[1022] | 1 | /* Copyright 2009, UCAR/Unidata and OPeNDAP, Inc. |
---|
| 2 | See the COPYRIGHT file for more information. */ |
---|
| 3 | |
---|
| 4 | #ifndef OCDATATYPES_H |
---|
| 5 | #define OCDATATYPES_H |
---|
| 6 | |
---|
| 7 | /* Define some useful info about the supported |
---|
| 8 | primitive datatypes*/ |
---|
| 9 | |
---|
| 10 | #define DCHAR char |
---|
| 11 | #define DBYTE signed char |
---|
| 12 | #define DUBYTE unsigned char |
---|
| 13 | #define DINT16 short |
---|
| 14 | #define DUINT16 unsigned short |
---|
| 15 | #define DINT32 int |
---|
| 16 | #define DUINT32 unsigned int |
---|
| 17 | #define DINT64 int |
---|
| 18 | #define DUINT64 unsigned int |
---|
| 19 | #define DFLOAT32 float |
---|
| 20 | #define DFLOAT64 double |
---|
| 21 | |
---|
| 22 | #define OC_CHAR_MIN ((char)0x00) |
---|
| 23 | #define OC_CHAR_MAX ((char)0xff) |
---|
| 24 | #define OC_BYTE_MIN -128 |
---|
| 25 | #define OC_BYTE_MAX 127 |
---|
| 26 | #define OC_UBYTE_MIN 0 |
---|
| 27 | #define OC_UBYTE_MAX 255U |
---|
| 28 | #define OC_INT16_MIN -32768 |
---|
| 29 | #define OC_INT16_MAX 32767 |
---|
| 30 | #define OC_UINT16_MIN 0 |
---|
| 31 | #define OC_UINT16_MAX 65535U |
---|
| 32 | #define OC_INT32_MIN (-2147483647 - 1) |
---|
| 33 | #define OC_INT32_MAX 2147483647 |
---|
| 34 | #define OC_UINT32_MIN 0 |
---|
| 35 | #define OC_UINT32_MAX 4294967295U |
---|
| 36 | #define OC_INT64_MIN (-9223372036854775807LL-1) |
---|
| 37 | #define OC_INT64_MAX (9223372036854775807LL) |
---|
| 38 | #define OC_UINT64_MIN 0LL |
---|
| 39 | #define OC_UINT64_MAX (18446744073709551615ULL) |
---|
| 40 | #define OC_FLOAT32_MAX 3.402823466E+38F /* max decimal value of a "float" */ |
---|
| 41 | #define OC_FLOAT32_MIN (-OC_FLOAT_MAX) |
---|
| 42 | #define OC_FLOAT64_MAX 1.7976931348623157E+308 /* max decimal value of a double */ |
---|
| 43 | #define OC_FLOAT64_MIN (-OC_FLOAT64_MAX) |
---|
| 44 | |
---|
| 45 | /* Similar to netcdf*/ |
---|
| 46 | #define OC_FILL_CHAR ((char)0) |
---|
| 47 | #define OC_FILL_BYTE ((signed char)-127) |
---|
| 48 | #define OC_FILL_UBYTE (255) |
---|
| 49 | #define OC_FILL_INT16 ((short)-32767) |
---|
| 50 | #define OC_FILL_UINT16 (65535) |
---|
| 51 | #define OC_FILL_INT32 (-2147483647L) |
---|
| 52 | #define OC_FILL_UINT32 (4294967295U) |
---|
| 53 | #define OC_FILL_INT64 ((long long)-9223372036854775806LL) |
---|
| 54 | #define OC_FILL_UINT64 ((unsigned long long)18446744073709551614ULL) |
---|
| 55 | #define OC_FILL_FLOAT32 (9.9692099683868690e+36f) /* near 15 * 2^119 */ |
---|
| 56 | #define OC_FILL_FLOAT64 (9.9692099683868690e+36) |
---|
| 57 | #define OC_FILL_STRING "" |
---|
| 58 | #define OC_FILL_URL "" |
---|
| 59 | |
---|
| 60 | |
---|
| 61 | #endif /*OCDATATYPES_H*/ |
---|