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 #define OSSIZE_MAX OSNULLINDEX
00113
00118 typedef struct OSNumDateTime {
00119 OSINT32 year;
00120 OSUINT8 mon;
00121 OSUINT8 day;
00122 OSUINT8 hour;
00123 OSUINT8 min;
00124 OSREAL sec;
00125 OSBOOL tz_flag;
00126 OSINT32 tzo;
00127 } OSNumDateTime;
00128
00129
00130
00131 #if defined(_MSC_VER)
00132 #if _MSC_VER < 1300
00133
00134 #define OSSIZEFMT "%u"
00135 #else
00136
00137 #define OSSIZEFMT "%Iu"
00138 #endif
00139 #elif defined(__hpux) || defined(VMS) || defined(_VMS)
00140
00141 #define OSSIZEFMT "%u"
00142 #else
00143
00144 #define OSSIZEFMT "%zu"
00145 #endif
00146
00147
00148
00149 #ifndef OSINT64_
00150 #if !defined(_NO_INT64_SUPPORT)
00151 #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
00152 #define OSINT64_
00153 typedef __int64 OSINT64;
00154 typedef unsigned __int64 OSUINT64;
00155 #define OSINT64FMT "%I64d"
00156 #define OSUINT64FMT "%I64u"
00157 #define OSINT64FMTX "%I64x"
00158 #define OSINT64MAX _I64_MAX
00159 #define OSUINT64MAX _UI64_MAX
00160 #define OSINT64MIN _I64_MIN
00161 #define OSI64CONST(val) val##i64
00162 #define OSUI64CONST(val) val##ui64
00163
00164 #elif defined(INT64_MAX)
00165 #define OSINT64_
00166 typedef int64_t OSINT64;
00167 typedef uint64_t OSUINT64;
00168 #ifdef PRId64
00169
00170 #define OSINT64FMT "%" PRId64
00171 #define OSUINT64FMT "%" PRIu64
00172 #define OSINT64FMTX "%" PRIx64
00173 #else
00174 #define OSINT64FMT "%lld"
00175 #define OSUINT64FMT "%llu"
00176 #define OSINT64FMTX "%llx"
00177 #endif
00178 #define OSINT64MAX INT64_MAX
00179 #define OSUINT64MAX UINT64_MAX
00180 #define OSINT64MIN INT64_MIN
00181 #define OSI64CONST(val) INT64_C(val)
00182 #define OSUI64CONST(val) UINT64_C(val)
00183
00184 #else
00185 #define OSINT64_
00186 typedef long long OSINT64;
00187 typedef unsigned long long OSUINT64;
00188 #define OSINT64FMT "%lld"
00189 #define OSUINT64FMT "%llu"
00190 #define OSINT64FMTX "%llx"
00191 #define OSI64CONST(val) val##LL
00192 #define OSUI64CONST(val) val##ULL
00193
00194
00195 #ifdef LLONG_MAX
00196 #define OSINT64MAX LLONG_MAX
00197 #define OSUINT64MAX ULLONG_MAX
00198 #define OSINT64MIN LLONG_MIN
00199 #elif defined LONG_LONG_MAX
00200 #define OSINT64MAX LONG_LONG_MAX
00201 #define OSUINT64MAX ULONG_LONG_MAX
00202 #define OSINT64MIN LONG_LONG_MIN
00203 #elif defined __INT64_MAX
00204 #define OSINT64MAX __INT64_MAX
00205 #define OSUINT64MAX __UINT64_MAX
00206 #define OSINT64MIN __INT64_MIN
00207 #else
00208 #warning "Using LONG_MAX for 64-bit maximum."
00209 #define OSINT64MAX LONG_MAX
00210 #define OSUINT64MAX ULONG_MAX
00211 #define OSINT64MIN LONG_MIN
00212 #endif
00213
00214 #endif
00215 #endif
00216
00217 #ifndef OSINT64_
00218
00219 #define OSINT64_
00220 typedef long OSINT64;
00221 typedef unsigned long OSUINT64;
00222 #define OSINT64FMT "%ld"
00223 #define OSUINT64FMT "%lu"
00224 #define OSINT64FMTX "%lx"
00225 #define OSINT64MAX LONG_MAX
00226 #define OSUINT64MAX ULONG_MAX
00227 #define OSINT64MIN LONG_MIN
00228 #define OSI64CONST(val) val##L
00229 #define OSUI64CONST(val) val##UL
00230 #endif
00231
00232 #define OSU64NULLIDX OSUINT64MAX
00233
00234 #endif
00235
00243 typedef struct OSDynOctStr {
00244 OSUINT32 numocts;
00245 const OSOCTET* data;
00246 } OSDynOctStr;
00247
00248 typedef struct OSDynOctStr64 {
00249 OSSIZE numocts;
00250 OSOCTET* data;
00251 } OSDynOctStr64;
00252
00253 typedef OSDynOctStr OSOpenType;
00254 typedef OSDynOctStr64 OSOpenType64;
00255
00260 typedef enum { OSXSDAny_binary, OSXSDAny_xmlText } OSXSDAnyAlt;
00261 typedef struct OSXSDAny {
00262 OSXSDAnyAlt t;
00263 union {
00264 OSOpenType* binary;
00265 const OSUTF8CHAR* xmlText;
00266 } u;
00267 } OSXSDAny;
00268
00269
00270
00271 typedef struct OSUTF8NVP {
00272 const OSUTF8CHAR* name;
00273 const OSUTF8CHAR* value;
00274 } OSUTF8NVP;
00275
00276 typedef OSUTF8NVP OSAnyAttr;
00277 typedef OSUTF8NVP OSAnyElement;
00278
00279
00280
00287 typedef struct OSXMLSTRING {
00288 OSBOOL cdata;
00289 const OSUTF8CHAR* value;
00290 } OSXMLSTRING;
00291
00300 typedef OSNumDateTime OSXSDDateTime;
00301
00308 typedef struct OSBitMapItem {
00309 const OSUTF8CHAR* name;
00310 OSUINT16 bitno;
00311 OSUINT16 namelen;
00312 } OSBitMapItem;
00313
00323 typedef struct OSUTF8NameAndLen {
00324 const OSUTF8CHAR* name;
00325 OSSIZE len;
00326 } OSUTF8NameAndLen;
00327
00328
00329 typedef struct OSDecimalFmt {
00330 OSINT8 totalDigits;
00331 OSINT8 fractionDigits;
00332
00333 OSINT8 fractionMinDigits;
00334
00335
00336 OSINT8 integerMaxDigits;
00337
00338
00339 OSINT8 integerMinDigits;
00340
00341 OSBOOL signPresent;
00342
00343 OSBOOL pointPresent;
00344
00345 OSUINT8 nPatterns;
00346 const char* const* patterns;
00347
00348 } OSDecimalFmt;
00349
00350
00351
00352 typedef struct OSDoubleFmt {
00353 OSINT8 totalDigits;
00354 OSINT8 fractionDigits;
00355
00356 OSINT8 fractionMinDigits;
00357
00358
00359 OSINT8 integerMaxDigits;
00360
00361
00362 OSINT8 integerMinDigits;
00363
00364 OSINT8 expSymbol;
00365
00366 OSINT16 expMinValue;
00367 OSINT16 expMaxValue;
00368 OSINT8 expDigits;
00369
00370
00371 OSBOOL signPresent;
00372
00373 OSBOOL pointPresent;
00374
00375 OSBOOL expPresent;
00376
00377 OSBOOL expSignPresent;
00378
00379 } OSDoubleFmt;
00380
00381 #if defined(_MSC_VER)
00382
00383 #pragma warning(disable: 4100)
00384
00385 #pragma warning(disable: 4512)
00386 #endif
00387
00388 #endif