DSMCC
15.3.1
|
00001 /******************************************************************************* 00002 * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org) 00003 * Copyright © 2004 Ocean Blue Software Ltd 00004 * Copyright © 2001 Koninklijke Philips Electronics N.V 00005 * 00006 * This file is part of a DTVKit Software Component 00007 * You are permitted to copy, modify or distribute this file subject to the terms 00008 * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org 00009 * 00010 * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, 00011 * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES 00012 * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. 00013 * 00014 * If you or your organisation is not a member of DTVKit then you have access 00015 * to this source code outside of the terms of the licence agreement 00016 * and you are expected to delete this and any associated files immediately. 00017 * Further information on DTVKit, membership and terms can be found at www.dtvkit.org 00018 *******************************************************************************/ 00025 /*---Includes for this header------------------------------------------------*/ 00026 #include <string.h> 00027 #include "clDsmUtils.h" 00028 00029 /*---Constant and macro definitions for public use-----------------------------*/ 00030 00031 /* -- SET STANDARD MACROS TO ACCESS CONTIGUOUS MEMORY */ 00032 00033 #undef MemPtr 00034 #undef MemPos 00035 #undef MEMPTR_SEQ_OPEN 00036 #undef MEMPTR_SEQ_CLOSE 00037 #undef MEMPTR_OPEN 00038 #undef MEMPTR_CLOSE 00039 #undef MEMPTR_GET_DIFF 00040 #undef MEMPTR_DATA_COMPARE 00041 #undef MEMPTR_READ 00042 #undef MEMPTR_WRITE 00043 #undef MEMPTR_COPY 00044 #undef SET_POS_REL 00045 #undef SET_POS_ABS 00046 #undef GET_POS 00047 #undef READ_UINT8 00048 #undef READ_UINT16 00049 #undef READ_UINT32 00050 #undef GET_UINT8 00051 #undef GET_UINT16 00052 #undef GET_UINT32 00053 #undef READ_OBJECT_KEY 00054 00055 00056 #define MemPtr pU8BIT 00057 #define MemPos pU8BIT 00058 00059 #define MEMPTR_SEQ_OPEN( context, memArea, offset, length, async, memPtr ) \ 00060 memOpen( context, memArea, (void**) &memPtr ); \ 00061 memPtr += offset 00062 00063 #define MEMPTR_SEQ_CLOSE( context, memArea, memPtr ) 00064 00065 #define MEMPTR_OPEN( seqMemPtr, memPtr ) \ 00066 memPtr = seqMemPtr 00067 00068 #define MEMPTR_CLOSE( memPtr ) 00069 00070 #define MEMPTR_GET_DIFF( memPtr1, memPtr2, i32 ) \ 00071 i32 = (memPtr2 - memPtr1) 00072 00073 #define MEMPTR_DATA_COMPARE( ui8Ptr, memPtr, length, equal )\ 00074 equal = ((memcmp( ui8Ptr, memPtr, length ) != 0) ? FALSE:TRUE) 00075 00076 #define MEMPTR_READ( srcMemPtr, destUi8Ptr, numbytes ) \ 00077 memcpy( destUi8Ptr, srcMemPtr, numbytes ) 00078 00079 #define MEMPTR_WRITE( srcUi8Ptr, destMemPtr, numbytes ) \ 00080 memcpy( destMemPtr, srcUi8Ptr, numbytes ) 00081 00082 #define MEMPTR_COPY( srcMemPtr, destMemPtr, numbytes ) \ 00083 memcpy( destMemPtr, srcMemPtr, numbytes ) 00084 00085 #define SET_POS_REL( memPtr, offset ) (memPtr += offset) 00086 #define SET_POS_ABS( memPtr, memPos ) (memPtr = memPos) 00087 #define GET_POS( memPtr, memPos ) (memPos = memPtr) 00088 00089 #define READ_UINT8( memPtr, ui8 ) READ_UINT8_C( memPtr, ui8 ) 00090 #define READ_UINT16( memPtr, ui16 ) READ_UINT16_C( memPtr, ui16 ) 00091 #define READ_UINT32( memPtr, ui32 ) READ_UINT32_C( memPtr, ui32 ) 00092 #define GET_UINT8( memPtr, ui8 ) GET_UINT8_C( memPtr, ui8 ) 00093 #define GET_UINT16( memPtr,ui16 ) GET_UINT16_C( memPtr, ui16 ) 00094 #define GET_UINT32( memPtr, ui32 ) GET_UINT32_C( memPtr, ui32 ) 00095 00096 #define READ_OBJECT_KEY( memPtr, objKey, valid ) \ 00097 READ_OBJECT_KEY_C( memPtr, objKey, valid ) 00098 00099 00100 /*----------------------------------------------------------------------------*/ 00101