Removed strange checkj for !filename, so we don't get section NULL
[wine] / include / winnls.h
1 #ifndef __WINE_WINNLS_H
2 #define __WINE_WINNLS_H
3 #ifndef NONLS
4
5 #include "windef.h"
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9
10 #define MB_PRECOMPOSED              0x00000001 
11 #define MB_COMPOSITE                0x00000002
12 #define MB_USEGLYPHCHARS            0x00000004
13 #define MB_ERR_INVALID_CHARS        0x00000008
14
15 #define LCID_INSTALLED              0x00000001 
16
17 /* flags to GetLocaleInfo */
18 #define LOCALE_NOUSEROVERRIDE       0x80000000
19 #define LOCALE_USE_CP_ACP           0x40000000
20
21 #define LOCALE_LOCALEINFOFLAGSMASK  0xC0000000
22
23 /* When adding new defines, don't forget to add an entry to the
24  * locale2id map in misc/ole2nls.c
25  */
26 #define LOCALE_ILANGUAGE            0x00000001   
27 #define LOCALE_SLANGUAGE            0x00000002   
28 #define LOCALE_SENGLANGUAGE         0x00001001   
29 #define LOCALE_SABBREVLANGNAME      0x00000003   
30 #define LOCALE_SNATIVELANGNAME      0x00000004   
31 #define LOCALE_ICOUNTRY             0x00000005   
32 #define LOCALE_SCOUNTRY             0x00000006   
33 #define LOCALE_SENGCOUNTRY          0x00001002   
34 #define LOCALE_SABBREVCTRYNAME      0x00000007   
35 #define LOCALE_SNATIVECTRYNAME      0x00000008   
36 #define LOCALE_IDEFAULTLANGUAGE     0x00000009   
37 #define LOCALE_IDEFAULTCOUNTRY      0x0000000A   
38 #define LOCALE_IDEFAULTCODEPAGE     0x0000000B   
39 #define LOCALE_IDEFAULTANSICODEPAGE 0x00001004   
40 #define LOCALE_IDEFAULTMACCODEPAGE  0x00001011
41 #define LOCALE_SLIST                0x0000000C   
42 #define LOCALE_IMEASURE             0x0000000D   
43 #define LOCALE_SDECIMAL             0x0000000E   
44 #define LOCALE_STHOUSAND            0x0000000F   
45 #define LOCALE_SGROUPING            0x00000010   
46 #define LOCALE_IDIGITS              0x00000011   
47 #define LOCALE_ILZERO               0x00000012   
48 #define LOCALE_INEGNUMBER           0x00001010   
49 #define LOCALE_SNATIVEDIGITS        0x00000013   
50 #define LOCALE_SCURRENCY            0x00000014   
51 #define LOCALE_SINTLSYMBOL          0x00000015   
52 #define LOCALE_SMONDECIMALSEP       0x00000016   
53 #define LOCALE_SMONTHOUSANDSEP      0x00000017   
54 #define LOCALE_SMONGROUPING         0x00000018   
55 #define LOCALE_ICURRDIGITS          0x00000019   
56 #define LOCALE_IINTLCURRDIGITS      0x0000001A   
57 #define LOCALE_ICURRENCY            0x0000001B   
58 #define LOCALE_INEGCURR             0x0000001C   
59 #define LOCALE_SDATE                0x0000001D   
60 #define LOCALE_STIME                0x0000001E   
61 #define LOCALE_SSHORTDATE           0x0000001F   
62 #define LOCALE_SLONGDATE            0x00000020   
63 #define LOCALE_STIMEFORMAT          0x00001003   
64 #define LOCALE_IDATE                0x00000021   
65 #define LOCALE_ILDATE               0x00000022   
66 #define LOCALE_ITIME                0x00000023   
67 #define LOCALE_ITIMEMARKPOSN        0x00001005   
68 #define LOCALE_ICENTURY             0x00000024   
69 #define LOCALE_ITLZERO              0x00000025   
70 #define LOCALE_IDAYLZERO            0x00000026   
71 #define LOCALE_IMONLZERO            0x00000027   
72 #define LOCALE_S1159                0x00000028   
73 #define LOCALE_S2359                0x00000029   
74 #define LOCALE_ICALENDARTYPE        0x00001009   
75 #define LOCALE_IOPTIONALCALENDAR    0x0000100B   
76 #define LOCALE_IFIRSTDAYOFWEEK      0x0000100C   
77 #define LOCALE_IFIRSTWEEKOFYEAR     0x0000100D   
78 #define LOCALE_SDAYNAME1            0x0000002A   
79 #define LOCALE_SDAYNAME2            0x0000002B   
80 #define LOCALE_SDAYNAME3            0x0000002C   
81 #define LOCALE_SDAYNAME4            0x0000002D   
82 #define LOCALE_SDAYNAME5            0x0000002E   
83 #define LOCALE_SDAYNAME6            0x0000002F   
84 #define LOCALE_SDAYNAME7            0x00000030   
85 #define LOCALE_SABBREVDAYNAME1      0x00000031   
86 #define LOCALE_SABBREVDAYNAME2      0x00000032   
87 #define LOCALE_SABBREVDAYNAME3      0x00000033   
88 #define LOCALE_SABBREVDAYNAME4      0x00000034   
89 #define LOCALE_SABBREVDAYNAME5      0x00000035   
90 #define LOCALE_SABBREVDAYNAME6      0x00000036   
91 #define LOCALE_SABBREVDAYNAME7      0x00000037   
92 #define LOCALE_SMONTHNAME1          0x00000038   
93 #define LOCALE_SMONTHNAME2          0x00000039   
94 #define LOCALE_SMONTHNAME3          0x0000003A   
95 #define LOCALE_SMONTHNAME4          0x0000003B   
96 #define LOCALE_SMONTHNAME5          0x0000003C   
97 #define LOCALE_SMONTHNAME6          0x0000003D   
98 #define LOCALE_SMONTHNAME7          0x0000003E   
99 #define LOCALE_SMONTHNAME8          0x0000003F   
100 #define LOCALE_SMONTHNAME9          0x00000040   
101 #define LOCALE_SMONTHNAME10         0x00000041   
102 #define LOCALE_SMONTHNAME11         0x00000042   
103 #define LOCALE_SMONTHNAME12         0x00000043   
104 #define LOCALE_SMONTHNAME13         0x0000100E   
105 #define LOCALE_SABBREVMONTHNAME1    0x00000044   
106 #define LOCALE_SABBREVMONTHNAME2    0x00000045   
107 #define LOCALE_SABBREVMONTHNAME3    0x00000046   
108 #define LOCALE_SABBREVMONTHNAME4    0x00000047   
109 #define LOCALE_SABBREVMONTHNAME5    0x00000048   
110 #define LOCALE_SABBREVMONTHNAME6    0x00000049   
111 #define LOCALE_SABBREVMONTHNAME7    0x0000004A   
112 #define LOCALE_SABBREVMONTHNAME8    0x0000004B   
113 #define LOCALE_SABBREVMONTHNAME9    0x0000004C   
114 #define LOCALE_SABBREVMONTHNAME10   0x0000004D   
115 #define LOCALE_SABBREVMONTHNAME11   0x0000004E   
116 #define LOCALE_SABBREVMONTHNAME12   0x0000004F   
117 #define LOCALE_SABBREVMONTHNAME13   0x0000100F   
118 #define LOCALE_SPOSITIVESIGN        0x00000050   
119 #define LOCALE_SNEGATIVESIGN        0x00000051   
120 #define LOCALE_IPOSSIGNPOSN         0x00000052   
121 #define LOCALE_INEGSIGNPOSN         0x00000053   
122 #define LOCALE_IPOSSYMPRECEDES      0x00000054   
123 #define LOCALE_IPOSSEPBYSPACE       0x00000055   
124 #define LOCALE_INEGSYMPRECEDES      0x00000056   
125 #define LOCALE_INEGSEPBYSPACE       0x00000057   
126 #define LOCALE_FONTSIGNATURE        0x00000058
127 #define LOCALE_SISO639LANGNAME      0x00000059
128 #define LOCALE_SISO3166CTRYNAME     0x0000005A
129
130 #define LOCALE_IDEFAULTEBCDICCODEPAGE 0x00001012
131 #define LOCALE_IPAPERSIZE             0x0000100A
132 #define LOCALE_SENGCURRNAME           0x00001007
133 #define LOCALE_SNATIVECURRNAME        0x00001008
134 #define LOCALE_SYEARMONTH             0x00001006
135 #define LOCALE_SSORTNAME              0x00001013
136 #define LOCALE_IDIGITSUBSTITUTION     0x00001014
137
138 #define NORM_IGNORECASE                         1
139 #define NORM_IGNORENONSPACE                     2
140 #define NORM_IGNORESYMBOLS                      4
141 #define NORM_STRINGSORT                         0x1000
142 #define NORM_IGNOREKANATYPE                     0x00010000
143 #define NORM_IGNOREWIDTH                        0x00020000
144
145 #define CP_ACP                                  0
146 #define CP_OEMCP                                1
147 #define CP_MACCP                                2
148 #define CP_THREAD_ACP                           3
149 #define CP_SYMBOL                               42
150 #define CP_UTF7                                 65000
151 #define CP_UTF8                                 65001
152
153 #define WC_DISCARDNS                0x00000010
154 #define WC_SEPCHARS                 0x00000020
155 #define WC_DEFAULTCHAR              0x00000040
156 #define WC_COMPOSITECHECK           0x00000200
157 #define WC_NO_BEST_FIT_CHARS        0x00000400
158
159
160 /* Locale Dependent Mapping Flags */
161 #define LCMAP_LOWERCASE 0x00000100      /* lower case letters */
162 #define LCMAP_UPPERCASE 0x00000200      /* upper case letters */
163 #define LCMAP_SORTKEY   0x00000400      /* WC sort key (normalize) */
164 #define LCMAP_BYTEREV   0x00000800      /* byte reversal */
165
166 #define SORT_STRINGSORT 0x00001000      /* take punctuation into account */
167
168 #define LCMAP_HIRAGANA  0x00100000      /* map katakana to hiragana */
169 #define LCMAP_KATAKANA  0x00200000      /* map hiragana to katakana */
170 #define LCMAP_HALFWIDTH 0x00400000      /* map double byte to single byte */
171 #define LCMAP_FULLWIDTH 0x00800000      /* map single byte to double byte */
172
173 /* Date Flags for GetDateFormat. */
174
175 #define DATE_SHORTDATE         0x00000001  /* use short date picture */
176 #define DATE_LONGDATE          0x00000002  /* use long date picture */
177 #define DATE_USE_ALT_CALENDAR  0x00000004  /* use alternate calendar */
178                           /* alt. calendar support is broken anyway */
179
180 #define TIME_FORCE24HOURFORMAT 0x00000008  /* force 24 hour format*/
181 #define TIME_NOTIMEMARKER      0x00000004  /* show no AM/PM */
182 #define TIME_NOSECONDS         0x00000002  /* show no seconds */
183 #define TIME_NOMINUTESORSECONDS 0x0000001  /* show no minutes either */
184
185 /* internal flags for GetDateFormat system */
186 #define DATE_DATEVARSONLY      0x00000100  /* only date stuff: yMdg */
187 #define TIME_TIMEVARSONLY      0x00000200  /* only time stuff: hHmst */
188 /* use this in a WineLib program if you really want all types */
189 #define LOCALE_TIMEDATEBOTH    0x00000300  /* full set */
190
191 /* Tests that we currently implement */
192 #define ITU_IMPLEMENTED_TESTS \
193         IS_TEXT_UNICODE_SIGNATURE| \
194         IS_TEXT_UNICODE_ODD_LENGTH
195
196         
197 /* Character Type Flags */
198 #define CT_CTYPE1               0x00000001      /* usual ctype */
199 #define CT_CTYPE2               0x00000002      /* bidirectional layout info */
200 #define CT_CTYPE3               0x00000004      /* textprocessing info */
201
202 /* CType 1 Flag Bits */
203 #define C1_UPPER                0x0001
204 #define C1_LOWER                0x0002
205 #define C1_DIGIT                0x0004
206 #define C1_SPACE                0x0008
207 #define C1_PUNCT                0x0010
208 #define C1_CNTRL                0x0020
209 #define C1_BLANK                0x0040
210 #define C1_XDIGIT               0x0080
211 #define C1_ALPHA                0x0100
212
213 /* CType 2 Flag Bits */
214 #define C2_LEFTTORIGHT          0x0001
215 #define C2_RIGHTTOLEFT          0x0002
216 #define C2_EUROPENUMBER         0x0003
217 #define C2_EUROPESEPARATOR      0x0004
218 #define C2_EUROPETERMINATOR     0x0005
219 #define C2_ARABICNUMBER         0x0006
220 #define C2_COMMONSEPARATOR      0x0007
221 #define C2_BLOCKSEPARATOR       0x0008
222 #define C2_SEGMENTSEPARATOR     0x0009
223 #define C2_WHITESPACE           0x000A
224 #define C2_OTHERNEUTRAL         0x000B
225 #define C2_NOTAPPLICABLE        0x0000
226
227 /* CType 3 Flag Bits */
228 #define C3_NONSPACING           0x0001
229 #define C3_DIACRITIC            0x0002
230 #define C3_VOWELMARK            0x0004
231 #define C3_SYMBOL               0x0008
232 #define C3_KATAKANA             0x0010
233 #define C3_HIRAGANA             0x0020
234 #define C3_HALFWIDTH            0x0040
235 #define C3_FULLWIDTH            0x0080
236 #define C3_IDEOGRAPH            0x0100
237 #define C3_KASHIDA              0x0200
238 #define C3_LEXICAL              0x0400
239 #define C3_ALPHA                0x8000
240 #define C3_NOTAPPLICABLE        0x0000
241
242 /* Code page information.
243  */
244 #define MAX_LEADBYTES     12
245 #define MAX_DEFAULTCHAR   2
246
247
248 /* Types
249  */
250
251 typedef DWORD LCTYPE;
252 typedef DWORD CALTYPE;
253 typedef DWORD CALID;
254
255 typedef struct
256 {
257     UINT MaxCharSize;
258     BYTE   DefaultChar[MAX_DEFAULTCHAR];
259     BYTE   LeadByte[MAX_LEADBYTES];
260 } CPINFO, *LPCPINFO;
261
262 typedef struct
263 {
264     UINT MaxCharSize;
265     BYTE DefaultChar[MAX_DEFAULTCHAR];
266     BYTE LeadByte[MAX_LEADBYTES];
267     WCHAR UnicodeDefaultChar;
268     UINT CodePage;
269     CHAR CodePageName[MAX_PATH];
270 } CPINFOEXA, *LPCPINFOEXA;
271
272 typedef struct
273 {
274     UINT MaxCharSize;
275     BYTE DefaultChar[MAX_DEFAULTCHAR];
276     BYTE LeadByte[MAX_LEADBYTES];
277     WCHAR UnicodeDefaultChar;
278     UINT CodePage;
279     WCHAR CodePageName[MAX_PATH];
280 } CPINFOEXW, *LPCPINFOEXW;
281
282 DECL_WINELIB_TYPE_AW(CPINFOEX)
283 DECL_WINELIB_TYPE_AW(LPCPINFOEX)
284
285 typedef struct _numberfmtA {
286     UINT NumDigits;
287     UINT LeadingZero;
288     UINT Grouping;
289     LPCSTR lpDecimalSep;
290     LPCSTR lpThousandSep;
291     UINT NegativeOrder;
292 } NUMBERFMTA, *LPNUMBERFMTA;
293
294 typedef struct _numberfmtW {
295     UINT NumDigits;
296     UINT LeadingZero;
297     UINT Grouping;
298     LPCWSTR lpDecimalSep;
299     LPCWSTR lpThousandSep;
300     UINT NegativeOrder;
301 } NUMBERFMTW, *LPNUMBERFMTW;
302
303 DECL_WINELIB_TYPE_AW(NUMBERFMT)
304 DECL_WINELIB_TYPE_AW(LPNUMBERFMT)
305
306 typedef struct _currencyfmtA
307 {   
308         UINT      NumDigits;   
309         UINT      LeadingZero; 
310         UINT      Grouping;   
311         LPCSTR    lpDecimalSep;   
312         LPCSTR    lpThousandSep; 
313         UINT      NegativeOrder;   
314         UINT      PositiveOrder; 
315         LPCSTR    lpCurrencySymbol;
316 } CURRENCYFMTA, *LPCURRENCYFMTA; 
317
318 typedef struct _currencyfmtW
319 {   
320         UINT      NumDigits;   
321         UINT      LeadingZero; 
322         UINT      Grouping;   
323         LPCWSTR   lpDecimalSep;   
324         LPCWSTR   lpThousandSep; 
325         UINT      NegativeOrder;   
326         UINT      PositiveOrder; 
327         LPCWSTR   lpCurrencySymbol;
328 } CURRENCYFMTW, *LPCURRENCYFMTW; 
329
330 DECL_WINELIB_TYPE_AW(CURRENCYFMT)
331 DECL_WINELIB_TYPE_AW(LPCURRENCYFMT)
332
333
334 /* APIs
335  */
336
337 typedef BOOL CALLBACK (*CALINFO_ENUMPROCA)(LPSTR);
338 typedef BOOL CALLBACK (*CALINFO_ENUMPROCW)(LPWSTR);
339 DECL_WINELIB_TYPE_AW(CALINFO_ENUMPROC)
340
341 BOOL    WINAPI EnumCalendarInfoA(CALINFO_ENUMPROCA lpCalInfoEnumProc,LCID Locale,CALID Calendar,CALTYPE CalType);
342 BOOL    WINAPI EnumCalendarInfoW(CALINFO_ENUMPROCW lpCalInfoEnumProc,LCID Locale,CALID Calendar,CALTYPE CalType);
343 #define EnumCalendarInfo WINELIB_NAME_AW(EnumCalendarInfo)
344
345 LCID WINAPI ConvertDefaultLocale(LCID   Locale);
346
347 BOOL    WINAPI GetCPInfo(UINT,LPCPINFO);
348 BOOL    WINAPI GetCPInfoExA(UINT,DWORD,LPCPINFOEXA);
349 BOOL    WINAPI GetCPInfoExW(UINT,DWORD,LPCPINFOEXW);
350 #define GetCPInfoEx WINELIB_NAME_AW(GetCPInfoEx)
351 INT     WINAPI GetLocaleInfoA(LCID,LCTYPE,LPSTR,INT);
352 INT     WINAPI GetLocaleInfoW(LCID,LCTYPE,LPWSTR,INT);
353 #define GetLocaleInfo WINELIB_NAME_AW(GetLocaleInfo)
354 INT     WINAPI GetNumberFormatA(LCID,DWORD,LPCSTR,const NUMBERFMTA*,LPSTR,int);
355 INT     WINAPI GetNumberFormatW(LCID,DWORD,LPCWSTR,const NUMBERFMTW*,LPWSTR,int);
356 #define GetNumberFormat WINELIB_NAME_AW(GetNumberFormat)
357
358 #ifdef __cplusplus
359 }
360 #endif
361
362 #endif /* !NONLS */
363 #endif  /* __WINE_WINNLS_H */