00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef PUTIL_H
00025 #define PUTIL_H
00026
00027 #include "unicode/utypes.h"
00028
00029
00030
00031 #ifndef IEEE_754
00032 # define IEEE_754 1
00033 #endif
00034
00035
00036
00037
00038
00049 U_CAPI UBool U_EXPORT2 uprv_isNaN(double d);
00054 U_CAPI UBool U_EXPORT2 uprv_isInfinite(double d);
00059 U_CAPI UBool U_EXPORT2 uprv_isPositiveInfinity(double d);
00064 U_CAPI UBool U_EXPORT2 uprv_isNegativeInfinity(double d);
00069 U_CAPI double U_EXPORT2 uprv_getNaN(void);
00074 U_CAPI double U_EXPORT2 uprv_getInfinity(void);
00075
00080 U_CAPI double U_EXPORT2 uprv_trunc(double d);
00085 U_CAPI double U_EXPORT2 uprv_floor(double d);
00090 U_CAPI double U_EXPORT2 uprv_ceil(double d);
00095 U_CAPI double U_EXPORT2 uprv_fabs(double d);
00100 U_CAPI double U_EXPORT2 uprv_modf(double d, double* pinteger);
00105 U_CAPI double U_EXPORT2 uprv_fmod(double d, double y);
00110 U_CAPI double U_EXPORT2 uprv_pow(double d, double exp);
00115 U_CAPI double U_EXPORT2 uprv_pow10(int32_t exp);
00120 U_CAPI double U_EXPORT2 uprv_fmax(double d, double y);
00125 U_CAPI double U_EXPORT2 uprv_fmin(double d, double y);
00130 U_CAPI int32_t U_EXPORT2 uprv_max(int32_t d, int32_t y);
00135 U_CAPI int32_t U_EXPORT2 uprv_min(int32_t d, int32_t y);
00136
00137 #if U_IS_BIG_ENDIAN
00138 # define uprv_isNegative(number) (*((signed char *)&(number))<0)
00139 #else
00140 # define uprv_isNegative(number) (*((signed char *)&(number)+sizeof(number)-1)<0)
00141 #endif
00142
00148 U_CAPI double U_EXPORT2 uprv_maxMantissa(void);
00149
00161 U_CAPI int16_t U_EXPORT2 uprv_log10(double d);
00162
00167 U_CAPI double U_EXPORT2 uprv_log(double d);
00168
00175 U_CAPI double U_EXPORT2 uprv_round(double x);
00176
00184 U_CAPI int32_t U_EXPORT2 uprv_digitsAfterDecimal(double x);
00185
00218 U_CAPI void U_EXPORT2 uprv_tzset(void);
00219
00226 U_CAPI int32_t U_EXPORT2 uprv_timezone(void);
00227
00236 U_CAPI char* U_EXPORT2 uprv_tzname(int n);
00237
00244 U_CAPI int32_t U_EXPORT2 uprv_getUTCtime(void);
00245
00267 U_CAPI const char* U_EXPORT2 u_getDataDirectory(void);
00268
00282 U_CAPI void U_EXPORT2 u_setDataDirectory(const char *directory);
00283
00292 U_CAPI const char* U_EXPORT2 uprv_getDefaultCodepage(void);
00293
00303 U_CAPI const char* U_EXPORT2 uprv_getDefaultLocaleID(void);
00304
00305 #ifdef ICU_NEXTDOUBLE_USE_DEPRECATES
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317 U_CAPI double U_EXPORT2 uprv_nextDouble(double d, UBool positive);
00318 #endif
00319
00325 #ifdef XP_MAC
00326 # define U_FILE_SEP_CHAR ':'
00327 # define U_PATH_SEP_CHAR ';'
00328 # define U_FILE_SEP_STRING ":"
00329 # define U_PATH_SEP_STRING ";"
00330 #elif defined(WIN32) || defined(OS2)
00331 # define U_FILE_SEP_CHAR '\\'
00332 # define U_PATH_SEP_CHAR ';'
00333 # define U_FILE_SEP_STRING "\\"
00334 # define U_PATH_SEP_STRING ";"
00335 #else
00336 # define U_FILE_SEP_CHAR '/'
00337 # define U_PATH_SEP_CHAR ':'
00338 # define U_FILE_SEP_STRING "/"
00339 # define U_PATH_SEP_STRING ":"
00340 #endif
00341
00358 U_CAPI void U_EXPORT2
00359 u_charsToUChars(const char *cs, UChar *us, int32_t length);
00360
00378 U_CAPI void U_EXPORT2
00379 u_UCharsToChars(const UChar *us, char *cs, int32_t length);
00380
00386 #if U_CHARSET_FAMILY==U_ASCII_FAMILY
00387 # define U_UPPER_ORDINAL(x) ((x)-'A')
00388 #elif U_CHARSET_FAMILY==U_EBCDIC_FAMILY
00389 # define U_UPPER_ORDINAL(x) (((x) < 'J') ? ((x)-'A') : \
00390 (((x) < 'S') ? ((x)-'J'+9) : \
00391 ((x)-'S'+18)))
00392 #else
00393 # error Unknown charset family!
00394 #endif
00395
00410 #ifndef U_MAX_PTR
00411 # ifdef OS390
00412 # define U_MAX_PTR(base) ((void *)0x7fffffff)
00413 # elif defined(OS400)
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426 # define U_MAX_PTR(base) ((void *)(((char *)base)-((int32_t)(base))+((int32_t)0xffefff)))
00427 # else
00428 # define U_MAX_PTR(base) ((void *)(((char *)(base)+0x7fffffff) > (char *)(base) ? ((char *)(base)+0x7fffffff) : (char *)-1))
00429 # endif
00430 #endif
00431
00432 #endif