1 /* |
|
2 * Copyright (c) 2010 Ixonos Plc. |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - Initial contribution |
|
11 * |
|
12 * Contributors: |
|
13 * Ixonos Plc |
|
14 * |
|
15 * Description: |
|
16 * Header file for epoclib.cpp. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef _EPOC_LIB |
|
22 #define _EPOC_LIB |
|
23 |
|
24 #include <e32base.h> |
|
25 #include <s32file.h> |
|
26 |
|
27 #ifdef _DEBUG |
|
28 #define MALLOC_DEBUG |
|
29 #endif |
|
30 |
|
31 #define EPOCLIB_DS |
|
32 |
|
33 //#define FILE RFile |
|
34 //#define void TAny |
|
35 |
|
36 //specific to this program |
|
37 //#define HANDLE void * |
|
38 |
|
39 typedef TUint8 Byte; |
|
40 typedef TUint8 u_char; |
|
41 typedef TInt8 int8; |
|
42 typedef TUint8 u_int8; |
|
43 typedef TInt16 int16; |
|
44 typedef TUint16 u_int16; |
|
45 typedef TInt32 int32; |
|
46 typedef TUint32 u_int32; |
|
47 typedef TReal32 float32; |
|
48 typedef TReal64 float64; |
|
49 |
|
50 |
|
51 typedef unsigned int size_t; |
|
52 |
|
53 |
|
54 #define max(a,b) (((a) > (b)) ? (a) : (b)) |
|
55 #define min(a,b) (((a) < (b)) ? (a) : (b)) |
|
56 |
|
57 #define abs Abs |
|
58 #define labs Abs |
|
59 |
|
60 |
|
61 EPOCLIB_DS void free(TAny *ptr); |
|
62 |
|
63 #ifdef MALLOC_DEBUG |
|
64 #define malloc(size) debugMalloc(size, __FILE__, __LINE__) |
|
65 EPOCLIB_DS TAny *debugMalloc(u_int32 size, char *file, int line); |
|
66 #else |
|
67 EPOCLIB_DS TAny *malloc(u_int32 size); |
|
68 #endif |
|
69 EPOCLIB_DS TAny *realloc(void *memblock, u_int32 size); |
|
70 #ifdef MALLOC_DEBUG |
|
71 #define calloc(num, size) debugCalloc(num, size, __FILE__, __LINE__) |
|
72 EPOCLIB_DS TAny *debugCalloc(u_int32 num, u_int32 size, char *file, int line); |
|
73 #else |
|
74 EPOCLIB_DS TAny *calloc(u_int32 num, u_int32 size); |
|
75 #endif |
|
76 EPOCLIB_DS TAny *memset(TAny *dest, TInt c, TInt size); |
|
77 EPOCLIB_DS TAny *memcpy(TAny *dest, const TAny *src, TInt size); |
|
78 EPOCLIB_DS TAny *memmove(TAny *dest, const TAny *src, u_int32 count); |
|
79 |
|
80 #define assert(expr) __ASSERT_DEBUG(expr, User::Panic(_L("assert"), 1)); |
|
81 EPOCLIB_DS int atoi(const char *nptr); |
|
82 |
|
83 |
|
84 EPOCLIB_DS u_int32 fwrite(const TAny *buffer, u_int32 size, u_int32 count, RFile stream); |
|
85 |
|
86 #endif |
|
87 |
|
88 |
|
89 |
|
90 // End of File |
|