]>
Commit | Line | Data |
---|---|---|
374ca955 A |
1 | /* |
2 | ****************************************************************************** | |
3 | * * | |
4388f060 | 4 | * Copyright (C) 2001-2011, International Business Machines * |
374ca955 A |
5 | * Corporation and others. All Rights Reserved. * |
6 | * * | |
7 | ****************************************************************************** | |
8 | * file name: uinit.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" | |
729e4ab9 | 18 | #include "unicode/icuplug.h" |
374ca955 | 19 | #include "unicode/uclean.h" |
729e4ab9 A |
20 | #include "cmemory.h" |
21 | #include "icuplugimp.h" | |
729e4ab9 | 22 | #include "ucln.h" |
73c04bcf | 23 | #include "ucnv_io.h" |
374ca955 | 24 | #include "umutex.h" |
729e4ab9 | 25 | #include "utracimp.h" |
374ca955 | 26 | |
374ca955 | 27 | /* |
729e4ab9 | 28 | * ICU Initialization Function. Need not be called. |
374ca955 A |
29 | */ |
30 | U_CAPI void U_EXPORT2 | |
31 | u_init(UErrorCode *status) { | |
32 | UTRACE_ENTRY_OC(UTRACE_U_INIT); | |
729e4ab9 A |
33 | /* initialize plugins */ |
34 | uplug_init(status); | |
35 | ||
374ca955 A |
36 | umtx_lock(&gICUInitMutex); |
37 | if (gICUInitialized || U_FAILURE(*status)) { | |
38 | umtx_unlock(&gICUInitMutex); | |
39 | UTRACE_EXIT_STATUS(*status); | |
40 | return; | |
41 | } | |
42 | ||
73c04bcf A |
43 | /* |
44 | * 2005-may-02 | |
45 | * | |
46 | * ICU4C 3.4 (jitterbug 4497) hardcodes the data for Unicode character | |
47 | * properties for APIs that want to be fast. | |
48 | * Therefore, we need not load them here nor check for errors. | |
49 | * Instead, we load the converter alias table to see if any ICU data | |
50 | * is available. | |
51 | * Users should really open the service objects they need and check | |
52 | * for errors there, to make sure that the actual items they need are | |
53 | * available. | |
54 | */ | |
55 | #if !UCONFIG_NO_CONVERSION | |
46f4442e | 56 | ucnv_io_countKnownConverters(status); |
73c04bcf | 57 | #endif |
374ca955 | 58 | |
374ca955 A |
59 | gICUInitialized = TRUE; /* TODO: don't set if U_FAILURE? */ |
60 | umtx_unlock(&gICUInitMutex); | |
61 | UTRACE_EXIT_STATUS(*status); | |
62 | } |