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.

227 lines
7.3 KiB

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