00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _OSSYSTYPES_H_
00026 #define _OSSYSTYPES_H_
00027
00028
00029 #ifndef __STDC_LIMIT_MACROS
00030 #define __STDC_LIMIT_MACROS
00031 #endif
00032 #ifndef __STDC_CONSTANT_MACROS
00033 #define __STDC_CONSTANT_MACROS
00034 #endif
00035
00036 #if (!defined(BREW_MODULE) && !defined(FLAT_BREW))
00037 #include <stdlib.h>
00038 #else
00039
00040
00041 #endif
00042
00043 #if !defined(_MSC_VER) && !defined(__BORLANDC__) && !defined(__WATCOMC__) \
00044 && !defined(__vxworks) && !defined(__SYMBIAN32__)
00045 #include <inttypes.h>
00046 #endif
00047
00048 #include <limits.h>
00049
00050 #include <float.h>
00051
00052 #ifndef FALSE
00053 #define FALSE 0
00054 #define TRUE 1
00055 #endif
00056
00057 #define NumberOf(x) (sizeof(x)/sizeof(x[0]))
00058
00059 typedef void OSVoid;
00060 typedef void* OSVoidPtr;
00061 typedef unsigned char OSBOOL;
00062 typedef signed char OSINT8;
00063 typedef unsigned char OSUINT8;
00064 typedef short OSINT16;
00065 typedef unsigned short OSUINT16;
00066 typedef OSUINT8 OSOCTET;
00067 typedef OSUINT8 OSUTF8CHAR;
00068 typedef OSUINT16 OSUNICHAR;
00069 typedef double OSREAL;
00070 typedef double OSDOUBLE;
00071 typedef float OSFLOAT;
00072 #ifdef _16BIT
00073 typedef long OSINT32;
00074 typedef unsigned long OSUINT32;
00075 #define OSINTCONST(val) val##L
00076 #define OSUINTCONST(val) val##UL
00077 #else
00078 typedef int OSINT32;
00079 typedef unsigned int OSUINT32;
00080 #define OSINTCONST(val) val
00081 #define OSUINTCONST(val) val##u
00082 #endif
00083 typedef OSUINT32 OS32BITCHAR;
00084
00085 #define OSUINT32_MAX ((OSUINT32)4294967295UL)
00086 #define OSINT32_MAX ((OSINT32)2147483647L)
00087 #define OSINT32_MIN ((OSINT32)(-OSINT32_MAX-1))
00088
00089 #define OSUINT16_MAX ((OSUINT16)65535UL)
00090 #define OSINT16_MAX ((OSINT16)32767L)
00091 #define OSINT16_MIN ((OSINT16)(-OSINT16_MAX-1))
00092
00093 #define OSUINT8_MAX ((OSUINT8)255U)
00094 #define OSINT8_MAX ((OSINT8)127L)
00095 #define OSINT8_MIN ((OSINT8)(-OSINT8_MAX-1))
00096
00097 #define OSREALMAX ((OSREAL)DBL_MAX)
00098 #define OSREALMIN ((OSREAL)-DBL_MAX)
00099
00100 #define OSU32NULLIDX OSUINT32_MAX
00101 #define OSNULLINDEX ((size_t)-1)
00102
00107 typedef struct OSNumDateTime {
00108 OSINT32 year;
00109 OSUINT8 mon;
00110 OSUINT8 day;
00111 OSUINT8 hour;
00112 OSUINT8 min;
00113 OSREAL sec;
00114 OSBOOL tz_flag;
00115 OSINT32 tzo;
00116 } OSNumDateTime;
00117
00118
00119
00120 #ifndef OSINT64_
00121 #if !defined(_NO_INT64_SUPPORT)
00122 #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
00123 #define OSINT64_
00124 typedef __int64 OSINT64;
00125 typedef unsigned __int64 OSUINT64;
00126 #define OSINT64FMT "%I64d"
00127 #define OSUINT64FMT "%I64u"
00128 #define OSINT64FMTX "%I64x"
00129 #define OSINT64MAX _I64_MAX
00130 #define OSUINT64MAX _UI64_MAX
00131 #define OSINT64MIN _I64_MIN
00132 #define OSI64CONST(val) val##i64
00133 #define OSUI64CONST(val) val##ui64
00134
00135 #elif defined(INT64_MAX)
00136 #define OSINT64_
00137 typedef int64_t OSINT64;
00138 typedef uint64_t OSUINT64;
00139 #ifdef PRId64
00140 #define OSINT64FMT "%"PRId64
00141 #define OSUINT64FMT "%"PRIu64
00142 #define OSINT64FMTX "%"PRIx64
00143 #else
00144 #define OSINT64FMT "%lld"
00145 #define OSUINT64FMT "%llu"
00146 #define OSINT64FMTX "%llx"
00147 #endif
00148 #define OSINT64MAX INT64_MAX
00149 #define OSUINT64MAX UINT64_MAX
00150 #define OSINT64MIN INT64_MIN
00151 #define OSI64CONST(val) INT64_C(val)
00152 #define OSUI64CONST(val) UINT64_C(val)
00153
00154 #else
00155 #warning "Using long long for 64-bit integers."
00156 #define OSINT64_
00157 typedef long long OSINT64;
00158 typedef unsigned long long OSUINT64;
00159 #define OSINT64FMT "%lld"
00160 #define OSUINT64FMT "%llu"
00161 #define OSINT64FMTX "%llx"
00162 #define OSI64CONST(val) val##LL
00163 #define OSUI64CONST(val) val##ULL
00164
00165
00166 #ifdef LLONG_MAX
00167 #define OSINT64MAX LLONG_MAX
00168 #define OSUINT64MAX ULLONG_MAX
00169 #define OSINT64MIN LLONG_MIN
00170 #else
00171 #warning "Using LONG_MAX for 64-bit maximum."
00172 #define OSINT64MAX LONG_MAX
00173 #define OSUINT64MAX ULONG_MAX
00174 #define OSINT64MIN LONG_MIN
00175 #endif
00176
00177 #endif
00178 #endif
00179
00180 #ifndef OSINT64_
00181
00182 #define OSINT64_
00183 typedef long OSINT64;
00184 typedef unsigned long OSUINT64;
00185 #define OSINT64FMT "%ld"
00186 #define OSUINT64FMT "%lu"
00187 #define OSINT64FMTX "%lx"
00188 #define OSINT64MAX LONG_MAX
00189 #define OSUINT64MAX ULONG_MAX
00190 #define OSINT64MIN LONG_MIN
00191 #define OSI64CONST(val) val##L
00192 #define OSUI64CONST(val) val##UL
00193 #endif
00194
00195 #define OSU64NULLIDX OSUINT64MAX
00196
00197 #endif
00198
00206 typedef struct OSDynOctStr {
00207 OSUINT32 numocts;
00208 const OSOCTET* data;
00209 } OSDynOctStr;
00210
00211 typedef OSDynOctStr OSOpenType;
00212
00217 typedef enum { OSXSDAny_binary, OSXSDAny_xmlText } OSXSDAnyAlt;
00218 typedef struct OSXSDAny {
00219 OSXSDAnyAlt t;
00220 union {
00221 OSOpenType* binary;
00222 const OSUTF8CHAR* xmlText;
00223 } u;
00224 } OSXSDAny;
00225
00226
00227
00228 typedef struct OSUTF8NVP {
00229 const OSUTF8CHAR* name;
00230 const OSUTF8CHAR* value;
00231 } OSUTF8NVP;
00232
00233 typedef OSUTF8NVP OSAnyAttr;
00234 typedef OSUTF8NVP OSAnyElement;
00235
00236
00237
00244 typedef struct OSXMLSTRING {
00245 OSBOOL cdata;
00246 const OSUTF8CHAR* value;
00247 } OSXMLSTRING;
00248
00257 typedef OSNumDateTime OSXSDDateTime;
00258
00265 typedef struct OSBitMapItem {
00266 const OSUTF8CHAR* name;
00267 OSUINT16 bitno;
00268 OSUINT16 namelen;
00269 } OSBitMapItem;
00270
00271 #endif