home *** CD-ROM | disk | FTP | other *** search
/ C Programming Starter Kit 2.0 / SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso / bc45 / msinc.pak / OLENLS.H < prev    next >
C/C++ Source or Header  |  1997-07-23  |  22KB  |  510 lines

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