summaryrefslogtreecommitdiff
path: root/gettext-tools/gnulib-lib/unictype
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2015-12-28 00:06:36 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2015-12-28 00:06:36 +0000
commit6eb5949dd99d174393465069c2fd0bab32deddcc (patch)
treed104f72ac2dcb0f592b1c8e06a5af6790bd4080c /gettext-tools/gnulib-lib/unictype
parent482840e61f86ca321838a91e902c41d40c098bbb (diff)
downloadgettext-tarball-6eb5949dd99d174393465069c2fd0bab32deddcc.tar.gz
gettext-0.19.7gettext-0.19.7
Diffstat (limited to 'gettext-tools/gnulib-lib/unictype')
-rw-r--r--gettext-tools/gnulib-lib/unictype/bitmap.h47
-rw-r--r--gettext-tools/gnulib-lib/unictype/ctype_space.c32
-rw-r--r--gettext-tools/gnulib-lib/unictype/ctype_space.h168
3 files changed, 247 insertions, 0 deletions
diff --git a/gettext-tools/gnulib-lib/unictype/bitmap.h b/gettext-tools/gnulib-lib/unictype/bitmap.h
new file mode 100644
index 0000000..19aea60
--- /dev/null
+++ b/gettext-tools/gnulib-lib/unictype/bitmap.h
@@ -0,0 +1,47 @@
+/* Three-level bitmap lookup.
+ Copyright (C) 2000-2002, 2005-2007, 2009-2015 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2000-2002.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU 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
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+static inline int bitmap_lookup (const void *table, ucs4_t uc);
+
+/* These values are currently hardcoded into gen-ctype.c. */
+#define header_0 16
+#define header_2 9
+#define header_3 127
+#define header_4 15
+
+static inline int
+bitmap_lookup (const void *table, ucs4_t uc)
+{
+ unsigned int index1 = uc >> header_0;
+ if (index1 < ((const int *) table)[0])
+ {
+ int lookup1 = ((const int *) table)[1 + index1];
+ if (lookup1 >= 0)
+ {
+ unsigned int index2 = (uc >> header_2) & header_3;
+ int lookup2 = ((const short *) table)[lookup1 + index2];
+ if (lookup2 >= 0)
+ {
+ unsigned int index3 = (uc >> 5) & header_4;
+ unsigned int lookup3 = ((const int *) table)[lookup2 + index3];
+
+ return (lookup3 >> (uc & 0x1f)) & 1;
+ }
+ }
+ }
+ return 0;
+}
diff --git a/gettext-tools/gnulib-lib/unictype/ctype_space.c b/gettext-tools/gnulib-lib/unictype/ctype_space.c
new file mode 100644
index 0000000..7bca2ac
--- /dev/null
+++ b/gettext-tools/gnulib-lib/unictype/ctype_space.c
@@ -0,0 +1,32 @@
+/* ISO C <ctype.h> like properties of Unicode characters.
+ Copyright (C) 2002, 2006-2007, 2009-2015 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2002.
+
+ This program is free software: you can redistribute it and/or modify it
+ under the terms of the GNU 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
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "unictype.h"
+
+#include "bitmap.h"
+
+/* Define u_is_space table. */
+#include "ctype_space.h"
+
+bool
+uc_is_space (ucs4_t uc)
+{
+ return bitmap_lookup (&u_is_space, uc);
+}
diff --git a/gettext-tools/gnulib-lib/unictype/ctype_space.h b/gettext-tools/gnulib-lib/unictype/ctype_space.h
new file mode 100644
index 0000000..86a7373
--- /dev/null
+++ b/gettext-tools/gnulib-lib/unictype/ctype_space.h
@@ -0,0 +1,168 @@
+/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
+/* ISO C <ctype.h> like properties of Unicode characters. */
+/* Generated automatically by gen-uni-tables.c for Unicode 8.0.0. */
+#define header_0 16
+#define header_2 9
+#define header_3 127
+#define header_4 15
+static const
+struct
+ {
+ int header[1];
+ int level1[1];
+ short level2[1 << 7];
+ /*unsigned*/ int level3[4 << 4];
+ }
+u_is_space =
+{
+ { 1 },
+ { 2 * sizeof (int) / sizeof (short) + 0 },
+ {
+ 2 + 128 * sizeof (short) / sizeof (int) + 0,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ 2 + 128 * sizeof (short) / sizeof (int) + 16,
+ -1,
+ -1,
+ -1,
+ -1,
+ 2 + 128 * sizeof (short) / sizeof (int) + 32,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ 2 + 128 * sizeof (short) / sizeof (int) + 48,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1,
+ -1
+ },
+ {
+ 0x00003E00, 0x00000001, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000001, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x0000077F, 0x00000300, 0x80000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000001, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000
+ }
+};