1 /* -*- buffer-read-only: t -*- vi: set ro: */
2 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3 /* A substitute <strings.h>.
5 Copyright (C) 2007-2014 Free Software Foundation, Inc.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, see <http://www.gnu.org/licenses/>. */
20 #ifndef _@GUARD_PREFIX@_STRINGS_H
23 @PRAGMA_SYSTEM_HEADER@
27 /* Minix 3.1.8 has a bug: <sys/types.h> must be included before <strings.h>.
28 But avoid namespace pollution on glibc systems. */
29 #if defined __minix && !defined __GLIBC__
30 # include <sys/types.h>
33 /* The include_next requires a split double-inclusion guard. */
35 # @INCLUDE_NEXT@ @NEXT_STRINGS_H@
38 #ifndef _@GUARD_PREFIX@_STRINGS_H
39 #define _@GUARD_PREFIX@_STRINGS_H
41 #if ! @HAVE_DECL_STRNCASECMP@
47 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
49 /* The definition of _GL_ARG_NONNULL is copied here. */
51 /* The definition of _GL_WARN_ON_USE is copied here. */
58 /* Find the index of the least-significant set bit. */
61 _GL_FUNCDECL_SYS (ffs, int, (int i));
63 _GL_CXXALIAS_SYS (ffs, int, (int i));
64 _GL_CXXALIASWARN (ffs);
65 #elif defined GNULIB_POSIXCHECK
67 # if HAVE_RAW_DECL_FFS
68 _GL_WARN_ON_USE (ffs, "ffs is not portable - use the ffs module");
72 /* Compare strings S1 and S2, ignoring case, returning less than, equal to or
73 greater than zero if S1 is lexicographically less than, equal to or greater
75 Note: This function does not work in multibyte locales. */
76 #if ! @HAVE_STRCASECMP@
77 extern int strcasecmp (char const *s1, char const *s2)
78 _GL_ARG_NONNULL ((1, 2));
80 #if defined GNULIB_POSIXCHECK
81 /* strcasecmp() does not work with multibyte strings:
82 POSIX says that it operates on "strings", and "string" in POSIX is defined
83 as a sequence of bytes, not of characters. */
85 # if HAVE_RAW_DECL_STRCASECMP
86 _GL_WARN_ON_USE (strcasecmp, "strcasecmp cannot work correctly on character "
87 "strings in multibyte locales - "
88 "use mbscasecmp if you care about "
89 "internationalization, or use c_strcasecmp , "
90 "gnulib module c-strcase) if you want a locale "
91 "independent function");
95 /* Compare no more than N bytes of strings S1 and S2, ignoring case,
96 returning less than, equal to or greater than zero if S1 is
97 lexicographically less than, equal to or greater than S2.
98 Note: This function cannot work correctly in multibyte locales. */
99 #if ! @HAVE_DECL_STRNCASECMP@
100 extern int strncasecmp (char const *s1, char const *s2, size_t n)
101 _GL_ARG_NONNULL ((1, 2));
103 #if defined GNULIB_POSIXCHECK
104 /* strncasecmp() does not work with multibyte strings:
105 POSIX says that it operates on "strings", and "string" in POSIX is defined
106 as a sequence of bytes, not of characters. */
108 # if HAVE_RAW_DECL_STRNCASECMP
109 _GL_WARN_ON_USE (strncasecmp, "strncasecmp cannot work correctly on character "
110 "strings in multibyte locales - "
111 "use mbsncasecmp or mbspcasecmp if you care about "
112 "internationalization, or use c_strncasecmp , "
113 "gnulib module c-strcase) if you want a locale "
114 "independent function");
123 #endif /* _@GUARD_PREFIX@_STRING_H */
124 #endif /* _@GUARD_PREFIX@_STRING_H */