4 * Copyright 1994 Alexandre Julliard
9 #ifndef X_DISPLAY_MISSING
11 #else /* !defined(X_DISPLAY_MISSING) */
13 #endif /* !defined(X_DISPLAY_MISSING) */
20 #ifdef MALLOC_DEBUGGING
32 #include "builtin32.h"
33 #include "debugtools.h"
34 #include "debugdefs.h"
45 #include "wine/winuser16.h"
49 /**********************************************************************/
51 USER_DRIVER *USER_Driver = NULL;
53 /* when adding new languages look at ole/ole2nls.c
54 * for proper iso name and Windows code (add 0x0400
55 * to the code listed there)
57 const WINE_LANGUAGE_DEF Languages[] =
59 {"En",0x0409}, /* LANG_En */
60 {"Es",0x040A}, /* LANG_Es */
61 {"De",0x0407}, /* LANG_De */
62 {"No",0x0414}, /* LANG_No */
63 {"Fr",0x040C}, /* LANG_Fr */
64 {"Fi",0x040B}, /* LANG_Fi */
65 {"Da",0x0406}, /* LANG_Da */
66 {"Cs",0x0405}, /* LANG_Cs */
67 {"Eo",0x048f}, /* LANG_Eo */
68 {"It",0x0410}, /* LANG_It */
69 {"Ko",0x0412}, /* LANG_Ko */
70 {"Hu",0x040e}, /* LANG_Hu */
71 {"Pl",0x0415}, /* LANG_Pl */
72 {"Pt",0x0416}, /* LANG_Pt */
73 {"Sk",0x041b}, /* LANG_Sk */
74 {"Sv",0x041d}, /* LANG_Sv */
75 {"Ca",0x0403}, /* LANG_Ca */
76 {"Nl",0x0413}, /* LANG_Nl */
77 {"Ru",0x0419}, /* LANG_Ru */
78 {"Wa",0x0490}, /* LANG_Wa */
79 {"Ga",0x043c}, /* LANG_Ga */
80 {"Gd",0x083c}, /* LANG_Gd */
81 {"Gv",0x0c3c}, /* LANG_Gv */
82 {"Kw",0x0491}, /* LANG_Kw */
83 {"Cy",0x0492}, /* LANG_Cy */
84 {"Br",0x0493}, /* LANG_Br */
85 {"Ja",0x0411}, /* LANG_Ja */
89 WORD WINE_LanguageId = 0x409; /* english as default */
91 struct options Options =
92 { /* default options */
95 NULL, /* desktopGeometry */
98 FALSE, /* synchronous */
100 FALSE, /* failReadOnly */
102 FALSE, /* Managed windows */
103 NULL /* Alternate config file name */
108 /***********************************************************************
109 * MAIN_ParseDebugOptions
111 * Turns specific debug messages on or off, according to "options".
113 void MAIN_ParseDebugOptions( const char *arg )
115 /* defined in relay32/relay386.c */
116 extern char **debug_relay_includelist;
117 extern char **debug_relay_excludelist;
118 /* defined in relay32/snoop.c */
119 extern char **debug_snoop_includelist;
120 extern char **debug_snoop_excludelist;
123 int l, cls, dotracerelay = TRACE_ON(relay);
125 char *options = strdup(arg);
130 if (options[l-1]=='\n') options[l-1]='\0';
133 if ((*options!='+')&&(*options!='-')){
136 for(j=0; j<DEBUG_CLASS_COUNT; j++)
137 if(!lstrncmpiA(options, debug_cl_name[j], strlen(debug_cl_name[j])))
139 if(j==DEBUG_CLASS_COUNT)
141 options += strlen(debug_cl_name[j]);
142 if ((*options!='+')&&(*options!='-'))
147 cls = -1; /* all classes */
149 if (strchr(options,','))
150 l=strchr(options,',')-options;
154 if (!lstrncmpiA(options+1,"all",l-1))
157 for (i=0; i<DEBUG_CHANNEL_COUNT; i++)
158 for(j=0; j<DEBUG_CLASS_COUNT; j++)
159 if(cls == -1 || cls == j)
160 __SET_DEBUGGING( j, debug_channels[i], (*options=='+') );
162 else if (!lstrncmpiA(options+1, "relay=", 6) ||
163 !lstrncmpiA(options+1, "snoop=", 6))
166 char *s, *s2, ***output, c;
168 for (i=0; i<DEBUG_CHANNEL_COUNT; i++)
169 if (!strncasecmp( debug_channels[i] + 1, options + 1, 5))
171 for(j=0; j<DEBUG_CLASS_COUNT; j++)
172 if(cls == -1 || cls == j)
173 __SET_DEBUGGING( j, debug_channels[i], 1 );
176 /* should never happen, maybe assert(i!=DEBUG_CHANNEL_COUNT)? */
177 if (i==DEBUG_CHANNEL_COUNT)
179 output = (*options == '+') ?
180 ((*(options+1) == 'r') ?
181 &debug_relay_includelist :
182 &debug_snoop_includelist) :
183 ((*(options+1) == 'r') ?
184 &debug_relay_excludelist :
185 &debug_snoop_excludelist);
187 /* if there are n ':', there are n+1 modules, and we need n+2 slots
188 * last one being for the sentinel (NULL) */
190 while((s = strchr(s, ':'))) i++, s++;
191 *output = malloc(sizeof(char **) * i);
194 while((s2 = strchr(s, ':'))) {
197 *((*output)+i) = CharUpperA(strdup(s));
203 *(options + l) = '\0';
204 *((*output)+i) = CharUpperA(strdup(s));
206 *((*output)+i+1) = NULL;
211 for (i=0; i<DEBUG_CHANNEL_COUNT; i++)
212 if (!strncasecmp( debug_channels[i] + 1, options + 1, l - 1) && !debug_channels[i][l])
214 for(j=0; j<DEBUG_CLASS_COUNT; j++)
215 if(cls == -1 || cls == j)
216 __SET_DEBUGGING( j, debug_channels[i], (*options=='+') );
219 if (i==DEBUG_CHANNEL_COUNT)
224 while((*options==',')&&(*(++options)));
226 /* special handling for relay debugging */
227 if (dotracerelay != TRACE_ON(relay))
228 BUILTIN32_SwitchRelayDebug( TRACE_ON(relay) );
230 if (!*options) return;
233 MESSAGE("%s: Syntax: -debugmsg [class]+xxx,... or "
234 "-debugmsg [class]-xxx,...\n",argv0);
235 MESSAGE("Example: -debugmsg +all,warn-heap\n"
236 " turn on all messages except warning heap messages\n");
237 MESSAGE("Special case: -debugmsg +relay=DLL:DLL.###:FuncName\n"
238 " turn on -debugmsg +relay only as specified\n"
239 "Special case: -debugmsg -relay=DLL:DLL.###:FuncName\n"
240 " turn on -debugmsg +relay except as specified\n"
241 "Also permitted, +snoop=..., -snoop=... as with relay.\n\n");
243 MESSAGE("Available message classes:\n");
244 for(i=0;i<DEBUG_CLASS_COUNT;i++)
245 MESSAGE( "%-9s", debug_cl_name[i]);
248 MESSAGE("Available message types:\n");
249 MESSAGE("%-9s ","all");
250 for(i=0;i<DEBUG_CHANNEL_COUNT;i++)
251 MESSAGE("%-9s%c",debug_channels[i] + 1,
252 (((i+2)%8==0)?'\n':' '));
257 /***********************************************************************
261 * Lang: a string whose two first chars are the iso name of a language.
262 * Country: a string whose two first chars are the iso name of country
263 * Charset: a string defining the chossen charset encoding
264 * Dialect: a string defining a variation of the locale
266 * all those values are from the standardized format of locale
267 * name in unix which is: Lang[_Country][.Charset][@Dialect]
270 * the numeric code of the language used by Windows (or 0x00)
272 int MAIN_GetLanguageID(LPCSTR Lang,LPCSTR Country,LPCSTR Charset,LPCSTR Dialect)
274 char lang[3]="??", country[3]={0,0,0};
275 char *charset=NULL, *dialect=NULL;
278 if (Lang==NULL) return 0x00;
279 if (Lang[0]) lang[0]=tolower(Lang[0]);
280 if (Lang[1]) lang[1]=tolower(Lang[1]);
283 if (Country[0]) country[0]=toupper(Country[0]);
284 if (Country[1]) country[1]=toupper(Country[1]);
289 charset=(char*)malloc(j+1);
291 charset[i]=toupper(Charset[i]);
297 dialect=(char*)malloc(j+1);
299 dialect[i]=tolower(Dialect[i]);
306 #define LANG_ENTRY_BEGIN(x,y) if(!strcmp(lang, x )) { \
309 goto end_MAIN_GetLanguageID; \
311 #define LANG_SUB_ENTRY(x,y,z) if (!strcmp(country, x )) \
312 ret = MAKELANGID( LANG_##y , SUBLANG_##z ); \
313 goto end_MAIN_GetLanguageID;
314 #define LANG_DIALECT_ENTRY(x,y) { ret = MAKELANGID(LANG_##x , SUBLANG_##y ); \
315 goto end_MAIN_GetLanguageID; }
316 #define LANG_ENTRY_END(x) ret = MAKELANGID(LANG_##x , SUBLANG_DEFAULT); \
317 goto end_MAIN_GetLanguageID; \
320 /*x01*/ LANG_ENTRY_BEGIN( "ar", ARABIC )
321 LANG_SUB_ENTRY( "SA", ARABIC, ARABIC)
322 LANG_SUB_ENTRY( "IQ", ARABIC, ARABIC_IRAQ )
323 LANG_SUB_ENTRY( "EG", ARABIC, ARABIC_EGYPT )
324 LANG_SUB_ENTRY( "LY", ARABIC, ARABIC_LIBYA )
325 LANG_SUB_ENTRY( "DZ", ARABIC, ARABIC_ALGERIA )
326 LANG_SUB_ENTRY( "MA", ARABIC, ARABIC_MOROCCO )
327 LANG_SUB_ENTRY( "TN", ARABIC, ARABIC_TUNISIA )
328 LANG_SUB_ENTRY( "OM", ARABIC, ARABIC_OMAN )
329 LANG_SUB_ENTRY( "YE", ARABIC, ARABIC_YEMEN )
330 LANG_SUB_ENTRY( "SY", ARABIC, ARABIC_SYRIA )
331 LANG_SUB_ENTRY( "JO", ARABIC, ARABIC_JORDAN )
332 LANG_SUB_ENTRY( "LB", ARABIC, ARABIC_LEBANON )
333 LANG_SUB_ENTRY( "KW", ARABIC, ARABIC_KUWAIT )
334 LANG_SUB_ENTRY( "AE", ARABIC, ARABIC_UAE )
335 LANG_SUB_ENTRY( "BH", ARABIC, ARABIC_BAHRAIN )
336 LANG_SUB_ENTRY( "QA", ARABIC, ARABIC_QATAR )
337 LANG_ENTRY_END( ARABIC )
338 /*x02*/ LANG_ENTRY_BEGIN( "bu", BULGARIAN )
339 LANG_ENTRY_END( BULGARIAN )
340 /*x03*/ LANG_ENTRY_BEGIN( "ca", CATALAN )
341 LANG_ENTRY_END( CATALAN )
342 /*x04*/ LANG_ENTRY_BEGIN( "zh", CHINESE )
343 LANG_SUB_ENTRY( "TW", CHINESE, CHINESE_TRADITIONAL )
344 LANG_SUB_ENTRY( "CN", CHINESE, CHINESE_SIMPLIFIED )
345 LANG_SUB_ENTRY( "HK", CHINESE, CHINESE_HONGKONG )
346 LANG_SUB_ENTRY( "SG", CHINESE, CHINESE_SINGAPORE )
347 LANG_SUB_ENTRY( "MO", CHINESE, CHINESE_MACAU )
348 LANG_ENTRY_END( CHINESE )
349 /*x05*/ LANG_ENTRY_BEGIN( "cs", CZECH )
350 LANG_ENTRY_END( CZECH )
351 /*x06*/ LANG_ENTRY_BEGIN( "da", DANISH )
352 LANG_ENTRY_END( DANISH )
353 /*x07*/ LANG_ENTRY_BEGIN( "de", GERMAN )
354 LANG_SUB_ENTRY( "DE", GERMAN, GERMAN )
355 LANG_SUB_ENTRY( "CH", GERMAN, GERMAN_SWISS )
356 LANG_SUB_ENTRY( "AT", GERMAN, GERMAN_AUSTRIAN )
357 LANG_SUB_ENTRY( "LU", GERMAN, GERMAN_LUXEMBOURG )
358 LANG_SUB_ENTRY( "LI", GERMAN, GERMAN_LIECHTENSTEIN )
359 LANG_ENTRY_END( GERMAN )
360 /*x08*/ LANG_ENTRY_BEGIN( "el", GREEK )
361 LANG_ENTRY_END( GREEK )
362 /*x09*/ LANG_ENTRY_BEGIN( "en", ENGLISH )
363 LANG_SUB_ENTRY( "US", ENGLISH, ENGLISH_US )
364 LANG_SUB_ENTRY( "UK", ENGLISH, ENGLISH_UK )
365 LANG_SUB_ENTRY( "AU", ENGLISH, ENGLISH_AUS )
366 LANG_SUB_ENTRY( "CA", ENGLISH, ENGLISH_CAN )
367 LANG_SUB_ENTRY( "NZ", ENGLISH, ENGLISH_NZ )
368 LANG_SUB_ENTRY( "EI", ENGLISH, ENGLISH_EIRE )
369 LANG_SUB_ENTRY( "ZA", ENGLISH, ENGLISH_SAFRICA )
370 LANG_SUB_ENTRY( "JM", ENGLISH, ENGLISH_JAMAICA )
371 /* LANG_SUB_ENTRY( "AG", ENGLISH, ENGLISH_CARIBBEAN ) */
372 LANG_SUB_ENTRY( "BZ", ENGLISH, ENGLISH_BELIZE )
373 LANG_SUB_ENTRY( "TT", ENGLISH, ENGLISH_TRINIDAD )
374 LANG_SUB_ENTRY( "ZW", ENGLISH, ENGLISH_ZIMBABWE )
375 LANG_SUB_ENTRY( "PH", ENGLISH, ENGLISH_PHILIPPINES )
376 LANG_ENTRY_END( ENGLISH )
377 /*x0a*/ LANG_ENTRY_BEGIN( "es", SPANISH )
378 /* traditional sorting */
379 if (!strcmp(dialect,"tradicional"))
380 LANG_DIALECT_ENTRY( SPANISH, SPANISH )
381 LANG_SUB_ENTRY( "MX", SPANISH, SPANISH_MEXICAN )
382 LANG_SUB_ENTRY( "ES", SPANISH, SPANISH_MODERN )
383 LANG_SUB_ENTRY( "GT", SPANISH, SPANISH_GUATEMALA )
384 LANG_SUB_ENTRY( "CR", SPANISH, SPANISH_COSTARICA )
385 LANG_SUB_ENTRY( "PA", SPANISH, SPANISH_PANAMA )
386 LANG_SUB_ENTRY( "DO", SPANISH, SPANISH_DOMINICAN )
387 LANG_SUB_ENTRY( "VE", SPANISH, SPANISH_VENEZUELA )
388 LANG_SUB_ENTRY( "CO", SPANISH, SPANISH_COLOMBIA )
389 LANG_SUB_ENTRY( "PE", SPANISH, SPANISH_PERU )
390 LANG_SUB_ENTRY( "AR", SPANISH, SPANISH_ARGENTINA )
391 LANG_SUB_ENTRY( "EC", SPANISH, SPANISH_ECUADOR )
392 LANG_SUB_ENTRY( "CL", SPANISH, SPANISH_CHILE )
393 LANG_SUB_ENTRY( "UY", SPANISH, SPANISH_URUGUAY )
394 LANG_SUB_ENTRY( "PY", SPANISH, SPANISH_PARAGUAY )
395 LANG_SUB_ENTRY( "BO", SPANISH, SPANISH_BOLIVIA )
396 LANG_SUB_ENTRY( "HN", SPANISH, SPANISH_HONDURAS )
397 LANG_SUB_ENTRY( "NI", SPANISH, SPANISH_NICARAGUA )
398 LANG_SUB_ENTRY( "PR", SPANISH, SPANISH_PUERTO_RICO )
399 LANG_ENTRY_END( SPANISH )
400 /*x0b*/ LANG_ENTRY_BEGIN( "fi", FINNISH )
401 LANG_ENTRY_END( FINNISH )
402 /*x0c*/ LANG_ENTRY_BEGIN( "fr", FRENCH )
403 LANG_SUB_ENTRY( "FR", FRENCH, FRENCH )
404 LANG_SUB_ENTRY( "BE", FRENCH, FRENCH_BELGIAN )
405 LANG_SUB_ENTRY( "CA", FRENCH, FRENCH_CANADIAN )
406 LANG_SUB_ENTRY( "CH", FRENCH, FRENCH_SWISS )
407 LANG_SUB_ENTRY( "LU", FRENCH, FRENCH_LUXEMBOURG )
408 LANG_SUB_ENTRY( "MC", FRENCH, FRENCH_MONACO )
409 LANG_ENTRY_END( FRENCH )
410 /*x0d*/ LANG_ENTRY_BEGIN( "iw", HEBREW )
411 LANG_ENTRY_END( HEBREW )
412 /*x0e*/ LANG_ENTRY_BEGIN( "hu", HUNGARIAN )
413 LANG_ENTRY_END( HUNGARIAN )
414 /*x0f*/ LANG_ENTRY_BEGIN( "ic", ICELANDIC )
415 LANG_ENTRY_END( ICELANDIC )
416 /*x10*/ LANG_ENTRY_BEGIN( "it", ITALIAN )
417 LANG_SUB_ENTRY( "IT", ITALIAN, ITALIAN )
418 LANG_SUB_ENTRY( "CH", ITALIAN, ITALIAN_SWISS )
419 LANG_ENTRY_END( ITALIAN )
420 /*x11*/ LANG_ENTRY_BEGIN( "ja", JAPANESE )
421 LANG_ENTRY_END( JAPANESE )
422 /*x12*/ LANG_ENTRY_BEGIN( "ko", KOREAN )
424 if (!strcmp(charset,"JOHAB"))
425 LANG_DIALECT_ENTRY( KOREAN, KOREAN_JOHAB )
427 LANG_DIALECT_ENTRY( KOREAN, KOREAN )
428 LANG_ENTRY_END( KOREAN )
429 /*x13*/ LANG_ENTRY_BEGIN( "nl", DUTCH )
430 LANG_SUB_ENTRY( "NL", DUTCH, DUTCH )
431 LANG_SUB_ENTRY( "BE", DUTCH, DUTCH_BELGIAN )
432 LANG_SUB_ENTRY( "SR", DUTCH, DUTCH_SURINAM )
433 LANG_ENTRY_END( DUTCH )
434 /*x14*/ LANG_ENTRY_BEGIN( "no", NORWEGIAN )
436 if (!strcmp(dialect,"nynorsk"))
437 LANG_DIALECT_ENTRY( NORWEGIAN, NORWEGIAN_NYNORSK )
439 LANG_DIALECT_ENTRY( NORWEGIAN, NORWEGIAN_BOKMAL )
440 LANG_ENTRY_END( NORWEGIAN )
441 /*x15*/ LANG_ENTRY_BEGIN( "pl", POLISH )
442 LANG_ENTRY_END( POLISH )
443 /*x16*/ LANG_ENTRY_BEGIN( "pt", PORTUGUESE )
444 LANG_SUB_ENTRY( "BR", PORTUGUESE, PORTUGUESE_BRAZILIAN )
445 LANG_SUB_ENTRY( "PT", PORTUGUESE, PORTUGUESE )
446 LANG_ENTRY_END( PORTUGUESE )
447 /*x17*/ LANG_ENTRY_BEGIN( "rm", RHAETO_ROMANCE )
448 LANG_ENTRY_END( RHAETO_ROMANCE )
449 /*x18*/ LANG_ENTRY_BEGIN( "ro", ROMANIAN )
450 LANG_SUB_ENTRY( "RO", ROMANIAN, ROMANIAN )
451 LANG_SUB_ENTRY( "MD", ROMANIAN, ROMANIAN_MOLDAVIA )
452 LANG_ENTRY_END( ROMANIAN )
453 /*x19*/ LANG_ENTRY_BEGIN( "ru", RUSSIAN )
454 LANG_SUB_ENTRY( "RU", RUSSIAN, RUSSIAN )
455 LANG_SUB_ENTRY( "MD", RUSSIAN, RUSSIAN_MOLDAVIA )
456 LANG_ENTRY_END( RUSSIAN )
457 /*x1a*/ if (!strcmp(lang,"sh") || !strcmp(lang,"hr") || !strcmp(lang,"sr")) {
459 LANG_DIALECT_ENTRY( SERBO_CROATIAN, NEUTRAL)
460 if (!strcmp(charset,"ISO-8859-5"))
461 LANG_DIALECT_ENTRY( SERBO_CROATIAN, SERBIAN )
462 LANG_SUB_ENTRY( "HR", SERBO_CROATIAN, CROATIAN )
463 if (!strcmp(country,"YU") && !strcmp(charset,"ISO-8859-2"))
464 LANG_DIALECT_ENTRY( SERBO_CROATIAN, SERBIAN_LATIN )
465 LANG_SUB_ENTRY( "YU", SERBO_CROATIAN, SERBIAN )
466 LANG_DIALECT_ENTRY( SERBO_CROATIAN, SERBIAN_LATIN )
468 /*x1b*/ LANG_ENTRY_BEGIN( "sk", SLOVAK )
469 LANG_ENTRY_END( SLOVAK )
470 /*x1c*/ LANG_ENTRY_BEGIN( "sq", ALBANIAN )
471 LANG_ENTRY_END( ALBANIAN )
472 /*x1d*/ LANG_ENTRY_BEGIN( "sv", SWEDISH )
473 LANG_SUB_ENTRY( "SE", SWEDISH, SWEDISH )
474 LANG_SUB_ENTRY( "FI", SWEDISH, SWEDISH_FINLAND )
475 LANG_ENTRY_END( SWEDISH )
476 /*x1e*/ LANG_ENTRY_BEGIN( "th", THAI )
477 LANG_ENTRY_END( THAI )
478 /*x1f*/ LANG_ENTRY_BEGIN( "tr", TURKISH )
479 LANG_ENTRY_END( TURKISH )
480 /*x20*/ LANG_ENTRY_BEGIN( "ur", URDU )
481 LANG_ENTRY_END( URDU )
482 /*x21*/ LANG_ENTRY_BEGIN( "in", INDONESIAN )
483 LANG_ENTRY_END( INDONESIAN )
484 /*x22*/ LANG_ENTRY_BEGIN( "uk", UKRAINIAN )
485 LANG_ENTRY_END( UKRAINIAN )
486 /*x23*/ LANG_ENTRY_BEGIN( "be", BYELORUSSIAN )
487 LANG_ENTRY_END( BYELORUSSIAN )
488 /*x24*/ LANG_ENTRY_BEGIN( "sl", SLOVENIAN )
489 LANG_ENTRY_END( SLOVENIAN )
490 /*x25*/ LANG_ENTRY_BEGIN( "et", ESTONIAN )
491 LANG_ENTRY_END( ESTONIAN )
492 /*x26*/ LANG_ENTRY_BEGIN( "lv", LATVIAN )
493 LANG_ENTRY_END( LATVIAN )
494 /*x27*/ LANG_ENTRY_BEGIN( "lt", LITHUANIAN )
495 /* traditional sorting ? */
496 if (!strcmp(dialect,"classic") || !strcmp(dialect,"traditional"))
497 LANG_DIALECT_ENTRY( LITHUANIAN, LITHUANIAN_CLASSIC )
499 LANG_DIALECT_ENTRY( LITHUANIAN, LITHUANIAN )
500 LANG_ENTRY_END( LITHUANIAN )
501 /*x28*/ LANG_ENTRY_BEGIN( "mi", MAORI )
502 LANG_ENTRY_END( MAORI )
503 /*x29*/ LANG_ENTRY_BEGIN( "fa", FARSI )
504 LANG_ENTRY_END( FARSI )
505 /*x2a*/ LANG_ENTRY_BEGIN( "vi", VIETNAMESE )
506 LANG_ENTRY_END( VIETNAMESE )
507 /*x2b*/ LANG_ENTRY_BEGIN( "hy", ARMENIAN )
508 LANG_ENTRY_END( ARMENIAN )
509 /*x2c*/ LANG_ENTRY_BEGIN( "az", AZERI )
511 if (strstr(charset,"KOI8") || !strcmp(charset,"ISO-8859-5"))
512 LANG_DIALECT_ENTRY( AZERI, AZERI_CYRILLIC )
514 LANG_DIALECT_ENTRY( AZERI, AZERI )
515 LANG_ENTRY_END( AZERI )
516 /*x2d*/ LANG_ENTRY_BEGIN( "eu", BASQUE )
517 LANG_ENTRY_END( BASQUE )
518 /*x2e*/ /*LANG_ENTRY_BEGIN( "??", SORBIAN )
519 LANG_ENTRY_END( SORBIAN ) */
520 /*x2f*/ LANG_ENTRY_BEGIN( "mk", MACEDONIAN )
521 LANG_ENTRY_END( MACEDONIAN )
522 /*x30*/ /*LANG_ENTRY_BEGIN( "??", SUTU )
523 LANG_ENTRY_END( SUTU ) */
524 /*x31*/ LANG_ENTRY_BEGIN( "ts", TSONGA )
525 LANG_ENTRY_END( TSONGA )
526 /*x32*/ /*LANG_ENTRY_BEGIN( "??", TSWANA )
527 LANG_ENTRY_END( TSWANA ) */
528 /*x33*/ /*LANG_ENTRY_BEGIN( "??", VENDA )
529 LANG_ENTRY_END( VENDA ) */
530 /*x34*/ LANG_ENTRY_BEGIN( "xh", XHOSA )
531 LANG_ENTRY_END( XHOSA )
532 /*x35*/ LANG_ENTRY_BEGIN( "zu", ZULU )
533 LANG_ENTRY_END( ZULU )
534 /*x36*/ LANG_ENTRY_BEGIN( "af", AFRIKAANS )
535 LANG_ENTRY_END( AFRIKAANS )
536 /*x37*/ LANG_ENTRY_BEGIN( "ka", GEORGIAN )
537 LANG_ENTRY_END( GEORGIAN )
538 /*x38*/ LANG_ENTRY_BEGIN( "fo", FAEROESE )
539 LANG_ENTRY_END( FAEROESE )
540 /*x39*/ LANG_ENTRY_BEGIN( "hi", HINDI )
541 LANG_ENTRY_END( HINDI )
542 /*x3a*/ LANG_ENTRY_BEGIN( "mt", MALTESE )
543 LANG_ENTRY_END( MALTESE )
544 /*x3b*/ /*LANG_ENTRY_BEGIN( "??", SAAMI )
545 LANG_ENTRY_END( SAAMI ) */
546 /*x3c*/ LANG_ENTRY_BEGIN( "ga", GAELIC )
547 LANG_DIALECT_ENTRY( GAELIC, GAELIC )
548 LANG_ENTRY_END( GAELIC )
549 /*x3c*/ LANG_ENTRY_BEGIN( "gd", GAELIC )
550 LANG_DIALECT_ENTRY( GAELIC, GAELIC_SCOTTISH )
551 LANG_ENTRY_END( GAELIC )
553 /*x3e*/ LANG_ENTRY_BEGIN( "ms", MALAY )
554 LANG_SUB_ENTRY( "MY", MALAY, MALAY )
555 LANG_SUB_ENTRY( "BN", MALAY, MALAY_BRUNEI_DARUSSALAM )
556 LANG_ENTRY_END( MALAY )
557 /*x3f*/ LANG_ENTRY_BEGIN( "kk", KAZAKH )
558 LANG_ENTRY_END( KAZAKH )
560 /*x41*/ LANG_ENTRY_BEGIN( "sw", SWAHILI )
561 LANG_ENTRY_END( SWAHILI )
563 /*x43*/ LANG_ENTRY_BEGIN( "uz", UZBEK )
565 if (strstr(charset,"KOI8") || !strcmp(charset,"ISO-8859-5"))
566 LANG_DIALECT_ENTRY( UZBEK, UZBEK_CYRILLIC )
568 LANG_DIALECT_ENTRY( UZBEK, UZBEK )
569 LANG_ENTRY_END( UZBEK )
570 /*x44*/ LANG_ENTRY_BEGIN( "tt", TATAR )
571 LANG_ENTRY_END( TATAR )
572 /*x45*/ LANG_ENTRY_BEGIN( "bn", BENGALI )
573 LANG_ENTRY_END( BENGALI )
574 /*x46*/ LANG_ENTRY_BEGIN( "pa", PUNJABI )
575 LANG_ENTRY_END( PUNJABI )
576 /*x47*/ LANG_ENTRY_BEGIN( "gu", GUJARATI )
577 LANG_ENTRY_END( GUJARATI )
578 /*x48*/ LANG_ENTRY_BEGIN( "or", ORIYA )
579 LANG_ENTRY_END( ORIYA )
580 /*x49*/ LANG_ENTRY_BEGIN( "ta", TAMIL )
581 LANG_ENTRY_END( TAMIL )
582 /*x4a*/ LANG_ENTRY_BEGIN( "te", TELUGU )
583 LANG_ENTRY_END( TELUGU )
584 /*x4b*/ LANG_ENTRY_BEGIN( "kn", KANNADA )
585 LANG_ENTRY_END( KANNADA )
586 /*x4c*/ LANG_ENTRY_BEGIN( "ml", MALAYALAM )
587 LANG_ENTRY_END( MALAYALAM )
588 /*x4d*/ LANG_ENTRY_BEGIN( "as", ASSAMESE )
589 LANG_ENTRY_END( ASSAMESE )
590 /*x4e*/ LANG_ENTRY_BEGIN( "mr", MARATHI )
591 LANG_ENTRY_END( MARATHI )
592 /*x4f*/ LANG_ENTRY_BEGIN( "sa", SANSKRIT )
593 LANG_ENTRY_END( SANSKRIT )
595 /*x57*/ /*LANG_ENTRY_BEGIN( "??", KONKANI )
596 LANG_ENTRY_END( KONKANI ) */
598 LANG_ENTRY_BEGIN( "eo", ESPERANTO ) /* not official */
599 LANG_ENTRY_END( ESPERANTO )
600 LANG_ENTRY_BEGIN( "wa", WALON ) /* not official */
601 LANG_ENTRY_END( WALON )
605 end_MAIN_GetLanguageID:
606 if (Charset) free(charset);
612 /***********************************************************************
613 * MAIN_ParseLanguageOption
615 * Parse -language option.
617 void MAIN_ParseLanguageOption( const char *arg )
619 const WINE_LANGUAGE_DEF *p = Languages;
621 Options.language = LANG_Xx; /* First (dummy) language */
624 if (!lstrcmpiA( p->name, arg ))
626 WINE_LanguageId = p->langid;
631 MESSAGE( "Invalid language specified '%s'. Supported languages are: ", arg );
632 for (p = Languages; p->name; p++) MESSAGE( "%s ", p->name );
638 /***********************************************************************
641 static void called_at_exit(void)
644 GDI_Driver->pFinalize();
646 USER_Driver->pFinalize();
651 /***********************************************************************
654 * Wine initialisation and command-line parsing
656 BOOL MAIN_WineInit( int argc, char *argv[] )
660 #ifdef MALLOC_DEBUGGING
664 if (!(trace = getenv("MALLOC_TRACE")))
666 MESSAGE( "MALLOC_TRACE not set. No trace generated\n" );
670 MESSAGE( "malloc trace goes to %s\n", trace );
678 setlocale(LC_CTYPE,"");
679 gettimeofday( &tv, NULL);
680 MSG_WineStartTicks = (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
682 OPTIONS_ParseOptions( argc, argv );
684 atexit(called_at_exit);
688 /***********************************************************************
689 * MessageBeep16 (USER.104)
691 void WINAPI MessageBeep16( UINT16 i )
697 /***********************************************************************
698 * MessageBeep32 (USER32.390)
700 BOOL WINAPI MessageBeep( UINT i )
707 /***********************************************************************
710 BOOL WINAPI Beep( DWORD dwFreq, DWORD dwDur )
712 /* dwFreq and dwDur are ignored by Win95 */
718 /***********************************************************************
719 * FileCDR (KERNEL.130)
721 FARPROC16 WINAPI FileCDR16(FARPROC16 x)
723 FIXME_(file)("(0x%8x): stub\n", (int) x);
724 return (FARPROC16)TRUE;
727 /***********************************************************************
728 * GetTickCount (USER.13) (KERNEL32.299)
730 * Returns the number of milliseconds, modulo 2^32, since the start
731 * of the current session.
733 DWORD WINAPI GetTickCount(void)
736 gettimeofday( &t, NULL );
737 return ((t.tv_sec * 1000) + (t.tv_usec / 1000)) - MSG_WineStartTicks;