1 | // © 2016 and later: Unicode, Inc. and others. |
2 | // License & terms of use: http://www.unicode.org/copyright.html |
3 | /* |
4 | ****************************************************************************** |
5 | * Copyright (C) 2001-2016, International Business Machines |
6 | * Corporation and others. All Rights Reserved. |
7 | ****************************************************************************** |
8 | * file name: ucln_cmn.h |
9 | * encoding: UTF-8 |
10 | * tab size: 8 (not used) |
11 | * indentation:4 |
12 | * |
13 | * created on: 2001July05 |
14 | * created by: George Rhoten |
15 | */ |
16 | |
17 | #ifndef __UCLN_CMN_H__ |
18 | #define __UCLN_CMN_H__ |
19 | |
20 | #include "unicode/utypes.h" |
21 | #include "ucln.h" |
22 | |
23 | /* These are the cleanup functions for various APIs. */ |
24 | /* @return true if cleanup complete successfully.*/ |
25 | U_CFUNC UBool utrace_cleanup(void); |
26 | |
27 | U_CFUNC UBool ucln_lib_cleanup(void); |
28 | |
29 | /* |
30 | Please keep the order of enums declared in same order |
31 | as the cleanup functions are suppose to be called. */ |
32 | typedef enum ECleanupCommonType { |
33 | UCLN_COMMON_START = -1, |
34 | UCLN_COMMON_NUMPARSE_UNISETS, |
35 | UCLN_COMMON_USPREP, |
36 | UCLN_COMMON_BREAKITERATOR, |
37 | UCLN_COMMON_RBBI, |
38 | UCLN_COMMON_SERVICE, |
39 | UCLN_COMMON_LOCALE_KEY_TYPE, |
40 | UCLN_COMMON_LOCALE, |
41 | UCLN_COMMON_LOCALE_ALIAS, |
42 | UCLN_COMMON_LOCALE_KNOWN_CANONICALIZED, |
43 | UCLN_COMMON_LOCALE_AVAILABLE, |
44 | UCLN_COMMON_LIKELY_SUBTAGS, |
45 | UCLN_COMMON_LOCALE_DISTANCE, |
46 | UCLN_COMMON_ULOC, |
47 | UCLN_COMMON_CURRENCY, |
48 | UCLN_COMMON_LOADED_NORMALIZER2, |
49 | UCLN_COMMON_NORMALIZER2, |
50 | UCLN_COMMON_CHARACTERPROPERTIES, |
51 | UCLN_COMMON_USET, |
52 | UCLN_COMMON_UNAMES, |
53 | UCLN_COMMON_UPROPS, |
54 | UCLN_COMMON_EMOJIPROPS, |
55 | UCLN_COMMON_UCNV, |
56 | UCLN_COMMON_UCNV_IO, |
57 | UCLN_COMMON_UDATA, |
58 | UCLN_COMMON_PUTIL, |
59 | UCLN_COMMON_UINIT, |
60 | |
61 | /* |
62 | Unified caches caches collation stuff. Collation data structures |
63 | contain resource bundles which means that unified cache cleanup |
64 | must happen before resource bundle clean up. |
65 | */ |
66 | UCLN_COMMON_UNIFIED_CACHE, |
67 | UCLN_COMMON_URES, |
68 | UCLN_COMMON_MUTEX, // Mutexes should be the last to be cleaned up. |
69 | UCLN_COMMON_COUNT /* This must be last */ |
70 | } ECleanupCommonType; |
71 | |
72 | /* Main library cleanup registration function. */ |
73 | /* See common/ucln.h for details on adding a cleanup function. */ |
74 | /* Note: the global mutex must not be held when calling this function. */ |
75 | U_CFUNC void U_EXPORT2 ucln_common_registerCleanup(ECleanupCommonType type, |
76 | cleanupFunc *func); |
77 | |
78 | #endif |
79 | |