1 /* Canonical combining classes of Unicode characters.
2 Copyright (C) 2002, 2006-2007, 2011-2014 Free Software Foundation, Inc.
3 Written by Bruno Haible <bruno@clisp.org>, 2011.
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/>. */
25 static const signed char u_combining_class_index_part1[10] =
27 0, /* Not Reordered */
38 static const signed char u_combining_class_index_part2[241 - 200] =
40 5, /* Attached Below Left */
42 6, /* Attached Below */
54 7, /* Attached Above */
56 8, /* Attached Above Right */
73 17, /* Double Below */
74 18, /* Double Above */
80 19 /* Iota Subscript */
83 static const char u_combining_class_name[20][5] =
85 "NR", /* Not Reordered */
88 "KV", /* Kana Voicing */
90 "ATBL", /* Attached Below Left */
91 "ATB", /* Attached Below */
92 "ATA", /* Attached Above */
93 "ATAR", /* Attached Above Right */
94 "BL", /* Below Left */
96 "BR", /* Below Right */
99 "AL", /* Above Left */
101 "AR", /* Above Right */
102 "DB", /* Double Below */
103 "DA", /* Double Above */
104 "IS" /* Iota Subscript */
108 uc_combining_class_name (int ccc)
115 index = u_combining_class_index_part1[ccc];
116 else if (ccc >= 200 && ccc < 241)
117 index = u_combining_class_index_part2[ccc - 200];
123 if (index < sizeof (u_combining_class_name) / sizeof (u_combining_class_name[0]))
124 return u_combining_class_name[index];