annotate lib/strings.in.h @ 423:079d43b6967b 3.0-beta2 3.0-beta2

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