/*
******************************************************************************
*
-* Copyright (C) 2001-2011, International Business Machines
+* Copyright (C) 2001-2012, International Business Machines
* Corporation and others. All Rights Reserved.
*
******************************************************************************
*/
U_CDECL_BEGIN
typedef UBool U_CALLCONV cleanupFunc(void);
+typedef void U_CALLCONV initFunc(UErrorCode *);
U_CDECL_END
/**
U_CAPI void U_EXPORT2 ucln_cleanupOne(ECleanupLibraryType type);
/* ucln_cmn.c variables shared with uinit.c */
-U_CDECL_BEGIN
-
-extern UBool gICUInitialized;
-extern UMTX gICUInitMutex;
-
-U_CDECL_END
+U_CFUNC UBool ucln_mutexedInit(initFunc *func, UErrorCode *status);
#endif
/*
******************************************************************************
-* Copyright (C) 2001-2011, International Business Machines
+* Copyright (C) 2001-2012, International Business Machines
* Corporation and others. All Rights Reserved.
******************************************************************************
* file name: ucln_cmn.c
#define UCLN_TYPE_IS_COMMON
#include "ucln_imp.h"
-U_CDECL_BEGIN
-
-UBool gICUInitialized = FALSE;
-UMTX gICUInitMutex = NULL;
-
-U_CDECL_END
+static UBool gICUInitialized = FALSE;
+static UMTX gICUInitMutex = NULL;
static cleanupFunc *gCommonCleanupFunctions[UCLN_COMMON_COUNT];
static cleanupFunc *gLibCleanupFunctions[UCLN_COMMON];
+U_CFUNC UBool ucln_mutexedInit(initFunc *func, UErrorCode *status) {
+ UBool initialized = FALSE;
+ umtx_lock(&gICUInitMutex);
+ if (!gICUInitialized && U_SUCCESS(*status)) {
+ if (func != NULL) {
+ func(status);
+ }
+ gICUInitialized = TRUE; /* TODO: don't set if U_FAILURE? */
+ initialized = TRUE;
+ }
+ umtx_unlock(&gICUInitMutex);
+ return initialized;
+}
+
/************************************************
The cleanup order is important in this function.
Please be sure that you have read ucln.h
/*
******************************************************************************
* *
-* Copyright (C) 2001-2011, International Business Machines *
+* Copyright (C) 2001-2012, International Business Machines *
* Corporation and others. All Rights Reserved. *
* *
******************************************************************************
#include "umutex.h"
#include "utracimp.h"
-/*
- * ICU Initialization Function. Need not be called.
- */
-U_CAPI void U_EXPORT2
-u_init(UErrorCode *status) {
- UTRACE_ENTRY_OC(UTRACE_U_INIT);
- /* initialize plugins */
- uplug_init(status);
-
- umtx_lock(&gICUInitMutex);
- if (gICUInitialized || U_FAILURE(*status)) {
- umtx_unlock(&gICUInitMutex);
- UTRACE_EXIT_STATUS(*status);
- return;
- }
-
+static void U_CALLCONV
+initData(UErrorCode *status)
+{
/*
* 2005-may-02
*
#if !UCONFIG_NO_CONVERSION
ucnv_io_countKnownConverters(status);
#endif
+}
+
+/*
+ * ICU Initialization Function. Need not be called.
+ */
+U_CAPI void U_EXPORT2
+u_init(UErrorCode *status) {
+ UTRACE_ENTRY_OC(UTRACE_U_INIT);
+
+ /* initialize plugins */
+ uplug_init(status);
+ ucln_mutexedInit(initData, status);
- gICUInitialized = TRUE; /* TODO: don't set if U_FAILURE? */
- umtx_unlock(&gICUInitMutex);
UTRACE_EXIT_STATUS(*status);
}
/* U_DISABLE_RENAMING can be defined in the following ways:
* - when running configure, e.g.
- * runConfigureICU Linux CPPFLAGS="-DU_DISABLE_RENAMING"
+ * runConfigureICU Linux --disable-renaming
* - by changing the default setting of U_DISABLE_RENAMING in uconfig.h
*/
/* C exports renaming data */
-#define DECPOWERS U_ICU_ENTRY_POINT_RENAME(DECPOWERS)
-#define DECSTICKYTAB U_ICU_ENTRY_POINT_RENAME(DECSTICKYTAB)
#define T_CString_int64ToString U_ICU_ENTRY_POINT_RENAME(T_CString_int64ToString)
#define T_CString_integerToString U_ICU_ENTRY_POINT_RENAME(T_CString_integerToString)
#define T_CString_stringToInteger U_ICU_ENTRY_POINT_RENAME(T_CString_stringToInteger)
#define bms_setTargetString U_ICU_ENTRY_POINT_RENAME(bms_setTargetString)
#define cmemory_cleanup U_ICU_ENTRY_POINT_RENAME(cmemory_cleanup)
#define cmemory_inUse U_ICU_ENTRY_POINT_RENAME(cmemory_inUse)
-#define d2utable U_ICU_ENTRY_POINT_RENAME(d2utable)
-#define deleteCEList U_ICU_ENTRY_POINT_RENAME(deleteCEList)
-#define deleteChars U_ICU_ENTRY_POINT_RENAME(deleteChars)
-#define deleteCollDataCacheEntry U_ICU_ENTRY_POINT_RENAME(deleteCollDataCacheEntry)
-#define deleteStringList U_ICU_ENTRY_POINT_RENAME(deleteStringList)
-#define deleteUnicodeStringKey U_ICU_ENTRY_POINT_RENAME(deleteUnicodeStringKey)
-#define gICUInitMutex U_ICU_ENTRY_POINT_RENAME(gICUInitMutex)
-#define gICUInitialized U_ICU_ENTRY_POINT_RENAME(gICUInitialized)
#define izrule_clone U_ICU_ENTRY_POINT_RENAME(izrule_clone)
#define izrule_close U_ICU_ENTRY_POINT_RENAME(izrule_close)
#define izrule_equals U_ICU_ENTRY_POINT_RENAME(izrule_equals)
#define ucln_i18n_registerCleanup U_ICU_ENTRY_POINT_RENAME(ucln_i18n_registerCleanup)
#define ucln_io_registerCleanup U_ICU_ENTRY_POINT_RENAME(ucln_io_registerCleanup)
#define ucln_lib_cleanup U_ICU_ENTRY_POINT_RENAME(ucln_lib_cleanup)
+#define ucln_mutexedInit U_ICU_ENTRY_POINT_RENAME(ucln_mutexedInit)
#define ucln_registerCleanup U_ICU_ENTRY_POINT_RENAME(ucln_registerCleanup)
#define ucnv_MBCSFromUChar32 U_ICU_ENTRY_POINT_RENAME(ucnv_MBCSFromUChar32)
#define ucnv_MBCSFromUnicodeWithOffsets U_ICU_ENTRY_POINT_RENAME(ucnv_MBCSFromUnicodeWithOffsets)
#define ucol_findReorderingEntry U_ICU_ENTRY_POINT_RENAME(ucol_findReorderingEntry)
#define ucol_forceHanImplicit U_ICU_ENTRY_POINT_RENAME(ucol_forceHanImplicit)
#define ucol_forgetUCA U_ICU_ENTRY_POINT_RENAME(ucol_forgetUCA)
-#define ucol_freeOffsetBuffer U_ICU_ENTRY_POINT_RENAME(ucol_freeOffsetBuffer)
#define ucol_getAttribute U_ICU_ENTRY_POINT_RENAME(ucol_getAttribute)
#define ucol_getAttributeOrDefault U_ICU_ENTRY_POINT_RENAME(ucol_getAttributeOrDefault)
#define ucol_getAvailable U_ICU_ENTRY_POINT_RENAME(ucol_getAvailable)
#define ucol_tok_assembleTokenList U_ICU_ENTRY_POINT_RENAME(ucol_tok_assembleTokenList)
#define ucol_tok_closeTokenList U_ICU_ENTRY_POINT_RENAME(ucol_tok_closeTokenList)
#define ucol_tok_getNextArgument U_ICU_ENTRY_POINT_RENAME(ucol_tok_getNextArgument)
-#define ucol_tok_getRulesFromBundle U_ICU_ENTRY_POINT_RENAME(ucol_tok_getRulesFromBundle)
#define ucol_tok_initTokenList U_ICU_ENTRY_POINT_RENAME(ucol_tok_initTokenList)
#define ucol_tok_parseNextToken U_ICU_ENTRY_POINT_RENAME(ucol_tok_parseNextToken)
#define ucol_updateInternalState U_ICU_ENTRY_POINT_RENAME(ucol_updateInternalState)
#define uenum_nextDefault U_ICU_ENTRY_POINT_RENAME(uenum_nextDefault)
#define uenum_openCharStringsEnumeration U_ICU_ENTRY_POINT_RENAME(uenum_openCharStringsEnumeration)
#define uenum_openFromStringEnumeration U_ICU_ENTRY_POINT_RENAME(uenum_openFromStringEnumeration)
+#define uenum_openUCharStringsEnumeration U_ICU_ENTRY_POINT_RENAME(uenum_openUCharStringsEnumeration)
#define uenum_reset U_ICU_ENTRY_POINT_RENAME(uenum_reset)
#define uenum_unext U_ICU_ENTRY_POINT_RENAME(uenum_unext)
#define uenum_unextDefault U_ICU_ENTRY_POINT_RENAME(uenum_unextDefault)
#define uprv_fmod U_ICU_ENTRY_POINT_RENAME(uprv_fmod)
#define uprv_free U_ICU_ENTRY_POINT_RENAME(uprv_free)
#define uprv_getCharNameCharacters U_ICU_ENTRY_POINT_RENAME(uprv_getCharNameCharacters)
-#define uprv_getDefaultCodepage U_ICU_ENTRY_POINT_RENAME(uprv_getDefaultCodepage)
#define uprv_getDefaultLocaleID U_ICU_ENTRY_POINT_RENAME(uprv_getDefaultLocaleID)
#define uprv_getInfinity U_ICU_ENTRY_POINT_RENAME(uprv_getInfinity)
#define uprv_getMaxCharNameLength U_ICU_ENTRY_POINT_RENAME(uprv_getMaxCharNameLength)
}
-U_CFUNC void deleteStringList(void *obj);
+U_CDECL_BEGIN
+static void U_CALLCONV
+deleteStringList(void *obj)
+{
+ StringList *strings = (StringList *) obj;
+
+ delete strings;
+}
+static void U_CALLCONV
+deleteCEList(void *obj)
+{
+ CEList *list = (CEList *) obj;
+
+ delete list;
+}
+
+static void U_CALLCONV
+deleteUnicodeStringKey(void *obj)
+{
+ UnicodeString *key = (UnicodeString *) obj;
+
+ delete key;
+}
+
+static void U_CALLCONV
+deleteChars(void * /*obj*/)
+{
+ // char *chars = (char *) obj;
+ // All the key strings are owned by the
+ // CollData objects and don't need to
+ // be freed here.
+ //DELETE_ARRAY(chars);
+}
+
+U_CDECL_END
class CEToStringsMap : public UMemory
{
uhash_iput(map, ce, (void *) stringList, &status);
}
-U_CFUNC void deleteStringList(void *obj)
-{
- StringList *strings = (StringList *) obj;
-
- delete strings;
-}
-
-U_CFUNC void deleteCEList(void *obj);
-U_CFUNC void deleteUnicodeStringKey(void *obj);
-
class StringToCEsMap : public UMemory
{
public:
return (const CEList *) uhash_get(map, string);
}
-U_CFUNC void deleteCEList(void *obj)
-{
- CEList *list = (CEList *) obj;
-
- delete list;
-}
-
-U_CFUNC void deleteUnicodeStringKey(void *obj)
-{
- UnicodeString *key = (UnicodeString *) obj;
-
- delete key;
-}
-
class CollDataCacheEntry : public UMemory
{
public:
};
static UMTX lock;
-U_CFUNC void deleteChars(void * /*obj*/)
-{
- // char *chars = (char *) obj;
- // All the key strings are owned by the
- // CollData objects and don't need to
- // be freed here.
- //DELETE_ARRAY(chars);
-}
-
-U_CFUNC void deleteCollDataCacheEntry(void *obj)
+U_CDECL_BEGIN
+static void U_CALLCONV
+deleteCollDataCacheEntry(void *obj)
{
CollDataCacheEntry *entry = (CollDataCacheEntry *) obj;
delete entry;
}
+U_CDECL_END
CollDataCache::CollDataCache(UErrorCode &status)
: cache(NULL)
/* ------------------------------------------------------------------ */
/* Decimal Context module */
/* ------------------------------------------------------------------ */
-/* Copyright (c) IBM Corporation, 2000-2011. All rights reserved. */
+/* Copyright (c) IBM Corporation, 2000-2012. All rights reserved. */
/* */
/* This software is made available under the terms of the */
/* ICU License -- ICU 1.8.1 and later. */
#define LITEND *mfctop /* named flag; 1=little-endian */
#endif
-/* ------------------------------------------------------------------ */
-/* round-for-reround digits */
-/* ------------------------------------------------------------------ */
-const uByte DECSTICKYTAB[10]={1,1,2,3,4,6,6,7,8,9}; /* used if sticky */
-
-/* ------------------------------------------------------------------ */
-/* Powers of ten (powers[n]==10**n, 0<=n<=9) */
-/* ------------------------------------------------------------------ */
-const uInt DECPOWERS[10]={1, 10, 100, 1000, 10000, 100000, 1000000,
- 10000000, 100000000, 1000000000};
-
/* ------------------------------------------------------------------ */
/* decContextClearStatus -- clear bits in current status */
/* */
/* Constants */
/* Public lookup table used by the D2U macro */
-const uByte d2utable[DECMAXD2U+1]=D2UTABLE;
+static const uByte d2utable[DECMAXD2U+1]=D2UTABLE;
#define DECVERB 1 /* set to 1 for verbose DECCHECK */
#define powers DECPOWERS /* old internal name */
static const Unit uarrone[1]={1}; /* Unit array of 1, used for incrementing */
+/* ------------------------------------------------------------------ */
+/* round-for-reround digits */
+/* ------------------------------------------------------------------ */
+static const uByte DECSTICKYTAB[10]={1,1,2,3,4,6,6,7,8,9}; /* used if sticky */
+
+/* ------------------------------------------------------------------ */
+/* Powers of ten (powers[n]==10**n, 0<=n<=9) */
+/* ------------------------------------------------------------------ */
+static const uInt DECPOWERS[10]={1, 10, 100, 1000, 10000, 100000, 1000000,
+ 10000000, 100000000, 1000000000};
+
+
/* Granularity-dependent code */
#if DECDPUN<=4
#define eInt Int /* extended integer */
/* ------------------------------------------------------------------ */
/* decNumber package local type, tuning, and macro definitions */
/* ------------------------------------------------------------------ */
-/* Copyright (c) IBM Corporation, 2000-2010. All rights reserved. */
+/* Copyright (c) IBM Corporation, 2000-2012. All rights reserved. */
/* */
/* This software is made available under the terms of the */
/* ICU License -- ICU 1.8.1 and later. */
#define long ?? /* .. or 'long' types are not used */
#endif
- /* Shared lookup tables */
- extern const uByte DECSTICKYTAB[10]; /* re-round digits if sticky */
- extern const uInt DECPOWERS[10]; /* powers of ten table */
- /* The following are included from decDPD.h */
- extern const uShort DPD2BIN[1024]; /* DPD -> 0-999 */
- extern const uShort BIN2DPD[1000]; /* 0-999 -> DPD */
- extern const uInt DPD2BINK[1024]; /* DPD -> 0-999000 */
- extern const uInt DPD2BINM[1024]; /* DPD -> 0-999000000 */
- extern const uByte DPD2BCD8[4096]; /* DPD -> ddd + len */
- extern const uByte BIN2BCD8[4000]; /* 0-999 -> ddd + len */
- extern const uShort BCD2DPD[2458]; /* 0-0x999 -> DPD (0x999=2457)*/
-
/* LONGMUL32HI -- set w=(u*v)>>32, where w, u, and v are uInts */
/* (that is, sets w to be the high-order word of the 64-bit result; */
/* the low-order word is simply u*v.) */
/* ----- Shared data (in decNumber.c) ----- */
/* Public lookup table used by the D2U macro (see below) */
#define DECMAXD2U 49
- extern const uByte d2utable[DECMAXD2U+1];
+ /*extern const uByte d2utable[DECMAXD2U+1];*/
/* ----- Macros ----- */
/* ISZERO -- return true if decNumber dn is a zero */
($_, $address, $type) = split(/\|/);
chop $qtype;
} elsif ($mode =~ /Mach-O/) {
- if(/^(?:[0-9a-fA-F]){8} ([A-Z]) (?:_)?(.*)$/) {
- ($_, $type) = ($2, $1);
+ ($address, $type, $_) = split(/ /);
+ if(/^_(.*)$/) {
+ $_ = $1;
} else {
next;
}