changeset 14454:be1d0cce54fd

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.
author Bruno Haible <bruno@clisp.org>
date Mon, 21 Mar 2011 23:07:08 +0100
parents 74c1200a73eb
children 51b56c6309e5
files ChangeLog lib/unictype/joininggroup_name.c lib/unictype/joininggroup_name.h modules/unictype/joininggroup-name
diffstat 4 files changed, 160 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2011-03-21  Bruno Haible  <bruno@clisp.org>
 
+	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.
 
new file mode 100644
--- /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 <bruno@clisp.org>, 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 <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* 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;
+}
new file mode 100644
--- /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 <bruno@clisp.org>, 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 <http://www.gnu.org/licenses/>.  */
+
+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")
new file mode 100644
--- /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