1 /* -*- buffer-read-only: t -*- vi: set ro: */
2 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3 /* A substitute <strings.h>.
5 Copyright (C) 2007-2011 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, write to the Free Software Foundation,
19 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
21 #ifndef _@GUARD_PREFIX@_STRINGS_H
24 @PRAGMA_SYSTEM_HEADER@
28 /* Minix 3.1.8 has a bug: <sys/types.h> must be included before <strings.h>.
29 But avoid namespace pollution on glibc systems. */
30 #if defined __minix && !defined __GLIBC__
31 # include <sys/types.h>
34 /* The include_next requires a split double-inclusion guard. */
35 #@INCLUDE_NEXT@ @NEXT_STRINGS_H@
37 #ifndef _@GUARD_PREFIX@_STRINGS_H
38 #define _@GUARD_PREFIX@_STRINGS_H
41 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
43 /* The definition of _GL_ARG_NONNULL is copied here. */
45 /* The definition of _GL_WARN_ON_USE is copied here. */
52 /* Find the index of the least-significant set bit. */
55 _GL_FUNCDECL_SYS (ffs, int, (int i));
57 _GL_CXXALIAS_SYS (ffs, int, (int i));
58 _GL_CXXALIASWARN (ffs);
59 #elif defined GNULIB_POSIXCHECK
61 # if HAVE_RAW_DECL_FFS
62 _GL_WARN_ON_USE (ffs, "ffs is not portable - use the ffs module");
66 /* Compare strings S1 and S2, ignoring case, returning less than, equal to or
67 greater than zero if S1 is lexicographically less than, equal to or greater
69 Note: This function does not work in multibyte locales. */
70 #if ! @HAVE_STRCASECMP@
71 extern int strcasecmp (char const *s1, char const *s2)
72 _GL_ARG_NONNULL ((1, 2));
74 #if defined GNULIB_POSIXCHECK
75 /* strcasecmp() does not work with multibyte strings:
76 POSIX says that it operates on "strings", and "string" in POSIX is defined
77 as a sequence of bytes, not of characters. */
79 # if HAVE_RAW_DECL_STRCASECMP
80 _GL_WARN_ON_USE (strcasecmp, "strcasecmp cannot work correctly on character "
81 "strings in multibyte locales - "
82 "use mbscasecmp if you care about "
83 "internationalization, or use c_strcasecmp , "
84 "gnulib module c-strcase) if you want a locale "
85 "independent function");
89 /* Compare no more than N bytes of strings S1 and S2, ignoring case,
90 returning less than, equal to or greater than zero if S1 is
91 lexicographically less than, equal to or greater than S2.
92 Note: This function cannot work correctly in multibyte locales. */
93 #if ! @HAVE_DECL_STRNCASECMP@
94 extern int strncasecmp (char const *s1, char const *s2, size_t n)
95 _GL_ARG_NONNULL ((1, 2));
97 #if defined GNULIB_POSIXCHECK
98 /* strncasecmp() does not work with multibyte strings:
99 POSIX says that it operates on "strings", and "string" in POSIX is defined
100 as a sequence of bytes, not of characters. */
102 # if HAVE_RAW_DECL_STRNCASECMP
103 _GL_WARN_ON_USE (strncasecmp, "strncasecmp cannot work correctly on character "
104 "strings in multibyte locales - "
105 "use mbsncasecmp or mbspcasecmp if you care about "
106 "internationalization, or use c_strncasecmp , "
107 "gnulib module c-strcase) if you want a locale "
108 "independent function");
117 #endif /* _@GUARD_PREFIX@_STRING_H */
118 #endif /* _@GUARD_PREFIX@_STRING_H */