Leaked source code of windows server 2003
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.

194 lines
6.3 KiB

  1. /*
  2. * M A P I N L S . H
  3. *
  4. * Internationalization Support Utilities
  5. *
  6. * Copyright 1993-1995 Microsoft Corporation. All Rights Reserved.
  7. */
  8. #ifndef _MAPINLS_H_
  9. #define _MAPINLS_H_
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. /* We don't want to include windows.h in case that conflicts with an */
  14. /* earlier inclusion of compobj.h */
  15. #if !defined(WINAPI)
  16. #if defined(WIN32) && (_MSC_VER >= 800)
  17. #define WINAPI __stdcall
  18. #elif defined(WIN16)
  19. #define WINAPI _far _pascal
  20. #else
  21. #define WINAPI _far _pascal
  22. #endif
  23. #endif
  24. #if defined(DOS) || defined(MAC)
  25. #include <string.h>
  26. #endif
  27. #ifndef FAR
  28. #define FAR
  29. #endif
  30. typedef unsigned char BYTE;
  31. typedef unsigned short WORD;
  32. typedef unsigned long DWORD;
  33. typedef unsigned int UINT;
  34. typedef int BOOL;
  35. #ifndef __CHAR_DEFINED__
  36. typedef char CHAR;
  37. #endif
  38. #ifdef UNICODE
  39. typedef WCHAR TCHAR;
  40. #else
  41. typedef char TCHAR;
  42. #endif
  43. #if !defined(_NATIVE_WCHAR_T_DEFINED)
  44. typedef unsigned short WCHAR;
  45. #else
  46. typedef wchar_t WCHAR;
  47. #endif
  48. typedef WCHAR FAR * LPWSTR;
  49. typedef const WCHAR FAR * LPCWSTR;
  50. typedef CHAR FAR * LPSTR;
  51. typedef const CHAR FAR * LPCSTR;
  52. typedef TCHAR FAR * LPTSTR;
  53. typedef const TCHAR FAR * LPCTSTR;
  54. typedef DWORD LCID;
  55. typedef const void FAR * LPCVOID;
  56. #ifndef LPOLESTR
  57. #ifndef WIN32
  58. #define LPOLESTR LPSTR
  59. #define LPCOLESTR LPCSTR
  60. #define OLECHAR char
  61. #define OLESTR(str) str
  62. #else /* Win32 */
  63. #define LPOLESTR LPWSTR
  64. #define LPCOLESTR LPCWSTR
  65. #define OLECHAR WCHAR
  66. #define OLESTR(str) L##str
  67. #endif /* !WIN32 */
  68. #endif /* LPOLESTR */
  69. #define NORM_IGNORECASE 0x00000001 /* ignore case */
  70. #define NORM_IGNORENONSPACE 0x00000002 /* ignore diacritics */
  71. #define NORM_IGNORESYMBOLS 0x00000004 /* ignore symbols */
  72. #define NORM_IGNOREKANATYPE 0x00010000 /* ignore kanatype */
  73. #define NORM_IGNOREWIDTH 0x00020000 /* ignore width */
  74. #if defined(WIN16)
  75. #define lstrcpyA lstrcpy
  76. #define lstrlenA lstrlen
  77. #define lstrcmpA lstrcmp
  78. #define lstrcmpiA lstrcmpi
  79. #define LoadStringA LoadString
  80. #define IsBadStringPtrA(a1, a2) IsBadStringPtr(a1, a2)
  81. #define wvsprintfA wvsprintf
  82. #define MessageBoxA MessageBox
  83. #define GetModuleHandleA GetModuleHandle
  84. #define CreateWindowA CreateWindow
  85. #define RegisterClassA RegisterClass
  86. #define CharToOemBuff AnsiToOemBuff
  87. #define CharToOem AnsiToOem
  88. #define CharUpperBuff AnsiUpperBuff
  89. #define CharUpper AnsiUpper
  90. #elif defined(DOS) || defined(MAC)
  91. #define IsBadReadPtr(lp, cb) (FALSE)
  92. #define IsBadWritePtr(lp, cb) (FALSE)
  93. #define IsBadHugeReadPtr(lp, cb) (FALSE)
  94. #define IsBadHugeWritePtr(lp, cb) (FALSE)
  95. #define IsBadCodePtr(lpfn) (FALSE)
  96. #define IsBadStringPtr(lpsz, cchMax) (FALSE)
  97. #define IsBadStringPtrA(lpsz, cchMax) (FALSE)
  98. #if defined(DOS)
  99. #define lstrcpyA strcpy
  100. #define lstrlenA strlen
  101. #define lstrcmpA strcmp
  102. #define lstrcmp strcmp
  103. #define lstrcmpi strcmpi
  104. #define lstrcpy strcpy
  105. #define lstrcat strcat
  106. #define lstrlen strlen
  107. #define wsprintf sprintf
  108. #endif
  109. #endif
  110. #if defined(DOS) || defined(WIN16)
  111. #define TEXT(x) x
  112. #endif
  113. #define CP_ACP 0 /* default to ANSI code page */
  114. #define CP_OEMCP 1 /* default to OEM code page */
  115. LCID WINAPI MNLS_GetUserDefaultLCID(void);
  116. UINT WINAPI MNLS_GetACP(void);
  117. int WINAPI MNLS_CompareStringA(LCID Locale, DWORD dwCmpFlags,
  118. LPCSTR lpString1, int cchCount1, LPCSTR lpString2,
  119. int cchCount2);
  120. int WINAPI MNLS_CompareStringW(LCID Locale, DWORD dwCmpFlags,
  121. LPCWSTR lpString1, int cchCount1, LPCWSTR lpString2,
  122. int cchCount2);
  123. int WINAPI MNLS_MultiByteToWideChar(UINT uCodePage, DWORD dwFlags,
  124. LPCSTR lpMultiByteStr, int cchMultiByte,
  125. LPWSTR lpWideCharStr, int cchWideChar);
  126. int WINAPI MNLS_WideCharToMultiByte(UINT uCodePage, DWORD dwFlags,
  127. LPCWSTR lpWideCharStr, int cchWideChar,
  128. LPSTR lpMultiByteStr, int cchMultiByte,
  129. LPCSTR lpDefaultChar, BOOL FAR *lpfUsedDefaultChar);
  130. int WINAPI MNLS_lstrlenW(LPCWSTR lpString);
  131. int WINAPI MNLS_lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2);
  132. LPWSTR WINAPI MNLS_lstrcpyW(LPWSTR lpString1, LPCWSTR lpString2);
  133. BOOL WINAPI MNLS_IsBadStringPtrW(LPCWSTR lpsz, UINT ucchMax);
  134. #if defined(WIN32) && !defined(NT) && !defined(CHICAGO) && !defined(_MAC)
  135. #define NT
  136. #endif
  137. #if !defined(NT) && !defined(CHICAGO)
  138. #define GetUserDefaultLCID MNLS_GetUserDefaultLCID
  139. #define GetACP MNLS_GetACP
  140. #define MultiByteToWideChar MNLS_MultiByteToWideChar
  141. #define WideCharToMultiByte MNLS_WideCharToMultiByte
  142. #define CompareStringA MNLS_CompareStringA
  143. #endif
  144. #if !defined(NT)
  145. #define lstrlenW MNLS_lstrlenW
  146. #define lstrcmpW MNLS_lstrcmpW
  147. #define lstrcpyW MNLS_lstrcpyW
  148. #define CompareStringW MNLS_CompareStringW
  149. #if defined(WIN16) || defined(CHICAGO)
  150. #define IsBadStringPtrW MNLS_IsBadStringPtrW
  151. #elif defined(MAC)
  152. #define IsBadStringPtrW(lpsz, cchMax) (FALSE)
  153. #else
  154. #define IsBadStringPtrW (FALSE)
  155. #endif
  156. #endif
  157. #ifdef __cplusplus
  158. }
  159. #endif
  160. #endif /* _MAPINLS_H_ */