string.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. /*
  2. * string.h
  3. *
  4. * Definitions for memory and string functions.
  5. *
  6. * This file is part of the Mingw32 package.
  7. *
  8. * Contributors:
  9. * Created by Colin Peters <[email protected]>
  10. *
  11. * THIS SOFTWARE IS NOT COPYRIGHTED
  12. *
  13. * This source code is offered for use in the public domain. You may
  14. * use, modify or distribute it freely.
  15. *
  16. * This code is distributed in the hope that it will be useful but
  17. * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
  18. * DISCLAIMED. This includes but is not limited to warranties of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  20. *
  21. * $Revision: 1.2 $
  22. * $Author: bellard $
  23. * $Date: 2005/04/17 13:14:29 $
  24. *
  25. */
  26. #ifndef _STRING_H_
  27. #define _STRING_H_
  28. /* All the headers include this file. */
  29. #include <_mingw.h>
  30. /*
  31. * Define size_t, wchar_t and NULL
  32. */
  33. #define __need_size_t
  34. #define __need_wchar_t
  35. #define __need_NULL
  36. #ifndef RC_INVOKED
  37. #include <stddef.h>
  38. #endif /* Not RC_INVOKED */
  39. #ifndef RC_INVOKED
  40. #ifdef __cplusplus
  41. extern "C" {
  42. #endif
  43. /*
  44. * Prototypes of the ANSI Standard C library string functions.
  45. */
  46. void* memchr (const void*, int, size_t);
  47. int memcmp (const void*, const void*, size_t);
  48. void* memcpy (void*, const void*, size_t);
  49. void* memmove (void*, const void*, size_t);
  50. void* memset (void*, int, size_t);
  51. char* strcat (char*, const char*);
  52. char* strchr (const char*, int);
  53. int strcmp (const char*, const char*);
  54. int strcoll (const char*, const char*); /* Compare using locale */
  55. char* strcpy (char*, const char*);
  56. size_t strcspn (const char*, const char*);
  57. char* strerror (int); /* NOTE: NOT an old name wrapper. */
  58. char* _strerror (const char *);
  59. size_t strlen (const char*);
  60. char* strncat (char*, const char*, size_t);
  61. int strncmp (const char*, const char*, size_t);
  62. char* strncpy (char*, const char*, size_t);
  63. char* strpbrk (const char*, const char*);
  64. char* strrchr (const char*, int);
  65. size_t strspn (const char*, const char*);
  66. char* strstr (const char*, const char*);
  67. char* strtok (char*, const char*);
  68. size_t strxfrm (char*, const char*, size_t);
  69. #ifndef __STRICT_ANSI__
  70. /*
  71. * Extra non-ANSI functions provided by the CRTDLL library
  72. */
  73. void* _memccpy (void*, const void*, int, size_t);
  74. int _memicmp (const void*, const void*, size_t);
  75. char* _strdup (const char*);
  76. int _strcmpi (const char*, const char*);
  77. int _stricmp (const char*, const char*);
  78. int _stricoll (const char*, const char*);
  79. char* _strlwr (char*);
  80. int _strnicmp (const char*, const char*, size_t);
  81. char* _strnset (char*, int, size_t);
  82. char* _strrev (char*);
  83. char* _strset (char*, int);
  84. char* _strupr (char*);
  85. void _swab (const char*, char*, size_t);
  86. /*
  87. * Multi-byte character functions
  88. */
  89. unsigned char* _mbschr (unsigned char*, unsigned char*);
  90. unsigned char* _mbsncat (unsigned char*, const unsigned char*, size_t);
  91. unsigned char* _mbstok (unsigned char*, unsigned char*);
  92. #ifdef __MSVCRT__
  93. int _strncoll(const char*, const char*, size_t);
  94. int _strnicoll(const char*, const char*, size_t);
  95. #endif
  96. #endif /* Not __STRICT_ANSI__ */
  97. /*
  98. * Unicode versions of the standard calls.
  99. */
  100. wchar_t* wcscat (wchar_t*, const wchar_t*);
  101. wchar_t* wcschr (const wchar_t*, wchar_t);
  102. int wcscmp (const wchar_t*, const wchar_t*);
  103. int wcscoll (const wchar_t*, const wchar_t*);
  104. wchar_t* wcscpy (wchar_t*, const wchar_t*);
  105. size_t wcscspn (const wchar_t*, const wchar_t*);
  106. /* Note: No wcserror in CRTDLL. */
  107. size_t wcslen (const wchar_t*);
  108. wchar_t* wcsncat (wchar_t*, const wchar_t*, size_t);
  109. int wcsncmp(const wchar_t*, const wchar_t*, size_t);
  110. wchar_t* wcsncpy(wchar_t*, const wchar_t*, size_t);
  111. wchar_t* wcspbrk(const wchar_t*, const wchar_t*);
  112. wchar_t* wcsrchr(const wchar_t*, wchar_t);
  113. size_t wcsspn(const wchar_t*, const wchar_t*);
  114. wchar_t* wcsstr(const wchar_t*, const wchar_t*);
  115. wchar_t* wcstok(wchar_t*, const wchar_t*);
  116. size_t wcsxfrm(wchar_t*, const wchar_t*, size_t);
  117. #ifndef __STRICT_ANSI__
  118. /*
  119. * Unicode versions of non-ANSI functions provided by CRTDLL.
  120. */
  121. /* NOTE: _wcscmpi not provided by CRTDLL, this define is for portability */
  122. #define _wcscmpi _wcsicmp
  123. wchar_t* _wcsdup (wchar_t*);
  124. int _wcsicmp (const wchar_t*, const wchar_t*);
  125. int _wcsicoll (const wchar_t*, const wchar_t*);
  126. wchar_t* _wcslwr (wchar_t*);
  127. int _wcsnicmp (const wchar_t*, const wchar_t*, size_t);
  128. wchar_t* _wcsnset (wchar_t*, wchar_t, size_t);
  129. wchar_t* _wcsrev (wchar_t*);
  130. wchar_t* _wcsset (wchar_t*, wchar_t);
  131. wchar_t* _wcsupr (wchar_t*);
  132. #ifdef __MSVCRT__
  133. int _wcsncoll(const wchar_t*, const wchar_t*, size_t);
  134. int _wcsnicoll(const wchar_t*, const wchar_t*, size_t);
  135. #endif
  136. #endif /* Not __STRICT_ANSI__ */
  137. #ifndef __STRICT_ANSI__
  138. #ifndef _NO_OLDNAMES
  139. /*
  140. * Non-underscored versions of non-ANSI functions. They live in liboldnames.a
  141. * and provide a little extra portability. Also a few extra UNIX-isms like
  142. * strcasecmp.
  143. */
  144. void* memccpy (void*, const void*, int, size_t);
  145. int memicmp (const void*, const void*, size_t);
  146. char* strdup (const char*);
  147. int strcmpi (const char*, const char*);
  148. int stricmp (const char*, const char*);
  149. int strcasecmp (const char*, const char*);
  150. int stricoll (const char*, const char*);
  151. char* strlwr (char*);
  152. int strnicmp (const char*, const char*, size_t);
  153. int strncasecmp (const char*, const char*, size_t);
  154. char* strnset (char*, int, size_t);
  155. char* strrev (char*);
  156. char* strset (char*, int);
  157. char* strupr (char*);
  158. #ifndef _UWIN
  159. void swab (const char*, char*, size_t);
  160. #endif /* _UWIN */
  161. /* NOTE: There is no _wcscmpi, but this is for compatibility. */
  162. int wcscmpi (const wchar_t*, const wchar_t*);
  163. wchar_t* wcsdup (wchar_t*);
  164. int wcsicmp (const wchar_t*, const wchar_t*);
  165. int wcsicoll (const wchar_t*, const wchar_t*);
  166. wchar_t* wcslwr (wchar_t*);
  167. int wcsnicmp (const wchar_t*, const wchar_t*, size_t);
  168. wchar_t* wcsnset (wchar_t*, wchar_t, size_t);
  169. wchar_t* wcsrev (wchar_t*);
  170. wchar_t* wcsset (wchar_t*, wchar_t);
  171. wchar_t* wcsupr (wchar_t*);
  172. #endif /* Not _NO_OLDNAMES */
  173. #endif /* Not strict ANSI */
  174. #ifdef __cplusplus
  175. }
  176. #endif
  177. #endif /* Not RC_INVOKED */
  178. #endif /* Not _STRING_H_ */