home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / mapinls.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  7KB  |  210 lines

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