michael@0: /* michael@0: ****************************************************************************** michael@0: * michael@0: * Copyright (C) 1997-2013, International Business Machines michael@0: * Corporation and others. All Rights Reserved. michael@0: * michael@0: ****************************************************************************** michael@0: * michael@0: * FILE NAME : putilimp.h michael@0: * michael@0: * Date Name Description michael@0: * 10/17/04 grhoten Move internal functions from putil.h to this file. michael@0: ****************************************************************************** michael@0: */ michael@0: michael@0: #ifndef PUTILIMP_H michael@0: #define PUTILIMP_H michael@0: michael@0: #include "unicode/utypes.h" michael@0: #include "unicode/putil.h" michael@0: michael@0: /** michael@0: * \def U_SIGNED_RIGHT_SHIFT_IS_ARITHMETIC michael@0: * Nearly all CPUs and compilers implement a right-shift of a signed integer michael@0: * as an Arithmetic Shift Right which copies the sign bit (the Most Significant Bit (MSB)) michael@0: * into the vacated bits (sign extension). michael@0: * For example, (int32_t)0xfff5fff3>>4 becomes 0xffff5fff and -1>>1=-1. michael@0: * michael@0: * This can be useful for storing a signed value in the upper bits michael@0: * and another bit field in the lower bits. michael@0: * The signed value can be retrieved by simple right-shifting. michael@0: * michael@0: * This is consistent with the Java language. michael@0: * michael@0: * However, the C standard allows compilers to implement a right-shift of a signed integer michael@0: * as a Logical Shift Right which copies a 0 into the vacated bits. michael@0: * For example, (int32_t)0xfff5fff3>>4 becomes 0x0fff5fff and -1>>1=0x7fffffff. michael@0: * michael@0: * Code that depends on the natural behavior should be guarded with this macro, michael@0: * with an alternate path for unusual platforms. michael@0: * @internal michael@0: */ michael@0: #ifdef U_SIGNED_RIGHT_SHIFT_IS_ARITHMETIC michael@0: /* Use the predefined value. */ michael@0: #else michael@0: /* michael@0: * Nearly all CPUs & compilers implement a right-shift of a signed integer michael@0: * as an Arithmetic Shift Right (with sign extension). michael@0: */ michael@0: # define U_SIGNED_RIGHT_SHIFT_IS_ARITHMETIC 1 michael@0: #endif michael@0: michael@0: /** Define this to 1 if your platform supports IEEE 754 floating point, michael@0: to 0 if it does not. */ michael@0: #ifndef IEEE_754 michael@0: # define IEEE_754 1 michael@0: #endif michael@0: michael@0: /** michael@0: * uintptr_t is an optional part of the standard definitions in stdint.h. michael@0: * The opengroup.org documentation for stdint.h says michael@0: * "On XSI-conformant systems, the intptr_t and uintptr_t types are required; michael@0: * otherwise, they are optional." michael@0: * We assume that when uintptr_t is defined, UINTPTR_MAX is defined as well. michael@0: * michael@0: * Do not use ptrdiff_t since it is signed. size_t is unsigned. michael@0: */ michael@0: /* TODO: This check fails on some z environments. Filed a ticket #9357 for this. */ michael@0: #if !defined(__intptr_t_defined) && !defined(UINTPTR_MAX) && (U_PLATFORM != U_PF_OS390) michael@0: typedef size_t uintptr_t; michael@0: #endif michael@0: michael@0: /** michael@0: * \def U_HAVE_MSVC_2003_OR_EARLIER michael@0: * Flag for workaround of MSVC 2003 optimization bugs michael@0: * @internal michael@0: */ michael@0: #if !defined(U_HAVE_MSVC_2003_OR_EARLIER) && defined(_MSC_VER) && (_MSC_VER < 1400) michael@0: #define U_HAVE_MSVC_2003_OR_EARLIER michael@0: #endif michael@0: michael@0: /*===========================================================================*/ michael@0: /** @{ Information about POSIX support */ michael@0: /*===========================================================================*/ michael@0: michael@0: #ifdef U_HAVE_NL_LANGINFO_CODESET michael@0: /* Use the predefined value. */ michael@0: #elif U_PLATFORM_HAS_WIN32_API michael@0: # define U_HAVE_NL_LANGINFO_CODESET 0 michael@0: #else michael@0: # define U_HAVE_NL_LANGINFO_CODESET 1 michael@0: #endif michael@0: michael@0: #ifdef U_NL_LANGINFO_CODESET michael@0: /* Use the predefined value. */ michael@0: #elif !U_HAVE_NL_LANGINFO_CODESET michael@0: # define U_NL_LANGINFO_CODESET -1 michael@0: #elif U_PLATFORM == U_PF_OS400 michael@0: /* not defined */ michael@0: #else michael@0: # define U_NL_LANGINFO_CODESET CODESET michael@0: #endif michael@0: michael@0: #ifdef U_TZSET michael@0: /* Use the predefined value. */ michael@0: #elif U_PLATFORM_USES_ONLY_WIN32_API michael@0: # define U_TZSET _tzset michael@0: #elif U_PLATFORM == U_PF_OS400 michael@0: /* not defined */ michael@0: #else michael@0: # define U_TZSET tzset michael@0: #endif michael@0: michael@0: #if defined(U_TIMEZONE) || defined(U_HAVE_TIMEZONE) michael@0: /* Use the predefined value. */ michael@0: #elif U_PLATFORM == U_PF_ANDROID michael@0: # define U_TIMEZONE timezone michael@0: #elif U_PLATFORM_IS_LINUX_BASED michael@0: # if !defined(__UCLIBC__) michael@0: /* __timezone is only available in glibc */ michael@0: # define U_TIMEZONE __timezone michael@0: # endif michael@0: #elif U_PLATFORM_USES_ONLY_WIN32_API michael@0: # define U_TIMEZONE _timezone michael@0: #elif U_PLATFORM == U_PF_BSD && !defined(__NetBSD__) michael@0: /* not defined */ michael@0: #elif U_PLATFORM == U_PF_OS400 michael@0: /* not defined */ michael@0: #elif U_PLATFORM == U_PF_IPHONE michael@0: /* not defined */ michael@0: #else michael@0: # define U_TIMEZONE timezone michael@0: #endif michael@0: michael@0: #ifdef U_TZNAME michael@0: /* Use the predefined value. */ michael@0: #elif U_PLATFORM_USES_ONLY_WIN32_API michael@0: # define U_TZNAME _tzname michael@0: #elif U_PLATFORM == U_PF_OS400 michael@0: /* not defined */ michael@0: #else michael@0: # define U_TZNAME tzname michael@0: #endif michael@0: michael@0: #ifdef U_HAVE_MMAP michael@0: /* Use the predefined value. */ michael@0: #elif U_PLATFORM_HAS_WIN32_API michael@0: # define U_HAVE_MMAP 0 michael@0: #else michael@0: # define U_HAVE_MMAP 1 michael@0: #endif michael@0: michael@0: #ifdef U_HAVE_POPEN michael@0: /* Use the predefined value. */ michael@0: #elif U_PLATFORM_USES_ONLY_WIN32_API michael@0: # define U_HAVE_POPEN 0 michael@0: #elif U_PLATFORM == U_PF_OS400 michael@0: # define U_HAVE_POPEN 0 michael@0: #else michael@0: # define U_HAVE_POPEN 1 michael@0: #endif michael@0: michael@0: /** michael@0: * \def U_HAVE_DIRENT_H michael@0: * Defines whether dirent.h is available. michael@0: * @internal michael@0: */ michael@0: #ifdef U_HAVE_DIRENT_H michael@0: /* Use the predefined value. */ michael@0: #elif U_PLATFORM_HAS_WIN32_API michael@0: # define U_HAVE_DIRENT_H 0 michael@0: #else michael@0: # define U_HAVE_DIRENT_H 1 michael@0: #endif michael@0: michael@0: /** @} */ michael@0: michael@0: /*===========================================================================*/ michael@0: /** @{ GCC built in functions for atomic memory operations */ michael@0: /*===========================================================================*/ michael@0: michael@0: /** michael@0: * \def U_HAVE_GCC_ATOMICS michael@0: * @internal michael@0: */ michael@0: #ifdef U_HAVE_GCC_ATOMICS michael@0: /* Use the predefined value. */ michael@0: #elif U_PLATFORM == U_PF_MINGW michael@0: #define U_HAVE_GCC_ATOMICS 0 michael@0: #elif U_GCC_MAJOR_MINOR >= 404 || defined(__clang__) michael@0: /* TODO: Intel icc and IBM xlc on AIX also support gcc atomics. (Intel originated them.) michael@0: * Add them for these compilers. michael@0: * Note: Clang sets __GNUC__ defines for version 4.2, so misses the 4.4 test here. michael@0: */ michael@0: # define U_HAVE_GCC_ATOMICS 1 michael@0: #else michael@0: # define U_HAVE_GCC_ATOMICS 0 michael@0: #endif michael@0: michael@0: /** @} */ michael@0: michael@0: /** michael@0: * \def U_HAVE_STD_ATOMICS michael@0: * Defines whether the standard C++11 is available. michael@0: * ICU will use this when avialable, michael@0: * otherwise will fall back to compiler or platform specific alternatives. michael@0: * @internal michael@0: */ michael@0: #ifdef U_HAVE_STD_ATOMICS michael@0: /* Use the predefined value. */ michael@0: #elif !defined(__cplusplus) || __cplusplus<201103L michael@0: /* Not C++11, disable use of atomics */ michael@0: # define U_HAVE_STD_ATOMICS 0 michael@0: #elif __clang__ && __clang_major__==3 && __clang_minor__<=1 michael@0: /* Clang 3.1, has atomic variable initializer bug. */ michael@0: # define U_HAVE_STD_ATOMICS 0 michael@0: #else michael@0: /* U_HAVE_ATOMIC is typically set by an autoconf test of #include */ michael@0: /* Can be set manually, or left undefined, on platforms without autoconf. */ michael@0: # if defined(U_HAVE_ATOMIC) && U_HAVE_ATOMIC michael@0: # define U_HAVE_STD_ATOMICS 1 michael@0: # else michael@0: # define U_HAVE_STD_ATOMICS 0 michael@0: # endif michael@0: #endif michael@0: michael@0: michael@0: /*===========================================================================*/ michael@0: /** @{ Code alignment */ michael@0: /*===========================================================================*/ michael@0: michael@0: /** michael@0: * \def U_ALIGN_CODE michael@0: * This is used to align code fragments to a specific byte boundary. michael@0: * This is useful for getting consistent performance test results. michael@0: * @internal michael@0: */ michael@0: #ifdef U_ALIGN_CODE michael@0: /* Use the predefined value. */ michael@0: #elif defined(_MSC_VER) && defined(_M_IX86) && !defined(_MANAGED) michael@0: # define U_ALIGN_CODE(boundarySize) __asm align boundarySize michael@0: #else michael@0: # define U_ALIGN_CODE(boundarySize) michael@0: #endif michael@0: michael@0: /** @} */ michael@0: michael@0: /*===========================================================================*/ michael@0: /** @{ Programs used by ICU code */ michael@0: /*===========================================================================*/ michael@0: michael@0: /** michael@0: * \def U_MAKE_IS_NMAKE michael@0: * Defines whether the "make" program is Windows nmake. michael@0: */ michael@0: #ifdef U_MAKE_IS_NMAKE michael@0: /* Use the predefined value. */ michael@0: #elif U_PLATFORM == U_PF_WINDOWS michael@0: # define U_MAKE_IS_NMAKE 1 michael@0: #else michael@0: # define U_MAKE_IS_NMAKE 0 michael@0: #endif michael@0: michael@0: /** @} */ michael@0: michael@0: /*==========================================================================*/ michael@0: /* Platform utilities */ michael@0: /*==========================================================================*/ michael@0: michael@0: /** michael@0: * Platform utilities isolates the platform dependencies of the michael@0: * libarary. For each platform which this code is ported to, these michael@0: * functions may have to be re-implemented. michael@0: */ michael@0: michael@0: /** michael@0: * Floating point utility to determine if a double is Not a Number (NaN). michael@0: * @internal michael@0: */ michael@0: U_INTERNAL UBool U_EXPORT2 uprv_isNaN(double d); michael@0: /** michael@0: * Floating point utility to determine if a double has an infinite value. michael@0: * @internal michael@0: */ michael@0: U_INTERNAL UBool U_EXPORT2 uprv_isInfinite(double d); michael@0: /** michael@0: * Floating point utility to determine if a double has a positive infinite value. michael@0: * @internal michael@0: */ michael@0: U_INTERNAL UBool U_EXPORT2 uprv_isPositiveInfinity(double d); michael@0: /** michael@0: * Floating point utility to determine if a double has a negative infinite value. michael@0: * @internal michael@0: */ michael@0: U_INTERNAL UBool U_EXPORT2 uprv_isNegativeInfinity(double d); michael@0: /** michael@0: * Floating point utility that returns a Not a Number (NaN) value. michael@0: * @internal michael@0: */ michael@0: U_INTERNAL double U_EXPORT2 uprv_getNaN(void); michael@0: /** michael@0: * Floating point utility that returns an infinite value. michael@0: * @internal michael@0: */ michael@0: U_INTERNAL double U_EXPORT2 uprv_getInfinity(void); michael@0: michael@0: /** michael@0: * Floating point utility to truncate a double. michael@0: * @internal michael@0: */ michael@0: U_INTERNAL double U_EXPORT2 uprv_trunc(double d); michael@0: /** michael@0: * Floating point utility to calculate the floor of a double. michael@0: * @internal michael@0: */ michael@0: U_INTERNAL double U_EXPORT2 uprv_floor(double d); michael@0: /** michael@0: * Floating point utility to calculate the ceiling of a double. michael@0: * @internal michael@0: */ michael@0: U_INTERNAL double U_EXPORT2 uprv_ceil(double d); michael@0: /** michael@0: * Floating point utility to calculate the absolute value of a double. michael@0: * @internal michael@0: */ michael@0: U_INTERNAL double U_EXPORT2 uprv_fabs(double d); michael@0: /** michael@0: * Floating point utility to calculate the fractional and integer parts of a double. michael@0: * @internal michael@0: */ michael@0: U_INTERNAL double U_EXPORT2 uprv_modf(double d, double* pinteger); michael@0: /** michael@0: * Floating point utility to calculate the remainder of a double divided by another double. michael@0: * @internal michael@0: */ michael@0: U_INTERNAL double U_EXPORT2 uprv_fmod(double d, double y); michael@0: /** michael@0: * Floating point utility to calculate d to the power of exponent (d^exponent). michael@0: * @internal michael@0: */ michael@0: U_INTERNAL double U_EXPORT2 uprv_pow(double d, double exponent); michael@0: /** michael@0: * Floating point utility to calculate 10 to the power of exponent (10^exponent). michael@0: * @internal michael@0: */ michael@0: U_INTERNAL double U_EXPORT2 uprv_pow10(int32_t exponent); michael@0: /** michael@0: * Floating point utility to calculate the maximum value of two doubles. michael@0: * @internal michael@0: */ michael@0: U_INTERNAL double U_EXPORT2 uprv_fmax(double d, double y); michael@0: /** michael@0: * Floating point utility to calculate the minimum value of two doubles. michael@0: * @internal michael@0: */ michael@0: U_INTERNAL double U_EXPORT2 uprv_fmin(double d, double y); michael@0: /** michael@0: * Private utility to calculate the maximum value of two integers. michael@0: * @internal michael@0: */ michael@0: U_INTERNAL int32_t U_EXPORT2 uprv_max(int32_t d, int32_t y); michael@0: /** michael@0: * Private utility to calculate the minimum value of two integers. michael@0: * @internal michael@0: */ michael@0: U_INTERNAL int32_t U_EXPORT2 uprv_min(int32_t d, int32_t y); michael@0: michael@0: #if U_IS_BIG_ENDIAN michael@0: # define uprv_isNegative(number) (*((signed char *)&(number))<0) michael@0: #else michael@0: # define uprv_isNegative(number) (*((signed char *)&(number)+sizeof(number)-1)<0) michael@0: #endif michael@0: michael@0: /** michael@0: * Return the largest positive number that can be represented by an integer michael@0: * type of arbitrary bit length. michael@0: * @internal michael@0: */ michael@0: U_INTERNAL double U_EXPORT2 uprv_maxMantissa(void); michael@0: michael@0: /** michael@0: * Floating point utility to calculate the logarithm of a double. michael@0: * @internal michael@0: */ michael@0: U_INTERNAL double U_EXPORT2 uprv_log(double d); michael@0: michael@0: /** michael@0: * Does common notion of rounding e.g. uprv_floor(x + 0.5); michael@0: * @param x the double number michael@0: * @return the rounded double michael@0: * @internal michael@0: */ michael@0: U_INTERNAL double U_EXPORT2 uprv_round(double x); michael@0: michael@0: #if 0 michael@0: /** michael@0: * Returns the number of digits after the decimal point in a double number x. michael@0: * michael@0: * @param x the double number michael@0: * @return the number of digits after the decimal point in a double number x. michael@0: * @internal michael@0: */ michael@0: /*U_INTERNAL int32_t U_EXPORT2 uprv_digitsAfterDecimal(double x);*/ michael@0: #endif michael@0: michael@0: #if !U_CHARSET_IS_UTF8 michael@0: /** michael@0: * Please use ucnv_getDefaultName() instead. michael@0: * Return the default codepage for this platform and locale. michael@0: * This function can call setlocale() on Unix platforms. Please read the michael@0: * platform documentation on setlocale() before calling this function. michael@0: * @return the default codepage for this platform michael@0: * @internal michael@0: */ michael@0: U_INTERNAL const char* U_EXPORT2 uprv_getDefaultCodepage(void); michael@0: #endif michael@0: michael@0: /** michael@0: * Please use uloc_getDefault() instead. michael@0: * Return the default locale ID string by querying ths system, or michael@0: * zero if one cannot be found. michael@0: * This function can call setlocale() on Unix platforms. Please read the michael@0: * platform documentation on setlocale() before calling this function. michael@0: * @return the default locale ID string michael@0: * @internal michael@0: */ michael@0: U_INTERNAL const char* U_EXPORT2 uprv_getDefaultLocaleID(void); michael@0: michael@0: /** michael@0: * Time zone utilities michael@0: * michael@0: * Wrappers for C runtime library functions relating to timezones. michael@0: * The t_tzset() function (similar to tzset) uses the current setting michael@0: * of the environment variable TZ to assign values to three global michael@0: * variables: daylight, timezone, and tzname. These variables have the michael@0: * following meanings, and are declared in <time.h>. michael@0: * michael@0: * daylight Nonzero if daylight-saving-time zone (DST) is specified michael@0: * in TZ; otherwise, 0. Default value is 1. michael@0: * timezone Difference in seconds between coordinated universal michael@0: * time and local time. E.g., -28,800 for PST (GMT-8hrs) michael@0: * tzname(0) Three-letter time-zone name derived from TZ environment michael@0: * variable. E.g., "PST". michael@0: * tzname(1) Three-letter DST zone name derived from TZ environment michael@0: * variable. E.g., "PDT". If DST zone is omitted from TZ, michael@0: * tzname(1) is an empty string. michael@0: * michael@0: * Notes: For example, to set the TZ environment variable to correspond michael@0: * to the current time zone in Germany, you can use one of the michael@0: * following statements: michael@0: * michael@0: * set TZ=GST1GDT michael@0: * set TZ=GST+1GDT michael@0: * michael@0: * If the TZ value is not set, t_tzset() attempts to use the time zone michael@0: * information specified by the operating system. Under Windows NT michael@0: * and Windows 95, this information is specified in the Control Panel's michael@0: * Date/Time application. michael@0: * @internal michael@0: */ michael@0: U_INTERNAL void U_EXPORT2 uprv_tzset(void); michael@0: michael@0: /** michael@0: * Difference in seconds between coordinated universal michael@0: * time and local time. E.g., -28,800 for PST (GMT-8hrs) michael@0: * @return the difference in seconds between coordinated universal time and local time. michael@0: * @internal michael@0: */ michael@0: U_INTERNAL int32_t U_EXPORT2 uprv_timezone(void); michael@0: michael@0: /** michael@0: * tzname(0) Three-letter time-zone name derived from TZ environment michael@0: * variable. E.g., "PST". michael@0: * tzname(1) Three-letter DST zone name derived from TZ environment michael@0: * variable. E.g., "PDT". If DST zone is omitted from TZ, michael@0: * tzname(1) is an empty string. michael@0: * @internal michael@0: */ michael@0: U_INTERNAL const char* U_EXPORT2 uprv_tzname(int n); michael@0: michael@0: /** michael@0: * Get UTC (GMT) time measured in milliseconds since 0:00 on 1/1/1970. michael@0: * This function is affected by 'faketime' and should be the bottleneck for all user-visible ICU time functions. michael@0: * @return the UTC time measured in milliseconds michael@0: * @internal michael@0: */ michael@0: U_INTERNAL UDate U_EXPORT2 uprv_getUTCtime(void); michael@0: michael@0: /** michael@0: * Get UTC (GMT) time measured in milliseconds since 0:00 on 1/1/1970. michael@0: * This function is not affected by 'faketime', so it should only be used by low level test functions- not by anything that michael@0: * exposes time to the end user. michael@0: * @return the UTC time measured in milliseconds michael@0: * @internal michael@0: */ michael@0: U_INTERNAL UDate U_EXPORT2 uprv_getRawUTCtime(void); michael@0: michael@0: /** michael@0: * Determine whether a pathname is absolute or not, as defined by the platform. michael@0: * @param path Pathname to test michael@0: * @return TRUE if the path is absolute michael@0: * @internal (ICU 3.0) michael@0: */ michael@0: U_INTERNAL UBool U_EXPORT2 uprv_pathIsAbsolute(const char *path); michael@0: michael@0: /** michael@0: * Use U_MAX_PTR instead of this function. michael@0: * @param void pointer to test michael@0: * @return the largest possible pointer greater than the base michael@0: * @internal (ICU 3.8) michael@0: */ michael@0: U_INTERNAL void * U_EXPORT2 uprv_maximumPtr(void *base); michael@0: michael@0: /** michael@0: * Maximum value of a (void*) - use to indicate the limit of an 'infinite' buffer. michael@0: * In fact, buffer sizes must not exceed 2GB so that the difference between michael@0: * the buffer limit and the buffer start can be expressed in an int32_t. michael@0: * michael@0: * The definition of U_MAX_PTR must fulfill the following conditions: michael@0: * - return the largest possible pointer greater than base michael@0: * - return a valid pointer according to the machine architecture (AS/400, 64-bit, etc.) michael@0: * - avoid wrapping around at high addresses michael@0: * - make sure that the returned pointer is not farther from base than 0x7fffffff bytes michael@0: * michael@0: * @param base The beginning of a buffer to find the maximum offset from michael@0: * @internal michael@0: */ michael@0: #ifndef U_MAX_PTR michael@0: # if U_PLATFORM == U_PF_OS390 && !defined(_LP64) michael@0: /* We have 31-bit pointers. */ michael@0: # define U_MAX_PTR(base) ((void *)0x7fffffff) michael@0: # elif U_PLATFORM == U_PF_OS400 michael@0: # define U_MAX_PTR(base) uprv_maximumPtr((void *)base) michael@0: # elif 0 michael@0: /* michael@0: * For platforms where pointers are scalar values (which is normal, but unlike i5/OS) michael@0: * but that do not define uintptr_t. michael@0: * michael@0: * However, this does not work on modern compilers: michael@0: * The C++ standard does not define pointer overflow, and allows compilers to michael@0: * assume that p+u>p for any pointer p and any integer u>0. michael@0: * Thus, modern compilers optimize away the ">" comparison. michael@0: * (See ICU tickets #7187 and #8096.) michael@0: */ michael@0: # define U_MAX_PTR(base) \ michael@0: ((void *)(((char *)(base)+0x7fffffffu) > (char *)(base) \ michael@0: ? ((char *)(base)+0x7fffffffu) \ michael@0: : (char *)-1)) michael@0: # else michael@0: /* Default version. C++ standard compliant for scalar pointers. */ michael@0: # define U_MAX_PTR(base) \ michael@0: ((void *)(((uintptr_t)(base)+0x7fffffffu) > (uintptr_t)(base) \ michael@0: ? ((uintptr_t)(base)+0x7fffffffu) \ michael@0: : (uintptr_t)-1)) michael@0: # endif michael@0: #endif michael@0: michael@0: /* Dynamic Library Functions */ michael@0: michael@0: typedef void (UVoidFunction)(void); michael@0: michael@0: #if U_ENABLE_DYLOAD michael@0: /** michael@0: * Load a library michael@0: * @internal (ICU 4.4) michael@0: */ michael@0: U_INTERNAL void * U_EXPORT2 uprv_dl_open(const char *libName, UErrorCode *status); michael@0: michael@0: /** michael@0: * Close a library michael@0: * @internal (ICU 4.4) michael@0: */ michael@0: U_INTERNAL void U_EXPORT2 uprv_dl_close( void *lib, UErrorCode *status); michael@0: michael@0: /** michael@0: * Extract a symbol from a library (function) michael@0: * @internal (ICU 4.8) michael@0: */ michael@0: U_INTERNAL UVoidFunction* U_EXPORT2 uprv_dlsym_func( void *lib, const char *symbolName, UErrorCode *status); michael@0: michael@0: /** michael@0: * Extract a symbol from a library (function) michael@0: * Not implemented, no clients. michael@0: * @internal michael@0: */ michael@0: /* U_INTERNAL void * U_EXPORT2 uprv_dlsym_data( void *lib, const char *symbolName, UErrorCode *status); */ michael@0: michael@0: #endif michael@0: michael@0: /** michael@0: * Define malloc and related functions michael@0: * @internal michael@0: */ michael@0: #if U_PLATFORM == U_PF_OS400 michael@0: # define uprv_default_malloc(x) _C_TS_malloc(x) michael@0: # define uprv_default_realloc(x,y) _C_TS_realloc(x,y) michael@0: # define uprv_default_free(x) _C_TS_free(x) michael@0: /* also _C_TS_calloc(x) */ michael@0: #else michael@0: /* C defaults */ michael@0: # define uprv_default_malloc(x) malloc(x) michael@0: # define uprv_default_realloc(x,y) realloc(x,y) michael@0: # define uprv_default_free(x) free(x) michael@0: #endif michael@0: michael@0: michael@0: #endif