Annotation of mstools/h/winnls.h, revision 1.1.1.3

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

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.