]> git.cworth.org Git - tar/blob - lib/strings.in.h
Imported Upstream version 1.20
[tar] / lib / 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 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 /* The include_next requires a split double-inclusion guard.  */
24 #@INCLUDE_NEXT@ @NEXT_STRINGS_H@
25
26 #ifndef _GL_STRINGS_H
27 #define _GL_STRINGS_H
28
29
30 /* The definition of GL_LINK_WARNING is copied here.  */
31
32
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36
37
38 /* Compare strings S1 and S2, ignoring case, returning less than, equal to or
39    greater than zero if S1 is lexicographically less than, equal to or greater
40    than S2.
41    Note: This function does not work in multibyte locales.  */
42 #if ! @HAVE_STRCASECMP@
43 extern int strcasecmp (char const *s1, char const *s2);
44 #endif
45 #if defined GNULIB_POSIXCHECK
46 /* strcasecmp() does not work with multibyte strings:
47    POSIX says that it operates on "strings", and "string" in POSIX is defined
48    as a sequence of bytes, not of characters.   */
49 # undef strcasecmp
50 # define strcasecmp(a,b) \
51     (GL_LINK_WARNING ("strcasecmp cannot work correctly on character strings " \
52                       "in multibyte locales - " \
53                       "use mbscasecmp if you care about " \
54                       "internationalization, or use c_strcasecmp (from " \
55                       "gnulib module c-strcase) if you want a locale " \
56                       "independent function"), \
57      strcasecmp (a, b))
58 #endif
59
60 /* Compare no more than N bytes of strings S1 and S2, ignoring case,
61    returning less than, equal to or greater than zero if S1 is
62    lexicographically less than, equal to or greater than S2.
63    Note: This function cannot work correctly in multibyte locales.  */
64 #if ! @HAVE_DECL_STRNCASECMP@
65 extern int strncasecmp (char const *s1, char const *s2, size_t n);
66 #endif
67 #if defined GNULIB_POSIXCHECK
68 /* strncasecmp() does not work with multibyte strings:
69    POSIX says that it operates on "strings", and "string" in POSIX is defined
70    as a sequence of bytes, not of characters.  */
71 # undef strncasecmp
72 # define strncasecmp(a,b,n) \
73     (GL_LINK_WARNING ("strncasecmp cannot work correctly on character " \
74                       "strings in multibyte locales - " \
75                       "use mbsncasecmp or mbspcasecmp if you care about " \
76                       "internationalization, or use c_strncasecmp (from " \
77                       "gnulib module c-strcase) if you want a locale " \
78                       "independent function"), \
79      strncasecmp (a, b, n))
80 #endif
81
82
83 #ifdef __cplusplus
84 }
85 #endif
86
87 #endif /* _GL_STRING_H */
88 #endif /* _GL_STRING_H */