Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

429 lines
20 KiB

  1. /***
  2. *olenls.h - National language support functions.
  3. *
  4. * Copyright (C) 1992, Microsoft Corporation. All Rights Reserved.
  5. * Information Contained Herein Is Proprietary and Confidential.
  6. *
  7. *Purpose:
  8. * This describes the NLSAPI functions for Win16. This is a subset
  9. * of Win32 NLSAPI, and is a non-Unicode version.
  10. *
  11. *Implementation Notes:
  12. * This files is largely ported from the Win32 header winnls.h.
  13. *
  14. *****************************************************************************/
  15. #ifndef _OLENLS_
  16. #define _OLENLS_
  17. #ifndef NONLS
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif // __cpluscplus
  21. /***************************************************************************\
  22. * Constants
  23. *
  24. * Define all constants for the NLS component here.
  25. \***************************************************************************/
  26. /*
  27. * Character Type Flags.
  28. */
  29. #define CT_CTYPE1 0x00000001 /* ctype 1 information */
  30. #define CT_CTYPE2 0x00000002 /* ctype 2 information */
  31. #define CT_CTYPE3 0x00000004 /* ctype 3 information */
  32. /*
  33. * CType 1 Flag Bits.
  34. */
  35. #define C1_UPPER 0x0001 /* upper case */
  36. #define C1_LOWER 0x0002 /* lower case */
  37. #define C1_DIGIT 0x0004 /* decimal digits */
  38. #define C1_SPACE 0x0008 /* spacing characters */
  39. #define C1_PUNCT 0x0010 /* punctuation characters */
  40. #define C1_CNTRL 0x0020 /* control characters */
  41. #define C1_BLANK 0x0040 /* blank characters */
  42. #define C1_XDIGIT 0x0080 /* other digits */
  43. #define C1_ALPHA 0x0100 /* any letter */
  44. /*
  45. * CType 2 Flag Bits.
  46. */
  47. #define C2_LEFTTORIGHT 0x1 /* left to right */
  48. #define C2_RIGHTTOLEFT 0x2 /* right to left */
  49. #define C2_EUROPENUMBER 0x3 /* European number, digit */
  50. #define C2_EUROPESEPARATOR 0x4 /* European numeric separator */
  51. #define C2_EUROPETERMINATOR 0x5 /* European numeric terminator */
  52. #define C2_ARABICNUMBER 0x6 /* Arabic number */
  53. #define C2_COMMONSEPARATOR 0x7 /* common numeric separator */
  54. #define C2_BLOCKSEPARATOR 0x8 /* block separator */
  55. #define C2_SEGMENTSEPARATOR 0x9 /* segment separator */
  56. #define C2_WHITESPACE 0xA /* white space */
  57. #define C2_OTHERNEUTRAL 0xB /* other neutrals */
  58. #define C2_NOTAPPLICABLE 0x0 /* no implicit directionality */
  59. /*
  60. * CType 3 Flag Bits.
  61. */
  62. #define C3_NONSPACING 0x0001 /* nonspacing character */
  63. #define C3_DIACRITIC 0x0002 /* diacritic mark */
  64. #define C3_VOWELMARK 0x0004 /* vowel mark */
  65. #define C3_SYMBOL 0x0008 /* symbols */
  66. #define C3_NOTAPPLICABLE 0x0 /* ctype 3 is not applicable */
  67. /*
  68. * String Flags.
  69. */
  70. #define NORM_IGNORECASE 0x00000001 /* ignore case */
  71. #define NORM_IGNORENONSPACE 0x00000002 /* ignore nonspacing chars */
  72. #define NORM_IGNORESYMBOLS 0x00000004 /* ignore symbols */
  73. /*
  74. * Locale Dependent Mapping Flags.
  75. */
  76. #define LCMAP_LOWERCASE 0x00000100 /* lower case letters */
  77. #define LCMAP_UPPERCASE 0x00000200 /* upper case letters */
  78. #define LCMAP_SORTKEY 0x00000400 /* WC sort key (normalize) */
  79. /*
  80. * Language IDs.
  81. *
  82. * The following two combinations of primary language ID and
  83. * sublanguage ID have special semantics:
  84. *
  85. * Primary Language ID Sublanguage ID Result
  86. * ------------------- --------------- ------------------------
  87. * LANG_NEUTRAL SUBLANG_NEUTRAL Language neutral
  88. * LANG_NEUTRAL SUBLANG_DEFAULT Process default language
  89. */
  90. /*
  91. * Primary language IDs.
  92. */
  93. #define LANG_NEUTRAL 0x00
  94. #define LANG_ALBANIAN 0x1c
  95. #define LANG_ARABIC 0x01
  96. #define LANG_BAHASA 0x21
  97. #define LANG_BULGARIAN 0x02
  98. #define LANG_CATALAN 0x03
  99. #define LANG_CHINESE 0x04
  100. #define LANG_CZECH 0x05
  101. #define LANG_DANISH 0x06
  102. #define LANG_DUTCH 0x13
  103. #define LANG_ENGLISH 0x09
  104. #define LANG_FINNISH 0x0b
  105. #define LANG_FRENCH 0x0c
  106. #define LANG_GERMAN 0x07
  107. #define LANG_GREEK 0x08
  108. #define LANG_HEBREW 0x0d
  109. #define LANG_HUNGARIAN 0x0e
  110. #define LANG_ICELANDIC 0x0f
  111. #define LANG_ITALIAN 0x10
  112. #define LANG_JAPANESE 0x11
  113. #define LANG_KOREAN 0x12
  114. #define LANG_NORWEGIAN 0x14
  115. #define LANG_POLISH 0x15
  116. #define LANG_PORTUGUESE 0x16
  117. #define LANG_RHAETO_ROMAN 0x17
  118. #define LANG_ROMANIAN 0x18
  119. #define LANG_RUSSIAN 0x19
  120. #define LANG_SERBO_CROATIAN 0x1a
  121. #define LANG_SLOVAK 0x1b
  122. #define LANG_SPANISH 0x0a
  123. #define LANG_SWEDISH 0x1d
  124. #define LANG_THAI 0x1e
  125. #define LANG_TURKISH 0x1f
  126. #define LANG_URDU 0x20
  127. /*
  128. * Sublanguage IDs.
  129. *
  130. * The name immediately following SUBLANG_ dictates which primary
  131. * language ID that sublanguage ID can be combined with to form a
  132. * valid language ID.
  133. */
  134. #define SUBLANG_NEUTRAL 0x00 /* language neutral */
  135. #define SUBLANG_DEFAULT 0x01 /* user default */
  136. #define SUBLANG_SYS_DEFAULT 0x02 /* system default */
  137. #define SUBLANG_CHINESE_SIMPLIFIED 0x02 /* Chinese (Simplified) */
  138. #define SUBLANG_CHINESE_TRADITIONAL 0x01 /* Chinese (Traditional) */
  139. #define SUBLANG_DUTCH 0x01 /* Dutch */
  140. #define SUBLANG_DUTCH_BELGIAN 0x02 /* Dutch (Belgian) */
  141. #define SUBLANG_ENGLISH_US 0x01 /* English (USA) */
  142. #define SUBLANG_ENGLISH_UK 0x02 /* English (UK) */
  143. #define SUBLANG_ENGLISH_AUS 0x03 /* English (Australian) */
  144. #define SUBLANG_ENGLISH_CAN 0x04 /* English (Canadian) */
  145. #define SUBLANG_ENGLISH_NZ 0x05 /* English (New Zealand) */
  146. #define SUBLANG_FRENCH 0x01 /* French */
  147. #define SUBLANG_FRENCH_BELGIAN 0x02 /* French (Belgian) */
  148. #define SUBLANG_FRENCH_CANADIAN 0x03 /* French (Canadian) */
  149. #define SUBLANG_FRENCH_SWISS 0x04 /* French (Swiss) */
  150. #define SUBLANG_GERMAN 0x01 /* German */
  151. #define SUBLANG_GERMAN_SWISS 0x02 /* German (Swiss) */
  152. #define SUBLANG_GERMAN_AUSTRIAN 0x03 /* German (Austrian) */
  153. #define SUBLANG_ITALIAN 0x01 /* Italian */
  154. #define SUBLANG_ITALIAN_SWISS 0x02 /* Italian (Swiss) */
  155. #define SUBLANG_NORWEGIAN_BOKMAL 0x01 /* Norwegian (Bokmal) */
  156. #define SUBLANG_NORWEGIAN_NYNORSK 0x02 /* Norwegian (Nynorsk) */
  157. #define SUBLANG_PORTUGUESE 0x02 /* Portuguese */
  158. #define SUBLANG_PORTUGUESE_BRAZILIAN 0x01 /* Portuguese (Brazilian) */
  159. #define SUBLANG_SERBO_CROATIAN_CYRILLIC 0x02 /* Serbo-Croatian (Cyrillic) */
  160. #define SUBLANG_SERBO_CROATIAN_LATIN 0x01 /* Croato-Serbian (Latin) */
  161. #define SUBLANG_SPANISH 0x01 /* Spanish */
  162. #define SUBLANG_SPANISH_MEXICAN 0x02 /* Spanish (Mexican) */
  163. #define SUBLANG_SPANISH_MODERN 0x03 /* Spanish (Modern) */
  164. /*
  165. * Country Codes.
  166. */
  167. #define CTRY_DEFAULT 0
  168. #define CTRY_AUSTRALIA 61 /* Australia */
  169. #define CTRY_AUSTRIA 43 /* Austria */
  170. #define CTRY_BELGIUM 32 /* Belgium */
  171. #define CTRY_BRAZIL 55 /* Brazil */
  172. #define CTRY_CANADA 2 /* Canada */
  173. #define CTRY_DENMARK 45 /* Denmark */
  174. #define CTRY_FINLAND 358 /* Finland */
  175. #define CTRY_FRANCE 33 /* France */
  176. #define CTRY_GERMANY 49 /* Germany */
  177. #define CTRY_ICELAND 354 /* Iceland */
  178. #define CTRY_IRELAND 353 /* Ireland */
  179. #define CTRY_ITALY 39 /* Italy */
  180. #define CTRY_JAPAN 81 /* Japan */
  181. #define CTRY_MEXICO 52 /* Mexico */
  182. #define CTRY_NETHERLANDS 31 /* Netherlands */
  183. #define CTRY_NEW_ZEALAND 64 /* New Zealand */
  184. #define CTRY_NORWAY 47 /* Norway */
  185. #define CTRY_PORTUGAL 351 /* Portugal */
  186. #define CTRY_PRCHINA 86 /* PR China */
  187. #define CTRY_KOREA 82 /* Korea */
  188. #define CTRY_SPAIN 34 /* Spain */
  189. #define CTRY_SWEDEN 46 /* Sweden */
  190. #define CTRY_SWITZERLAND 41 /* Switzerland */
  191. #define CTRY_TAIWAN 886 /* Taiwan */
  192. #define CTRY_UNITED_KINGDOM 44 /* United Kingdom */
  193. #define CTRY_UNITED_STATES 1 /* United States */
  194. /*
  195. * Locale Types.
  196. *
  197. * These types are used for the GetLocaleInfoA NLS API routine.
  198. */
  199. #define LOCALE_ILANGUAGE 0x0001 /* language id */
  200. #define LOCALE_SLANGUAGE 0x0002 /* localized name of language */
  201. #define LOCALE_SENGLANGUAGE 0x1001 /* English name of language */
  202. #define LOCALE_SABBREVLANGNAME 0x0003 /* abbreviated language name */
  203. #define LOCALE_SNATIVELANGNAME 0x0004 /* native name of language */
  204. #define LOCALE_ICOUNTRY 0x0005 /* country code */
  205. #define LOCALE_SCOUNTRY 0x0006 /* localized name of country */
  206. #define LOCALE_SENGCOUNTRY 0x1002 /* English name of country */
  207. #define LOCALE_SABBREVCTRYNAME 0x0007 /* abbreviated country name */
  208. #define LOCALE_SNATIVECTRYNAME 0x0008 /* native name of country */
  209. #define LOCALE_IDEFAULTLANGUAGE 0x0009 /* default language id */
  210. #define LOCALE_IDEFAULTCOUNTRY 0x000A /* default country code */
  211. #define LOCALE_IDEFAULTCODEPAGE 0x000B /* default code page */
  212. #define LOCALE_SLIST 0x000C /* list item separator */
  213. #define LOCALE_IMEASURE 0x000D /* 0 = metric, 1 = US */
  214. #define LOCALE_SDECIMAL 0x000E /* decimal separator */
  215. #define LOCALE_STHOUSAND 0x000F /* thousand separator */
  216. #define LOCALE_SGROUPING 0x0010 /* digit grouping */
  217. #define LOCALE_IDIGITS 0x0011 /* number of fractional digits */
  218. #define LOCALE_ILZERO 0x0012 /* leading zeros for decimal */
  219. #define LOCALE_SNATIVEDIGITS 0x0013 /* native ascii 0-9 */
  220. #define LOCALE_SCURRENCY 0x0014 /* local monetary symbol */
  221. #define LOCALE_SINTLSYMBOL 0x0015 /* intl monetary symbol */
  222. #define LOCALE_SMONDECIMALSEP 0x0016 /* monetary decimal separator */
  223. #define LOCALE_SMONTHOUSANDSEP 0x0017 /* monetary thousand separator */
  224. #define LOCALE_SMONGROUPING 0x0018 /* monetary grouping */
  225. #define LOCALE_ICURRDIGITS 0x0019 /* # local monetary digits */
  226. #define LOCALE_IINTLCURRDIGITS 0x001A /* # intl monetary digits */
  227. #define LOCALE_ICURRENCY 0x001B /* positive currency mode */
  228. #define LOCALE_INEGCURR 0x001C /* negative currency mode */
  229. #define LOCALE_SDATE 0x001D /* date separator */
  230. #define LOCALE_STIME 0x001E /* time separator */
  231. #define LOCALE_SSHORTDATE 0x001F /* short date-time separator */
  232. #define LOCALE_SLONGDATE 0x0020 /* long date-time separator */
  233. #define LOCALE_IDATE 0x0021 /* short date format ordering */
  234. #define LOCALE_ILDATE 0x0022 /* long date format ordering */
  235. #define LOCALE_ITIME 0x0023 /* time format specifier */
  236. #define LOCALE_ICENTURY 0x0024 /* century format specifier */
  237. #define LOCALE_ITLZERO 0x0025 /* leading zeros in time field */
  238. #define LOCALE_IDAYLZERO 0x0026 /* leading zeros in day field */
  239. #define LOCALE_IMONLZERO 0x0027 /* leading zeros in month field */
  240. #define LOCALE_S1159 0x0028 /* AM designator */
  241. #define LOCALE_S2359 0x0029 /* PM designator */
  242. #define LOCALE_SDAYNAME1 0x002A /* long name for Monday */
  243. #define LOCALE_SDAYNAME2 0x002B /* long name for Tuesday */
  244. #define LOCALE_SDAYNAME3 0x002C /* long name for Wednesday */
  245. #define LOCALE_SDAYNAME4 0x002D /* long name for Thursday */
  246. #define LOCALE_SDAYNAME5 0x002E /* long name for Friday */
  247. #define LOCALE_SDAYNAME6 0x002F /* long name for Saturday */
  248. #define LOCALE_SDAYNAME7 0x0030 /* long name for Sunday */
  249. #define LOCALE_SABBREVDAYNAME1 0x0031 /* abbreviated name for Monday */
  250. #define LOCALE_SABBREVDAYNAME2 0x0032 /* abbreviated name for Tuesday */
  251. #define LOCALE_SABBREVDAYNAME3 0x0033 /* abbreviated name for Wednesday */
  252. #define LOCALE_SABBREVDAYNAME4 0x0034 /* abbreviated name for Thursday */
  253. #define LOCALE_SABBREVDAYNAME5 0x0035 /* abbreviated name for Friday */
  254. #define LOCALE_SABBREVDAYNAME6 0x0036 /* abbreviated name for Saturday */
  255. #define LOCALE_SABBREVDAYNAME7 0x0037 /* abbreviated name for Sunday */
  256. #define LOCALE_SMONTHNAME1 0x0038 /* long name for January */
  257. #define LOCALE_SMONTHNAME2 0x0039 /* long name for February */
  258. #define LOCALE_SMONTHNAME3 0x003A /* long name for March */
  259. #define LOCALE_SMONTHNAME4 0x003B /* long name for April */
  260. #define LOCALE_SMONTHNAME5 0x003C /* long name for May */
  261. #define LOCALE_SMONTHNAME6 0x003D /* long name for June */
  262. #define LOCALE_SMONTHNAME7 0x003E /* long name for July */
  263. #define LOCALE_SMONTHNAME8 0x003F /* long name for August */
  264. #define LOCALE_SMONTHNAME9 0x0040 /* long name for September */
  265. #define LOCALE_SMONTHNAME10 0x0041 /* long name for October */
  266. #define LOCALE_SMONTHNAME11 0x0042 /* long name for November */
  267. #define LOCALE_SMONTHNAME12 0x0043 /* long name for December */
  268. #define LOCALE_SABBREVMONTHNAME1 0x0044 /* abbreviated name for January */
  269. #define LOCALE_SABBREVMONTHNAME2 0x0045 /* abbreviated name for February */
  270. #define LOCALE_SABBREVMONTHNAME3 0x0046 /* abbreviated name for March */
  271. #define LOCALE_SABBREVMONTHNAME4 0x0047 /* abbreviated name for April */
  272. #define LOCALE_SABBREVMONTHNAME5 0x0048 /* abbreviated name for May */
  273. #define LOCALE_SABBREVMONTHNAME6 0x0049 /* abbreviated name for June */
  274. #define LOCALE_SABBREVMONTHNAME7 0x004A /* abbreviated name for July */
  275. #define LOCALE_SABBREVMONTHNAME8 0x004B /* abbreviated name for August */
  276. #define LOCALE_SABBREVMONTHNAME9 0x004C /* abbreviated name for September */
  277. #define LOCALE_SABBREVMONTHNAME10 0x004D /* abbreviated name for October */
  278. #define LOCALE_SABBREVMONTHNAME11 0x004E /* abbreviated name for November */
  279. #define LOCALE_SABBREVMONTHNAME12 0x004F /* abbreviated name for December */
  280. #define LOCALE_SPOSITIVESIGN 0x0050 /* positive sign */
  281. #define LOCALE_SNEGATIVESIGN 0x0051 /* negative sign */
  282. #define LOCALE_IPOSSIGNPOSN 0x0052 /* positive sign position */
  283. #define LOCALE_INEGSIGNPOSN 0x0053 /* negative sign position */
  284. #define LOCALE_IPOSSYMPRECEDES 0x0054 /* mon sym precedes pos amt */
  285. #define LOCALE_IPOSSEPBYSPACE 0x0055 /* mon sym sep by space from pos */
  286. #define LOCALE_INEGSYMPRECEDES 0x0056 /* mon sym precedes neg amt */
  287. #define LOCALE_INEGSEPBYSPACE 0x0057 /* mon sym sep by space from neg */
  288. #define LOCALE_NOUSEROVERRIDE 0x80000000 /* OR in to avoid user override */
  289. /***************************************************************************\
  290. * Typedefs
  291. *
  292. * Define all types for the NLS component here.
  293. \***************************************************************************/
  294. /*
  295. * IDs.
  296. */
  297. typedef DWORD LCID; /* locale ID */
  298. typedef WORD LANGID; /* language ID */
  299. typedef DWORD LCTYPE; /* locale type constant */
  300. #define _LCID_DEFINED
  301. /***************************************************************************\
  302. * Macros
  303. *
  304. * Define all macros for the NLS component here.
  305. \***************************************************************************/
  306. /*
  307. * A language ID is a 16 bit value which is the combination of a
  308. * primary language ID and a secondary language ID. The bits are
  309. * allocated as follows:
  310. *
  311. * +-----------------------+-------------------------+
  312. * | Sublanguage ID | Primary Language ID |
  313. * +-----------------------+-------------------------+
  314. * 15 10 9 0 bit
  315. *
  316. *
  317. * Language ID creation/extraction macros:
  318. *
  319. * MAKELANGID - construct language id from primary language id and
  320. * sublanguage id.
  321. * PRIMARYLANGID - extract primary language id from a language id.
  322. * SUBLANGID - extract sublanguage id from a language id.
  323. */
  324. #define MAKELANGID(p, s) ((((WORD)(s)) << 10) | (WORD)(p))
  325. #define PRIMARYLANGID(lgid) ((WORD)(lgid) & 0x3ff)
  326. #define SUBLANGID(lgid) ((WORD)(lgid) >> 10)
  327. /*
  328. * A locale ID is a 32 bit value which is the combination of a
  329. * language ID and a reserved area. The bits are allocated as follows:
  330. *
  331. * +-----------------------+-------------------------+
  332. * | Reserved | Language ID |
  333. * +-----------------------+-------------------------+
  334. * 31 16 15 0 bit
  335. *
  336. *
  337. * Locale ID creation macro:
  338. *
  339. * MAKELCID - construct locale id from a language id.
  340. */
  341. #define MAKELCID(lgid) ((DWORD)(((WORD)(lgid)) | (((DWORD)((WORD)(0))) << 16)))
  342. /*
  343. * Get the language id from a locale id.
  344. */
  345. #define LANGIDFROMLCID(lcid) ((WORD)(lcid))
  346. /*
  347. * Default System and User IDs for language and locale.
  348. */
  349. #define LANG_SYSTEM_DEFAULT (MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT))
  350. #define LANG_USER_DEFAULT (MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT))
  351. #define LOCALE_SYSTEM_DEFAULT (MAKELCID(LANG_SYSTEM_DEFAULT))
  352. #define LOCALE_USER_DEFAULT (MAKELCID(LANG_USER_DEFAULT))
  353. /***************************************************************************\
  354. * Function Prototypes
  355. *
  356. * Only prototypes for the NLS APIs should go here.
  357. \***************************************************************************/
  358. int WINAPI CompareStringA(LCID, DWORD, LPCSTR, int, LPCSTR, int);
  359. int WINAPI LCMapStringA(LCID, DWORD, LPCSTR, int, LPSTR, int);
  360. int WINAPI GetLocaleInfoA(LCID, LCTYPE, LPSTR, int);
  361. BOOL WINAPI GetStringTypeA(LCID, DWORD, LPCSTR, int, LPWORD);
  362. LANGID WINAPI GetSystemDefaultLangID(void);
  363. LANGID WINAPI GetUserDefaultLangID(void);
  364. LCID WINAPI GetSystemDefaultLCID(void);
  365. LCID WINAPI GetUserDefaultLCID(void);
  366. #ifdef __cplusplus
  367. }
  368. #endif // __cpluscplus
  369. #endif // NONLS
  370. #endif // _OLENLS_