Objective Systems, Inc.  
Home
About ASN.1
Products
Free Software
Documents
Services
Resources
Resellers
Customers
Careers
About Us
Contact Us
 

Google


Objective Systems, Inc.

rtxSysTypes.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2003-2006 Objective Systems, Inc.
00003  *
00004  * This software is furnished under a license and may be used and copied
00005  * only in accordance with the terms of such license and with the
00006  * inclusion of the above copyright notice. This software or any other
00007  * copies thereof may not be provided or otherwise made available to any
00008  * other person. No title to and ownership of the software is hereby
00009  * transferred.
00010  *
00011  * The information in this software is subject to change without notice
00012  * and should not be construed as a commitment by Objective Systems, Inc.
00013  *
00014  * PROPRIETARY NOTICE
00015  *
00016  * This software is an unpublished work subject to a confidentiality agreement
00017  * and is protected by copyright and trade secret law.  Unauthorized copying,
00018  * redistribution or other use of this work is prohibited.
00019  *
00020  * The above notice of copyright on this source code product does not indicate
00021  * any actual or intended publication of such source code.
00022  *
00023  *****************************************************************************/
00027 #ifndef _RTXSYSTYPES_H_
00028 #define _RTXSYSTYPES_H_
00029 
00030 #ifndef FALSE
00031 #define FALSE   0
00032 #define TRUE    (!FALSE)
00033 #endif
00034 
00035 #define NumberOf(x)     (sizeof(x)/sizeof(x[0]))
00036 
00037 #define OSUINT32_MAX    4294967295U
00038 #define OSINT32_MAX     2147483647L
00039 #define OSINT32_MIN    (-OSINT32_MAX-1)
00040 
00041 #define OSUINT16_MAX    65535U
00042 #define OSINT16_MAX     32767
00043 #define OSINT16_MIN    (-OSINT16_MAX-1)
00044 
00045 #define OSUINT8_MAX    255U
00046 #define OSINT8_MAX     127
00047 #define OSINT8_MIN    (-OSINT8_MAX-1)
00048 
00049 typedef void            OSVoid;
00050 typedef void*           OSVoidPtr;
00051 typedef unsigned char   OSBOOL;
00052 typedef signed char     OSINT8;
00053 typedef unsigned char   OSUINT8;
00054 typedef short           OSINT16;
00055 typedef unsigned short  OSUINT16;
00056 typedef int             OSINT32;
00057 typedef unsigned int    OSUINT32;
00058 typedef OSUINT8         OSOCTET;
00059 typedef OSUINT8         OSUTF8CHAR;
00060 typedef OSUINT16        OSUNICHAR;
00061 typedef OSUINT32        OS32BITCHAR;
00062 typedef double          OSREAL;
00063 
00064 /*
00065  * Cast a string literal as a UTF-8 character string value
00066  */
00067 #define OSUTF8(str) ((const OSUTF8CHAR*)str)
00068 
00076 typedef struct OSDynOctStr {
00077    OSUINT32     numocts;
00078    const OSOCTET* data;
00079 } OSDynOctStr;
00080 
00081 typedef OSDynOctStr OSOpenType;
00082 
00083 /* UTF-8 name/value pair */
00084 
00085 typedef struct OSUTF8NVP {
00086    const OSUTF8CHAR* name;
00087    const OSUTF8CHAR* value;
00088 } OSUTF8NVP;
00089 
00090 typedef OSUTF8NVP OSAnyAttr;
00091 typedef OSUTF8NVP OSAnyElement;
00092 
00093 /* XML string */
00094 
00101 typedef struct OSXMLSTRING {
00102    OSBOOL cdata;                /* encode as a CDATA section */
00103    const OSUTF8CHAR* value;
00104 } OSXMLSTRING;
00105 
00106 /* XSD numeric date/time */
00107 
00116 typedef struct OSXSDDateTime {
00117    OSINT32      year;
00118    OSUINT8      mon;            /* 1 <=  mon    <= 12   */
00119    OSUINT8      day;            /* 1 <=  day    <= 31   */
00120    OSUINT8      hour;           /* 0 <=  hour   <= 23   */
00121    OSUINT8      min;            /* 0 <=  min    <= 59   */
00122    OSREAL       sec;
00123    OSBOOL       tz_flag;        /* is tzo explicitely set? */
00124    OSINT32      tzo;            /* -1440 <= tzo <= 1440 */
00125 } OSXSDDateTime;
00126 
00127 /* 64-bit long integer type */
00128 
00129 #ifndef OSINT64
00130 #if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
00131 #define OSINT64 __int64
00132 #define OSUINT64 unsigned __int64
00133 #define OSINT64FMT  "%I64d"
00134 #define OSUINT64FMT "%I64u"
00135 #define OSINT64FMTX "%I64x"
00136 #define OSINT64MAX  _I64_MAX
00137 #define OSUINT64MAX _UI64_MAX
00138 #define OSINT64MIN  _I64_MIN
00139 #define OSI64CONST(val)  val##i64
00140 #define OSUI64CONST(val) val##ui64
00141 
00142 #elif defined(__IBMC__) || defined(__GNUC__) || defined(__SUNPRO_CC) || \
00143 defined(__SUNPRO_C) || defined(__CC_ARM) || \
00144 defined(__hpux) || defined(__HPUX_CC__) || defined(__HP_aCC) || \
00145 defined(IRIX) || defined(__sgi) || defined(__xlC__) || \
00146 defined(__UNIXWARE__) || defined(__USLC__) || defined(__svr4__)
00147 
00148 /* stdint.h is a proper subset of inttypes.h, but is not always
00149  * included in some GCC compilers.  Tornado doesn't include inttypes at all. */
00150 #if defined(__GNUC__) && !defined(__CCPPC__)
00151 #define __STDC_LIMIT_MACROS
00152 #include <inttypes.h>
00153 #endif /* defined __GNUC__ */
00154 
00155 /* Standard specifies that limit macros are defined by included
00156  * files. */
00157 #if defined (INT64_MAX)
00158 #define OSINT64 int64_t
00159 #define OSUINT64 uint64_t
00160 #else
00161 #define OSINT64 long long
00162 #define OSUINT64 unsigned long long
00163 #endif /* defined INT64_MAX */
00164 
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 #if defined(__IBMC__) || defined(__xlC__)
00172 #define OSINT64MAX  LONGLONG_MAX
00173 #define OSUINT64MAX ULONGLONG_MAX
00174 #define OSINT64MIN  LONGLONG_MIN
00175 #elif defined(__SUNPRO_CC) || defined(__SUNPRO_C) || \
00176 defined(__CC_ARM) || defined(__FreeBSD__) || \
00177 (defined(__GNUC__) && defined(__SVR4) && defined(sun) && (defined(i386) || defined(__x86_64)))
00178 #define OSINT64MAX  LLONG_MAX
00179 #define OSUINT64MAX ULLONG_MAX
00180 #define OSINT64MIN  LLONG_MIN
00181 #elif defined(__hpux) || defined(__HPUX_CC__) || defined(__HP_aCC)
00182 #ifdef __LP64__ /* for 64-bit HP-UX long is 64-bit */
00183 #define OSINT64MAX  LONG_MAX
00184 #define OSUINT64MAX ULONG_MAX
00185 #define OSINT64MIN  LONG_MIN
00186 #else  /* !__LP64__ */
00187 #define OSINT64MAX  LONG_LONG_MAX
00188 #define OSUINT64MAX ULONG_LONG_MAX
00189 #define OSINT64MIN  LONG_LONG_MIN
00190 #endif /* __LP64__ */
00191 #else  /* !__IBMC__ && !SUN && !HP_CC etc */
00192 #ifndef _GNU_SOURCE
00193 #define _GNU_SOURCE
00194 #endif  /* _GNU_SOURCE */
00195 #define OSINT64MAX  LONG_LONG_MAX
00196 #define OSUINT64MAX ULONG_LONG_MAX
00197 #define OSINT64MIN  LONG_LONG_MIN
00198 #endif  /* __IBMC__ */
00199 
00200 #else   /* !MSC_VER && !__IBMC__ etc */
00201 #define OSINT64 long
00202 #define OSUINT64 unsigned long
00203 #define OSINT64FMT  "%ld"
00204 #define OSUINT64FMT "%lu"
00205 #define OSINT64FMTX "%lx"
00206 #define OSINT64MAX  LONG_MAX
00207 #define OSUINT64MAX ULONG_MAX
00208 #define OSINT64MIN  LONG_MIN
00209 #define OSI64CONST(val)  val##L  
00210 #define OSUI64CONST(val) val##UL  
00211 #endif /* MSC_VER ... */
00212 #endif /* OSINT64 */
00213 
00214 #endif

This file was last modified on 8 Jan 2007.
XBinder, Version 1.1.9