]> git.saurik.com Git - apple/icu.git/blame - icuSources/common/ucln_cmn.c
ICU-6.2.4.tar.gz
[apple/icu.git] / icuSources / common / ucln_cmn.c
CommitLineData
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******************************************************************************
8* file name: ucln_cmn.c
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 "unicode/utypes.h"
18#include "unicode/uclean.h"
374ca955 19#include "utracimp.h"
b75a7d8f
A
20#include "ustr_imp.h"
21#include "unormimp.h"
22#include "ucln_cmn.h"
23#include "umutex.h"
24#include "ucln.h"
374ca955
A
25#include "cmemory.h"
26#include "uassert.h"
b75a7d8f 27
374ca955 28static cleanupFunc *gCommonCleanupFunctions[UCLN_COMMON_COUNT];
b75a7d8f 29
374ca955
A
30void ucln_common_registerCleanup(ECleanupCommonType type,
31 cleanupFunc *func)
b75a7d8f 32{
374ca955
A
33 U_ASSERT(UCLN_COMMON_START < type && type < UCLN_COMMON_COUNT);
34 if (UCLN_COMMON_START < type && type < UCLN_COMMON_COUNT)
b75a7d8f 35 {
374ca955 36 gCommonCleanupFunctions[type] = func;
b75a7d8f
A
37 }
38}
39
374ca955
A
40U_CFUNC UBool ucln_common_lib_cleanup(void) {
41 ECleanupCommonType commonFunc;
b75a7d8f 42
374ca955
A
43 for (commonFunc = UCLN_COMMON_START+1; commonFunc<UCLN_COMMON_COUNT; commonFunc++) {
44 if (gCommonCleanupFunctions[commonFunc])
b75a7d8f 45 {
374ca955
A
46 gCommonCleanupFunctions[commonFunc]();
47 gCommonCleanupFunctions[commonFunc] = NULL;
b75a7d8f 48 }
b75a7d8f 49 }
374ca955 50 return TRUE;
b75a7d8f
A
51}
52