Use orthodox libtoology in `guile'.
[bpt/guile.git] / lib / strings.in.h
CommitLineData
103dc4d4
LC
1/* A substitute <strings.h>.
2
e65fc94b 3 Copyright (C) 2007-2008 Free Software Foundation, Inc.
103dc4d4
LC
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2, or (at your option)
8 any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with this program; if not, write to the Free Software Foundation,
17 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
18
19#ifndef _GL_STRINGS_H
20
e65fc94b
LC
21@PRAGMA_SYSTEM_HEADER@
22
103dc4d4
LC
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
34extern "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@
43extern 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@
65extern 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 */