1 // Copyright © 2015, Peter Atashian
2 // Licensed under the MIT License <LICENSE.md>
3 //! Procedure declarations, constant definitions, and macros for the NLS component.
4 pub const CP_ACP: ::DWORD = 0;
5 pub const CP_OEMCP: ::DWORD = 1;
6 pub const CP_MACCP: ::DWORD = 2;
7 pub const CP_THREAD_ACP: ::DWORD = 3;
8 pub const CP_SYMBOL: ::DWORD = 42;
9 pub const CP_UTF7: ::DWORD = 65000;
10 pub const CP_UTF8: ::DWORD = 65001;
11 pub const MAX_LEADBYTES: usize = 12;
12 pub const MAX_DEFAULTCHAR: usize = 2;
13 pub type LGRPID = ::DWORD;
14 pub type LCTYPE = ::DWORD;
15 pub type CALTYPE = ::DWORD;
16 pub type CALID = ::DWORD;
17 pub type GEOID = ::LONG;
18 pub type GEOTYPE = ::DWORD;
19 pub type GEOCLASS = ::DWORD;
20 STRUCT!{struct NLSVERSIONINFO {
21     dwNLSVersionInfoSize: ::DWORD,
22     dwNLSVersion: ::DWORD,
23     dwDefinedVersion: ::DWORD,
24     dwEffectiveId: ::DWORD,
25     guidCustomVersion: ::GUID,
26 }}
27 pub type LPNLSVERSIONINFO = *mut NLSVERSIONINFO;
28 STRUCT!{struct NLSVERSIONINFOEX {
29     dwNLSVersionInfoSize: ::DWORD,
30     dwNLSVersion: ::DWORD,
31     dwDefinedVersion: ::DWORD,
32     dwEffectiveId: ::DWORD,
33     guidCustomVersion: ::GUID,
34 }}
35 pub type LPNLSVERSIONINFOEX = *mut NLSVERSIONINFOEX;
36 ENUM!{enum NORM_FORM {
37     NormalizationOther = 0,
38     NormalizationC = 0x1,
39     NormalizationD = 0x2,
40     NormalizationKC = 0x5,
41     NormalizationKD = 0x6,
42 }}
43 pub type LANGUAGEGROUP_ENUMPROCA = Option<unsafe extern "system" fn(
44     ::LGRPID, ::LPSTR, ::LPSTR, ::DWORD, ::LONG_PTR,
45 ) -> ::BOOL>;
46 pub type LANGGROUPLOCALE_ENUMPROCA = Option<unsafe extern "system" fn(
47     ::LGRPID, ::LCID, ::LPSTR, ::LONG_PTR,
48 ) -> ::BOOL>;
49 pub type UILANGUAGE_ENUMPROCA = Option<unsafe extern "system" fn(::LPSTR, ::LONG_PTR) -> ::BOOL>;
50 pub type CODEPAGE_ENUMPROCA = Option<unsafe extern "system" fn(::LPSTR) -> ::BOOL>;
51 pub type DATEFMT_ENUMPROCA = Option<unsafe extern "system" fn(::LPSTR) -> ::BOOL>;
52 pub type DATEFMT_ENUMPROCEXA = Option<unsafe extern "system" fn(::LPSTR, ::CALID) -> ::BOOL>;
53 pub type TIMEFMT_ENUMPROCA = Option<unsafe extern "system" fn(::LPSTR) -> ::BOOL>;
54 pub type CALINFO_ENUMPROCA = Option<unsafe extern "system" fn(::LPSTR) -> ::BOOL>;
55 pub type CALINFO_ENUMPROCEXA = Option<unsafe extern "system" fn(::LPSTR, ::CALID) -> ::BOOL>;
56 pub type LOCALE_ENUMPROCA = Option<unsafe extern "system" fn(::LPSTR) -> ::BOOL>;
57 pub type LOCALE_ENUMPROCW = Option<unsafe extern "system" fn(::LPWSTR) -> ::BOOL>;
58 pub type LANGUAGEGROUP_ENUMPROCW = Option<unsafe extern "system" fn(
59     ::LGRPID, ::LPWSTR, ::LPWSTR, ::DWORD, ::LONG_PTR,
60 ) -> ::BOOL>;
61 pub type LANGGROUPLOCALE_ENUMPROCW = Option<unsafe extern "system" fn(
62     ::LGRPID, ::LCID, ::LPWSTR, ::LONG_PTR,
63 ) -> ::BOOL>;
64 pub type UILANGUAGE_ENUMPROCW = Option<unsafe extern "system" fn(::LPWSTR, ::LONG_PTR) -> ::BOOL>;
65 pub type CODEPAGE_ENUMPROCW = Option<unsafe extern "system" fn(::LPWSTR) -> ::BOOL>;
66 pub type DATEFMT_ENUMPROCW = Option<unsafe extern "system" fn(::LPWSTR) -> ::BOOL>;
67 pub type DATEFMT_ENUMPROCEXW = Option<unsafe extern "system" fn(::LPWSTR, ::CALID) -> ::BOOL>;
68 pub type TIMEFMT_ENUMPROCW = Option<unsafe extern "system" fn(::LPWSTR) -> ::BOOL>;
69 pub type CALINFO_ENUMPROCW = Option<unsafe extern "system" fn(::LPWSTR) -> ::BOOL>;
70 pub type CALINFO_ENUMPROCEXW = Option<unsafe extern "system" fn(::LPWSTR, ::CALID) -> ::BOOL>;
71 pub type GEO_ENUMPROC = Option<unsafe extern "system" fn(GEOID) -> ::BOOL>;
72 STRUCT!{struct CPINFO {
73     MaxCharSize: ::UINT,
74     DefaultChar: [::BYTE; MAX_DEFAULTCHAR],
75     LeadByte: [::BYTE; MAX_LEADBYTES],
76 }}
77 pub type LPCPINFO = *mut CPINFO;
78 STRUCT!{nodebug struct CPINFOEXA {
79     MaxCharSize: ::UINT,
80     DefaultChar: [::BYTE; MAX_DEFAULTCHAR],
81     LeadByte: [::BYTE; MAX_LEADBYTES],
82     UnicodeDefaultChar: ::WCHAR,
83     CodePage: ::UINT,
84     CodePageName: [::CHAR; ::MAX_PATH],
85 }}
86 pub type LPCPINFOEXA = *mut CPINFOEXA;
87 STRUCT!{nodebug struct CPINFOEXW {
88     MaxCharSize: ::UINT,
89     DefaultChar: [::BYTE; MAX_DEFAULTCHAR],
90     LeadByte: [::BYTE; MAX_LEADBYTES],
91     UnicodeDefaultChar: ::WCHAR,
92     CodePage: ::UINT,
93     CodePageName: [::WCHAR; ::MAX_PATH],
94 }}
95 pub type LPCPINFOEXW = *mut CPINFOEXW;
96 STRUCT!{struct NUMBERFMTA {
97     NumDigits: ::UINT,
98     LeadingZero: ::UINT,
99     Grouping: ::UINT,
100     lpDecimalSep: ::LPSTR,
101     lpThousandSep: ::LPSTR,
102     NegativeOrder: ::UINT,
103 }}
104 pub type LPNUMBERFMTA = *mut NUMBERFMTA;
105 STRUCT!{struct NUMBERFMTW {
106     NumDigits: ::UINT,
107     LeadingZero: ::UINT,
108     Grouping: ::UINT,
109     lpDecimalSep: ::LPWSTR,
110     lpThousandSep: ::LPWSTR,
111     NegativeOrder: ::UINT,
112 }}
113 pub type LPNUMBERFMTW = *mut NUMBERFMTW;
114 STRUCT!{struct CURRENCYFMTA {
115     NumDigits: ::UINT,
116     LeadingZero: ::UINT,
117     Grouping: ::UINT,
118     lpDecimalSep: ::LPSTR,
119     lpThousandSep: ::LPSTR,
120     NegativeOrder: ::UINT,
121     PositiveOrder: ::UINT,
122     lpCurrencySymbol: ::LPSTR,
123 }}
124 pub type LPCURRENCYFMTA = *mut CURRENCYFMTA;
125 STRUCT!{struct CURRENCYFMTW {
126     NumDigits: ::UINT,
127     LeadingZero: ::UINT,
128     Grouping: ::UINT,
129     lpDecimalSep: ::LPWSTR,
130     lpThousandSep: ::LPWSTR,
131     NegativeOrder: ::UINT,
132     PositiveOrder: ::UINT,
133     lpCurrencySymbol: ::LPWSTR,
134 }}
135 pub type LPCURRENCYFMTW = *mut CURRENCYFMTW;
136 pub type NLS_FUNCTION = ::DWORD;
137 STRUCT!{struct FILEMUIINFO {
138     dwSize: ::DWORD,
139     dwVersion: ::DWORD,
140     dwFileType: ::DWORD,
141     pChecksum: [::BYTE; 16],
142     pServiceChecksum: [::BYTE; 16],
143     dwLanguageNameOffset: ::DWORD,
144     dwTypeIDMainSize: ::DWORD,
145     dwTypeIDMainOffset: ::DWORD,
146     dwTypeNameMainOffset: ::DWORD,
147     dwTypeIDMUISize: ::DWORD,
148     dwTypeIDMUIOffset: ::DWORD,
149     dwTypeNameMUIOffset: ::DWORD,
150     abBuffer: [::BYTE; 8],
151 }}
152 pub type PFILEMUIINFO = *mut FILEMUIINFO;
153 pub type CALINFO_ENUMPROCEXEX = Option<unsafe extern "system" fn(
154     ::LPWSTR, ::CALID, ::LPWSTR, ::LPARAM,
155 ) -> ::BOOL>;
156 pub type DATEFMT_ENUMPROCEXEX = Option<unsafe extern "system" fn(
157     ::LPWSTR, ::CALID, ::LPARAM,
158 ) -> ::BOOL>;
159 pub type TIMEFMT_ENUMPROCEX = Option<unsafe extern "system" fn(
160     ::LPWSTR, ::LPARAM,
161 ) -> ::BOOL>;
162 pub type LOCALE_ENUMPROCEX = Option<unsafe extern "system" fn(
163     ::LPWSTR, ::DWORD, ::LPARAM,
164 ) -> ::BOOL>;
165