windows-nt/Source/XPSP1/NT/base/fs/utils/ulib/inc/winnls.old
2020-09-26 16:20:57 +08:00

293 lines
4.5 KiB
Plaintext

/*++
Copyright (c) 1991 Microsoft Corporation
Module Name:
winnls.h
Abstract:
This module defines the 32-Bit Windows NLS APIs.
Author:
David J. Gilman (davegi) 22-Mar-1991
Revision History:
--*/
#ifndef _WINNLS_
#define _WINNLS_
//
// NLSAPI and wide character related types.
//
typedef char CHAR;
typedef PDWORD LPWCHAR;
typedef LPSTR LPCHAR;
typedef DWORD HLCID;
typedef DWORD HLOCALE;
//
// Length of locale strings.
//
#define MAX_LANG_LEN ( 128 )
#define MAX_CTRY_LEN ( 128 )
#define MAX_CP_LEN ( 128 )
//
// String based locale representation.
//
typedef struct tagLC_STRINGS {
CHAR szLanguage[MAX_LANG_LEN]; // language name
CHAR szCountry[MAX_CTRY_LEN]; // country name
CHAR szCodePage[MAX_CP_LEN]; // codepage name
} LC_STRINGS, *LPLC_STRINGS, *PLC_STRINGS;
//
// Code based local representation.
//
typedef struct tagLC_ID {
WORD wLanguage; // language id
WORD wCountry; // country id
WORD wCodePage; // codepage id
} LC_ID, *LPLC_ID, *PLC_ID;
//
// Locale information enumeration type.
//
#define LI_CPDATA ( 0 )
#define LI_CTRYDATA ( 1 )
#define LI_LANGDATA ( 2 )
//
// Locale information type.
//
#define LI_CPDATA ( 0 )
#define LI_CTRYDATA ( 1 )
#define LI_LANGDATA ( 2 )
#define LI_LCMONETARY ( 3 )
#define LI_LCNUMERIC ( 4 )
#define LI_DATETIMEFMT ( 5 )
#define LI_DATETIMESTR ( 6 )
//
// LC_ID and LC_STRINGS indicator.
//
#define QF_LCID ( 0 )
#define QF_STRINGS ( 1 )
//
// Requested character type information.
//
#define CT_CTYPE1 ( 1 )
#define CT_CTYPE2 ( 2 )
//
// Character type 1 (CT_CTYPE1) information
//
#define C1_ALPHA ( 0x100 )
#define C1_CONTROLCHAR ( 0x020 )
#define C1_DIACRITIC ( 0x200 )
#define C1_DIGIT ( 0x004 )
#define C1_LOWERCASE ( 0x002 )
#define C1_PUNCTUATION ( 0x010 )
#define C1_WHITESPACE ( 0x008 )
#define C1_SYMBOL ( 0x400 )
#define C1_UPPERCASE ( 0x001 )
//
// Extended character type 1 (CT_CTYPE1) information
//
#define C1_ALPHNUMERIC ( C1_ALPHA | C1_DIGIT )
#define C1_GRAPHIC ( C1_PUNCTUATION | C1_ALPHNUMERIC )
//
// Character type 2 (CT_CTYPE2) information
//
#define C2_STRONGLEFTTORIGHT ( 0 )
#define C2_STRONGRIGHTTOLEFT ( 1 )
#define C2_WEAKLEFTTORIGHT ( 2 )
#define C2_WEAKRIGHTTOLEFT ( 3 )
#define C2_NEUTRAL ( 4 )
#define C2_NUMERICCONTEXT ( 5 )
#define C2_OPENPUNCTUATION ( 6 )
#define C2_CLOSEPUNCTUATION ( 7 )
//
// Extended character type 2 (CT_CTYPE2) information
//
#define C2_UPSTREAM ( C2_CLOSEPUNCTUATION + 1 )
#define C2_DOWNSTREAM ( C2_CLOSEPUNCTUATION + 2 )
#define C2_IDEOGRAPHIC ( C2_CLOSEPUNCTUATION + 3 )
#define C2_NONBREAKING ( C2_CLOSEPUNCTUATION + 4 )
//
// Comparison flags
//
#define CF_IGNORECASE ( 1 )
#define CF_IGNOREDIACRITIC ( 2 )
#define CF_IGNORESYMBOLS ( 4 )
//
// Map types and flags.
//
#define MAP_COLLATE ( 0 )
#define MAP_CTYPE1 ( 1 )
#define MAP_CTYPE2 ( 2 )
#define MAP_UPPERCASE ( 3 )
#define MAP_LOWERCASE ( 4 )
#define MAP_UCTOMB ( 5 )
#define MAP_MBTOUC ( 6 )
#define MAP_SORTKEY ( 7 )
//
// Character traits.
//
#define STR_IGNORECASE ( 0 )
#define STR_IGNOREDIACRITIC ( 1 )
#define STR_IGNORESYMBOLS ( 2 )
//
// Low level NLSAPI routines.
//
HLCID
BeginEnumLocale(
DWORD dwEnumType,
LPLC_ID lpLCID
);
BOOL
GetNextLocale(
HLCID hEnumHandle,
LPLC_ID lpLCID
);
BOOL
EndEnumLocale(
HLCID hEnumHandle
);
DWORD
GetLocaleInfo(
LPLC_ID lpLocale,
DWORD dwLCType,
LPVOID pvLCData,
DWORD cbBuf
);
BOOL
GetQualifiedLocale(
WORD wType,
LPVOID lpInput,
LPLC_ID lpOutID,
LPLC_STRINGS lpOutStr
);
//
// High level NLSAPI routines.
//
BOOL
GetCharType(
HLOCALE hLocale,
WORD wInfoType,
WCHAR wcChar,
LPWORD lpCharType
);
BOOL
CloseLocale(
HLOCALE hLocale
);
int
CompareString(
HLOCALE hLocale,
DWORD dwCmpFlags,
LPWSTR lpwstrString1,
int nCount1,
LPWSTR lpwstrString2,
int nCount2
);
int
QueryMap(
HLOCALE hLocale,
WORD wMapType,
WORD wMapFlags,
WCHAR wcBeginMap,
WCHAR wcEndMap,
LPVOID pvOutMap,
DWORD dwOutSize
);
int
MapString(
HLOCALE hLocale,
DWORD dwMapFlags,
LPWSTR lpWCSrcStr,
int nWCSrc,
LPWSTR lpWCDestStr,
int nWCDest
);
HLOCALE
OpenLocale(
LPLC_ID lpLCID
);
//
// MBCS Support NLSAPI Routines
//
int
WideCharToMultiByte(
WORD wCodePage,
LPWSTR lpWideCharStr,
int nWideChar,
LPSTR lpMultiByteStr,
int nChar,
LPCHAR lpDefaultChar
);
int
MultiByteToWideChar(
WORD wCodePage,
LPSTR lpMultiByteStr,
int nChar,
LPWSTR lpWideCharStr,
int nWideChar
);
int
MultiByteToMultiByte(
WORD wTranslations,
WORD wSrcCodePage,
LPSTR lpSrcString,
int nSrcChar,
WORD wDestCodePage,
LPSTR wDestString,
int nDestChar
);
#endif // _WINNLS_