• R/O
  • HTTP
  • SSH
  • HTTPS

mingw-org-wsl: 提交

The MinGW.org Windows System Libraries


Commit MetaInfo

修訂14b23ef68b8345b1bdf9c95d7c23e5d99dae37ae (tree)
時間2020-01-17 00:23:43
作者Keith Marshall <keith@user...>
CommiterKeith Marshall

Log Message

Incorporate <winnls.h> updates for Vista and Windows-7.

Change Summary

差異

--- a/w32api/ChangeLog
+++ b/w32api/ChangeLog
@@ -1,3 +1,26 @@
1+2020-01-15 Keith Marshall <keith@users.osdn.me>
2+
3+ Incorporate <winnls.h> updates for Vista and Windows-7.
4+
5+ * include/winnls.h: Reorganize into logical definition groups.
6+ [_WIN32_WINNT >= _WIN32_WINNT_VISTA] (LOCALE_CUSTOM_DEFAULT)
7+ (LOCALE_CUSTOM_UI_DEFAULT, LOCALE_CUSTOM_UNSPECIFIED, LOCALE_SNAME)
8+ (LOCALE_SDURATION, LOCALE_SKEYBOARDSTOINSTALL, LOCALE_SSCRIPTS)
9+ (LOCALE_SNAN, LOCALE_SPOSINFINITY, LOCALE_SNEGINFINITY)
10+ (LOCALE_SISO3166CTRYNAME2, LOCALE_SISO639LANGNAME2)
11+ (LOCALE_SSHORTESTDAYNAME1, LOCALE_SSHORTESTDAYNAME2)
12+ (LOCALE_SSHORTESTDAYNAME3, LOCALE_SSHORTESTDAYNAME4)
13+ (LOCALE_SSHORTESTDAYNAME5, LOCALE_SSHORTESTDAYNAME6)
14+ (LOCALE_SSHORTESTDAYNAME7, CAL_SSHORTESTDAYNAME1)
15+ (CAL_SSHORTESTDAYNAME2, CAL_SSHORTESTDAYNAME3, CAL_SSHORTESTDAYNAME4)
16+ (CAL_SSHORTESTDAYNAME5, CAL_SSHORTESTDAYNAME6, CAL_SSHORTESTDAYNAME7)
17+ (CAL_UMALQURA, C3_HIGHSURROGATE, C3_LOWSURROGATE): New symbolic
18+ constants; define each as a manifest constant macro.
19+ [_WIN32_WINNT >= _WIN32_WINNT_WIN7] (CAL_SMONTHDAY)
20+ (CAL_SABBREVERASTRING): Likewise.
21+ [_WIN32_WINNT >= _WIN32_WINNT_VISTA] (GetCalendarInfoEx): New
22+ function; declare its prototype.
23+
124 2020-01-14 Keith Marshall <keith@users.osdn.me>
225
326 Make <winnls.h> header effectively self-contained.
--- a/w32api/include/winnls.h
+++ b/w32api/include/winnls.h
@@ -37,31 +37,71 @@
3737
3838 _BEGIN_C_DECLS
3939
40-#define MAX_LEADBYTES 12
41-#define MAX_DEFAULTCHAR 2
42-#define LOCALE_NOUSEROVERRIDE 0x80000000
43-#define LOCALE_USE_CP_ACP 0x40000000
40+/* Locale Specifications
41+ * ---------------------
42+ * Locale identifiers; documentation reference links may be found at:
43+ * https://docs.microsoft.com/en-gb/windows/desktop/Intl/locale-information-constants
44+ */
45+#define LOCALE_USER_DEFAULT 0x0400
46+#define LOCALE_SYSTEM_DEFAULT 0x0800
4447
45-#if WINVER >= _WIN32_WINNT_NT4 /* also >= Win95 */
48+#if _WIN32_WINNT >= _WIN32_WINNT_WINXP
49+/* The invariant system locale was added in Windows-XP.
50+ */
51+#define LOCALE_INVARIANT 0x007F
4652
47-#define LOCALE_RETURN_NUMBER 0x20000000
53+#if _WIN32_WINNT >= _WIN32_WINNT_VISTA
54+/* Support for custom locales was added in Windows-Vista.
55+ */
56+#define LOCALE_CUSTOM_DEFAULT 0x0C00
57+#define LOCALE_CUSTOM_UI_DEFAULT 0x1400
58+#define LOCALE_CUSTOM_UNSPECIFIED 0x1000
59+
60+#endif /* Vista (and later) custom locale identifiers */
61+#endif /* WinXP (and later) custom locale identifiers */
4862
49-#endif /* >= WinNT4 / Win95 */
63+/* Locale identifier reference classification flags; for documentation see:
64+ * https://docs.microsoft.com/en-gb/windows/desktop/api/winnls/nf-winnls-enumsystemlocalesa
65+ * https://docs.microsoft.com/en-gb/windows/desktop/api/winnls/nf-winnls-isvalidlocale
66+ */
67+#define LCID_INSTALLED 1
68+#define LCID_SUPPORTED 2
69+#define LCID_ALTERNATE_SORTS 4
70+
71+/* Locale information constants; (inadequately) documented at:
72+ * https://docs.microsoft.com/en-gb/windows/desktop/Intl/locale-information-constants
73+ *
74+ * Qualifier flags, which may be used in combination with any one of the
75+ * otherwise mutually exclusive locale property identification codes.
76+ */
77+#if WINVER >= _WIN32_WINNT_NT4
78+/* The first of these wasn't available prior to WinNT4. WINVER equivalence
79+ * suggests that this would also apply for Windows-95, but the documentation
80+ * states otherwise; this may not be supported prior to Windows-98.
81+ */
82+#define LOCALE_RETURN_NUMBER 0x20000000
83+#endif
84+/* The remaining pair appear to have been universally available.
85+ */
86+#define LOCALE_USE_CP_ACP 0x40000000
87+#define LOCALE_NOUSEROVERRIDE 0x80000000
5088
89+/* The locale property identification codes themselves. These are each
90+ * mutually exclusive of the others; while each one may be used with any
91+ * combination of the preceding qualifier flags, no combination of these
92+ * individually distinct property identification codes is permitted.
93+ */
5194 #define LOCALE_ILANGUAGE 1
5295 #define LOCALE_SLANGUAGE 2
53-#define LOCALE_SENGLANGUAGE 0x1001
5496 #define LOCALE_SABBREVLANGNAME 3
5597 #define LOCALE_SNATIVELANGNAME 4
5698 #define LOCALE_ICOUNTRY 5
5799 #define LOCALE_SCOUNTRY 6
58-#define LOCALE_SENGCOUNTRY 0x1002
59100 #define LOCALE_SABBREVCTRYNAME 7
60101 #define LOCALE_SNATIVECTRYNAME 8
61102 #define LOCALE_IDEFAULTLANGUAGE 9
62103 #define LOCALE_IDEFAULTCOUNTRY 10
63104 #define LOCALE_IDEFAULTCODEPAGE 11
64-#define LOCALE_IDEFAULTANSICODEPAGE 0x1004
65105 #define LOCALE_SLIST 12
66106 #define LOCALE_IMEASURE 13
67107 #define LOCALE_SDECIMAL 14
@@ -69,7 +109,6 @@ _BEGIN_C_DECLS
69109 #define LOCALE_SGROUPING 16
70110 #define LOCALE_IDIGITS 17
71111 #define LOCALE_ILZERO 18
72-#define LOCALE_INEGNUMBER 0x1010
73112 #define LOCALE_SNATIVEDIGITS 19
74113 #define LOCALE_SCURRENCY 20
75114 #define LOCALE_SINTLSYMBOL 21
@@ -84,21 +123,15 @@ _BEGIN_C_DECLS
84123 #define LOCALE_STIME 30
85124 #define LOCALE_SSHORTDATE 31
86125 #define LOCALE_SLONGDATE 32
87-#define LOCALE_STIMEFORMAT 0x1003
88126 #define LOCALE_IDATE 33
89127 #define LOCALE_ILDATE 34
90128 #define LOCALE_ITIME 35
91-#define LOCALE_ITIMEMARKPOSN 0x1005
92129 #define LOCALE_ICENTURY 36
93130 #define LOCALE_ITLZERO 37
94131 #define LOCALE_IDAYLZERO 38
95132 #define LOCALE_IMONLZERO 39
96133 #define LOCALE_S1159 40
97134 #define LOCALE_S2359 41
98-#define LOCALE_ICALENDARTYPE 0x1009
99-#define LOCALE_IOPTIONALCALENDAR 0x100B
100-#define LOCALE_IFIRSTDAYOFWEEK 0x100C
101-#define LOCALE_IFIRSTWEEKOFYEAR 0x100D
102135 #define LOCALE_SDAYNAME1 42
103136 #define LOCALE_SDAYNAME2 43
104137 #define LOCALE_SDAYNAME3 44
@@ -125,7 +158,6 @@ _BEGIN_C_DECLS
125158 #define LOCALE_SMONTHNAME10 65
126159 #define LOCALE_SMONTHNAME11 66
127160 #define LOCALE_SMONTHNAME12 67
128-#define LOCALE_SMONTHNAME13 0x100E
129161 #define LOCALE_SABBREVMONTHNAME1 68
130162 #define LOCALE_SABBREVMONTHNAME2 69
131163 #define LOCALE_SABBREVMONTHNAME3 70
@@ -138,7 +170,6 @@ _BEGIN_C_DECLS
138170 #define LOCALE_SABBREVMONTHNAME10 77
139171 #define LOCALE_SABBREVMONTHNAME11 78
140172 #define LOCALE_SABBREVMONTHNAME12 79
141-#define LOCALE_SABBREVMONTHNAME13 0x100F
142173 #define LOCALE_SPOSITIVESIGN 80
143174 #define LOCALE_SNEGATIVESIGN 81
144175 #define LOCALE_IPOSSIGNPOSN 82
@@ -150,94 +181,84 @@ _BEGIN_C_DECLS
150181 #define LOCALE_FONTSIGNATURE 88
151182 #define LOCALE_SISO639LANGNAME 89
152183 #define LOCALE_SISO3166CTRYNAME 90
153-#define LOCALE_SYSTEM_DEFAULT 0x800
154-#define LOCALE_USER_DEFAULT 0x400
155-#define NORM_IGNORECASE 1
156-#define NORM_IGNOREKANATYPE 65536
157-#define NORM_IGNORENONSPACE 2
158-#define NORM_IGNORESYMBOLS 4
159-#define NORM_IGNOREWIDTH 131072
160-#define SORT_STRINGSORT 4096
161-#define LCMAP_LOWERCASE 0x00000100
162-#define LCMAP_UPPERCASE 0x00000200
163-#define LCMAP_SORTKEY 0x00000400
164-#define LCMAP_BYTEREV 0x00000800
165-#define LCMAP_HIRAGANA 0x00100000
166-#define LCMAP_KATAKANA 0x00200000
167-#define LCMAP_HALFWIDTH 0x00400000
168-#define LCMAP_FULLWIDTH 0x00800000
169-#define LCMAP_LINGUISTIC_CASING 0x01000000
170-#define LCMAP_SIMPLIFIED_CHINESE 0x02000000
171-#define LCMAP_TRADITIONAL_CHINESE 0x04000000
172-#define ENUM_ALL_CALENDARS (-1)
173-#define DATE_SHORTDATE 1
174-#define DATE_LONGDATE 2
175-#define DATE_USE_ALT_CALENDAR 4
176-#define CP_INSTALLED 1
177-#define CP_SUPPORTED 2
178-#define LCID_INSTALLED 1
179-#define LCID_SUPPORTED 2
180-#define LCID_ALTERNATE_SORTS 4
181-#define MAP_FOLDCZONE 16
182-#define MAP_FOLDDIGITS 128
183-#define MAP_PRECOMPOSED 32
184-#define MAP_COMPOSITE 64
185-#define CP_ACP 0
186-#define CP_OEMCP 1
187-#define CP_MACCP 2
188-#define CP_THREAD_ACP 3
189-#define CP_SYMBOL 42
190-#define CP_UTF7 65000
191-#define CP_UTF8 65001
192-#define CT_CTYPE1 1
193-#define CT_CTYPE2 2
194-#define CT_CTYPE3 4
195-#define C1_UPPER 1
196-#define C1_LOWER 2
197-#define C1_DIGIT 4
198-#define C1_SPACE 8
199-#define C1_PUNCT 16
200-#define C1_CNTRL 32
201-#define C1_BLANK 64
202-#define C1_XDIGIT 128
203-#define C1_ALPHA 256
204-#define C2_LEFTTORIGHT 1
205-#define C2_RIGHTTOLEFT 2
206-#define C2_EUROPENUMBER 3
207-#define C2_EUROPESEPARATOR 4
208-#define C2_EUROPETERMINATOR 5
209-#define C2_ARABICNUMBER 6
210-#define C2_COMMONSEPARATOR 7
211-#define C2_BLOCKSEPARATOR 8
212-#define C2_SEGMENTSEPARATOR 9
213-#define C2_WHITESPACE 10
214-#define C2_OTHERNEUTRAL 11
215-#define C2_NOTAPPLICABLE 0
216-#define C3_NONSPACING 1
217-#define C3_DIACRITIC 2
218-#define C3_VOWELMARK 4
219-#define C3_SYMBOL 8
220-#define C3_KATAKANA 16
221-#define C3_HIRAGANA 32
222-#define C3_HALFWIDTH 64
223-#define C3_FULLWIDTH 128
224-#define C3_IDEOGRAPH 256
225-#define C3_KASHIDA 512
226-#define C3_LEXICAL 1024
227-#define C3_ALPHA 32768
228-#define C3_NOTAPPLICABLE 0
229-#define TIME_NOMINUTESORSECONDS 1
230-#define TIME_NOSECONDS 2
231-#define TIME_NOTIMEMARKER 4
232-#define TIME_FORCE24HOURFORMAT 8
233-#define MB_PRECOMPOSED 1
234-#define MB_COMPOSITE 2
235-#define MB_ERR_INVALID_CHARS 8
236-#define MB_USEGLYPHCHARS 4
237-#define WC_COMPOSITECHECK 512
238-#define WC_DISCARDNS 16
239-#define WC_SEPCHARS 32
240-#define WC_DEFAULTCHAR 64
184+#define LOCALE_IGEOID 91
185+
186+#define LOCALE_SENGLANGUAGE 0x1001
187+#define LOCALE_SENGCOUNTRY 0x1002
188+#define LOCALE_STIMEFORMAT 0x1003
189+#define LOCALE_IDEFAULTANSICODEPAGE 0x1004
190+#define LOCALE_ITIMEMARKPOSN 0x1005
191+#define LOCALE_ICALENDARTYPE 0x1009
192+#define LOCALE_IOPTIONALCALENDAR 0x100B
193+#define LOCALE_IFIRSTDAYOFWEEK 0x100C
194+#define LOCALE_IFIRSTWEEKOFYEAR 0x100D
195+#define LOCALE_SMONTHNAME13 0x100E
196+#define LOCALE_SABBREVMONTHNAME13 0x100F
197+#define LOCALE_INEGNUMBER 0x1010
198+
199+#if WINVER >= _WIN32_WINDOWS_98
200+/* The following locale property identifiers were introduced for Windows-98,
201+ * and are thus implicitly supported on WinNT platforms from Win2K onwards.
202+ */
203+#define LOCALE_SYEARMONTH 0x1006
204+#define LOCALE_SENGCURRNAME 0x1007
205+#define LOCALE_SNATIVECURRNAME 0x1008
206+#define LOCALE_SSORTNAME 0x1013
207+
208+#if _WIN32_WINNT >= _WIN32_WINNT_WIN2K
209+/* The following locale identification codes were not supported, prior to
210+ * Win2K, and thus are unavailable on any Win9X platform.
211+ */
212+#define LOCALE_IPAPERSIZE 0x100A
213+#define LOCALE_IDEFAULTEBCDICCODEPAGE 0x1012
214+#define LOCALE_IDIGITSUBSTITUTION 0x1014
215+
216+#if _WIN32_WINNT >= _WIN32_WINNT_VISTA
217+/* Introduced with Win-Vista, Microsoft don't document values for these;
218+ * I have deduced them by inspection of GetLocaleInfoA() return values for
219+ * every possible property identifier in the range 0..0x1FFFFFFF, ignoring
220+ * those which return an error condition code.
221+ */
222+#define LOCALE_SNAME 92
223+#define LOCALE_SDURATION 93
224+#define LOCALE_SKEYBOARDSTOINSTALL 94
225+
226+#define LOCALE_SSHORTESTDAYNAME1 96
227+#define LOCALE_SSHORTESTDAYNAME2 97
228+#define LOCALE_SSHORTESTDAYNAME3 98
229+#define LOCALE_SSHORTESTDAYNAME4 99
230+#define LOCALE_SSHORTESTDAYNAME5 100
231+#define LOCALE_SSHORTESTDAYNAME6 101
232+#define LOCALE_SSHORTESTDAYNAME7 102
233+
234+#define LOCALE_SISO639LANGNAME2 103
235+#define LOCALE_SISO3166CTRYNAME2 104
236+
237+#define LOCALE_SNAN 105
238+#define LOCALE_SPOSINFINITY 106
239+#define LOCALE_SNEGINFINITY 107
240+#define LOCALE_SSCRIPTS 108
241+
242+#if 0
243+/* FIXME: Originally identified by Dimitri Papadopolous, as a Vista addition,
244+ * but with unknown value, (and I see nothing in WinXP GetLocaleInfo() output,
245+ * corresponding to ANY possible locale data identifier, which even remotely
246+ * resembles an IETF language name); Microsoft now document this identifier
247+ * as "deprecated in Vista and later", (which seems kind of contradictory).
248+ * Does this serve any useful purpose? Did it ever? Maybe define it as an
249+ * alias for LOCALE_SNAME, (which, as I've deduced its value, does seem to
250+ * represent an IETF name, on my Win7 host)? Or, just drop it altogether?
251+ */
252+#define LOCALE_SIETFLANGUAGE ???
253+#endif
254+
255+#endif /* Vista (and later) only */
256+#endif /* Win2K (and later) only */
257+#endif /* Win98/Win2K and later */
258+
259+
260+/* Country identification codes.
261+ */
241262 #define CTRY_DEFAULT 0
242263 #define CTRY_ALBANIA 355
243264 #define CTRY_ALGERIA 213
@@ -350,6 +371,248 @@ _BEGIN_C_DECLS
350371 #define CTRY_VIET_NAM 84
351372 #define CTRY_YEMEN 967
352373 #define CTRY_ZIMBABWE 263
374+
375+
376+/* Language group enumeration options; for documentation see:
377+ * https://docs.microsoft.com/en-gb/windows/desktop/api/winnls/nf-winnls-enumsystemlanguagegroupsa
378+ */
379+#define LGRPID_INSTALLED 1
380+#define LGRPID_SUPPORTED 2
381+
382+/* Language group identification codes; for documentation see:
383+ * https://docs.microsoft.com/en-gb/windows/desktop/api/winnls/nf-winnls-enumlanguagegrouplocalesa
384+ * https://docs.microsoft.com/en-gb/windows/desktop/api/winnls/nf-winnls-isvalidlanguagegroup
385+ */
386+#define LGRPID_WESTERN_EUROPE 1
387+#define LGRPID_CENTRAL_EUROPE 2
388+#define LGRPID_BALTIC 3
389+#define LGRPID_GREEK 4
390+#define LGRPID_CYRILLIC 5
391+#define LGRPID_TURKISH 6
392+#define LGRPID_JAPANESE 7
393+#define LGRPID_KOREAN 8
394+#define LGRPID_TRADITIONAL_CHINESE 9
395+#define LGRPID_SIMPLIFIED_CHINESE 10
396+#define LGRPID_THAI 11
397+#define LGRPID_HEBREW 12
398+#define LGRPID_ARABIC 13
399+#define LGRPID_VIETNAMESE 14
400+#define LGRPID_INDIC 15
401+#define LGRPID_GEORGIAN 16
402+#define LGRPID_ARMENIAN 17
403+
404+
405+/* String Handling API
406+ * -------------------
407+ * Code page enumeration options; see:
408+ * https://docs.microsoft.com/en-gb/windows/desktop/api/winnls/nf-winnls-enumsystemcodepagesw
409+ */
410+#define CP_INSTALLED 1
411+#define CP_SUPPORTED 2
412+
413+/* Generic code page selectors for MBCS to/from UTF-16LE transformation:
414+ * https://docs.microsoft.com/en-gb/windows/desktop/api/stringapiset/nf-stringapiset-multibytetowidechar
415+ * https://docs.microsoft.com/en-gb/windows/desktop/api/stringapiset/nf-stringapiset-widechartomultibyte
416+ */
417+#define CP_ACP 0
418+#define CP_OEMCP 1
419+#define CP_MACCP 2
420+#define CP_THREAD_ACP 3
421+#define CP_SYMBOL 42
422+#define CP_UTF7 65000
423+#define CP_UTF8 65001
424+
425+/* Options for MBCS to UTF-16LE transformations; see:
426+ * https://docs.microsoft.com/en-gb/windows/desktop/api/stringapiset/nf-stringapiset-multibytetowidechar
427+ */
428+#define MB_PRECOMPOSED 0x001
429+#define MB_COMPOSITE 0x002
430+#define MB_USEGLYPHCHARS 0x004
431+#define MB_ERR_INVALID_CHARS 0x008
432+
433+/* Options for UTF-16LE to MBCS transformations; see:
434+ */
435+#define WC_DISCARDNS 0x010
436+#define WC_SEPCHARS 0x020
437+#define WC_DEFAULTCHAR 0x040
438+#define WC_COMPOSITECHECK 0x200
439+
440+#if _WIN32_WINNT >= _WIN32_WINNT_WIN2K
441+/* The following is not supported on Win9x, nor on WinNT prior to Win-2000.
442+ */
443+#define WC_NO_BEST_FIT_CHARS 0x400
444+
445+#endif /* Windows-2000 and later */
446+
447+/* Character type classification operations; see:
448+ * https://docs.microsoft.com/en-gb/windows/desktop/api/stringapiset/nf-stringapiset-getstringtypew
449+ */
450+#define CT_CTYPE1 1
451+#define CT_CTYPE2 2
452+#define CT_CTYPE3 4
453+
454+/* CT_CTYPE1 classification (approximately equivalent to ISO-C ctype);
455+ * for each character in the string, returns any bit-wise combination of
456+ * the following attributes:
457+ */
458+#define C1_UPPER 0x0001
459+#define C1_LOWER 0x0002
460+#define C1_DIGIT 0x0004
461+#define C1_SPACE 0x0008
462+#define C1_PUNCT 0x0010
463+#define C1_CNTRL 0x0020
464+#define C1_BLANK 0x0040
465+#define C1_XDIGIT 0x0080
466+#define C1_ALPHA 0x0100
467+#define C1_DEFINED 0x0200
468+
469+/* CT_CTYPE2 classification; for each character in the string, returns
470+ * one of the following mutually exclusive Unicode bidirectional layout
471+ * attributes:
472+ */
473+#define C2_NOTAPPLICABLE 0
474+#define C2_LEFTTORIGHT 1
475+#define C2_RIGHTTOLEFT 2
476+#define C2_EUROPENUMBER 3
477+#define C2_EUROPESEPARATOR 4
478+#define C2_EUROPETERMINATOR 5
479+#define C2_ARABICNUMBER 6
480+#define C2_COMMONSEPARATOR 7
481+#define C2_BLOCKSEPARATOR 8
482+#define C2_SEGMENTSEPARATOR 9
483+#define C2_WHITESPACE 10
484+#define C2_OTHERNEUTRAL 11
485+
486+/* CT_CTYPE3 classification; for each character in the string, returns
487+ * a bit-wise combination of any of the following attributes:
488+ */
489+#define C3_NOTAPPLICABLE 0x0000
490+#define C3_NONSPACING 0x0001
491+#define C3_DIACRITIC 0x0002
492+#define C3_VOWELMARK 0x0004
493+#define C3_SYMBOL 0x0008
494+#define C3_KATAKANA 0x0010
495+#define C3_HIRAGANA 0x0020
496+#define C3_HALFWIDTH 0x0040
497+#define C3_FULLWIDTH 0x0080
498+#define C3_IDEOGRAPH 0x0100
499+#define C3_KASHIDA 0x0200
500+#define C3_LEXICAL 0x0400
501+#define C3_ALPHA 0x8000
502+
503+#if _WIN32_WINNT >= _WIN32_WINNT_VISTA
504+
505+#define C3_HIGHSURROGATE 0x0800
506+#define C3_LOWSURROGATE 0x1000
507+
508+#endif /* Windows-Vista and later */
509+
510+/* String sorting and transformation option flags; see:
511+ * https://docs.microsoft.com/en-gb/windows/desktop/api/winnls/nf-winnls-lcmapstringex
512+ */
513+#define LCMAP_LOWERCASE 0x00000100
514+#define LCMAP_UPPERCASE 0x00000200
515+#define LCMAP_SORTKEY 0x00000400
516+#define LCMAP_BYTEREV 0x00000800
517+#define LCMAP_HIRAGANA 0x00100000
518+#define LCMAP_KATAKANA 0x00200000
519+#define LCMAP_HALFWIDTH 0x00400000
520+#define LCMAP_FULLWIDTH 0x00800000
521+#define LCMAP_LINGUISTIC_CASING 0x01000000
522+#define LCMAP_SIMPLIFIED_CHINESE 0x02000000
523+#define LCMAP_TRADITIONAL_CHINESE 0x04000000
524+
525+/* Additional Unicode string transformation options; see:
526+ * https://docs.microsoft.com/en-gb/windows/desktop/api/stringapiset/nf-stringapiset-foldstringw
527+ */
528+#define MAP_FOLDCZONE 0x00000010
529+#define MAP_PRECOMPOSED 0x00000020
530+#define MAP_COMPOSITE 0x00000040
531+#define MAP_FOLDDIGITS 0x00000080
532+
533+#if _WIN32_WINNT >= _WIN32_WINNT_WIN2K
534+/* This additional FoldString() transformation option was not supported,
535+ * prior to Windows-2000.
536+ */
537+#define MAP_EXPAND_LIGATURES 0x00002000
538+
539+#endif /* Windows-2000 and later */
540+
541+/* Normalization options for string comparison, sorting, and transformation:
542+ * https://docs.microsoft.com/en-gb/windows/desktop/api/stringapiset/nf-stringapiset-comparestringex
543+ * https://docs.microsoft.com/en-gb/windows/desktop/api/winnls/nf-winnls-lcmapstringex
544+ */
545+#define NORM_IGNORECASE 0x00000001
546+#define NORM_IGNORENONSPACE 0x00000002
547+#define NORM_IGNORESYMBOLS 0x00000004
548+#define NORM_IGNOREKANATYPE 0x00010000
549+#define NORM_IGNOREWIDTH 0x00020000
550+
551+/* String sorting options; see:
552+ * https://docs.microsoft.com/en-gb/windows/desktop/api/stringapiset/nf-stringapiset-comparestringex
553+ * https://docs.microsoft.com/en-gb/windows/desktop/api/winnls/nf-winnls-lcmapstringex
554+ */
555+#define SORT_STRINGSORT 0x00001000
556+
557+/* String comparator return values; (note intentional difference from ISO-C):
558+ * https://docs.microsoft.com/en-gb/windows/desktop/api/stringapiset/nf-stringapiset-comparestringex
559+ */
560+#define CSTR_LESS_THAN 1
561+#define CSTR_EQUAL 2
562+#define CSTR_GREATER_THAN 3
563+
564+/* Macros for UTF-16LE surrogate identification.
565+ */
566+#define IS_HIGH_SURROGATE(c) (((c) & 0xFC00) == 0xD800)
567+#define IS_LOW_SURROGATE(c) (((c) & 0xFC00) == 0xDC00)
568+#define IS_SURROGATE_PAIR(hc,lc) (IS_HIGH_SURROGATE(hc) && IS_LOW_SURROGATE(lc))
569+
570+
571+/* Date and Time Handling API
572+ * --------------------------
573+ * Calendar identification codes; these are documented at:
574+ * https://docs.microsoft.com/en-gb/windows/desktop/Intl/calendar-identifiers
575+ */
576+#define CAL_GREGORIAN 1
577+#define CAL_GREGORIAN_US 2
578+#define CAL_JAPAN 3
579+#define CAL_TAIWAN 4
580+#define CAL_KOREA 5
581+#define CAL_HIJRI 6
582+#define CAL_THAI 7
583+#define CAL_HEBREW 8
584+#define CAL_GREGORIAN_ME_FRENCH 9
585+#define CAL_GREGORIAN_ARABIC 10
586+#define CAL_GREGORIAN_XLIT_ENGLISH 11
587+#define CAL_GREGORIAN_XLIT_FRENCH 12
588+
589+#if _WIN32_WINNT >= _WIN32_WINNT_VISTA
590+/* Introduced for Windows-Vista and later; values in the interval 13..22 are
591+ * reserved by Microsoft, and are unallocated.
592+ */
593+#define CAL_UMALQURA 23
594+#endif
595+
596+#define ENUM_ALL_CALENDARS (-1)
597+
598+/* Calendar property identifiation codes; (inadequately) documented at:
599+ * https://docs.microsoft.com/en-gb/windows/desktop/Intl/calendar-type-information
600+ */
601+#if WINVER >= _WIN32_WINDOWS_98
602+/* Analagous to, and sharing values with, their corresponding locale property
603+ * qualifying flags, these calendar property qualifying flags were unsupported
604+ * prior to Windows-98, (and correpondingly, Windows-2000 for WinNT platforms).
605+ */
606+#define CAL_RETURN_NUMBER 0x20000000
607+#define CAL_USE_CP_ACP 0x40000000
608+#define CAL_NOUSEROVERRIDE 0x80000000
609+#endif
610+
611+/* The calendar property identification codes themselves. Each one is
612+ * mutually exclusive of the others; while each one may be used with any
613+ * combination of the preceding qualifier flags, no combination of these
614+ * individually distinct property identification codes is permitted.
615+ */
353616 #define CAL_ICALINTVALUE 1
354617 #define CAL_SCALNAME 2
355618 #define CAL_IYEAROFFSETRANGE 3
@@ -396,107 +659,61 @@ _BEGIN_C_DECLS
396659 #define CAL_SABBREVMONTHNAME11 44
397660 #define CAL_SABBREVMONTHNAME12 45
398661 #define CAL_SABBREVMONTHNAME13 46
399-#define CAL_GREGORIAN 1
400-#define CAL_GREGORIAN_US 2
401-#define CAL_JAPAN 3
402-#define CAL_TAIWAN 4
403-#define CAL_KOREA 5
404-#define CAL_HIJRI 6
405-#define CAL_THAI 7
406-#define CAL_HEBREW 8
407-#define CAL_GREGORIAN_ME_FRENCH 9
408-#define CAL_GREGORIAN_ARABIC 10
409-#define CAL_GREGORIAN_XLIT_ENGLISH 11
410-#define CAL_GREGORIAN_XLIT_FRENCH 12
411-#define CSTR_LESS_THAN 1
412-#define CSTR_EQUAL 2
413-#define CSTR_GREATER_THAN 3
414-#define LGRPID_INSTALLED 1
415-#define LGRPID_SUPPORTED 2
416-#define LGRPID_WESTERN_EUROPE 1
417-#define LGRPID_CENTRAL_EUROPE 2
418-#define LGRPID_BALTIC 3
419-#define LGRPID_GREEK 4
420-#define LGRPID_CYRILLIC 5
421-#define LGRPID_TURKISH 6
422-#define LGRPID_JAPANESE 7
423-#define LGRPID_KOREAN 8
424-#define LGRPID_TRADITIONAL_CHINESE 9
425-#define LGRPID_SIMPLIFIED_CHINESE 10
426-#define LGRPID_THAI 11
427-#define LGRPID_HEBREW 12
428-#define LGRPID_ARABIC 13
429-#define LGRPID_VIETNAMESE 14
430-#define LGRPID_INDIC 15
431-#define LGRPID_GEORGIAN 16
432-#define LGRPID_ARMENIAN 17
433-#define IS_HIGH_SURROGATE(c) (((c) & 0xFC00) == 0xD800)
434-#define IS_LOW_SURROGATE(c) (((c) & 0xFC00) == 0xDC00)
435-#define IS_SURROGATE_PAIR(hc,lc) (IS_HIGH_SURROGATE(hc) && IS_LOW_SURROGATE(lc))
436-
437-#if WINVER >= _WIN32_WINDOWS_98 /* also >= Win2K */
438662
663+#if WINVER >= _WIN32_WINDOWS_98
664+/* The following pair of calendar properties were unsupported prior to
665+ * Windows-98, (or Windows-2000, for WinNT platforms).
666+ */
439667 #define CAL_SYEARMONTH 47
440668 #define CAL_ITWODIGITYEARMAX 48
441-#define CAL_NOUSEROVERRIDE LOCALE_NOUSEROVERRIDE
442-#define CAL_RETURN_NUMBER LOCALE_RETURN_NUMBER
443-#define CAL_USE_CP_ACP LOCALE_USE_CP_ACP
444-#define LOCALE_SYEARMONTH 0x1006
445-#define LOCALE_SENGCURRNAME 0x1007
446-#define LOCALE_SNATIVECURRNAME 0x1008
447-#define LOCALE_SSORTNAME 0x1013
448669
449-#endif /* >= Win98 / Win2K */
670+#if _WIN32_WINNT >= _WIN32_WINNT_VISTA
450671
451-#if _WIN32_WINNT >= _WIN32_WINNT_WIN2K
672+#define CAL_SSHORTESTDAYNAME1 49
673+#define CAL_SSHORTESTDAYNAME2 50
674+#define CAL_SSHORTESTDAYNAME3 51
675+#define CAL_SSHORTESTDAYNAME4 52
676+#define CAL_SSHORTESTDAYNAME5 53
677+#define CAL_SSHORTESTDAYNAME6 54
678+#define CAL_SSHORTESTDAYNAME7 55
679+
680+#if _WIN32_WINNT >= _WIN32_WINNT_WIN7
681+/* New calendar properties, supported on Windows-7 and later. Note that
682+ * these may not be accessible through LCID references; e.g. when running
683+ * on Windows-7 Home Premium, it appears that GetCalendarInfoA() cannot
684+ * retrieve them, but GetCalendarInfoEx() can.
685+ */
686+#define CAL_SMONTHDAY 56
687+#define CAL_SABBREVERASTRING 57
452688
453-#define LOCALE_IDEFAULTEBCDICCODEPAGE 0x1012
454-#define LOCALE_IDIGITSUBSTITUTION 0x1014
455-#define LOCALE_IPAPERSIZE 0x100A
689+#endif /* Windows-7 and later */
690+#endif /* Windows-Vista and later */
691+#endif /* Win98 / Win2K and later */
692+
693+/* Date format options, for use with GetDateFormat*() functions; see:
694+ * https://docs.microsoft.com/en-gb/windows/desktop/api/datetimeapi/nf-datetimeapi-getdateformatex
695+ */
696+#define DATE_SHORTDATE 1
697+#define DATE_LONGDATE 2
698+#define DATE_USE_ALT_CALENDAR 4
699+
700+#if _WIN32_WINNT >= _WIN32_WINNT_WIN2K
701+/* The following are not supported on Win9x, nor on WinNT prior to Win-2000.
702+ */
456703 #define DATE_YEARMONTH 8
457704 #define DATE_LTRREADING 16
458705 #define DATE_RTLREADING 32
459-#define MAP_EXPAND_LIGATURES 0x2000
460-#define WC_NO_BEST_FIT_CHARS 1024
461-
462-#endif /* >= Win2K */
463-
464-#if _WIN32_WINNT >= _WIN32_WINNT_VISTA
465706
466-#if 0
467-#define CAL_SSHORTESTDAYNAME1
468-#define CAL_SSHORTESTDAYNAME2
469-#define CAL_SSHORTESTDAYNAME3
470-#define CAL_SSHORTESTDAYNAME4
471-#define CAL_SSHORTESTDAYNAME5
472-#define CAL_SSHORTESTDAYNAME6
473-#define CAL_SSHORTESTDAYNAME7
474-
475-#define LOCALE_SSHORTESTDAYNAME1
476-#define LOCALE_SSHORTESTDAYNAME2
477-#define LOCALE_SSHORTESTDAYNAME3
478-#define LOCALE_SSHORTESTDAYNAME4
479-#define LOCALE_SSHORTESTDAYNAME5
480-#define LOCALE_SSHORTESTDAYNAME6
481-#define LOCALE_SSHORTESTDAYNAME7
482-#endif
707+#endif /* Windows-2000 and later */
483708
484-#define CAL_UMALQURA 23
485-
486-#if 0
487-#define LOCALE_SDURATION
488-#define LOCALE_SIETFLANGUAGE
489-#define LOCALE_SISO3166CTRYNAME2
490-#define LOCALE_SISO639LANGNAME2
491-#define LOCALE_SKEYBOARDSTOINSTALL
492-#define LOCALE_SNAME
493-#define LOCALE_SNAN
494-#define LOCALE_SNEGINFINITY
495-#define LOCALE_SPOSINFINITY
496-#define LOCALE_SSCRIPTS
497-#endif
709+/* Time format options, for use with GetTimeFormat*() functions; see:
710+ * https://docs.microsoft.com/en-gb/windows/desktop/api/datetimeapi/nf-datetimeapi-gettimeformatex
711+ */
712+#define TIME_NOMINUTESORSECONDS 1
713+#define TIME_NOSECONDS 2
714+#define TIME_NOTIMEMARKER 4
715+#define TIME_FORCE24HOURFORMAT 8
498716
499-#endif /* >= WinVista */
500717
501718 #ifndef RC_INVOKED
502719
@@ -552,16 +769,16 @@ typedef BOOL (CALLBACK *GEO_ENUMPROC) (GEOID);
552769
553770 typedef
554771 enum NLS_FUNCTION
555-{ COMPARE_STRING = 1
772+{ COMPARE_STRING = 1
556773 } NLS_FUNCTION;
557774
558775 enum SYSGEOCLASS
559-{ GEOCLASS_REGION = 14,
560- GEOCLASS_NATION = 16
776+{ GEOCLASS_NATION = 16,
777+ GEOCLASS_REGION = 14
561778 };
562779
563780 enum SYSGEOTYPE
564-{ GEO_NATION = 1,
781+{ GEO_NATION = 1,
565782 GEO_LATITUDE,
566783 GEO_LONGITUDE,
567784 GEO_ISO2,
@@ -574,6 +791,9 @@ enum SYSGEOTYPE
574791 GEO_OFFICIALLANGUAGES
575792 };
576793
794+#define MAX_DEFAULTCHAR 2
795+#define MAX_LEADBYTES 12
796+
577797 typedef struct _cpinfo
578798 { UINT MaxCharSize;
579799 BYTE DefaultChar[MAX_DEFAULTCHAR];
@@ -786,7 +1006,12 @@ WINBASEAPI WINAPI LANGID GetSystemDefaultUILanguage (void);
7861006 WINBASEAPI WINAPI LANGID GetUserDefaultUILanguage (void);
7871007 WINBASEAPI WINAPI BOOL IsValidLanguageGroup (LGRPID, DWORD);
7881008
789-#endif /* >= Win2K */
1009+#if _WIN32_WINNT >= _WIN32_WINNT_VISTA
1010+
1011+WINBASEAPI WINAPI int GetCalendarInfoEx (LPCWSTR, CALID, LPCWSTR, CALTYPE, LPCSTR, int, LPDWORD );
1012+
1013+#endif /* Win-Vista and later */
1014+#endif /* Win2K and later */
7901015 #endif /* ! RC_INVOKED */
7911016
7921017 _END_C_DECLS
Show on old repository browser