1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/intl/icu/source/i18n/ucln_in.c Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,60 @@ 1.4 +/* 1.5 +****************************************************************************** 1.6 +* * 1.7 +* Copyright (C) 2001-2009, International Business Machines * 1.8 +* Corporation and others. All Rights Reserved. * 1.9 +* * 1.10 +****************************************************************************** 1.11 +* file name: ucln_in.c 1.12 +* encoding: US-ASCII 1.13 +* tab size: 8 (not used) 1.14 +* indentation:4 1.15 +* 1.16 +* created on: 2001July05 1.17 +* created by: George Rhoten 1.18 +*/ 1.19 + 1.20 +#include "ucln.h" 1.21 +#include "ucln_in.h" 1.22 +#include "uassert.h" 1.23 + 1.24 +/** Auto-client for UCLN_I18N **/ 1.25 +#define UCLN_TYPE UCLN_I18N 1.26 +#include "ucln_imp.h" 1.27 + 1.28 +/* Leave this copyright notice here! It needs to go somewhere in this library. */ 1.29 +static const char copyright[] = U_COPYRIGHT_STRING; 1.30 + 1.31 +static cleanupFunc *gCleanupFunctions[UCLN_I18N_COUNT]; 1.32 + 1.33 +static UBool i18n_cleanup(void) 1.34 +{ 1.35 + ECleanupI18NType libType = UCLN_I18N_START; 1.36 + 1.37 + while (++libType<UCLN_I18N_COUNT) { 1.38 + if (gCleanupFunctions[libType]) 1.39 + { 1.40 + gCleanupFunctions[libType](); 1.41 + gCleanupFunctions[libType] = NULL; 1.42 + } 1.43 + } 1.44 +#if !UCLN_NO_AUTO_CLEANUP && (defined(UCLN_AUTO_ATEXIT) || defined(UCLN_AUTO_LOCAL)) 1.45 + ucln_unRegisterAutomaticCleanup(); 1.46 +#endif 1.47 + return TRUE; 1.48 +} 1.49 + 1.50 +void ucln_i18n_registerCleanup(ECleanupI18NType type, 1.51 + cleanupFunc *func) 1.52 +{ 1.53 + U_ASSERT(UCLN_I18N_START < type && type < UCLN_I18N_COUNT); 1.54 + ucln_registerCleanup(UCLN_I18N, i18n_cleanup); 1.55 + if (UCLN_I18N_START < type && type < UCLN_I18N_COUNT) 1.56 + { 1.57 + gCleanupFunctions[type] = func; 1.58 + } 1.59 +#if !UCLN_NO_AUTO_CLEANUP && (defined(UCLN_AUTO_ATEXIT) || defined(UCLN_AUTO_LOCAL)) 1.60 + ucln_registerAutomaticCleanup(); 1.61 +#endif 1.62 +} 1.63 +