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