eSpeak NG is an open source speech synthesizer that supports more than hundred languages and accents.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ucd.h 39KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989
  1. /* Unicode Character Database API
  2. *
  3. * Copyright (C) 2012-2017 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. #ifndef UNICODE_CHARACTER_DATA_H
  21. #define UNICODE_CHARACTER_DATA_H
  22. #include <stdint.h>
  23. #ifdef __cplusplus
  24. extern "C"
  25. {
  26. #endif
  27. /** @brief Represents a Unicode codepoint.
  28. */
  29. typedef uint32_t codepoint_t;
  30. /** @brief Unicode General Category Groups
  31. * @see http://www.unicode.org/reports/tr44/
  32. */
  33. typedef enum ucd_category_group_
  34. {
  35. UCD_CATEGORY_GROUP_C, /**< @brief Other */
  36. UCD_CATEGORY_GROUP_I, /**< @brief Invalid */
  37. UCD_CATEGORY_GROUP_L, /**< @brief Letter */
  38. UCD_CATEGORY_GROUP_M, /**< @brief Mark */
  39. UCD_CATEGORY_GROUP_N, /**< @brief Number */
  40. UCD_CATEGORY_GROUP_P, /**< @brief Punctuation */
  41. UCD_CATEGORY_GROUP_S, /**< @brief Symbol */
  42. UCD_CATEGORY_GROUP_Z, /**< @brief Separator */
  43. } ucd_category_group;
  44. /** @brief Get a string representation of the category_group enumeration value.
  45. *
  46. * @param c The value to get the string representation for.
  47. *
  48. * @return The string representation, or "-" if the value is not recognized.
  49. */
  50. const char *ucd_get_category_group_string(ucd_category_group c);
  51. /** @brief Unicode General Category Values
  52. * @see http://www.unicode.org/reports/tr44/
  53. */
  54. typedef enum ucd_category_
  55. {
  56. UCD_CATEGORY_Cc, /**< @brief Control Character */
  57. UCD_CATEGORY_Cf, /**< @brief Format Control Character */
  58. UCD_CATEGORY_Cn, /**< @brief Unassigned */
  59. UCD_CATEGORY_Co, /**< @brief Private Use */
  60. UCD_CATEGORY_Cs, /**< @brief Surrogate Code Point */
  61. UCD_CATEGORY_Ii, /**< @brief Invalid Unicode Codepoint */
  62. UCD_CATEGORY_Ll, /**< @brief Lower Case Letter */
  63. UCD_CATEGORY_Lm, /**< @brief Letter Modifier */
  64. UCD_CATEGORY_Lo, /**< @brief Other Letter */
  65. UCD_CATEGORY_Lt, /**< @brief Title Case Letter */
  66. UCD_CATEGORY_Lu, /**< @brief Upper Case Letter */
  67. UCD_CATEGORY_Mc, /**< @brief Spacing Mark */
  68. UCD_CATEGORY_Me, /**< @brief Enclosing Mark */
  69. UCD_CATEGORY_Mn, /**< @brief Non-Spacing Mark */
  70. UCD_CATEGORY_Nd, /**< @brief Decimal Digit */
  71. UCD_CATEGORY_Nl, /**< @brief Letter-Like Number */
  72. UCD_CATEGORY_No, /**< @brief Other Number */
  73. UCD_CATEGORY_Pc, /**< @brief Connector */
  74. UCD_CATEGORY_Pd, /**< @brief Dash/Hyphen */
  75. UCD_CATEGORY_Pe, /**< @brief Close Punctuation Mark */
  76. UCD_CATEGORY_Pf, /**< @brief Final Quotation Mark */
  77. UCD_CATEGORY_Pi, /**< @brief Initial Quotation Mark */
  78. UCD_CATEGORY_Po, /**< @brief Other */
  79. UCD_CATEGORY_Ps, /**< @brief Open Punctuation Mark */
  80. UCD_CATEGORY_Sc, /**< @brief Currency Symbol */
  81. UCD_CATEGORY_Sk, /**< @brief Modifier Symbol */
  82. UCD_CATEGORY_Sm, /**< @brief Math Symbol */
  83. UCD_CATEGORY_So, /**< @brief Other Symbol */
  84. UCD_CATEGORY_Zl, /**< @brief Line Separator */
  85. UCD_CATEGORY_Zp, /**< @brief Paragraph Separator */
  86. UCD_CATEGORY_Zs, /**< @brief Space Separator */
  87. } ucd_category;
  88. /** @brief Get a string representation of the category enumeration value.
  89. *
  90. * @param c The value to get the string representation for.
  91. *
  92. * @return The string representation, or "--" if the value is not recognized.
  93. */
  94. const char *ucd_get_category_string(ucd_category c);
  95. /** @brief Lookup the General Category Group for a General Category.
  96. *
  97. * @param c The General Category to lookup.
  98. * @return The General Category Group of the General Category.
  99. */
  100. ucd_category_group ucd_get_category_group_for_category(ucd_category c);
  101. /** @brief Lookup the General Category Group for a Unicode codepoint.
  102. *
  103. * @param c The Unicode codepoint to lookup.
  104. * @return The General Category Group of the Unicode codepoint.
  105. */
  106. ucd_category_group ucd_lookup_category_group(codepoint_t c);
  107. /** @brief Lookup the General Category for a Unicode codepoint.
  108. *
  109. * @param c The Unicode codepoint to lookup.
  110. * @return The General Category of the Unicode codepoint.
  111. */
  112. ucd_category ucd_lookup_category(codepoint_t c);
  113. /** @brief Unicode Script
  114. * @see http://www.iana.org/assignments/language-subtag-registry
  115. * @see http://www.unicode.org/iso15924/iso15924-codes.html
  116. */
  117. typedef enum ucd_script_
  118. {
  119. UCD_SCRIPT_Adlm, /**< @brief Adlam Script */
  120. UCD_SCRIPT_Afak, /**< @brief Afaka Script */
  121. UCD_SCRIPT_Aghb, /**< @brief Caucasian Albanian Script */
  122. UCD_SCRIPT_Ahom, /**< @brief Tai Ahom Script */
  123. UCD_SCRIPT_Arab, /**< @brief Arabic Script */
  124. UCD_SCRIPT_Armi, /**< @brief Imperial Aramaic Script */
  125. UCD_SCRIPT_Armn, /**< @brief Armenian Script */
  126. UCD_SCRIPT_Avst, /**< @brief Avestan Script */
  127. UCD_SCRIPT_Bali, /**< @brief Balinese Script */
  128. UCD_SCRIPT_Bamu, /**< @brief Bamum Script */
  129. UCD_SCRIPT_Bass, /**< @brief Bassa Vah Script */
  130. UCD_SCRIPT_Batk, /**< @brief Batak Script */
  131. UCD_SCRIPT_Beng, /**< @brief Bengali Script */
  132. UCD_SCRIPT_Bhks, /**< @brief Bhaiksuki Script */
  133. UCD_SCRIPT_Blis, /**< @brief Blissymbols Script */
  134. UCD_SCRIPT_Bopo, /**< @brief Bopomofo Script */
  135. UCD_SCRIPT_Brah, /**< @brief Brahmi Script */
  136. UCD_SCRIPT_Brai, /**< @brief Braille Script */
  137. UCD_SCRIPT_Bugi, /**< @brief Buginese Script */
  138. UCD_SCRIPT_Buhd, /**< @brief Buhid Script */
  139. UCD_SCRIPT_Cakm, /**< @brief Chakma Script */
  140. UCD_SCRIPT_Cans, /**< @brief Unified Canadian Aboriginal Syllabics */
  141. UCD_SCRIPT_Cari, /**< @brief Carian Script */
  142. UCD_SCRIPT_Cham, /**< @brief Cham Script */
  143. UCD_SCRIPT_Cher, /**< @brief Cherokee Script */
  144. UCD_SCRIPT_Cirt, /**< @brief Cirth Script */
  145. UCD_SCRIPT_Copt, /**< @brief Coptic Script */
  146. UCD_SCRIPT_Cprt, /**< @brief Cypriot Script */
  147. UCD_SCRIPT_Cyrl, /**< @brief Cyrillic Script */
  148. UCD_SCRIPT_Cyrs, /**< @brief Cyrillic (Old Church Slavonic variant) Script */
  149. UCD_SCRIPT_Deva, /**< @brief Devanagari Script */
  150. UCD_SCRIPT_Dsrt, /**< @brief Deseret Script */
  151. UCD_SCRIPT_Dupl, /**< @brief Duployan Shorthand Script */
  152. UCD_SCRIPT_Egyd, /**< @brief Egyptian Demotic Script */
  153. UCD_SCRIPT_Egyh, /**< @brief Egyptian Hieratic Script */
  154. UCD_SCRIPT_Egyp, /**< @brief Egyptian Hiegoglyphs */
  155. UCD_SCRIPT_Elba, /**< @brief Elbasan Script */
  156. UCD_SCRIPT_Ethi, /**< @brief Ethiopic Script */
  157. UCD_SCRIPT_Geok, /**< @brief Khutsuri Script */
  158. UCD_SCRIPT_Geor, /**< @brief Geirgian Script */
  159. UCD_SCRIPT_Glag, /**< @brief Glagolitic Script */
  160. UCD_SCRIPT_Goth, /**< @brief Gothic Script */
  161. UCD_SCRIPT_Gran, /**< @brief Grantha Script */
  162. UCD_SCRIPT_Grek, /**< @brief Greek Script */
  163. UCD_SCRIPT_Gujr, /**< @brief Gujarati Script */
  164. UCD_SCRIPT_Guru, /**< @brief Gurmukhi Script */
  165. UCD_SCRIPT_Hang, /**< @brief Hangul Script */
  166. UCD_SCRIPT_Hani, /**< @brief Han (Hanzi, Kanji, Hanja) Script */
  167. UCD_SCRIPT_Hano, /**< @brief Hanunoo Script */
  168. UCD_SCRIPT_Hans, /**< @brief Han (Simplified) Script */
  169. UCD_SCRIPT_Hant, /**< @brief Han (Traditional) Script */
  170. UCD_SCRIPT_Hatr, /**< @brief Hatran Script */
  171. UCD_SCRIPT_Hebr, /**< @brief Hebrew Script */
  172. UCD_SCRIPT_Hira, /**< @brief Hiragana Script */
  173. UCD_SCRIPT_Hluw, /**< @brief Anatolian Hieroglyphs */
  174. UCD_SCRIPT_Hmng, /**< @brief Pahawh Hmong Script */
  175. UCD_SCRIPT_Hrkt, /**< @brief Japanese Syllabaries */
  176. UCD_SCRIPT_Hung, /**< @brief Old Hungarian Script */
  177. UCD_SCRIPT_Inds, /**< @brief Indus Script */
  178. UCD_SCRIPT_Ital, /**< @brief Old Italic Script */
  179. UCD_SCRIPT_Java, /**< @brief Javanese Script */
  180. UCD_SCRIPT_Jpan, /**< @brief Japanese (Han + Hiragana + Katakana) Scripts */
  181. UCD_SCRIPT_Jurc, /**< @brief Jurchen Script */
  182. UCD_SCRIPT_Kali, /**< @brief Kayah Li Script */
  183. UCD_SCRIPT_Kana, /**< @brief Katakana Script */
  184. UCD_SCRIPT_Khar, /**< @brief Kharoshthi Script */
  185. UCD_SCRIPT_Khmr, /**< @brief Khmer Script */
  186. UCD_SCRIPT_Khoj, /**< @brief Khojki Script */
  187. UCD_SCRIPT_Knda, /**< @brief Kannada Script */
  188. UCD_SCRIPT_Kore, /**< @brief Korean (Hangul + Han) Scripts */
  189. UCD_SCRIPT_Kpel, /**< @brief Kpelle Script */
  190. UCD_SCRIPT_Kthi, /**< @brief Kaithi Script */
  191. UCD_SCRIPT_Lana, /**< @brief Tai Tham Script */
  192. UCD_SCRIPT_Laoo, /**< @brief Lao Script */
  193. UCD_SCRIPT_Latf, /**< @brief Latin Script (Fractur Variant) */
  194. UCD_SCRIPT_Latg, /**< @brief Latin Script (Gaelic Variant) */
  195. UCD_SCRIPT_Latn, /**< @brief Latin Script */
  196. UCD_SCRIPT_Lepc, /**< @brief Lepcha Script */
  197. UCD_SCRIPT_Limb, /**< @brief Limbu Script */
  198. UCD_SCRIPT_Lina, /**< @brief Linear A Script */
  199. UCD_SCRIPT_Linb, /**< @brief Linear B Script */
  200. UCD_SCRIPT_Lisu, /**< @brief Lisu Script */
  201. UCD_SCRIPT_Loma, /**< @brief Loma Script */
  202. UCD_SCRIPT_Lyci, /**< @brief Lycian Script */
  203. UCD_SCRIPT_Lydi, /**< @brief Lydian Script */
  204. UCD_SCRIPT_Mahj, /**< @brief Mahajani Script */
  205. UCD_SCRIPT_Mand, /**< @brief Mandaic Script */
  206. UCD_SCRIPT_Mani, /**< @brief Manichaean Script */
  207. UCD_SCRIPT_Marc, /**< @brief Marchen Script */
  208. UCD_SCRIPT_Maya, /**< @brief Mayan Hieroglyphs */
  209. UCD_SCRIPT_Mend, /**< @brief Mende Kikakui Script */
  210. UCD_SCRIPT_Merc, /**< @brief Meroitic Cursive Script */
  211. UCD_SCRIPT_Mero, /**< @brief Meroitic Hieroglyphs */
  212. UCD_SCRIPT_Mlym, /**< @brief Malayalam Script */
  213. UCD_SCRIPT_Modi, /**< @brief Modi Script */
  214. UCD_SCRIPT_Mong, /**< @brief Mongolian Script */
  215. UCD_SCRIPT_Moon, /**< @brief Moon Script */
  216. UCD_SCRIPT_Mroo, /**< @brief Mro Script */
  217. UCD_SCRIPT_Mtei, /**< @brief Meitei Mayek Script */
  218. UCD_SCRIPT_Mult, /**< @brief Multani Script */
  219. UCD_SCRIPT_Mymr, /**< @brief Myanmar (Burmese) Script */
  220. UCD_SCRIPT_Narb, /**< @brief Old North Arabian Script */
  221. UCD_SCRIPT_Nbat, /**< @brief Nabataean Script */
  222. UCD_SCRIPT_Newa, /**< @brief Newa Script */
  223. UCD_SCRIPT_Nkgb, /**< @brief Nakhi Geba Script */
  224. UCD_SCRIPT_Nkoo, /**< @brief N'Ko Script */
  225. UCD_SCRIPT_Nshu, /**< @brief Nushu Script */
  226. UCD_SCRIPT_Ogam, /**< @brief Ogham Script */
  227. UCD_SCRIPT_Olck, /**< @brief Ol Chiki Script */
  228. UCD_SCRIPT_Orkh, /**< @brief Old Turkic Script */
  229. UCD_SCRIPT_Orya, /**< @brief Oriya Script */
  230. UCD_SCRIPT_Osge, /**< @brief Osage Script */
  231. UCD_SCRIPT_Osma, /**< @brief Osmanya Script */
  232. UCD_SCRIPT_Palm, /**< @brief Palmyrene Script */
  233. UCD_SCRIPT_Pauc, /**< @brief Pau Cin Hau Script */
  234. UCD_SCRIPT_Perm, /**< @brief Old Permic */
  235. UCD_SCRIPT_Phag, /**< @brief Phags-Pa Script */
  236. UCD_SCRIPT_Phli, /**< @brief Inscriptional Pahlavi Script */
  237. UCD_SCRIPT_Phlp, /**< @brief Psalter Pahlavi Script */
  238. UCD_SCRIPT_Phlv, /**< @brief Book Pahlavi Script */
  239. UCD_SCRIPT_Phnx, /**< @brief Phoenician Script */
  240. UCD_SCRIPT_Plrd, /**< @brief Miao Script */
  241. UCD_SCRIPT_Prti, /**< @brief Inscriptional Parthian Script */
  242. UCD_SCRIPT_Qaak, /**< @brief Klingon Script (Private Use) */
  243. UCD_SCRIPT_Rjng, /**< @brief Rejang Script */
  244. UCD_SCRIPT_Roro, /**< @brief Rongorongo Script */
  245. UCD_SCRIPT_Runr, /**< @brief Runic Script */
  246. UCD_SCRIPT_Samr, /**< @brief Samaritan Script */
  247. UCD_SCRIPT_Sara, /**< @brief Sarati Script */
  248. UCD_SCRIPT_Sarb, /**< @brief Old South Arabian Script */
  249. UCD_SCRIPT_Saur, /**< @brief Saurashtra Script */
  250. UCD_SCRIPT_Sgnw, /**< @brief Sign Writing */
  251. UCD_SCRIPT_Shaw, /**< @brief Shavian Script */
  252. UCD_SCRIPT_Shrd, /**< @brief Sharada Script */
  253. UCD_SCRIPT_Sidd, /**< @brief Siddham Script */
  254. UCD_SCRIPT_Sind, /**< @brief Sindhi Script */
  255. UCD_SCRIPT_Sinh, /**< @brief Sinhala Script */
  256. UCD_SCRIPT_Sora, /**< @brief Sora Sompeng Script */
  257. UCD_SCRIPT_Sund, /**< @brief Sundanese Script */
  258. UCD_SCRIPT_Sylo, /**< @brief Syloti Nagri Script */
  259. UCD_SCRIPT_Syrc, /**< @brief Syriac Script */
  260. UCD_SCRIPT_Syre, /**< @brief Syriac Script (Estrangelo Variant) */
  261. UCD_SCRIPT_Syrj, /**< @brief Syriac Script (Western Variant) */
  262. UCD_SCRIPT_Syrn, /**< @brief Syriac Script (Eastern Variant) */
  263. UCD_SCRIPT_Tagb, /**< @brief Tagbanwa Script */
  264. UCD_SCRIPT_Takr, /**< @brief Takri Script */
  265. UCD_SCRIPT_Tale, /**< @brief Tai Le Script */
  266. UCD_SCRIPT_Talu, /**< @brief New Tai Lue Script */
  267. UCD_SCRIPT_Taml, /**< @brief Tamil Script */
  268. UCD_SCRIPT_Tang, /**< @brief Tangut Script */
  269. UCD_SCRIPT_Tavt, /**< @brief Tai Viet Script */
  270. UCD_SCRIPT_Telu, /**< @brief Telugu Script */
  271. UCD_SCRIPT_Teng, /**< @brief Tengwar Script */
  272. UCD_SCRIPT_Tfng, /**< @brief Tifinagh Script */
  273. UCD_SCRIPT_Tglg, /**< @brief Tagalog Script */
  274. UCD_SCRIPT_Thaa, /**< @brief Thaana Script */
  275. UCD_SCRIPT_Thai, /**< @brief Thai Script */
  276. UCD_SCRIPT_Tibt, /**< @brief Tibetan Script */
  277. UCD_SCRIPT_Tirh, /**< @brief Tirhuta Script */
  278. UCD_SCRIPT_Ugar, /**< @brief Ugaritic Script */
  279. UCD_SCRIPT_Vaii, /**< @brief Vai Script */
  280. UCD_SCRIPT_Visp, /**< @brief Visible Speech Script */
  281. UCD_SCRIPT_Wara, /**< @brief Warang Citi Script */
  282. UCD_SCRIPT_Wole, /**< @brief Woleai Script */
  283. UCD_SCRIPT_Xpeo, /**< @brief Old Persian Script */
  284. UCD_SCRIPT_Xsux, /**< @brief Cuneiform Script */
  285. UCD_SCRIPT_Yiii, /**< @brief Yi Script */
  286. UCD_SCRIPT_Zinh, /**< @brief Inherited Script */
  287. UCD_SCRIPT_Zmth, /**< @brief Mathematical Notation */
  288. UCD_SCRIPT_Zsym, /**< @brief Symbols */
  289. UCD_SCRIPT_Zxxx, /**< @brief Unwritten Documents */
  290. UCD_SCRIPT_Zyyy, /**< @brief Undetermined Script */
  291. UCD_SCRIPT_Zzzz, /**< @brief Uncoded Script */
  292. } ucd_script;
  293. /** @brief Get a string representation of the script enumeration value.
  294. *
  295. * @param s The value to get the string representation for.
  296. *
  297. * @return The string representation, or "----" if the value is not recognized.
  298. */
  299. const char *ucd_get_script_string(ucd_script s);
  300. /** @brief Lookup the Script for a Unicode codepoint.
  301. *
  302. * @param c The Unicode codepoint to lookup.
  303. * @return The Script of the Unicode codepoint.
  304. */
  305. ucd_script ucd_lookup_script(codepoint_t c);
  306. /** @brief Properties
  307. */
  308. typedef enum ucd_property_
  309. {
  310. UCD_PROPERTY_WHITE_SPACE = 0x00000001, /**< @brief White_Space PropList */
  311. UCD_PROPERTY_NO_BREAK = 0x00000002, /**< @brief <noBreak> DispositionType (enabled check only) */
  312. UCD_PROPERTY_BIDI_CONTROL = 0x00000004, /**< @brief Bidi_Control PropList */
  313. UCD_PROPERTY_JOIN_CONTROL = 0x00000008, /**< @brief Join_Control PropList */
  314. UCD_PROPERTY_DASH = 0x00000010, /**< @brief Dash PropList */
  315. UCD_PROPERTY_HYPHEN = 0x00000020, /**< @brief Hyphen PropList */
  316. UCD_PROPERTY_QUOTATION_MARK = 0x00000040, /**< @brief Quotation_Mark PropList */
  317. UCD_PROPERTY_TERMINAL_PUNCTUATION = 0x00000080, /**< @brief Terminal_Punctuation PropList */
  318. UCD_PROPERTY_OTHER_MATH = 0x00000100, /**< @brief Other_Math PropList */
  319. } ucd_property;
  320. /** @brief Return the properties of the specified codepoint.
  321. *
  322. * @param c The Unicode codepoint to lookup.
  323. * @param category The General Category of the codepoint.
  324. * @return The properties associated with the codepoint.
  325. */
  326. ucd_property ucd_properties(codepoint_t c, ucd_category category);
  327. /** @brief Is the codepoint in the 'alnum' class?
  328. *
  329. * @param c The Unicode codepoint to check.
  330. * @return Non-zero if the codepoint is in the 'alnum' class, zero otherwise.
  331. */
  332. int ucd_isalnum(codepoint_t c);
  333. /** @brief Is the codepoint in the 'alpha' class?
  334. *
  335. * @param c The Unicode codepoint to check.
  336. * @return Non-zero if the codepoint is in the 'alpha' class, zero otherwise.
  337. */
  338. int ucd_isalpha(codepoint_t c);
  339. /** @brief Is the codepoint in the 'blank' class?
  340. *
  341. * @param c The Unicode codepoint to check.
  342. * @return Non-zero if the codepoint is in the 'blank' class, zero otherwise.
  343. */
  344. int ucd_isblank(codepoint_t c);
  345. /** @brief Is the codepoint in the 'cntrl' class?
  346. *
  347. * @param c The Unicode codepoint to check.
  348. * @return Non-zero if the codepoint is in the 'cntrl' class, zero otherwise.
  349. */
  350. int ucd_iscntrl(codepoint_t c);
  351. /** @brief Is the codepoint in the 'digit' class?
  352. *
  353. * @param c The Unicode codepoint to check.
  354. * @return Non-zero if the codepoint is in the 'digit' class, zero otherwise.
  355. */
  356. int ucd_isdigit(codepoint_t c);
  357. /** @brief Is the codepoint in the 'graph' class?
  358. *
  359. * @param c The Unicode codepoint to check.
  360. * @return Non-zero if the codepoint is in the 'graph' class, zero otherwise.
  361. */
  362. int ucd_isgraph(codepoint_t c);
  363. /** @brief Is the codepoint in the 'lower' class?
  364. *
  365. * @param c The Unicode codepoint to check.
  366. * @return Non-zero if the codepoint is in the 'lower' class, zero otherwise.
  367. */
  368. int ucd_islower(codepoint_t c);
  369. /** @brief Is the codepoint in the 'print' class?
  370. *
  371. * @param c The Unicode codepoint to check.
  372. * @return Non-zero if the codepoint is in the 'print' class, zero otherwise.
  373. */
  374. int ucd_isprint(codepoint_t c);
  375. /** @brief Is the codepoint in the 'punct' class?
  376. *
  377. * @param c The Unicode codepoint to check.
  378. * @return Non-zero if the codepoint is in the 'punct' class, zero otherwise.
  379. */
  380. int ucd_ispunct(codepoint_t c);
  381. /** @brief Is the codepoint in the 'space' class?
  382. *
  383. * @param c The Unicode codepoint to check.
  384. * @return Non-zero if the codepoint is in the 'space' class, zero otherwise.
  385. */
  386. int ucd_isspace(codepoint_t c);
  387. /** @brief Is the codepoint in the 'upper' class?
  388. *
  389. * @param c The Unicode codepoint to check.
  390. * @return Non-zero if the codepoint is in the 'upper' class, zero otherwise.
  391. */
  392. int ucd_isupper(codepoint_t c);
  393. /** @brief Is the codepoint in the 'xdigit' class?
  394. *
  395. * @param c The Unicode codepoint to check.
  396. * @return Non-zero if the codepoint is in the 'xdigit' class, zero otherwise.
  397. */
  398. int ucd_isxdigit(codepoint_t c);
  399. /** @brief Convert the Unicode codepoint to upper-case.
  400. *
  401. * This function only uses the simple case mapping present in the
  402. * UnicodeData file. The data in SpecialCasing requires Unicode
  403. * codepoints to be mapped to multiple codepoints.
  404. *
  405. * @param c The Unicode codepoint to convert.
  406. * @return The upper-case Unicode codepoint for this codepoint, or
  407. * this codepoint if there is no upper-case codepoint.
  408. */
  409. codepoint_t ucd_toupper(codepoint_t c);
  410. /** @brief Convert the Unicode codepoint to lower-case.
  411. *
  412. * This function only uses the simple case mapping present in the
  413. * UnicodeData file. The data in SpecialCasing requires Unicode
  414. * codepoints to be mapped to multiple codepoints.
  415. *
  416. * @param c The Unicode codepoint to convert.
  417. * @return The lower-case Unicode codepoint for this codepoint, or
  418. * this codepoint if there is no upper-case codepoint.
  419. */
  420. codepoint_t ucd_tolower(codepoint_t c);
  421. /** @brief Convert the Unicode codepoint to title-case.
  422. *
  423. * This function only uses the simple case mapping present in the
  424. * UnicodeData file. The data in SpecialCasing requires Unicode
  425. * codepoints to be mapped to multiple codepoints.
  426. *
  427. * @param c The Unicode codepoint to convert.
  428. * @return The title-case Unicode codepoint for this codepoint, or
  429. * this codepoint if there is no upper-case codepoint.
  430. */
  431. codepoint_t ucd_totitle(codepoint_t c);
  432. #ifdef __cplusplus
  433. }
  434. /** @brief Unicode Character Database
  435. */
  436. namespace ucd
  437. {
  438. /** @brief Represents a Unicode codepoint.
  439. */
  440. using ::codepoint_t;
  441. /** @brief Unicode General Category Groups
  442. * @see http://www.unicode.org/reports/tr44/
  443. */
  444. enum category_group
  445. {
  446. C = UCD_CATEGORY_GROUP_C, /**< @brief Other */
  447. I = UCD_CATEGORY_GROUP_I, /**< @brief Invalid */
  448. L = UCD_CATEGORY_GROUP_L, /**< @brief Letter */
  449. M = UCD_CATEGORY_GROUP_M, /**< @brief Mark */
  450. N = UCD_CATEGORY_GROUP_N, /**< @brief Number */
  451. P = UCD_CATEGORY_GROUP_P, /**< @brief Punctuation */
  452. S = UCD_CATEGORY_GROUP_S, /**< @brief Symbol */
  453. Z = UCD_CATEGORY_GROUP_Z, /**< @brief Separator */
  454. };
  455. /** @brief Get a string representation of the category_group enumeration value.
  456. *
  457. * @param c The value to get the string representation for.
  458. *
  459. * @return The string representation, or "-" if the value is not recognized.
  460. */
  461. inline const char *get_category_group_string(category_group c)
  462. {
  463. return ucd_get_category_group_string((ucd_category_group)c);
  464. }
  465. /** @brief Unicode General Category Values
  466. * @see http://www.unicode.org/reports/tr44/
  467. */
  468. enum category
  469. {
  470. Cc = UCD_CATEGORY_Cc, /**< @brief Control Character */
  471. Cf = UCD_CATEGORY_Cf, /**< @brief Format Control Character */
  472. Cn = UCD_CATEGORY_Cn, /**< @brief Unassigned */
  473. Co = UCD_CATEGORY_Co, /**< @brief Private Use */
  474. Cs = UCD_CATEGORY_Cs, /**< @brief Surrogate Code Point */
  475. Ii = UCD_CATEGORY_Ii, /**< @brief Invalid Unicode Codepoint */
  476. Ll = UCD_CATEGORY_Ll, /**< @brief Lower Case Letter */
  477. Lm = UCD_CATEGORY_Lm, /**< @brief Letter Modifier */
  478. Lo = UCD_CATEGORY_Lo, /**< @brief Other Letter */
  479. Lt = UCD_CATEGORY_Lt, /**< @brief Title Case Letter */
  480. Lu = UCD_CATEGORY_Lu, /**< @brief Upper Case Letter */
  481. Mc = UCD_CATEGORY_Mc, /**< @brief Spacing Mark */
  482. Me = UCD_CATEGORY_Me, /**< @brief Enclosing Mark */
  483. Mn = UCD_CATEGORY_Mn, /**< @brief Non-Spacing Mark */
  484. Nd = UCD_CATEGORY_Nd, /**< @brief Decimal Digit */
  485. Nl = UCD_CATEGORY_Nl, /**< @brief Letter-Like Number */
  486. No = UCD_CATEGORY_No, /**< @brief Other Number */
  487. Pc = UCD_CATEGORY_Pc, /**< @brief Connector */
  488. Pd = UCD_CATEGORY_Pd, /**< @brief Dash/Hyphen */
  489. Pe = UCD_CATEGORY_Pe, /**< @brief Close Punctuation Mark */
  490. Pf = UCD_CATEGORY_Pf, /**< @brief Final Quotation Mark */
  491. Pi = UCD_CATEGORY_Pi, /**< @brief Initial Quotation Mark */
  492. Po = UCD_CATEGORY_Po, /**< @brief Other */
  493. Ps = UCD_CATEGORY_Ps, /**< @brief Open Punctuation Mark */
  494. Sc = UCD_CATEGORY_Sc, /**< @brief Currency Symbol */
  495. Sk = UCD_CATEGORY_Sk, /**< @brief Modifier Symbol */
  496. Sm = UCD_CATEGORY_Sm, /**< @brief Math Symbol */
  497. So = UCD_CATEGORY_So, /**< @brief Other Symbol */
  498. Zl = UCD_CATEGORY_Zl, /**< @brief Line Separator */
  499. Zp = UCD_CATEGORY_Zp, /**< @brief Paragraph Separator */
  500. Zs = UCD_CATEGORY_Zs, /**< @brief Space Separator */
  501. };
  502. /** @brief Get a string representation of the category enumeration value.
  503. *
  504. * @param c The value to get the string representation for.
  505. *
  506. * @return The string representation, or "--" if the value is not recognized.
  507. */
  508. inline const char *get_category_string(category c)
  509. {
  510. return ucd_get_category_string((ucd_category)c);
  511. }
  512. /** @brief Lookup the General Category Group for a General Category.
  513. *
  514. * @param c The General Category to lookup.
  515. * @return The General Category Group of the General Category.
  516. */
  517. inline category_group lookup_category_group(category c)
  518. {
  519. return (category_group)ucd_get_category_group_for_category((ucd_category)c);
  520. }
  521. /** @brief Lookup the General Category Group for a Unicode codepoint.
  522. *
  523. * @param c The Unicode codepoint to lookup.
  524. * @return The General Category Group of the Unicode codepoint.
  525. */
  526. inline category_group lookup_category_group(codepoint_t c)
  527. {
  528. return (category_group)ucd_lookup_category_group(c);
  529. }
  530. /** @brief Lookup the General Category for a Unicode codepoint.
  531. *
  532. * @param c The Unicode codepoint to lookup.
  533. * @return The General Category of the Unicode codepoint.
  534. */
  535. inline category lookup_category(codepoint_t c)
  536. {
  537. return (category)ucd_lookup_category(c);
  538. }
  539. /** @brief Unicode Script
  540. * @see http://www.iana.org/assignments/language-subtag-registry
  541. * @see http://www.unicode.org/iso15924/iso15924-codes.html
  542. */
  543. enum script
  544. {
  545. Adlm = UCD_SCRIPT_Adlm, /**< @brief Adlam Script */
  546. Afak = UCD_SCRIPT_Afak, /**< @brief Afaka Script */
  547. Aghb = UCD_SCRIPT_Aghb, /**< @brief Caucasian Albanian Script */
  548. Ahom = UCD_SCRIPT_Ahom, /**< @brief Tai Ahom Script */
  549. Arab = UCD_SCRIPT_Arab, /**< @brief Arabic Script */
  550. Armi = UCD_SCRIPT_Armi, /**< @brief Imperial Aramaic Script */
  551. Armn = UCD_SCRIPT_Armn, /**< @brief Armenian Script */
  552. Avst = UCD_SCRIPT_Avst, /**< @brief Avestan Script */
  553. Bali = UCD_SCRIPT_Bali, /**< @brief Balinese Script */
  554. Bamu = UCD_SCRIPT_Bamu, /**< @brief Bamum Script */
  555. Bass = UCD_SCRIPT_Bass, /**< @brief Bassa Vah Script */
  556. Batk = UCD_SCRIPT_Batk, /**< @brief Batak Script */
  557. Beng = UCD_SCRIPT_Beng, /**< @brief Bengali Script */
  558. Bhks = UCD_SCRIPT_Bhks, /**< @brief Bhaiksuki Script */
  559. Blis = UCD_SCRIPT_Blis, /**< @brief Blissymbols Script */
  560. Bopo = UCD_SCRIPT_Bopo, /**< @brief Bopomofo Script */
  561. Brah = UCD_SCRIPT_Brah, /**< @brief Brahmi Script */
  562. Brai = UCD_SCRIPT_Brai, /**< @brief Braille Script */
  563. Bugi = UCD_SCRIPT_Bugi, /**< @brief Buginese Script */
  564. Buhd = UCD_SCRIPT_Buhd, /**< @brief Buhid Script */
  565. Cakm = UCD_SCRIPT_Cakm, /**< @brief Chakma Script */
  566. Cans = UCD_SCRIPT_Cans, /**< @brief Unified Canadian Aboriginal Syllabics */
  567. Cari = UCD_SCRIPT_Cari, /**< @brief Carian Script */
  568. Cham = UCD_SCRIPT_Cham, /**< @brief Cham Script */
  569. Cher = UCD_SCRIPT_Cher, /**< @brief Cherokee Script */
  570. Cirt = UCD_SCRIPT_Cirt, /**< @brief Cirth Script */
  571. Copt = UCD_SCRIPT_Copt, /**< @brief Coptic Script */
  572. Cprt = UCD_SCRIPT_Cprt, /**< @brief Cypriot Script */
  573. Cyrl = UCD_SCRIPT_Cyrl, /**< @brief Cyrillic Script */
  574. Cyrs = UCD_SCRIPT_Cyrs, /**< @brief Cyrillic (Old Church Slavonic variant) Script */
  575. Deva = UCD_SCRIPT_Deva, /**< @brief Devanagari Script */
  576. Dsrt = UCD_SCRIPT_Dsrt, /**< @brief Deseret Script */
  577. Dupl = UCD_SCRIPT_Dupl, /**< @brief Duployan Shorthand Script */
  578. Egyd = UCD_SCRIPT_Egyd, /**< @brief Egyptian Demotic Script */
  579. Egyh = UCD_SCRIPT_Egyh, /**< @brief Egyptian Hieratic Script */
  580. Egyp = UCD_SCRIPT_Egyp, /**< @brief Egyptian Hiegoglyphs */
  581. Elba = UCD_SCRIPT_Elba, /**< @brief Elbasan Script */
  582. Ethi = UCD_SCRIPT_Ethi, /**< @brief Ethiopic Script */
  583. Geok = UCD_SCRIPT_Geok, /**< @brief Khutsuri Script */
  584. Geor = UCD_SCRIPT_Geor, /**< @brief Geirgian Script */
  585. Glag = UCD_SCRIPT_Glag, /**< @brief Glagolitic Script */
  586. Goth = UCD_SCRIPT_Goth, /**< @brief Gothic Script */
  587. Gran = UCD_SCRIPT_Gran, /**< @brief Grantha Script */
  588. Grek = UCD_SCRIPT_Grek, /**< @brief Greek Script */
  589. Gujr = UCD_SCRIPT_Gujr, /**< @brief Gujarati Script */
  590. Guru = UCD_SCRIPT_Guru, /**< @brief Gurmukhi Script */
  591. Hang = UCD_SCRIPT_Hang, /**< @brief Hangul Script */
  592. Hani = UCD_SCRIPT_Hani, /**< @brief Han (Hanzi, Kanji, Hanja) Script */
  593. Hano = UCD_SCRIPT_Hano, /**< @brief Hanunoo Script */
  594. Hans = UCD_SCRIPT_Hans, /**< @brief Han (Simplified) Script */
  595. Hant = UCD_SCRIPT_Hant, /**< @brief Han (Traditional) Script */
  596. Hatr = UCD_SCRIPT_Hatr, /**< @brief Hatran Script */
  597. Hebr = UCD_SCRIPT_Hebr, /**< @brief Hebrew Script */
  598. Hira = UCD_SCRIPT_Hira, /**< @brief Hiragana Script */
  599. Hluw = UCD_SCRIPT_Hluw, /**< @brief Anatolian Hieroglyphs */
  600. Hmng = UCD_SCRIPT_Hmng, /**< @brief Pahawh Hmong Script */
  601. Hrkt = UCD_SCRIPT_Hrkt, /**< @brief Japanese Syllabaries */
  602. Hung = UCD_SCRIPT_Hung, /**< @brief Old Hungarian Script */
  603. Inds = UCD_SCRIPT_Inds, /**< @brief Indus Script */
  604. Ital = UCD_SCRIPT_Ital, /**< @brief Old Italic Script */
  605. Java = UCD_SCRIPT_Java, /**< @brief Javanese Script */
  606. Jpan = UCD_SCRIPT_Jpan, /**< @brief Japanese (Han + Hiragana + Katakana) Scripts */
  607. Jurc = UCD_SCRIPT_Jurc, /**< @brief Jurchen Script */
  608. Kali = UCD_SCRIPT_Kali, /**< @brief Kayah Li Script */
  609. Kana = UCD_SCRIPT_Kana, /**< @brief Katakana Script */
  610. Khar = UCD_SCRIPT_Khar, /**< @brief Kharoshthi Script */
  611. Khmr = UCD_SCRIPT_Khmr, /**< @brief Khmer Script */
  612. Khoj = UCD_SCRIPT_Khoj, /**< @brief Khojki Script */
  613. Knda = UCD_SCRIPT_Knda, /**< @brief Kannada Script */
  614. Kore = UCD_SCRIPT_Kore, /**< @brief Korean (Hangul + Han) Scripts */
  615. Kpel = UCD_SCRIPT_Kpel, /**< @brief Kpelle Script */
  616. Kthi = UCD_SCRIPT_Kthi, /**< @brief Kaithi Script */
  617. Lana = UCD_SCRIPT_Lana, /**< @brief Tai Tham Script */
  618. Laoo = UCD_SCRIPT_Laoo, /**< @brief Lao Script */
  619. Latf = UCD_SCRIPT_Latf, /**< @brief Latin Script (Fractur Variant) */
  620. Latg = UCD_SCRIPT_Latg, /**< @brief Latin Script (Gaelic Variant) */
  621. Latn = UCD_SCRIPT_Latn, /**< @brief Latin Script */
  622. Lepc = UCD_SCRIPT_Lepc, /**< @brief Lepcha Script */
  623. Limb = UCD_SCRIPT_Limb, /**< @brief Limbu Script */
  624. Lina = UCD_SCRIPT_Lina, /**< @brief Linear A Script */
  625. Linb = UCD_SCRIPT_Linb, /**< @brief Linear B Script */
  626. Lisu = UCD_SCRIPT_Lisu, /**< @brief Lisu Script */
  627. Loma = UCD_SCRIPT_Loma, /**< @brief Loma Script */
  628. Lyci = UCD_SCRIPT_Lyci, /**< @brief Lycian Script */
  629. Lydi = UCD_SCRIPT_Lydi, /**< @brief Lydian Script */
  630. Mahj = UCD_SCRIPT_Mahj, /**< @brief Mahajani Script */
  631. Mand = UCD_SCRIPT_Mand, /**< @brief Mandaic Script */
  632. Mani = UCD_SCRIPT_Mani, /**< @brief Manichaean Script */
  633. Marc = UCD_SCRIPT_Marc, /**< @brief Marchen Script */
  634. Maya = UCD_SCRIPT_Maya, /**< @brief Mayan Hieroglyphs */
  635. Mend = UCD_SCRIPT_Mend, /**< @brief Mende Kikakui Script */
  636. Merc = UCD_SCRIPT_Merc, /**< @brief Meroitic Cursive Script */
  637. Mero = UCD_SCRIPT_Mero, /**< @brief Meroitic Hieroglyphs */
  638. Mlym = UCD_SCRIPT_Mlym, /**< @brief Malayalam Script */
  639. Modi = UCD_SCRIPT_Modi, /**< @brief Modi Script */
  640. Mong = UCD_SCRIPT_Mong, /**< @brief Mongolian Script */
  641. Moon = UCD_SCRIPT_Moon, /**< @brief Moon Script */
  642. Mroo = UCD_SCRIPT_Mroo, /**< @brief Mro Script */
  643. Mtei = UCD_SCRIPT_Mtei, /**< @brief Meitei Mayek Script */
  644. Mult = UCD_SCRIPT_Mult, /**< @brief Multani Script */
  645. Mymr = UCD_SCRIPT_Mymr, /**< @brief Myanmar (Burmese) Script */
  646. Narb = UCD_SCRIPT_Narb, /**< @brief Old North Arabian Script */
  647. Nbat = UCD_SCRIPT_Nbat, /**< @brief Nabataean Script */
  648. Newa = UCD_SCRIPT_Newa, /**< @brief Newa Script */
  649. Nkgb = UCD_SCRIPT_Nkgb, /**< @brief Nakhi Geba Script */
  650. Nkoo = UCD_SCRIPT_Nkoo, /**< @brief N'Ko Script */
  651. Nshu = UCD_SCRIPT_Nshu, /**< @brief Nushu Script */
  652. Ogam = UCD_SCRIPT_Ogam, /**< @brief Ogham Script */
  653. Olck = UCD_SCRIPT_Olck, /**< @brief Ol Chiki Script */
  654. Orkh = UCD_SCRIPT_Orkh, /**< @brief Old Turkic Script */
  655. Orya = UCD_SCRIPT_Orya, /**< @brief Oriya Script */
  656. Osge = UCD_SCRIPT_Osge, /**< @brief Osage Script */
  657. Osma = UCD_SCRIPT_Osma, /**< @brief Osmanya Script */
  658. Palm = UCD_SCRIPT_Palm, /**< @brief Palmyrene Script */
  659. Pauc = UCD_SCRIPT_Pauc, /**< @brief Pau Cin Hau Script */
  660. Perm = UCD_SCRIPT_Perm, /**< @brief Old Permic */
  661. Phag = UCD_SCRIPT_Phag, /**< @brief Phags-Pa Script */
  662. Phli = UCD_SCRIPT_Phli, /**< @brief Inscriptional Pahlavi Script */
  663. Phlp = UCD_SCRIPT_Phlp, /**< @brief Psalter Pahlavi Script */
  664. Phlv = UCD_SCRIPT_Phlv, /**< @brief Book Pahlavi Script */
  665. Phnx = UCD_SCRIPT_Phnx, /**< @brief Phoenician Script */
  666. Plrd = UCD_SCRIPT_Plrd, /**< @brief Miao Script */
  667. Prti = UCD_SCRIPT_Prti, /**< @brief Inscriptional Parthian Script */
  668. Qaak = UCD_SCRIPT_Qaak, /**< @brief Klingon Script (Private Use) */
  669. Rjng = UCD_SCRIPT_Rjng, /**< @brief Rejang Script */
  670. Roro = UCD_SCRIPT_Roro, /**< @brief Rongorongo Script */
  671. Runr = UCD_SCRIPT_Runr, /**< @brief Runic Script */
  672. Samr = UCD_SCRIPT_Samr, /**< @brief Samaritan Script */
  673. Sara = UCD_SCRIPT_Sara, /**< @brief Sarati Script */
  674. Sarb = UCD_SCRIPT_Sarb, /**< @brief Old South Arabian Script */
  675. Saur = UCD_SCRIPT_Saur, /**< @brief Saurashtra Script */
  676. Sgnw = UCD_SCRIPT_Sgnw, /**< @brief Sign Writing */
  677. Shaw = UCD_SCRIPT_Shaw, /**< @brief Shavian Script */
  678. Shrd = UCD_SCRIPT_Shrd, /**< @brief Sharada Script */
  679. Sidd = UCD_SCRIPT_Sidd, /**< @brief Siddham Script */
  680. Sind = UCD_SCRIPT_Sind, /**< @brief Sindhi Script */
  681. Sinh = UCD_SCRIPT_Sinh, /**< @brief Sinhala Script */
  682. Sora = UCD_SCRIPT_Sora, /**< @brief Sora Sompeng Script */
  683. Sund = UCD_SCRIPT_Sund, /**< @brief Sundanese Script */
  684. Sylo = UCD_SCRIPT_Sylo, /**< @brief Syloti Nagri Script */
  685. Syrc = UCD_SCRIPT_Syrc, /**< @brief Syriac Script */
  686. Syre = UCD_SCRIPT_Syre, /**< @brief Syriac Script (Estrangelo Variant) */
  687. Syrj = UCD_SCRIPT_Syrj, /**< @brief Syriac Script (Western Variant) */
  688. Syrn = UCD_SCRIPT_Syrn, /**< @brief Syriac Script (Eastern Variant) */
  689. Tagb = UCD_SCRIPT_Tagb, /**< @brief Tagbanwa Script */
  690. Takr = UCD_SCRIPT_Takr, /**< @brief Takri Script */
  691. Tale = UCD_SCRIPT_Tale, /**< @brief Tai Le Script */
  692. Talu = UCD_SCRIPT_Talu, /**< @brief New Tai Lue Script */
  693. Taml = UCD_SCRIPT_Taml, /**< @brief Tamil Script */
  694. Tang = UCD_SCRIPT_Tang, /**< @brief Tangut Script */
  695. Tavt = UCD_SCRIPT_Tavt, /**< @brief Tai Viet Script */
  696. Telu = UCD_SCRIPT_Telu, /**< @brief Telugu Script */
  697. Teng = UCD_SCRIPT_Teng, /**< @brief Tengwar Script */
  698. Tfng = UCD_SCRIPT_Tfng, /**< @brief Tifinagh Script */
  699. Tglg = UCD_SCRIPT_Tglg, /**< @brief Tagalog Script */
  700. Thaa = UCD_SCRIPT_Thaa, /**< @brief Thaana Script */
  701. Thai = UCD_SCRIPT_Thai, /**< @brief Thai Script */
  702. Tibt = UCD_SCRIPT_Tibt, /**< @brief Tibetan Script */
  703. Tirh = UCD_SCRIPT_Tirh, /**< @brief Tirhuta Script */
  704. Ugar = UCD_SCRIPT_Ugar, /**< @brief Ugaritic Script */
  705. Vaii = UCD_SCRIPT_Vaii, /**< @brief Vai Script */
  706. Visp = UCD_SCRIPT_Visp, /**< @brief Visible Speech Script */
  707. Wara = UCD_SCRIPT_Wara, /**< @brief Warang Citi Script */
  708. Wole = UCD_SCRIPT_Wole, /**< @brief Woleai Script */
  709. Xpeo = UCD_SCRIPT_Xpeo, /**< @brief Old Persian Script */
  710. Xsux = UCD_SCRIPT_Xsux, /**< @brief Cuneiform Script */
  711. Yiii = UCD_SCRIPT_Yiii, /**< @brief Yi Script */
  712. Zinh = UCD_SCRIPT_Zinh, /**< @brief Inherited Script */
  713. Zmth = UCD_SCRIPT_Zmth, /**< @brief Mathematical Notation */
  714. Zsym = UCD_SCRIPT_Zsym, /**< @brief Symbols */
  715. Zxxx = UCD_SCRIPT_Zxxx, /**< @brief Unwritten Documents */
  716. Zyyy = UCD_SCRIPT_Zyyy, /**< @brief Undetermined Script */
  717. Zzzz = UCD_SCRIPT_Zzzz, /**< @brief Uncoded Script */
  718. };
  719. /** @brief Get a string representation of the script enumeration value.
  720. *
  721. * @param s The value to get the string representation for.
  722. *
  723. * @return The string representation, or "----" if the value is not recognized.
  724. */
  725. inline const char *get_script_string(script s)
  726. {
  727. return ucd_get_script_string((ucd_script)s);
  728. }
  729. /** @brief Lookup the Script for a Unicode codepoint.
  730. *
  731. * @param c The Unicode codepoint to lookup.
  732. * @return The Script of the Unicode codepoint.
  733. */
  734. inline script lookup_script(codepoint_t c)
  735. {
  736. return (script)ucd_lookup_script(c);
  737. }
  738. /** @brief Properties
  739. */
  740. enum property
  741. {
  742. White_Space = UCD_PROPERTY_WHITE_SPACE, /**< @brief White_Space PropList */
  743. noBreak = UCD_PROPERTY_NO_BREAK, /**< @brief <noBreak> DispositionType (enabled check only) */
  744. Bidi_Control = UCD_PROPERTY_BIDI_CONTROL, /**< @brief Bidi_Control PropList */
  745. Join_Control = UCD_PROPERTY_JOIN_CONTROL, /**< @brief Join_Control PropList */
  746. Dash = UCD_PROPERTY_DASH, /**< @brief Dash PropList */
  747. Hyphen = UCD_PROPERTY_HYPHEN, /**< @brief Hyphen PropList */
  748. Quotation_Mark = UCD_PROPERTY_QUOTATION_MARK, /**< @brief Quotation_Mark PropList */
  749. Terminal_Punctuation = UCD_PROPERTY_TERMINAL_PUNCTUATION, /**< @brief Terminal_Punctuation PropList */
  750. Other_Math = UCD_PROPERTY_OTHER_MATH, /**< @brief Other_Math PropList */
  751. };
  752. /** @brief Return the properties of the specified codepoint.
  753. *
  754. * @param c The Unicode codepoint to lookup.
  755. * @param cat The General Category of the codepoint.
  756. * @return The properties associated with the codepoint.
  757. */
  758. inline property properties(codepoint_t c, category cat)
  759. {
  760. return (property)ucd_properties(c, (ucd_category)cat);
  761. }
  762. /** @brief Is the codepoint in the 'alnum' class?
  763. *
  764. * @param c The Unicode codepoint to check.
  765. * @return Non-zero if the codepoint is in the 'alnum' class, zero otherwise.
  766. */
  767. inline int isalnum(codepoint_t c)
  768. {
  769. return ucd_isalnum(c);
  770. }
  771. /** @brief Is the codepoint in the 'alpha' class?
  772. *
  773. * @param c The Unicode codepoint to check.
  774. * @return Non-zero if the codepoint is in the 'alpha' class, zero otherwise.
  775. */
  776. inline int isalpha(codepoint_t c)
  777. {
  778. return ucd_isalpha(c);
  779. }
  780. /** @brief Is the codepoint in the 'blank' class?
  781. *
  782. * @param c The Unicode codepoint to check.
  783. * @return Non-zero if the codepoint is in the 'blank' class, zero otherwise.
  784. */
  785. inline int isblank(codepoint_t c)
  786. {
  787. return ucd_isblank(c);
  788. }
  789. /** @brief Is the codepoint in the 'cntrl' class?
  790. *
  791. * @param c The Unicode codepoint to check.
  792. * @return Non-zero if the codepoint is in the 'cntrl' class, zero otherwise.
  793. */
  794. inline int iscntrl(codepoint_t c)
  795. {
  796. return ucd_iscntrl(c);
  797. }
  798. /** @brief Is the codepoint in the 'digit' class?
  799. *
  800. * @param c The Unicode codepoint to check.
  801. * @return Non-zero if the codepoint is in the 'digit' class, zero otherwise.
  802. */
  803. inline int isdigit(codepoint_t c)
  804. {
  805. return ucd_isdigit(c);
  806. }
  807. /** @brief Is the codepoint in the 'graph' class?
  808. *
  809. * @param c The Unicode codepoint to check.
  810. * @return Non-zero if the codepoint is in the 'graph' class, zero otherwise.
  811. */
  812. inline int isgraph(codepoint_t c)
  813. {
  814. return ucd_isgraph(c);
  815. }
  816. /** @brief Is the codepoint in the 'lower' class?
  817. *
  818. * @param c The Unicode codepoint to check.
  819. * @return Non-zero if the codepoint is in the 'lower' class, zero otherwise.
  820. */
  821. inline int islower(codepoint_t c)
  822. {
  823. return ucd_islower(c);
  824. }
  825. /** @brief Is the codepoint in the 'print' class?
  826. *
  827. * @param c The Unicode codepoint to check.
  828. * @return Non-zero if the codepoint is in the 'print' class, zero otherwise.
  829. */
  830. inline int isprint(codepoint_t c)
  831. {
  832. return ucd_isprint(c);
  833. }
  834. /** @brief Is the codepoint in the 'punct' class?
  835. *
  836. * @param c The Unicode codepoint to check.
  837. * @return Non-zero if the codepoint is in the 'punct' class, zero otherwise.
  838. */
  839. inline int ispunct(codepoint_t c)
  840. {
  841. return ucd_ispunct(c);
  842. }
  843. /** @brief Is the codepoint in the 'space' class?
  844. *
  845. * @param c The Unicode codepoint to check.
  846. * @return Non-zero if the codepoint is in the 'space' class, zero otherwise.
  847. */
  848. inline int isspace(codepoint_t c)
  849. {
  850. return ucd_isspace(c);
  851. }
  852. /** @brief Is the codepoint in the 'upper' class?
  853. *
  854. * @param c The Unicode codepoint to check.
  855. * @return Non-zero if the codepoint is in the 'upper' class, zero otherwise.
  856. */
  857. inline int isupper(codepoint_t c)
  858. {
  859. return ucd_isupper(c);
  860. }
  861. /** @brief Is the codepoint in the 'xdigit' class?
  862. *
  863. * @param c The Unicode codepoint to check.
  864. * @return Non-zero if the codepoint is in the 'xdigit' class, zero otherwise.
  865. */
  866. inline int isxdigit(codepoint_t c)
  867. {
  868. return ucd_isxdigit(c);
  869. }
  870. /** @brief Convert the Unicode codepoint to upper-case.
  871. *
  872. * This function only uses the simple case mapping present in the
  873. * UnicodeData file. The data in SpecialCasing requires Unicode
  874. * codepoints to be mapped to multiple codepoints.
  875. *
  876. * @param c The Unicode codepoint to convert.
  877. * @return The upper-case Unicode codepoint for this codepoint, or
  878. * this codepoint if there is no upper-case codepoint.
  879. */
  880. inline codepoint_t toupper(codepoint_t c)
  881. {
  882. return ucd_toupper(c);
  883. }
  884. /** @brief Convert the Unicode codepoint to lower-case.
  885. *
  886. * This function only uses the simple case mapping present in the
  887. * UnicodeData file. The data in SpecialCasing requires Unicode
  888. * codepoints to be mapped to multiple codepoints.
  889. *
  890. * @param c The Unicode codepoint to convert.
  891. * @return The lower-case Unicode codepoint for this codepoint, or
  892. * this codepoint if there is no upper-case codepoint.
  893. */
  894. inline codepoint_t tolower(codepoint_t c)
  895. {
  896. return ucd_tolower(c);
  897. }
  898. /** @brief Convert the Unicode codepoint to title-case.
  899. *
  900. * This function only uses the simple case mapping present in the
  901. * UnicodeData file. The data in SpecialCasing requires Unicode
  902. * codepoints to be mapped to multiple codepoints.
  903. *
  904. * @param c The Unicode codepoint to convert.
  905. * @return The title-case Unicode codepoint for this codepoint, or
  906. * this codepoint if there is no upper-case codepoint.
  907. */
  908. inline codepoint_t totitle(codepoint_t c)
  909. {
  910. return ucd_totitle(c);
  911. }
  912. }
  913. #endif
  914. #endif