]>
Commit | Line | Data |
---|---|---|
b75a7d8f A |
1 | /* |
2 | ****************************************************************************** | |
3 | * * | |
374ca955 | 4 | * Copyright (C) 2001-2004, International Business Machines * |
b75a7d8f A |
5 | * Corporation and others. All Rights Reserved. * |
6 | * * | |
7 | ****************************************************************************** | |
374ca955 | 8 | * file name: ucln_in.c |
b75a7d8f A |
9 | * encoding: US-ASCII |
10 | * tab size: 8 (not used) | |
11 | * indentation:4 | |
12 | * | |
13 | * created on: 2001July05 | |
14 | * created by: George Rhoten | |
15 | */ | |
16 | ||
17 | #include "ucln.h" | |
18 | #include "ucln_in.h" | |
374ca955 | 19 | #include "uassert.h" |
b75a7d8f A |
20 | |
21 | /* Leave this copyright notice here! It needs to go somewhere in this library. */ | |
22 | static const char copyright[] = U_COPYRIGHT_STRING; | |
23 | ||
374ca955 A |
24 | static cleanupFunc *gCleanupFunctions[UCLN_I18N_COUNT]; |
25 | ||
b75a7d8f A |
26 | static UBool i18n_cleanup(void) |
27 | { | |
374ca955 A |
28 | ECleanupI18NType libType; |
29 | ||
30 | for (libType = UCLN_I18N_START+1; libType<UCLN_I18N_COUNT; libType++) { | |
31 | if (gCleanupFunctions[libType]) | |
32 | { | |
33 | gCleanupFunctions[libType](); | |
34 | gCleanupFunctions[libType] = NULL; | |
35 | } | |
36 | } | |
b75a7d8f A |
37 | return TRUE; |
38 | } | |
39 | ||
374ca955 A |
40 | void ucln_i18n_registerCleanup(ECleanupI18NType type, |
41 | cleanupFunc *func) | |
b75a7d8f | 42 | { |
374ca955 | 43 | U_ASSERT(UCLN_I18N_START < type && type < UCLN_I18N_COUNT); |
b75a7d8f | 44 | ucln_registerCleanup(UCLN_I18N, i18n_cleanup); |
374ca955 A |
45 | if (UCLN_I18N_START < type && type < UCLN_I18N_COUNT) |
46 | { | |
47 | gCleanupFunctions[type] = func; | |
48 | } | |
b75a7d8f A |
49 | } |
50 |