00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __UMACHINE_H__
00024 #define __UMACHINE_H__
00025
00026
00039
00040
00041
00042
00043
00044 #include "unicode/ptypes.h"
00045
00046
00047
00048
00049
00050 #include <stddef.h>
00051
00052
00053
00054
00055
00056
00057
00076 #ifdef __cplusplus
00077 # define U_CFUNC extern "C"
00078 # define U_CDECL_BEGIN extern "C" {
00079 # define U_CDECL_END }
00080 #else
00081 # define U_CFUNC extern
00082 # define U_CDECL_BEGIN
00083 # define U_CDECL_END
00084 #endif
00085
00086 #ifndef U_ATTRIBUTE_DEPRECATED
00087
00092 #if U_GCC_MAJOR_MINOR >= 302
00093 # define U_ATTRIBUTE_DEPRECATED __attribute__ ((deprecated))
00094
00099 #elif defined(_MSC_VER) && (_MSC_VER >= 1400)
00100 # define U_ATTRIBUTE_DEPRECATED __declspec(deprecated)
00101 #else
00102 # define U_ATTRIBUTE_DEPRECATED
00103 #endif
00104 #endif
00105
00107 #define U_CAPI U_CFUNC U_EXPORT
00108
00109 #define U_STABLE U_CAPI
00110
00111 #define U_DRAFT U_CAPI
00112
00113 #define U_DEPRECATED U_CAPI U_ATTRIBUTE_DEPRECATED
00114
00115 #define U_OBSOLETE U_CAPI
00116
00117 #define U_INTERNAL U_CAPI
00118
00119
00120
00121
00122
00123 #ifndef INT8_MIN
00124
00125 # define INT8_MIN ((int8_t)(-128))
00126 #endif
00127 #ifndef INT16_MIN
00128
00129 # define INT16_MIN ((int16_t)(-32767-1))
00130 #endif
00131 #ifndef INT32_MIN
00132
00133 # define INT32_MIN ((int32_t)(-2147483647-1))
00134 #endif
00135
00136 #ifndef INT8_MAX
00137
00138 # define INT8_MAX ((int8_t)(127))
00139 #endif
00140 #ifndef INT16_MAX
00141
00142 # define INT16_MAX ((int16_t)(32767))
00143 #endif
00144 #ifndef INT32_MAX
00145
00146 # define INT32_MAX ((int32_t)(2147483647))
00147 #endif
00148
00149 #ifndef UINT8_MAX
00150
00151 # define UINT8_MAX ((uint8_t)(255U))
00152 #endif
00153 #ifndef UINT16_MAX
00154
00155 # define UINT16_MAX ((uint16_t)(65535U))
00156 #endif
00157 #ifndef UINT32_MAX
00158
00159 # define UINT32_MAX ((uint32_t)(4294967295U))
00160 #endif
00161
00162 #if defined(U_INT64_T_UNAVAILABLE)
00163 # error int64_t is required for decimal format and rule-based number format.
00164 #else
00165 # ifndef INT64_C
00166
00171 # define INT64_C(c) c ## LL
00172 # endif
00173 # ifndef UINT64_C
00174
00179 # define UINT64_C(c) c ## ULL
00180 # endif
00181 # ifndef U_INT64_MIN
00182
00183 # define U_INT64_MIN ((int64_t)(INT64_C(-9223372036854775807)-1))
00184 # endif
00185 # ifndef U_INT64_MAX
00186
00187 # define U_INT64_MAX ((int64_t)(INT64_C(9223372036854775807)))
00188 # endif
00189 # ifndef U_UINT64_MAX
00190
00191 # define U_UINT64_MAX ((uint64_t)(UINT64_C(18446744073709551615)))
00192 # endif
00193 #endif
00194
00195
00196
00197
00198
00200 typedef int8_t UBool;
00201
00202 #ifndef TRUE
00203
00204 # define TRUE 1
00205 #endif
00206 #ifndef FALSE
00207
00208 # define FALSE 0
00209 #endif
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230 #if !defined(U_WCHAR_IS_UTF16) && !defined(U_WCHAR_IS_UTF32)
00231 # ifdef __STDC_ISO_10646__
00232 # if (U_SIZEOF_WCHAR_T==2)
00233 # define U_WCHAR_IS_UTF16
00234 # elif (U_SIZEOF_WCHAR_T==4)
00235 # define U_WCHAR_IS_UTF32
00236 # endif
00237 # elif defined __UCS2__
00238 # if (U_PF_OS390 <= U_PLATFORM && U_PLATFORM <= U_PF_OS400) && (U_SIZEOF_WCHAR_T==2)
00239 # define U_WCHAR_IS_UTF16
00240 # endif
00241 # elif defined(__UCS4__) || (U_PLATFORM == U_PF_OS400 && defined(__UTF32__))
00242 # if (U_SIZEOF_WCHAR_T==4)
00243 # define U_WCHAR_IS_UTF32
00244 # endif
00245 # elif U_PLATFORM_IS_DARWIN_BASED || (U_SIZEOF_WCHAR_T==4 && U_PLATFORM_IS_LINUX_BASED)
00246 # define U_WCHAR_IS_UTF32
00247 # elif U_PLATFORM_HAS_WIN32_API
00248 # define U_WCHAR_IS_UTF16
00249 # endif
00250 #endif
00251
00252
00253
00255 #define U_SIZEOF_UCHAR 2
00256
00269 #if defined(UCHAR_TYPE)
00270 typedef UCHAR_TYPE UChar;
00271
00272
00273 #elif U_SIZEOF_WCHAR_T==2
00274 typedef wchar_t UChar;
00275 #elif defined(__CHAR16_TYPE__)
00276 typedef __CHAR16_TYPE__ UChar;
00277 #else
00278 typedef uint16_t UChar;
00279 #endif
00280
00298 typedef int32_t UChar32;
00299
00318 #define U_SENTINEL (-1)
00319
00320 #include "unicode/urename.h"
00321
00322 #endif