]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/ucln_cmn.h
ICU-57166.0.1.tar.gz
[apple/icu.git] / icuSources / common / ucln_cmn.h
index 0ad0c721cd3051675981f4636a85288443a14cd0..2fdf1c7a67e97cefde124c29885646528f4cba2a 100644 (file)
@@ -1,9 +1,7 @@
 /*
 ******************************************************************************
-*                                                                            *
-* Copyright (C) 2001-2003, International Business Machines                   *
-*                Corporation and others. All Rights Reserved.                *
-*                                                                            *
+* Copyright (C) 2001-2016, International Business Machines
+*                Corporation and others. All Rights Reserved.
 ******************************************************************************
 *   file name:  ucln_cmn.h
 *   encoding:   US-ASCII
 #define __UCLN_CMN_H__
 
 #include "unicode/utypes.h"
+#include "ucln.h"
 
 /* These are the cleanup functions for various APIs. */
 /* @return true if cleanup complete successfully.*/
-U_CFUNC UBool unames_cleanup(void);
+U_CFUNC UBool umtx_cleanup(void);
 
-U_CFUNC UBool unorm_cleanup(void);
+U_CFUNC UBool utrace_cleanup(void);
 
-U_CFUNC UBool uchar_cleanup(void);
+U_CFUNC UBool ucln_lib_cleanup(void);
 
-U_CFUNC UBool pname_cleanup(void);
-
-U_CFUNC UBool locale_cleanup(void);
-
-U_CFUNC UBool uloc_cleanup(void);
-
-U_CFUNC UBool breakiterator_cleanup(void);
-
-U_CFUNC UBool ustrprep_cleanup(void);
-
-U_CFUNC UBool U_EXPORT2 ucnv_cleanup(void);
-
-U_CFUNC UBool ucnv_io_cleanup(void);
-
-U_CFUNC UBool ures_cleanup(void);
-
-U_CFUNC UBool udata_cleanup(void);
-
-U_CFUNC UBool putil_cleanup(void);
-
-U_CFUNC UBool uset_cleanup(void);
-
-U_CFUNC UBool service_cleanup(void);
-
-
-/* Only mutexes should be initialized in these functions. */
-
-U_CFUNC void ucnv_init(UErrorCode *status);
-
-U_CFUNC void ures_init(UErrorCode *status);
+/*
+Please keep the order of enums declared in same order
+as the cleanup functions are suppose to be called. */
+typedef enum ECleanupCommonType {
+    UCLN_COMMON_START = -1,
+    UCLN_COMMON_USPREP,
+    UCLN_COMMON_BREAKITERATOR,
+    UCLN_COMMON_BREAKITERATOR_DICT,
+    UCLN_COMMON_SERVICE,
+    UCLN_COMMON_LOCALE_KEY_TYPE,
+    UCLN_COMMON_LOCALE,
+    UCLN_COMMON_LOCALE_AVAILABLE,
+    UCLN_COMMON_ULOC,
+    UCLN_COMMON_CURRENCY,
+    UCLN_COMMON_LOADED_NORMALIZER2,
+    UCLN_COMMON_NORMALIZER2,
+    UCLN_COMMON_USET,
+    UCLN_COMMON_UNAMES,
+    UCLN_COMMON_UPROPS,
+    UCLN_COMMON_UCNV,
+    UCLN_COMMON_UCNV_IO,
+    UCLN_COMMON_UDATA,
+    UCLN_COMMON_PUTIL,
+    UCLN_COMMON_LIST_FORMATTER,
+    UCLN_COMMON_UINIT,
+
+    /*
+       Unified caches caches collation stuff. Collation data structures
+       contain resource bundles which means that unified cache cleanup
+       must happen before resource bundle clean up.
+    */
+    UCLN_COMMON_UNIFIED_CACHE,
+    UCLN_COMMON_URES,
+    UCLN_COMMON_COUNT /* This must be last */
+} ECleanupCommonType;
+
+/* Main library cleanup registration function. */
+/* See common/ucln.h for details on adding a cleanup function. */
+/* Note: the global mutex must not be held when calling this function. */
+U_CFUNC void U_EXPORT2 ucln_common_registerCleanup(ECleanupCommonType type,
+                                                   cleanupFunc *func);
 
 #endif