1 /*
2  * COPYRIGHT:       GPL - See COPYING in the top level directory
3  * PROJECT:         ReactOS Virtual DOS Machine
4  * FILE:            subsystems/mvdm/ntvdm/dos/dos32krnl/country.h
5  * PURPOSE:         DOS32 Country support
6  * PROGRAMMERS:     Hermes Belusca-Maito (hermes.belusca@sfr.fr)
7  *
8  * NOTE:            Support for default (english) language only.
9  *                  For other languages, please use COUNTRY.SYS
10  */
11 
12 #ifndef _COUNTRY_H_
13 #define _COUNTRY_H_
14 
15 /* DEFINITIONS ****************************************************************/
16 
17 #pragma pack(push, 1)
18 
19 #if 0 // Keep here for information purposes only
20 // DOS 2.00-2.10 country info structure
21 typedef struct _DOS_COUNTRY_INFO_OLD
22 {
23     WORD DateTimeFormat;
24     CHAR CurrencySymbol[2];
25     CHAR ThousandSep[2];
26     CHAR DecimalSep[2];
27     BYTE Reserved[24];
28 } DOS_COUNTRY_INFO_OLD, *PDOS_COUNTRY_INFO_OLD;
29 C_ASSERT(sizeof(DOS_COUNTRY_INFO_OLD) == 0x20);
30 #endif
31 
32 // DOS 2.11+ compatible country info structure
33 typedef struct _DOS_COUNTRY_INFO
34 {
35     WORD DateTimeFormat;
36     CHAR CurrencySymbol[5];
37     CHAR ThousandSep[2];
38     CHAR DecimalSep[2];
39     CHAR DateSep[2];
40     CHAR TimeSep[2];
41     BYTE CurrencyFormat;
42     BYTE CurrencyDigitsNum;
43     BYTE TimeFormat;
44     DWORD CaseMapPtr;
45     CHAR DataListSep[2];
46     BYTE Reserved[10];
47 } DOS_COUNTRY_INFO, *PDOS_COUNTRY_INFO;
48 C_ASSERT(sizeof(DOS_COUNTRY_INFO) == 0x22);
49 
50 typedef struct _DOS_COUNTRY_INFO_EX
51 {
52     WORD Size;
53     WORD CountryId;
54     WORD CodePage;
55     DOS_COUNTRY_INFO CountryInfo;
56 } DOS_COUNTRY_INFO_EX, *PDOS_COUNTRY_INFO_EX;
57 C_ASSERT(sizeof(DOS_COUNTRY_INFO_EX) == 0x28);
58 
59 typedef struct _DOS_COUNTRY_INFO_2
60 {
61     BYTE InfoId;
62     union
63     {
64         DOS_COUNTRY_INFO_EX CountryInfoEx;
65 
66         DWORD UpCaseTblPtr;
67         DWORD LoCaseTblPtr;
68 
69         DWORD FNameUpCaseTblPtr;
70         DWORD FNameTermTblPtr;
71 
72         DWORD CollateTblPtr;
73         DWORD DBCSLeadTblPtr;
74     };
75 } DOS_COUNTRY_INFO_2, *PDOS_COUNTRY_INFO_2;
76 
77 #pragma pack(pop)
78 
79 /* FUNCTIONS ******************************************************************/
80 
81 WORD
82 DosGetCountryInfo(IN OUT PWORD CountryId,
83                   OUT PDOS_COUNTRY_INFO CountryInfo);
84 
85 WORD
86 DosGetCountryInfoEx(IN BYTE InfoId,
87                     IN WORD CodePage,
88                     IN WORD CountryId,
89                     OUT PDOS_COUNTRY_INFO_2 CountryInfo,
90                     IN OUT PWORD BufferSize);
91 
92 WORD DosIfCharYesNo(WORD Char);
93 CHAR DosToUpper(CHAR Char);
94 VOID DosToUpperStrN(PCHAR DestStr, PCHAR SrcStr, WORD Length);
95 VOID DosToUpperStrZ(PSTR DestStr, PSTR SrcStr);
96 
97 BOOLEAN DosCountryInitialize(VOID);
98 
99 #endif /* _COUNTRY_H_ */
100