2 ******************************************************************************
4 * Copyright (C) 2001-2006, International Business Machines *
5 * Corporation and others. All Rights Reserved. *
7 ******************************************************************************
8 * file name: ucln_cmn.c
10 * tab size: 8 (not used)
13 * created on: 2001July05
14 * created by: George Rhoten
17 #include "unicode/utypes.h"
18 #include "unicode/uclean.h"
28 static cleanupFunc
*gCommonCleanupFunctions
[UCLN_COMMON_COUNT
];
29 static cleanupFunc
*gLibCleanupFunctions
[UCLN_COMMON
];
32 ucln_common_registerCleanup(ECleanupCommonType type
,
35 U_ASSERT(UCLN_COMMON_START
< type
&& type
< UCLN_COMMON_COUNT
);
36 if (UCLN_COMMON_START
< type
&& type
< UCLN_COMMON_COUNT
)
38 gCommonCleanupFunctions
[type
] = func
;
43 ucln_registerCleanup(ECleanupLibraryType type
,
46 U_ASSERT(UCLN_START
< type
&& type
< UCLN_COMMON
);
47 if (UCLN_START
< type
&& type
< UCLN_COMMON
)
49 gLibCleanupFunctions
[type
] = func
;
53 U_CFUNC UBool
ucln_lib_cleanup(void) {
54 ECleanupLibraryType libType
= UCLN_START
;
55 ECleanupCommonType commonFunc
= UCLN_COMMON_START
;
57 for (libType
++; libType
<UCLN_COMMON
; libType
++) {
58 if (gLibCleanupFunctions
[libType
])
60 gLibCleanupFunctions
[libType
]();
61 gLibCleanupFunctions
[libType
] = NULL
;
65 for (commonFunc
++; commonFunc
<UCLN_COMMON_COUNT
; commonFunc
++) {
66 if (gCommonCleanupFunctions
[commonFunc
])
68 gCommonCleanupFunctions
[commonFunc
]();
69 gCommonCleanupFunctions
[commonFunc
] = NULL
;