]>
git.saurik.com Git - apple/icu.git/blob - icuSources/i18n/ucln_in.c
2 ******************************************************************************
4 * Copyright (C) 2001-2009, International Business Machines *
5 * Corporation and others. All Rights Reserved. *
7 ******************************************************************************
10 * tab size: 8 (not used)
13 * created on: 2001July05
14 * created by: George Rhoten
21 /** Auto-client for UCLN_I18N **/
22 #define UCLN_TYPE UCLN_I18N
25 /* Leave this copyright notice here! It needs to go somewhere in this library. */
26 static const char copyright
[] = U_COPYRIGHT_STRING
;
28 static cleanupFunc
*gCleanupFunctions
[UCLN_I18N_COUNT
];
30 static UBool
i18n_cleanup(void)
32 ECleanupI18NType libType
= UCLN_I18N_START
;
34 while (++libType
<UCLN_I18N_COUNT
) {
35 if (gCleanupFunctions
[libType
])
37 gCleanupFunctions
[libType
]();
38 gCleanupFunctions
[libType
] = NULL
;
41 #if !UCLN_NO_AUTO_CLEANUP && (defined(UCLN_AUTO_ATEXIT) || defined(UCLN_AUTO_LOCAL))
42 ucln_unRegisterAutomaticCleanup();
47 void ucln_i18n_registerCleanup(ECleanupI18NType type
,
50 U_ASSERT(UCLN_I18N_START
< type
&& type
< UCLN_I18N_COUNT
);
51 ucln_registerCleanup(UCLN_I18N
, i18n_cleanup
);
52 if (UCLN_I18N_START
< type
&& type
< UCLN_I18N_COUNT
)
54 gCleanupFunctions
[type
] = func
;
56 #if !UCLN_NO_AUTO_CLEANUP && (defined(UCLN_AUTO_ATEXIT) || defined(UCLN_AUTO_LOCAL))
57 ucln_registerAutomaticCleanup();