1 /* Special casing table.
2 Copyright (C) 2009-2014 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 <http://www.gnu.org/licenses/>. */
19 /* A special casing context.
20 A context is negated through x -> -x. */
25 SCC_AFTER_SOFT_DOTTED = 2,
31 struct special_casing_rule
33 /* The first two bytes are the code, in big-endian order. The third byte
34 only distinguishes different rules pertaining to the same code. */
35 /*unsigned*/ char code[3];
37 /* True when this rule is not the last one for the given code. */
38 /*bool*/ unsigned int has_next : 1;
41 signed int context : 7;
43 /* Language, or an empty string. */
46 /* Mapping to upper case. Between 0 and 3 characters. Filled with 0s. */
47 unsigned short upper[3];
49 /* Mapping to lower case. Between 0 and 3 characters. Filled with 0s. */
50 unsigned short lower[3];
52 /* Mapping to title case. Between 0 and 3 characters. Filled with 0s. */
53 unsigned short title[3];
55 /* Casefolding mapping. Between 0 and 3 characters. Filled with 0s. */
56 unsigned short casefold[3];
59 extern const struct special_casing_rule *
60 gl_unicase_special_lookup (const char *str, unsigned int len);