annotate lib/mbmemcasecoll.h @ 40186:8964917f9574

autoupdate
author Karl Berry <karl@freefriends.org>
date Mon, 18 Feb 2019 08:02:49 -0800
parents b06060465f09
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11393
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Locale-specific case-ignoring memory comparison.
40057
b06060465f09 maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents: 19484
diff changeset
2 Copyright (C) 2001, 2009-2019 Free Software Foundation, Inc.
11393
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 This program is free software: you can redistribute it and/or modify it
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 under the terms of the GNU Lesser General Public License as published
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 by the Free Software Foundation; either version 3 of the License, or
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 (at your option) any later version.
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 Lesser General Public License for more details.
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 You should have received a copy of the GNU Lesser General Public License
19190
9759915b2aca all: prefer https: URLs
Paul Eggert <eggert@cs.ucla.edu>
parents: 18626
diff changeset
15 along with this program. If not, see <https://www.gnu.org/licenses/>. */
11393
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 /* Written by Bruno Haible <bruno@clisp.org>, 2001. */
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 #ifndef MBMEMCASECOLL_H
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20 #define MBMEMCASECOLL_H
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 #include <stdbool.h>
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 #include <stddef.h>
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 #ifdef __cplusplus
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 extern "C" {
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27 #endif
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30 /* Compare the memory regions S1 = [s1..s1+s1len-1], S2 = [s2..s2+s2len-1],
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 that contain character sequences, using the rules of the current locale,
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32 ignoring case.
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 HARD_LC_COLLATE is false if the LC_COLLATE category of the current locale
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 is equivalent to the "C" locale.
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 This function's result is locale dependent. Unlike memcasecmp(), it works
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 correctly in multibyte locales and also handles Turkish i / dotless i.
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38 Unlike ulc_casecmp(), it does not handle the German sharp s and the Greek
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 final sigma. Like memcoll() and ulc_casecoll(), it uses collation order.
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 Return a negative number if S1 < S2, a positive number if S1 > S2, 0 if
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42 S1 and S2 have the same contents, or an unspecified value if there is an
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 error.
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 Set errno to an error number if there is an error, and to zero otherwise.
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
45
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
46 Note: This function may, in multibyte locales, return 0 for strings of
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
47 different lengths! */
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
48
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
49 extern int mbmemcasecoll (const char *s1, size_t s1len,
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11393
diff changeset
50 const char *s2, size_t s2len,
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11393
diff changeset
51 bool hard_LC_COLLATE);
11393
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
52
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
53
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
54 #ifdef __cplusplus
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
55 }
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
56 #endif
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
57
fed5074dc3ea New module 'mbmemcasecoll'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
58 #endif /* MBMEMCASECOLL_H */