annotate lib/strings.in.h @ 440:367bdde181be 3.0

Fixed type in fix
author lost@l-w.ca
date Sat, 30 Oct 2010 11:45:52 -0600
parents b8bf63962a99
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
434
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
1 /* A substitute <strings.h>.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
2
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
3 Copyright (C) 2007-2010 Free Software Foundation, Inc.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
4
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
5 This program is free software; you can redistribute it and/or modify
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
6 it under the terms of the GNU General Public License as published by
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
7 the Free Software Foundation; either version 3, or (at your option)
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
8 any later version.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
9
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
10 This program is distributed in the hope that it will be useful,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
13 GNU General Public License for more details.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
14
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
15 You should have received a copy of the GNU General Public License
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
16 along with this program; if not, write to the Free Software Foundation,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
17 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
18
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
19 #ifndef _GL_STRINGS_H
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
20
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
21 #if __GNUC__ >= 3
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
22 @PRAGMA_SYSTEM_HEADER@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
23 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
24
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
25 /* The include_next requires a split double-inclusion guard. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
26 #@INCLUDE_NEXT@ @NEXT_STRINGS_H@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
27
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
28 #ifndef _GL_STRINGS_H
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
29 #define _GL_STRINGS_H
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
30
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
31
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
32 /* The definition of GL_LINK_WARNING is copied here. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
33
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
34 /* The definition of _GL_ARG_NONNULL is copied here. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
35
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
36
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
37 #ifdef __cplusplus
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
38 extern "C" {
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
39 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
40
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
41
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
42 /* Compare strings S1 and S2, ignoring case, returning less than, equal to or
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
43 greater than zero if S1 is lexicographically less than, equal to or greater
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
44 than S2.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
45 Note: This function does not work in multibyte locales. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
46 #if ! @HAVE_STRCASECMP@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
47 extern int strcasecmp (char const *s1, char const *s2)
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
48 _GL_ARG_NONNULL ((1, 2));
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
49 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
50 #if defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
51 /* strcasecmp() does not work with multibyte strings:
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
52 POSIX says that it operates on "strings", and "string" in POSIX is defined
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
53 as a sequence of bytes, not of characters. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
54 # undef strcasecmp
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
55 # define strcasecmp(a,b) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
56 (GL_LINK_WARNING ("strcasecmp cannot work correctly on character strings " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
57 "in multibyte locales - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
58 "use mbscasecmp if you care about " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
59 "internationalization, or use c_strcasecmp (from " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
60 "gnulib module c-strcase) if you want a locale " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
61 "independent function"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
62 strcasecmp (a, b))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
63 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
64
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
65 /* Compare no more than N bytes of strings S1 and S2, ignoring case,
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
66 returning less than, equal to or greater than zero if S1 is
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
67 lexicographically less than, equal to or greater than S2.
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
68 Note: This function cannot work correctly in multibyte locales. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
69 #if ! @HAVE_DECL_STRNCASECMP@
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
70 extern int strncasecmp (char const *s1, char const *s2, size_t n)
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
71 _GL_ARG_NONNULL ((1, 2));
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
72 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
73 #if defined GNULIB_POSIXCHECK
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
74 /* strncasecmp() does not work with multibyte strings:
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
75 POSIX says that it operates on "strings", and "string" in POSIX is defined
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
76 as a sequence of bytes, not of characters. */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
77 # undef strncasecmp
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
78 # define strncasecmp(a,b,n) \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
79 (GL_LINK_WARNING ("strncasecmp cannot work correctly on character " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
80 "strings in multibyte locales - " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
81 "use mbsncasecmp or mbspcasecmp if you care about " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
82 "internationalization, or use c_strncasecmp (from " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
83 "gnulib module c-strcase) if you want a locale " \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
84 "independent function"), \
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
85 strncasecmp (a, b, n))
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
86 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
87
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
88
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
89 #ifdef __cplusplus
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
90 }
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
91 #endif
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
92
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
93 #endif /* _GL_STRING_H */
b8bf63962a99 Added various generated files for release
lost@l-w.ca
parents:
diff changeset
94 #endif /* _GL_STRING_H */