Import upstream version 1.27
[debian/tar] / gnu / strings.in.h
1 /* -*- buffer-read-only: t -*- vi: set ro: */
2 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3 /* A substitute <strings.h>.
4
5    Copyright (C) 2007-2013 Free Software Foundation, Inc.
6
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)
10    any later version.
11
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.
16
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/>.  */
19
20 #ifndef _@GUARD_PREFIX@_STRINGS_H
21
22 #if __GNUC__ >= 3
23 @PRAGMA_SYSTEM_HEADER@
24 #endif
25 @PRAGMA_COLUMNS@
26
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>
31 #endif
32
33 /* The include_next requires a split double-inclusion guard.  */
34 #if @HAVE_STRINGS_H@
35 # @INCLUDE_NEXT@ @NEXT_STRINGS_H@
36 #endif
37
38 #ifndef _@GUARD_PREFIX@_STRINGS_H
39 #define _@GUARD_PREFIX@_STRINGS_H
40
41 #if ! @HAVE_DECL_STRNCASECMP@
42 /* Get size_t.  */
43 # include <stddef.h>
44 #endif
45
46
47 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
48
49 /* The definition of _GL_ARG_NONNULL is copied here.  */
50
51 /* The definition of _GL_WARN_ON_USE is copied here.  */
52
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56
57
58   /* Find the index of the least-significant set bit.  */
59 #if @GNULIB_FFS@
60 # if !@HAVE_FFS@
61 _GL_FUNCDECL_SYS (ffs, int, (int i));
62 # endif
63 _GL_CXXALIAS_SYS (ffs, int, (int i));
64 _GL_CXXALIASWARN (ffs);
65 #elif defined GNULIB_POSIXCHECK
66 # undef ffs
67 # if HAVE_RAW_DECL_FFS
68 _GL_WARN_ON_USE (ffs, "ffs is not portable - use the ffs module");
69 # endif
70 #endif
71
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
74    than S2.
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));
79 #endif
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.   */
84 # undef strcasecmp
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");
92 # endif
93 #endif
94
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));
102 #endif
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.  */
107 # undef strncasecmp
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");
115 # endif
116 #endif
117
118
119 #ifdef __cplusplus
120 }
121 #endif
122
123 #endif /* _@GUARD_PREFIX@_STRING_H */
124 #endif /* _@GUARD_PREFIX@_STRING_H */