00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _CX_TYPES_H
00022 #define _CX_TYPES_H
00023
00024 #ifdef HAVE_CONFIG_H
00025 #include <config.h>
00026 #endif
00027
00028 #include <limits.h>
00029 #include <float.h>
00030
00031 #include <cxmacros.h>
00032
00033 CX_BEGIN_DECLS
00034
00035
00036
00037
00038
00039
00040
00041
00042 #define CX_PI 3.14159265358979323846e0
00043
00044
00045
00046
00047
00048 #define CX_MINSHORT SHRT_MIN
00049 #define CX_MAXSHORT SHRT_MAX
00050 #define CX_MAXUSHORT USHRT_MAX
00051 #define CX_MININT INT_MIN
00052 #define CX_MAXINT INT_MAX
00053 #define CX_MAXUINT UINT_MAX
00054 #define CX_MINLONG LONG_MIN
00055 #define CX_MAXLONG LONG_MAX
00056 #define CX_MAXULONG ULONG_MAX
00057
00058 #define CX_MINFLOAT FLT_MIN
00059 #define CX_MAXFLOAT FLT_MAX
00060 #define CX_MINDOUBLE DBL_MIN
00061 #define CX_MAXDOUBLE DBL_MAX
00062
00063
00064 #define CX_MININT64 ((cxint64) 0x8000000000000000)
00065 #define CX_MAXINT64 ((cxint64) 0x7fffffffffffffff)
00066 #define CX_MAXUINT64 ((cxuint64) 0xffffffffffffffff)
00067
00068
00069
00070
00071
00072
00073 typedef signed char cxint8;
00074 typedef unsigned char cxuint8;
00075 typedef signed short cxint16;
00076 typedef unsigned short cxuint16;
00077 typedef signed int cxint32;
00078 typedef unsigned int cxuint32;
00079
00080
00081 #if defined SIZEOF_LONG && SIZEOF_LONG == 8
00082 CX_GNUC_EXTENSION typedef signed long cxint64;
00083 CX_GNUC_EXTENSION typedef unsigned long cxuint64;
00084 #else
00085 CX_GNUC_EXTENSION typedef signed long long cxint64;
00086 CX_GNUC_EXTENSION typedef unsigned long long cxuint64;
00087 #endif
00088
00089 #if defined SIZEOF_SIZE_T && SIZEOF_SIZE_T == 8
00090 typedef cxint64 cxssize;
00091 typedef cxuint64 cxsize;
00092 #else
00093 typedef cxint32 cxssize;
00094 typedef cxuint32 cxsize;
00095 #endif
00096
00097
00098
00099
00100
00101 typedef char cxchar;
00102 typedef short cxshort;
00103 typedef int cxint;
00104 typedef long cxlong;
00105
00106 typedef unsigned char cxbyte;
00107
00108 typedef unsigned char cxuchar;
00109 typedef unsigned short cxushort;
00110 typedef unsigned int cxuint;
00111 typedef unsigned long cxulong;
00112
00113 typedef float cxfloat;
00114 typedef double cxdouble;
00115
00116 typedef void * cxptr;
00117 typedef const void * cxcptr;
00118
00119 typedef int cxbool;
00120
00121
00122
00123
00124
00125
00126 typedef cxint (*cx_compare_func) (cxcptr a, cxcptr b);
00127 typedef cxint (*cx_compare_data_func) (cxcptr a, cxcptr b, cxptr data);
00128
00129 typedef cxbool (*cx_equal_func) (cxcptr a, cxcptr b);
00130
00131 typedef void (*cx_free_func) (cxptr data);
00132
00133 CX_END_DECLS
00134
00135 #endif