home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / sdk / winh / mapinls.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-29  |  6.7 KB  |  204 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. #if __IBMCPP__
  54. typedef wchar_t                         WCHAR;
  55. #else
  56. typedef unsigned short                  WCHAR;
  57. #endif
  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 LPOLESTR
  68. #if !defined (WIN32) || defined (_MAC)
  69.  
  70. #define LPOLESTR        LPSTR
  71. #define LPCOLESTR       LPCSTR
  72. #define OLECHAR         char
  73. #define OLESTR(str) str
  74.  
  75. #else  /* Win32 */
  76.  
  77. #define LPOLESTR        LPWSTR
  78. #define LPCOLESTR       LPCWSTR
  79. #define OLECHAR         WCHAR
  80. #define OLESTR(str)     L##str
  81.  
  82. #endif /* !WIN32 */
  83. #endif /* LPOLESTR */
  84.  
  85. #define NORM_IGNORECASE                 0x00000001     /* ignore case */
  86. #define NORM_IGNORENONSPACE             0x00000002     /* ignore diacritics */
  87. #define NORM_IGNORESYMBOLS              0x00000004     /* ignore symbols */
  88.  
  89. #if defined (WIN32) /* from winnls.h */
  90. #define NORM_IGNOREKANATYPE             0x00010000     /* ignore kanatype */
  91. #define NORM_IGNOREWIDTH                0x00020000     /* ignore width */
  92. #elif defined (WIN16) /* from olenls.h */
  93. #define NORM_IGNOREWIDTH                0x00000008      /* ignore width */
  94. #define NORM_IGNOREKANATYPE             0x00000040      /* ignore kanatype */
  95. #endif
  96.  
  97. #if defined(WIN16)
  98.  
  99. #define lstrcpyA                        lstrcpy
  100. #define lstrlenA                        lstrlen
  101. #define lstrcmpA                        lstrcmp
  102. #define lstrcmpiA                       lstrcmpi
  103. #define LoadStringA                     LoadString
  104. #define IsBadStringPtrA(a1, a2)         IsBadStringPtr(a1, a2)
  105. #define wvsprintfA                      wvsprintf
  106. #define MessageBoxA                     MessageBox
  107. #define GetModuleHandleA                GetModuleHandle
  108. #define CreateWindowA                   CreateWindow
  109. #define RegisterClassA                  RegisterClass
  110. #define CharToOemBuff                   AnsiToOemBuff
  111. #define CharToOem                       AnsiToOem
  112. #define CharUpperBuff                   AnsiUpperBuff
  113. #define CharUpper                       AnsiUpper
  114.  
  115. #elif defined(DOS) || defined(_MAC)
  116.  
  117. #define IsBadReadPtr(lp, cb)            (FALSE)
  118. #define IsBadWritePtr(lp, cb)           (FALSE)
  119. #define IsBadHugeReadPtr(lp, cb)        (FALSE)
  120. #define IsBadHugeWritePtr(lp, cb)       (FALSE)
  121. #define IsBadCodePtr(lpfn)              (FALSE)
  122. #ifdef _MAC
  123. #undef IsBadStringPtr
  124. #endif
  125. #define IsBadStringPtr(lpsz, cchMax)    (FALSE)
  126. #define IsBadStringPtrA(lpsz, cchMax)   (FALSE)
  127.  
  128. #if defined(DOS)
  129.  
  130. #define lstrcpyA                        strcpy
  131. #define lstrlenA                        strlen
  132. #define lstrcmpA                        strcmp
  133. #define lstrcmp                         strcmp
  134. #define lstrcmpi                        strcmpi
  135. #define lstrcpy                         strcpy
  136. #define lstrcat                         strcat
  137. #define lstrlen                         strlen
  138. #define wsprintf                        sprintf
  139.  
  140. #endif
  141. #endif
  142.  
  143. #if defined(DOS) || defined(WIN16)
  144. /* Simulate effect of afx header */
  145. #define __T(x)      x
  146. #define _T(x)       __T(x)
  147. #define TEXT        _T
  148. #endif
  149.  
  150. #define CP_ACP      0       /* default to ANSI code page */
  151. #define CP_OEMCP    1       /* default to OEM  code page */
  152.  
  153. LCID    WINAPI  MNLS_GetUserDefaultLCID(void);
  154. UINT    WINAPI  MNLS_GetACP(void);
  155. int     WINAPI  MNLS_CompareStringA(LCID Locale, DWORD dwCmpFlags,
  156.                     LPCSTR lpString1, int cchCount1, LPCSTR lpString2,
  157.                     int cchCount2);
  158. int     WINAPI  MNLS_CompareStringW(LCID Locale, DWORD dwCmpFlags,
  159.                     LPCWSTR lpString1, int cchCount1, LPCWSTR lpString2,
  160.                     int cchCount2);
  161. int     WINAPI  MNLS_MultiByteToWideChar(UINT uCodePage, DWORD dwFlags,
  162.                     LPCSTR lpMultiByteStr, int cchMultiByte,
  163.                     LPWSTR lpWideCharStr, int cchWideChar);
  164. int     WINAPI  MNLS_WideCharToMultiByte(UINT uCodePage, DWORD dwFlags,
  165.                     LPCWSTR lpWideCharStr, int cchWideChar,
  166.                     LPSTR lpMultiByteStr, int cchMultiByte,
  167.                     LPCSTR lpDefaultChar, BOOL FAR *lpfUsedDefaultChar);
  168. int     WINAPI  MNLS_lstrlenW(LPCWSTR lpString);
  169. int     WINAPI  MNLS_lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2);
  170. LPWSTR  WINAPI  MNLS_lstrcpyW(LPWSTR lpString1, LPCWSTR lpString2);
  171. BOOL    WINAPI  MNLS_IsBadStringPtrW(LPCWSTR lpsz, UINT ucchMax);
  172.  
  173. #if defined(WIN32) && !defined(_WINNT) && !defined(_WIN95) && !defined(_MAC)
  174. #define _WINNT
  175. #endif
  176.  
  177. #if !defined(_WINNT) && !defined(_WIN95)
  178. #define GetUserDefaultLCID      MNLS_GetUserDefaultLCID
  179. #define GetACP                  MNLS_GetACP
  180. #define MultiByteToWideChar     MNLS_MultiByteToWideChar
  181. #define WideCharToMultiByte     MNLS_WideCharToMultiByte
  182. #define CompareStringA          MNLS_CompareStringA
  183. #endif
  184.  
  185. #define lstrlenW                MNLS_lstrlenW
  186. #define lstrcmpW                MNLS_lstrcmpW
  187. #define lstrcpyW                MNLS_lstrcpyW
  188. #define CompareStringW          MNLS_CompareStringW
  189.  
  190. #if defined(WIN16) || defined(_WINNT) || defined(_WIN95)
  191. #define IsBadStringPtrW         MNLS_IsBadStringPtrW
  192. #elif defined(_MAC)
  193. #define IsBadStringPtrW(lpsz, cchMax)           (FALSE)
  194. #else
  195. #define IsBadStringPtrW         (FALSE)
  196. #endif
  197.  
  198. #ifdef __cplusplus
  199. }
  200. #endif
  201.  
  202. #endif /* _MAPINLS_H_ */
  203.  
  204.