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
00044
00045
00046
00047 U_CAPI UBool U_EXPORT2 uprv_isNaN(double);
00048 U_CAPI UBool U_EXPORT2 uprv_isInfinite(double);
00049 U_CAPI UBool U_EXPORT2 uprv_isPositiveInfinity(double);
00050 U_CAPI UBool U_EXPORT2 uprv_isNegativeInfinity(double);
00051 U_CAPI double U_EXPORT2 uprv_getNaN(void);
00052 U_CAPI double U_EXPORT2 uprv_getInfinity(void);
00053
00054 U_CAPI double U_EXPORT2 uprv_floor(double x);
00055 U_CAPI double U_EXPORT2 uprv_ceil(double x);
00056 U_CAPI double U_EXPORT2 uprv_fabs(double x);
00057 U_CAPI double U_EXPORT2 uprv_modf(double x, double* y);
00058 U_CAPI double U_EXPORT2 uprv_fmod(double x, double y);
00059 U_CAPI double U_EXPORT2 uprv_pow10(int32_t x);
00060 U_CAPI double U_EXPORT2 uprv_IEEEremainder(double x, double y);
00061 U_CAPI double U_EXPORT2 uprv_fmax(double x, double y);
00062 U_CAPI double U_EXPORT2 uprv_fmin(double x, double y);
00063 U_CAPI int32_t U_EXPORT2 uprv_max(int32_t x, int32_t y);
00064 U_CAPI int32_t U_EXPORT2 uprv_min(int32_t x, int32_t y);
00065 U_CAPI double U_EXPORT2 uprv_trunc(double d);
00066 U_CAPI void U_EXPORT2 uprv_longBitsFromDouble(double d, int32_t *hi, uint32_t *lo);
00067 #if U_IS_BIG_ENDIAN
00068 # define uprv_isNegative(number) (*((signed char *)&(number))<0)
00069 #else
00070 # define uprv_isNegative(number) (*((signed char *)&(number)+sizeof(number)-1)<0)
00071 #endif
00072
00073
00074 #define T_CString_itosOffset(a) ((a)<=9?('0'+(a)):('A'+(a)-10))
00075
00076
00077
00078
00079
00080
00081
00082
00090 U_CAPI int16_t U_EXPORT2 uprv_log10(double d);
00091
00098 U_CAPI int32_t U_EXPORT2 uprv_digitsAfterDecimal(double x);
00099
00132 U_CAPI void U_EXPORT2 uprv_tzset(void);
00133 U_CAPI int32_t U_EXPORT2 uprv_timezone(void);
00134 U_CAPI char* U_EXPORT2 uprv_tzname(int n);
00135
00140 U_CAPI int32_t U_EXPORT2 uprv_getUTCtime(void);
00141
00146 U_CAPI const char* U_EXPORT2 u_getDataDirectory(void);
00147
00152 U_CAPI void U_EXPORT2 u_setDataDirectory(const char *directory);
00153
00158 U_CAPI const char* U_EXPORT2 uprv_getDefaultCodepage(void);
00159
00165 U_CAPI const char* U_EXPORT2 uprv_getDefaultLocaleID(void);
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176 U_CAPI double U_EXPORT2 uprv_nextDouble(double d, UBool positive);
00177
00183 #ifdef XP_MAC
00184 # define U_FILE_SEP_CHAR ':'
00185 # define U_PATH_SEP_CHAR ';'
00186 # define U_FILE_SEP_STRING ":"
00187 # define U_PATH_SEP_STRING ";"
00188 #elif defined(WIN32) || defined(OS2)
00189 # define U_FILE_SEP_CHAR '\\'
00190 # define U_PATH_SEP_CHAR ';'
00191 # define U_FILE_SEP_STRING "\\"
00192 # define U_PATH_SEP_STRING ";"
00193 #else
00194 # define U_FILE_SEP_CHAR '/'
00195 # define U_PATH_SEP_CHAR ':'
00196 # define U_FILE_SEP_STRING "/"
00197 # define U_PATH_SEP_STRING ":"
00198 #endif
00199
00216 U_CAPI void U_EXPORT2
00217 u_charsToUChars(const char *cs, UChar *us, UTextOffset length);
00218
00236 U_CAPI void U_EXPORT2
00237 u_UCharsToChars(const UChar *us, char *cs, UTextOffset length);
00238
00248 U_CAPI void U_EXPORT2
00249 u_versionFromString(UVersionInfo versionArray, const char *versionString);
00250
00261 U_CAPI void U_EXPORT2
00262 u_versionToString(UVersionInfo versionArray, char *versionString);
00263
00271 U_CAPI void U_EXPORT2
00272 u_getVersion(UVersionInfo versionArray);
00273
00274 #endif