4 * Definitions for memory and string functions.
6 * This file is part of the Mingw32 package.
9 * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
11 * THIS SOFTWARE IS NOT COPYRIGHTED
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
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 * DISCLAMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23 * $Date: 2001/09/23 22:14:02 $
26 /* Appropriated for Reactos Crtdll by Ariadne */
27 /* changed prototype for _strerror */
28 /* moved prototype for swab from string.h to stdlib.h */
39 * Define size_t, wchar_t and NULL
42 #define __need_wchar_t
44 #include <crtdll/stddef.h>
46 char * ___strtok
; // removed extern specifier 02-06-98, BD
49 * Prototypes of the ANSI Standard C library string functions.
51 void* memchr (const void* p
, int cSearchFor
, size_t sizeSearch
);
52 int memcmp (const void* p1
, const void* p2
, size_t sizeSearch
);
53 void* memcpy (void* pCopyTo
, const void* pSource
, size_t sizeSource
);
54 void* memmove (void* pMoveTo
, const void* pSource
, size_t sizeSource
);
55 void* memset (void* p
, int cFill
, size_t sizeRepeatCount
);
56 char* strcat (char* szAddTo
, const char* szAdd
);
57 char* strchr (const char* szSearch
, int cFor
);
58 int strcmp (const char* sz1
, const char* sz2
);
59 int strcoll (const char* sz1
, const char* sz2
); /* Compare using locale */
60 char* strcpy (char* szCopyTo
, const char* szSource
);
61 size_t strcspn (const char* szGetPrefix
, const char* szNotIncluding
);
62 char* strerror (int nError
); /* NOTE: NOT an old name wrapper. */
63 char * _strerror(const char *s
);
64 size_t strlen (const char* sz
);
65 size_t strnlen (const char* sz
, size_t count
); // not exported
66 char* strncat (char* szAddTo
, const char* szAdd
, size_t sizeMaxAdd
);
67 int strncmp (const char* sz1
, const char* sz2
, size_t sizeMaxCompare
);
68 char* strncpy (char* szCopyTo
, const char* szSource
, size_t sizeMaxCopy
);
69 char* strpbrk (const char* szSearch
, const char* szAnyOf
);
70 char* strrchr (const char* szSearch
, int cFor
);
71 size_t strspn (const char* szGetPrefix
, const char *szIncluding
);
72 char* strstr (const char* szSearch
, const char *szFor
);
73 char* strtok (char* szTokenize
, const char* szDelimiters
);
74 size_t strxfrm (char* szTransformed
, const char *szSource
,
75 size_t sizeTransform
);
77 #ifndef __STRICT_ANSI__
79 * Extra non-ANSI functions provided by the CRTDLL library
81 void* _memccpy (void* pCopyTo
, const void* pSource
, int cTerminator
,
83 int _memicmp (const void* p1
, const void* p2
, size_t sizeSearch
);
84 char* _strdup (const char *szDuplicate
);
85 int _strcmpi (const char* sz1
, const char* sz2
);
86 int _stricmp (const char* sz1
, const char* sz2
);
87 int _stricoll (const char* sz1
, const char* sz2
);
88 char* _strlwr (char* szToConvert
);
89 int _strnicmp (const char* sz1
, const char* sz2
,
90 size_t sizeMaxCompare
);
91 char* _strnset (char* szToFill
, int cFill
, size_t sizeMaxFill
);
92 char* _strrev (char* szToReverse
);
93 char* _strset (char* szToFill
, int cFill
);
94 char* _strupr (char* szToConvert
);
97 #endif /* Not __STRICT_ANSI__ */
101 * Unicode versions of the standard calls.
103 wchar_t* wcscat (wchar_t* wsAddTo
, const wchar_t* wsAdd
);
104 wchar_t* wcschr (const wchar_t* wsSearch
, wchar_t wcFor
);
105 int wcscmp (const wchar_t* ws1
, const wchar_t* ws2
);
106 int wcscoll (const wchar_t* ws1
, const wchar_t* ws2
);
107 wchar_t* wcscpy (wchar_t* wsCopyTo
, const wchar_t* wsSource
);
108 size_t wcscspn (const wchar_t* wsGetPrefix
, const wchar_t* wsNotIncluding
);
109 /* Note: No wcserror in CRTDLL. */
110 size_t wcslen (const wchar_t* ws
);
111 wchar_t* wcsncat (wchar_t* wsAddTo
, const wchar_t* wsAdd
, size_t sizeMaxAdd
);
112 int wcsncmp(const wchar_t* ws1
, const wchar_t* ws2
, size_t sizeMaxCompare
);
113 wchar_t* wcsncpy(wchar_t* wsCopyTo
, const wchar_t* wsSource
,
115 wchar_t* wcspbrk(const wchar_t* wsSearch
, const wchar_t* wsAnyOf
);
116 wchar_t* wcsrchr(const wchar_t* wsSearch
, wchar_t wcFor
);
117 size_t wcsspn(const wchar_t* wsGetPrefix
, const wchar_t* wsIncluding
);
118 wchar_t* wcsstr(const wchar_t* wsSearch
, const wchar_t* wsFor
);
119 wchar_t* wcstok(wchar_t* wsTokenize
, const wchar_t* wsDelimiters
);
120 size_t wcsxfrm(wchar_t* wsTransformed
, const wchar_t *wsSource
,
121 size_t sizeTransform
);
124 #ifndef __STRICT_ANSI__
126 * Unicode versions of non-ANSI functions provided by CRTDLL.
129 /* NOTE: _wcscmpi not provided by CRTDLL, this define is for portability */
130 #define _wcscmpi _wcsicmp
132 wchar_t* _wcsdup (const wchar_t* wsToDuplicate
);
133 int _wcsicmp (const wchar_t* ws1
, const wchar_t* ws2
);
134 int _wcsicoll (const wchar_t* ws1
, const wchar_t* ws2
);
135 wchar_t* _wcslwr (wchar_t* wsToConvert
);
136 int _wcsnicmp (const wchar_t* ws1
, const wchar_t* ws2
,
137 size_t sizeMaxCompare
);
138 wchar_t* _wcsnset (wchar_t* wsToFill
, wchar_t wcFill
, size_t sizeMaxFill
);
139 wchar_t* _wcsrev (wchar_t* wsToReverse
);
140 wchar_t* _wcsset (wchar_t* wsToFill
, wchar_t wcToFill
);
141 wchar_t* _wcsupr (wchar_t* wsToConvert
);
143 #endif /* Not __STRICT_ANSI__ */
146 #ifndef __STRICT_ANSI__
150 * Non-underscored versions of non-ANSI functions. They live in liboldnames.a
151 * and provide a little extra portability. Also a few extra UNIX-isms like
155 void* memccpy (void* pCopyTo
, const void* pSource
, int cTerminator
,
157 int memicmp (const void* p1
, const void* p2
, size_t sizeSearch
);
158 #define strdup(szDuplicate) _strdup(szDuplicate)
159 int strcmpi (const char* sz1
, const char* sz2
);
160 int stricmp (const char* sz1
, const char* sz2
);
161 int strcasecmp (const char* sz1
, const char* sz2
);
162 int stricoll (const char* sz1
, const char* sz2
);
163 char* strlwr (char* szToConvert
);
164 int strnicmp (const char* sz1
, const char* sz2
, size_t sizeMaxCompare
);
165 int strncasecmp (const char* sz1
, const char* sz2
, size_t sizeMaxCompare
);
166 char* strnset (char* szToFill
, int cFill
, size_t sizeMaxFill
);
167 char* strrev (char* szToReverse
);
168 char* strset (char* szToFill
, int cFill
);
169 char* strupr (char* szToConvert
);
172 /* NOTE: There is no _wcscmpi, but this is for compatibility. */
173 int wcscmpi (const wchar_t* ws1
, const wchar_t* ws2
);
174 wchar_t* wcsdup (const wchar_t* wsToDuplicate
);
175 int wcsicmp (const wchar_t* ws1
, const wchar_t* ws2
);
176 int wcsicoll (const wchar_t* ws1
, const wchar_t* ws2
);
177 wchar_t* wcslwr (wchar_t* wsToConvert
);
178 int wcsnicmp (const wchar_t* ws1
, const wchar_t* ws2
,
179 size_t sizeMaxCompare
);
180 wchar_t* wcsnset (wchar_t* wsToFill
, wchar_t wcFill
, size_t sizeMaxFill
);
181 wchar_t* wcsrev (wchar_t* wsToReverse
);
182 wchar_t* wcsset (wchar_t* wsToFill
, wchar_t wcToFill
);
183 wchar_t* wcsupr (wchar_t* wsToConvert
);
185 #endif /* Not _NO_OLDNAMES */
186 #endif /* Not strict ANSI */