| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | |
|---|
| 23 | #ifdef HAVE_CONFIG_H |
|---|
| 24 | # include <config.h> |
|---|
| 25 | #endif |
|---|
| 26 | |
|---|
| 27 | #include <stdlib.h> |
|---|
| 28 | #include <locale.h> |
|---|
| 29 | |
|---|
| 30 | #if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE |
|---|
| 31 | # include <string.h> |
|---|
| 32 | # include <CFString.h> |
|---|
| 33 | # if HAVE_CFLOCALECOPYCURRENT |
|---|
| 34 | # include <CFLocale.h> |
|---|
| 35 | # elif HAVE_CFPREFERENCESCOPYAPPVALUE |
|---|
| 36 | # include <CFPreferences.h> |
|---|
| 37 | # endif |
|---|
| 38 | #endif |
|---|
| 39 | |
|---|
| 40 | #if defined _WIN32 || defined __WIN32__ |
|---|
| 41 | # undef WIN32 |
|---|
| 42 | # define WIN32 |
|---|
| 43 | #endif |
|---|
| 44 | |
|---|
| 45 | #ifdef WIN32 |
|---|
| 46 | # define WIN32_LEAN_AND_MEAN |
|---|
| 47 | # include <windows.h> |
|---|
| 48 | |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | |
|---|
| 53 | |
|---|
| 54 | |
|---|
| 55 | |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | |
|---|
| 59 | |
|---|
| 60 | |
|---|
| 61 | |
|---|
| 62 | |
|---|
| 63 | |
|---|
| 64 | |
|---|
| 65 | |
|---|
| 66 | |
|---|
| 67 | |
|---|
| 68 | |
|---|
| 69 | |
|---|
| 70 | |
|---|
| 71 | |
|---|
| 72 | |
|---|
| 73 | |
|---|
| 74 | |
|---|
| 75 | |
|---|
| 76 | |
|---|
| 77 | |
|---|
| 78 | |
|---|
| 79 | |
|---|
| 80 | |
|---|
| 81 | |
|---|
| 82 | |
|---|
| 83 | |
|---|
| 84 | |
|---|
| 85 | |
|---|
| 86 | |
|---|
| 87 | |
|---|
| 88 | |
|---|
| 89 | |
|---|
| 90 | |
|---|
| 91 | |
|---|
| 92 | |
|---|
| 93 | |
|---|
| 94 | |
|---|
| 95 | |
|---|
| 96 | |
|---|
| 97 | |
|---|
| 98 | |
|---|
| 99 | |
|---|
| 100 | |
|---|
| 101 | |
|---|
| 102 | |
|---|
| 103 | |
|---|
| 104 | |
|---|
| 105 | |
|---|
| 106 | |
|---|
| 107 | |
|---|
| 108 | |
|---|
| 109 | |
|---|
| 110 | |
|---|
| 111 | |
|---|
| 112 | |
|---|
| 113 | |
|---|
| 114 | |
|---|
| 115 | |
|---|
| 116 | |
|---|
| 117 | |
|---|
| 118 | |
|---|
| 119 | |
|---|
| 120 | |
|---|
| 121 | |
|---|
| 122 | |
|---|
| 123 | |
|---|
| 124 | |
|---|
| 125 | |
|---|
| 126 | |
|---|
| 127 | |
|---|
| 128 | |
|---|
| 129 | |
|---|
| 130 | |
|---|
| 131 | |
|---|
| 132 | |
|---|
| 133 | |
|---|
| 134 | |
|---|
| 135 | |
|---|
| 136 | |
|---|
| 137 | |
|---|
| 138 | |
|---|
| 139 | |
|---|
| 140 | |
|---|
| 141 | |
|---|
| 142 | |
|---|
| 143 | |
|---|
| 144 | |
|---|
| 145 | |
|---|
| 146 | |
|---|
| 147 | |
|---|
| 148 | |
|---|
| 149 | |
|---|
| 150 | |
|---|
| 151 | |
|---|
| 152 | |
|---|
| 153 | |
|---|
| 154 | |
|---|
| 155 | |
|---|
| 156 | |
|---|
| 157 | |
|---|
| 158 | |
|---|
| 159 | |
|---|
| 160 | |
|---|
| 161 | |
|---|
| 162 | |
|---|
| 163 | |
|---|
| 164 | |
|---|
| 165 | |
|---|
| 166 | |
|---|
| 167 | # ifndef LANG_AFRIKAANS |
|---|
| 168 | # define LANG_AFRIKAANS 0x36 |
|---|
| 169 | # endif |
|---|
| 170 | # ifndef LANG_ALBANIAN |
|---|
| 171 | # define LANG_ALBANIAN 0x1c |
|---|
| 172 | # endif |
|---|
| 173 | # ifndef LANG_AMHARIC |
|---|
| 174 | # define LANG_AMHARIC 0x5e |
|---|
| 175 | # endif |
|---|
| 176 | # ifndef LANG_ARABIC |
|---|
| 177 | # define LANG_ARABIC 0x01 |
|---|
| 178 | # endif |
|---|
| 179 | # ifndef LANG_ARMENIAN |
|---|
| 180 | # define LANG_ARMENIAN 0x2b |
|---|
| 181 | # endif |
|---|
| 182 | # ifndef LANG_ASSAMESE |
|---|
| 183 | # define LANG_ASSAMESE 0x4d |
|---|
| 184 | # endif |
|---|
| 185 | # ifndef LANG_AZERI |
|---|
| 186 | # define LANG_AZERI 0x2c |
|---|
| 187 | # endif |
|---|
| 188 | # ifndef LANG_BASQUE |
|---|
| 189 | # define LANG_BASQUE 0x2d |
|---|
| 190 | # endif |
|---|
| 191 | # ifndef LANG_BELARUSIAN |
|---|
| 192 | # define LANG_BELARUSIAN 0x23 |
|---|
| 193 | # endif |
|---|
| 194 | # ifndef LANG_BENGALI |
|---|
| 195 | # define LANG_BENGALI 0x45 |
|---|
| 196 | # endif |
|---|
| 197 | # ifndef LANG_BURMESE |
|---|
| 198 | # define LANG_BURMESE 0x55 |
|---|
| 199 | # endif |
|---|
| 200 | # ifndef LANG_CAMBODIAN |
|---|
| 201 | # define LANG_CAMBODIAN 0x53 |
|---|
| 202 | # endif |
|---|
| 203 | # ifndef LANG_CATALAN |
|---|
| 204 | # define LANG_CATALAN 0x03 |
|---|
| 205 | # endif |
|---|
| 206 | # ifndef LANG_CHEROKEE |
|---|
| 207 | # define LANG_CHEROKEE 0x5c |
|---|
| 208 | # endif |
|---|
| 209 | # ifndef LANG_DIVEHI |
|---|
| 210 | # define LANG_DIVEHI 0x65 |
|---|
| 211 | # endif |
|---|
| 212 | # ifndef LANG_EDO |
|---|
| 213 | # define LANG_EDO 0x66 |
|---|
| 214 | # endif |
|---|
| 215 | # ifndef LANG_ESTONIAN |
|---|
| 216 | # define LANG_ESTONIAN 0x25 |
|---|
| 217 | # endif |
|---|
| 218 | # ifndef LANG_FAEROESE |
|---|
| 219 | # define LANG_FAEROESE 0x38 |
|---|
| 220 | # endif |
|---|
| 221 | # ifndef LANG_FARSI |
|---|
| 222 | # define LANG_FARSI 0x29 |
|---|
| 223 | # endif |
|---|
| 224 | # ifndef LANG_FRISIAN |
|---|
| 225 | # define LANG_FRISIAN 0x62 |
|---|
| 226 | # endif |
|---|
| 227 | # ifndef LANG_FULFULDE |
|---|
| 228 | # define LANG_FULFULDE 0x67 |
|---|
| 229 | # endif |
|---|
| 230 | # ifndef LANG_GAELIC |
|---|
| 231 | # define LANG_GAELIC 0x3c |
|---|
| 232 | # endif |
|---|
| 233 | # ifndef LANG_GALICIAN |
|---|
| 234 | # define LANG_GALICIAN 0x56 |
|---|
| 235 | # endif |
|---|
| 236 | # ifndef LANG_GEORGIAN |
|---|
| 237 | # define LANG_GEORGIAN 0x37 |
|---|
| 238 | # endif |
|---|
| 239 | # ifndef LANG_GUARANI |
|---|
| 240 | # define LANG_GUARANI 0x74 |
|---|
| 241 | # endif |
|---|
| 242 | # ifndef LANG_GUJARATI |
|---|
| 243 | # define LANG_GUJARATI 0x47 |
|---|
| 244 | # endif |
|---|
| 245 | # ifndef LANG_HAUSA |
|---|
| 246 | # define LANG_HAUSA 0x68 |
|---|
| 247 | # endif |
|---|
| 248 | # ifndef LANG_HAWAIIAN |
|---|
| 249 | # define LANG_HAWAIIAN 0x75 |
|---|
| 250 | # endif |
|---|
| 251 | # ifndef LANG_HEBREW |
|---|
| 252 | # define LANG_HEBREW 0x0d |
|---|
| 253 | # endif |
|---|
| 254 | # ifndef LANG_HINDI |
|---|
| 255 | # define LANG_HINDI 0x39 |
|---|
| 256 | # endif |
|---|
| 257 | # ifndef LANG_IBIBIO |
|---|
| 258 | # define LANG_IBIBIO 0x69 |
|---|
| 259 | # endif |
|---|
| 260 | # ifndef LANG_IGBO |
|---|
| 261 | # define LANG_IGBO 0x70 |
|---|
| 262 | # endif |
|---|
| 263 | # ifndef LANG_INDONESIAN |
|---|
| 264 | # define LANG_INDONESIAN 0x21 |
|---|
| 265 | # endif |
|---|
| 266 | # ifndef LANG_INUKTITUT |
|---|
| 267 | # define LANG_INUKTITUT 0x5d |
|---|
| 268 | # endif |
|---|
| 269 | # ifndef LANG_KANNADA |
|---|
| 270 | # define LANG_KANNADA 0x4b |
|---|
| 271 | # endif |
|---|
| 272 | # ifndef LANG_KANURI |
|---|
| 273 | # define LANG_KANURI 0x71 |
|---|
| 274 | # endif |
|---|
| 275 | # ifndef LANG_KASHMIRI |
|---|
| 276 | # define LANG_KASHMIRI 0x60 |
|---|
| 277 | # endif |
|---|
| 278 | # ifndef LANG_KAZAK |
|---|
| 279 | # define LANG_KAZAK 0x3f |
|---|
| 280 | # endif |
|---|
| 281 | # ifndef LANG_KONKANI |
|---|
| 282 | # define LANG_KONKANI 0x57 |
|---|
| 283 | # endif |
|---|
| 284 | # ifndef LANG_KYRGYZ |
|---|
| 285 | # define LANG_KYRGYZ 0x40 |
|---|
| 286 | # endif |
|---|
| 287 | # ifndef LANG_LAO |
|---|
| 288 | # define LANG_LAO 0x54 |
|---|
| 289 | # endif |
|---|
| 290 | # ifndef LANG_LATIN |
|---|
| 291 | # define LANG_LATIN 0x76 |
|---|
| 292 | # endif |
|---|
| 293 | # ifndef LANG_LATVIAN |
|---|
| 294 | # define LANG_LATVIAN 0x26 |
|---|
| 295 | # endif |
|---|
| 296 | # ifndef LANG_LITHUANIAN |
|---|
| 297 | # define LANG_LITHUANIAN 0x27 |
|---|
| 298 | # endif |
|---|
| 299 | # ifndef LANG_MACEDONIAN |
|---|
| 300 | # define LANG_MACEDONIAN 0x2f |
|---|
| 301 | # endif |
|---|
| 302 | # ifndef LANG_MALAY |
|---|
| 303 | # define LANG_MALAY 0x3e |
|---|
| 304 | # endif |
|---|
| 305 | # ifndef LANG_MALAYALAM |
|---|
| 306 | # define LANG_MALAYALAM 0x4c |
|---|
| 307 | # endif |
|---|
| 308 | # ifndef LANG_MALTESE |
|---|
| 309 | # define LANG_MALTESE 0x3a |
|---|
| 310 | # endif |
|---|
| 311 | # ifndef LANG_MANIPURI |
|---|
| 312 | # define LANG_MANIPURI 0x58 |
|---|
| 313 | # endif |
|---|
| 314 | # ifndef LANG_MARATHI |
|---|
| 315 | # define LANG_MARATHI 0x4e |
|---|
| 316 | # endif |
|---|
| 317 | # ifndef LANG_MONGOLIAN |
|---|
| 318 | # define LANG_MONGOLIAN 0x50 |
|---|
| 319 | # endif |
|---|
| 320 | # ifndef LANG_NEPALI |
|---|
| 321 | # define LANG_NEPALI 0x61 |
|---|
| 322 | # endif |
|---|
| 323 | # ifndef LANG_ORIYA |
|---|
| 324 | # define LANG_ORIYA 0x48 |
|---|
| 325 | # endif |
|---|
| 326 | # ifndef LANG_OROMO |
|---|
| 327 | # define LANG_OROMO 0x72 |
|---|
| 328 | # endif |
|---|
| 329 | # ifndef LANG_PAPIAMENTU |
|---|
| 330 | # define LANG_PAPIAMENTU 0x79 |
|---|
| 331 | # endif |
|---|
| 332 | # ifndef LANG_PASHTO |
|---|
| 333 | # define LANG_PASHTO 0x63 |
|---|
| 334 | # endif |
|---|
| 335 | # ifndef LANG_PUNJABI |
|---|
| 336 | # define LANG_PUNJABI 0x46 |
|---|
| 337 | # endif |
|---|
| 338 | # ifndef LANG_RHAETO_ROMANCE |
|---|
| 339 | # define LANG_RHAETO_ROMANCE 0x17 |
|---|
| 340 | # endif |
|---|
| 341 | # ifndef LANG_SAAMI |
|---|
| 342 | # define LANG_SAAMI 0x3b |
|---|
| 343 | # endif |
|---|
| 344 | # ifndef LANG_SANSKRIT |
|---|
| 345 | # define LANG_SANSKRIT 0x4f |
|---|
| 346 | # endif |
|---|
| 347 | # ifndef LANG_SERBIAN |
|---|
| 348 | # define LANG_SERBIAN 0x1a |
|---|
| 349 | # endif |
|---|
| 350 | # ifndef LANG_SINDHI |
|---|
| 351 | # define LANG_SINDHI 0x59 |
|---|
| 352 | # endif |
|---|
| 353 | # ifndef LANG_SINHALESE |
|---|
| 354 | # define LANG_SINHALESE 0x5b |
|---|
| 355 | # endif |
|---|
| 356 | # ifndef LANG_SLOVAK |
|---|
| 357 | # define LANG_SLOVAK 0x1b |
|---|
| 358 | # endif |
|---|
| 359 | # ifndef LANG_SOMALI |
|---|
| 360 | # define LANG_SOMALI 0x77 |
|---|
| 361 | # endif |
|---|
| 362 | # ifndef LANG_SORBIAN |
|---|
| 363 | # define LANG_SORBIAN 0x2e |
|---|
| 364 | # endif |
|---|
| 365 | # ifndef LANG_SUTU |
|---|
| 366 | # define LANG_SUTU 0x30 |
|---|
| 367 | # endif |
|---|
| 368 | # ifndef LANG_SWAHILI |
|---|
| 369 | # define LANG_SWAHILI 0x41 |
|---|
| 370 | # endif |
|---|
| 371 | # ifndef LANG_SYRIAC |
|---|
| 372 | # define LANG_SYRIAC 0x5a |
|---|
| 373 | # endif |
|---|
| 374 | # ifndef LANG_TAGALOG |
|---|
| 375 | # define LANG_TAGALOG 0x64 |
|---|
| 376 | # endif |
|---|
| 377 | # ifndef LANG_TAJIK |
|---|
| 378 | # define LANG_TAJIK 0x28 |
|---|
| 379 | # endif |
|---|
| 380 | # ifndef LANG_TAMAZIGHT |
|---|
| 381 | # define LANG_TAMAZIGHT 0x5f |
|---|
| 382 | # endif |
|---|
| 383 | # ifndef LANG_TAMIL |
|---|
| 384 | # define LANG_TAMIL 0x49 |
|---|
| 385 | # endif |
|---|
| 386 | # ifndef LANG_TATAR |
|---|
| 387 | # define LANG_TATAR 0x44 |
|---|
| 388 | # endif |
|---|
| 389 | # ifndef LANG_TELUGU |
|---|
| 390 | # define LANG_TELUGU 0x4a |
|---|
| 391 | # endif |
|---|
| 392 | # ifndef LANG_THAI |
|---|
| 393 | # define LANG_THAI 0x1e |
|---|
| 394 | # endif |
|---|
| 395 | # ifndef LANG_TIBETAN |
|---|
| 396 | # define LANG_TIBETAN 0x51 |
|---|
| 397 | # endif |
|---|
| 398 | # ifndef LANG_TIGRINYA |
|---|
| 399 | # define LANG_TIGRINYA 0x73 |
|---|
| 400 | # endif |
|---|
| 401 | # ifndef LANG_TSONGA |
|---|
| 402 | # define LANG_TSONGA 0x31 |
|---|
| 403 | # endif |
|---|
| 404 | # ifndef LANG_TSWANA |
|---|
| 405 | # define LANG_TSWANA 0x32 |
|---|
| 406 | # endif |
|---|
| 407 | # ifndef LANG_TURKMEN |
|---|
| 408 | # define LANG_TURKMEN 0x42 |
|---|
| 409 | # endif |
|---|
| 410 | # ifndef LANG_UKRAINIAN |
|---|
| 411 | # define LANG_UKRAINIAN 0x22 |
|---|
| 412 | # endif |
|---|
| 413 | # ifndef LANG_URDU |
|---|
| 414 | # define LANG_URDU 0x20 |
|---|
| 415 | # endif |
|---|
| 416 | # ifndef LANG_UZBEK |
|---|
| 417 | # define LANG_UZBEK 0x43 |
|---|
| 418 | # endif |
|---|
| 419 | # ifndef LANG_VENDA |
|---|
| 420 | # define LANG_VENDA 0x33 |
|---|
| 421 | # endif |
|---|
| 422 | # ifndef LANG_VIETNAMESE |
|---|
| 423 | # define LANG_VIETNAMESE 0x2a |
|---|
| 424 | # endif |
|---|
| 425 | # ifndef LANG_WELSH |
|---|
| 426 | # define LANG_WELSH 0x52 |
|---|
| 427 | # endif |
|---|
| 428 | # ifndef LANG_XHOSA |
|---|
| 429 | # define LANG_XHOSA 0x34 |
|---|
| 430 | # endif |
|---|
| 431 | # ifndef LANG_YI |
|---|
| 432 | # define LANG_YI 0x78 |
|---|
| 433 | # endif |
|---|
| 434 | # ifndef LANG_YIDDISH |
|---|
| 435 | # define LANG_YIDDISH 0x3d |
|---|
| 436 | # endif |
|---|
| 437 | # ifndef LANG_YORUBA |
|---|
| 438 | # define LANG_YORUBA 0x6a |
|---|
| 439 | # endif |
|---|
| 440 | # ifndef LANG_ZULU |
|---|
| 441 | # define LANG_ZULU 0x35 |
|---|
| 442 | # endif |
|---|
| 443 | # ifndef SUBLANG_ARABIC_SAUDI_ARABIA |
|---|
| 444 | # define SUBLANG_ARABIC_SAUDI_ARABIA 0x01 |
|---|
| 445 | # endif |
|---|
| 446 | # ifndef SUBLANG_ARABIC_IRAQ |
|---|
| 447 | # define SUBLANG_ARABIC_IRAQ 0x02 |
|---|
| 448 | # endif |
|---|
| 449 | # ifndef SUBLANG_ARABIC_EGYPT |
|---|
| 450 | # define SUBLANG_ARABIC_EGYPT 0x03 |
|---|
| 451 | # endif |
|---|
| 452 | # ifndef SUBLANG_ARABIC_LIBYA |
|---|
| 453 | # define SUBLANG_ARABIC_LIBYA 0x04 |
|---|
| 454 | # endif |
|---|
| 455 | # ifndef SUBLANG_ARABIC_ALGERIA |
|---|
| 456 | # define SUBLANG_ARABIC_ALGERIA 0x05 |
|---|
| 457 | # endif |
|---|
| 458 | # ifndef SUBLANG_ARABIC_MOROCCO |
|---|
| 459 | # define SUBLANG_ARABIC_MOROCCO 0x06 |
|---|
| 460 | # endif |
|---|
| 461 | # ifndef SUBLANG_ARABIC_TUNISIA |
|---|
| 462 | # define SUBLANG_ARABIC_TUNISIA 0x07 |
|---|
| 463 | # endif |
|---|
| 464 | # ifndef SUBLANG_ARABIC_OMAN |
|---|
| 465 | # define SUBLANG_ARABIC_OMAN 0x08 |
|---|
| 466 | # endif |
|---|
| 467 | # ifndef SUBLANG_ARABIC_YEMEN |
|---|
| 468 | # define SUBLANG_ARABIC_YEMEN 0x09 |
|---|
| 469 | # endif |
|---|
| 470 | # ifndef SUBLANG_ARABIC_SYRIA |
|---|
| 471 | # define SUBLANG_ARABIC_SYRIA 0x0a |
|---|
| 472 | # endif |
|---|
| 473 | # ifndef SUBLANG_ARABIC_JORDAN |
|---|
| 474 | # define SUBLANG_ARABIC_JORDAN 0x0b |
|---|
| 475 | # endif |
|---|
| 476 | # ifndef SUBLANG_ARABIC_LEBANON |
|---|
| 477 | # define SUBLANG_ARABIC_LEBANON 0x0c |
|---|
| 478 | # endif |
|---|
| 479 | # ifndef SUBLANG_ARABIC_KUWAIT |
|---|
| 480 | # define SUBLANG_ARABIC_KUWAIT 0x0d |
|---|
| 481 | # endif |
|---|
| 482 | # ifndef SUBLANG_ARABIC_UAE |
|---|
| 483 | # define SUBLANG_ARABIC_UAE 0x0e |
|---|
| 484 | # endif |
|---|
| 485 | # ifndef SUBLANG_ARABIC_BAHRAIN |
|---|
| 486 | # define SUBLANG_ARABIC_BAHRAIN 0x0f |
|---|
| 487 | # endif |
|---|
| 488 | # ifndef SUBLANG_ARABIC_QATAR |
|---|
| 489 | # define SUBLANG_ARABIC_QATAR 0x10 |
|---|
| 490 | # endif |
|---|
| 491 | # ifndef SUBLANG_AZERI_LATIN |
|---|
| 492 | # define SUBLANG_AZERI_LATIN 0x01 |
|---|
| 493 | # endif |
|---|
| 494 | # ifndef SUBLANG_AZERI_CYRILLIC |
|---|
| 495 | # define SUBLANG_AZERI_CYRILLIC 0x02 |
|---|
| 496 | # endif |
|---|
| 497 | # ifndef SUBLANG_BENGALI_INDIA |
|---|
| 498 | # define SUBLANG_BENGALI_INDIA 0x00 |
|---|
| 499 | # endif |
|---|
| 500 | # ifndef SUBLANG_BENGALI_BANGLADESH |
|---|
| 501 | # define SUBLANG_BENGALI_BANGLADESH 0x01 |
|---|
| 502 | # endif |
|---|
| 503 | # ifndef SUBLANG_CHINESE_MACAU |
|---|
| 504 | # define SUBLANG_CHINESE_MACAU 0x05 |
|---|
| 505 | # endif |
|---|
| 506 | # ifndef SUBLANG_ENGLISH_SOUTH_AFRICA |
|---|
| 507 | # define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07 |
|---|
| 508 | # endif |
|---|
| 509 | # ifndef SUBLANG_ENGLISH_JAMAICA |
|---|
| 510 | # define SUBLANG_ENGLISH_JAMAICA 0x08 |
|---|
| 511 | # endif |
|---|
| 512 | # ifndef SUBLANG_ENGLISH_CARIBBEAN |
|---|
| 513 | # define SUBLANG_ENGLISH_CARIBBEAN 0x09 |
|---|
| 514 | # endif |
|---|
| 515 | # ifndef SUBLANG_ENGLISH_BELIZE |
|---|
| 516 | # define SUBLANG_ENGLISH_BELIZE 0x0a |
|---|
| 517 | # endif |
|---|
| 518 | # ifndef SUBLANG_ENGLISH_TRINIDAD |
|---|
| 519 | # define SUBLANG_ENGLISH_TRINIDAD 0x0b |
|---|
| 520 | # endif |
|---|
| 521 | # ifndef SUBLANG_ENGLISH_ZIMBABWE |
|---|
| 522 | # define SUBLANG_ENGLISH_ZIMBABWE 0x0c |
|---|
| 523 | # endif |
|---|
| 524 | # ifndef SUBLANG_ENGLISH_PHILIPPINES |
|---|
| 525 | # define SUBLANG_ENGLISH_PHILIPPINES 0x0d |
|---|
| 526 | # endif |
|---|
| 527 | # ifndef SUBLANG_ENGLISH_INDONESIA |
|---|
| 528 | # define SUBLANG_ENGLISH_INDONESIA 0x0e |
|---|
| 529 | # endif |
|---|
| 530 | # ifndef SUBLANG_ENGLISH_HONGKONG |
|---|
| 531 | # define SUBLANG_ENGLISH_HONGKONG 0x0f |
|---|
| 532 | # endif |
|---|
| 533 | # ifndef SUBLANG_ENGLISH_INDIA |
|---|
| 534 | # define SUBLANG_ENGLISH_INDIA 0x10 |
|---|
| 535 | # endif |
|---|
| 536 | # ifndef SUBLANG_ENGLISH_MALAYSIA |
|---|
| 537 | # define SUBLANG_ENGLISH_MALAYSIA 0x11 |
|---|
| 538 | # endif |
|---|
| 539 | # ifndef SUBLANG_ENGLISH_SINGAPORE |
|---|
| 540 | # define SUBLANG_ENGLISH_SINGAPORE 0x12 |
|---|
| 541 | # endif |
|---|
| 542 | # ifndef SUBLANG_FRENCH_LUXEMBOURG |
|---|
| 543 | # define SUBLANG_FRENCH_LUXEMBOURG 0x05 |
|---|
| 544 | # endif |
|---|
| 545 | # ifndef SUBLANG_FRENCH_MONACO |
|---|
| 546 | # define SUBLANG_FRENCH_MONACO 0x06 |
|---|
| 547 | # endif |
|---|
| 548 | # ifndef SUBLANG_FRENCH_WESTINDIES |
|---|
| 549 | # define SUBLANG_FRENCH_WESTINDIES 0x07 |
|---|
| 550 | # endif |
|---|
| 551 | # ifndef SUBLANG_FRENCH_REUNION |
|---|
| 552 | # define SUBLANG_FRENCH_REUNION 0x08 |
|---|
| 553 | # endif |
|---|
| 554 | # ifndef SUBLANG_FRENCH_CONGO |
|---|
| 555 | # define SUBLANG_FRENCH_CONGO 0x09 |
|---|
| 556 | # endif |
|---|
| 557 | # ifndef SUBLANG_FRENCH_SENEGAL |
|---|
| 558 | # define SUBLANG_FRENCH_SENEGAL 0x0a |
|---|
| 559 | # endif |
|---|
| 560 | # ifndef SUBLANG_FRENCH_CAMEROON |
|---|
| 561 | # define SUBLANG_FRENCH_CAMEROON 0x0b |
|---|
| 562 | # endif |
|---|
| 563 | # ifndef SUBLANG_FRENCH_COTEDIVOIRE |
|---|
| 564 | # define SUBLANG_FRENCH_COTEDIVOIRE 0x0c |
|---|
| 565 | # endif |
|---|
| 566 | # ifndef SUBLANG_FRENCH_MALI |
|---|
| 567 | # define SUBLANG_FRENCH_MALI 0x0d |
|---|
| 568 | # endif |
|---|
| 569 | # ifndef SUBLANG_FRENCH_MOROCCO |
|---|
| 570 | # define SUBLANG_FRENCH_MOROCCO 0x0e |
|---|
| 571 | # endif |
|---|
| 572 | # ifndef SUBLANG_FRENCH_HAITI |
|---|
| 573 | # define SUBLANG_FRENCH_HAITI 0x0f |
|---|
| 574 | # endif |
|---|
| 575 | # ifndef SUBLANG_GERMAN_LUXEMBOURG |
|---|
| 576 | # define SUBLANG_GERMAN_LUXEMBOURG 0x04 |
|---|
| 577 | # endif |
|---|
| 578 | # ifndef SUBLANG_GERMAN_LIECHTENSTEIN |
|---|
| 579 | # define SUBLANG_GERMAN_LIECHTENSTEIN 0x05 |
|---|
| 580 | # endif |
|---|
| 581 | # ifndef SUBLANG_KASHMIRI_INDIA |
|---|
| 582 | # define SUBLANG_KASHMIRI_INDIA 0x02 |
|---|
| 583 | # endif |
|---|
| 584 | # ifndef SUBLANG_MALAY_MALAYSIA |
|---|
| 585 | # define SUBLANG_MALAY_MALAYSIA 0x01 |
|---|
| 586 | # endif |
|---|
| 587 | # ifndef SUBLANG_MALAY_BRUNEI_DARUSSALAM |
|---|
| 588 | # define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02 |
|---|
| 589 | # endif |
|---|
| 590 | # ifndef SUBLANG_NEPALI_INDIA |
|---|
| 591 | # define SUBLANG_NEPALI_INDIA 0x02 |
|---|
| 592 | # endif |
|---|
| 593 | # ifndef SUBLANG_PUNJABI_INDIA |
|---|
| 594 | # define SUBLANG_PUNJABI_INDIA 0x00 |
|---|
| 595 | # endif |
|---|
| 596 | # ifndef SUBLANG_PUNJABI_PAKISTAN |
|---|
| 597 | # define SUBLANG_PUNJABI_PAKISTAN 0x01 |
|---|
| 598 | # endif |
|---|
| 599 | # ifndef SUBLANG_ROMANIAN_ROMANIA |
|---|
| 600 | # define SUBLANG_ROMANIAN_ROMANIA 0x00 |
|---|
| 601 | # endif |
|---|
| 602 | # ifndef SUBLANG_ROMANIAN_MOLDOVA |
|---|
| 603 | # define SUBLANG_ROMANIAN_MOLDOVA 0x01 |
|---|
| 604 | # endif |
|---|
| 605 | # ifndef SUBLANG_SERBIAN_LATIN |
|---|
| 606 | # define SUBLANG_SERBIAN_LATIN 0x02 |
|---|
| 607 | # endif |
|---|
| 608 | # ifndef SUBLANG_SERBIAN_CYRILLIC |
|---|
| 609 | # define SUBLANG_SERBIAN_CYRILLIC 0x03 |
|---|
| 610 | # endif |
|---|
| 611 | # ifndef SUBLANG_SINDHI_INDIA |
|---|
| 612 | # define SUBLANG_SINDHI_INDIA 0x00 |
|---|
| 613 | # endif |
|---|
| 614 | # ifndef SUBLANG_SINDHI_PAKISTAN |
|---|
| 615 | # define SUBLANG_SINDHI_PAKISTAN 0x01 |
|---|
| 616 | # endif |
|---|
| 617 | # ifndef SUBLANG_SPANISH_GUATEMALA |
|---|
| 618 | # define SUBLANG_SPANISH_GUATEMALA 0x04 |
|---|
| 619 | # endif |
|---|
| 620 | # ifndef SUBLANG_SPANISH_COSTA_RICA |
|---|
| 621 | # define SUBLANG_SPANISH_COSTA_RICA 0x05 |
|---|
| 622 | # endif |
|---|
| 623 | # ifndef SUBLANG_SPANISH_PANAMA |
|---|
| 624 | # define SUBLANG_SPANISH_PANAMA 0x06 |
|---|
| 625 | # endif |
|---|
| 626 | # ifndef SUBLANG_SPANISH_DOMINICAN_REPUBLIC |
|---|
| 627 | # define SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07 |
|---|
| 628 | # endif |
|---|
| 629 | # ifndef SUBLANG_SPANISH_VENEZUELA |
|---|
| 630 | # define SUBLANG_SPANISH_VENEZUELA 0x08 |
|---|
| 631 | # endif |
|---|
| 632 | # ifndef SUBLANG_SPANISH_COLOMBIA |
|---|
| 633 | # define SUBLANG_SPANISH_COLOMBIA 0x09 |
|---|
| 634 | # endif |
|---|
| 635 | # ifndef SUBLANG_SPANISH_PERU |
|---|
| 636 | # define SUBLANG_SPANISH_PERU 0x0a |
|---|
| 637 | # endif |
|---|
| 638 | # ifndef SUBLANG_SPANISH_ARGENTINA |
|---|
| 639 | # define SUBLANG_SPANISH_ARGENTINA 0x0b |
|---|
| 640 | # endif |
|---|
| 641 | # ifndef SUBLANG_SPANISH_ECUADOR |
|---|
| 642 | # define SUBLANG_SPANISH_ECUADOR 0x0c |
|---|
| 643 | # endif |
|---|
| 644 | # ifndef SUBLANG_SPANISH_CHILE |
|---|
| 645 | # define SUBLANG_SPANISH_CHILE 0x0d |
|---|
| 646 | # endif |
|---|
| 647 | # ifndef SUBLANG_SPANISH_URUGUAY |
|---|
| 648 | # define SUBLANG_SPANISH_URUGUAY 0x0e |
|---|
| 649 | # endif |
|---|
| 650 | # ifndef SUBLANG_SPANISH_PARAGUAY |
|---|
| 651 | # define SUBLANG_SPANISH_PARAGUAY 0x0f |
|---|
| 652 | # endif |
|---|
| 653 | # ifndef SUBLANG_SPANISH_BOLIVIA |
|---|
| 654 | # define SUBLANG_SPANISH_BOLIVIA 0x10 |
|---|
| 655 | # endif |
|---|
| 656 | # ifndef SUBLANG_SPANISH_EL_SALVADOR |
|---|
| 657 | # define SUBLANG_SPANISH_EL_SALVADOR 0x11 |
|---|
| 658 | # endif |
|---|
| 659 | # ifndef SUBLANG_SPANISH_HONDURAS |
|---|
| 660 | # define SUBLANG_SPANISH_HONDURAS 0x12 |
|---|
| 661 | # endif |
|---|
| 662 | # ifndef SUBLANG_SPANISH_NICARAGUA |
|---|
| 663 | # define SUBLANG_SPANISH_NICARAGUA 0x13 |
|---|
| 664 | # endif |
|---|
| 665 | # ifndef SUBLANG_SPANISH_PUERTO_RICO |
|---|
| 666 | # define SUBLANG_SPANISH_PUERTO_RICO 0x14 |
|---|
| 667 | # endif |
|---|
| 668 | # ifndef SUBLANG_SWEDISH_FINLAND |
|---|
| 669 | # define SUBLANG_SWEDISH_FINLAND 0x02 |
|---|
| 670 | # endif |
|---|
| 671 | # ifndef SUBLANG_TAMAZIGHT_ARABIC |
|---|
| 672 | # define SUBLANG_TAMAZIGHT_ARABIC 0x01 |
|---|
| 673 | # endif |
|---|
| 674 | # ifndef SUBLANG_TAMAZIGHT_LATIN |
|---|
| 675 | # define SUBLANG_TAMAZIGHT_LATIN 0x02 |
|---|
| 676 | # endif |
|---|
| 677 | # ifndef SUBLANG_TIGRINYA_ETHIOPIA |
|---|
| 678 | # define SUBLANG_TIGRINYA_ETHIOPIA 0x00 |
|---|
| 679 | # endif |
|---|
| 680 | # ifndef SUBLANG_TIGRINYA_ERITREA |
|---|
| 681 | # define SUBLANG_TIGRINYA_ERITREA 0x01 |
|---|
| 682 | # endif |
|---|
| 683 | # ifndef SUBLANG_URDU_PAKISTAN |
|---|
| 684 | # define SUBLANG_URDU_PAKISTAN 0x01 |
|---|
| 685 | # endif |
|---|
| 686 | # ifndef SUBLANG_URDU_INDIA |
|---|
| 687 | # define SUBLANG_URDU_INDIA 0x02 |
|---|
| 688 | # endif |
|---|
| 689 | # ifndef SUBLANG_UZBEK_LATIN |
|---|
| 690 | # define SUBLANG_UZBEK_LATIN 0x01 |
|---|
| 691 | # endif |
|---|
| 692 | # ifndef SUBLANG_UZBEK_CYRILLIC |
|---|
| 693 | # define SUBLANG_UZBEK_CYRILLIC 0x02 |
|---|
| 694 | # endif |
|---|
| 695 | #endif |
|---|
| 696 | |
|---|
| 697 | # if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE |
|---|
| 698 | |
|---|
| 699 | |
|---|
| 700 | |
|---|
| 701 | |
|---|
| 702 | |
|---|
| 703 | |
|---|
| 704 | void |
|---|
| 705 | _nl_locale_name_canonicalize (char *name) |
|---|
| 706 | { |
|---|
| 707 | |
|---|
| 708 | |
|---|
| 709 | |
|---|
| 710 | |
|---|
| 711 | |
|---|
| 712 | |
|---|
| 713 | |
|---|
| 714 | |
|---|
| 715 | |
|---|
| 716 | typedef struct { const char legacy[21+1]; const char unixy[5+1]; } |
|---|
| 717 | legacy_entry; |
|---|
| 718 | static const legacy_entry legacy_table[] = { |
|---|
| 719 | { "Afrikaans", "af" }, |
|---|
| 720 | { "Albanian", "sq" }, |
|---|
| 721 | { "Amharic", "am" }, |
|---|
| 722 | { "Arabic", "ar" }, |
|---|
| 723 | { "Armenian", "hy" }, |
|---|
| 724 | { "Assamese", "as" }, |
|---|
| 725 | { "Aymara", "ay" }, |
|---|
| 726 | { "Azerbaijani", "az" }, |
|---|
| 727 | { "Basque", "eu" }, |
|---|
| 728 | { "Belarusian", "be" }, |
|---|
| 729 | { "Belorussian", "be" }, |
|---|
| 730 | { "Bengali", "bn" }, |
|---|
| 731 | { "Brazilian Portugese", "pt_BR" }, |
|---|
| 732 | { "Brazilian Portuguese", "pt_BR" }, |
|---|
| 733 | { "Breton", "br" }, |
|---|
| 734 | { "Bulgarian", "bg" }, |
|---|
| 735 | { "Burmese", "my" }, |
|---|
| 736 | { "Byelorussian", "be" }, |
|---|
| 737 | { "Catalan", "ca" }, |
|---|
| 738 | { "Chewa", "ny" }, |
|---|
| 739 | { "Chichewa", "ny" }, |
|---|
| 740 | { "Chinese", "zh" }, |
|---|
| 741 | { "Chinese, Simplified", "zh_CN" }, |
|---|
| 742 | { "Chinese, Traditional", "zh_TW" }, |
|---|
| 743 | { "Chinese, Tradtional", "zh_TW" }, |
|---|
| 744 | { "Croatian", "hr" }, |
|---|
| 745 | { "Czech", "cs" }, |
|---|
| 746 | { "Danish", "da" }, |
|---|
| 747 | { "Dutch", "nl" }, |
|---|
| 748 | { "Dzongkha", "dz" }, |
|---|
| 749 | { "English", "en" }, |
|---|
| 750 | { "Esperanto", "eo" }, |
|---|
| 751 | { "Estonian", "et" }, |
|---|
| 752 | { "Faroese", "fo" }, |
|---|
| 753 | { "Farsi", "fa" }, |
|---|
| 754 | { "Finnish", "fi" }, |
|---|
| 755 | { "Flemish", "nl_BE" }, |
|---|
| 756 | { "French", "fr" }, |
|---|
| 757 | { "Galician", "gl" }, |
|---|
| 758 | { "Gallegan", "gl" }, |
|---|
| 759 | { "Georgian", "ka" }, |
|---|
| 760 | { "German", "de" }, |
|---|
| 761 | { "Greek", "el" }, |
|---|
| 762 | { "Greenlandic", "kl" }, |
|---|
| 763 | { "Guarani", "gn" }, |
|---|
| 764 | { "Gujarati", "gu" }, |
|---|
| 765 | { "Hawaiian", "haw" }, |
|---|
| 766 | { "Hebrew", "he" }, |
|---|
| 767 | { "Hindi", "hi" }, |
|---|
| 768 | { "Hungarian", "hu" }, |
|---|
| 769 | { "Icelandic", "is" }, |
|---|
| 770 | { "Indonesian", "id" }, |
|---|
| 771 | { "Inuktitut", "iu" }, |
|---|
| 772 | { "Irish", "ga" }, |
|---|
| 773 | { "Italian", "it" }, |
|---|
| 774 | { "Japanese", "ja" }, |
|---|
| 775 | { "Javanese", "jv" }, |
|---|
| 776 | { "Kalaallisut", "kl" }, |
|---|
| 777 | { "Kannada", "kn" }, |
|---|
| 778 | { "Kashmiri", "ks" }, |
|---|
| 779 | { "Kazakh", "kk" }, |
|---|
| 780 | { "Khmer", "km" }, |
|---|
| 781 | { "Kinyarwanda", "rw" }, |
|---|
| 782 | { "Kirghiz", "ky" }, |
|---|
| 783 | { "Korean", "ko" }, |
|---|
| 784 | { "Kurdish", "ku" }, |
|---|
| 785 | { "Latin", "la" }, |
|---|
| 786 | { "Latvian", "lv" }, |
|---|
| 787 | { "Lithuanian", "lt" }, |
|---|
| 788 | { "Macedonian", "mk" }, |
|---|
| 789 | { "Malagasy", "mg" }, |
|---|
| 790 | { "Malay", "ms" }, |
|---|
| 791 | { "Malayalam", "ml" }, |
|---|
| 792 | { "Maltese", "mt" }, |
|---|
| 793 | { "Manx", "gv" }, |
|---|
| 794 | { "Marathi", "mr" }, |
|---|
| 795 | { "Moldavian", "mo" }, |
|---|
| 796 | { "Mongolian", "mn" }, |
|---|
| 797 | { "Nepali", "ne" }, |
|---|
| 798 | { "Norwegian", "nb" }, |
|---|
| 799 | { "Nyanja", "ny" }, |
|---|
| 800 | { "Nynorsk", "nn" }, |
|---|
| 801 | { "Oriya", "or" }, |
|---|
| 802 | { "Oromo", "om" }, |
|---|
| 803 | { "Panjabi", "pa" }, |
|---|
| 804 | { "Pashto", "ps" }, |
|---|
| 805 | { "Persian", "fa" }, |
|---|
| 806 | { "Polish", "pl" }, |
|---|
| 807 | { "Portuguese", "pt" }, |
|---|
| 808 | { "Portuguese, Brazilian", "pt_BR" }, |
|---|
| 809 | { "Punjabi", "pa" }, |
|---|
| 810 | { "Pushto", "ps" }, |
|---|
| 811 | { "Quechua", "qu" }, |
|---|
| 812 | { "Romanian", "ro" }, |
|---|
| 813 | { "Ruanda", "rw" }, |
|---|
| 814 | { "Rundi", "rn" }, |
|---|
| 815 | { "Russian", "ru" }, |
|---|
| 816 | { "Sami", "se_NO" }, |
|---|
| 817 | { "Sanskrit", "sa" }, |
|---|
| 818 | { "Scottish", "gd" }, |
|---|
| 819 | { "Serbian", "sr" }, |
|---|
| 820 | { "Simplified Chinese", "zh_CN" }, |
|---|
| 821 | { "Sindhi", "sd" }, |
|---|
| 822 | { "Sinhalese", "si" }, |
|---|
| 823 | { "Slovak", "sk" }, |
|---|
| 824 | { "Slovenian", "sl" }, |
|---|
| 825 | { "Somali", "so" }, |
|---|
| 826 | { "Spanish", "es" }, |
|---|
| 827 | { "Sundanese", "su" }, |
|---|
| 828 | { "Swahili", "sw" }, |
|---|
| 829 | { "Swedish", "sv" }, |
|---|
| 830 | { "Tagalog", "tl" }, |
|---|
| 831 | { "Tajik", "tg" }, |
|---|
| 832 | { "Tajiki", "tg" }, |
|---|
| 833 | { "Tamil", "ta" }, |
|---|
| 834 | { "Tatar", "tt" }, |
|---|
| 835 | { "Telugu", "te" }, |
|---|
| 836 | { "Thai", "th" }, |
|---|
| 837 | { "Tibetan", "bo" }, |
|---|
| 838 | { "Tigrinya", "ti" }, |
|---|
| 839 | { "Tongan", "to" }, |
|---|
| 840 | { "Traditional Chinese", "zh_TW" }, |
|---|
|
|---|