1 /* Special casing table.
2 Copyright (C) 2009-2018 Free Software Foundation, Inc.
3 Written by Bruno Haible <bruno@clisp.org>, 2009.
5 This program is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Lesser General Public License as published
7 by the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
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 GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License
16 along with this program. If not, see <https://www.gnu.org/licenses/>. */
20 /* A special casing context.
21 A context is negated through x -> -x. */
26 SCC_AFTER_SOFT_DOTTED
= 2,
32 struct special_casing_rule
34 /* The first two bytes are the code, in big-endian order. The third byte
35 only distinguishes different rules pertaining to the same code. */
36 /*unsigned*/ char code
[3];
38 /* True when this rule is not the last one for the given code. */
39 /*bool*/ unsigned int has_next
: 1;
42 signed int context
: 7;
44 /* Language, or an empty string. */
47 /* Mapping to upper case. Between 0 and 3 characters. Filled with 0s. */
48 unsigned short upper
[3];
50 /* Mapping to lower case. Between 0 and 3 characters. Filled with 0s. */
51 unsigned short lower
[3];
53 /* Mapping to title case. Between 0 and 3 characters. Filled with 0s. */
54 unsigned short title
[3];
56 /* Casefolding mapping. Between 0 and 3 characters. Filled with 0s. */
57 unsigned short casefold
[3];
60 extern const struct special_casing_rule
*
61 gl_unicase_special_lookup (const char *str
, size_t len
);