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 #ifndef __STDC_FORMAT_MACROS
00036 #define __STDC_FORMAT_MACROS
00037 #endif
00038
00039 #if (!defined(BREW_MODULE) && !defined(FLAT_BREW))
00040 #include <stdlib.h>
00041 #else
00042
00043
00044 #endif
00045
00046 #if !defined(_MSC_VER) && !defined(__BORLANDC__) && !defined(__WATCOMC__) \
00047 && !defined(__vxworks) && !defined(__SYMBIAN32__) && !defined(NIOS2)
00048 #include <inttypes.h>
00049 #endif
00050
00051 #include <limits.h>
00052
00053 #include <float.h>
00054
00055 #ifndef FALSE
00056 #define FALSE 0
00057 #define TRUE 1
00058 #endif
00059
00060 #define NumberOf(x) (sizeof(x)/sizeof(x[0]))
00061
00062
00063
00064
00065
00066 #define OSVOIDARG void
00067
00068 typedef void OSVoid;
00069 typedef void* OSVoidPtr;
00070 typedef unsigned char OSBOOL;
00071 typedef signed char OSINT8;
00072 typedef unsigned char OSUINT8;
00073 typedef short OSINT16;
00074 typedef unsigned short OSUINT16;
00075 typedef OSUINT8 OSOCTET;
00076 typedef OSUINT8 OSUTF8CHAR;
00077 typedef OSUINT16 OSUNICHAR;
00078 typedef double OSREAL;
00079 typedef double OSDOUBLE;
00080 typedef float OSFLOAT;
00081 #ifdef _16BIT
00082 typedef long OSINT32;
00083 typedef unsigned long OSUINT32;
00084 #define OSINTCONST(val) val##L
00085 #define OSUINTCONST(val) val##UL
00086 #else
00087 typedef int OSINT32;
00088 typedef unsigned int OSUINT32;
00089 #define OSINTCONST(val) val
00090 #define OSUINTCONST(val) val##u
00091 #endif
00092 typedef OSUINT32 OS32BITCHAR;
00093 typedef size_t OSSIZE;
00094
00095 #define OSUINT32_MAX ((OSUINT32)4294967295UL)
00096 #define OSINT32_MAX ((OSINT32)2147483647L)
00097 #define OSINT32_MIN ((OSINT32)(-OSINT32_MAX-1))
00098
00099 #define OSUINT16_MAX ((OSUINT16)65535UL)
00100 #define OSINT16_MAX ((OSINT16)32767L)
00101 #define OSINT16_MIN ((OSINT16)(-OSINT16_MAX-1))
00102
00103 #define OSUINT8_MAX ((OSUINT8)255U)
00104 #define OSINT8_MAX ((OSINT8)127L)
00105 #define OSINT8_MIN ((OSINT8)(-OSINT8_MAX-1))
00106
00107 #define OSREALMAX ((OSREAL)DBL_MAX)
00108 #define OSREALMIN ((OSREAL)-DBL_MAX)
00109
00110 #define OSU32NULLIDX OSUINT32_MAX
00111 #define OSNULLINDEX ((OSSIZE)-1)
00112
00117 typedef struct OSNumDateTime {
00118 OSINT32 year;
00119 OSUINT8 mon;
00120 OSUINT8 day;
00121 OSUINT8 hour;
00122 OSUINT8 min;
00123 OSREAL sec;
00124 OSBOOL tz_flag;
00125 OSINT32 tzo;
00126 } OSNumDateTime;
00127
00128
00129
00130 #if defined(_MSC_VER)
00131 #if _MSC_VER < 1300
00132
00133 #define OSSIZEFMT "%u"
00134 #else
00135
00136 #define OSSIZEFMT "%Iu"
00137 #endif
00138 #elif defined(__hpux) || defined(VMS) || defined(_VMS)
00139
00140 #define OSSIZEFMT "%u"
00141 #else
00142
00143 #define OSSIZEFMT "%zu"
00144 #endif
00145
00146
00147
00148 #ifndef OSINT64_
00149 #if !defined(_NO_INT64_SUPPORT)
00150 #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
00151 #define OSINT64_
00152 typedef __int64 OSINT64;
00153 typedef unsigned __int64 OSUINT64;
00154 #define OSINT64FMT "%I64d"
00155 #define OSUINT64FMT "%I64u"
00156 #define OSINT64FMTX "%I64x"
00157 #define OSINT64MAX _I64_MAX
00158 #define OSUINT64MAX _UI64_MAX
00159 #define OSINT64MIN _I64_MIN
00160 #define OSI64CONST(val) val##i64
00161 #define OSUI64CONST(val) val##ui64
00162
00163 #elif defined(INT64_MAX)
00164 #define OSINT64_
00165 typedef int64_t OSINT64;
00166 typedef uint64_t OSUINT64;
00167 #ifdef PRId64
00168
00169 #define OSINT64FMT "%" PRId64
00170 #define OSUINT64FMT "%" PRIu64
00171 #define OSINT64FMTX "%" PRIx64
00172 #else
00173 #define OSINT64FMT "%lld"
00174 #define OSUINT64FMT "%llu"
00175 #define OSINT64FMTX "%llx"
00176 #endif
00177 #define OSINT64MAX INT64_MAX
00178 #define OSUINT64MAX UINT64_MAX
00179 #define OSINT64MIN INT64_MIN
00180 #define OSI64CONST(val) INT64_C(val)
00181 #define OSUI64CONST(val) UINT64_C(val)
00182
00183 #else
00184 #define OSINT64_
00185 typedef long long OSINT64;
00186 typedef unsigned long long OSUINT64;
00187 #define OSINT64FMT "%lld"
00188 #define OSUINT64FMT "%llu"
00189 #define OSINT64FMTX "%llx"
00190 #define OSI64CONST(val) val##LL
00191 #define OSUI64CONST(val) val##ULL
00192
00193
00194 #ifdef LLONG_MAX
00195 #define OSINT64MAX LLONG_MAX
00196 #define OSUINT64MAX ULLONG_MAX
00197 #define OSINT64MIN LLONG_MIN
00198 #elif defined LONG_LONG_MAX
00199 #define OSINT64MAX LONG_LONG_MAX
00200 #define OSUINT64MAX ULONG_LONG_MAX
00201 #define OSINT64MIN LONG_LONG_MIN
00202 #elif defined __INT64_MAX
00203 #define OSINT64MAX __INT64_MAX
00204 #define OSUINT64MAX __UINT64_MAX
00205 #define OSINT64MIN __INT64_MIN
00206 #else
00207 #warning "Using LONG_MAX for 64-bit maximum."
00208 #define OSINT64MAX LONG_MAX
00209 #define OSUINT64MAX ULONG_MAX
00210 #define OSINT64MIN LONG_MIN
00211 #endif
00212
00213 #endif
00214 #endif
00215
00216 #ifndef OSINT64_
00217
00218 #define OSINT64_
00219 typedef long OSINT64;
00220 typedef unsigned long OSUINT64;
00221 #define OSINT64FMT "%ld"
00222 #define OSUINT64FMT "%lu"
00223 #define OSINT64FMTX "%lx"
00224 #define OSINT64MAX LONG_MAX
00225 #define OSUINT64MAX ULONG_MAX
00226 #define OSINT64MIN LONG_MIN
00227 #define OSI64CONST(val) val##L
00228 #define OSUI64CONST(val) val##UL
00229 #endif
00230
00231 #define OSU64NULLIDX OSUINT64MAX
00232
00233 #endif
00234
00242 typedef struct OSDynOctStr {
00243 OSUINT32 numocts;
00244 const OSOCTET* data;
00245 } OSDynOctStr;
00246
00247 typedef OSDynOctStr OSOpenType;
00248
00253 typedef enum { OSXSDAny_binary, OSXSDAny_xmlText } OSXSDAnyAlt;
00254 typedef struct OSXSDAny {
00255 OSXSDAnyAlt t;
00256 union {
00257 OSOpenType* binary;
00258 const OSUTF8CHAR* xmlText;
00259 } u;
00260 } OSXSDAny;
00261
00262
00263
00264 typedef struct OSUTF8NVP {
00265 const OSUTF8CHAR* name;
00266 const OSUTF8CHAR* value;
00267 } OSUTF8NVP;
00268
00269 typedef OSUTF8NVP OSAnyAttr;
00270 typedef OSUTF8NVP OSAnyElement;
00271
00272
00273
00280 typedef struct OSXMLSTRING {
00281 OSBOOL cdata;
00282 const OSUTF8CHAR* value;
00283 } OSXMLSTRING;
00284
00293 typedef OSNumDateTime OSXSDDateTime;
00294
00301 typedef struct OSBitMapItem {
00302 const OSUTF8CHAR* name;
00303 OSUINT16 bitno;
00304 OSUINT16 namelen;
00305 } OSBitMapItem;
00306
00316 typedef struct OSUTF8NameAndLen {
00317 const OSUTF8CHAR* name;
00318 OSSIZE len;
00319 } OSUTF8NameAndLen;
00320
00321
00322 typedef struct OSDecimalFmt {
00323 OSINT8 totalDigits;
00324 OSINT8 fractionDigits;
00325
00326 OSINT8 fractionMinDigits;
00327
00328
00329 OSINT8 integerMaxDigits;
00330
00331
00332 OSINT8 integerMinDigits;
00333
00334 OSBOOL signPresent;
00335
00336 OSBOOL pointPresent;
00337
00338 OSUINT8 nPatterns;
00339 const char* const* patterns;
00340
00341 } OSDecimalFmt;
00342
00343
00344
00345 typedef struct OSDoubleFmt {
00346 OSINT8 totalDigits;
00347 OSINT8 fractionDigits;
00348
00349 OSINT8 fractionMinDigits;
00350
00351
00352 OSINT8 integerMaxDigits;
00353
00354
00355 OSINT8 integerMinDigits;
00356
00357 OSINT8 expSymbol;
00358
00359 OSINT16 expMinValue;
00360 OSINT16 expMaxValue;
00361 OSINT8 expDigits;
00362
00363
00364 OSBOOL signPresent;
00365
00366 OSBOOL pointPresent;
00367
00368 OSBOOL expPresent;
00369
00370 OSBOOL expSignPresent;
00371
00372 } OSDoubleFmt;
00373
00374 #if defined(_MSC_VER)
00375
00376 #pragma warning(disable: 4100)
00377
00378 #pragma warning(disable: 4512)
00379 #endif
00380
00381 #endif