xref: /titanic_51/usr/src/uts/common/smbsrv/ntlocale.h (revision da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0)
1*da6c28aaSamw /*
2*da6c28aaSamw  * CDDL HEADER START
3*da6c28aaSamw  *
4*da6c28aaSamw  * The contents of this file are subject to the terms of the
5*da6c28aaSamw  * Common Development and Distribution License (the "License").
6*da6c28aaSamw  * You may not use this file except in compliance with the License.
7*da6c28aaSamw  *
8*da6c28aaSamw  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*da6c28aaSamw  * or http://www.opensolaris.org/os/licensing.
10*da6c28aaSamw  * See the License for the specific language governing permissions
11*da6c28aaSamw  * and limitations under the License.
12*da6c28aaSamw  *
13*da6c28aaSamw  * When distributing Covered Code, include this CDDL HEADER in each
14*da6c28aaSamw  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*da6c28aaSamw  * If applicable, add the following below this CDDL HEADER, with the
16*da6c28aaSamw  * fields enclosed by brackets "[]" replaced with your own identifying
17*da6c28aaSamw  * information: Portions Copyright [yyyy] [name of copyright owner]
18*da6c28aaSamw  *
19*da6c28aaSamw  * CDDL HEADER END
20*da6c28aaSamw  */
21*da6c28aaSamw /*
22*da6c28aaSamw  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23*da6c28aaSamw  * Use is subject to license terms.
24*da6c28aaSamw  */
25*da6c28aaSamw 
26*da6c28aaSamw #ifndef _SMBSRV_NTLOCALE_H
27*da6c28aaSamw #define	_SMBSRV_NTLOCALE_H
28*da6c28aaSamw 
29*da6c28aaSamw #pragma ident	"%Z%%M%	%I%	%E% SMI"
30*da6c28aaSamw 
31*da6c28aaSamw /*
32*da6c28aaSamw  * NT language and locale identifiers.
33*da6c28aaSamw  */
34*da6c28aaSamw 
35*da6c28aaSamw #ifdef __cplusplus
36*da6c28aaSamw extern "C" {
37*da6c28aaSamw #endif
38*da6c28aaSamw 
39*da6c28aaSamw 
40*da6c28aaSamw /*
41*da6c28aaSamw  * Language IDs.
42*da6c28aaSamw  *
43*da6c28aaSamw  * A language ID is a 16 bit value which is the combination of a
44*da6c28aaSamw  * primary language ID and a secondary language ID. The bits are
45*da6c28aaSamw  * allocated as follows:
46*da6c28aaSamw  *
47*da6c28aaSamw  *      +-----------------------+-------------------------+
48*da6c28aaSamw  *      |     Sublanguage ID    |   Primary Language ID   |
49*da6c28aaSamw  *      +-----------------------+-------------------------+
50*da6c28aaSamw  *       15                   10 9                       0   bit
51*da6c28aaSamw  *
52*da6c28aaSamw  * The following two combinations of primary language ID and sub-
53*da6c28aaSamw  * language ID have special semantics:
54*da6c28aaSamw  *
55*da6c28aaSamw  * Primary Language ID   Sublanguage ID      Result
56*da6c28aaSamw  * -------------------   ---------------     ------------------------
57*da6c28aaSamw  * LANG_NEUTRAL          SUBLANG_NEUTRAL     Language neutral
58*da6c28aaSamw  * LANG_NEUTRAL          SUBLANG_DEFAULT     User default language
59*da6c28aaSamw  * LANG_NEUTRAL          SUBLANG_SYS_DEFAULT System default language
60*da6c28aaSamw  *
61*da6c28aaSamw  * Language ID creation/extraction macros:
62*da6c28aaSamw  * MAKELANGID    - construct language id from a primary language
63*da6c28aaSamw  *                 id and a sublanguage id.
64*da6c28aaSamw  * PRIMARYLANGID - extract primary language id from a language id.
65*da6c28aaSamw  * SUBLANGID     - extract sublanguage id from a language id.
66*da6c28aaSamw  */
67*da6c28aaSamw #define	MAKELANGID(p, s)	((((WORD)(s)) << 10) | (WORD)(p))
68*da6c28aaSamw #define	PRIMARYLANGID(lgid)	((WORD)(lgid) & 0x3ff)
69*da6c28aaSamw #define	SUBLANGID(lgid)		((WORD)(lgid) >> 10)
70*da6c28aaSamw 
71*da6c28aaSamw 
72*da6c28aaSamw /*
73*da6c28aaSamw  * Primary language IDs.
74*da6c28aaSamw  */
75*da6c28aaSamw #define	LANG_NEUTRAL			0x00
76*da6c28aaSamw 
77*da6c28aaSamw #define	LANG_AFRIKAANS			0x36
78*da6c28aaSamw #define	LANG_ALBANIAN			0x1c
79*da6c28aaSamw #define	LANG_ARABIC			0x01
80*da6c28aaSamw #define	LANG_ARMENIAN			0x2b
81*da6c28aaSamw #define	LANG_ASSAMESE			0x4d
82*da6c28aaSamw #define	LANG_AZERI			0x2c
83*da6c28aaSamw #define	LANG_BASQUE			0x2d
84*da6c28aaSamw #define	LANG_BELARUSIAN			0x23
85*da6c28aaSamw #define	LANG_BENGALI			0x45
86*da6c28aaSamw #define	LANG_BULGARIAN			0x02
87*da6c28aaSamw #define	LANG_CATALAN			0x03
88*da6c28aaSamw #define	LANG_CHINESE			0x04
89*da6c28aaSamw #define	LANG_CROATIAN			0x1a
90*da6c28aaSamw #define	LANG_CZECH			0x05
91*da6c28aaSamw #define	LANG_DANISH			0x06
92*da6c28aaSamw #define	LANG_DUTCH			0x13
93*da6c28aaSamw #define	LANG_ENGLISH			0x09
94*da6c28aaSamw #define	LANG_ESTONIAN			0x25
95*da6c28aaSamw #define	LANG_FAEROESE			0x38
96*da6c28aaSamw #define	LANG_FARSI			0x29
97*da6c28aaSamw #define	LANG_FINNISH			0x0b
98*da6c28aaSamw #define	LANG_FRENCH			0x0c
99*da6c28aaSamw #define	LANG_GEORGIAN			0x37
100*da6c28aaSamw #define	LANG_GERMAN			0x07
101*da6c28aaSamw #define	LANG_GREEK			0x08
102*da6c28aaSamw #define	LANG_GUJARATI			0x47
103*da6c28aaSamw #define	LANG_HEBREW			0x0d
104*da6c28aaSamw #define	LANG_HINDI			0x39
105*da6c28aaSamw #define	LANG_HUNGARIAN			0x0e
106*da6c28aaSamw #define	LANG_ICELANDIC			0x0f
107*da6c28aaSamw #define	LANG_INDONESIAN			0x21
108*da6c28aaSamw #define	LANG_ITALIAN			0x10
109*da6c28aaSamw #define	LANG_JAPANESE			0x11
110*da6c28aaSamw #define	LANG_KANNADA			0x4b
111*da6c28aaSamw #define	LANG_KASHMIRI			0x60
112*da6c28aaSamw #define	LANG_KAZAK			0x3f
113*da6c28aaSamw #define	LANG_KONKANI			0x57
114*da6c28aaSamw #define	LANG_KOREAN			0x12
115*da6c28aaSamw #define	LANG_LATVIAN			0x26
116*da6c28aaSamw #define	LANG_LITHUANIAN			0x27
117*da6c28aaSamw #define	LANG_MACEDONIAN			0x2f
118*da6c28aaSamw #define	LANG_MALAY			0x3e
119*da6c28aaSamw #define	LANG_MALAYALAM			0x4c
120*da6c28aaSamw #define	LANG_MANIPURI			0x58
121*da6c28aaSamw #define	LANG_MARATHI			0x4e
122*da6c28aaSamw #define	LANG_NEPALI			0x61
123*da6c28aaSamw #define	LANG_NORWEGIAN			0x14
124*da6c28aaSamw #define	LANG_ORIYA			0x48
125*da6c28aaSamw #define	LANG_POLISH			0x15
126*da6c28aaSamw #define	LANG_PORTUGUESE			0x16
127*da6c28aaSamw #define	LANG_PUNJABI			0x46
128*da6c28aaSamw #define	LANG_ROMANIAN			0x18
129*da6c28aaSamw #define	LANG_RUSSIAN			0x19
130*da6c28aaSamw #define	LANG_SANSKRIT			0x4f
131*da6c28aaSamw #define	LANG_SERBIAN			0x1a
132*da6c28aaSamw #define	LANG_SINDHI			0x59
133*da6c28aaSamw #define	LANG_SLOVAK			0x1b
134*da6c28aaSamw #define	LANG_SLOVENIAN			0x24
135*da6c28aaSamw #define	LANG_SPANISH			0x0a
136*da6c28aaSamw #define	LANG_SWAHILI			0x41
137*da6c28aaSamw #define	LANG_SWEDISH			0x1d
138*da6c28aaSamw #define	LANG_TAMIL			0x49
139*da6c28aaSamw #define	LANG_TATAR			0x44
140*da6c28aaSamw #define	LANG_TELUGU			0x4a
141*da6c28aaSamw #define	LANG_THAI			0x1e
142*da6c28aaSamw #define	LANG_TURKISH			0x1f
143*da6c28aaSamw #define	LANG_UKRAINIAN			0x22
144*da6c28aaSamw #define	LANG_URDU			0x20
145*da6c28aaSamw #define	LANG_UZBEK			0x43
146*da6c28aaSamw #define	LANG_VIETNAMESE			0x2a
147*da6c28aaSamw 
148*da6c28aaSamw 
149*da6c28aaSamw /*
150*da6c28aaSamw  * Sublanguage IDs.
151*da6c28aaSamw  *
152*da6c28aaSamw  * The name immediately following SUBLANG_ dictates which primary
153*da6c28aaSamw  * language ID can be combined with the sub-language ID to form a
154*da6c28aaSamw  * valid language ID.
155*da6c28aaSamw  */
156*da6c28aaSamw #define	SUBLANG_NEUTRAL			0x00	/* language neutral */
157*da6c28aaSamw #define	SUBLANG_DEFAULT			0x01	/* user default */
158*da6c28aaSamw #define	SUBLANG_SYS_DEFAULT		0x02	/* system default */
159*da6c28aaSamw 
160*da6c28aaSamw #define	SUBLANG_ARABIC_SAUDI_ARABIA	0x01	/* Arabic (Saudi Arabia) */
161*da6c28aaSamw #define	SUBLANG_ARABIC_IRAQ		0x02	/* Arabic (Iraq) */
162*da6c28aaSamw #define	SUBLANG_ARABIC_EGYPT		0x03	/* Arabic (Egypt) */
163*da6c28aaSamw #define	SUBLANG_ARABIC_LIBYA		0x04	/* Arabic (Libya) */
164*da6c28aaSamw #define	SUBLANG_ARABIC_ALGERIA		0x05	/* Arabic (Algeria) */
165*da6c28aaSamw #define	SUBLANG_ARABIC_MOROCCO		0x06	/* Arabic (Morocco) */
166*da6c28aaSamw #define	SUBLANG_ARABIC_TUNISIA		0x07	/* Arabic (Tunisia) */
167*da6c28aaSamw #define	SUBLANG_ARABIC_OMAN		0x08	/* Arabic (Oman) */
168*da6c28aaSamw #define	SUBLANG_ARABIC_YEMEN		0x09	/* Arabic (Yemen) */
169*da6c28aaSamw #define	SUBLANG_ARABIC_SYRIA		0x0a	/* Arabic (Syria) */
170*da6c28aaSamw #define	SUBLANG_ARABIC_JORDAN		0x0b	/* Arabic (Jordan) */
171*da6c28aaSamw #define	SUBLANG_ARABIC_LEBANON		0x0c	/* Arabic (Lebanon) */
172*da6c28aaSamw #define	SUBLANG_ARABIC_KUWAIT		0x0d	/* Arabic (Kuwait) */
173*da6c28aaSamw #define	SUBLANG_ARABIC_UAE		0x0e	/* Arabic (U.A.E) */
174*da6c28aaSamw #define	SUBLANG_ARABIC_BAHRAIN		0x0f	/* Arabic (Bahrain) */
175*da6c28aaSamw #define	SUBLANG_ARABIC_QATAR		0x10	/* Arabic (Qatar) */
176*da6c28aaSamw #define	SUBLANG_AZERI_LATIN		0x01	/* Azeri (Latin) */
177*da6c28aaSamw #define	SUBLANG_AZERI_CYRILLIC		0x02	/* Azeri (Cyrillic) */
178*da6c28aaSamw #define	SUBLANG_CHINESE_TRADITIONAL	0x01	/* Chinese (Taiwan Region) */
179*da6c28aaSamw #define	SUBLANG_CHINESE_SIMPLIFIED	0x02	/* Chinese (PR China) */
180*da6c28aaSamw #define	SUBLANG_CHINESE_HONGKONG	0x03	/* Chinese (Hong Kong) */
181*da6c28aaSamw #define	SUBLANG_CHINESE_SINGAPORE	0x04	/* Chinese (Singapore) */
182*da6c28aaSamw #define	SUBLANG_CHINESE_MACAU		0x05	/* Chinese (Macau) */
183*da6c28aaSamw #define	SUBLANG_DUTCH			0x01	/* Dutch */
184*da6c28aaSamw #define	SUBLANG_DUTCH_BELGIAN		0x02	/* Dutch (Belgian) */
185*da6c28aaSamw #define	SUBLANG_ENGLISH_US		0x01	/* English (USA) */
186*da6c28aaSamw #define	SUBLANG_ENGLISH_UK		0x02	/* English (UK) */
187*da6c28aaSamw #define	SUBLANG_ENGLISH_AUS		0x03	/* English (Australian) */
188*da6c28aaSamw #define	SUBLANG_ENGLISH_CAN		0x04	/* English (Canadian) */
189*da6c28aaSamw #define	SUBLANG_ENGLISH_NZ		0x05	/* English (New Zealand) */
190*da6c28aaSamw #define	SUBLANG_ENGLISH_EIRE		0x06	/* English (Irish) */
191*da6c28aaSamw #define	SUBLANG_ENGLISH_SOUTH_AFRICA	0x07	/* English (South Africa) */
192*da6c28aaSamw #define	SUBLANG_ENGLISH_JAMAICA		0x08	/* English (Jamaica) */
193*da6c28aaSamw #define	SUBLANG_ENGLISH_CARIBBEAN	0x09	/* English (Caribbean) */
194*da6c28aaSamw #define	SUBLANG_ENGLISH_BELIZE		0x0a	/* English (Belize) */
195*da6c28aaSamw #define	SUBLANG_ENGLISH_TRINIDAD	0x0b	/* English (Trinidad) */
196*da6c28aaSamw #define	SUBLANG_ENGLISH_ZIMBABWE	0x0c	/* English (Zimbabwe) */
197*da6c28aaSamw #define	SUBLANG_ENGLISH_PHILIPPINES	0x0d	/* English (Philippines) */
198*da6c28aaSamw #define	SUBLANG_FRENCH			0x01	/* French */
199*da6c28aaSamw #define	SUBLANG_FRENCH_BELGIAN		0x02	/* French (Belgian) */
200*da6c28aaSamw #define	SUBLANG_FRENCH_CANADIAN		0x03	/* French (Canadian) */
201*da6c28aaSamw #define	SUBLANG_FRENCH_SWISS		0x04	/* French (Swiss) */
202*da6c28aaSamw #define	SUBLANG_FRENCH_LUXEMBOURG	0x05	/* French (Luxembourg) */
203*da6c28aaSamw #define	SUBLANG_FRENCH_MONACO		0x06	/* French (Monaco) */
204*da6c28aaSamw #define	SUBLANG_GERMAN			0x01	/* German */
205*da6c28aaSamw #define	SUBLANG_GERMAN_SWISS		0x02	/* German (Swiss) */
206*da6c28aaSamw #define	SUBLANG_GERMAN_AUSTRIAN		0x03	/* German (Austrian) */
207*da6c28aaSamw #define	SUBLANG_GERMAN_LUXEMBOURG	0x04	/* German (Luxembourg) */
208*da6c28aaSamw #define	SUBLANG_GERMAN_LIECHTENSTEIN	0x05	/* German (Liechtenstein) */
209*da6c28aaSamw #define	SUBLANG_ITALIAN			0x01	/* Italian */
210*da6c28aaSamw #define	SUBLANG_ITALIAN_SWISS		0x02	/* Italian (Swiss) */
211*da6c28aaSamw #define	SUBLANG_KASHMIRI_INDIA		0x02	/* Kashmiri (India) */
212*da6c28aaSamw #define	SUBLANG_KOREAN			0x01	/* Korean (Extended Wansung) */
213*da6c28aaSamw #define	SUBLANG_LITHUANIAN		0x01	/* Lithuanian */
214*da6c28aaSamw #define	SUBLANG_LITHUANIAN_CLASSIC	0x02	/* Lithuanian (Classic) */
215*da6c28aaSamw #define	SUBLANG_MALAY_MALAYSIA		0x01	/* Malay (Malaysia) */
216*da6c28aaSamw #define	SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02	/* Malay (Brunei Darussalam) */
217*da6c28aaSamw #define	SUBLANG_NEPALI_INDIA		0x02	/* Nepali (India) */
218*da6c28aaSamw #define	SUBLANG_NORWEGIAN_BOKMAL	0x01	/* Norwegian (Bokmal) */
219*da6c28aaSamw #define	SUBLANG_NORWEGIAN_NYNORSK	0x02	/* Norwegian (Nynorsk) */
220*da6c28aaSamw #define	SUBLANG_PORTUGUESE		0x02	/* Portuguese */
221*da6c28aaSamw #define	SUBLANG_PORTUGUESE_BRAZILIAN	0x01	/* Portuguese (Brazilian) */
222*da6c28aaSamw #define	SUBLANG_SERBIAN_LATIN		0x02	/* Serbian (Latin) */
223*da6c28aaSamw #define	SUBLANG_SERBIAN_CYRILLIC	0x03	/* Serbian (Cyrillic) */
224*da6c28aaSamw #define	SUBLANG_SPANISH			0x01	/* Spanish (Castilian) */
225*da6c28aaSamw #define	SUBLANG_SPANISH_MEXICAN		0x02	/* Spanish (Mexican) */
226*da6c28aaSamw #define	SUBLANG_SPANISH_MODERN		0x03	/* Spanish (Modern) */
227*da6c28aaSamw #define	SUBLANG_SPANISH_GUATEMALA	0x04	/* Spanish (Guatemala) */
228*da6c28aaSamw #define	SUBLANG_SPANISH_COSTA_RICA	0x05	/* Spanish (Costa Rica) */
229*da6c28aaSamw #define	SUBLANG_SPANISH_PANAMA		0x06	/* Spanish (Panama) */
230*da6c28aaSamw #define	SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07	/* Spanish (Dom. Republic) */
231*da6c28aaSamw #define	SUBLANG_SPANISH_VENEZUELA	0x08	/* Spanish (Venezuela) */
232*da6c28aaSamw #define	SUBLANG_SPANISH_COLOMBIA	0x09	/* Spanish (Colombia) */
233*da6c28aaSamw #define	SUBLANG_SPANISH_PERU		0x0a	/* Spanish (Peru) */
234*da6c28aaSamw #define	SUBLANG_SPANISH_ARGENTINA	0x0b	/* Spanish (Argentina) */
235*da6c28aaSamw #define	SUBLANG_SPANISH_ECUADOR		0x0c	/* Spanish (Ecuador) */
236*da6c28aaSamw #define	SUBLANG_SPANISH_CHILE		0x0d	/* Spanish (Chile) */
237*da6c28aaSamw #define	SUBLANG_SPANISH_URUGUAY		0x0e	/* Spanish (Uruguay) */
238*da6c28aaSamw #define	SUBLANG_SPANISH_PARAGUAY	0x0f	/* Spanish (Paraguay) */
239*da6c28aaSamw #define	SUBLANG_SPANISH_BOLIVIA		0x10	/* Spanish (Bolivia) */
240*da6c28aaSamw #define	SUBLANG_SPANISH_EL_SALVADOR	0x11	/* Spanish (El Salvador) */
241*da6c28aaSamw #define	SUBLANG_SPANISH_HONDURAS	0x12	/* Spanish (Honduras) */
242*da6c28aaSamw #define	SUBLANG_SPANISH_NICARAGUA	0x13	/* Spanish (Nicaragua) */
243*da6c28aaSamw #define	SUBLANG_SPANISH_PUERTO_RICO	0x14	/* Spanish (Puerto Rico) */
244*da6c28aaSamw #define	SUBLANG_SWEDISH			0x01	/* Swedish */
245*da6c28aaSamw #define	SUBLANG_SWEDISH_FINLAND		0x02	/* Swedish (Finland) */
246*da6c28aaSamw #define	SUBLANG_URDU_PAKISTAN		0x01	/* Urdu (Pakistan) */
247*da6c28aaSamw #define	SUBLANG_URDU_INDIA		0x02	/* Urdu (India) */
248*da6c28aaSamw #define	SUBLANG_UZBEK_LATIN		0x01	/* Uzbek (Latin) */
249*da6c28aaSamw #define	SUBLANG_UZBEK_CYRILLIC		0x02	/* Uzbek (Cyrillic) */
250*da6c28aaSamw 
251*da6c28aaSamw /*
252*da6c28aaSamw  * Sorting IDs.
253*da6c28aaSamw  */
254*da6c28aaSamw #define	SORT_DEFAULT			0x0	/* sorting default */
255*da6c28aaSamw 
256*da6c28aaSamw #define	SORT_JAPANESE_XJIS		0x0	/* Japanese XJIS order */
257*da6c28aaSamw #define	SORT_JAPANESE_UNICODE		0x1	/* Japanese Unicode order */
258*da6c28aaSamw 
259*da6c28aaSamw #define	SORT_CHINESE_BIG5		0x0	/* Chinese BIG5 order */
260*da6c28aaSamw #define	SORT_CHINESE_PRCP		0x0	/* PRC Chinese Phonetic order */
261*da6c28aaSamw #define	SORT_CHINESE_UNICODE		0x1	/* Chinese Unicode order */
262*da6c28aaSamw #define	SORT_CHINESE_PRC		0x2	/* PRC Chinese Stroke Count */
263*da6c28aaSamw 						/* order */
264*da6c28aaSamw #define	SORT_CHINESE_BOPOMOFO		0x3	/* Traditional Chinese */
265*da6c28aaSamw 						/* Bopomofo order */
266*da6c28aaSamw 
267*da6c28aaSamw #define	SORT_KOREAN_KSC			0x0	/* Korean KSC order */
268*da6c28aaSamw #define	SORT_KOREAN_UNICODE		0x1	/* Korean Unicode order */
269*da6c28aaSamw 
270*da6c28aaSamw #define	SORT_GERMAN_PHONE_BOOK		0x1	/* German Phone Book order */
271*da6c28aaSamw 
272*da6c28aaSamw #define	SORT_HUNGARIAN_DEFAULT		0x0	/* Hungarian Default order */
273*da6c28aaSamw #define	SORT_HUNGARIAN_TECHNICAL	0x1	/* Hungarian Technical order */
274*da6c28aaSamw 
275*da6c28aaSamw #define	SORT_GEORGIAN_TRADITIONAL	0x0	/* Georgian Traditional order */
276*da6c28aaSamw #define	SORT_GEORGIAN_MODERN		0x1	/* Georgian Modern order */
277*da6c28aaSamw 
278*da6c28aaSamw 
279*da6c28aaSamw /*
280*da6c28aaSamw  *  A locale ID is a 32 bit value which is the combination of a
281*da6c28aaSamw  *  language ID, a sort ID, and a reserved area.  The bits are
282*da6c28aaSamw  *  allocated as follows:
283*da6c28aaSamw  *
284*da6c28aaSamw  *       +-------------+---------+-------------------------+
285*da6c28aaSamw  *       |   Reserved  | Sort ID |      Language ID        |
286*da6c28aaSamw  *       +-------------+---------+-------------------------+
287*da6c28aaSamw  *        31         20 19     16 15                      0   bit
288*da6c28aaSamw  *
289*da6c28aaSamw  *  Locale ID creation/extraction macros:
290*da6c28aaSamw  *
291*da6c28aaSamw  * MAKELCID            - construct the locale id from a language id
292*da6c28aaSamw  *                       and a sort id.
293*da6c28aaSamw  * MAKESORTLCID        - construct the locale id from a language id,
294*da6c28aaSamw  *                       sort id, and sort version.
295*da6c28aaSamw  * LANGIDFROMLCID      - extract the language id from a locale id.
296*da6c28aaSamw  * SORTIDFROMLCID      - extract the sort id from a locale id.
297*da6c28aaSamw  * SORTVERSIONFROMLCID - extract the sort version from a locale id.
298*da6c28aaSamw  */
299*da6c28aaSamw 
300*da6c28aaSamw #define	NLS_VALID_LOCALE_MASK	0x000fffff
301*da6c28aaSamw 
302*da6c28aaSamw #define	MAKELCID(lgid, srtid)	\
303*da6c28aaSamw 	((DWORD)((((DWORD)((WORD)(srtid))) << 16) | ((DWORD)((WORD)(lgid)))))
304*da6c28aaSamw 
305*da6c28aaSamw #define	MAKESORTLCID(lgid, srtid, ver)	\
306*da6c28aaSamw 	((DWORD)((MAKELCID(lgid, srtid)) | (((DWORD)((WORD)(ver))) << 20)))
307*da6c28aaSamw 
308*da6c28aaSamw #define	LANGIDFROMLCID(lcid)		((WORD)(lcid))
309*da6c28aaSamw #define	SORTIDFROMLCID(lcid)		((WORD)((((DWORD)(lcid)) >> 16) & 0xf))
310*da6c28aaSamw #define	SORTVERSIONFROMLCID(lcid)	((WORD)((((DWORD)(lcid)) >> 20) & 0xf))
311*da6c28aaSamw 
312*da6c28aaSamw 
313*da6c28aaSamw /*
314*da6c28aaSamw  * Default System and User IDs for language and locale.
315*da6c28aaSamw  */
316*da6c28aaSamw #define	LANG_SYSTEM_DEFAULT	MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT))
317*da6c28aaSamw #define	LANG_USER_DEFAULT	(MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT))
318*da6c28aaSamw 
319*da6c28aaSamw #define	LOCALE_SYSTEM_DEFAULT	(MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT))
320*da6c28aaSamw #define	LOCALE_USER_DEFAULT	(MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT))
321*da6c28aaSamw 
322*da6c28aaSamw #define	LOCALE_NEUTRAL         \
323*da6c28aaSamw 	(MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), SORT_DEFAULT))
324*da6c28aaSamw 
325*da6c28aaSamw 
326*da6c28aaSamw #ifdef __cplusplus
327*da6c28aaSamw }
328*da6c28aaSamw #endif
329*da6c28aaSamw 
330*da6c28aaSamw #endif /* _SMBSRV_NTLOCALE_H */
331