home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / crt / src / string.h < prev    next >
C/C++ Source or Header  |  1998-06-17  |  9KB  |  253 lines

  1. /***
  2. *string.h - declarations for string manipulation functions
  3. *
  4. *       Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       This file contains the function declarations for the string
  8. *       manipulation functions.
  9. *       [ANSI/System V]
  10. *
  11. *       [Public]
  12. *
  13. ****/
  14.  
  15. #if _MSC_VER > 1000
  16. #pragma once
  17. #endif  /* _MSC_VER > 1000 */
  18.  
  19. #ifndef _INC_STRING
  20. #define _INC_STRING
  21.  
  22. #if !defined (_WIN32) && !defined (_MAC)
  23. #error ERROR: Only Mac or Win32 targets supported!
  24. #endif  /* !defined (_WIN32) && !defined (_MAC) */
  25.  
  26. #ifndef _CRTBLD
  27. /* This version of the header files is NOT for user programs.
  28.  * It is intended for use when building the C runtimes ONLY.
  29.  * The version intended for public use will not have this message.
  30.  */
  31. #error ERROR: Use of C runtime library internal header file.
  32. #endif  /* _CRTBLD */
  33.  
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif  /* __cplusplus */
  37.  
  38. #ifndef _INTERNAL_IFSTRIP_
  39. #include <cruntime.h>
  40. #endif  /* _INTERNAL_IFSTRIP_ */
  41.  
  42.  
  43. /* Define _CRTIMP */
  44.  
  45. #ifndef _CRTIMP
  46. #ifdef CRTDLL
  47. #define _CRTIMP __declspec(dllexport)
  48. #else  /* CRTDLL */
  49. #ifdef _DLL
  50. #define _CRTIMP __declspec(dllimport)
  51. #else  /* _DLL */
  52. #define _CRTIMP
  53. #endif  /* _DLL */
  54. #endif  /* CRTDLL */
  55. #endif  /* _CRTIMP */
  56.  
  57. /* Define __cdecl for non-Microsoft compilers */
  58.  
  59. #if (!defined (_MSC_VER) && !defined (__cdecl))
  60. #define __cdecl
  61. #endif  /* (!defined (_MSC_VER) && !defined (__cdecl)) */
  62.  
  63. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  64.  
  65. #ifndef _CRTAPI1
  66. #if _MSC_VER >= 800 && _M_IX86 >= 300
  67. #define _CRTAPI1 __cdecl
  68. #else  /* _MSC_VER >= 800 && _M_IX86 >= 300 */
  69. #define _CRTAPI1
  70. #endif  /* _MSC_VER >= 800 && _M_IX86 >= 300 */
  71. #endif  /* _CRTAPI1 */
  72.  
  73.  
  74. #ifndef _SIZE_T_DEFINED
  75. typedef unsigned int size_t;
  76. #define _SIZE_T_DEFINED
  77. #endif  /* _SIZE_T_DEFINED */
  78.  
  79.  
  80. #ifndef _MAC
  81. #ifndef _WCHAR_T_DEFINED
  82. typedef unsigned short wchar_t;
  83. #define _WCHAR_T_DEFINED
  84. #endif  /* _WCHAR_T_DEFINED */
  85. #endif  /* _MAC */
  86.  
  87. #ifndef _NLSCMP_DEFINED
  88. #define _NLSCMPERROR    2147483647  /* currently == INT_MAX */
  89. #define _NLSCMP_DEFINED
  90. #endif  /* _NLSCMP_DEFINED */
  91.  
  92. /* Define NULL pointer value */
  93.  
  94. #ifndef NULL
  95. #ifdef __cplusplus
  96. #define NULL    0
  97. #else  /* __cplusplus */
  98. #define NULL    ((void *)0)
  99. #endif  /* __cplusplus */
  100. #endif  /* NULL */
  101.  
  102.  
  103. /* Function prototypes */
  104.  
  105. #ifdef _M_MRX000
  106. _CRTIMP void *  __cdecl memcpy(void *, const void *, size_t);
  107. _CRTIMP int     __cdecl memcmp(const void *, const void *, size_t);
  108. _CRTIMP void *  __cdecl memset(void *, int, size_t);
  109. _CRTIMP char *  __cdecl _strset(char *, int);
  110. _CRTIMP char *  __cdecl strcpy(char *, const char *);
  111. _CRTIMP char *  __cdecl strcat(char *, const char *);
  112. _CRTIMP int     __cdecl strcmp(const char *, const char *);
  113. _CRTIMP size_t  __cdecl strlen(const char *);
  114. #else  /* _M_MRX000 */
  115.         void *  __cdecl memcpy(void *, const void *, size_t);
  116.         int     __cdecl memcmp(const void *, const void *, size_t);
  117.         void *  __cdecl memset(void *, int, size_t);
  118.         char *  __cdecl _strset(char *, int);
  119.         char *  __cdecl strcpy(char *, const char *);
  120.         char *  __cdecl strcat(char *, const char *);
  121.         int     __cdecl strcmp(const char *, const char *);
  122.         size_t  __cdecl strlen(const char *);
  123. #endif  /* _M_MRX000 */
  124. _CRTIMP void *  __cdecl _memccpy(void *, const void *, int, unsigned int);
  125. _CRTIMP void *  __cdecl memchr(const void *, int, size_t);
  126. _CRTIMP int     __cdecl _memicmp(const void *, const void *, unsigned int);
  127.  
  128. #ifdef _M_ALPHA
  129.         /* memmove is available as an intrinsic in the Alpha compiler */
  130.         void *  __cdecl memmove(void *, const void *, size_t);
  131. #else  /* _M_ALPHA */
  132. _CRTIMP void *  __cdecl memmove(void *, const void *, size_t);
  133. #endif  /* _M_ALPHA */
  134.  
  135.  
  136. _CRTIMP char *  __cdecl strchr(const char *, int);
  137. _CRTIMP int     __cdecl _strcmpi(const char *, const char *);
  138. _CRTIMP int     __cdecl _stricmp(const char *, const char *);
  139. _CRTIMP int     __cdecl strcoll(const char *, const char *);
  140. _CRTIMP int     __cdecl _stricoll(const char *, const char *);
  141. _CRTIMP int     __cdecl _strncoll(const char *, const char *, size_t);
  142. _CRTIMP int     __cdecl _strnicoll(const char *, const char *, size_t);
  143. _CRTIMP size_t  __cdecl strcspn(const char *, const char *);
  144. _CRTIMP char *  __cdecl _strdup(const char *);
  145. _CRTIMP char *  __cdecl _strerror(const char *);
  146. _CRTIMP char *  __cdecl strerror(int);
  147. _CRTIMP char *  __cdecl _strlwr(char *);
  148. _CRTIMP char *  __cdecl strncat(char *, const char *, size_t);
  149. _CRTIMP int     __cdecl strncmp(const char *, const char *, size_t);
  150. _CRTIMP int     __cdecl _strnicmp(const char *, const char *, size_t);
  151. _CRTIMP char *  __cdecl strncpy(char *, const char *, size_t);
  152. _CRTIMP char *  __cdecl _strnset(char *, int, size_t);
  153. _CRTIMP char *  __cdecl strpbrk(const char *, const char *);
  154. _CRTIMP char *  __cdecl strrchr(const char *, int);
  155. _CRTIMP char *  __cdecl _strrev(char *);
  156. _CRTIMP size_t  __cdecl strspn(const char *, const char *);
  157. _CRTIMP char *  __cdecl strstr(const char *, const char *);
  158. _CRTIMP char *  __cdecl strtok(char *, const char *);
  159. _CRTIMP char *  __cdecl _strupr(char *);
  160. _CRTIMP size_t  __cdecl strxfrm (char *, const char *, size_t);
  161.  
  162. #ifdef _MAC
  163. unsigned char * __cdecl _c2pstr(char *);
  164. char * __cdecl _p2cstr(unsigned char *);
  165.  
  166. #if !__STDC__
  167. __inline unsigned char * __cdecl c2pstr(char *sz) { return _c2pstr(sz);};
  168. __inline char * __cdecl p2cstr(unsigned char *sz) { return _p2cstr(sz);};
  169. #endif  /* !__STDC__ */
  170. #endif  /* _MAC */
  171.  
  172. #if !__STDC__
  173.  
  174. /* prototypes for oldnames.lib functions */
  175. _CRTIMP void * __cdecl memccpy(void *, const void *, int, unsigned int);
  176. _CRTIMP int __cdecl memicmp(const void *, const void *, unsigned int);
  177. _CRTIMP int __cdecl strcmpi(const char *, const char *);
  178. _CRTIMP int __cdecl stricmp(const char *, const char *);
  179. _CRTIMP char * __cdecl strdup(const char *);
  180. _CRTIMP char * __cdecl strlwr(char *);
  181. _CRTIMP int __cdecl strnicmp(const char *, const char *, size_t);
  182. _CRTIMP char * __cdecl strnset(char *, int, size_t);
  183. _CRTIMP char * __cdecl strrev(char *);
  184.         char * __cdecl strset(char *, int);
  185. _CRTIMP char * __cdecl strupr(char *);
  186.  
  187. #endif  /* !__STDC__ */
  188.  
  189.  
  190. #ifndef _MAC
  191. #ifndef _WSTRING_DEFINED
  192.  
  193. /* wide function prototypes, also declared in wchar.h  */
  194.  
  195. _CRTIMP wchar_t * __cdecl wcscat(wchar_t *, const wchar_t *);
  196. _CRTIMP wchar_t * __cdecl wcschr(const wchar_t *, wchar_t);
  197. _CRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *);
  198. _CRTIMP wchar_t * __cdecl wcscpy(wchar_t *, const wchar_t *);
  199. _CRTIMP size_t __cdecl wcscspn(const wchar_t *, const wchar_t *);
  200. _CRTIMP size_t __cdecl wcslen(const wchar_t *);
  201. _CRTIMP wchar_t * __cdecl wcsncat(wchar_t *, const wchar_t *, size_t);
  202. _CRTIMP int __cdecl wcsncmp(const wchar_t *, const wchar_t *, size_t);
  203. _CRTIMP wchar_t * __cdecl wcsncpy(wchar_t *, const wchar_t *, size_t);
  204. _CRTIMP wchar_t * __cdecl wcspbrk(const wchar_t *, const wchar_t *);
  205. _CRTIMP wchar_t * __cdecl wcsrchr(const wchar_t *, wchar_t);
  206. _CRTIMP size_t __cdecl wcsspn(const wchar_t *, const wchar_t *);
  207. _CRTIMP wchar_t * __cdecl wcsstr(const wchar_t *, const wchar_t *);
  208. _CRTIMP wchar_t * __cdecl wcstok(wchar_t *, const wchar_t *);
  209.  
  210. _CRTIMP wchar_t * __cdecl _wcsdup(const wchar_t *);
  211. _CRTIMP int __cdecl _wcsicmp(const wchar_t *, const wchar_t *);
  212. _CRTIMP int __cdecl _wcsnicmp(const wchar_t *, const wchar_t *, size_t);
  213. _CRTIMP wchar_t * __cdecl _wcsnset(wchar_t *, wchar_t, size_t);
  214. _CRTIMP wchar_t * __cdecl _wcsrev(wchar_t *);
  215. _CRTIMP wchar_t * __cdecl _wcsset(wchar_t *, wchar_t);
  216.  
  217. _CRTIMP wchar_t * __cdecl _wcslwr(wchar_t *);
  218. _CRTIMP wchar_t * __cdecl _wcsupr(wchar_t *);
  219. _CRTIMP size_t __cdecl wcsxfrm(wchar_t *, const wchar_t *, size_t);
  220. _CRTIMP int __cdecl wcscoll(const wchar_t *, const wchar_t *);
  221. _CRTIMP int __cdecl _wcsicoll(const wchar_t *, const wchar_t *);
  222. _CRTIMP int __cdecl _wcsncoll(const wchar_t *, const wchar_t *, size_t);
  223. _CRTIMP int __cdecl _wcsnicoll(const wchar_t *, const wchar_t *, size_t);
  224.  
  225. #if !__STDC__
  226.  
  227. /* old names */
  228. #define wcswcs wcsstr
  229.  
  230. /* prototypes for oldnames.lib functions */
  231. _CRTIMP wchar_t * __cdecl wcsdup(const wchar_t *);
  232. _CRTIMP int __cdecl wcsicmp(const wchar_t *, const wchar_t *);
  233. _CRTIMP int __cdecl wcsnicmp(const wchar_t *, const wchar_t *, size_t);
  234. _CRTIMP wchar_t * __cdecl wcsnset(wchar_t *, wchar_t, size_t);
  235. _CRTIMP wchar_t * __cdecl wcsrev(wchar_t *);
  236. _CRTIMP wchar_t * __cdecl wcsset(wchar_t *, wchar_t);
  237. _CRTIMP wchar_t * __cdecl wcslwr(wchar_t *);
  238. _CRTIMP wchar_t * __cdecl wcsupr(wchar_t *);
  239. _CRTIMP int __cdecl wcsicoll(const wchar_t *, const wchar_t *);
  240.  
  241. #endif  /* !__STDC__ */
  242.  
  243. #define _WSTRING_DEFINED
  244. #endif  /* _WSTRING_DEFINED */
  245.  
  246. #endif  /* _MAC */
  247.  
  248. #ifdef __cplusplus
  249. }
  250. #endif  /* __cplusplus */
  251.  
  252. #endif  /* _INC_STRING */
  253.