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