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