4 * ISO-C standard header, with MSVC compatible extensions.
8 * Written by Rob Savoye <rob@cygnus.com>
9 * Copyright (C) 1997-2000, 2002-2004, 2007, 2009, 2015, 2016,
13 * Permission is hereby granted, free of charge, to any person obtaining a
14 * copy of this software and associated documentation files (the "Software"),
15 * to deal in the Software without restriction, including without limitation
16 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 * and/or sell copies of the Software, and to permit persons to whom the
18 * Software is furnished to do so, subject to the following conditions:
20 * The above copyright notice, this permission notice, and the following
21 * disclaimer shall be included in all copies or substantial portions of
24 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF OR OTHER
30 * DEALINGS IN THE SOFTWARE.
34 #pragma GCC system_header
37 /* All MinGW system headers must include this...
42 /* ISO-C requires this header to expose definitions for NULL and size_t,
43 * retaining compatiblity with their fundamental <stddef.h> definitions.
47 #ifndef __STRICT_ANSI__
48 /* MSVC extends this requirement to include a definition of wchar_t,
49 * (which contravenes strict ISO-C standards conformity).
51 # define __need_wchar_t
57 #define __STRING_H_SOURCED__
58 /* Prototypes for the ISO-C Standard library string functions.
60 _CRTIMP __cdecl __MINGW_NOTHROW void *memchr (const void *, int, size_t) __MINGW_ATTRIB_PURE;
61 _CRTIMP __cdecl __MINGW_NOTHROW int memcmp (const void *, const void *, size_t) __MINGW_ATTRIB_PURE;
62 _CRTIMP __cdecl __MINGW_NOTHROW void *memcpy (void *, const void *, size_t);
63 _CRTIMP __cdecl __MINGW_NOTHROW void *memmove (void *, const void *, size_t);
64 _CRTIMP __cdecl __MINGW_NOTHROW void *memset (void *, int, size_t);
65 _CRTIMP __cdecl __MINGW_NOTHROW char *strcat (char *, const char *);
66 _CRTIMP __cdecl __MINGW_NOTHROW char *strchr (const char *, int) __MINGW_ATTRIB_PURE;
67 _CRTIMP __cdecl __MINGW_NOTHROW int strcmp (const char *, const char *) __MINGW_ATTRIB_PURE;
68 _CRTIMP __cdecl __MINGW_NOTHROW int strcoll (const char *, const char *); /* Compare using locale */
69 _CRTIMP __cdecl __MINGW_NOTHROW char *strcpy (char *, const char *);
70 _CRTIMP __cdecl __MINGW_NOTHROW size_t strcspn (const char *, const char *) __MINGW_ATTRIB_PURE;
71 _CRTIMP __cdecl __MINGW_NOTHROW char *strerror (int); /* NOTE: NOT an old name wrapper. */
73 _CRTIMP __cdecl __MINGW_NOTHROW size_t strlen (const char *) __MINGW_ATTRIB_PURE;
74 _CRTIMP __cdecl __MINGW_NOTHROW char *strncat (char *, const char *, size_t);
75 _CRTIMP __cdecl __MINGW_NOTHROW int strncmp (const char *, const char *, size_t) __MINGW_ATTRIB_PURE;
76 _CRTIMP __cdecl __MINGW_NOTHROW char *strncpy (char *, const char *, size_t);
77 _CRTIMP __cdecl __MINGW_NOTHROW char *strpbrk (const char *, const char *) __MINGW_ATTRIB_PURE;
78 _CRTIMP __cdecl __MINGW_NOTHROW char *strrchr (const char *, int) __MINGW_ATTRIB_PURE;
79 _CRTIMP __cdecl __MINGW_NOTHROW size_t strspn (const char *, const char *) __MINGW_ATTRIB_PURE;
80 _CRTIMP __cdecl __MINGW_NOTHROW char *strstr (const char *, const char *) __MINGW_ATTRIB_PURE;
81 _CRTIMP __cdecl __MINGW_NOTHROW char *strtok (char *, const char *);
82 _CRTIMP __cdecl __MINGW_NOTHROW size_t strxfrm (char *, const char *, size_t);
84 #ifndef __STRICT_ANSI__
86 * Extra non-ANSI functions provided by the CRTDLL library
88 _CRTIMP __cdecl __MINGW_NOTHROW char *_strerror (const char *);
89 _CRTIMP __cdecl __MINGW_NOTHROW void *_memccpy (void *, const void *, int, size_t);
90 _CRTIMP __cdecl __MINGW_NOTHROW int _memicmp (const void *, const void *, size_t);
91 _CRTIMP __cdecl __MINGW_NOTHROW char *_strdup (const char *) __MINGW_ATTRIB_MALLOC;
92 _CRTIMP __cdecl __MINGW_NOTHROW int _strcmpi (const char *, const char *);
93 _CRTIMP __cdecl __MINGW_NOTHROW int _stricoll (const char *, const char *);
94 _CRTIMP __cdecl __MINGW_NOTHROW char *_strlwr (char *);
95 _CRTIMP __cdecl __MINGW_NOTHROW char *_strnset (char *, int, size_t);
96 _CRTIMP __cdecl __MINGW_NOTHROW char *_strrev (char *);
97 _CRTIMP __cdecl __MINGW_NOTHROW char *_strset (char *, int);
98 _CRTIMP __cdecl __MINGW_NOTHROW char *_strupr (char *);
99 _CRTIMP __cdecl __MINGW_NOTHROW void _swab (const char *, char *, size_t);
101 /* MSVC's non-ANSI _stricmp() and _strnicmp() functions must also be
102 * prototyped here, but we need to share them with <strings.h>, where
103 * we declare their POSIX strcasecmp() and strncasecmp() equivalents;
104 * get the requisite prototypes by selective <strings.h> inclusion.
109 /* These were not present in the CRTDLL prior to the first release of
110 * MSVCRT.DLL, but are available in all versions of that library.
112 _CRTIMP __cdecl __MINGW_NOTHROW int _strncoll(const char *, const char *, size_t);
113 _CRTIMP __cdecl __MINGW_NOTHROW int _strnicoll(const char *, const char *, size_t);
116 # ifndef _NO_OLDNAMES
117 /* Non-underscore decorated versions of non-ANSI functions. They live in the
118 * OLDNAMES libraries, whence they provide a little extra portability.
120 _CRTIMP __cdecl __MINGW_NOTHROW void *memccpy (void *, const void *, int, size_t);
121 _CRTIMP __cdecl __MINGW_NOTHROW int memicmp (const void *, const void *, size_t);
122 _CRTIMP __cdecl __MINGW_NOTHROW char *strdup (const char *) __MINGW_ATTRIB_MALLOC;
123 _CRTIMP __cdecl __MINGW_NOTHROW int strcmpi (const char *, const char *);
124 _CRTIMP __cdecl __MINGW_NOTHROW int stricmp (const char *, const char *);
125 _CRTIMP __cdecl __MINGW_NOTHROW int stricoll (const char *, const char *);
126 _CRTIMP __cdecl __MINGW_NOTHROW char *strlwr (char *);
127 _CRTIMP __cdecl __MINGW_NOTHROW int strnicmp (const char *, const char *, size_t);
128 _CRTIMP __cdecl __MINGW_NOTHROW char *strnset (char *, int, size_t);
129 _CRTIMP __cdecl __MINGW_NOTHROW char *strrev (char *);
130 _CRTIMP __cdecl __MINGW_NOTHROW char *strset (char *, int);
131 _CRTIMP __cdecl __MINGW_NOTHROW char *strupr (char *);
134 /* FIXME: Do we really care that UWin doesn't support this? We are
135 * under no obligation to support UWin.
137 _CRTIMP __cdecl __MINGW_NOTHROW void swab (const char *, char *, size_t);
139 # endif /* ! _UWIN */
140 # endif /* ! _NO_OLDNAMES */
142 /* MSVC also expects <string.h> to declare duplicates of the wchar_t
143 * string functions which are nominally declared in <wchar.h>, (which
144 * is where ISO-C specifies that they should be declared). For the
145 * convenience of applications which rely on this Microsoft anomaly,
146 * inclusion of <wchar.h>, within the current __STRING_H_SOURCED__
147 * scope, will selectively expose the required function prototypes;
148 * however, strictly ISO-C conforming applications should include
149 * <wchar.h> directly; they should not rely on this MSVC specific
150 * anomalous behaviour.
154 #endif /* ! __STRICT_ANSI__ */
155 #undef __STRING_H_SOURCED__
159 #endif /* ! RC_INVOKED */
160 #endif /* !_STRING_H: $RCSfile$: end of file */