• R/O
  • SSH

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Mercurial Patch Queue for Windows System Libraries


Commit MetaInfo

Revisionbd9c2d0cd8e6e818cc5b20c0618e2d6d57648b15 (tree)
Zeit2019-04-03 06:55:20
AutorKeith Marshall <keith@user...>
CommiterKeith Marshall

Log Message

Merge <winnls.h> reorganization from 5.2-trunk.

Ändern Zusammenfassung

Diff

diff -r e77cb33f187d -r bd9c2d0cd8e6 series
--- a/series Mon Apr 01 19:25:55 2019 +0100
+++ b/series Tue Apr 02 22:55:20 2019 +0100
@@ -2,6 +2,7 @@
22 winerror-winsock2-update.patch #+void #-void
33 winnls-self-contained.patch #+self-contained
44 winnls-layout-improvement.patch
5+winnls-reorganization.patch
56 win10-version-identification.patch
67 winnt-consolidation.patch
78 winnt-pshpack-disinfection.patch #+hold
diff -r e77cb33f187d -r bd9c2d0cd8e6 winnls-reorganization.patch
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/winnls-reorganization.patch Tue Apr 02 22:55:20 2019 +0100
@@ -0,0 +1,795 @@
1+# HG changeset patch
2+# Parent ffbccc8040bcf25ff7b202335baf5c9c62008335
3+Reorganize <winnls.h> layout.
4+
5+diff --git a/wslapi/include/winnls.h b/wslapi/include/winnls.h
6+--- a/wslapi/include/winnls.h
7++++ b/wslapi/include/winnls.h
8+@@ -35,43 +35,82 @@
9+
10+ #include <winbase.h>
11+
12+ _BEGIN_C_DECLS
13+
14+-#define MAX_LEADBYTES 12
15+-#define MAX_DEFAULTCHAR 2
16++/* Locale Specifications
17++ * ---------------------
18++ * Locale identifiers; documentation reference links may be found at:
19++ * https://docs.microsoft.com/en-gb/windows/desktop/Intl/locale-information-constants
20++ */
21++#define LOCALE_USER_DEFAULT 0x0400
22++#define LOCALE_SYSTEM_DEFAULT 0x0800
23++
24++#if _WIN32_WINNT >= _WIN32_WINNT_WINXP
25++/* The invariant system locale was added in Windows-XP.
26++ */
27++#define LOCALE_INVARIANT 0x007F
28++
29++#if _WIN32_WINNT >= _WIN32_WINNT_VISTA
30++/* Support for custom locales was added in Windows-Vista.
31++ */
32++#define LOCALE_CUSTOM_DEFAULT 0x0C00
33++#define LOCALE_CUSTOM_UI_DEFAULT 0x1400
34++#define LOCALE_CUSTOM_UNSPECIFIED 0x1000
35++
36++#endif /* Vista (and later) custom locale identifiers */
37++#endif /* WinXP (and later) custom locale identifiers */
38++
39++/* Locale identifier reference classification flags; for documentation see:
40++ * https://docs.microsoft.com/en-gb/windows/desktop/api/winnls/nf-winnls-enumsystemlocalesa
41++ * https://docs.microsoft.com/en-gb/windows/desktop/api/winnls/nf-winnls-isvalidlocale
42++ */
43++#define LCID_INSTALLED 1
44++#define LCID_SUPPORTED 2
45++#define LCID_ALTERNATE_SORTS 4
46++
47++/* Locale information constants; (inadequately) documented at:
48++ * https://docs.microsoft.com/en-gb/windows/desktop/Intl/locale-information-constants
49++ *
50++ * Qualifier flags, which may be used in combination with any one of the
51++ * otherwise mutually exclusive locale property identification codes.
52++ */
53++#if WINVER >= _WIN32_WINNT_NT4
54++/* The first of these wasn't available prior to WinNT4. WINVER equivalence
55++ * suggests that this would also apply for Windows-95, but the documentation
56++ * states otherwise; this may not be supported prior to Windows-98.
57++ */
58++#define LOCALE_RETURN_NUMBER 0x20000000
59++#endif
60++/* The remaining pair appear to have been universally available.
61++ */
62++#define LOCALE_USE_CP_ACP 0x40000000
63+ #define LOCALE_NOUSEROVERRIDE 0x80000000
64+-#define LOCALE_USE_CP_ACP 0x40000000
65+
66+-#if WINVER >= _WIN32_WINNT_NT4 /* also >= Win95 */
67+-
68+-#define LOCALE_RETURN_NUMBER 0x20000000
69+-
70+-#endif /* >= WinNT4 / Win95 */
71+-
72++/* The locale property identification codes themselves. These are each
73++ * mutually exclusive of the others; while each one may be used with any
74++ * combination of the preceding qualifier flags, no combination of these
75++ * individually distinct property identification codes is permitted.
76++ */
77+ #define LOCALE_ILANGUAGE 1
78+ #define LOCALE_SLANGUAGE 2
79+-#define LOCALE_SENGLANGUAGE 0x1001
80+ #define LOCALE_SABBREVLANGNAME 3
81+ #define LOCALE_SNATIVELANGNAME 4
82+ #define LOCALE_ICOUNTRY 5
83+ #define LOCALE_SCOUNTRY 6
84+-#define LOCALE_SENGCOUNTRY 0x1002
85+ #define LOCALE_SABBREVCTRYNAME 7
86+ #define LOCALE_SNATIVECTRYNAME 8
87+ #define LOCALE_IDEFAULTLANGUAGE 9
88+ #define LOCALE_IDEFAULTCOUNTRY 10
89+ #define LOCALE_IDEFAULTCODEPAGE 11
90+-#define LOCALE_IDEFAULTANSICODEPAGE 0x1004
91+ #define LOCALE_SLIST 12
92+ #define LOCALE_IMEASURE 13
93+ #define LOCALE_SDECIMAL 14
94+ #define LOCALE_STHOUSAND 15
95+ #define LOCALE_SGROUPING 16
96+ #define LOCALE_IDIGITS 17
97+ #define LOCALE_ILZERO 18
98+-#define LOCALE_INEGNUMBER 0x1010
99+ #define LOCALE_SNATIVEDIGITS 19
100+ #define LOCALE_SCURRENCY 20
101+ #define LOCALE_SINTLSYMBOL 21
102+ #define LOCALE_SMONDECIMALSEP 22
103+ #define LOCALE_SMONTHOUSANDSEP 23
104+@@ -82,25 +121,19 @@
105+ #define LOCALE_INEGCURR 28
106+ #define LOCALE_SDATE 29
107+ #define LOCALE_STIME 30
108+ #define LOCALE_SSHORTDATE 31
109+ #define LOCALE_SLONGDATE 32
110+-#define LOCALE_STIMEFORMAT 0x1003
111+ #define LOCALE_IDATE 33
112+ #define LOCALE_ILDATE 34
113+ #define LOCALE_ITIME 35
114+-#define LOCALE_ITIMEMARKPOSN 0x1005
115+ #define LOCALE_ICENTURY 36
116+ #define LOCALE_ITLZERO 37
117+ #define LOCALE_IDAYLZERO 38
118+ #define LOCALE_IMONLZERO 39
119+ #define LOCALE_S1159 40
120+ #define LOCALE_S2359 41
121+-#define LOCALE_ICALENDARTYPE 0x1009
122+-#define LOCALE_IOPTIONALCALENDAR 0x100B
123+-#define LOCALE_IFIRSTDAYOFWEEK 0x100C
124+-#define LOCALE_IFIRSTWEEKOFYEAR 0x100D
125+ #define LOCALE_SDAYNAME1 42
126+ #define LOCALE_SDAYNAME2 43
127+ #define LOCALE_SDAYNAME3 44
128+ #define LOCALE_SDAYNAME4 45
129+ #define LOCALE_SDAYNAME5 46
130+@@ -123,11 +156,10 @@
131+ #define LOCALE_SMONTHNAME8 63
132+ #define LOCALE_SMONTHNAME9 64
133+ #define LOCALE_SMONTHNAME10 65
134+ #define LOCALE_SMONTHNAME11 66
135+ #define LOCALE_SMONTHNAME12 67
136+-#define LOCALE_SMONTHNAME13 0x100E
137+ #define LOCALE_SABBREVMONTHNAME1 68
138+ #define LOCALE_SABBREVMONTHNAME2 69
139+ #define LOCALE_SABBREVMONTHNAME3 70
140+ #define LOCALE_SABBREVMONTHNAME4 71
141+ #define LOCALE_SABBREVMONTHNAME5 72
142+@@ -136,11 +168,10 @@
143+ #define LOCALE_SABBREVMONTHNAME8 75
144+ #define LOCALE_SABBREVMONTHNAME9 76
145+ #define LOCALE_SABBREVMONTHNAME10 77
146+ #define LOCALE_SABBREVMONTHNAME11 78
147+ #define LOCALE_SABBREVMONTHNAME12 79
148+-#define LOCALE_SABBREVMONTHNAME13 0x100F
149+ #define LOCALE_SPOSITIVESIGN 80
150+ #define LOCALE_SNEGATIVESIGN 81
151+ #define LOCALE_IPOSSIGNPOSN 82
152+ #define LOCALE_INEGSIGNPOSN 83
153+ #define LOCALE_IPOSSYMPRECEDES 84
154+@@ -148,98 +179,88 @@
155+ #define LOCALE_INEGSYMPRECEDES 86
156+ #define LOCALE_INEGSEPBYSPACE 87
157+ #define LOCALE_FONTSIGNATURE 88
158+ #define LOCALE_SISO639LANGNAME 89
159+ #define LOCALE_SISO3166CTRYNAME 90
160+-#define LOCALE_SYSTEM_DEFAULT 0x800
161+-#define LOCALE_USER_DEFAULT 0x400
162+-#define NORM_IGNORECASE 1
163+-#define NORM_IGNOREKANATYPE 65536
164+-#define NORM_IGNORENONSPACE 2
165+-#define NORM_IGNORESYMBOLS 4
166+-#define NORM_IGNOREWIDTH 131072
167+-#define SORT_STRINGSORT 4096
168+-#define LCMAP_LOWERCASE 0x00000100
169+-#define LCMAP_UPPERCASE 0x00000200
170+-#define LCMAP_SORTKEY 0x00000400
171+-#define LCMAP_BYTEREV 0x00000800
172+-#define LCMAP_HIRAGANA 0x00100000
173+-#define LCMAP_KATAKANA 0x00200000
174+-#define LCMAP_HALFWIDTH 0x00400000
175+-#define LCMAP_FULLWIDTH 0x00800000
176+-#define LCMAP_LINGUISTIC_CASING 0x01000000
177+-#define LCMAP_SIMPLIFIED_CHINESE 0x02000000
178+-#define LCMAP_TRADITIONAL_CHINESE 0x04000000
179+-#define ENUM_ALL_CALENDARS (-1)
180+-#define DATE_SHORTDATE 1
181+-#define DATE_LONGDATE 2
182+-#define DATE_USE_ALT_CALENDAR 4
183+-#define CP_INSTALLED 1
184+-#define CP_SUPPORTED 2
185+-#define LCID_INSTALLED 1
186+-#define LCID_SUPPORTED 2
187+-#define LCID_ALTERNATE_SORTS 4
188+-#define MAP_FOLDCZONE 16
189+-#define MAP_FOLDDIGITS 128
190+-#define MAP_PRECOMPOSED 32
191+-#define MAP_COMPOSITE 64
192+-#define CP_ACP 0
193+-#define CP_OEMCP 1
194+-#define CP_MACCP 2
195+-#define CP_THREAD_ACP 3
196+-#define CP_SYMBOL 42
197+-#define CP_UTF7 65000
198+-#define CP_UTF8 65001
199+-#define CT_CTYPE1 1
200+-#define CT_CTYPE2 2
201+-#define CT_CTYPE3 4
202+-#define C1_UPPER 1
203+-#define C1_LOWER 2
204+-#define C1_DIGIT 4
205+-#define C1_SPACE 8
206+-#define C1_PUNCT 16
207+-#define C1_CNTRL 32
208+-#define C1_BLANK 64
209+-#define C1_XDIGIT 128
210+-#define C1_ALPHA 256
211+-#define C2_LEFTTORIGHT 1
212+-#define C2_RIGHTTOLEFT 2
213+-#define C2_EUROPENUMBER 3
214+-#define C2_EUROPESEPARATOR 4
215+-#define C2_EUROPETERMINATOR 5
216+-#define C2_ARABICNUMBER 6
217+-#define C2_COMMONSEPARATOR 7
218+-#define C2_BLOCKSEPARATOR 8
219+-#define C2_SEGMENTSEPARATOR 9
220+-#define C2_WHITESPACE 10
221+-#define C2_OTHERNEUTRAL 11
222+-#define C2_NOTAPPLICABLE 0
223+-#define C3_NONSPACING 1
224+-#define C3_DIACRITIC 2
225+-#define C3_VOWELMARK 4
226+-#define C3_SYMBOL 8
227+-#define C3_KATAKANA 16
228+-#define C3_HIRAGANA 32
229+-#define C3_HALFWIDTH 64
230+-#define C3_FULLWIDTH 128
231+-#define C3_IDEOGRAPH 256
232+-#define C3_KASHIDA 512
233+-#define C3_LEXICAL 1024
234+-#define C3_ALPHA 32768
235+-#define C3_NOTAPPLICABLE 0
236+-#define TIME_NOMINUTESORSECONDS 1
237+-#define TIME_NOSECONDS 2
238+-#define TIME_NOTIMEMARKER 4
239+-#define TIME_FORCE24HOURFORMAT 8
240+-#define MB_PRECOMPOSED 1
241+-#define MB_COMPOSITE 2
242+-#define MB_ERR_INVALID_CHARS 8
243+-#define MB_USEGLYPHCHARS 4
244+-#define WC_COMPOSITECHECK 512
245+-#define WC_DISCARDNS 16
246+-#define WC_SEPCHARS 32
247+-#define WC_DEFAULTCHAR 64
248++#define LOCALE_IGEOID 91
249++
250++#define LOCALE_SENGLANGUAGE 0x1001
251++#define LOCALE_SENGCOUNTRY 0x1002
252++#define LOCALE_STIMEFORMAT 0x1003
253++#define LOCALE_IDEFAULTANSICODEPAGE 0x1004
254++#define LOCALE_ITIMEMARKPOSN 0x1005
255++#define LOCALE_ICALENDARTYPE 0x1009
256++#define LOCALE_IOPTIONALCALENDAR 0x100B
257++#define LOCALE_IFIRSTDAYOFWEEK 0x100C
258++#define LOCALE_IFIRSTWEEKOFYEAR 0x100D
259++#define LOCALE_SMONTHNAME13 0x100E
260++#define LOCALE_SABBREVMONTHNAME13 0x100F
261++#define LOCALE_INEGNUMBER 0x1010
262++
263++#if WINVER >= _WIN32_WINDOWS_98
264++/* The following locale property identifiers were introduced for Windows-98,
265++ * and are thus implicitly supported on WinNT platforms from Win2K onwards.
266++ */
267++#define LOCALE_SYEARMONTH 0x1006
268++#define LOCALE_SENGCURRNAME 0x1007
269++#define LOCALE_SNATIVECURRNAME 0x1008
270++#define LOCALE_SSORTNAME 0x1013
271++
272++#if _WIN32_WINNT >= _WIN32_WINNT_WIN2K
273++/* The following locale identification codes were not supported, prior to
274++ * Win2K, and thus are unavailable on any Win9X platform.
275++ */
276++#define LOCALE_IPAPERSIZE 0x100A
277++#define LOCALE_IDEFAULTEBCDICCODEPAGE 0x1012
278++#define LOCALE_IDIGITSUBSTITUTION 0x1014
279++
280++#if _WIN32_WINNT >= _WIN32_WINNT_VISTA
281++/* Introduced with Win-Vista, Microsoft don't document values for these;
282++ * I have deduced them by inspection of GetLocaleInfoA() return values for
283++ * every possible property identifier in the range 0..0x1FFFFFFF, ignoring
284++ * those which return an error condition code.
285++ */
286++#define LOCALE_SNAME 92
287++#define LOCALE_SDURATION 93
288++#define LOCALE_SKEYBOARDSTOINSTALL 94
289++
290++#define LOCALE_SSHORTESTDAYNAME1 96
291++#define LOCALE_SSHORTESTDAYNAME2 97
292++#define LOCALE_SSHORTESTDAYNAME3 98
293++#define LOCALE_SSHORTESTDAYNAME4 99
294++#define LOCALE_SSHORTESTDAYNAME5 100
295++#define LOCALE_SSHORTESTDAYNAME6 101
296++#define LOCALE_SSHORTESTDAYNAME7 102
297++
298++#define LOCALE_SISO639LANGNAME2 103
299++#define LOCALE_SISO3166CTRYNAME2 104
300++
301++#define LOCALE_SNAN 105
302++#define LOCALE_SPOSINFINITY 106
303++#define LOCALE_SNEGINFINITY 107
304++#define LOCALE_SSCRIPTS 108
305++
306++#if 0
307++/* FIXME: Originally identified by Dimitri Papadopolous, as a Vista addition,
308++ * but with unknown value, (and I see nothing in WinXP GetLocaleInfo() output,
309++ * corresponding to ANY possible locale data identifier, which even remotely
310++ * resembles an IETF language name); Microsoft now document this identifier
311++ * as "deprecated in Vista and later", (which seems kind of contradictory).
312++ * Does this serve any useful purpose? Did it ever? Maybe define it as an
313++ * alias for LOCALE_SNAME, (which, as I've deduced its value, does seem to
314++ * represent an IETF name, on my Win7 host)? Or, just drop it altogether?
315++ */
316++#define LOCALE_SIETFLANGUAGE ???
317++#endif
318++
319++#endif /* Vista (and later) only */
320++#endif /* Win2K (and later) only */
321++#endif /* Win98/Win2K and later */
322++
323++
324++/* Country identification codes.
325++ */
326+ #define CTRY_DEFAULT 0
327+ #define CTRY_ALBANIA 355
328+ #define CTRY_ALGERIA 213
329+ #define CTRY_ARGENTINA 54
330+ #define CTRY_ARMENIA 374
331+@@ -348,10 +369,252 @@
332+ #define CTRY_UZBEKISTAN 7
333+ #define CTRY_VENEZUELA 58
334+ #define CTRY_VIET_NAM 84
335+ #define CTRY_YEMEN 967
336+ #define CTRY_ZIMBABWE 263
337++
338++
339++/* Language group enumeration options; for documentation see:
340++ * https://docs.microsoft.com/en-gb/windows/desktop/api/winnls/nf-winnls-enumsystemlanguagegroupsa
341++ */
342++#define LGRPID_INSTALLED 1
343++#define LGRPID_SUPPORTED 2
344++
345++/* Language group identification codes; for documentation see:
346++ * https://docs.microsoft.com/en-gb/windows/desktop/api/winnls/nf-winnls-enumlanguagegrouplocalesa
347++ * https://docs.microsoft.com/en-gb/windows/desktop/api/winnls/nf-winnls-isvalidlanguagegroup
348++ */
349++#define LGRPID_WESTERN_EUROPE 1
350++#define LGRPID_CENTRAL_EUROPE 2
351++#define LGRPID_BALTIC 3
352++#define LGRPID_GREEK 4
353++#define LGRPID_CYRILLIC 5
354++#define LGRPID_TURKISH 6
355++#define LGRPID_JAPANESE 7
356++#define LGRPID_KOREAN 8
357++#define LGRPID_TRADITIONAL_CHINESE 9
358++#define LGRPID_SIMPLIFIED_CHINESE 10
359++#define LGRPID_THAI 11
360++#define LGRPID_HEBREW 12
361++#define LGRPID_ARABIC 13
362++#define LGRPID_VIETNAMESE 14
363++#define LGRPID_INDIC 15
364++#define LGRPID_GEORGIAN 16
365++#define LGRPID_ARMENIAN 17
366++
367++
368++/* String Handling API
369++ * -------------------
370++ * Code page enumeration options; see:
371++ * https://docs.microsoft.com/en-gb/windows/desktop/api/winnls/nf-winnls-enumsystemcodepagesw
372++ */
373++#define CP_INSTALLED 1
374++#define CP_SUPPORTED 2
375++
376++/* Generic code page selectors for MBCS to/from UTF-16LE transformation:
377++ * https://docs.microsoft.com/en-gb/windows/desktop/api/stringapiset/nf-stringapiset-multibytetowidechar
378++ * https://docs.microsoft.com/en-gb/windows/desktop/api/stringapiset/nf-stringapiset-widechartomultibyte
379++ */
380++#define CP_ACP 0
381++#define CP_OEMCP 1
382++#define CP_MACCP 2
383++#define CP_THREAD_ACP 3
384++#define CP_SYMBOL 42
385++#define CP_UTF7 65000
386++#define CP_UTF8 65001
387++
388++/* Options for MBCS to UTF-16LE transformations; see:
389++ * https://docs.microsoft.com/en-gb/windows/desktop/api/stringapiset/nf-stringapiset-multibytetowidechar
390++ */
391++#define MB_PRECOMPOSED 0x001
392++#define MB_COMPOSITE 0x002
393++#define MB_USEGLYPHCHARS 0x004
394++#define MB_ERR_INVALID_CHARS 0x008
395++
396++/* Options for UTF-16LE to MBCS transformations; see:
397++ */
398++#define WC_DISCARDNS 0x010
399++#define WC_SEPCHARS 0x020
400++#define WC_DEFAULTCHAR 0x040
401++#define WC_COMPOSITECHECK 0x200
402++
403++#if _WIN32_WINNT >= _WIN32_WINNT_WIN2K
404++/* The following is not supported on Win9x, nor on WinNT prior to Win-2000.
405++ */
406++#define WC_NO_BEST_FIT_CHARS 0x400
407++
408++#endif /* Windows-2000 and later */
409++
410++/* Character type classification operations; see:
411++ * https://docs.microsoft.com/en-gb/windows/desktop/api/stringapiset/nf-stringapiset-getstringtypew
412++ */
413++#define CT_CTYPE1 1
414++#define CT_CTYPE2 2
415++#define CT_CTYPE3 4
416++
417++/* CT_CTYPE1 classification (approximately equivalent to ISO-C ctype);
418++ * for each character in the string, returns any bit-wise combination of
419++ * the following attributes:
420++ */
421++#define C1_UPPER 0x0001
422++#define C1_LOWER 0x0002
423++#define C1_DIGIT 0x0004
424++#define C1_SPACE 0x0008
425++#define C1_PUNCT 0x0010
426++#define C1_CNTRL 0x0020
427++#define C1_BLANK 0x0040
428++#define C1_XDIGIT 0x0080
429++#define C1_ALPHA 0x0100
430++#define C1_DEFINED 0x0200
431++
432++/* CT_CTYPE2 classification; for each character in the string, returns
433++ * one of the following mutually exclusive Unicode bidirectional layout
434++ * attributes:
435++ */
436++#define C2_NOTAPPLICABLE 0
437++#define C2_LEFTTORIGHT 1
438++#define C2_RIGHTTOLEFT 2
439++#define C2_EUROPENUMBER 3
440++#define C2_EUROPESEPARATOR 4
441++#define C2_EUROPETERMINATOR 5
442++#define C2_ARABICNUMBER 6
443++#define C2_COMMONSEPARATOR 7
444++#define C2_BLOCKSEPARATOR 8
445++#define C2_SEGMENTSEPARATOR 9
446++#define C2_WHITESPACE 10
447++#define C2_OTHERNEUTRAL 11
448++
449++/* CT_CTYPE3 classification; for each character in the string, returns
450++ * a bit-wise combination of any of the following attributes:
451++ */
452++#define C3_NOTAPPLICABLE 0x0000
453++#define C3_NONSPACING 0x0001
454++#define C3_DIACRITIC 0x0002
455++#define C3_VOWELMARK 0x0004
456++#define C3_SYMBOL 0x0008
457++#define C3_KATAKANA 0x0010
458++#define C3_HIRAGANA 0x0020
459++#define C3_HALFWIDTH 0x0040
460++#define C3_FULLWIDTH 0x0080
461++#define C3_IDEOGRAPH 0x0100
462++#define C3_KASHIDA 0x0200
463++#define C3_LEXICAL 0x0400
464++#define C3_ALPHA 0x8000
465++
466++#if _WIN32_WINNT >= _WIN32_WINNT_VISTA
467++
468++#define C3_HIGHSURROGATE 0x0800
469++#define C3_LOWSURROGATE 0x1000
470++
471++#endif /* Windows-Vista and later */
472++
473++/* String sorting and transformation option flags; see:
474++ * https://docs.microsoft.com/en-gb/windows/desktop/api/winnls/nf-winnls-lcmapstringex
475++ */
476++#define LCMAP_LOWERCASE 0x00000100
477++#define LCMAP_UPPERCASE 0x00000200
478++#define LCMAP_SORTKEY 0x00000400
479++#define LCMAP_BYTEREV 0x00000800
480++#define LCMAP_HIRAGANA 0x00100000
481++#define LCMAP_KATAKANA 0x00200000
482++#define LCMAP_HALFWIDTH 0x00400000
483++#define LCMAP_FULLWIDTH 0x00800000
484++#define LCMAP_LINGUISTIC_CASING 0x01000000
485++#define LCMAP_SIMPLIFIED_CHINESE 0x02000000
486++#define LCMAP_TRADITIONAL_CHINESE 0x04000000
487++
488++/* Additional Unicode string transformation options; see:
489++ * https://docs.microsoft.com/en-gb/windows/desktop/api/stringapiset/nf-stringapiset-foldstringw
490++ */
491++#define MAP_FOLDCZONE 0x00000010
492++#define MAP_PRECOMPOSED 0x00000020
493++#define MAP_COMPOSITE 0x00000040
494++#define MAP_FOLDDIGITS 0x00000080
495++
496++#if _WIN32_WINNT >= _WIN32_WINNT_WIN2K
497++/* This additional FoldString() transformation option was not supported,
498++ * prior to Windows-2000.
499++ */
500++#define MAP_EXPAND_LIGATURES 0x00002000
501++
502++#endif /* Windows-2000 and later */
503++
504++/* Normalization options for string comparison, sorting, and transformation:
505++ * https://docs.microsoft.com/en-gb/windows/desktop/api/stringapiset/nf-stringapiset-comparestringex
506++ * https://docs.microsoft.com/en-gb/windows/desktop/api/winnls/nf-winnls-lcmapstringex
507++ */
508++#define NORM_IGNORECASE 0x00000001
509++#define NORM_IGNORENONSPACE 0x00000002
510++#define NORM_IGNORESYMBOLS 0x00000004
511++#define NORM_IGNOREKANATYPE 0x00010000
512++#define NORM_IGNOREWIDTH 0x00020000
513++
514++/* String sorting options; see:
515++ * https://docs.microsoft.com/en-gb/windows/desktop/api/stringapiset/nf-stringapiset-comparestringex
516++ * https://docs.microsoft.com/en-gb/windows/desktop/api/winnls/nf-winnls-lcmapstringex
517++ */
518++#define SORT_STRINGSORT 0x00001000
519++
520++/* String comparator return values; (note intentional difference from ISO-C):
521++ * https://docs.microsoft.com/en-gb/windows/desktop/api/stringapiset/nf-stringapiset-comparestringex
522++ */
523++#define CSTR_LESS_THAN 1
524++#define CSTR_EQUAL 2
525++#define CSTR_GREATER_THAN 3
526++
527++/* Macros for UTF-16LE surrogate identification.
528++ */
529++#define IS_HIGH_SURROGATE(c) (((c) & 0xFC00) == 0xD800)
530++#define IS_LOW_SURROGATE(c) (((c) & 0xFC00) == 0xDC00)
531++#define IS_SURROGATE_PAIR(hc,lc) (IS_HIGH_SURROGATE(hc) && IS_LOW_SURROGATE(lc))
532++
533++
534++/* Date and Time Handling API
535++ * --------------------------
536++ * Calendar identification codes; these are documented at:
537++ * https://docs.microsoft.com/en-gb/windows/desktop/Intl/calendar-identifiers
538++ */
539++#define CAL_GREGORIAN 1
540++#define CAL_GREGORIAN_US 2
541++#define CAL_JAPAN 3
542++#define CAL_TAIWAN 4
543++#define CAL_KOREA 5
544++#define CAL_HIJRI 6
545++#define CAL_THAI 7
546++#define CAL_HEBREW 8
547++#define CAL_GREGORIAN_ME_FRENCH 9
548++#define CAL_GREGORIAN_ARABIC 10
549++#define CAL_GREGORIAN_XLIT_ENGLISH 11
550++#define CAL_GREGORIAN_XLIT_FRENCH 12
551++
552++#if _WIN32_WINNT >= _WIN32_WINNT_VISTA
553++/* Introduced for Windows-Vista and later; values in the interval 13..22 are
554++ * reserved by Microsoft, and are unallocated.
555++ */
556++#define CAL_UMALQURA 23
557++#endif
558++
559++#define ENUM_ALL_CALENDARS (-1)
560++
561++/* Calendar property identifiation codes; (inadequately) documented at:
562++ * https://docs.microsoft.com/en-gb/windows/desktop/Intl/calendar-type-information
563++ */
564++#if WINVER >= _WIN32_WINDOWS_98
565++/* Analagous to, and sharing values with, their corresponding locale property
566++ * qualifying flags, these calendar property qualifying flags were unsupported
567++ * prior to Windows-98, (and correpondingly, Windows-2000 for WinNT platforms).
568++ */
569++#define CAL_RETURN_NUMBER 0x20000000
570++#define CAL_USE_CP_ACP 0x40000000
571++#define CAL_NOUSEROVERRIDE 0x80000000
572++#endif
573++
574++/* The calendar property identification codes themselves. Each one is
575++ * mutually exclusive of the others; while each one may be used with any
576++ * combination of the preceding qualifier flags, no combination of these
577++ * individually distinct property identification codes is permitted.
578++ */
579+ #define CAL_ICALINTVALUE 1
580+ #define CAL_SCALNAME 2
581+ #define CAL_IYEAROFFSETRANGE 3
582+ #define CAL_SERASTRING 4
583+ #define CAL_SSHORTDATE 5
584+@@ -394,111 +657,65 @@
585+ #define CAL_SABBREVMONTHNAME9 42
586+ #define CAL_SABBREVMONTHNAME10 43
587+ #define CAL_SABBREVMONTHNAME11 44
588+ #define CAL_SABBREVMONTHNAME12 45
589+ #define CAL_SABBREVMONTHNAME13 46
590+-#define CAL_GREGORIAN 1
591+-#define CAL_GREGORIAN_US 2
592+-#define CAL_JAPAN 3
593+-#define CAL_TAIWAN 4
594+-#define CAL_KOREA 5
595+-#define CAL_HIJRI 6
596+-#define CAL_THAI 7
597+-#define CAL_HEBREW 8
598+-#define CAL_GREGORIAN_ME_FRENCH 9
599+-#define CAL_GREGORIAN_ARABIC 10
600+-#define CAL_GREGORIAN_XLIT_ENGLISH 11
601+-#define CAL_GREGORIAN_XLIT_FRENCH 12
602+-#define CSTR_LESS_THAN 1
603+-#define CSTR_EQUAL 2
604+-#define CSTR_GREATER_THAN 3
605+-#define LGRPID_INSTALLED 1
606+-#define LGRPID_SUPPORTED 2
607+-#define LGRPID_WESTERN_EUROPE 1
608+-#define LGRPID_CENTRAL_EUROPE 2
609+-#define LGRPID_BALTIC 3
610+-#define LGRPID_GREEK 4
611+-#define LGRPID_CYRILLIC 5
612+-#define LGRPID_TURKISH 6
613+-#define LGRPID_JAPANESE 7
614+-#define LGRPID_KOREAN 8
615+-#define LGRPID_TRADITIONAL_CHINESE 9
616+-#define LGRPID_SIMPLIFIED_CHINESE 10
617+-#define LGRPID_THAI 11
618+-#define LGRPID_HEBREW 12
619+-#define LGRPID_ARABIC 13
620+-#define LGRPID_VIETNAMESE 14
621+-#define LGRPID_INDIC 15
622+-#define LGRPID_GEORGIAN 16
623+-#define LGRPID_ARMENIAN 17
624+-#define IS_HIGH_SURROGATE(c) (((c) & 0xFC00) == 0xD800)
625+-#define IS_LOW_SURROGATE(c) (((c) & 0xFC00) == 0xDC00)
626+-#define IS_SURROGATE_PAIR(hc,lc) (IS_HIGH_SURROGATE(hc) && IS_LOW_SURROGATE(lc))
627+
628+-#if WINVER >= _WIN32_WINDOWS_98 /* also >= Win2K */
629+-
630++#if WINVER >= _WIN32_WINDOWS_98
631++/* The following pair of calendar properties were unsupported prior to
632++ * Windows-98, (or Windows-2000, for WinNT platforms).
633++ */
634+ #define CAL_SYEARMONTH 47
635+ #define CAL_ITWODIGITYEARMAX 48
636+-#define CAL_NOUSEROVERRIDE LOCALE_NOUSEROVERRIDE
637+-#define CAL_RETURN_NUMBER LOCALE_RETURN_NUMBER
638+-#define CAL_USE_CP_ACP LOCALE_USE_CP_ACP
639+-#define LOCALE_SYEARMONTH 0x1006
640+-#define LOCALE_SENGCURRNAME 0x1007
641+-#define LOCALE_SNATIVECURRNAME 0x1008
642+-#define LOCALE_SSORTNAME 0x1013
643+
644+-#endif /* >= Win98 / Win2K */
645++#if _WIN32_WINNT >= _WIN32_WINNT_VISTA
646++
647++#define CAL_SSHORTESTDAYNAME1 49
648++#define CAL_SSHORTESTDAYNAME2 50
649++#define CAL_SSHORTESTDAYNAME3 51
650++#define CAL_SSHORTESTDAYNAME4 52
651++#define CAL_SSHORTESTDAYNAME5 53
652++#define CAL_SSHORTESTDAYNAME6 54
653++#define CAL_SSHORTESTDAYNAME7 55
654++
655++#if _WIN32_WINNT >= _WIN32_WINNT_WIN7
656++/* New calendar properties, supported on Windows-7 and later. Note that
657++ * these may not be accessible through LCID references; e.g. when running
658++ * on Windows-7 Home Premium, it appears that GetCalendarInfoA() cannot
659++ * retrieve them, but GetCalendarInfoEx() can.
660++ */
661++#define CAL_SMONTHDAY 56
662++#define CAL_SABBREVERASTRING 57
663++
664++#endif /* Windows-7 and later */
665++#endif /* Windows-Vista and later */
666++#endif /* Win98 / Win2K and later */
667++
668++/* Date format options, for use with GetDateFormat*() functions; see:
669++ * https://docs.microsoft.com/en-gb/windows/desktop/api/datetimeapi/nf-datetimeapi-getdateformatex
670++ */
671++#define DATE_SHORTDATE 1
672++#define DATE_LONGDATE 2
673++#define DATE_USE_ALT_CALENDAR 4
674+
675+ #if _WIN32_WINNT >= _WIN32_WINNT_WIN2K
676+-
677+-#define LOCALE_IDEFAULTEBCDICCODEPAGE 0x1012
678+-#define LOCALE_IDIGITSUBSTITUTION 0x1014
679+-#define LOCALE_IPAPERSIZE 0x100A
680++/* The following are not supported on Win9x, nor on WinNT prior to Win-2000.
681++ */
682+ #define DATE_YEARMONTH 8
683+ #define DATE_LTRREADING 16
684+ #define DATE_RTLREADING 32
685+-#define MAP_EXPAND_LIGATURES 0x2000
686+-#define WC_NO_BEST_FIT_CHARS 1024
687+
688+-#endif /* >= Win2K */
689++#endif /* Windows-2000 and later */
690+
691+-#if _WIN32_WINNT >= _WIN32_WINNT_VISTA
692++/* Time format options, for use with GetTimeFormat*() functions; see:
693++ * https://docs.microsoft.com/en-gb/windows/desktop/api/datetimeapi/nf-datetimeapi-gettimeformatex
694++ */
695++#define TIME_NOMINUTESORSECONDS 1
696++#define TIME_NOSECONDS 2
697++#define TIME_NOTIMEMARKER 4
698++#define TIME_FORCE24HOURFORMAT 8
699+
700+-#if 0
701+-#define CAL_SSHORTESTDAYNAME1
702+-#define CAL_SSHORTESTDAYNAME2
703+-#define CAL_SSHORTESTDAYNAME3
704+-#define CAL_SSHORTESTDAYNAME4
705+-#define CAL_SSHORTESTDAYNAME5
706+-#define CAL_SSHORTESTDAYNAME6
707+-#define CAL_SSHORTESTDAYNAME7
708+-
709+-#define LOCALE_SSHORTESTDAYNAME1
710+-#define LOCALE_SSHORTESTDAYNAME2
711+-#define LOCALE_SSHORTESTDAYNAME3
712+-#define LOCALE_SSHORTESTDAYNAME4
713+-#define LOCALE_SSHORTESTDAYNAME5
714+-#define LOCALE_SSHORTESTDAYNAME6
715+-#define LOCALE_SSHORTESTDAYNAME7
716+-#endif
717+-
718+-#define CAL_UMALQURA 23
719+-
720+-#if 0
721+-#define LOCALE_SDURATION
722+-#define LOCALE_SIETFLANGUAGE
723+-#define LOCALE_SISO3166CTRYNAME2
724+-#define LOCALE_SISO639LANGNAME2
725+-#define LOCALE_SKEYBOARDSTOINSTALL
726+-#define LOCALE_SNAME
727+-#define LOCALE_SNAN
728+-#define LOCALE_SNEGINFINITY
729+-#define LOCALE_SPOSINFINITY
730+-#define LOCALE_SSCRIPTS
731+-#endif
732+-
733+-#endif /* >= WinVista */
734+
735+ #ifndef RC_INVOKED
736+
737+ typedef DWORD LCTYPE;
738+ typedef DWORD CALTYPE;
739+@@ -550,20 +767,20 @@ typedef BOOL (CALLBACK *TIMEFMT_ENUMPROC
740+
741+ typedef BOOL (CALLBACK *GEO_ENUMPROC) (GEOID);
742+
743+ typedef
744+ enum NLS_FUNCTION
745+-{ COMPARE_STRING = 1
746++{ COMPARE_STRING = 1
747+ } NLS_FUNCTION;
748+
749+ enum SYSGEOCLASS
750+-{ GEOCLASS_REGION = 14,
751+- GEOCLASS_NATION = 16
752++{ GEOCLASS_NATION = 16,
753++ GEOCLASS_REGION = 14
754+ };
755+
756+ enum SYSGEOTYPE
757+-{ GEO_NATION = 1,
758++{ GEO_NATION = 1,
759+ GEO_LATITUDE,
760+ GEO_LONGITUDE,
761+ GEO_ISO2,
762+ GEO_ISO3,
763+ GEO_RFC1766,
764+@@ -572,10 +789,13 @@ enum SYSGEOTYPE
765+ GEO_OFFICIALNAME,
766+ GEO_TIMEZONES,
767+ GEO_OFFICIALLANGUAGES
768+ };
769+
770++#define MAX_DEFAULTCHAR 2
771++#define MAX_LEADBYTES 12
772++
773+ typedef struct _cpinfo
774+ { UINT MaxCharSize;
775+ BYTE DefaultChar[MAX_DEFAULTCHAR];
776+ BYTE LeadByte[MAX_LEADBYTES];
777+ } CPINFO, *LPCPINFO;
778+@@ -784,11 +1004,16 @@ WINBASEAPI WINAPI BOOL EnumUILanguage
779+
780+ WINBASEAPI WINAPI LANGID GetSystemDefaultUILanguage (void);
781+ WINBASEAPI WINAPI LANGID GetUserDefaultUILanguage (void);
782+ WINBASEAPI WINAPI BOOL IsValidLanguageGroup (LGRPID, DWORD);
783+
784+-#endif /* >= Win2K */
785++#if _WIN32_WINNT >= _WIN32_WINNT_VISTA
786++
787++WINBASEAPI WINAPI int GetCalendarInfoEx (LPCWSTR, CALID, LPCWSTR, CALTYPE, LPCSTR, int, LPDWORD );
788++
789++#endif /* Win-Vista and later */
790++#endif /* Win2K and later */
791+ #endif /* ! RC_INVOKED */
792+
793+ _END_C_DECLS
794+
795+ #endif /* !_WINNLS_H: $RCSfile$: end of file */