Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

292 lines
4.5 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. winnls.h
  5. Abstract:
  6. This module defines the 32-Bit Windows NLS APIs.
  7. Author:
  8. David J. Gilman (davegi) 22-Mar-1991
  9. Revision History:
  10. --*/
  11. #ifndef _WINNLS_
  12. #define _WINNLS_
  13. //
  14. // NLSAPI and wide character related types.
  15. //
  16. typedef char CHAR;
  17. typedef PDWORD LPWCHAR;
  18. typedef LPSTR LPCHAR;
  19. typedef DWORD HLCID;
  20. typedef DWORD HLOCALE;
  21. //
  22. // Length of locale strings.
  23. //
  24. #define MAX_LANG_LEN ( 128 )
  25. #define MAX_CTRY_LEN ( 128 )
  26. #define MAX_CP_LEN ( 128 )
  27. //
  28. // String based locale representation.
  29. //
  30. typedef struct tagLC_STRINGS {
  31. CHAR szLanguage[MAX_LANG_LEN]; // language name
  32. CHAR szCountry[MAX_CTRY_LEN]; // country name
  33. CHAR szCodePage[MAX_CP_LEN]; // codepage name
  34. } LC_STRINGS, *LPLC_STRINGS, *PLC_STRINGS;
  35. //
  36. // Code based local representation.
  37. //
  38. typedef struct tagLC_ID {
  39. WORD wLanguage; // language id
  40. WORD wCountry; // country id
  41. WORD wCodePage; // codepage id
  42. } LC_ID, *LPLC_ID, *PLC_ID;
  43. //
  44. // Locale information enumeration type.
  45. //
  46. #define LI_CPDATA ( 0 )
  47. #define LI_CTRYDATA ( 1 )
  48. #define LI_LANGDATA ( 2 )
  49. //
  50. // Locale information type.
  51. //
  52. #define LI_CPDATA ( 0 )
  53. #define LI_CTRYDATA ( 1 )
  54. #define LI_LANGDATA ( 2 )
  55. #define LI_LCMONETARY ( 3 )
  56. #define LI_LCNUMERIC ( 4 )
  57. #define LI_DATETIMEFMT ( 5 )
  58. #define LI_DATETIMESTR ( 6 )
  59. //
  60. // LC_ID and LC_STRINGS indicator.
  61. //
  62. #define QF_LCID ( 0 )
  63. #define QF_STRINGS ( 1 )
  64. //
  65. // Requested character type information.
  66. //
  67. #define CT_CTYPE1 ( 1 )
  68. #define CT_CTYPE2 ( 2 )
  69. //
  70. // Character type 1 (CT_CTYPE1) information
  71. //
  72. #define C1_ALPHA ( 0x100 )
  73. #define C1_CONTROLCHAR ( 0x020 )
  74. #define C1_DIACRITIC ( 0x200 )
  75. #define C1_DIGIT ( 0x004 )
  76. #define C1_LOWERCASE ( 0x002 )
  77. #define C1_PUNCTUATION ( 0x010 )
  78. #define C1_WHITESPACE ( 0x008 )
  79. #define C1_SYMBOL ( 0x400 )
  80. #define C1_UPPERCASE ( 0x001 )
  81. //
  82. // Extended character type 1 (CT_CTYPE1) information
  83. //
  84. #define C1_ALPHNUMERIC ( C1_ALPHA | C1_DIGIT )
  85. #define C1_GRAPHIC ( C1_PUNCTUATION | C1_ALPHNUMERIC )
  86. //
  87. // Character type 2 (CT_CTYPE2) information
  88. //
  89. #define C2_STRONGLEFTTORIGHT ( 0 )
  90. #define C2_STRONGRIGHTTOLEFT ( 1 )
  91. #define C2_WEAKLEFTTORIGHT ( 2 )
  92. #define C2_WEAKRIGHTTOLEFT ( 3 )
  93. #define C2_NEUTRAL ( 4 )
  94. #define C2_NUMERICCONTEXT ( 5 )
  95. #define C2_OPENPUNCTUATION ( 6 )
  96. #define C2_CLOSEPUNCTUATION ( 7 )
  97. //
  98. // Extended character type 2 (CT_CTYPE2) information
  99. //
  100. #define C2_UPSTREAM ( C2_CLOSEPUNCTUATION + 1 )
  101. #define C2_DOWNSTREAM ( C2_CLOSEPUNCTUATION + 2 )
  102. #define C2_IDEOGRAPHIC ( C2_CLOSEPUNCTUATION + 3 )
  103. #define C2_NONBREAKING ( C2_CLOSEPUNCTUATION + 4 )
  104. //
  105. // Comparison flags
  106. //
  107. #define CF_IGNORECASE ( 1 )
  108. #define CF_IGNOREDIACRITIC ( 2 )
  109. #define CF_IGNORESYMBOLS ( 4 )
  110. //
  111. // Map types and flags.
  112. //
  113. #define MAP_COLLATE ( 0 )
  114. #define MAP_CTYPE1 ( 1 )
  115. #define MAP_CTYPE2 ( 2 )
  116. #define MAP_UPPERCASE ( 3 )
  117. #define MAP_LOWERCASE ( 4 )
  118. #define MAP_UCTOMB ( 5 )
  119. #define MAP_MBTOUC ( 6 )
  120. #define MAP_SORTKEY ( 7 )
  121. //
  122. // Character traits.
  123. //
  124. #define STR_IGNORECASE ( 0 )
  125. #define STR_IGNOREDIACRITIC ( 1 )
  126. #define STR_IGNORESYMBOLS ( 2 )
  127. //
  128. // Low level NLSAPI routines.
  129. //
  130. HLCID
  131. BeginEnumLocale(
  132. DWORD dwEnumType,
  133. LPLC_ID lpLCID
  134. );
  135. BOOL
  136. GetNextLocale(
  137. HLCID hEnumHandle,
  138. LPLC_ID lpLCID
  139. );
  140. BOOL
  141. EndEnumLocale(
  142. HLCID hEnumHandle
  143. );
  144. DWORD
  145. GetLocaleInfo(
  146. LPLC_ID lpLocale,
  147. DWORD dwLCType,
  148. LPVOID pvLCData,
  149. DWORD cbBuf
  150. );
  151. BOOL
  152. GetQualifiedLocale(
  153. WORD wType,
  154. LPVOID lpInput,
  155. LPLC_ID lpOutID,
  156. LPLC_STRINGS lpOutStr
  157. );
  158. //
  159. // High level NLSAPI routines.
  160. //
  161. BOOL
  162. GetCharType(
  163. HLOCALE hLocale,
  164. WORD wInfoType,
  165. WCHAR wcChar,
  166. LPWORD lpCharType
  167. );
  168. BOOL
  169. CloseLocale(
  170. HLOCALE hLocale
  171. );
  172. int
  173. CompareString(
  174. HLOCALE hLocale,
  175. DWORD dwCmpFlags,
  176. LPWSTR lpwstrString1,
  177. int nCount1,
  178. LPWSTR lpwstrString2,
  179. int nCount2
  180. );
  181. int
  182. QueryMap(
  183. HLOCALE hLocale,
  184. WORD wMapType,
  185. WORD wMapFlags,
  186. WCHAR wcBeginMap,
  187. WCHAR wcEndMap,
  188. LPVOID pvOutMap,
  189. DWORD dwOutSize
  190. );
  191. int
  192. MapString(
  193. HLOCALE hLocale,
  194. DWORD dwMapFlags,
  195. LPWSTR lpWCSrcStr,
  196. int nWCSrc,
  197. LPWSTR lpWCDestStr,
  198. int nWCDest
  199. );
  200. HLOCALE
  201. OpenLocale(
  202. LPLC_ID lpLCID
  203. );
  204. //
  205. // MBCS Support NLSAPI Routines
  206. //
  207. int
  208. WideCharToMultiByte(
  209. WORD wCodePage,
  210. LPWSTR lpWideCharStr,
  211. int nWideChar,
  212. LPSTR lpMultiByteStr,
  213. int nChar,
  214. LPCHAR lpDefaultChar
  215. );
  216. int
  217. MultiByteToWideChar(
  218. WORD wCodePage,
  219. LPSTR lpMultiByteStr,
  220. int nChar,
  221. LPWSTR lpWideCharStr,
  222. int nWideChar
  223. );
  224. int
  225. MultiByteToMultiByte(
  226. WORD wTranslations,
  227. WORD wSrcCodePage,
  228. LPSTR lpSrcString,
  229. int nSrcChar,
  230. WORD wDestCodePage,
  231. LPSTR wDestString,
  232. int nDestChar
  233. );
  234. #endif // _WINNLS_