home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 14 / hacker14.iso / programacao / cwin / c.exe / $INSTDIR / include / string.h < prev    next >
Encoding:
C/C++ Source or Header  |  2003-12-15  |  5.9 KB  |  207 lines

  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 <colin@bird.fu.is.saga-u.ac.jp>
  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.5 $
  22.  * $Author: earnie $
  23.  * $Date: 2002/11/12 15:29:39 $
  24.  *
  25.  */
  26.  
  27. #ifndef _STRING_H_
  28. #define    _STRING_H_
  29.  
  30. /* All the headers include this file. */
  31. #include <_mingw.h>
  32.  
  33. /*
  34.  * Define size_t, wchar_t and NULL
  35.  */
  36. #define __need_size_t
  37. #define __need_wchar_t
  38. #define    __need_NULL
  39. #ifndef RC_INVOKED
  40. #include <stddef.h>
  41. #endif    /* Not RC_INVOKED */
  42.  
  43. #ifndef RC_INVOKED
  44.  
  45. #ifdef __cplusplus
  46. extern "C" {
  47. #endif
  48.  
  49. /*
  50.  * Prototypes of the ANSI Standard C library string functions.
  51.  */
  52. void*    memchr (const void*, int, size_t);
  53. int     memcmp (const void*, const void*, size_t);
  54. void*     memcpy (void*, const void*, size_t);
  55. void*    memmove (void*, const void*, size_t);
  56. void*    memset (void*, int, size_t);
  57. char*    strcat (char*, const char*);
  58. char*    strchr (const char*, int);
  59. int    strcmp (const char*, const char*);
  60. int    strcoll (const char*, const char*);    /* Compare using locale */
  61. char*    strcpy (char*, const char*);
  62. size_t    strcspn (const char*, const char*);
  63. char*    strerror (int); /* NOTE: NOT an old name wrapper. */
  64.  
  65. size_t    strlen (const char*);
  66. char*    strncat (char*, const char*, size_t);
  67. int    strncmp (const char*, const char*, size_t);
  68. char*    strncpy (char*, const char*, size_t);
  69. char*    strpbrk (const char*, const char*);
  70. char*    strrchr (const char*, int);
  71. size_t    strspn (const char*, const char*);
  72. char*    strstr (const char*, const char*);
  73. char*    strtok (char*, const char*);
  74. size_t    strxfrm (char*, const char*, size_t);
  75.  
  76. #ifndef __STRICT_ANSI__
  77. /*
  78.  * Extra non-ANSI functions provided by the CRTDLL library
  79.  */
  80. char*    _strerror (const char *);
  81. void*    _memccpy (void*, const void*, int, size_t);
  82. int     _memicmp (const void*, const void*, size_t);
  83. char*     _strdup (const char*);
  84. int    _strcmpi (const char*, const char*);
  85. int    _stricmp (const char*, const char*);
  86. int    _stricoll (const char*, const char*);
  87. char*    _strlwr (char*);
  88. int    _strnicmp (const char*, const char*, size_t);
  89. char*    _strnset (char*, int, size_t);
  90. char*    _strrev (char*);
  91. char*    _strset (char*, int);
  92. char*    _strupr (char*);
  93. void    _swab (const char*, char*, size_t);
  94.  
  95. #ifdef __MSVCRT__
  96. int  _strncoll(const char*, const char*, size_t);
  97. int  _strnicoll(const char*, const char*, size_t);
  98. #endif
  99.  
  100. #endif    /* Not __STRICT_ANSI__ */
  101.  
  102. /*
  103.  * Unicode versions of the standard calls.
  104.  */
  105. wchar_t* wcscat (wchar_t*, const wchar_t*);
  106. wchar_t* wcschr (const wchar_t*, wchar_t);
  107. int    wcscmp (const wchar_t*, const wchar_t*);
  108. int    wcscoll (const wchar_t*, const wchar_t*);
  109. wchar_t* wcscpy (wchar_t*, const wchar_t*);
  110. size_t    wcscspn (const wchar_t*, const wchar_t*);
  111. /* Note: No wcserror in CRTDLL. */
  112. size_t    wcslen (const wchar_t*);
  113. wchar_t* wcsncat (wchar_t*, const wchar_t*, size_t);
  114. int    wcsncmp(const wchar_t*, const wchar_t*, size_t);
  115. wchar_t* wcsncpy(wchar_t*, const wchar_t*, size_t);
  116. wchar_t* wcspbrk(const wchar_t*, const wchar_t*);
  117. wchar_t* wcsrchr(const wchar_t*, wchar_t);
  118. size_t    wcsspn(const wchar_t*, const wchar_t*);
  119. wchar_t* wcsstr(const wchar_t*, const wchar_t*);
  120. wchar_t* wcstok(wchar_t*, const wchar_t*);
  121. size_t    wcsxfrm(wchar_t*, const wchar_t*, size_t);
  122.  
  123. #ifndef    __STRICT_ANSI__
  124. /*
  125.  * Unicode versions of non-ANSI functions provided by CRTDLL.
  126.  */
  127.  
  128. /* NOTE: _wcscmpi not provided by CRTDLL, this define is for portability */
  129. #define        _wcscmpi    _wcsicmp
  130.  
  131. wchar_t* _wcsdup (const wchar_t*);
  132. int    _wcsicmp (const wchar_t*, const wchar_t*);
  133. int    _wcsicoll (const wchar_t*, const wchar_t*);
  134. wchar_t* _wcslwr (wchar_t*);
  135. int    _wcsnicmp (const wchar_t*, const wchar_t*, size_t);
  136. wchar_t* _wcsnset (wchar_t*, wchar_t, size_t);
  137. wchar_t* _wcsrev (wchar_t*);
  138. wchar_t* _wcsset (wchar_t*, wchar_t);
  139. wchar_t* _wcsupr (wchar_t*);
  140.  
  141. #ifdef __MSVCRT__
  142. int  _wcsncoll(const wchar_t*, const wchar_t*, size_t);
  143. int  _wcsnicoll(const wchar_t*, const wchar_t*, size_t);
  144. #endif
  145.  
  146.  
  147. #endif    /* Not __STRICT_ANSI__ */
  148.  
  149.  
  150. #ifndef    __STRICT_ANSI__
  151. #ifndef    _NO_OLDNAMES
  152.  
  153. /*
  154.  * Non-underscored versions of non-ANSI functions. They live in liboldnames.a
  155.  * and provide a little extra portability. Also a few extra UNIX-isms like
  156.  * strcasecmp.
  157.  */
  158.  
  159. void*    memccpy (void*, const void*, int, size_t);
  160. int    memicmp (const void*, const void*, size_t);
  161. char*    strdup (const char*);
  162. int    strcmpi (const char*, const char*);
  163. int    stricmp (const char*, const char*);
  164. extern __inline__ int
  165. strcasecmp (const char * __sz1, const char * __sz2)
  166.   {return _stricmp (__sz1, __sz2);}
  167. int    stricoll (const char*, const char*);
  168. char*    strlwr (char*);
  169. int    strnicmp (const char*, const char*, size_t);
  170. extern __inline__ int
  171. strncasecmp (const char * __sz1, const char * __sz2, size_t __sizeMaxCompare)
  172.   {return _strnicmp (__sz1, __sz2, __sizeMaxCompare);}
  173. char*    strnset (char*, int, size_t);
  174. char*    strrev (char*);
  175. char*    strset (char*, int);
  176. char*    strupr (char*);
  177. #ifndef _UWIN
  178. void    swab (const char*, char*, size_t);
  179. #endif /* _UWIN */
  180.  
  181. /* NOTE: There is no _wcscmpi, but this is for compatibility. */
  182. extern __inline__ int
  183. wcscmpi (const wchar_t * __ws1, const wchar_t * __ws2)
  184.   {return _wcsicmp (__ws1, __ws2);}
  185. wchar_t* wcsdup (wchar_t*);
  186. int    wcsicmp (const wchar_t*, const wchar_t*);
  187. int    wcsicoll (const wchar_t*, const wchar_t*);
  188. wchar_t* wcslwr (wchar_t*);
  189. int    wcsnicmp (const wchar_t*, const wchar_t*, size_t);
  190. wchar_t* wcsnset (wchar_t*, wchar_t, size_t);
  191. wchar_t* wcsrev (wchar_t*);
  192. wchar_t* wcsset (wchar_t*, wchar_t);
  193. wchar_t* wcsupr (wchar_t*);
  194.  
  195. #endif    /* Not _NO_OLDNAMES */
  196. #endif    /* Not strict ANSI */
  197.  
  198.  
  199. #ifdef __cplusplus
  200. }
  201. #endif
  202.  
  203. #endif    /* Not RC_INVOKED */
  204.  
  205. #endif    /* Not _STRING_H_ */
  206.  
  207.