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 typedef void OSVoid;
00063 typedef void* OSVoidPtr;
00064 typedef unsigned char OSBOOL;
00065 typedef signed char OSINT8;
00066 typedef unsigned char OSUINT8;
00067 typedef short OSINT16;
00068 typedef unsigned short OSUINT16;
00069 typedef OSUINT8 OSOCTET;
00070 typedef OSUINT8 OSUTF8CHAR;
00071 typedef OSUINT16 OSUNICHAR;
00072 typedef double OSREAL;
00073 typedef double OSDOUBLE;
00074 typedef float OSFLOAT;
00075 #ifdef _16BIT
00076 typedef long OSINT32;
00077 typedef unsigned long OSUINT32;
00078 #define OSINTCONST(val) val##L
00079 #define OSUINTCONST(val) val##UL
00080 #else
00081 typedef int OSINT32;
00082 typedef unsigned int OSUINT32;
00083 #define OSINTCONST(val) val
00084 #define OSUINTCONST(val) val##u
00085 #endif
00086 typedef OSUINT32 OS32BITCHAR;
00087 typedef size_t OSSIZE;
00088
00089 #define OSUINT32_MAX ((OSUINT32)4294967295UL)
00090 #define OSINT32_MAX ((OSINT32)2147483647L)
00091 #define OSINT32_MIN ((OSINT32)(-OSINT32_MAX-1))
00092
00093 #define OSUINT16_MAX ((OSUINT16)65535UL)
00094 #define OSINT16_MAX ((OSINT16)32767L)
00095 #define OSINT16_MIN ((OSINT16)(-OSINT16_MAX-1))
00096
00097 #define OSUINT8_MAX ((OSUINT8)255U)
00098 #define OSINT8_MAX ((OSINT8)127L)
00099 #define OSINT8_MIN ((OSINT8)(-OSINT8_MAX-1))
00100
00101 #define OSREALMAX ((OSREAL)DBL_MAX)
00102 #define OSREALMIN ((OSREAL)-DBL_MAX)
00103
00104 #define OSU32NULLIDX OSUINT32_MAX
00105 #define OSNULLINDEX ((OSSIZE)-1)
00106
00111 typedef struct OSNumDateTime {
00112 OSINT32 year;
00113 OSUINT8 mon;
00114 OSUINT8 day;
00115 OSUINT8 hour;
00116 OSUINT8 min;
00117 OSREAL sec;
00118 OSBOOL tz_flag;
00119 OSINT32 tzo;
00120 } OSNumDateTime;
00121
00122
00123
00124 #ifndef OSINT64_
00125 #if !defined(_NO_INT64_SUPPORT)
00126 #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
00127 #define OSINT64_
00128 typedef __int64 OSINT64;
00129 typedef unsigned __int64 OSUINT64;
00130 #define OSINT64FMT "%I64d"
00131 #define OSUINT64FMT "%I64u"
00132 #define OSINT64FMTX "%I64x"
00133 #define OSINT64MAX _I64_MAX
00134 #define OSUINT64MAX _UI64_MAX
00135 #define OSINT64MIN _I64_MIN
00136 #define OSI64CONST(val) val##i64
00137 #define OSUI64CONST(val) val##ui64
00138
00139 #elif defined(INT64_MAX)
00140 #define OSINT64_
00141 typedef int64_t OSINT64;
00142 typedef uint64_t OSUINT64;
00143 #ifdef PRId64
00144 #define OSINT64FMT "%"PRId64
00145 #define OSUINT64FMT "%"PRIu64
00146 #define OSINT64FMTX "%"PRIx64
00147 #else
00148 #define OSINT64FMT "%lld"
00149 #define OSUINT64FMT "%llu"
00150 #define OSINT64FMTX "%llx"
00151 #endif
00152 #define OSINT64MAX INT64_MAX
00153 #define OSUINT64MAX UINT64_MAX
00154 #define OSINT64MIN INT64_MIN
00155 #define OSI64CONST(val) INT64_C(val)
00156 #define OSUI64CONST(val) UINT64_C(val)
00157
00158 #else
00159 #ifdef __GNUC__ // warning is a GNU compiler extension
00160 #warning "Using long long for 64-bit integers."
00161 #endif
00162 #define OSINT64_
00163 typedef long long OSINT64;
00164 typedef unsigned long long OSUINT64;
00165 #define OSINT64FMT "%lld"
00166 #define OSUINT64FMT "%llu"
00167 #define OSINT64FMTX "%llx"
00168 #define OSI64CONST(val) val##LL
00169 #define OSUI64CONST(val) val##ULL
00170
00171
00172 #ifdef LLONG_MAX
00173 #define OSINT64MAX LLONG_MAX
00174 #define OSUINT64MAX ULLONG_MAX
00175 #define OSINT64MIN LLONG_MIN
00176 #elif defined LONG_LONG_MAX
00177 #define OSINT64MAX LONG_LONG_MAX
00178 #define OSUINT64MAX ULONG_LONG_MAX
00179 #define OSINT64MIN LONG_LONG_MIN
00180 #elif defined __INT64_MAX
00181 #define OSINT64MAX __INT64_MAX
00182 #define OSUINT64MAX __UINT64_MAX
00183 #define OSINT64MIN __INT64_MIN
00184 #else
00185 #warning "Using LONG_MAX for 64-bit maximum."
00186 #define OSINT64MAX LONG_MAX
00187 #define OSUINT64MAX ULONG_MAX
00188 #define OSINT64MIN LONG_MIN
00189 #endif
00190
00191 #endif
00192 #endif
00193
00194 #ifndef OSINT64_
00195
00196 #define OSINT64_
00197 typedef long OSINT64;
00198 typedef unsigned long OSUINT64;
00199 #define OSINT64FMT "%ld"
00200 #define OSUINT64FMT "%lu"
00201 #define OSINT64FMTX "%lx"
00202 #define OSINT64MAX LONG_MAX
00203 #define OSUINT64MAX ULONG_MAX
00204 #define OSINT64MIN LONG_MIN
00205 #define OSI64CONST(val) val##L
00206 #define OSUI64CONST(val) val##UL
00207 #endif
00208
00209 #define OSU64NULLIDX OSUINT64MAX
00210
00211 #endif
00212
00220 typedef struct OSDynOctStr {
00221 OSUINT32 numocts;
00222 const OSOCTET* data;
00223 } OSDynOctStr;
00224
00225 typedef OSDynOctStr OSOpenType;
00226
00231 typedef enum { OSXSDAny_binary, OSXSDAny_xmlText } OSXSDAnyAlt;
00232 typedef struct OSXSDAny {
00233 OSXSDAnyAlt t;
00234 union {
00235 OSOpenType* binary;
00236 const OSUTF8CHAR* xmlText;
00237 } u;
00238 } OSXSDAny;
00239
00240
00241
00242 typedef struct OSUTF8NVP {
00243 const OSUTF8CHAR* name;
00244 const OSUTF8CHAR* value;
00245 } OSUTF8NVP;
00246
00247 typedef OSUTF8NVP OSAnyAttr;
00248 typedef OSUTF8NVP OSAnyElement;
00249
00250
00251
00258 typedef struct OSXMLSTRING {
00259 OSBOOL cdata;
00260 const OSUTF8CHAR* value;
00261 } OSXMLSTRING;
00262
00271 typedef OSNumDateTime OSXSDDateTime;
00272
00279 typedef struct OSBitMapItem {
00280 const OSUTF8CHAR* name;
00281 OSUINT16 bitno;
00282 OSUINT16 namelen;
00283 } OSBitMapItem;
00284
00294 typedef struct OSUTF8NameAndLen {
00295 const OSUTF8CHAR* name;
00296 OSSIZE len;
00297 } OSUTF8NameAndLen;
00298
00299
00300 typedef struct OSDecimalFmt {
00301 OSINT8 totalDigits;
00302 OSINT8 fractionDigits;
00303
00304 OSINT8 fractionMinDigits;
00305
00306
00307 OSINT8 integerMaxDigits;
00308
00309
00310 OSINT8 integerMinDigits;
00311
00312 OSBOOL signPresent;
00313
00314 OSBOOL pointPresent;
00315
00316 OSUINT8 nPatterns;
00317 const char* const* patterns;
00318
00319 } OSDecimalFmt;
00320
00321
00322
00323 typedef struct OSDoubleFmt {
00324 OSINT8 totalDigits;
00325 OSINT8 fractionDigits;
00326
00327 OSINT8 fractionMinDigits;
00328
00329
00330 OSINT8 integerMaxDigits;
00331
00332
00333 OSINT8 integerMinDigits;
00334
00335 OSINT8 expSymbol;
00336
00337 OSINT16 expMinValue;
00338 OSINT16 expMaxValue;
00339 OSINT8 expDigits;
00340
00341
00342 OSBOOL signPresent;
00343
00344 OSBOOL pointPresent;
00345
00346 OSBOOL expPresent;
00347
00348 OSBOOL expSignPresent;
00349
00350 } OSDoubleFmt;
00351
00352 #endif