]>
git.saurik.com Git - apple/icu.git/blob - icuSources/i18n/ucln_in.cpp
2 ******************************************************************************
4 * Copyright (C) 2001-2014, International Business Machines *
5 * Corporation and others. All Rights Reserved. *
7 ******************************************************************************
8 * file name: ucln_in.cpp
10 * tab size: 8 (not used)
13 * created on: 2001July05
14 * created by: George Rhoten
22 /** Auto-client for UCLN_I18N **/
23 #define UCLN_TYPE UCLN_I18N
26 /* Leave this copyright notice here! It needs to go somewhere in this library. */
27 static const char copyright
[] = U_COPYRIGHT_STRING
;
29 static cleanupFunc
*gCleanupFunctions
[UCLN_I18N_COUNT
];
31 static UBool
i18n_cleanup(void)
33 int32_t libType
= UCLN_I18N_START
;
34 (void)copyright
; /* Suppress unused variable warning with clang. */
36 while (++libType
<UCLN_I18N_COUNT
) {
37 if (gCleanupFunctions
[libType
])
39 gCleanupFunctions
[libType
]();
40 gCleanupFunctions
[libType
] = NULL
;
43 #if !UCLN_NO_AUTO_CLEANUP && (defined(UCLN_AUTO_ATEXIT) || defined(UCLN_AUTO_LOCAL))
44 ucln_unRegisterAutomaticCleanup();
49 void ucln_i18n_registerCleanup(ECleanupI18NType type
,
51 U_ASSERT(UCLN_I18N_START
< type
&& type
< UCLN_I18N_COUNT
);
53 icu::Mutex m
; // See ticket 10295 for discussion.
54 ucln_registerCleanup(UCLN_I18N
, i18n_cleanup
);
55 if (UCLN_I18N_START
< type
&& type
< UCLN_I18N_COUNT
) {
56 gCleanupFunctions
[type
] = func
;
59 #if !UCLN_NO_AUTO_CLEANUP && (defined(UCLN_AUTO_ATEXIT) || defined(UCLN_AUTO_LOCAL))
60 ucln_registerAutomaticCleanup();