1 /*_______________________________ epson-escpr-mem.h ________________________________*/
\r
3 /* 1 2 3 4 5 6 7 8 */
\r
4 /*34567890123456789012345678901234567890123456789012345678901234567890123456789012345678*/
\r
5 /*******************************************|********************************************/
\r
7 * Copyright (c) 2009 Seiko Epson Corporation All rights reserved.
\r
9 * Copyright protection claimed includes all forms and matters of
\r
10 * copyrightable material and information now allowed by statutory or judicial
\r
11 * law or hereinafter granted, including without limitation, material generated
\r
12 * from the software programs which are displayed on the screen such as icons,
\r
13 * screen display looks, etc.
\r
16 /*******************************************|********************************************/
\r
18 /* Epson memory Module Definitions */
\r
20 /*******************************************|********************************************/
\r
21 #ifndef _EPSON_ESPCR_MEM_H_
\r
22 #define _EPSON_ESPCR_MEM_H_
\r
25 #endif /* def __cplusplus */
\r
28 /*------------------------------- Global Compiler Switch -------------------------------*/
\r
29 /*******************************************|********************************************/
\r
31 /*------------------------------------ Includes -------------------------------------*/
\r
32 /*******************************************|********************************************/
\r
33 #include "epson-typedefs.h"
\r
34 #include "epson-escpr-pvt.h"
\r
37 /*------------------------------ Import Debug utility -------------------------------*/
\r
38 /*******************************************|********************************************/
\r
40 #include "epson-escpr-dbg.h"
\r
42 /* Redefine Debug macros */
\r
43 #define EPS_ALLOC( s ) epsCmnFnc.memAlloc((EPS_UINT32)s)
\r
44 #define EPS_FREE( p ) epsCmnFnc.memFree( p )
\r
45 #define EPS_RETURN(e) return e;
\r
46 #define EPS_RETURN_VOID return;
\r
48 #define EPS_MEM_INIT
\r
49 #define EPS_MEM_RESET_PEAK
\r
50 #define EPS_MEM_REPORT_PEAK
\r
51 #define EPS_MEM_GET_PEAK (0)
\r
52 #define EPS_MEM_REPORT_LEAK
\r
54 #define EPS_DBGPRINT( f )
\r
55 #define EPS_DUMP( p, s )
\r
56 #define EPS_DUMP_STR( str )
\r
58 #define EPS_LOG_INITIALIZE(f, m)
\r
59 #define EPS_LOG_TREMINATE
\r
60 #define EPS_LOG_FUNCIN
\r
61 #define EPS_LOG_FUNCOUT(e)
\r
63 #define DECRALE_DMP_FILE
\r
64 #define EPS_DF_OPEN( fn )
\r
65 #define EPS_DF_CLOSE
\r
66 #define EPS_DF_WRITE( p, s )
\r
69 /*---------------------------------- Generic Macros ---------------------------------*/
\r
70 /*******************************************|********************************************/
\r
72 #define EPS_SAFE_RELEASE( p ) \
\r
78 /*---------------------------------- CPU Endian-ness -----------------------------------*/
\r
79 /*******************************************|********************************************/
\r
80 typedef enum _EPS_ENDIAN {
\r
81 EPS_ENDIAN_NOT_TESTED = 1000,
\r
86 typedef enum _EPS_BYTE_SIZE {
\r
92 #define EPS_SWP_ORDER16(data) (EPS_INT16)((((data) >> 8) & 0x00FF )|(((data) << 8) & 0xFF00 ) )
\r
93 #define EPS_SWP_ORDER32(data) (EPS_INT32)((((data) >> 24) & 0x000000FF)|(((data) >> 8) & 0x0000FF00) | \
\r
94 (((data) << 8) & 0x00FF0000)|(((data) << 24) & 0xFF000000) )
\r
97 /*----------------------------------- Definitions ------------------------------------*/
\r
98 /*******************************************|********************************************/
\r
100 /*** -------------------------------------------------------------------------------*/
\r
101 #define Max(a,b) ( ((a) > (b)) ? (a) : (b))
\r
102 #define Min(a,b) ( ((a) < (b)) ? (a) : (b))
\r
104 /*** memcpy macro for readability */
\r
105 /*** -------------------------------------------------------------------------------*/
\r
106 #define COPY_BYTES(des,src,size) memcpy(des,src,size); des+=size;
\r
109 /*-------------------------- Public Function Declarations ---------------------------*/
\r
110 /*******************************************|********************************************/
\r
111 extern void* memRealloc (void*, EPS_UINT32, EPS_UINT32 );
\r
113 extern EPS_INT8* memStrStr (EPS_INT8*, const EPS_INT8*, EPS_BOOL );
\r
114 extern EPS_INT8* memStrStrWithLen (EPS_INT8*, EPS_UINT32, const EPS_INT8* );
\r
116 extern void memSetEndian (EPS_ENDIAN, EPS_BYTE_SIZE, EPS_UINT32, EPS_UINT8*);
\r
117 extern void memInspectEndian (void );
\r
118 extern EPS_INT32 memGetBitCount (EPS_INT32 );
\r
119 extern EPS_UINT8 memSearchWhiteColorVal(EPS_UINT8, EPS_UINT8*, EPS_UINT16 );
\r
121 #define EPS_MEM_GROW(t, p, pCurSize, nNewSize) \
\r
122 /*EPS_DBGPRINT(("GROW %d->%d\n", *pCurSize, (nNewSize)))*/ \
\r
123 if(*pCurSize < (nNewSize)){ \
\r
124 p = (t)memRealloc(p, *pCurSize, (nNewSize)); \
\r
125 *pCurSize = (nNewSize); \
\r
130 #endif /* def __cplusplus */
\r
132 #endif /* def _EPSON_ESPCR_MEM_H_ */
\r
134 /*_______________________________ epson-escpr-mem.h ________________________________*/
\r
136 /*34567890123456789012345678901234567890123456789012345678901234567890123456789012345678*/
\r
137 /* 1 2 3 4 5 6 7 8 */
\r
138 /*******************************************|********************************************/
\r
139 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%|%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
\r
140 /***** End of File *** End of File *** End of File *** End of File *** End of File ******/
\r
141 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%|%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
\r