From cfa45731762571f94196495541d3d9f0d310a4d4 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 21 Mar 2011 23:07:08 +0100 Subject: [PATCH] New module 'unictype/joininggroup-name'. * modules/unictype/joininggroup-name: New file. * lib/unictype/joininggroup_name.c: New file. * lib/unictype/joininggroup_name.h: New file. --- ChangeLog | 5 +++ lib/unictype/joininggroup_name.c | 55 ++++++++++++++++++++++++++++ lib/unictype/joininggroup_name.h | 74 ++++++++++++++++++++++++++++++++++++++ modules/unictype/joininggroup-name | 26 ++++++++++++++ 4 files changed, 160 insertions(+) create mode 100644 lib/unictype/joininggroup_name.c create mode 100644 lib/unictype/joininggroup_name.h create mode 100644 modules/unictype/joininggroup-name diff --git a/ChangeLog b/ChangeLog index 8dcbe9248..ba92e9b46 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2011-03-21 Bruno Haible + New module 'unictype/joininggroup-name'. + * modules/unictype/joininggroup-name: New file. + * lib/unictype/joininggroup_name.c: New file. + * lib/unictype/joininggroup_name.h: New file. + New module 'unictype/joiningtype-all'. * modules/unictype/joiningtype-all: New file. diff --git a/lib/unictype/joininggroup_name.c b/lib/unictype/joininggroup_name.c new file mode 100644 index 000000000..373a3c4d6 --- /dev/null +++ b/lib/unictype/joininggroup_name.c @@ -0,0 +1,55 @@ +/* Arabic joining group of Unicode characters. + Copyright (C) 2011 Free Software Foundation, Inc. + Written by Bruno Haible , 2011. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include "unictype.h" + +/* Use a string pool, rather than a two-dimensional array, because the strings + have very different lengths. */ + +struct joining_group_stringpool_t + { +#define ELEM(tag,string) char tag[sizeof (string)]; +#include "unictype/joininggroup_name.h" +#undef ELEM + }; + +static const struct joining_group_stringpool_t joining_group_stringpool_contents = + { +#define ELEM(tag,string) string, +#include "unictype/joininggroup_name.h" +#undef ELEM + }; +#define joining_group_stringpool ((const char *) &joining_group_stringpool_contents) + +static const int joining_group_index[] = + { +#define ELEM(tag,string) (int)(long)&((struct joining_group_stringpool_t *)0)->tag, +#include "unictype/joininggroup_name.h" +#undef ELEM + }; + +const char * +uc_joining_group_name (int joining_group) +{ + if (joining_group >= 0 + && joining_group < sizeof (joining_group_index) / sizeof (joining_group_index[0])) + return joining_group_stringpool + joining_group_index[joining_group]; + return NULL; +} diff --git a/lib/unictype/joininggroup_name.h b/lib/unictype/joininggroup_name.h new file mode 100644 index 000000000..12436a465 --- /dev/null +++ b/lib/unictype/joininggroup_name.h @@ -0,0 +1,74 @@ +/* Arabic joining group of Unicode characters. + Copyright (C) 2011 Free Software Foundation, Inc. + Written by Bruno Haible , 2011. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . */ + +ELEM (NONE, "No Joining Group") +ELEM (AIN, "Ain") +ELEM (ALAPH, "Alaph") +ELEM (ALEF, "Alef") +ELEM (BEH, "Beh") +ELEM (BETH, "Beth") +ELEM (BURUSHASKI_YEH_BARREE, "Burushaski Yeh Barree") +ELEM (DAL, "Dal") +ELEM (DALATH_RISH, "Dalath Rish") +ELEM (E, "E") +ELEM (FARSI_YEH, "Farsi Yeh") +ELEM (FE, "Fe") +ELEM (FEH, "Feh") +ELEM (FINAL_SEMKATH, "Final Semkath") +ELEM (GAF, "Gaf") +ELEM (GAMAL, "Gamal") +ELEM (HAH, "Hah") +ELEM (HE, "He") +ELEM (HEH, "Heh") +ELEM (HEH_GOAL, "Heh Goal") +ELEM (HETH, "Heth") +ELEM (KAF, "Kaf") +ELEM (KAPH, "Kaph") +ELEM (KHAPH, "Khaph") +ELEM (KNOTTED_HEH, "Knotted Heh") +ELEM (LAM, "Lam") +ELEM (LAMADH, "Lamadh") +ELEM (MEEM, "Meem") +ELEM (MIM, "Mim") +ELEM (NOON, "Noon") +ELEM (NUN, "Nun") +ELEM (NYA, "Nya") +ELEM (PE, "Pe") +ELEM (QAF, "Qaf") +ELEM (QAPH, "Qaph") +ELEM (REH, "Reh") +ELEM (REVERSED_PE, "Reversed Pe") +ELEM (SAD, "Sad") +ELEM (SADHE, "Sadhe") +ELEM (SEEN, "Seen") +ELEM (SEMKATH, "Semkath") +ELEM (SHIN, "Shin") +ELEM (SWASH_KAF, "Swash Kaf") +ELEM (SYRIAC_WAW, "Syriac Waw") +ELEM (TAH, "Tah") +ELEM (TAW, "Taw") +ELEM (TEH_MARBUTA, "Teh Marbuta") +ELEM (TEH_MARBUTA_GOAL, "Teh Marbuta Goal") +ELEM (TETH, "Teth") +ELEM (WAW, "Waw") +ELEM (YEH, "Yeh") +ELEM (YEH_BARREE, "Yeh Barree") +ELEM (YEH_WITH_TAIL, "Yeh With Tail") +ELEM (YUDH, "Yudh") +ELEM (YUDH_HE, "Yudh He") +ELEM (ZAIN, "Zain") +ELEM (ZHAIN, "Zhain") diff --git a/modules/unictype/joininggroup-name b/modules/unictype/joininggroup-name new file mode 100644 index 000000000..8df11fb3e --- /dev/null +++ b/modules/unictype/joininggroup-name @@ -0,0 +1,26 @@ +Description: +Name of Unicode character Arabic joining group. + +Files: +lib/unictype/joininggroup_name.c +lib/unictype/joininggroup_name.h + +Depends-on: +unictype/base + +configure.ac: +gl_LIBUNISTRING_MODULE([0.9.4], [unictype/joininggroup-name]) + +Makefile.am: +if LIBUNISTRING_COMPILE_UNICTYPE_JOININGGROUP_NAME +lib_SOURCES += unictype/joininggroup_name.c +endif + +Include: +"unictype.h" + +License: +LGPL + +Maintainer: +Bruno Haible -- 2.11.0