2001-08-11 00:29:58 +00:00
|
|
|
/*
|
|
|
|
******************************************************************************
|
|
|
|
* *
|
|
|
|
* Copyright (C) 2001-2001, International Business Machines *
|
|
|
|
* Corporation and others. All Rights Reserved. *
|
|
|
|
* *
|
|
|
|
******************************************************************************
|
|
|
|
* file name: ucln_cmn.c
|
|
|
|
* encoding: US-ASCII
|
|
|
|
* tab size: 8 (not used)
|
|
|
|
* indentation:4
|
|
|
|
*
|
|
|
|
* created on: 2001July05
|
|
|
|
* created by: George Rhoten
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "unicode/uclean.h"
|
|
|
|
#include "ucln_cmn.h"
|
|
|
|
#include "umutex.h"
|
2001-08-30 02:59:19 +00:00
|
|
|
#include "ucln.h"
|
|
|
|
|
|
|
|
static cleanupFunc *gCleanupFunctions[UCLN_COMMON] = {
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
U_CAPI void U_EXPORT2
|
|
|
|
ucln_registerCleanup(ECleanupLibraryType type,
|
|
|
|
cleanupFunc *func)
|
|
|
|
{
|
|
|
|
if (UCLN_START < type && type < UCLN_COMMON)
|
|
|
|
{
|
|
|
|
gCleanupFunctions[type] = func;
|
|
|
|
}
|
|
|
|
}
|
2001-08-11 00:29:58 +00:00
|
|
|
|
2001-11-21 01:02:11 +00:00
|
|
|
U_CAPI void U_EXPORT2
|
|
|
|
u_cleanup(void)
|
2001-08-11 00:29:58 +00:00
|
|
|
{
|
2001-10-08 23:26:58 +00:00
|
|
|
|
2001-08-30 02:59:19 +00:00
|
|
|
ECleanupLibraryType libType = UCLN_START;
|
|
|
|
while (++libType < UCLN_COMMON)
|
|
|
|
{
|
|
|
|
if (gCleanupFunctions[libType])
|
|
|
|
{
|
|
|
|
gCleanupFunctions[libType]();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2002-05-29 18:36:09 +00:00
|
|
|
upropset_cleanup();
|
2001-09-06 01:22:23 +00:00
|
|
|
unorm_cleanup();
|
2001-08-31 02:14:47 +00:00
|
|
|
unames_cleanup();
|
|
|
|
uchar_cleanup();
|
2001-09-01 01:55:48 +00:00
|
|
|
locale_cleanup();
|
2001-08-25 01:13:21 +00:00
|
|
|
uloc_cleanup();
|
|
|
|
ustring_cleanup();
|
2001-10-04 20:58:06 +00:00
|
|
|
UnicodeConverter_cleanup(); /* <-- deprecated code */
|
2001-08-25 01:13:21 +00:00
|
|
|
ucnv_cleanup();
|
|
|
|
ucnv_io_cleanup();
|
|
|
|
ures_cleanup();
|
2001-08-17 00:18:49 +00:00
|
|
|
udata_cleanup();
|
2001-08-31 02:14:47 +00:00
|
|
|
putil_cleanup();
|
2001-10-04 20:58:06 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* WARNING! Destroying the global mutex can cause synchronization
|
|
|
|
* problems. ICU must be reinitialized from a single thread
|
|
|
|
* before the library is used again. You never want two
|
|
|
|
* threads trying to initialize the global mutex at the same
|
|
|
|
* time. The global mutex is being destroyed so that heap and
|
|
|
|
* resource checkers don't complain. [grhoten]
|
|
|
|
*/
|
|
|
|
umtx_destroy(NULL);
|
2001-08-17 00:18:49 +00:00
|
|
|
}
|
|
|
|
|