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 |
82 #if UCONFIG_NO_NON_HTML5_CONVERSION | 86 #if UCONFIG_NO_NON_HTML5_CONVERSION |
83 NULL, | 87 NULL, |
84 #else | 88 #else |
85 &_SCSUData, | 89 &_SCSUData, |
86 #endif | 90 #endif |
87 | 91 |
88 | 92 |
89 #if UCONFIG_NO_LEGACY_CONVERSION || UCONFIG_NO_NON_HTML5_CONVERSION | 93 #if UCONFIG_NO_LEGACY_CONVERSION || UCONFIG_NO_NON_HTML5_CONVERSION |
90 NULL, | 94 NULL, |
91 #else | 95 #else |
92 &_ISCIIData, | 96 &_ISCIIData, |
93 #endif | 97 #endif |
94 | 98 |
95 &_ASCIIData, | 99 &_ASCIIData, |
96 #if UCONFIG_NO_NON_HTML5_CONVERSION | 100 #if UCONFIG_NO_NON_HTML5_CONVERSION |
97 NULL, NULL, &_UTF16Data, &_UTF32Data, NULL, NULL, | 101 NULL, NULL, &_UTF16Data, &_UTF32Data, NULL, NULL, |
98 #else | 102 #else |
99 &_UTF7Data, &_Bocu1Data, &_UTF16Data, &_UTF32Data, &_CESU8Data, &_IMAPData, | 103 &_UTF7Data, &_Bocu1Data, &_UTF16Data, &_UTF32Data, &_CESU8Data, &_IMAPData, |
100 #endif | 104 #endif |
101 | 105 |
102 #if UCONFIG_NO_LEGACY_CONVERSION | 106 #if UCONFIG_NO_LEGACY_CONVERSION || UCONFIG_NO_NON_HTML5_CONVERSION |
103 NULL, | 107 NULL, |
104 #else | 108 #else |
105 &_CompoundTextData | 109 &_CompoundTextData |
106 #endif | 110 #endif |
107 }; | 111 }; |
108 | 112 |
109 /* Please keep this in binary sorted order for getAlgorithmicTypeFromName. | 113 /* Please keep this in binary sorted order for getAlgorithmicTypeFromName. |
110 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 |
111 removed | 115 removed |
112 */ | 116 */ |
113 static struct { | 117 static struct { |
114 const char *name; | 118 const char *name; |
115 const UConverterType type; | 119 const UConverterType type; |
116 } const cnvNameType[] = { | 120 } const cnvNameType[] = { |
| 121 #if !UCONFIG_NO_NON_HTML5_CONVERSION |
117 { "bocu1", UCNV_BOCU1 }, | 122 { "bocu1", UCNV_BOCU1 }, |
118 { "cesu8", UCNV_CESU8 }, | 123 { "cesu8", UCNV_CESU8 }, |
119 #if !UCONFIG_NO_LEGACY_CONVERSION | 124 #endif |
| 125 #if !UCONFIG_NO_LEGACY_CONVERSION && !UCONFIG_NO_NON_HTML5_CONVERSION |
120 { "hz",UCNV_HZ }, | 126 { "hz",UCNV_HZ }, |
121 #endif | 127 #endif |
| 128 #if !UCONFIG_NO_NON_HTML5_CONVERSION |
122 { "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 |
123 #if !UCONFIG_NO_LEGACY_CONVERSION | 134 #if !UCONFIG_NO_LEGACY_CONVERSION |
124 { "iscii", UCNV_ISCII }, | |
125 { "iso2022", UCNV_ISO_2022 }, | 135 { "iso2022", UCNV_ISO_2022 }, |
126 #endif | 136 #endif |
127 { "iso88591", UCNV_LATIN_1 }, | 137 { "iso88591", UCNV_LATIN_1 }, |
128 #if !UCONFIG_NO_LEGACY_CONVERSION | 138 #if !UCONFIG_NO_LEGACY_CONVERSION && !UCONFIG_NO_NON_HTML5_CONVERSION |
129 { "lmbcs1", UCNV_LMBCS_1 }, | 139 { "lmbcs1", UCNV_LMBCS_1 }, |
130 { "lmbcs11",UCNV_LMBCS_11 }, | 140 { "lmbcs11",UCNV_LMBCS_11 }, |
131 { "lmbcs16",UCNV_LMBCS_16 }, | 141 { "lmbcs16",UCNV_LMBCS_16 }, |
132 { "lmbcs17",UCNV_LMBCS_17 }, | 142 { "lmbcs17",UCNV_LMBCS_17 }, |
133 { "lmbcs18",UCNV_LMBCS_18 }, | 143 { "lmbcs18",UCNV_LMBCS_18 }, |
134 { "lmbcs19",UCNV_LMBCS_19 }, | 144 { "lmbcs19",UCNV_LMBCS_19 }, |
135 { "lmbcs2", UCNV_LMBCS_2 }, | 145 { "lmbcs2", UCNV_LMBCS_2 }, |
136 { "lmbcs3", UCNV_LMBCS_3 }, | 146 { "lmbcs3", UCNV_LMBCS_3 }, |
137 { "lmbcs4", UCNV_LMBCS_4 }, | 147 { "lmbcs4", UCNV_LMBCS_4 }, |
138 { "lmbcs5", UCNV_LMBCS_5 }, | 148 { "lmbcs5", UCNV_LMBCS_5 }, |
139 { "lmbcs6", UCNV_LMBCS_6 }, | 149 { "lmbcs6", UCNV_LMBCS_6 }, |
140 { "lmbcs8", UCNV_LMBCS_8 }, | 150 { "lmbcs8", UCNV_LMBCS_8 }, |
141 #endif | 151 #endif |
| 152 #if !UCONFIG_NO_NON_HTML5_CONVERSION |
142 { "scsu", UCNV_SCSU }, | 153 { "scsu", UCNV_SCSU }, |
| 154 #endif |
143 { "usascii", UCNV_US_ASCII }, | 155 { "usascii", UCNV_US_ASCII }, |
144 { "utf16", UCNV_UTF16 }, | 156 { "utf16", UCNV_UTF16 }, |
145 { "utf16be", UCNV_UTF16_BigEndian }, | 157 { "utf16be", UCNV_UTF16_BigEndian }, |
146 { "utf16le", UCNV_UTF16_LittleEndian }, | 158 { "utf16le", UCNV_UTF16_LittleEndian }, |
147 #if U_IS_BIG_ENDIAN | 159 #if U_IS_BIG_ENDIAN |
148 { "utf16oppositeendian", UCNV_UTF16_LittleEndian }, | 160 { "utf16oppositeendian", UCNV_UTF16_LittleEndian }, |
149 { "utf16platformendian", UCNV_UTF16_BigEndian }, | 161 { "utf16platformendian", UCNV_UTF16_BigEndian }, |
150 #else | 162 #else |
151 { "utf16oppositeendian", UCNV_UTF16_BigEndian}, | 163 { "utf16oppositeendian", UCNV_UTF16_BigEndian}, |
152 { "utf16platformendian", UCNV_UTF16_LittleEndian }, | 164 { "utf16platformendian", UCNV_UTF16_LittleEndian }, |
153 #endif | 165 #endif |
154 { "utf32", UCNV_UTF32 }, | 166 { "utf32", UCNV_UTF32 }, |
155 { "utf32be", UCNV_UTF32_BigEndian }, | 167 { "utf32be", UCNV_UTF32_BigEndian }, |
156 { "utf32le", UCNV_UTF32_LittleEndian }, | 168 { "utf32le", UCNV_UTF32_LittleEndian }, |
157 #if U_IS_BIG_ENDIAN | 169 #if U_IS_BIG_ENDIAN |
158 { "utf32oppositeendian", UCNV_UTF32_LittleEndian }, | 170 { "utf32oppositeendian", UCNV_UTF32_LittleEndian }, |
159 { "utf32platformendian", UCNV_UTF32_BigEndian }, | 171 { "utf32platformendian", UCNV_UTF32_BigEndian }, |
160 #else | 172 #else |
161 { "utf32oppositeendian", UCNV_UTF32_BigEndian }, | 173 { "utf32oppositeendian", UCNV_UTF32_BigEndian }, |
162 { "utf32platformendian", UCNV_UTF32_LittleEndian }, | 174 { "utf32platformendian", UCNV_UTF32_LittleEndian }, |
163 #endif | 175 #endif |
| 176 #if !UCONFIG_NO_NON_HTML5_CONVERSION |
164 { "utf7", UCNV_UTF7 }, | 177 { "utf7", UCNV_UTF7 }, |
| 178 #endif |
165 { "utf8", UCNV_UTF8 }, | 179 { "utf8", UCNV_UTF8 }, |
| 180 #if !UCONFIG_NO_NON_HTML5_CONVERSION |
166 { "x11compoundtext", UCNV_COMPOUND_TEXT} | 181 { "x11compoundtext", UCNV_COMPOUND_TEXT} |
| 182 #endif |
167 }; | 183 }; |
168 | 184 |
169 | 185 |
170 /*initializes some global variables */ | 186 /*initializes some global variables */ |
171 static UHashtable *SHARED_DATA_HASHTABLE = NULL; | 187 static UHashtable *SHARED_DATA_HASHTABLE = NULL; |
172 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. */ |
173 /* Note: the global mutex
is used for */ | 189 /* Note: the global mutex
is used for */ |
174 /* reference count u
pdates. */ | 190 /* reference count u
pdates. */ |
175 | 191 |
176 static const char **gAvailableConverters = NULL; | 192 static const char **gAvailableConverters = NULL; |
(...skipping 1527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1704 *pErrorCode=U_UNSUPPORTED_ERROR; | 1720 *pErrorCode=U_UNSUPPORTED_ERROR; |
1705 return 0; | 1721 return 0; |
1706 } | 1722 } |
1707 | 1723 |
1708 return headerSize+(int32_t)staticDataSize+size; | 1724 return headerSize+(int32_t)staticDataSize+size; |
1709 } | 1725 } |
1710 | 1726 |
1711 #endif /* #if !UCONFIG_NO_LEGACY_CONVERSION */ | 1727 #endif /* #if !UCONFIG_NO_LEGACY_CONVERSION */ |
1712 | 1728 |
1713 #endif | 1729 #endif |
OLD | NEW |