]> git.cworth.org Git - tar/blob - gnu/strings.in.h
e1d772556d6245c22f8178f7d75f91f9fce5fab4
[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-2010 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, write to the Free Software Foundation,
19    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
20
21 #ifndef _GL_STRINGS_H
22
23 #if __GNUC__ >= 3
24 @PRAGMA_SYSTEM_HEADER@
25 #endif
26
27 /* The include_next requires a split double-inclusion guard.  */
28 #@INCLUDE_NEXT@ @NEXT_STRINGS_H@
29
30 #ifndef _GL_STRINGS_H
31 #define _GL_STRINGS_H
32
33
34 /* The definition of _GL_ARG_NONNULL is copied here.  */
35
36 /* The definition of _GL_WARN_ON_USE is copied here.  */
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41
42
43 /* Compare strings S1 and S2, ignoring case, returning less than, equal to or
44    greater than zero if S1 is lexicographically less than, equal to or greater
45    than S2.
46    Note: This function does not work in multibyte locales.  */
47 #if ! @HAVE_STRCASECMP@
48 extern int strcasecmp (char const *s1, char const *s2)
49      _GL_ARG_NONNULL ((1, 2));
50 #endif
51 #if defined GNULIB_POSIXCHECK
52 /* strcasecmp() does not work with multibyte strings:
53    POSIX says that it operates on "strings", and "string" in POSIX is defined
54    as a sequence of bytes, not of characters.   */
55 # undef strcasecmp
56 # if HAVE_RAW_DECL_STRCASECMP
57 _GL_WARN_ON_USE (strcasecmp, "strcasecmp cannot work correctly on character "
58                  "strings in multibyte locales - "
59                  "use mbscasecmp if you care about "
60                  "internationalization, or use c_strcasecmp , "
61                  "gnulib module c-strcase) if you want a locale "
62                  "independent function");
63 # endif
64 #endif
65
66 /* Compare no more than N bytes of strings S1 and S2, ignoring case,
67    returning less than, equal to or greater than zero if S1 is
68    lexicographically less than, equal to or greater than S2.
69    Note: This function cannot work correctly in multibyte locales.  */
70 #if ! @HAVE_DECL_STRNCASECMP@
71 extern int strncasecmp (char const *s1, char const *s2, size_t n)
72      _GL_ARG_NONNULL ((1, 2));
73 #endif
74 #if defined GNULIB_POSIXCHECK
75 /* strncasecmp() 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.  */
78 # undef strncasecmp
79 # if HAVE_RAW_DECL_STRNCASECMP
80 _GL_WARN_ON_USE (strncasecmp, "strncasecmp cannot work correctly on character "
81                  "strings in multibyte locales - "
82                  "use mbsncasecmp or mbspcasecmp if you care about "
83                  "internationalization, or use c_strncasecmp , "
84                  "gnulib module c-strcase) if you want a locale "
85                  "independent function");
86 # endif
87 #endif
88
89
90 #ifdef __cplusplus
91 }
92 #endif
93
94 #endif /* _GL_STRING_H */
95 #endif /* _GL_STRING_H */