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

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:  */
                     35: #define MAX_LANG_LEN         255            /* maximum language length */
                     36: #define MAX_CTRY_LEN         255            /* maximum country length */
                     37: #define MAX_CP_LEN           255            /* maximum codepage length */
                     38: 
                     39: 
                     40: /*
                     41:  *  MBCS and Unicode Translation Flags.
                     42:  */
                     43: #define MB_PRECOMPOSED       0x00000001     /* use precomposed chars */
                     44: #define MB_COMPOSITE         0x00000002     /* use composite chars */
                     45: 
                     46: #define WC_DISCARDNS         0x00000010     /* discard non-spacing chars */
                     47: #define WC_SEPCHARS          0x00000020     /* generate seperate chars */
                     48: #define WC_REPLACEBASE       0x00000040     /* replace base char w/ default */
                     49: 
                     50: 
                     51: /*
                     52:  *  Character Type Flags.
                     53:  */
                     54: #define CT_CTYPE1            0x00000001     /* ctype 1 information */
                     55: #define CT_CTYPE2            0x00000002     /* ctype 2 information */
                     56: 
                     57: /*
                     58:  *  CType 1 Flag Bits.
                     59:  */
                     60: #define C1_UPPERCASE         0x0001         /* upper case */
                     61: #define C1_LOWERCASE         0x0002         /* lower case */
                     62: #define C1_DIGIT             0x0004         /* 0-9 */
                     63: #define C1_WHITESPACE        0x0008         /* tab,CR,NL,vertical tab,form feed */
                     64: #define C1_PUNCTUATION       0x0010         /* punctuation character */
                     65: #define C1_CONTROLCHAR       0x0020         /* control character */
                     66: #define C1_ALPHA             0x0100         /* A-Z, a-z */
                     67: #define C1_NONSPACING        0x0200         /* nonspacing character */
                     68: #define C1_SYMBOL            0x0400         /* ! @ # $ % ^ & * ( ) etc. */
                     69: #define C1_ISNUMERIC         0x0800         /* numeric value */
                     70: 
                     71: /*
                     72:  *  CType 2 Flag Bits.
                     73:  */
                     74: #define C2_LEFTTORIGHT       0x0001         /* left to right */
                     75: #define C2_RIGHTTOLEFT       0x0002         /* right to left */
                     76: 
                     77: #define C2_EUROPENUMBER      0x0004         /* European number, digit */
                     78: #define C2_EUROPESEPERATOR   0x0008         /* European numeric seperator */
                     79: #define C2_EUROPETERMINATOR  0x0010         /* European numeric terminator */
                     80: #define C2_ARABICNUMBER      0x0020         /* Arabic number */
                     81: #define C2_COMMONSEPERATOR   0x0040         /* common numeric seperator */
                     82: 
                     83: #define C2_BLOCKSEPERATOR    0x0080         /* block seperator paragraph */
                     84: #define C2_SEGMENTSEPERATOR  0x0100         /* segment seperator */
                     85: #define C2_WHITESPACE        0x0200         /* white space */
                     86: #define C2_OTHERNEUTRAL      0x0400         /* other neutrals */
                     87: 
                     88: 
                     89: /*
                     90:  *  String Flags.
                     91:  */
                     92: #define STR_IGNORECASE       0x00000001     /* ignore case */
                     93: #define STR_IGNORENONSPACE   0x00000002     /* ignore nonspacing chars */
                     94: #define STR_IGNORESYMBOLS    0x00000004     /* ignore symbols */
                     95: 
                     96: /*
                     97:  *  Mapping Flags.
                     98:  */
                     99: #define MAP_UPPERCASE        0x00000010     /* upper case letters */
                    100: #define MAP_LOWERCASE        0x00000020     /* lower case letters */
                    101: #define MAP_CTYPE1           0x00000040     /* ctype 1 info */
                    102: #define MAP_CTYPE2           0x00000080     /* ctype 2 info */
                    103: 
                    104: #define MAP_COLLATE          0x00000100     /* collation (sort) table */
                    105: #define MAP_SORTKEY          0x00000200     /* sort key */
                    106: 
                    107: #define MAP_UCTOMB           0x00000400     /* UC to MB table */
                    108: #define MAP_MBTOUC           0x00000800     /* MB to UC table */
                    109: 
                    110: #define MAP_FOLDCZONE        0x00001000     /* fold compatibility zone chars */
                    111: #define MAP_PRECOMPOSED      0x00002000     /* accented to precomposed chars */
                    112: #define MAP_COMPOSITE        0x00004000     /* accented to composite chars */
                    113: #define MAP_ASCIIDIGITS      0x00008000     /* all digits to ASCII 0-9 */
                    114: 
                    115: 
                    116: /*
                    117:  *  Locale Information Flags.
                    118:  */
                    119: #define LI_CPDATA            0x00000001     /* code page data */
                    120: #define LI_CTRYDATA          0x00000002     /* country data */
                    121: #define LI_LANGDATA          0x00000004     /* language data */
                    122: #define LI_LCMONETARY        0x00000008     /* monetary conventions */
                    123: #define LI_LCNUMERIC         0x00000010     /* numeric conventions */
                    124: #define LI_DATETIMEFMT       0x00000020     /* date/time formats */
                    125: #define LI_DATETIMESTR       0x00000040     /* date/time strings */
                    126: 
                    127: 
                    128: /*
                    129:  *  Qualified Locale Flags.
                    130:  */
                    131: #define QF_LCID              0x00000001     /* LCID structure */
                    132: #define QF_STRINGS           0x00000002     /* LCSTRINGS structure */
                    133: 
                    134: 
                    135: /*
                    136:  *  Language IDs.
                    137:  *
                    138:  *  The following two combinations of primary language ID and
                    139:  *  sublanguage ID have special semantics: 
                    140:  *
                    141:  *    Primary Language ID   Sublanguage ID      Result
                    142:  *    -------------------   ---------------     ------------------------
                    143:  *    LANG_NEUTRAL          SUBLANG_NEUTRAL     Language neutral
                    144:  *    LANG_NEUTRAL          SUBLANG_DEFAULT     Process default language
                    145:  */
                    146: 
                    147: /*
                    148:  *  Primary language IDs.
                    149:  */
                    150: #define LANG_NEUTRAL                     0x00
                    151: 
                    152: #define LANG_ALBANIAN                    0x1c
                    153: #define LANG_ARABIC                      0x01
                    154: #define LANG_BAHASA                      0x21
                    155: #define LANG_BULGARIAN                   0x02
                    156: #define LANG_CATALAN                     0x03
                    157: #define LANG_CHINESE                     0x04
                    158: #define LANG_CZECH                       0x05
                    159: #define LANG_DANISH                      0x06
                    160: #define LANG_DUTCH                       0x13
                    161: #define LANG_ENGLISH                     0x09
                    162: #define LANG_FINNISH                     0x0b
                    163: #define LANG_FRENCH                      0x0c
                    164: #define LANG_GERMAN                      0x07
                    165: #define LANG_GREEK                       0x08
                    166: #define LANG_HEBREW                      0x0d
                    167: #define LANG_HUNGARIAN                   0x0e
                    168: #define LANG_ICELANDIC                   0x0f
                    169: #define LANG_ITALIAN                     0x10
                    170: #define LANG_JAPANESE                    0x11
                    171: #define LANG_KOREAN                      0x12
                    172: #define LANG_NORWEGIAN                   0x14
                    173: #define LANG_POLISH                      0x15
                    174: #define LANG_PORTUGUESE                  0x16
                    175: #define LANG_RHAETO_ROMAN                0x17
                    176: #define LANG_ROMANIAN                    0x18
                    177: #define LANG_RUSSIAN                     0x19
                    178: #define LANG_SERBO_CROATIAN              0x1a
                    179: #define LANG_SLOVAK                      0x1b
                    180: #define LANG_SPANISH                     0x0a
                    181: #define LANG_SWEDISH                     0x1d
                    182: #define LANG_THAI                        0x1e
                    183: #define LANG_TURKISH                     0x1f
                    184: #define LANG_URDU                        0x20
                    185: 
                    186: /*
                    187:  *  Sublanguage IDs.
                    188:  *
                    189:  *  The name immediately following SUBLANG_ dictates which primary
                    190:  *  language ID that sublanguage ID can be combined with to form a
                    191:  *  valid language ID.
                    192:  */
                    193: #define SUBLANG_DEFAULT                  0x01    /* language/process default */
                    194: #define SUBLANG_NEUTRAL                  0x00    /* language neutral */
                    195: 
                    196: #define SUBLANG_CHINESE_SIMPLIFIED       0x02    /* Chinese (Simplified) */
                    197: #define SUBLANG_CHINESE_TRADITIONAL      0x01    /* Chinese (Traditional) */ 
                    198: #define SUBLANG_DUTCH                    0x01    /* Dutch */
                    199: #define SUBLANG_DUTCH_BELGIAN            0x02    /* Dutch (Belgian) */
                    200: #define SUBLANG_ENGLISH_US               0x01    /* English (USA) */
                    201: #define SUBLANG_ENGLISH_UK               0x02    /* English (UK) */
                    202: #define SUBLANG_ENGLISH_AUS              0x03    /* English (Australian) */
                    203: #define SUBLANG_ENGLISH_CAN              0x04    /* English (Canadian) */
                    204: #define SUBLANG_FRENCH                   0x01    /* French */
                    205: #define SUBLANG_FRENCH_BELGIAN           0x02    /* French (Belgian) */
                    206: #define SUBLANG_FRENCH_CANADIAN          0x03    /* French (Canadian) */
                    207: #define SUBLANG_FRENCH_SWISS             0x04    /* French (Swiss) */
                    208: #define SUBLANG_GERMAN                   0x01    /* German */
                    209: #define SUBLANG_GERMAN_SWISS             0x02    /* German (Swiss) */
                    210: #define SUBLANG_ITALIAN                  0x01    /* Italian */
                    211: #define SUBLANG_ITALIAN_SWISS            0x02    /* Italian (Swiss) */
                    212: #define SUBLANG_NORWEGIAN_BOKMAL         0x01    /* Norwegian (Bokmal) */
                    213: #define SUBLANG_NORWEGIAN_NYNORSK        0x02    /* Norwegian (Nynorsk) */
                    214: #define SUBLANG_PORTUGUESE               0x02    /* Portuguese */
                    215: #define SUBLANG_PORTUGUESE_BRAZILIAN     0x01    /* Portuguese (Brazilian) */
                    216: #define SUBLANG_SERBO_CROATIAN_CYRILLIC  0x02    /* Serbo-Croatian (Cyrillic) */
                    217: #define SUBLANG_SERBO_CROATIAN_LATIN     0x01    /* Croato-Serbian (Latin) */
                    218: #define SUBLANG_SPANISH                  0x01    /* Spanish */
                    219: #define SUBLANG_SPANISH_MEXICAN          0x02    /* Spanish (Mexican) */
                    220: #define SUBLANG_SPANISH_MODERN           0x03    /* Spanish (Modern) */
                    221: 
                    222: 
                    223: 
                    224: /***************************************************************************\
                    225: * Typedefs
                    226: *
                    227: * Define all types for the NLS component here.
                    228: \***************************************************************************/
                    229: 
                    230: /*
                    231:  *  Handles.
                    232:  */
                    233: typedef HANDLE     HLOCALE;                 /* locale handle */
                    234: typedef HANDLE     HLCID;                   /* lcid handle */
                    235: 
                    236: 
                    237: /*
                    238:  *  Locale ID.
                    239:  */
                    240: typedef struct _lcid {
                    241:     WORD wLanguage;                         /* language id */
                    242:     UINT Country;                           /* country id */ 
                    243:     UINT CodePage;                          /* codepage id */
                    244: } LCID, *LPLCID;
                    245: 
                    246: 
                    247: /*
                    248:  *  Locale Strings.
                    249:  */
                    250: typedef struct _lcstrings {
                    251:     CHAR szLanguage[MAX_LANG_LEN];          /* language name */
                    252:     CHAR szCountry[MAX_CTRY_LEN];           /* country name */
                    253:     CHAR szCodePage[MAX_CP_LEN];            /* codepage name */
                    254: } LCSTRINGS, *LPLCSTRINGS;
                    255: 
                    256: 
                    257: 
                    258: /***************************************************************************\
                    259: * Macros
                    260: *
                    261: * Define all macros for the NLS component here.
                    262: \***************************************************************************/
                    263: 
                    264: /*
                    265:  *  A language ID is a 16 bit value which is the combination of a
                    266:  *  primary language ID and a secondary language ID.  The bits are
                    267:  *  allocated as follows:
                    268:  *
                    269:  *       +-----------------------+-------------------------+
                    270:  *       |      Sublanguage ID   |   Primary Language ID   |
                    271:  *       +-----------------------+-------------------------+
                    272:  *        15                   10 9                       0   bit
                    273:  */
                    274: 
                    275: /*
                    276:  *  Language ID creation/extraction macros:
                    277:  *
                    278:  *    MAKELANGID - construct language id from primary language id and
                    279:  *                 sublanguage id.
                    280:  *    PRIMARYLANGID - extract primary language id from a language id.
                    281:  *    SUBLANGID - extract sublanguage id from a language id.
                    282:  */
                    283: #define MAKELANGID(p, s)     ((((USHORT)(s)) << 10) | (USHORT)(p))
                    284: #define PRIMARYLANGID(lgid)  ((USHORT)(lgid) & 0x1ff)
                    285: #define SUBLANGID(lgid)      ((USHORT)(lgid) >> 10)
                    286: 
                    287: 
                    288: 
                    289: /***************************************************************************\
                    290: * Function Prototypes
                    291: *
                    292: * Only prototypes for the NLS APIs should go here.
                    293: \***************************************************************************/
                    294: 
                    295: /*
                    296:  *  MBCS Translation APIs.
                    297:  */
                    298: int     APIENTRY MultiByteToWideChar(UINT, LPSTR, int, LPWSTR, int *, DWORD);
                    299: int     APIENTRY WideCharToMultiByte(UINT, LPWSTR, int, LPSTR, int *, LPSTR,
                    300:                                      LPBOOL, DWORD);
                    301: int     APIENTRY MultiByteToMultiByte(UINT, UINT, LPSTR, int, UINT, LPSTR,
                    302:                                       int *);
                    303: int     APIENTRY GetDBCSLeadBytes(UINT, UINT *, LPBYTE, int *);
                    304: 
                    305: 
                    306: /*
                    307:  *  High Level APIs.
                    308:  */
                    309: HLOCALE APIENTRY OpenLocale(LPLCID);
                    310: BOOL    APIENTRY CloseLocale(HLOCALE);
                    311: BOOL    APIENTRY GetCharType(HLOCALE, DWORD, WCHAR, LPWORD);
                    312: int     APIENTRY CompareString(HLOCALE, DWORD, LPWSTR, int, LPWSTR, int);
                    313: int     APIENTRY MapString(HLOCALE, DWORD, LPWSTR, int, LPWSTR, int *);
                    314: int     APIENTRY QueryMap(HLOCALE, DWORD, DWORD, WCHAR, WCHAR, LPVOID, LPDWORD);
                    315: 
                    316: 
                    317: /*
                    318:  *  Low Level APIs.
                    319:  */
                    320: HLCID APIENTRY BeginEnumLocale(DWORD, LPLCID);
                    321: BOOL  APIENTRY GetNextLocale(HLCID, LPLCID);
                    322: BOOL  APIENTRY EndEnumLocale(HLCID);
                    323: int   APIENTRY GetLocaleInfo(LPLCID, DWORD, LPVOID, LPDWORD);
                    324: BOOL  APIENTRY GetQualifiedLocale(DWORD, LPVOID, LPLCID, LPLCSTRINGS);
                    325: 
                    326: 
                    327: 
                    328: #endif   // NONLS
                    329: 
                    330: #endif   // _WINNLS_

unix.superglobalmegacorp.com

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