OLD | NEW |
1 /* | 1 /* |
2 ******************************************************************** | 2 ******************************************************************** |
3 * COPYRIGHT: | 3 * COPYRIGHT: |
4 * Copyright (c) 1996-2013, International Business Machines Corporation and | 4 * Copyright (c) 1996-2013, International Business Machines Corporation and |
5 * others. All Rights Reserved. | 5 * others. All Rights Reserved. |
6 ******************************************************************** | 6 ******************************************************************** |
7 * | 7 * |
8 * uconv_bld.cpp: | 8 * uconv_bld.cpp: |
9 * | 9 * |
10 * Defines functions that are used in the creation/initialization/deletion | 10 * Defines functions that are used in the creation/initialization/deletion |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 #else | 62 #else |
63 &_MBCSData, | 63 &_MBCSData, |
64 #endif | 64 #endif |
65 | 65 |
66 &_Latin1Data, | 66 &_Latin1Data, |
67 &_UTF8Data, &_UTF16BEData, &_UTF16LEData, &_UTF32BEData, &_UTF32LEData, | 67 &_UTF8Data, &_UTF16BEData, &_UTF16LEData, &_UTF32BEData, &_UTF32LEData, |
68 NULL, | 68 NULL, |
69 | 69 |
70 #if UCONFIG_NO_LEGACY_CONVERSION | 70 #if UCONFIG_NO_LEGACY_CONVERSION |
71 NULL, | 71 NULL, |
| 72 #else |
| 73 &_ISO2022Data, |
| 74 #endif |
| 75 |
| 76 #if UCONFIG_NO_LEGACY_CONVERSION || UCONFIG_NO_NON_HTML5_CONVERSION |
72 NULL, NULL, NULL, NULL, NULL, NULL, | 77 NULL, NULL, NULL, NULL, NULL, NULL, |
73 NULL, NULL, NULL, NULL, NULL, NULL, | 78 NULL, NULL, NULL, NULL, NULL, NULL, |
74 NULL, | 79 NULL, |
75 #else | 80 #else |
76 &_ISO2022Data, | |
77 &_LMBCSData1,&_LMBCSData2, &_LMBCSData3, &_LMBCSData4, &_LMBCSData5, &_LMBCS
Data6, | 81 &_LMBCSData1,&_LMBCSData2, &_LMBCSData3, &_LMBCSData4, &_LMBCSData5, &_LMBCS
Data6, |
78 &_LMBCSData8,&_LMBCSData11,&_LMBCSData16,&_LMBCSData17,&_LMBCSData18,&_LMBCS
Data19, | 82 &_LMBCSData8,&_LMBCSData11,&_LMBCSData16,&_LMBCSData17,&_LMBCSData18,&_LMBCS
Data19, |
79 &_HZData, | 83 &_HZData, |
80 #endif | 84 #endif |
81 | 85 |
| 86 #if UCONFIG_NO_NON_HTML5_CONVERSION |
| 87 NULL, |
| 88 #else |
82 &_SCSUData, | 89 &_SCSUData, |
| 90 #endif |
83 | 91 |
84 #if UCONFIG_NO_LEGACY_CONVERSION | 92 |
| 93 #if UCONFIG_NO_LEGACY_CONVERSION || UCONFIG_NO_NON_HTML5_CONVERSION |
85 NULL, | 94 NULL, |
86 #else | 95 #else |
87 &_ISCIIData, | 96 &_ISCIIData, |
88 #endif | 97 #endif |
89 | 98 |
90 &_ASCIIData, | 99 &_ASCIIData, |
| 100 #if UCONFIG_NO_NON_HTML5_CONVERSION |
| 101 NULL, NULL, &_UTF16Data, &_UTF32Data, NULL, NULL, |
| 102 #else |
91 &_UTF7Data, &_Bocu1Data, &_UTF16Data, &_UTF32Data, &_CESU8Data, &_IMAPData, | 103 &_UTF7Data, &_Bocu1Data, &_UTF16Data, &_UTF32Data, &_CESU8Data, &_IMAPData, |
| 104 #endif |
92 | 105 |
93 #if UCONFIG_NO_LEGACY_CONVERSION | 106 #if UCONFIG_NO_LEGACY_CONVERSION || UCONFIG_NO_NON_HTML5_CONVERSION |
94 NULL, | 107 NULL, |
95 #else | 108 #else |
96 &_CompoundTextData | 109 &_CompoundTextData |
97 #endif | 110 #endif |
98 }; | 111 }; |
99 | 112 |
100 /* Please keep this in binary sorted order for getAlgorithmicTypeFromName. | 113 /* Please keep this in binary sorted order for getAlgorithmicTypeFromName. |
101 Also the name should be in lower case and all spaces, dashes and underscores | 114 Also the name should be in lower case and all spaces, dashes and underscores |
102 removed | 115 removed |
103 */ | 116 */ |
104 static struct { | 117 static struct { |
105 const char *name; | 118 const char *name; |
106 const UConverterType type; | 119 const UConverterType type; |
107 } const cnvNameType[] = { | 120 } const cnvNameType[] = { |
| 121 #if !UCONFIG_NO_NON_HTML5_CONVERSION |
108 { "bocu1", UCNV_BOCU1 }, | 122 { "bocu1", UCNV_BOCU1 }, |
109 { "cesu8", UCNV_CESU8 }, | 123 { "cesu8", UCNV_CESU8 }, |
110 #if !UCONFIG_NO_LEGACY_CONVERSION | 124 #endif |
| 125 #if !UCONFIG_NO_LEGACY_CONVERSION && !UCONFIG_NO_NON_HTML5_CONVERSION |
111 { "hz",UCNV_HZ }, | 126 { "hz",UCNV_HZ }, |
112 #endif | 127 #endif |
| 128 #if !UCONFIG_NO_NON_HTML5_CONVERSION |
113 { "imapmailboxname", UCNV_IMAP_MAILBOX }, | 129 { "imapmailboxname", UCNV_IMAP_MAILBOX }, |
| 130 #endif |
| 131 #if !UCONFIG_NO_LEGACY_CONVERSION && !UCONFIG_NO_NON_HTML5_CONVERSION |
| 132 { "iscii", UCNV_ISCII }, |
| 133 #endif |
114 #if !UCONFIG_NO_LEGACY_CONVERSION | 134 #if !UCONFIG_NO_LEGACY_CONVERSION |
115 { "iscii", UCNV_ISCII }, | |
116 { "iso2022", UCNV_ISO_2022 }, | 135 { "iso2022", UCNV_ISO_2022 }, |
117 #endif | 136 #endif |
118 { "iso88591", UCNV_LATIN_1 }, | 137 { "iso88591", UCNV_LATIN_1 }, |
119 #if !UCONFIG_NO_LEGACY_CONVERSION | 138 #if !UCONFIG_NO_LEGACY_CONVERSION && !UCONFIG_NO_NON_HTML5_CONVERSION |
120 { "lmbcs1", UCNV_LMBCS_1 }, | 139 { "lmbcs1", UCNV_LMBCS_1 }, |
121 { "lmbcs11",UCNV_LMBCS_11 }, | 140 { "lmbcs11",UCNV_LMBCS_11 }, |
122 { "lmbcs16",UCNV_LMBCS_16 }, | 141 { "lmbcs16",UCNV_LMBCS_16 }, |
123 { "lmbcs17",UCNV_LMBCS_17 }, | 142 { "lmbcs17",UCNV_LMBCS_17 }, |
124 { "lmbcs18",UCNV_LMBCS_18 }, | 143 { "lmbcs18",UCNV_LMBCS_18 }, |
125 { "lmbcs19",UCNV_LMBCS_19 }, | 144 { "lmbcs19",UCNV_LMBCS_19 }, |
126 { "lmbcs2", UCNV_LMBCS_2 }, | 145 { "lmbcs2", UCNV_LMBCS_2 }, |
127 { "lmbcs3", UCNV_LMBCS_3 }, | 146 { "lmbcs3", UCNV_LMBCS_3 }, |
128 { "lmbcs4", UCNV_LMBCS_4 }, | 147 { "lmbcs4", UCNV_LMBCS_4 }, |
129 { "lmbcs5", UCNV_LMBCS_5 }, | 148 { "lmbcs5", UCNV_LMBCS_5 }, |
130 { "lmbcs6", UCNV_LMBCS_6 }, | 149 { "lmbcs6", UCNV_LMBCS_6 }, |
131 { "lmbcs8", UCNV_LMBCS_8 }, | 150 { "lmbcs8", UCNV_LMBCS_8 }, |
132 #endif | 151 #endif |
| 152 #if !UCONFIG_NO_NON_HTML5_CONVERSION |
133 { "scsu", UCNV_SCSU }, | 153 { "scsu", UCNV_SCSU }, |
| 154 #endif |
134 { "usascii", UCNV_US_ASCII }, | 155 { "usascii", UCNV_US_ASCII }, |
135 { "utf16", UCNV_UTF16 }, | 156 { "utf16", UCNV_UTF16 }, |
136 { "utf16be", UCNV_UTF16_BigEndian }, | 157 { "utf16be", UCNV_UTF16_BigEndian }, |
137 { "utf16le", UCNV_UTF16_LittleEndian }, | 158 { "utf16le", UCNV_UTF16_LittleEndian }, |
138 #if U_IS_BIG_ENDIAN | 159 #if U_IS_BIG_ENDIAN |
139 { "utf16oppositeendian", UCNV_UTF16_LittleEndian }, | 160 { "utf16oppositeendian", UCNV_UTF16_LittleEndian }, |
140 { "utf16platformendian", UCNV_UTF16_BigEndian }, | 161 { "utf16platformendian", UCNV_UTF16_BigEndian }, |
141 #else | 162 #else |
142 { "utf16oppositeendian", UCNV_UTF16_BigEndian}, | 163 { "utf16oppositeendian", UCNV_UTF16_BigEndian}, |
143 { "utf16platformendian", UCNV_UTF16_LittleEndian }, | 164 { "utf16platformendian", UCNV_UTF16_LittleEndian }, |
144 #endif | 165 #endif |
145 { "utf32", UCNV_UTF32 }, | 166 { "utf32", UCNV_UTF32 }, |
146 { "utf32be", UCNV_UTF32_BigEndian }, | 167 { "utf32be", UCNV_UTF32_BigEndian }, |
147 { "utf32le", UCNV_UTF32_LittleEndian }, | 168 { "utf32le", UCNV_UTF32_LittleEndian }, |
148 #if U_IS_BIG_ENDIAN | 169 #if U_IS_BIG_ENDIAN |
149 { "utf32oppositeendian", UCNV_UTF32_LittleEndian }, | 170 { "utf32oppositeendian", UCNV_UTF32_LittleEndian }, |
150 { "utf32platformendian", UCNV_UTF32_BigEndian }, | 171 { "utf32platformendian", UCNV_UTF32_BigEndian }, |
151 #else | 172 #else |
152 { "utf32oppositeendian", UCNV_UTF32_BigEndian }, | 173 { "utf32oppositeendian", UCNV_UTF32_BigEndian }, |
153 { "utf32platformendian", UCNV_UTF32_LittleEndian }, | 174 { "utf32platformendian", UCNV_UTF32_LittleEndian }, |
154 #endif | 175 #endif |
| 176 #if !UCONFIG_NO_NON_HTML5_CONVERSION |
155 { "utf7", UCNV_UTF7 }, | 177 { "utf7", UCNV_UTF7 }, |
| 178 #endif |
156 { "utf8", UCNV_UTF8 }, | 179 { "utf8", UCNV_UTF8 }, |
| 180 #if !UCONFIG_NO_NON_HTML5_CONVERSION |
157 { "x11compoundtext", UCNV_COMPOUND_TEXT} | 181 { "x11compoundtext", UCNV_COMPOUND_TEXT} |
| 182 #endif |
158 }; | 183 }; |
159 | 184 |
160 | 185 |
161 /*initializes some global variables */ | 186 /*initializes some global variables */ |
162 static UHashtable *SHARED_DATA_HASHTABLE = NULL; | 187 static UHashtable *SHARED_DATA_HASHTABLE = NULL; |
163 static UMutex cnvCacheMutex = U_MUTEX_INITIALIZER; /* Mutex for synchronizing c
nv cache access. */ | 188 static UMutex cnvCacheMutex = U_MUTEX_INITIALIZER; /* Mutex for synchronizing c
nv cache access. */ |
164 /* Note: the global mutex
is used for */ | 189 /* Note: the global mutex
is used for */ |
165 /* reference count u
pdates. */ | 190 /* reference count u
pdates. */ |
166 | 191 |
167 static const char **gAvailableConverters = NULL; | 192 static const char **gAvailableConverters = NULL; |
(...skipping 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1695 *pErrorCode=U_UNSUPPORTED_ERROR; | 1720 *pErrorCode=U_UNSUPPORTED_ERROR; |
1696 return 0; | 1721 return 0; |
1697 } | 1722 } |
1698 | 1723 |
1699 return headerSize+(int32_t)staticDataSize+size; | 1724 return headerSize+(int32_t)staticDataSize+size; |
1700 } | 1725 } |
1701 | 1726 |
1702 #endif /* #if !UCONFIG_NO_LEGACY_CONVERSION */ | 1727 #endif /* #if !UCONFIG_NO_LEGACY_CONVERSION */ |
1703 | 1728 |
1704 #endif | 1729 #endif |
OLD | NEW |