home *** CD-ROM | disk | FTP | other *** search
/ C Programming Starter Kit 2.0 / SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso / bc45 / msinc.pak / MAPINLS.H < prev    next >
C/C++ Source or Header  |  1997-07-23  |  7KB  |  200 lines

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