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