Source code of Windows XP (NT5)
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.

251 lines
7.3 KiB

  1. /***
  2. *string.h - declarations for string manipulation functions
  3. *
  4. * Copyright (c) 1985-1994, 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. ****/
  12. #ifndef _INC_STRING
  13. #define _INC_STRING
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  18. #ifndef _CRTAPI1
  19. #if ( (_MSC_VER >= 800) && (_M_IX86 >= 300) )
  20. #define _CRTAPI1 __cdecl
  21. #else
  22. #define _CRTAPI1
  23. #endif
  24. #endif
  25. /* Define _CRTAPI2 (for compatibility with the NT SDK) */
  26. #ifndef _CRTAPI2
  27. #if ( (_MSC_VER >= 800) && (_M_IX86 >= 300) )
  28. #define _CRTAPI2 __cdecl
  29. #else
  30. #define _CRTAPI2
  31. #endif
  32. #endif
  33. /* Define _CRTIMP */
  34. #ifndef _CRTIMP
  35. #ifdef _NTSDK
  36. /* definition compatible with NT SDK */
  37. #define _CRTIMP
  38. #else /* ndef _NTSDK */
  39. /* current definition */
  40. #ifdef _DLL
  41. #define _CRTIMP __declspec(dllimport)
  42. #else /* ndef _DLL */
  43. #define _CRTIMP
  44. #endif /* _DLL */
  45. #endif /* _NTSDK */
  46. #endif /* _CRTIMP */
  47. /* Define __cdecl for non-Microsoft compilers */
  48. #if ( !defined(_MSC_VER) && !defined(__cdecl) )
  49. #define __cdecl
  50. #endif
  51. #ifndef _SIZE_T_DEFINED
  52. typedef unsigned int size_t;
  53. #define _SIZE_T_DEFINED
  54. #endif
  55. #ifndef _WCHAR_T_DEFINED
  56. typedef unsigned short wchar_t;
  57. #define _WCHAR_T_DEFINED
  58. #endif
  59. #ifndef _NLSCMP_DEFINED
  60. #define _NLSCMPERROR 2147483647 /* currently == INT_MAX */
  61. #define _NLSCMP_DEFINED
  62. #endif
  63. /* Define NULL pointer value */
  64. #ifndef NULL
  65. #ifdef __cplusplus
  66. #define NULL 0
  67. #else
  68. #define NULL ((void *)0)
  69. #endif
  70. #endif
  71. /* Function prototypes */
  72. _CRTIMP void * __cdecl _memccpy(void *, const void *, int, unsigned int);
  73. _CRTIMP void * __cdecl memchr(const void *, int, size_t);
  74. int __cdecl memcmp(const void *, const void *, size_t);
  75. _CRTIMP int __cdecl _memicmp(const void *, const void *, unsigned int);
  76. void * __cdecl memcpy(void *, const void *, size_t);
  77. #ifdef _M_ALPHA
  78. /* memmove is available as an intrinsic in the Alpha compiler */
  79. void * __cdecl memmove(void *, const void *, size_t);
  80. #else
  81. _CRTIMP void * __cdecl memmove(void *, const void *, size_t);
  82. #endif
  83. void * __cdecl memset(void *, int, size_t);
  84. char * __cdecl strcat(char *, const char *);
  85. _CRTIMP char * __cdecl strchr(const char *, int);
  86. int __cdecl strcmp(const char *, const char *);
  87. _CRTIMP int __cdecl _strcmpi(const char *, const char *);
  88. _CRTIMP int __cdecl _stricmp(const char *, const char *);
  89. _CRTIMP int __cdecl strcoll(const char *, const char *);
  90. _CRTIMP int __cdecl _stricoll(const char *, const char *);
  91. _CRTIMP int __cdecl _strnicoll(const char *, const char *, size_t);
  92. char * __cdecl strcpy(char *, const char *);
  93. _CRTIMP size_t __cdecl strcspn(const char *, const char *);
  94. _CRTIMP char * __cdecl _strdup(const char *);
  95. _CRTIMP char * __cdecl _strerror(const char *);
  96. _CRTIMP char * __cdecl strerror(int);
  97. size_t __cdecl strlen(const char *);
  98. _CRTIMP char * __cdecl _strlwr(char *);
  99. _CRTIMP char * __cdecl strncat(char *, const char *, size_t);
  100. _CRTIMP int __cdecl strncmp(const char *, const char *, size_t);
  101. _CRTIMP int __cdecl _strnicmp(const char *, const char *, size_t);
  102. _CRTIMP char * __cdecl strncpy(char *, const char *, size_t);
  103. _CRTIMP char * __cdecl _strnset(char *, int, size_t);
  104. _CRTIMP char * __cdecl strpbrk(const char *, const char *);
  105. _CRTIMP char * __cdecl strrchr(const char *, int);
  106. _CRTIMP char * __cdecl _strrev(char *);
  107. char * __cdecl _strset(char *, int);
  108. _CRTIMP size_t __cdecl strspn(const char *, const char *);
  109. _CRTIMP char * __cdecl strstr(const char *, const char *);
  110. _CRTIMP char * __cdecl strtok(char *, const char *);
  111. _CRTIMP char * __cdecl _strupr(char *);
  112. _CRTIMP size_t __cdecl strxfrm (char *, const char *, size_t);
  113. #if !__STDC__
  114. #ifdef _NTSDK
  115. /* Non-ANSI names for compatibility */
  116. #define memccpy _memccpy
  117. #define memicmp _memicmp
  118. #define strcmpi _strcmpi
  119. #define stricmp _stricmp
  120. #define strdup _strdup
  121. #define strlwr _strlwr
  122. #define strnicmp _strnicmp
  123. #define strnset _strnset
  124. #define strrev _strrev
  125. #define strset _strset
  126. #define strupr _strupr
  127. #define stricoll _stricoll
  128. #else /* ndef _NTSDK */
  129. /* prototypes for oldnames.lib functions */
  130. _CRTIMP void * __cdecl memccpy(void *, const void *, int, unsigned int);
  131. _CRTIMP int __cdecl memicmp(const void *, const void *, unsigned int);
  132. _CRTIMP int __cdecl strcmpi(const char *, const char *);
  133. _CRTIMP int __cdecl stricmp(const char *, const char *);
  134. _CRTIMP char * __cdecl strdup(const char *);
  135. _CRTIMP char * __cdecl strlwr(char *);
  136. _CRTIMP int __cdecl strnicmp(const char *, const char *, size_t);
  137. _CRTIMP char * __cdecl strnset(char *, int, size_t);
  138. _CRTIMP char * __cdecl strrev(char *);
  139. char * __cdecl strset(char *, int);
  140. _CRTIMP char * __cdecl strupr(char *);
  141. #endif /* ndef _NTSDK */
  142. #endif /* !__STDC__ */
  143. #ifndef _WSTRING_DEFINED
  144. /* wide function prototypes, also declared in wchar.h */
  145. _CRTIMP wchar_t * __cdecl wcscat(wchar_t *, const wchar_t *);
  146. _CRTIMP wchar_t * __cdecl wcschr(const wchar_t *, wchar_t);
  147. _CRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *);
  148. _CRTIMP wchar_t * __cdecl wcscpy(wchar_t *, const wchar_t *);
  149. _CRTIMP size_t __cdecl wcscspn(const wchar_t *, const wchar_t *);
  150. _CRTIMP size_t __cdecl wcslen(const wchar_t *);
  151. _CRTIMP wchar_t * __cdecl wcsncat(wchar_t *, const wchar_t *, size_t);
  152. _CRTIMP int __cdecl wcsncmp(const wchar_t *, const wchar_t *, size_t);
  153. _CRTIMP wchar_t * __cdecl wcsncpy(wchar_t *, const wchar_t *, size_t);
  154. _CRTIMP wchar_t * __cdecl wcspbrk(const wchar_t *, const wchar_t *);
  155. _CRTIMP wchar_t * __cdecl wcsrchr(const wchar_t *, wchar_t);
  156. _CRTIMP size_t __cdecl wcsspn(const wchar_t *, const wchar_t *);
  157. _CRTIMP wchar_t * __cdecl wcsstr(const wchar_t *, const wchar_t *);
  158. _CRTIMP wchar_t * __cdecl wcstok(wchar_t *, const wchar_t *);
  159. _CRTIMP wchar_t * __cdecl _wcsdup(const wchar_t *);
  160. _CRTIMP int __cdecl _wcsicmp(const wchar_t *, const wchar_t *);
  161. _CRTIMP int __cdecl _wcsnicmp(const wchar_t *, const wchar_t *, size_t);
  162. _CRTIMP wchar_t * __cdecl _wcsnset(wchar_t *, wchar_t, size_t);
  163. _CRTIMP wchar_t * __cdecl _wcsrev(wchar_t *);
  164. _CRTIMP wchar_t * __cdecl _wcsset(wchar_t *, wchar_t);
  165. _CRTIMP wchar_t * __cdecl _wcslwr(wchar_t *);
  166. _CRTIMP wchar_t * __cdecl _wcsupr(wchar_t *);
  167. _CRTIMP size_t __cdecl wcsxfrm(wchar_t *, const wchar_t *, size_t);
  168. _CRTIMP int __cdecl wcscoll(const wchar_t *, const wchar_t *);
  169. _CRTIMP int __cdecl _wcsicoll(const wchar_t *, const wchar_t *);
  170. _CRTIMP int __cdecl _wcsnicoll(const wchar_t *, const wchar_t *, size_t);
  171. #if !__STDC__
  172. /* old names */
  173. #define wcswcs wcsstr
  174. #ifdef _NTSDK
  175. /* Non-ANSI names for compatibility */
  176. #define wcsdup _wcsdup
  177. #define wcsicmp _wcsicmp
  178. #define wcsnicmp _wcsnicmp
  179. #define wcsnset _wcsnset
  180. #define wcsrev _wcsrev
  181. #define wcsset _wcsset
  182. #define wcslwr _wcslwr
  183. #define wcsupr _wcsupr
  184. #define wcsicoll _wcsicoll
  185. #else /* ndef _NTSDK */
  186. /* prototypes for oldnames.lib functions */
  187. _CRTIMP wchar_t * __cdecl wcsdup(const wchar_t *);
  188. _CRTIMP int __cdecl wcsicmp(const wchar_t *, const wchar_t *);
  189. _CRTIMP int __cdecl wcsnicmp(const wchar_t *, const wchar_t *, size_t);
  190. _CRTIMP wchar_t * __cdecl wcsnset(wchar_t *, wchar_t, size_t);
  191. _CRTIMP wchar_t * __cdecl wcsrev(wchar_t *);
  192. _CRTIMP wchar_t * __cdecl wcsset(wchar_t *, wchar_t);
  193. _CRTIMP wchar_t * __cdecl wcslwr(wchar_t *);
  194. _CRTIMP wchar_t * __cdecl wcsupr(wchar_t *);
  195. _CRTIMP int __cdecl wcsicoll(const wchar_t *, const wchar_t *);
  196. #endif /* ndef _NTSDK */
  197. #endif /* !__STDC__ */
  198. #define _WSTRING_DEFINED
  199. #endif
  200. #ifdef __cplusplus
  201. }
  202. #endif
  203. #endif /* _INC_STRING */