Leaked source code of windows server 2003
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.

216 lines
7.1 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. #if !defined(_WCHAR_T_DEFINED) && !defined(_NATIVE_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. void * __cdecl memcpy(void *, const void *, size_t);
  70. int __cdecl memcmp(const void *, const void *, size_t);
  71. void * __cdecl memset(void *, int, size_t);
  72. char * __cdecl _strset(char *, int);
  73. char * __cdecl strcpy(char *, const char *);
  74. char * __cdecl strcat(char *, const char *);
  75. int __cdecl strcmp(const char *, const char *);
  76. size_t __cdecl strlen(const char *);
  77. _CRTIMP void * __cdecl _memccpy(void *, const void *, int, size_t);
  78. _CRTIMP void * __cdecl memchr(const void *, int, size_t);
  79. _CRTIMP int __cdecl _memicmp(const void *, const void *, size_t);
  80. #if defined(_M_IA64)
  81. void * __cdecl memmove(void *, const void *, size_t);
  82. #else
  83. _CRTIMP void * __cdecl memmove(void *, const void *, size_t);
  84. #endif
  85. _CRTIMP char * __cdecl strchr(const char *, int);
  86. _CRTIMP int __cdecl _strcmpi(const char *, const char *);
  87. _CRTIMP int __cdecl _stricmp(const char *, const char *);
  88. _CRTIMP int __cdecl strcoll(const char *, const char *);
  89. _CRTIMP int __cdecl _stricoll(const char *, const char *);
  90. _CRTIMP int __cdecl _strncoll(const char *, const char *, size_t);
  91. _CRTIMP int __cdecl _strnicoll(const char *, const char *, size_t);
  92. _CRTIMP size_t __cdecl strcspn(const char *, const char *);
  93. _CRTIMP char * __cdecl _strdup(const char *);
  94. _CRTIMP char * __cdecl _strerror(const char *);
  95. _CRTIMP char * __cdecl strerror(int);
  96. _CRTIMP char * __cdecl _strlwr(char *);
  97. _CRTIMP char * __cdecl strncat(char *, const char *, size_t);
  98. _CRTIMP int __cdecl strncmp(const char *, const char *, size_t);
  99. _CRTIMP int __cdecl _strnicmp(const char *, const char *, size_t);
  100. _CRTIMP char * __cdecl strncpy(char *, const char *, size_t);
  101. _CRTIMP char * __cdecl _strnset(char *, int, size_t);
  102. _CRTIMP char * __cdecl strpbrk(const char *, const char *);
  103. _CRTIMP char * __cdecl strrchr(const char *, int);
  104. _CRTIMP char * __cdecl _strrev(char *);
  105. _CRTIMP size_t __cdecl strspn(const char *, const char *);
  106. _CRTIMP char * __cdecl strstr(const char *, const char *);
  107. _CRTIMP char * __cdecl strtok(char *, const char *);
  108. _CRTIMP char * __cdecl _strupr(char *);
  109. _CRTIMP size_t __cdecl strxfrm (char *, const char *, size_t);
  110. #if !__STDC__
  111. /* prototypes for oldnames.lib functions */
  112. _CRTIMP void * __cdecl memccpy(void *, const void *, int, size_t);
  113. _CRTIMP int __cdecl memicmp(const void *, const void *, size_t);
  114. _CRTIMP int __cdecl strcmpi(const char *, const char *);
  115. _CRTIMP int __cdecl stricmp(const char *, const char *);
  116. _CRTIMP char * __cdecl strdup(const char *);
  117. _CRTIMP char * __cdecl strlwr(char *);
  118. _CRTIMP int __cdecl strnicmp(const char *, const char *, size_t);
  119. _CRTIMP char * __cdecl strnset(char *, int, size_t);
  120. _CRTIMP char * __cdecl strrev(char *);
  121. char * __cdecl strset(char *, int);
  122. _CRTIMP char * __cdecl strupr(char *);
  123. #endif /* !__STDC__ */
  124. #ifndef _WSTRING_DEFINED
  125. /* wide function prototypes, also declared in wchar.h */
  126. _CRTIMP wchar_t * __cdecl wcscat(wchar_t *, const wchar_t *);
  127. _CRTIMP wchar_t * __cdecl wcschr(const wchar_t *, wchar_t);
  128. _CRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *);
  129. _CRTIMP wchar_t * __cdecl wcscpy(wchar_t *, const wchar_t *);
  130. _CRTIMP size_t __cdecl wcscspn(const wchar_t *, const wchar_t *);
  131. _CRTIMP size_t __cdecl wcslen(const wchar_t *);
  132. _CRTIMP wchar_t * __cdecl wcsncat(wchar_t *, const wchar_t *, size_t);
  133. _CRTIMP int __cdecl wcsncmp(const wchar_t *, const wchar_t *, size_t);
  134. _CRTIMP wchar_t * __cdecl wcsncpy(wchar_t *, const wchar_t *, size_t);
  135. _CRTIMP wchar_t * __cdecl wcspbrk(const wchar_t *, const wchar_t *);
  136. _CRTIMP wchar_t * __cdecl wcsrchr(const wchar_t *, wchar_t);
  137. _CRTIMP size_t __cdecl wcsspn(const wchar_t *, const wchar_t *);
  138. _CRTIMP wchar_t * __cdecl wcsstr(const wchar_t *, const wchar_t *);
  139. _CRTIMP wchar_t * __cdecl wcstok(wchar_t *, const wchar_t *);
  140. _CRTIMP wchar_t * __cdecl _wcserror(int);
  141. _CRTIMP wchar_t * __cdecl __wcserror(const wchar_t *);
  142. _CRTIMP wchar_t * __cdecl _wcsdup(const wchar_t *);
  143. _CRTIMP int __cdecl _wcsicmp(const wchar_t *, const wchar_t *);
  144. _CRTIMP int __cdecl _wcsnicmp(const wchar_t *, const wchar_t *, size_t);
  145. _CRTIMP wchar_t * __cdecl _wcsnset(wchar_t *, wchar_t, size_t);
  146. _CRTIMP wchar_t * __cdecl _wcsrev(wchar_t *);
  147. _CRTIMP wchar_t * __cdecl _wcsset(wchar_t *, wchar_t);
  148. _CRTIMP wchar_t * __cdecl _wcslwr(wchar_t *);
  149. _CRTIMP wchar_t * __cdecl _wcsupr(wchar_t *);
  150. _CRTIMP size_t __cdecl wcsxfrm(wchar_t *, const wchar_t *, size_t);
  151. _CRTIMP int __cdecl wcscoll(const wchar_t *, const wchar_t *);
  152. _CRTIMP int __cdecl _wcsicoll(const wchar_t *, const wchar_t *);
  153. _CRTIMP int __cdecl _wcsncoll(const wchar_t *, const wchar_t *, size_t);
  154. _CRTIMP int __cdecl _wcsnicoll(const wchar_t *, const wchar_t *, size_t);
  155. #if !__STDC__
  156. /* old names */
  157. #define wcswcs wcsstr
  158. /* prototypes for oldnames.lib functions */
  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 int __cdecl wcsicoll(const wchar_t *, const wchar_t *);
  168. #endif /* !__STDC__ */
  169. #define _WSTRING_DEFINED
  170. #endif
  171. #ifdef __cplusplus
  172. }
  173. #endif
  174. #endif /* _INC_STRING */