home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c083 / 14.ddi / GENINC.PAK / WINNLS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-02  |  18.8 KB  |  531 lines

  1. /*++ BUILD Version: 0003    // Increment this if a change has global effects
  2.  
  3. Copyright (c) 1991, Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     winnls.h
  8.  
  9. Abstract:
  10.  
  11.     Procedure declarations, constant definitions, and macros for the
  12.     NLS component.
  13.  
  14. Author:
  15.  
  16.     Julie Bennett (julieb) 31-May-1991
  17.  
  18. --*/
  19.  
  20. #ifndef __WINNLS_H
  21. #define __WINNLS_H
  22.  
  23.  
  24. #ifndef __WINDEF_H
  25. #include <windef.h>
  26. #endif
  27.  
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31.  
  32. #ifndef NONLS
  33.  
  34.  
  35. /***************************************************************************\
  36. * Constants
  37. *
  38. * Define all constants for the NLS component here.
  39. \***************************************************************************/
  40.  
  41. /*
  42.  *  String Length Maximums.
  43.  */
  44. #define MAX_LEADBYTES        12             /* 5 ranges, 2 bytes ea., 0 term. */
  45. #define MAX_DEFAULTCHAR      2              /* single or double byte */
  46.  
  47.  
  48. /*
  49.  *  MBCS and Unicode Translation Flags.
  50.  */
  51. #define MB_PRECOMPOSED       0x00000001     /* use precomposed chars */
  52. #define MB_COMPOSITE         0x00000002     /* use composite chars */
  53. #define MB_USEGLYPHCHARS     0x00000004     /* use glyph chars, not ctrl chars */
  54.  
  55. #define WC_DEFAULTCHECK      0x00000100     /* check for default char */
  56. #define WC_COMPOSITECHECK    0x00000200     /* convert composite to precomposed */
  57. #define WC_DISCARDNS         0x00000010     /* discard non-spacing chars */
  58. #define WC_SEPCHARS          0x00000020     /* generate separate chars */
  59. #define WC_DEFAULTCHAR       0x00000040     /* replace w/ default char */
  60.  
  61.  
  62.  
  63. /*
  64.  *  Character Type Flags.
  65.  */
  66. #define CT_CTYPE1            0x00000001     /* ctype 1 information */
  67. #define CT_CTYPE2            0x00000002     /* ctype 2 information */
  68. #define CT_CTYPE3            0x00000004     /* ctype 3 information */
  69.  
  70. /*
  71.  *  CType 1 Flag Bits.
  72.  */
  73. #define C1_UPPER             0x0001         /* upper case */
  74. #define C1_LOWER             0x0002         /* lower case */
  75. #define C1_DIGIT             0x0004         /* decimal digits */
  76. #define C1_SPACE             0x0008         /* spacing characters */
  77. #define C1_PUNCT             0x0010         /* punctuation characters */
  78. #define C1_CNTRL             0x0020         /* control characters */
  79. #define C1_BLANK             0x0040         /* blank characters */
  80. #define C1_XDIGIT            0x0080         /* other digits */
  81. #define C1_ALPHA             0x0100         /* any letter */
  82.  
  83. /*
  84.  *  CType 2 Flag Bits.
  85.  */
  86. #define C2_LEFTTORIGHT       0x0001         /* left to right */
  87. #define C2_RIGHTTOLEFT       0x0002         /* right to left */
  88.  
  89. #define C2_EUROPENUMBER      0x0003         /* European number, digit */
  90. #define C2_EUROPESEPARATOR   0x0004         /* European numeric separator */
  91. #define C2_EUROPETERMINATOR  0x0005         /* European numeric terminator */
  92. #define C2_ARABICNUMBER      0x0006         /* Arabic number */
  93. #define C2_COMMONSEPARATOR   0x0007         /* common numeric separator */
  94.  
  95. #define C2_BLOCKSEPARATOR    0x0008         /* block separator */
  96. #define C2_SEGMENTSEPARATOR  0x0009         /* segment separator */
  97. #define C2_WHITESPACE        0x000A         /* white space */
  98. #define C2_OTHERNEUTRAL      0x000B         /* other neutrals */
  99.  
  100. #define C2_NOTAPPLICABLE     0x0000         /* no implicit directionality */
  101.  
  102. /*
  103.  *  CType 3 Flag Bits.
  104.  */
  105. #define C3_NONSPACING        0x0001         /* nonspacing character */
  106. #define C3_DIACRITIC         0x0002         /* diacritic mark */
  107. #define C3_VOWELMARK         0x0004         /* vowel mark */
  108. #define C3_SYMBOL            0x0008         /* symbols */
  109.  
  110. #define C3_NOTAPPLICABLE     0x0000         /* ctype 3 is not applicable */
  111.  
  112.  
  113. /*
  114.  *  String Flags.
  115.  */
  116. #define NORM_IGNORECASE      0x00000001     /* ignore case */
  117. #define NORM_IGNORENONSPACE  0x00000002     /* ignore nonspacing chars */
  118. #define NORM_IGNORESYMBOLS   0x00000004     /* ignore symbols */
  119.  
  120.  
  121. /*
  122.  *  Locale Independent Mapping Flags.
  123.  */
  124. #define MAP_FOLDCZONE        0x00000010     /* fold compatibility zone chars */
  125. #define MAP_PRECOMPOSED      0x00000020     /* convert to precomposed chars */
  126. #define MAP_COMPOSITE        0x00000040     /* convert to composite chars */
  127. #define MAP_FOLDDIGITS       0x00000080     /* all digits to ASCII 0-9 */
  128.  
  129.  
  130. /*
  131.  *  Locale Dependent Mapping Flags.
  132.  */
  133. #define LCMAP_LOWERCASE      0x00000100     /* lower case letters */
  134. #define LCMAP_UPPERCASE      0x00000200     /* upper case letters */
  135. #define LCMAP_SORTKEY        0x00000400     /* WC sort key (normalize) */
  136. #define LCMAP_BYTEREV        0x00000800     /* byte reversal */
  137.  
  138.  
  139. /*
  140.  *  Sorting Flags.
  141.  *
  142.  *    WORD Sort:    culturally correct sort
  143.  *                  hyphen and apostrophe are special cased
  144.  *                  example: "coop" and "co-op" will sort together in a list
  145.  *
  146.  *                        co_op     <-------  underscore (symbol)
  147.  *                        coat
  148.  *                        comb
  149.  *                        coop
  150.  *                        co-op     <-------  hyphen (punctuation)
  151.  *                        cork
  152.  *                        went
  153.  *                        were
  154.  *                        we're     <-------  apostrophe (punctuation)
  155.  *
  156.  *
  157.  *    STRING Sort:  hyphen and apostrophe will sort with all other symbols
  158.  *
  159.  *                        co-op     <-------  hyphen (punctuation)
  160.  *                        co_op     <-------  underscore (symbol)
  161.  *                        coat
  162.  *                        comb
  163.  *                        coop
  164.  *                        cork
  165.  *                        we're     <-------  apostrophe (punctuation)
  166.  *                        went
  167.  *                        were
  168.  */
  169. #define SORT_STRINGSORT      0x00001000     /* use string sort method */
  170.  
  171.  
  172. /*
  173.  *  Code Page Default Values.
  174.  */
  175. #define CP_ACP               0              /* default to ANSI code page */
  176. #define CP_OEMCP             1              /* default to OEM  code page */
  177.  
  178.  
  179. /*
  180.  *  Country Codes.
  181.  */
  182. #define CTRY_DEFAULT                     0
  183.  
  184. #define CTRY_AUSTRALIA                   61      /* Australia */
  185. #define CTRY_AUSTRIA                     43      /* Austria */
  186. #define CTRY_BELGIUM                     32      /* Belgium */
  187. #define CTRY_BRAZIL                      55      /* Brazil */
  188. #define CTRY_CANADA                      2       /* Canada */
  189. #define CTRY_DENMARK                     45      /* Denmark */
  190. #define CTRY_FINLAND                     358     /* Finland */
  191. #define CTRY_FRANCE                      33      /* France */
  192. #define CTRY_GERMANY                     49      /* Germany */
  193. #define CTRY_ICELAND                     354     /* Iceland */
  194. #define CTRY_IRELAND                     353     /* Ireland */
  195. #define CTRY_ITALY                       39      /* Italy */
  196. #define CTRY_JAPAN                       81      /* Japan */
  197. #define CTRY_MEXICO                      52      /* Mexico */
  198. #define CTRY_NETHERLANDS                 31      /* Netherlands */
  199. #define CTRY_NEW_ZEALAND                 64      /* New Zealand */
  200. #define CTRY_NORWAY                      47      /* Norway */
  201. #define CTRY_PORTUGAL                    351     /* Portugal */
  202. #define CTRY_PRCHINA                     86      /* PR China */
  203. #define CTRY_SOUTH_KOREA                 82      /* South Korea */
  204. #define CTRY_SPAIN                       34      /* Spain */
  205. #define CTRY_SWEDEN                      46      /* Sweden */
  206. #define CTRY_SWITZERLAND                 41      /* Switzerland */
  207. #define CTRY_TAIWAN                      886     /* Taiwan */
  208. #define CTRY_UNITED_KINGDOM              44      /* United Kingdom */
  209. #define CTRY_UNITED_STATES               1       /* United States */
  210.  
  211.  
  212. /*
  213.  *  Locale Types.
  214.  *
  215.  *  These types are used for the GetLocaleInfoW NLS API routine.
  216.  *
  217.  *  LOCALE_NOUSEROVERRIDE is also used in GetTimeFormatW and GetDateFormatW.
  218.  */
  219. #define LOCALE_NOUSEROVERRIDE      0x80000000  /* do not use user overrides */
  220.  
  221. #define LOCALE_ILANGUAGE           0x00000001  /* language id */
  222. #define LOCALE_SLANGUAGE           0x00000002  /* localized name of language */
  223. #define LOCALE_SENGLANGUAGE        0x00001001  /* English name of language */
  224. #define LOCALE_SABBREVLANGNAME     0x00000003  /* abbreviated language name */
  225. #define LOCALE_SNATIVELANGNAME     0x00000004  /* native name of language */
  226. #define LOCALE_ICOUNTRY            0x00000005  /* country code */
  227. #define LOCALE_SCOUNTRY            0x00000006  /* localized name of country */  
  228. #define LOCALE_SENGCOUNTRY         0x00001002  /* English name of country */  
  229. #define LOCALE_SABBREVCTRYNAME     0x00000007  /* abbreviated country name */
  230. #define LOCALE_SNATIVECTRYNAME     0x00000008  /* native name of country */  
  231. #define LOCALE_IDEFAULTLANGUAGE    0x00000009  /* default language id */
  232. #define LOCALE_IDEFAULTCOUNTRY     0x0000000A  /* default country code */
  233. #define LOCALE_IDEFAULTCODEPAGE    0x0000000B  /* default code page */
  234.                                            
  235. #define LOCALE_SLIST               0x0000000C  /* list item separator */
  236. #define LOCALE_IMEASURE            0x0000000D  /* 0 = metric, 1 = US */
  237.                                            
  238. #define LOCALE_SDECIMAL            0x0000000E  /* decimal separator */
  239. #define LOCALE_STHOUSAND           0x0000000F  /* thousand separator */
  240. #define LOCALE_SGROUPING           0x00000010  /* digit grouping */
  241. #define LOCALE_IDIGITS             0x00000011  /* number of fractional digits */
  242. #define LOCALE_ILZERO              0x00000012  /* leading zeros for decimal */
  243. #define LOCALE_SNATIVEDIGITS       0x00000013  /* native ascii 0-9 */
  244.                                            
  245. #define LOCALE_SCURRENCY           0x00000014  /* local monetary symbol */
  246. #define LOCALE_SINTLSYMBOL         0x00000015  /* intl monetary symbol */
  247. #define LOCALE_SMONDECIMALSEP      0x00000016  /* monetary decimal separator */
  248. #define LOCALE_SMONTHOUSANDSEP     0x00000017  /* monetary thousand separator */
  249. #define LOCALE_SMONGROUPING        0x00000018  /* monetary grouping */
  250. #define LOCALE_ICURRDIGITS         0x00000019  /* # local monetary digits */
  251. #define LOCALE_IINTLCURRDIGITS     0x0000001A  /* # intl monetary digits */
  252. #define LOCALE_ICURRENCY           0x0000001B  /* positive currency mode */
  253. #define LOCALE_INEGCURR            0x0000001C  /* negative currency mode */
  254.                                            
  255. #define LOCALE_SDATE               0x0000001D  /* date separator */
  256. #define LOCALE_STIME               0x0000001E  /* time separator */
  257. #define LOCALE_SSHORTDATE          0x0000001F  /* short date format string */
  258. #define LOCALE_SLONGDATE           0x00000020  /* long date format string */
  259. #define LOCALE_STIMEFORMAT         0x00001003  /* time format string */
  260. #define LOCALE_IDATE               0x00000021  /* short date format ordering */
  261. #define LOCALE_ILDATE              0x00000022  /* long date format ordering */
  262. #define LOCALE_ITIME               0x00000023  /* time format specifier */
  263. #define LOCALE_ICENTURY            0x00000024  /* century format specifier */
  264. #define LOCALE_ITLZERO             0x00000025  /* leading zeros in time field */
  265. #define LOCALE_IDAYLZERO           0x00000026  /* leading zeros in day field */
  266. #define LOCALE_IMONLZERO           0x00000027  /* leading zeros in month field */
  267. #define LOCALE_S1159               0x00000028  /* AM designator */
  268. #define LOCALE_S2359               0x00000029  /* PM designator */
  269.                                            
  270. #define LOCALE_SDAYNAME1           0x0000002A  /* long name for Monday */
  271. #define LOCALE_SDAYNAME2           0x0000002B  /* long name for Tuesday */
  272. #define LOCALE_SDAYNAME3           0x0000002C  /* long name for Wednesday */
  273. #define LOCALE_SDAYNAME4           0x0000002D  /* long name for Thursday */
  274. #define LOCALE_SDAYNAME5           0x0000002E  /* long name for Friday */
  275. #define LOCALE_SDAYNAME6           0x0000002F  /* long name for Saturday */
  276. #define LOCALE_SDAYNAME7           0x00000030  /* long name for Sunday */
  277. #define LOCALE_SABBREVDAYNAME1     0x00000031  /* abbreviated name for Monday */   
  278. #define LOCALE_SABBREVDAYNAME2     0x00000032  /* abbreviated name for Tuesday */  
  279. #define LOCALE_SABBREVDAYNAME3     0x00000033  /* abbreviated name for Wednesday */
  280. #define LOCALE_SABBREVDAYNAME4     0x00000034  /* abbreviated name for Thursday */ 
  281. #define LOCALE_SABBREVDAYNAME5     0x00000035  /* abbreviated name for Friday */   
  282. #define LOCALE_SABBREVDAYNAME6     0x00000036  /* abbreviated name for Saturday */ 
  283. #define LOCALE_SABBREVDAYNAME7     0x00000037  /* abbreviated name for Sunday */   
  284. #define LOCALE_SMONTHNAME1         0x00000038  /* long name for January */
  285. #define LOCALE_SMONTHNAME2         0x00000039  /* long name for February */
  286. #define LOCALE_SMONTHNAME3         0x0000003A  /* long name for March */
  287. #define LOCALE_SMONTHNAME4         0x0000003B  /* long name for April */
  288. #define LOCALE_SMONTHNAME5         0x0000003C  /* long name for May */
  289. #define LOCALE_SMONTHNAME6         0x0000003D  /* long name for June */
  290. #define LOCALE_SMONTHNAME7         0x0000003E  /* long name for July */
  291. #define LOCALE_SMONTHNAME8         0x0000003F  /* long name for August */
  292. #define LOCALE_SMONTHNAME9         0x00000040  /* long name for September */
  293. #define LOCALE_SMONTHNAME10        0x00000041  /* long name for October */
  294. #define LOCALE_SMONTHNAME11        0x00000042  /* long name for November */
  295. #define LOCALE_SMONTHNAME12        0x00000043  /* long name for December */
  296. #define LOCALE_SABBREVMONTHNAME1   0x00000044  /* abbreviated name for January */
  297. #define LOCALE_SABBREVMONTHNAME2   0x00000045  /* abbreviated name for February */
  298. #define LOCALE_SABBREVMONTHNAME3   0x00000046  /* abbreviated name for March */
  299. #define LOCALE_SABBREVMONTHNAME4   0x00000047  /* abbreviated name for April */
  300. #define LOCALE_SABBREVMONTHNAME5   0x00000048  /* abbreviated name for May */
  301. #define LOCALE_SABBREVMONTHNAME6   0x00000049  /* abbreviated name for June */
  302. #define LOCALE_SABBREVMONTHNAME7   0x0000004A  /* abbreviated name for July */
  303. #define LOCALE_SABBREVMONTHNAME8   0x0000004B  /* abbreviated name for August */
  304. #define LOCALE_SABBREVMONTHNAME9   0x0000004C  /* abbreviated name for September */
  305. #define LOCALE_SABBREVMONTHNAME10  0x0000004D  /* abbreviated name for October */
  306. #define LOCALE_SABBREVMONTHNAME11  0x0000004E  /* abbreviated name for November */
  307. #define LOCALE_SABBREVMONTHNAME12  0x0000004F  /* abbreviated name for December */
  308.                                            
  309. #define LOCALE_SPOSITIVESIGN       0x00000050  /* positive sign */
  310. #define LOCALE_SNEGATIVESIGN       0x00000051  /* negative sign */
  311. #define LOCALE_IPOSSIGNPOSN        0x00000052  /* positive sign position */
  312. #define LOCALE_INEGSIGNPOSN        0x00000053  /* negative sign position */
  313. #define LOCALE_IPOSSYMPRECEDES     0x00000054  /* mon sym precedes pos amt */
  314. #define LOCALE_IPOSSEPBYSPACE      0x00000055  /* mon sym sep by space from pos amt */ 
  315. #define LOCALE_INEGSYMPRECEDES     0x00000056  /* mon sym precedes neg amt */
  316. #define LOCALE_INEGSEPBYSPACE      0x00000057  /* mon sym sep by space from neg amt */
  317.  
  318.  
  319. /*
  320.  *  Time Flags for GetTimeFormatW.
  321.  */
  322. #define TIME_NOMINUTESORSECONDS    0x00000001  /* do not use minutes or seconds */
  323. #define TIME_NOSECONDS             0x00000002  /* do not use seconds */
  324. #define TIME_NOTIMEMARKER          0x00000004  /* do not use time marker */
  325. #define TIME_FORCE24HOURFORMAT     0x00000008  /* always use 24 hour format */
  326.  
  327.  
  328. /*
  329.  *  Date Flags for GetDateFormatW.
  330.  */
  331. #define DATE_SHORTDATE             0x00000001  /* use short date picture */
  332. #define DATE_LONGDATE              0x00000002  /* use long date picture */
  333.  
  334.  
  335.  
  336. /***************************************************************************\
  337. * Typedefs
  338. *
  339. * Define all types for the NLS component here.
  340. \***************************************************************************/
  341.  
  342. /*
  343.  *  Locale type constant
  344.  */
  345.  
  346. typedef DWORD LCTYPE;
  347.  
  348.  
  349. /*
  350.  *  CP Info.
  351.  */
  352. typedef struct _cpinfo {
  353.     UINT   MaxCharSize;                     /* max length (bytes) of a char */
  354.     BYTE   DefaultChar[MAX_DEFAULTCHAR];    /* default character */
  355.     BYTE   LeadByte[MAX_LEADBYTES];         /* lead byte ranges */
  356. } CPINFO, *LPCPINFO;
  357.  
  358.  
  359.  
  360. /***************************************************************************\
  361. * Macros
  362. *
  363. * Define all macros for the NLS component here.
  364. \***************************************************************************/
  365.  
  366.  
  367.  
  368. /***************************************************************************\
  369. * Function Prototypes
  370. *
  371. * Only prototypes for the NLS APIs should go here.
  372. \***************************************************************************/
  373.  
  374. /*
  375.  *  Code Page Dependent APIs.
  376.  */
  377. BOOL
  378. WINAPI
  379. IsValidCodePage(
  380.     UINT  CodePage);
  381.  
  382. UINT
  383. WINAPI
  384. GetACP(void);
  385.  
  386. UINT
  387. WINAPI
  388. GetOEMCP(void);
  389.  
  390. BOOL
  391. WINAPI
  392. GetCPInfo(
  393.     UINT      CodePage,
  394.     LPCPINFO  lpCPInfo);
  395.  
  396. BOOL
  397. WINAPI
  398. IsDBCSLeadByte(
  399.     BYTE  TestChar);
  400.  
  401. int
  402. WINAPI
  403. MultiByteToWideChar(
  404.     UINT    CodePage,
  405.     DWORD   dwFlags,
  406.     LPCSTR  lpMultiByteStr,
  407.     int     cchMultiByte,
  408.     LPWSTR  lpWideCharStr,
  409.     int     cchWideChar);
  410.  
  411. int
  412. WINAPI
  413. WideCharToMultiByte(
  414.     UINT     CodePage,
  415.     DWORD    dwFlags,
  416.     LPCWSTR  lpWideCharStr,
  417.     int      cchWideChar,
  418.     LPSTR    lpMultiByteStr,
  419.     int      cchMultiByte,
  420.     LPCSTR   lpDefaultChar,
  421.     LPBOOL   lpUsedDefaultChar);
  422.  
  423.  
  424. /*
  425.  *  Locale Dependent APIs.
  426.  */
  427. int
  428. WINAPI
  429. CompareStringW(
  430.     LCID     Locale,
  431.     DWORD    dwCmpFlags,
  432.     LPCWSTR  lpString1,
  433.     int      cchCount1,
  434.     LPCWSTR  lpString2,
  435.     int      cchCount2);
  436.  
  437. int
  438. WINAPI
  439. LCMapStringW(
  440.     LCID     Locale,
  441.     DWORD    dwMapFlags,
  442.     LPCWSTR  lpSrcStr,
  443.     int      cchSrc,
  444.     LPWSTR   lpDestStr,
  445.     int      cchDest);
  446.  
  447. int
  448. WINAPI
  449. GetLocaleInfoW(
  450.     LCID    Locale,
  451.     LCTYPE  LCType,
  452.     LPWSTR  lpLCData,
  453.     int     cchData);
  454.  
  455. int
  456. WINAPI
  457. GetTimeFormatW(
  458.     LCID Locale,
  459.     DWORD dwFlags,
  460.     CONST SYSTEMTIME *lpTime,
  461.     LPCWSTR lpFormat,
  462.     LPWSTR lpTimeStr,
  463.     int cchTime);
  464.  
  465. int
  466. WINAPI
  467. GetDateFormatW(
  468.     LCID Locale,
  469.     DWORD dwFlags,
  470.     CONST SYSTEMTIME *lpDate,
  471.     LPCWSTR lpFormat,
  472.     LPWSTR lpDateStr,
  473.     int cchDate);
  474.  
  475. LCID
  476. WINAPI
  477. GetThreadLocale(void);
  478.  
  479. BOOL
  480. WINAPI
  481. SetThreadLocale(
  482.     LCID Locale
  483.     );
  484.  
  485. LANGID
  486. WINAPI
  487. GetSystemDefaultLangID(void);
  488.  
  489. LANGID
  490. WINAPI
  491. GetUserDefaultLangID(void);
  492.  
  493. LCID
  494. WINAPI
  495. GetSystemDefaultLCID(void);
  496.  
  497. LCID
  498. WINAPI
  499. GetUserDefaultLCID(void);
  500.  
  501.  
  502. /*
  503.  *  Locale Independent APIs.
  504.  */
  505. BOOL
  506. WINAPI
  507. GetStringTypeW(
  508.     DWORD    dwInfoType,
  509.     LPCWSTR  lpSrcStr,
  510.     int      cchSrc,
  511.     LPWORD   lpCharType);
  512.  
  513. int
  514. WINAPI
  515. FoldStringW(
  516.     DWORD    dwMapFlags,
  517.     LPCWSTR  lpSrcStr,
  518.     int      cchSrc,
  519.     LPWSTR   lpDestStr,
  520.     int      cchDest);
  521.  
  522.  
  523.  
  524. #endif   // NONLS
  525.  
  526. #ifdef __cplusplus
  527. }
  528. #endif
  529.  
  530. #endif   // _WINNLS_
  531.