DSMCC  17.9.0
 All Data Structures Files Functions Typedefs
defMemUtilsContig.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2004 Ocean Blue Software Ltd
4  * Copyright © 2001 Koninklijke Philips Electronics N.V
5  *
6  * This file is part of a DTVKit Software Component
7  * You are permitted to copy, modify or distribute this file subject to the terms
8  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
9  *
10  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
11  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
12  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
13  *
14  * If you or your organisation is not a member of DTVKit then you have access
15  * to this source code outside of the terms of the licence agreement
16  * and you are expected to delete this and any associated files immediately.
17  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
18  *******************************************************************************/
25 /*---Includes for this header------------------------------------------------*/
26 #include <string.h>
27 #include "clDsmUtils.h"
28 
29 /*---Constant and macro definitions for public use-----------------------------*/
30 
31 /* -- SET STANDARD MACROS TO ACCESS CONTIGUOUS MEMORY */
32 
33 #undef MemPtr
34 #undef MemPos
35 #undef MEMPTR_SEQ_OPEN
36 #undef MEMPTR_SEQ_CLOSE
37 #undef MEMPTR_OPEN
38 #undef MEMPTR_CLOSE
39 #undef MEMPTR_GET_DIFF
40 #undef MEMPTR_DATA_COMPARE
41 #undef MEMPTR_READ
42 #undef MEMPTR_WRITE
43 #undef MEMPTR_COPY
44 #undef SET_POS_REL
45 #undef SET_POS_ABS
46 #undef GET_POS
47 #undef READ_UINT8
48 #undef READ_UINT16
49 #undef READ_UINT32
50 #undef GET_UINT8
51 #undef GET_UINT16
52 #undef GET_UINT32
53 #undef READ_OBJECT_KEY
54 
55 
56 #define MemPtr PU8BIT
57 #define MemPos PU8BIT
58 
59 #define MEMPTR_SEQ_OPEN( context, memArea, offset, length, async, memPtr ) \
60  memPtr = memArea; \
61  memPtr += offset
62 
63 #define MEMPTR_SEQ_CLOSE( context, memArea, memPtr )
64 
65 #define MEMPTR_OPEN( seqMemPtr, memPtr ) \
66  memPtr = seqMemPtr
67 
68 #define MEMPTR_CLOSE( memPtr )
69 
70 #define MEMPTR_GET_DIFF( memPtr1, memPtr2, i32 ) \
71  i32 = (memPtr2 - memPtr1)
72 
73 #define MEMPTR_DATA_COMPARE( ui8Ptr, memPtr, length, equal ) \
74  equal = ((memcmp( ui8Ptr, memPtr, length ) != 0) ? FALSE : TRUE)
75 
76 #define MEMPTR_READ( srcMemPtr, destUi8Ptr, numbytes ) \
77  memcpy( destUi8Ptr, srcMemPtr, numbytes )
78 
79 #define MEMPTR_WRITE( srcUi8Ptr, destMemPtr, numbytes ) \
80  memcpy( destMemPtr, srcUi8Ptr, numbytes )
81 
82 #define MEMPTR_COPY( srcMemPtr, destMemPtr, numbytes ) \
83  memcpy( destMemPtr, srcMemPtr, numbytes )
84 
85 #define SET_POS_REL( memPtr, offset ) (memPtr += offset)
86 #define SET_POS_ABS( memPtr, memPos ) (memPtr = memPos)
87 #define GET_POS( memPtr, memPos ) (memPos = memPtr)
88 
89 #define READ_UINT8( memPtr, ui8 ) READ_UINT8_C( memPtr, ui8 )
90 #define READ_UINT16( memPtr, ui16 ) READ_UINT16_C( memPtr, ui16 )
91 #define READ_UINT24( memPtr, ui32 ) READ_UINT24_C( memPtr, ui32 )
92 #define READ_UINT32( memPtr, ui32 ) READ_UINT32_C( memPtr, ui32 )
93 #define GET_UINT8( memPtr, ui8 ) GET_UINT8_C( memPtr, ui8 )
94 #define GET_UINT16( memPtr, ui16 ) GET_UINT16_C( memPtr, ui16 )
95 #define GET_UINT32( memPtr, ui32 ) GET_UINT32_C( memPtr, ui32 )
96 
97 #define READ_OBJECT_KEY( memPtr, objKey, valid ) \
98  READ_OBJECT_KEY_C( memPtr, objKey, valid )
99 
100 
101 /*----------------------------------------------------------------------------*/
102 
eader to the clDsmUtils module.