Debian Codegraph @

external/espeak/ucd.h

raw symbols SCIP
1 /* Unicode Character Database API
2 *
3 * Copyright (C) 2012-2018 Reece H. Dunn
4 *
5 * This file is part of ucd-tools.
6 *
7 * ucd-tools is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * ucd-tools is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with ucd-tools. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #ifndef UNICODE_CHARACTER_DATA_H
22 #define UNICODE_CHARACTER_DATA_H
23
24 #include <stdint.h>
25
26 #ifdef __cplusplus
27 extern "C"
28 {
29 #endif
30
31 /** @brief Represents a Unicode codepoint.
32 */
33 typedef uint32_t codepoint_t;
34
35 /** @brief Unicode General Category Groups
36 * @see http://www.unicode.org/reports/tr44/
37 */
38 typedef enum ucd_category_group_
39 {
40 UCD_CATEGORY_GROUP_C, /**< @brief Other */
41 UCD_CATEGORY_GROUP_I, /**< @brief Invalid */
42 UCD_CATEGORY_GROUP_L, /**< @brief Letter */
43 UCD_CATEGORY_GROUP_M, /**< @brief Mark */
44 UCD_CATEGORY_GROUP_N, /**< @brief Number */
45 UCD_CATEGORY_GROUP_P, /**< @brief Punctuation */
46 UCD_CATEGORY_GROUP_S, /**< @brief Symbol */
47 UCD_CATEGORY_GROUP_Z, /**< @brief Separator */
48 } ucd_category_group;
49
50 /** @brief Get a string representation of the category_group enumeration value.
51 *
52 * @param c The value to get the string representation for.
53 *
54 * @return The string representation, or "-" if the value is not recognized.
55 */
56 const char *ucd_get_category_group_string(ucd_category_group c);
57
58 /** @brief Unicode General Category Values
59 * @see http://www.unicode.org/reports/tr44/
60 */
61 typedef enum ucd_category_
62 {
63 UCD_CATEGORY_Cc, /**< @brief Control Character */
64 UCD_CATEGORY_Cf, /**< @brief Format Control Character */
65 UCD_CATEGORY_Cn, /**< @brief Unassigned */
66 UCD_CATEGORY_Co, /**< @brief Private Use */
67 UCD_CATEGORY_Cs, /**< @brief Surrogate Code Point */
68
69 UCD_CATEGORY_Ii, /**< @brief Invalid Unicode Codepoint */
70
71 UCD_CATEGORY_Ll, /**< @brief Lower Case Letter */
72 UCD_CATEGORY_Lm, /**< @brief Letter Modifier */
73 UCD_CATEGORY_Lo, /**< @brief Other Letter */
74 UCD_CATEGORY_Lt, /**< @brief Title Case Letter */
75 UCD_CATEGORY_Lu, /**< @brief Upper Case Letter */
76
77 UCD_CATEGORY_Mc, /**< @brief Spacing Mark */
78 UCD_CATEGORY_Me, /**< @brief Enclosing Mark */
79 UCD_CATEGORY_Mn, /**< @brief Non-Spacing Mark */
80
81 UCD_CATEGORY_Nd, /**< @brief Decimal Digit */
82 UCD_CATEGORY_Nl, /**< @brief Letter-Like Number */
83 UCD_CATEGORY_No, /**< @brief Other Number */
84
85 UCD_CATEGORY_Pc, /**< @brief Connector */
86 UCD_CATEGORY_Pd, /**< @brief Dash/Hyphen */
87 UCD_CATEGORY_Pe, /**< @brief Close Punctuation Mark */
88 UCD_CATEGORY_Pf, /**< @brief Final Quotation Mark */
89 UCD_CATEGORY_Pi, /**< @brief Initial Quotation Mark */
90 UCD_CATEGORY_Po, /**< @brief Other */
91 UCD_CATEGORY_Ps, /**< @brief Open Punctuation Mark */
92
93 UCD_CATEGORY_Sc, /**< @brief Currency Symbol */
94 UCD_CATEGORY_Sk, /**< @brief Modifier Symbol */
95 UCD_CATEGORY_Sm, /**< @brief Math Symbol */
96 UCD_CATEGORY_So, /**< @brief Other Symbol */
97
98 UCD_CATEGORY_Zl, /**< @brief Line Separator */
99 UCD_CATEGORY_Zp, /**< @brief Paragraph Separator */
100 UCD_CATEGORY_Zs, /**< @brief Space Separator */
101 } ucd_category;
102
103 /** @brief Get a string representation of the category enumeration value.
104 *
105 * @param c The value to get the string representation for.
106 *
107 * @return The string representation, or "--" if the value is not recognized.
108 */
109 const char *ucd_get_category_string(ucd_category c);
110
111 /** @brief Lookup the General Category Group for a General Category.
112 *
113 * @param c The General Category to lookup.
114 * @return The General Category Group of the General Category.
115 */
116 ucd_category_group ucd_get_category_group_for_category(ucd_category c);
117
118 /** @brief Lookup the General Category Group for a Unicode codepoint.
119 *
120 * @param c The Unicode codepoint to lookup.
121 * @return The General Category Group of the Unicode codepoint.
122 */
123 ucd_category_group ucd_lookup_category_group(codepoint_t c);
124
125 /** @brief Lookup the General Category for a Unicode codepoint.
126 *
127 * @param c The Unicode codepoint to lookup.
128 * @return The General Category of the Unicode codepoint.
129 */
130 ucd_category ucd_lookup_category(codepoint_t c);
131
132 /** @brief Unicode Script
133 * @see http://www.iana.org/assignments/language-subtag-registry
134 * @see http://www.unicode.org/iso15924/iso15924-codes.html
135 */
136 typedef enum ucd_script_
137 {
138 UCD_SCRIPT_Adlm, /**< @brief Adlam Script */
139 UCD_SCRIPT_Afak, /**< @brief Afaka Script */
140 UCD_SCRIPT_Aghb, /**< @brief Caucasian Albanian Script */
141 UCD_SCRIPT_Ahom, /**< @brief Tai Ahom Script */
142 UCD_SCRIPT_Arab, /**< @brief Arabic Script */
143 UCD_SCRIPT_Armi, /**< @brief Imperial Aramaic Script */
144 UCD_SCRIPT_Armn, /**< @brief Armenian Script */
145 UCD_SCRIPT_Avst, /**< @brief Avestan Script */
146 UCD_SCRIPT_Bali, /**< @brief Balinese Script */
147 UCD_SCRIPT_Bamu, /**< @brief Bamum Script */
148 UCD_SCRIPT_Bass, /**< @brief Bassa Vah Script */
149 UCD_SCRIPT_Batk, /**< @brief Batak Script */
150 UCD_SCRIPT_Beng, /**< @brief Bengali Script */
151 UCD_SCRIPT_Bhks, /**< @brief Bhaiksuki Script */
152 UCD_SCRIPT_Blis, /**< @brief Blissymbols Script */
153 UCD_SCRIPT_Bopo, /**< @brief Bopomofo Script */
154 UCD_SCRIPT_Brah, /**< @brief Brahmi Script */
155 UCD_SCRIPT_Brai, /**< @brief Braille Script */
156 UCD_SCRIPT_Bugi, /**< @brief Buginese Script */
157 UCD_SCRIPT_Buhd, /**< @brief Buhid Script */
158 UCD_SCRIPT_Cakm, /**< @brief Chakma Script */
159 UCD_SCRIPT_Cans, /**< @brief Unified Canadian Aboriginal Syllabics */
160 UCD_SCRIPT_Cari, /**< @brief Carian Script */
161 UCD_SCRIPT_Cham, /**< @brief Cham Script */
162 UCD_SCRIPT_Cher, /**< @brief Cherokee Script */
163 UCD_SCRIPT_Cirt, /**< @brief Cirth Script */
164 UCD_SCRIPT_Copt, /**< @brief Coptic Script */
165 UCD_SCRIPT_Cprt, /**< @brief Cypriot Script */
166 UCD_SCRIPT_Cyrl, /**< @brief Cyrillic Script */
167 UCD_SCRIPT_Cyrs, /**< @brief Cyrillic (Old Church Slavonic variant) Script */
168 UCD_SCRIPT_Deva, /**< @brief Devanagari Script */
169 UCD_SCRIPT_Dogr, /**< @brief Dogra Script */
170 UCD_SCRIPT_Dsrt, /**< @brief Deseret Script */
171 UCD_SCRIPT_Dupl, /**< @brief Duployan Shorthand Script */
172 UCD_SCRIPT_Egyd, /**< @brief Egyptian Demotic Script */
173 UCD_SCRIPT_Egyh, /**< @brief Egyptian Hieratic Script */
174 UCD_SCRIPT_Egyp, /**< @brief Egyptian Hiegoglyphs */
175 UCD_SCRIPT_Elba, /**< @brief Elbasan Script */
176 UCD_SCRIPT_Ethi, /**< @brief Ethiopic Script */
177 UCD_SCRIPT_Geok, /**< @brief Khutsuri Script */
178 UCD_SCRIPT_Geor, /**< @brief Geirgian Script */
179 UCD_SCRIPT_Glag, /**< @brief Glagolitic Script */
180 UCD_SCRIPT_Gong, /**< @brief Gunjala Gondi */
181 UCD_SCRIPT_Gonm, /**< @brief Masaram Gondi */
182 UCD_SCRIPT_Goth, /**< @brief Gothic Script */
183 UCD_SCRIPT_Gran, /**< @brief Grantha Script */
184 UCD_SCRIPT_Grek, /**< @brief Greek Script */
185 UCD_SCRIPT_Gujr, /**< @brief Gujarati Script */
186 UCD_SCRIPT_Guru, /**< @brief Gurmukhi Script */
187 UCD_SCRIPT_Hang, /**< @brief Hangul Script */
188 UCD_SCRIPT_Hani, /**< @brief Han (Hanzi, Kanji, Hanja) Script */
189 UCD_SCRIPT_Hano, /**< @brief Hanunoo Script */
190 UCD_SCRIPT_Hans, /**< @brief Han (Simplified) Script */
191 UCD_SCRIPT_Hant, /**< @brief Han (Traditional) Script */
192 UCD_SCRIPT_Hatr, /**< @brief Hatran Script */
193 UCD_SCRIPT_Hebr, /**< @brief Hebrew Script */
194 UCD_SCRIPT_Hira, /**< @brief Hiragana Script */
195 UCD_SCRIPT_Hluw, /**< @brief Anatolian Hieroglyphs */
196 UCD_SCRIPT_Hmng, /**< @brief Pahawh Hmong Script */
197 UCD_SCRIPT_Hrkt, /**< @brief Japanese Syllabaries */
198 UCD_SCRIPT_Hung, /**< @brief Old Hungarian Script */
199 UCD_SCRIPT_Inds, /**< @brief Indus Script */
200 UCD_SCRIPT_Ital, /**< @brief Old Italic Script */
201 UCD_SCRIPT_Java, /**< @brief Javanese Script */
202 UCD_SCRIPT_Jpan, /**< @brief Japanese (Han + Hiragana + Katakana) Scripts */
203 UCD_SCRIPT_Jurc, /**< @brief Jurchen Script */
204 UCD_SCRIPT_Kali, /**< @brief Kayah Li Script */
205 UCD_SCRIPT_Kana, /**< @brief Katakana Script */
206 UCD_SCRIPT_Khar, /**< @brief Kharoshthi Script */
207 UCD_SCRIPT_Khmr, /**< @brief Khmer Script */
208 UCD_SCRIPT_Khoj, /**< @brief Khojki Script */
209 UCD_SCRIPT_Knda, /**< @brief Kannada Script */
210 UCD_SCRIPT_Kore, /**< @brief Korean (Hangul + Han) Scripts */
211 UCD_SCRIPT_Kpel, /**< @brief Kpelle Script */
212 UCD_SCRIPT_Kthi, /**< @brief Kaithi Script */
213 UCD_SCRIPT_Lana, /**< @brief Tai Tham Script */
214 UCD_SCRIPT_Laoo, /**< @brief Lao Script */
215 UCD_SCRIPT_Latf, /**< @brief Latin Script (Fractur Variant) */
216 UCD_SCRIPT_Latg, /**< @brief Latin Script (Gaelic Variant) */
217 UCD_SCRIPT_Latn, /**< @brief Latin Script */
218 UCD_SCRIPT_Lepc, /**< @brief Lepcha Script */
219 UCD_SCRIPT_Limb, /**< @brief Limbu Script */
220 UCD_SCRIPT_Lina, /**< @brief Linear A Script */
221 UCD_SCRIPT_Linb, /**< @brief Linear B Script */
222 UCD_SCRIPT_Lisu, /**< @brief Lisu Script */
223 UCD_SCRIPT_Loma, /**< @brief Loma Script */
224 UCD_SCRIPT_Lyci, /**< @brief Lycian Script */
225 UCD_SCRIPT_Lydi, /**< @brief Lydian Script */
226 UCD_SCRIPT_Mahj, /**< @brief Mahajani Script */
227 UCD_SCRIPT_Maka, /**< @brief Makasar Script */
228 UCD_SCRIPT_Mand, /**< @brief Mandaic Script */
229 UCD_SCRIPT_Mani, /**< @brief Manichaean Script */
230 UCD_SCRIPT_Marc, /**< @brief Marchen Script */
231 UCD_SCRIPT_Maya, /**< @brief Mayan Hieroglyphs */
232 UCD_SCRIPT_Medf, /**< @brief Medefaidrin (Oberi Okaime) Script */
233 UCD_SCRIPT_Mend, /**< @brief Mende Kikakui Script */
234 UCD_SCRIPT_Merc, /**< @brief Meroitic Cursive Script */
235 UCD_SCRIPT_Mero, /**< @brief Meroitic Hieroglyphs */
236 UCD_SCRIPT_Mlym, /**< @brief Malayalam Script */
237 UCD_SCRIPT_Modi, /**< @brief Modi Script */
238 UCD_SCRIPT_Mong, /**< @brief Mongolian Script */
239 UCD_SCRIPT_Moon, /**< @brief Moon Script */
240 UCD_SCRIPT_Mroo, /**< @brief Mro Script */
241 UCD_SCRIPT_Mtei, /**< @brief Meitei Mayek Script */
242 UCD_SCRIPT_Mult, /**< @brief Multani Script */
243 UCD_SCRIPT_Mymr, /**< @brief Myanmar (Burmese) Script */
244 UCD_SCRIPT_Narb, /**< @brief Old North Arabian Script */
245 UCD_SCRIPT_Nbat, /**< @brief Nabataean Script */
246 UCD_SCRIPT_Newa, /**< @brief Newa Script */
247 UCD_SCRIPT_Nkgb, /**< @brief Nakhi Geba Script */
248 UCD_SCRIPT_Nkoo, /**< @brief N'Ko Script */
249 UCD_SCRIPT_Nshu, /**< @brief Nushu Script */
250 UCD_SCRIPT_Ogam, /**< @brief Ogham Script */
251 UCD_SCRIPT_Olck, /**< @brief Ol Chiki Script */
252 UCD_SCRIPT_Orkh, /**< @brief Old Turkic Script */
253 UCD_SCRIPT_Orya, /**< @brief Oriya Script */
254 UCD_SCRIPT_Osge, /**< @brief Osage Script */
255 UCD_SCRIPT_Osma, /**< @brief Osmanya Script */
256 UCD_SCRIPT_Palm, /**< @brief Palmyrene Script */
257 UCD_SCRIPT_Pauc, /**< @brief Pau Cin Hau Script */
258 UCD_SCRIPT_Perm, /**< @brief Old Permic */
259 UCD_SCRIPT_Phag, /**< @brief Phags-Pa Script */
260 UCD_SCRIPT_Phli, /**< @brief Inscriptional Pahlavi Script */
261 UCD_SCRIPT_Phlp, /**< @brief Psalter Pahlavi Script */
262 UCD_SCRIPT_Phlv, /**< @brief Book Pahlavi Script */
263 UCD_SCRIPT_Phnx, /**< @brief Phoenician Script */
264 UCD_SCRIPT_Plrd, /**< @brief Miao Script */
265 UCD_SCRIPT_Prti, /**< @brief Inscriptional Parthian Script */
266 UCD_SCRIPT_Qaak, /**< @brief Klingon Script (Private Use) */
267 UCD_SCRIPT_Rjng, /**< @brief Rejang Script */
268 UCD_SCRIPT_Rohg, /**< @brief Hanifi Rohingya Script */
269 UCD_SCRIPT_Roro, /**< @brief Rongorongo Script */
270 UCD_SCRIPT_Runr, /**< @brief Runic Script */
271 UCD_SCRIPT_Samr, /**< @brief Samaritan Script */
272 UCD_SCRIPT_Sara, /**< @brief Sarati Script */
273 UCD_SCRIPT_Sarb, /**< @brief Old South Arabian Script */
274 UCD_SCRIPT_Saur, /**< @brief Saurashtra Script */
275 UCD_SCRIPT_Sgnw, /**< @brief Sign Writing */
276 UCD_SCRIPT_Shaw, /**< @brief Shavian Script */
277 UCD_SCRIPT_Shrd, /**< @brief Sharada Script */
278 UCD_SCRIPT_Sidd, /**< @brief Siddham Script */
279 UCD_SCRIPT_Sind, /**< @brief Sindhi Script */
280 UCD_SCRIPT_Sinh, /**< @brief Sinhala Script */
281 UCD_SCRIPT_Sogd, /**< @brief Sogdian Script */
282 UCD_SCRIPT_Sogo, /**< @brief Old Sogdian Script */
283 UCD_SCRIPT_Sora, /**< @brief Sora Sompeng Script */
284 UCD_SCRIPT_Soyo, /**< @brief Soyombo */
285 UCD_SCRIPT_Sund, /**< @brief Sundanese Script */
286 UCD_SCRIPT_Sylo, /**< @brief Syloti Nagri Script */
287 UCD_SCRIPT_Syrc, /**< @brief Syriac Script */
288 UCD_SCRIPT_Syre, /**< @brief Syriac Script (Estrangelo Variant) */
289 UCD_SCRIPT_Syrj, /**< @brief Syriac Script (Western Variant) */
290 UCD_SCRIPT_Syrn, /**< @brief Syriac Script (Eastern Variant) */
291 UCD_SCRIPT_Tagb, /**< @brief Tagbanwa Script */
292 UCD_SCRIPT_Takr, /**< @brief Takri Script */
293 UCD_SCRIPT_Tale, /**< @brief Tai Le Script */
294 UCD_SCRIPT_Talu, /**< @brief New Tai Lue Script */
295 UCD_SCRIPT_Taml, /**< @brief Tamil Script */
296 UCD_SCRIPT_Tang, /**< @brief Tangut Script */
297 UCD_SCRIPT_Tavt, /**< @brief Tai Viet Script */
298 UCD_SCRIPT_Telu, /**< @brief Telugu Script */
299 UCD_SCRIPT_Teng, /**< @brief Tengwar Script */
300 UCD_SCRIPT_Tfng, /**< @brief Tifinagh Script */
301 UCD_SCRIPT_Tglg, /**< @brief Tagalog Script */
302 UCD_SCRIPT_Thaa, /**< @brief Thaana Script */
303 UCD_SCRIPT_Thai, /**< @brief Thai Script */
304 UCD_SCRIPT_Tibt, /**< @brief Tibetan Script */
305 UCD_SCRIPT_Tirh, /**< @brief Tirhuta Script */
306 UCD_SCRIPT_Ugar, /**< @brief Ugaritic Script */
307 UCD_SCRIPT_Vaii, /**< @brief Vai Script */
308 UCD_SCRIPT_Visp, /**< @brief Visible Speech Script */
309 UCD_SCRIPT_Wara, /**< @brief Warang Citi Script */
310 UCD_SCRIPT_Wole, /**< @brief Woleai Script */
311 UCD_SCRIPT_Xpeo, /**< @brief Old Persian Script */
312 UCD_SCRIPT_Xsux, /**< @brief Cuneiform Script */
313 UCD_SCRIPT_Yiii, /**< @brief Yi Script */
314 UCD_SCRIPT_Zanb, /**< @brief Zanabazar Square */
315 UCD_SCRIPT_Zinh, /**< @brief Inherited Script */
316 UCD_SCRIPT_Zmth, /**< @brief Mathematical Notation */
317 UCD_SCRIPT_Zsym, /**< @brief Symbols */
318 UCD_SCRIPT_Zxxx, /**< @brief Unwritten Documents */
319 UCD_SCRIPT_Zyyy, /**< @brief Undetermined Script */
320 UCD_SCRIPT_Zzzz, /**< @brief Uncoded Script */
321 } ucd_script;
322
323 /** @brief Get a string representation of the script enumeration value.
324 *
325 * @param s The value to get the string representation for.
326 *
327 * @return The string representation, or "----" if the value is not recognized.
328 */
329 const char *ucd_get_script_string(ucd_script s);
330
331 /** @brief Lookup the Script for a Unicode codepoint.
332 *
333 * @param c The Unicode codepoint to lookup.
334 * @return The Script of the Unicode codepoint.
335 */
336 ucd_script ucd_lookup_script(codepoint_t c);
337
338 /** @brief Properties
339 */
340 typedef uint64_t ucd_property;
341
342 #define UCD_PROPERTY_WHITE_SPACE 0x0000000000000001ull /**< @brief White_Space */
343 #define UCD_PROPERTY_BIDI_CONTROL 0x0000000000000002ull /**< @brief Bidi_Control */
344 #define UCD_PROPERTY_JOIN_CONTROL 0x0000000000000004ull /**< @brief Join_Control */
345 #define UCD_PROPERTY_DASH 0x0000000000000008ull /**< @brief Dash */
346 #define UCD_PROPERTY_HYPHEN 0x0000000000000010ull /**< @brief Hyphen */
347 #define UCD_PROPERTY_QUOTATION_MARK 0x0000000000000020ull /**< @brief Quotation_Mark */
348 #define UCD_PROPERTY_TERMINAL_PUNCTUATION 0x0000000000000040ull /**< @brief Terminal_Punctuation */
349 #define UCD_PROPERTY_OTHER_MATH 0x0000000000000080ull /**< @brief Other_Math */
350 #define UCD_PROPERTY_HEX_DIGIT 0x0000000000000100ull /**< @brief Hex_Digit */
351 #define UCD_PROPERTY_ASCII_HEX_DIGIT 0x0000000000000200ull /**< @brief ASCII_Hex_Digit */
352 #define UCD_PROPERTY_OTHER_ALPHABETIC 0x0000000000000400ull /**< @brief Other_Alphabetic */
353 #define UCD_PROPERTY_IDEOGRAPHIC 0x0000000000000800ull /**< @brief Ideographic */
354 #define UCD_PROPERTY_DIACRITIC 0x0000000000001000ull /**< @brief Diacritic */
355 #define UCD_PROPERTY_EXTENDER 0x0000000000002000ull /**< @brief Extender */
356 #define UCD_PROPERTY_OTHER_LOWERCASE 0x0000000000004000ull /**< @brief Other_Lowercase */
357 #define UCD_PROPERTY_OTHER_UPPERCASE 0x0000000000008000ull /**< @brief Other_Uppercase */
358 #define UCD_PROPERTY_NONCHARACTER_CODE_POINT 0x0000000000010000ull /**< @brief Noncharacter_Code_Point */
359 #define UCD_PROPERTY_OTHER_GRAPHEME_EXTEND 0x0000000000020000ull /**< @brief Other_Grapheme_Extend */
360 #define UCD_PROPERTY_IDS_BINARY_OPERATOR 0x0000000000040000ull /**< @brief IDS_Binary_Operator */
361 #define UCD_PROPERTY_IDS_TRINARY_OPERATOR 0x0000000000080000ull /**< @brief IDS_Trinary_Operator */
362 #define UCD_PROPERTY_RADICAL 0x0000000000100000ull /**< @brief Radical */
363 #define UCD_PROPERTY_UNIFIED_IDEOGRAPH 0x0000000000200000ull /**< @brief Unified_Ideograph */
364 #define UCD_PROPERTY_OTHER_DEFAULT_IGNORABLE_CODE_POINT 0x0000000000400000ull /**< @brief Other_Default_Ignorable_Code_Point */
365 #define UCD_PROPERTY_DEPRECATED 0x0000000000800000ull /**< @brief Deprecated */
366 #define UCD_PROPERTY_SOFT_DOTTED 0x0000000001000000ull /**< @brief Soft_Dotted */
367 #define UCD_PROPERTY_LOGICAL_ORDER_EXCEPTION 0x0000000002000000ull /**< @brief Logical_Order_Exception */
368 #define UCD_PROPERTY_OTHER_ID_START 0x0000000004000000ull /**< @brief Other_ID_Start */
369 #define UCD_PROPERTY_OTHER_ID_CONTINUE 0x0000000008000000ull /**< @brief Other_ID_Continue */
370 #define UCD_PROPERTY_SENTENCE_TERMINAL 0x0000000010000000ull /**< @brief Sentence_Terminal */
371 #define UCD_PROPERTY_VARIATION_SELECTOR 0x0000000020000000ull /**< @brief Variation_Selector */
372 #define UCD_PROPERTY_PATTERN_WHITE_SPACE 0x0000000040000000ull /**< @brief Pattern_White_Space */
373 #define UCD_PROPERTY_PATTERN_SYNTAX 0x0000000080000000ull /**< @brief Pattern_Syntax */
374 #define UCD_PROPERTY_PREPENDED_CONCATENATION_MARK 0x0000000100000000ull /**< @brief Prepended_Concatenation_Mark */
375 #define UCD_PROPERTY_EMOJI 0x0000000200000000ull /**< @brief Emoji */
376 #define UCD_PROPERTY_EMOJI_PRESENTATION 0x0000000400000000ull /**< @brief Emoji_Presentation */
377 #define UCD_PROPERTY_EMOJI_MODIFIER 0x0000000800000000ull /**< @brief Emoji_Modifier */
378 #define UCD_PROPERTY_EMOJI_MODIFIER_BASE 0x0000001000000000ull /**< @brief Emoji_Modifier_Base */
379 #define UCD_PROPERTY_REGIONAL_INDICATOR 0x0000002000000000ull /**< @brief Regional_Indicator */
380 #define UCD_PROPERTY_EMOJI_COMPONENT 0x0000004000000000ull /**< @brief Emoji_Component */
381 #define UCD_PROPERTY_EXTENDED_PICTOGRAPHIC 0x0000008000000000ull /**< @brief Extended_Pictographic */
382
383 // eSpeak NG extended properties:
384 #define ESPEAKNG_PROPERTY_INVERTED_TERMINAL_PUNCTUATION 0x0010000000000000ull /**< @brief Inverted_Terminal_Punctuation */
385 #define ESPEAKNG_PROPERTY_PUNCTUATION_IN_WORD 0x0020000000000000ull /**< @brief Punctuation_In_Word */
386 #define ESPEAKNG_PROPERTY_OPTIONAL_SPACE_AFTER 0x0040000000000000ull /**< @brief Optional_Space_After */
387 #define ESPEAKNG_PROPERTY_EXTENDED_DASH 0x0080000000000000ull /**< @brief Extended_Dash */
388 #define ESPEAKNG_PROPERTY_PARAGRAPH_SEPARATOR 0x0100000000000000ull /**< @brief Paragraph_Separator */
389 #define ESPEAKNG_PROPERTY_ELLIPSIS 0x0200000000000000ull /**< @brief Ellipsis */
390 #define ESPEAKNG_PROPERTY_SEMI_COLON 0x0400000000000000ull /**< @brief Semi_Colon */
391 #define ESPEAKNG_PROPERTY_COLON 0x0800000000000000ull /**< @brief Colon */
392 #define ESPEAKNG_PROPERTY_COMMA 0x1000000000000000ull /**< @brief Comma */
393 #define ESPEAKNG_PROPERTY_EXCLAMATION_MARK 0x2000000000000000ull /**< @brief Exclamation_Mark */
394 #define ESPEAKNG_PROPERTY_QUESTION_MARK 0x4000000000000000ull /**< @brief Question_Mark */
395 #define ESPEAKNG_PROPERTY_FULL_STOP 0x8000000000000000ull /**< @brief Full_Stop */
396
397 /** @brief Return the properties of the specified codepoint.
398 *
399 * @param c The Unicode codepoint to lookup.
400 * @param category The General Category of the codepoint.
401 * @return The properties associated with the codepoint.
402 */
403 ucd_property ucd_properties(codepoint_t c, ucd_category category);
404
405 /** @brief Is the codepoint in the 'alnum' class?
406 *
407 * @param c The Unicode codepoint to check.
408 * @return Non-zero if the codepoint is in the 'alnum' class, zero otherwise.
409 */
410 int ucd_isalnum(codepoint_t c);
411
412 /** @brief Is the codepoint in the 'alpha' class?
413 *
414 * @param c The Unicode codepoint to check.
415 * @return Non-zero if the codepoint is in the 'alpha' class, zero otherwise.
416 */
417 int ucd_isalpha(codepoint_t c);
418
419 /** @brief Is the codepoint in the 'blank' class?
420 *
421 * @param c The Unicode codepoint to check.
422 * @return Non-zero if the codepoint is in the 'blank' class, zero otherwise.
423 */
424 int ucd_isblank(codepoint_t c);
425
426 /** @brief Is the codepoint in the 'cntrl' class?
427 *
428 * @param c The Unicode codepoint to check.
429 * @return Non-zero if the codepoint is in the 'cntrl' class, zero otherwise.
430 */
431 int ucd_iscntrl(codepoint_t c);
432
433 /** @brief Is the codepoint in the 'digit' class?
434 *
435 * @param c The Unicode codepoint to check.
436 * @return Non-zero if the codepoint is in the 'digit' class, zero otherwise.
437 */
438 int ucd_isdigit(codepoint_t c);
439
440 /** @brief Is the codepoint in the 'graph' class?
441 *
442 * @param c The Unicode codepoint to check.
443 * @return Non-zero if the codepoint is in the 'graph' class, zero otherwise.
444 */
445 int ucd_isgraph(codepoint_t c);
446
447 /** @brief Is the codepoint in the 'lower' class?
448 *
449 * @param c The Unicode codepoint to check.
450 * @return Non-zero if the codepoint is in the 'lower' class, zero otherwise.
451 */
452 int ucd_islower(codepoint_t c);
453
454 /** @brief Is the codepoint in the 'print' class?
455 *
456 * @param c The Unicode codepoint to check.
457 * @return Non-zero if the codepoint is in the 'print' class, zero otherwise.
458 */
459 int ucd_isprint(codepoint_t c);
460
461 /** @brief Is the codepoint in the 'punct' class?
462 *
463 * @param c The Unicode codepoint to check.
464 * @return Non-zero if the codepoint is in the 'punct' class, zero otherwise.
465 */
466 int ucd_ispunct(codepoint_t c);
467
468 /** @brief Is the codepoint in the 'space' class?
469 *
470 * @param c The Unicode codepoint to check.
471 * @return Non-zero if the codepoint is in the 'space' class, zero otherwise.
472 */
473 int ucd_isspace(codepoint_t c);
474
475 /** @brief Is the codepoint in the 'upper' class?
476 *
477 * @param c The Unicode codepoint to check.
478 * @return Non-zero if the codepoint is in the 'upper' class, zero otherwise.
479 */
480 int ucd_isupper(codepoint_t c);
481
482 /** @brief Is the codepoint in the 'xdigit' class?
483 *
484 * @param c The Unicode codepoint to check.
485 * @return Non-zero if the codepoint is in the 'xdigit' class, zero otherwise.
486 */
487 int ucd_isxdigit(codepoint_t c);
488
489 /** @brief Convert the Unicode codepoint to upper-case.
490 *
491 * This function only uses the simple case mapping present in the
492 * UnicodeData file. The data in SpecialCasing requires Unicode
493 * codepoints to be mapped to multiple codepoints.
494 *
495 * @param c The Unicode codepoint to convert.
496 * @return The upper-case Unicode codepoint for this codepoint, or
497 * this codepoint if there is no upper-case codepoint.
498 */
499 codepoint_t ucd_toupper(codepoint_t c);
500
501 /** @brief Convert the Unicode codepoint to lower-case.
502 *
503 * This function only uses the simple case mapping present in the
504 * UnicodeData file. The data in SpecialCasing requires Unicode
505 * codepoints to be mapped to multiple codepoints.
506 *
507 * @param c The Unicode codepoint to convert.
508 * @return The lower-case Unicode codepoint for this codepoint, or
509 * this codepoint if there is no upper-case codepoint.
510 */
511 codepoint_t ucd_tolower(codepoint_t c);
512
513 /** @brief Convert the Unicode codepoint to title-case.
514 *
515 * This function only uses the simple case mapping present in the
516 * UnicodeData file. The data in SpecialCasing requires Unicode
517 * codepoints to be mapped to multiple codepoints.
518 *
519 * @param c The Unicode codepoint to convert.
520 * @return The title-case Unicode codepoint for this codepoint, or
521 * this codepoint if there is no upper-case codepoint.
522 */
523 codepoint_t ucd_totitle(codepoint_t c);
524
525 #ifdef __cplusplus
526 }
527
528 /** @brief Unicode Character Database
529 */
530 namespace ucd
531 {
532 /** @brief Represents a Unicode codepoint.
533 */
534 using ::codepoint_t;
535
536 /** @brief Unicode General Category Groups
537 * @see http://www.unicode.org/reports/tr44/
538 */
539 enum category_group
540 {
541 C = UCD_CATEGORY_GROUP_C, /**< @brief Other */
542 I = UCD_CATEGORY_GROUP_I, /**< @brief Invalid */
543 L = UCD_CATEGORY_GROUP_L, /**< @brief Letter */
544 M = UCD_CATEGORY_GROUP_M, /**< @brief Mark */
545 N = UCD_CATEGORY_GROUP_N, /**< @brief Number */
546 P = UCD_CATEGORY_GROUP_P, /**< @brief Punctuation */
547 S = UCD_CATEGORY_GROUP_S, /**< @brief Symbol */
548 Z = UCD_CATEGORY_GROUP_Z, /**< @brief Separator */
549 };
550
551 /** @brief Get a string representation of the category_group enumeration value.
552 *
553 * @param c The value to get the string representation for.
554 *
555 * @return The string representation, or "-" if the value is not recognized.
556 */
557 inline const char *get_category_group_string(category_group c)
558 {
559 return ucd_get_category_group_string((ucd_category_group)c);
560 }
561
562 /** @brief Unicode General Category Values
563 * @see http://www.unicode.org/reports/tr44/
564 */
565 enum category
566 {
567 Cc = UCD_CATEGORY_Cc, /**< @brief Control Character */
568 Cf = UCD_CATEGORY_Cf, /**< @brief Format Control Character */
569 Cn = UCD_CATEGORY_Cn, /**< @brief Unassigned */
570 Co = UCD_CATEGORY_Co, /**< @brief Private Use */
571 Cs = UCD_CATEGORY_Cs, /**< @brief Surrogate Code Point */
572
573 Ii = UCD_CATEGORY_Ii, /**< @brief Invalid Unicode Codepoint */
574
575 Ll = UCD_CATEGORY_Ll, /**< @brief Lower Case Letter */
576 Lm = UCD_CATEGORY_Lm, /**< @brief Letter Modifier */
577 Lo = UCD_CATEGORY_Lo, /**< @brief Other Letter */
578 Lt = UCD_CATEGORY_Lt, /**< @brief Title Case Letter */
579 Lu = UCD_CATEGORY_Lu, /**< @brief Upper Case Letter */
580
581 Mc = UCD_CATEGORY_Mc, /**< @brief Spacing Mark */
582 Me = UCD_CATEGORY_Me, /**< @brief Enclosing Mark */
583 Mn = UCD_CATEGORY_Mn, /**< @brief Non-Spacing Mark */
584
585 Nd = UCD_CATEGORY_Nd, /**< @brief Decimal Digit */
586 Nl = UCD_CATEGORY_Nl, /**< @brief Letter-Like Number */
587 No = UCD_CATEGORY_No, /**< @brief Other Number */
588
589 Pc = UCD_CATEGORY_Pc, /**< @brief Connector */
590 Pd = UCD_CATEGORY_Pd, /**< @brief Dash/Hyphen */
591 Pe = UCD_CATEGORY_Pe, /**< @brief Close Punctuation Mark */
592 Pf = UCD_CATEGORY_Pf, /**< @brief Final Quotation Mark */
593 Pi = UCD_CATEGORY_Pi, /**< @brief Initial Quotation Mark */
594 Po = UCD_CATEGORY_Po, /**< @brief Other */
595 Ps = UCD_CATEGORY_Ps, /**< @brief Open Punctuation Mark */
596
597 Sc = UCD_CATEGORY_Sc, /**< @brief Currency Symbol */
598 Sk = UCD_CATEGORY_Sk, /**< @brief Modifier Symbol */
599 Sm = UCD_CATEGORY_Sm, /**< @brief Math Symbol */
600 So = UCD_CATEGORY_So, /**< @brief Other Symbol */
601
602 Zl = UCD_CATEGORY_Zl, /**< @brief Line Separator */
603 Zp = UCD_CATEGORY_Zp, /**< @brief Paragraph Separator */
604 Zs = UCD_CATEGORY_Zs, /**< @brief Space Separator */
605 };
606
607 /** @brief Get a string representation of the category enumeration value.
608 *
609 * @param c The value to get the string representation for.
610 *
611 * @return The string representation, or "--" if the value is not recognized.
612 */
613 inline const char *get_category_string(category c)
614 {
615 return ucd_get_category_string((ucd_category)c);
616 }
617
618 /** @brief Lookup the General Category Group for a General Category.
619 *
620 * @param c The General Category to lookup.
621 * @return The General Category Group of the General Category.
622 */
623 inline category_group lookup_category_group(category c)
624 {
625 return (category_group)ucd_get_category_group_for_category((ucd_category)c);
626 }
627
628 /** @brief Lookup the General Category Group for a Unicode codepoint.
629 *
630 * @param c The Unicode codepoint to lookup.
631 * @return The General Category Group of the Unicode codepoint.
632 */
633 inline category_group lookup_category_group(codepoint_t c)
634 {
635 return (category_group)ucd_lookup_category_group(c);
636 }
637
638 /** @brief Lookup the General Category for a Unicode codepoint.
639 *
640 * @param c The Unicode codepoint to lookup.
641 * @return The General Category of the Unicode codepoint.
642 */
643 inline category lookup_category(codepoint_t c)
644 {
645 return (category)ucd_lookup_category(c);
646 }
647
648 /** @brief Unicode Script
649 * @see http://www.iana.org/assignments/language-subtag-registry
650 * @see http://www.unicode.org/iso15924/iso15924-codes.html
651 */
652 enum script
653 {
654 Adlm = UCD_SCRIPT_Adlm, /**< @brief Adlam Script */
655 Afak = UCD_SCRIPT_Afak, /**< @brief Afaka Script */
656 Aghb = UCD_SCRIPT_Aghb, /**< @brief Caucasian Albanian Script */
657 Ahom = UCD_SCRIPT_Ahom, /**< @brief Tai Ahom Script */
658 Arab = UCD_SCRIPT_Arab, /**< @brief Arabic Script */
659 Armi = UCD_SCRIPT_Armi, /**< @brief Imperial Aramaic Script */
660 Armn = UCD_SCRIPT_Armn, /**< @brief Armenian Script */
661 Avst = UCD_SCRIPT_Avst, /**< @brief Avestan Script */
662 Bali = UCD_SCRIPT_Bali, /**< @brief Balinese Script */
663 Bamu = UCD_SCRIPT_Bamu, /**< @brief Bamum Script */
664 Bass = UCD_SCRIPT_Bass, /**< @brief Bassa Vah Script */
665 Batk = UCD_SCRIPT_Batk, /**< @brief Batak Script */
666 Beng = UCD_SCRIPT_Beng, /**< @brief Bengali Script */
667 Bhks = UCD_SCRIPT_Bhks, /**< @brief Bhaiksuki Script */
668 Blis = UCD_SCRIPT_Blis, /**< @brief Blissymbols Script */
669 Bopo = UCD_SCRIPT_Bopo, /**< @brief Bopomofo Script */
670 Brah = UCD_SCRIPT_Brah, /**< @brief Brahmi Script */
671 Brai = UCD_SCRIPT_Brai, /**< @brief Braille Script */
672 Bugi = UCD_SCRIPT_Bugi, /**< @brief Buginese Script */
673 Buhd = UCD_SCRIPT_Buhd, /**< @brief Buhid Script */
674 Cakm = UCD_SCRIPT_Cakm, /**< @brief Chakma Script */
675 Cans = UCD_SCRIPT_Cans, /**< @brief Unified Canadian Aboriginal Syllabics */
676 Cari = UCD_SCRIPT_Cari, /**< @brief Carian Script */
677 Cham = UCD_SCRIPT_Cham, /**< @brief Cham Script */
678 Cher = UCD_SCRIPT_Cher, /**< @brief Cherokee Script */
679 Cirt = UCD_SCRIPT_Cirt, /**< @brief Cirth Script */
680 Copt = UCD_SCRIPT_Copt, /**< @brief Coptic Script */
681 Cprt = UCD_SCRIPT_Cprt, /**< @brief Cypriot Script */
682 Cyrl = UCD_SCRIPT_Cyrl, /**< @brief Cyrillic Script */
683 Cyrs = UCD_SCRIPT_Cyrs, /**< @brief Cyrillic (Old Church Slavonic variant) Script */
684 Deva = UCD_SCRIPT_Deva, /**< @brief Devanagari Script */
685 Dogr = UCD_SCRIPT_Dogr, /**< @brief Dogra Script */
686 Dsrt = UCD_SCRIPT_Dsrt, /**< @brief Deseret Script */
687 Dupl = UCD_SCRIPT_Dupl, /**< @brief Duployan Shorthand Script */
688 Egyd = UCD_SCRIPT_Egyd, /**< @brief Egyptian Demotic Script */
689 Egyh = UCD_SCRIPT_Egyh, /**< @brief Egyptian Hieratic Script */
690 Egyp = UCD_SCRIPT_Egyp, /**< @brief Egyptian Hiegoglyphs */
691 Elba = UCD_SCRIPT_Elba, /**< @brief Elbasan Script */
692 Ethi = UCD_SCRIPT_Ethi, /**< @brief Ethiopic Script */
693 Geok = UCD_SCRIPT_Geok, /**< @brief Khutsuri Script */
694 Geor = UCD_SCRIPT_Geor, /**< @brief Geirgian Script */
695 Glag = UCD_SCRIPT_Glag, /**< @brief Glagolitic Script */
696 Gong = UCD_SCRIPT_Gong, /**< @brief Gunjala Gondi */
697 Gonm = UCD_SCRIPT_Gonm, /**< @brief Masaram Gondi */
698 Goth = UCD_SCRIPT_Goth, /**< @brief Gothic Script */
699 Gran = UCD_SCRIPT_Gran, /**< @brief Grantha Script */
700 Grek = UCD_SCRIPT_Grek, /**< @brief Greek Script */
701 Gujr = UCD_SCRIPT_Gujr, /**< @brief Gujarati Script */
702 Guru = UCD_SCRIPT_Guru, /**< @brief Gurmukhi Script */
703 Hang = UCD_SCRIPT_Hang, /**< @brief Hangul Script */
704 Hani = UCD_SCRIPT_Hani, /**< @brief Han (Hanzi, Kanji, Hanja) Script */
705 Hano = UCD_SCRIPT_Hano, /**< @brief Hanunoo Script */
706 Hans = UCD_SCRIPT_Hans, /**< @brief Han (Simplified) Script */
707 Hant = UCD_SCRIPT_Hant, /**< @brief Han (Traditional) Script */
708 Hatr = UCD_SCRIPT_Hatr, /**< @brief Hatran Script */
709 Hebr = UCD_SCRIPT_Hebr, /**< @brief Hebrew Script */
710 Hira = UCD_SCRIPT_Hira, /**< @brief Hiragana Script */
711 Hluw = UCD_SCRIPT_Hluw, /**< @brief Anatolian Hieroglyphs */
712 Hmng = UCD_SCRIPT_Hmng, /**< @brief Pahawh Hmong Script */
713 Hrkt = UCD_SCRIPT_Hrkt, /**< @brief Japanese Syllabaries */
714 Hung = UCD_SCRIPT_Hung, /**< @brief Old Hungarian Script */
715 Inds = UCD_SCRIPT_Inds, /**< @brief Indus Script */
716 Ital = UCD_SCRIPT_Ital, /**< @brief Old Italic Script */
717 Java = UCD_SCRIPT_Java, /**< @brief Javanese Script */
718 Jpan = UCD_SCRIPT_Jpan, /**< @brief Japanese (Han + Hiragana + Katakana) Scripts */
719 Jurc = UCD_SCRIPT_Jurc, /**< @brief Jurchen Script */
720 Kali = UCD_SCRIPT_Kali, /**< @brief Kayah Li Script */
721 Kana = UCD_SCRIPT_Kana, /**< @brief Katakana Script */
722 Khar = UCD_SCRIPT_Khar, /**< @brief Kharoshthi Script */
723 Khmr = UCD_SCRIPT_Khmr, /**< @brief Khmer Script */
724 Khoj = UCD_SCRIPT_Khoj, /**< @brief Khojki Script */
725 Knda = UCD_SCRIPT_Knda, /**< @brief Kannada Script */
726 Kore = UCD_SCRIPT_Kore, /**< @brief Korean (Hangul + Han) Scripts */
727 Kpel = UCD_SCRIPT_Kpel, /**< @brief Kpelle Script */
728 Kthi = UCD_SCRIPT_Kthi, /**< @brief Kaithi Script */
729 Lana = UCD_SCRIPT_Lana, /**< @brief Tai Tham Script */
730 Laoo = UCD_SCRIPT_Laoo, /**< @brief Lao Script */
731 Latf = UCD_SCRIPT_Latf, /**< @brief Latin Script (Fractur Variant) */
732 Latg = UCD_SCRIPT_Latg, /**< @brief Latin Script (Gaelic Variant) */
733 Latn = UCD_SCRIPT_Latn, /**< @brief Latin Script */
734 Lepc = UCD_SCRIPT_Lepc, /**< @brief Lepcha Script */
735 Limb = UCD_SCRIPT_Limb, /**< @brief Limbu Script */
736 Lina = UCD_SCRIPT_Lina, /**< @brief Linear A Script */
737 Linb = UCD_SCRIPT_Linb, /**< @brief Linear B Script */
738 Lisu = UCD_SCRIPT_Lisu, /**< @brief Lisu Script */
739 Loma = UCD_SCRIPT_Loma, /**< @brief Loma Script */
740 Lyci = UCD_SCRIPT_Lyci, /**< @brief Lycian Script */
741 Lydi = UCD_SCRIPT_Lydi, /**< @brief Lydian Script */
742 Mahj = UCD_SCRIPT_Mahj, /**< @brief Mahajani Script */
743 Maka = UCD_SCRIPT_Maka, /**< @brief Mahajani Script */
744 Mand = UCD_SCRIPT_Mand, /**< @brief Mandaic Script */
745 Mani = UCD_SCRIPT_Mani, /**< @brief Manichaean Script */
746 Marc = UCD_SCRIPT_Marc, /**< @brief Marchen Script */
747 Maya = UCD_SCRIPT_Maya, /**< @brief Mayan Hieroglyphs */
748 Medf = UCD_SCRIPT_Medf, /**< @brief Medefaidrin (Oberi Okaime) Script */
749 Mend = UCD_SCRIPT_Mend, /**< @brief Mende Kikakui Script */
750 Merc = UCD_SCRIPT_Merc, /**< @brief Meroitic Cursive Script */
751 Mero = UCD_SCRIPT_Mero, /**< @brief Meroitic Hieroglyphs */
752 Mlym = UCD_SCRIPT_Mlym, /**< @brief Malayalam Script */
753 Modi = UCD_SCRIPT_Modi, /**< @brief Modi Script */
754 Mong = UCD_SCRIPT_Mong, /**< @brief Mongolian Script */
755 Moon = UCD_SCRIPT_Moon, /**< @brief Moon Script */
756 Mroo = UCD_SCRIPT_Mroo, /**< @brief Mro Script */
757 Mtei = UCD_SCRIPT_Mtei, /**< @brief Meitei Mayek Script */
758 Mult = UCD_SCRIPT_Mult, /**< @brief Multani Script */
759 Mymr = UCD_SCRIPT_Mymr, /**< @brief Myanmar (Burmese) Script */
760 Narb = UCD_SCRIPT_Narb, /**< @brief Old North Arabian Script */
761 Nbat = UCD_SCRIPT_Nbat, /**< @brief Nabataean Script */
762 Newa = UCD_SCRIPT_Newa, /**< @brief Newa Script */
763 Nkgb = UCD_SCRIPT_Nkgb, /**< @brief Nakhi Geba Script */
764 Nkoo = UCD_SCRIPT_Nkoo, /**< @brief N'Ko Script */
765 Nshu = UCD_SCRIPT_Nshu, /**< @brief Nushu Script */
766 Ogam = UCD_SCRIPT_Ogam, /**< @brief Ogham Script */
767 Olck = UCD_SCRIPT_Olck, /**< @brief Ol Chiki Script */
768 Orkh = UCD_SCRIPT_Orkh, /**< @brief Old Turkic Script */
769 Orya = UCD_SCRIPT_Orya, /**< @brief Oriya Script */
770 Osge = UCD_SCRIPT_Osge, /**< @brief Osage Script */
771 Osma = UCD_SCRIPT_Osma, /**< @brief Osmanya Script */
772 Palm = UCD_SCRIPT_Palm, /**< @brief Palmyrene Script */
773 Pauc = UCD_SCRIPT_Pauc, /**< @brief Pau Cin Hau Script */
774 Perm = UCD_SCRIPT_Perm, /**< @brief Old Permic */
775 Phag = UCD_SCRIPT_Phag, /**< @brief Phags-Pa Script */
776 Phli = UCD_SCRIPT_Phli, /**< @brief Inscriptional Pahlavi Script */
777 Phlp = UCD_SCRIPT_Phlp, /**< @brief Psalter Pahlavi Script */
778 Phlv = UCD_SCRIPT_Phlv, /**< @brief Book Pahlavi Script */
779 Phnx = UCD_SCRIPT_Phnx, /**< @brief Phoenician Script */
780 Plrd = UCD_SCRIPT_Plrd, /**< @brief Miao Script */
781 Prti = UCD_SCRIPT_Prti, /**< @brief Inscriptional Parthian Script */
782 Qaak = UCD_SCRIPT_Qaak, /**< @brief Klingon Script (Private Use) */
783 Rjng = UCD_SCRIPT_Rjng, /**< @brief Rejang Script */
784 Rohg = UCD_SCRIPT_Rohg, /**< @brief Hanifi Rohingya Script */
785 Roro = UCD_SCRIPT_Roro, /**< @brief Rongorongo Script */
786 Runr = UCD_SCRIPT_Runr, /**< @brief Runic Script */
787 Samr = UCD_SCRIPT_Samr, /**< @brief Samaritan Script */
788 Sara = UCD_SCRIPT_Sara, /**< @brief Sarati Script */
789 Sarb = UCD_SCRIPT_Sarb, /**< @brief Old South Arabian Script */
790 Saur = UCD_SCRIPT_Saur, /**< @brief Saurashtra Script */
791 Sgnw = UCD_SCRIPT_Sgnw, /**< @brief Sign Writing */
792 Shaw = UCD_SCRIPT_Shaw, /**< @brief Shavian Script */
793 Shrd = UCD_SCRIPT_Shrd, /**< @brief Sharada Script */
794 Sidd = UCD_SCRIPT_Sidd, /**< @brief Siddham Script */
795 Sind = UCD_SCRIPT_Sind, /**< @brief Sindhi Script */
796 Sinh = UCD_SCRIPT_Sinh, /**< @brief Sinhala Script */
797 Sogd = UCD_SCRIPT_Sogd, /**< @brief Sogdian Script */
798 Sogo = UCD_SCRIPT_Sogo, /**< @brief Old Sogdian Script */
799 Sora = UCD_SCRIPT_Sora, /**< @brief Sora Sompeng Script */
800 Soyo = UCD_SCRIPT_Soyo, /**< @brief Soyombo */
801 Sund = UCD_SCRIPT_Sund, /**< @brief Sundanese Script */
802 Sylo = UCD_SCRIPT_Sylo, /**< @brief Syloti Nagri Script */
803 Syrc = UCD_SCRIPT_Syrc, /**< @brief Syriac Script */
804 Syre = UCD_SCRIPT_Syre, /**< @brief Syriac Script (Estrangelo Variant) */
805 Syrj = UCD_SCRIPT_Syrj, /**< @brief Syriac Script (Western Variant) */
806 Syrn = UCD_SCRIPT_Syrn, /**< @brief Syriac Script (Eastern Variant) */
807 Tagb = UCD_SCRIPT_Tagb, /**< @brief Tagbanwa Script */
808 Takr = UCD_SCRIPT_Takr, /**< @brief Takri Script */
809 Tale = UCD_SCRIPT_Tale, /**< @brief Tai Le Script */
810 Talu = UCD_SCRIPT_Talu, /**< @brief New Tai Lue Script */
811 Taml = UCD_SCRIPT_Taml, /**< @brief Tamil Script */
812 Tang = UCD_SCRIPT_Tang, /**< @brief Tangut Script */
813 Tavt = UCD_SCRIPT_Tavt, /**< @brief Tai Viet Script */
814 Telu = UCD_SCRIPT_Telu, /**< @brief Telugu Script */
815 Teng = UCD_SCRIPT_Teng, /**< @brief Tengwar Script */
816 Tfng = UCD_SCRIPT_Tfng, /**< @brief Tifinagh Script */
817 Tglg = UCD_SCRIPT_Tglg, /**< @brief Tagalog Script */
818 Thaa = UCD_SCRIPT_Thaa, /**< @brief Thaana Script */
819 Thai = UCD_SCRIPT_Thai, /**< @brief Thai Script */
820 Tibt = UCD_SCRIPT_Tibt, /**< @brief Tibetan Script */
821 Tirh = UCD_SCRIPT_Tirh, /**< @brief Tirhuta Script */
822 Ugar = UCD_SCRIPT_Ugar, /**< @brief Ugaritic Script */
823 Vaii = UCD_SCRIPT_Vaii, /**< @brief Vai Script */
824 Visp = UCD_SCRIPT_Visp, /**< @brief Visible Speech Script */
825 Wara = UCD_SCRIPT_Wara, /**< @brief Warang Citi Script */
826 Wole = UCD_SCRIPT_Wole, /**< @brief Woleai Script */
827 Xpeo = UCD_SCRIPT_Xpeo, /**< @brief Old Persian Script */
828 Xsux = UCD_SCRIPT_Xsux, /**< @brief Cuneiform Script */
829 Yiii = UCD_SCRIPT_Yiii, /**< @brief Yi Script */
830 Zanb = UCD_SCRIPT_Zanb, /**< @brief Zanabazar Square */
831 Zinh = UCD_SCRIPT_Zinh, /**< @brief Inherited Script */
832 Zmth = UCD_SCRIPT_Zmth, /**< @brief Mathematical Notation */
833 Zsym = UCD_SCRIPT_Zsym, /**< @brief Symbols */
834 Zxxx = UCD_SCRIPT_Zxxx, /**< @brief Unwritten Documents */
835 Zyyy = UCD_SCRIPT_Zyyy, /**< @brief Undetermined Script */
836 Zzzz = UCD_SCRIPT_Zzzz, /**< @brief Uncoded Script */
837 };
838
839 /** @brief Get a string representation of the script enumeration value.
840 *
841 * @param s The value to get the string representation for.
842 *
843 * @return The string representation, or "----" if the value is not recognized.
844 */
845 inline const char *get_script_string(script s)
846 {
847 return ucd_get_script_string((ucd_script)s);
848 }
849
850 /** @brief Lookup the Script for a Unicode codepoint.
851 *
852 * @param c The Unicode codepoint to lookup.
853 * @return The Script of the Unicode codepoint.
854 */
855 inline script lookup_script(codepoint_t c)
856 {
857 return (script)ucd_lookup_script(c);
858 }
859
860 /** @brief Properties
861 */
862 typedef ucd_property property;
863 enum
864 {
865 White_Space = UCD_PROPERTY_WHITE_SPACE, /**< @brief White_Space */
866 Bidi_Control = UCD_PROPERTY_BIDI_CONTROL, /**< @brief Bidi_Control */
867 Join_Control = UCD_PROPERTY_JOIN_CONTROL, /**< @brief Join_Control */
868 Dash = UCD_PROPERTY_DASH, /**< @brief Dash */
869 Hyphen = UCD_PROPERTY_HYPHEN, /**< @brief Hyphen */
870 Quotation_Mark = UCD_PROPERTY_QUOTATION_MARK, /**< @brief Quotation_Mark */
871 Terminal_Punctuation = UCD_PROPERTY_TERMINAL_PUNCTUATION, /**< @brief Terminal_Punctuation */
872 Other_Math = UCD_PROPERTY_OTHER_MATH, /**< @brief Other_Math */
873 Hex_Digit = UCD_PROPERTY_HEX_DIGIT, /**< @brief Hex_Digit */
874 ASCII_Hex_Digit = UCD_PROPERTY_ASCII_HEX_DIGIT, /**< @brief ASCII_Hex_Digit */
875 Other_Alphabetic = UCD_PROPERTY_OTHER_ALPHABETIC, /**< @brief Other_Alphabetic */
876 Ideographic = UCD_PROPERTY_IDEOGRAPHIC, /**< @brief Ideographic */
877 Diacritic = UCD_PROPERTY_DIACRITIC, /**< @brief Diacritic */
878 Extender = UCD_PROPERTY_EXTENDER, /**< @brief Extender */
879 Other_Lowercase = UCD_PROPERTY_OTHER_LOWERCASE, /**< @brief Other_Lowercase */
880 Other_Uppercase = UCD_PROPERTY_OTHER_UPPERCASE, /**< @brief Other_Uppercase */
881 Noncharacter_Code_Point = UCD_PROPERTY_NONCHARACTER_CODE_POINT, /**< @brief Noncharacter_Code_Point */
882 Other_Grapheme_Extend = UCD_PROPERTY_OTHER_GRAPHEME_EXTEND, /**< @brief Other_Grapheme_Extend */
883 IDS_Binary_Operator = UCD_PROPERTY_IDS_BINARY_OPERATOR, /**< @brief IDS_Binary_Operator */
884 IDS_Trinary_Operator = UCD_PROPERTY_IDS_TRINARY_OPERATOR, /**< @brief IDS_Trinary_Operator */
885 Radical = UCD_PROPERTY_RADICAL, /**< @brief Radical */
886 Unified_Ideograph = UCD_PROPERTY_UNIFIED_IDEOGRAPH, /**< @brief Unified_Ideograph */
887 Other_Default_Ignorable_Code_Point = UCD_PROPERTY_OTHER_DEFAULT_IGNORABLE_CODE_POINT, /**< @brief Other_Default_Ignorable_Code_Point */
888 Deprecated = UCD_PROPERTY_DEPRECATED, /**< @brief Deprecated */
889 Soft_Dotted = UCD_PROPERTY_SOFT_DOTTED, /**< @brief Soft_Dotted */
890 Logical_Order_Exception = UCD_PROPERTY_LOGICAL_ORDER_EXCEPTION, /**< @brief Logical_Order_Exception */
891 Other_ID_Start = UCD_PROPERTY_OTHER_ID_START, /**< @brief Other_ID_Start */
892 Other_ID_Continue = UCD_PROPERTY_OTHER_ID_CONTINUE, /**< @brief Other_ID_Continue */
893 Sentence_Terminal = UCD_PROPERTY_SENTENCE_TERMINAL, /**< @brief Sentence_Terminal */
894 Variation_Selector = UCD_PROPERTY_VARIATION_SELECTOR, /**< @brief Variation_Selector */
895 Pattern_White_Space = UCD_PROPERTY_PATTERN_WHITE_SPACE, /**< @brief Pattern_White_Space */
896 Pattern_Syntax = UCD_PROPERTY_PATTERN_SYNTAX, /**< @brief Pattern_Syntax */
897 Prepended_Concatenation_Mark = UCD_PROPERTY_PREPENDED_CONCATENATION_MARK, /**< @brief Prepended_Concatenation_Mark */
898 Emoji = UCD_PROPERTY_EMOJI, /**< @brief Emoji */
899 Emoji_Presentation = UCD_PROPERTY_EMOJI_PRESENTATION, /**< @brief Emoji_Presentation */
900 Emoji_Modifier = UCD_PROPERTY_EMOJI_MODIFIER, /**< @brief Emoji_Modifier */
901 Emoji_Modifier_Base = UCD_PROPERTY_EMOJI_MODIFIER_BASE, /**< @brief Emoji_Modifier_Base */
902 Regional_Indicator = UCD_PROPERTY_REGIONAL_INDICATOR, /**< @brief Regional_Indicator */
903 Emoji_Component = UCD_PROPERTY_EMOJI_COMPONENT, /**< @brief Emoji_Component */
904 Extended_Pictographic = UCD_PROPERTY_EXTENDED_PICTOGRAPHIC, /**< @brief Extended_Pictographic */
905 };
906
907 /** @brief Return the properties of the specified codepoint.
908 *
909 * @param c The Unicode codepoint to lookup.
910 * @param cat The General Category of the codepoint.
911 * @return The properties associated with the codepoint.
912 */
913 inline property properties(codepoint_t c, category cat)
914 {
915 return (property)ucd_properties(c, (ucd_category)cat);
916 }
917
918 /** @brief Is the codepoint in the 'alnum' class?
919 *
920 * @param c The Unicode codepoint to check.
921 * @return Non-zero if the codepoint is in the 'alnum' class, zero otherwise.
922 */
923 inline int isalnum(codepoint_t c)
924 {
925 return ucd_isalnum(c);
926 }
927
928 /** @brief Is the codepoint in the 'alpha' class?
929 *
930 * @param c The Unicode codepoint to check.
931 * @return Non-zero if the codepoint is in the 'alpha' class, zero otherwise.
932 */
933 inline int isalpha(codepoint_t c)
934 {
935 return ucd_isalpha(c);
936 }
937
938 /** @brief Is the codepoint in the 'blank' class?
939 *
940 * @param c The Unicode codepoint to check.
941 * @return Non-zero if the codepoint is in the 'blank' class, zero otherwise.
942 */
943 inline int isblank(codepoint_t c)
944 {
945 return ucd_isblank(c);
946 }
947
948 /** @brief Is the codepoint in the 'cntrl' class?
949 *
950 * @param c The Unicode codepoint to check.
951 * @return Non-zero if the codepoint is in the 'cntrl' class, zero otherwise.
952 */
953 inline int iscntrl(codepoint_t c)
954 {
955 return ucd_iscntrl(c);
956 }
957
958 /** @brief Is the codepoint in the 'digit' class?
959 *
960 * @param c The Unicode codepoint to check.
961 * @return Non-zero if the codepoint is in the 'digit' class, zero otherwise.
962 */
963 inline int isdigit(codepoint_t c)
964 {
965 return ucd_isdigit(c);
966 }
967
968 /** @brief Is the codepoint in the 'graph' class?
969 *
970 * @param c The Unicode codepoint to check.
971 * @return Non-zero if the codepoint is in the 'graph' class, zero otherwise.
972 */
973 inline int isgraph(codepoint_t c)
974 {
975 return ucd_isgraph(c);
976 }
977
978 /** @brief Is the codepoint in the 'lower' class?
979 *
980 * @param c The Unicode codepoint to check.
981 * @return Non-zero if the codepoint is in the 'lower' class, zero otherwise.
982 */
983 inline int islower(codepoint_t c)
984 {
985 return ucd_islower(c);
986 }
987
988 /** @brief Is the codepoint in the 'print' class?
989 *
990 * @param c The Unicode codepoint to check.
991 * @return Non-zero if the codepoint is in the 'print' class, zero otherwise.
992 */
993 inline int isprint(codepoint_t c)
994 {
995 return ucd_isprint(c);
996 }
997
998 /** @brief Is the codepoint in the 'punct' class?
999 *
1000 * @param c The Unicode codepoint to check.
1001 * @return Non-zero if the codepoint is in the 'punct' class, zero otherwise.
1002 */
1003 inline int ispunct(codepoint_t c)
1004 {
1005 return ucd_ispunct(c);
1006 }
1007
1008 /** @brief Is the codepoint in the 'space' class?
1009 *
1010 * @param c The Unicode codepoint to check.
1011 * @return Non-zero if the codepoint is in the 'space' class, zero otherwise.
1012 */
1013 inline int isspace(codepoint_t c)
1014 {
1015 return ucd_isspace(c);
1016 }
1017
1018 /** @brief Is the codepoint in the 'upper' class?
1019 *
1020 * @param c The Unicode codepoint to check.
1021 * @return Non-zero if the codepoint is in the 'upper' class, zero otherwise.
1022 */
1023 inline int isupper(codepoint_t c)
1024 {
1025 return ucd_isupper(c);
1026 }
1027
1028 /** @brief Is the codepoint in the 'xdigit' class?
1029 *
1030 * @param c The Unicode codepoint to check.
1031 * @return Non-zero if the codepoint is in the 'xdigit' class, zero otherwise.
1032 */
1033 inline int isxdigit(codepoint_t c)
1034 {
1035 return ucd_isxdigit(c);
1036 }
1037
1038 /** @brief Convert the Unicode codepoint to upper-case.
1039 *
1040 * This function only uses the simple case mapping present in the
1041 * UnicodeData file. The data in SpecialCasing requires Unicode
1042 * codepoints to be mapped to multiple codepoints.
1043 *
1044 * @param c The Unicode codepoint to convert.
1045 * @return The upper-case Unicode codepoint for this codepoint, or
1046 * this codepoint if there is no upper-case codepoint.
1047 */
1048 inline codepoint_t toupper(codepoint_t c)
1049 {
1050 return ucd_toupper(c);
1051 }
1052
1053 /** @brief Convert the Unicode codepoint to lower-case.
1054 *
1055 * This function only uses the simple case mapping present in the
1056 * UnicodeData file. The data in SpecialCasing requires Unicode
1057 * codepoints to be mapped to multiple codepoints.
1058 *
1059 * @param c The Unicode codepoint to convert.
1060 * @return The lower-case Unicode codepoint for this codepoint, or
1061 * this codepoint if there is no upper-case codepoint.
1062 */
1063 inline codepoint_t tolower(codepoint_t c)
1064 {
1065 return ucd_tolower(c);
1066 }
1067
1068 /** @brief Convert the Unicode codepoint to title-case.
1069 *
1070 * This function only uses the simple case mapping present in the
1071 * UnicodeData file. The data in SpecialCasing requires Unicode
1072 * codepoints to be mapped to multiple codepoints.
1073 *
1074 * @param c The Unicode codepoint to convert.
1075 * @return The title-case Unicode codepoint for this codepoint, or
1076 * this codepoint if there is no upper-case codepoint.
1077 */
1078 inline codepoint_t totitle(codepoint_t c)
1079 {
1080 return ucd_totitle(c);
1081 }
1082 }
1083 #endif
1084
1085 #endif