home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / olenls.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  23KB  |  503 lines

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