From fa095a4504cbe668e4244547e2c141597bea4ecf Mon Sep 17 00:00:00 2001 From: Andreas Rottmann Date: Mon, 14 Sep 2009 12:32:44 +0200 Subject: Imported Upstream version 0.9.1 --- lib/unicase/cased.c | 53 ++ lib/unicase/cased.h | 343 +++++++++++ lib/unicase/casefold.h | 22 + lib/unicase/caseprop.h | 32 + lib/unicase/context.h | 65 ++ lib/unicase/empty-prefix-context.c | 27 + lib/unicase/empty-suffix-context.c | 27 + lib/unicase/ignorable.c | 71 +++ lib/unicase/ignorable.h | 544 +++++++++++++++++ lib/unicase/invariant.h | 45 ++ lib/unicase/locale-language.c | 55 ++ lib/unicase/locale-languages.gperf | 270 +++++++++ lib/unicase/locale-languages.h | 1034 ++++++++++++++++++++++++++++++++ lib/unicase/simple-mapping.h | 39 ++ lib/unicase/special-casing-table.gperf | 136 +++++ lib/unicase/special-casing-table.h | 339 +++++++++++ lib/unicase/special-casing.c | 25 + lib/unicase/special-casing.h | 60 ++ lib/unicase/tocasefold.c | 27 + lib/unicase/tocasefold.h | 567 +++++++++++++++++ lib/unicase/tolower.c | 27 + lib/unicase/tolower.h | 567 +++++++++++++++++ lib/unicase/totitle.c | 27 + lib/unicase/totitle.h | 615 +++++++++++++++++++ lib/unicase/toupper.c | 27 + lib/unicase/toupper.h | 615 +++++++++++++++++++ lib/unicase/u-casecmp.h | 69 +++ lib/unicase/u-casecoll.h | 68 +++ lib/unicase/u-casefold.h | 28 + lib/unicase/u-casemap.h | 416 +++++++++++++ lib/unicase/u-casexfrm.h | 88 +++ lib/unicase/u-ct-casefold.h | 107 ++++ lib/unicase/u-ct-totitle.h | 501 ++++++++++++++++ lib/unicase/u-is-cased.h | 128 ++++ lib/unicase/u-is-invariant.h | 64 ++ lib/unicase/u-totitle.h | 28 + lib/unicase/u16-casecmp.c | 35 ++ lib/unicase/u16-casecoll.c | 32 + lib/unicase/u16-casefold.c | 26 + lib/unicase/u16-casemap.c | 40 ++ lib/unicase/u16-casexfrm.c | 35 ++ lib/unicase/u16-ct-casefold.c | 35 ++ lib/unicase/u16-ct-tolower.c | 40 ++ lib/unicase/u16-ct-totitle.c | 43 ++ lib/unicase/u16-ct-toupper.c | 40 ++ lib/unicase/u16-is-cased.c | 36 ++ lib/unicase/u16-is-casefolded.c | 30 + lib/unicase/u16-is-invariant.c | 33 + lib/unicase/u16-is-lowercase.c | 30 + lib/unicase/u16-is-titlecase.c | 30 + lib/unicase/u16-is-uppercase.c | 30 + lib/unicase/u16-tolower.c | 39 ++ lib/unicase/u16-totitle.c | 27 + lib/unicase/u16-toupper.c | 39 ++ lib/unicase/u32-casecmp.c | 35 ++ lib/unicase/u32-casecoll.c | 32 + lib/unicase/u32-casefold.c | 26 + lib/unicase/u32-casemap.c | 40 ++ lib/unicase/u32-casexfrm.c | 35 ++ lib/unicase/u32-ct-casefold.c | 35 ++ lib/unicase/u32-ct-tolower.c | 40 ++ lib/unicase/u32-ct-totitle.c | 43 ++ lib/unicase/u32-ct-toupper.c | 40 ++ lib/unicase/u32-is-cased.c | 36 ++ lib/unicase/u32-is-casefolded.c | 30 + lib/unicase/u32-is-invariant.c | 33 + lib/unicase/u32-is-lowercase.c | 30 + lib/unicase/u32-is-titlecase.c | 30 + lib/unicase/u32-is-uppercase.c | 30 + lib/unicase/u32-tolower.c | 39 ++ lib/unicase/u32-totitle.c | 26 + lib/unicase/u32-toupper.c | 39 ++ lib/unicase/u8-casecmp.c | 35 ++ lib/unicase/u8-casecoll.c | 32 + lib/unicase/u8-casefold.c | 107 ++++ lib/unicase/u8-casemap.c | 40 ++ lib/unicase/u8-casexfrm.c | 35 ++ lib/unicase/u8-ct-casefold.c | 35 ++ lib/unicase/u8-ct-tolower.c | 40 ++ lib/unicase/u8-ct-totitle.c | 43 ++ lib/unicase/u8-ct-toupper.c | 40 ++ lib/unicase/u8-is-cased.c | 36 ++ lib/unicase/u8-is-casefolded.c | 30 + lib/unicase/u8-is-invariant.c | 33 + lib/unicase/u8-is-lowercase.c | 30 + lib/unicase/u8-is-titlecase.c | 30 + lib/unicase/u8-is-uppercase.c | 30 + lib/unicase/u8-tolower.c | 120 ++++ lib/unicase/u8-totitle.c | 107 ++++ lib/unicase/u8-toupper.c | 120 ++++ lib/unicase/ulc-casecmp.c | 74 +++ lib/unicase/ulc-casecoll.c | 31 + lib/unicase/ulc-casexfrm.c | 64 ++ lib/unicase/unicasemap.h | 52 ++ 94 files changed, 9559 insertions(+) create mode 100644 lib/unicase/cased.c create mode 100644 lib/unicase/cased.h create mode 100644 lib/unicase/casefold.h create mode 100644 lib/unicase/caseprop.h create mode 100644 lib/unicase/context.h create mode 100644 lib/unicase/empty-prefix-context.c create mode 100644 lib/unicase/empty-suffix-context.c create mode 100644 lib/unicase/ignorable.c create mode 100644 lib/unicase/ignorable.h create mode 100644 lib/unicase/invariant.h create mode 100644 lib/unicase/locale-language.c create mode 100644 lib/unicase/locale-languages.gperf create mode 100644 lib/unicase/locale-languages.h create mode 100644 lib/unicase/simple-mapping.h create mode 100644 lib/unicase/special-casing-table.gperf create mode 100644 lib/unicase/special-casing-table.h create mode 100644 lib/unicase/special-casing.c create mode 100644 lib/unicase/special-casing.h create mode 100644 lib/unicase/tocasefold.c create mode 100644 lib/unicase/tocasefold.h create mode 100644 lib/unicase/tolower.c create mode 100644 lib/unicase/tolower.h create mode 100644 lib/unicase/totitle.c create mode 100644 lib/unicase/totitle.h create mode 100644 lib/unicase/toupper.c create mode 100644 lib/unicase/toupper.h create mode 100644 lib/unicase/u-casecmp.h create mode 100644 lib/unicase/u-casecoll.h create mode 100644 lib/unicase/u-casefold.h create mode 100644 lib/unicase/u-casemap.h create mode 100644 lib/unicase/u-casexfrm.h create mode 100644 lib/unicase/u-ct-casefold.h create mode 100644 lib/unicase/u-ct-totitle.h create mode 100644 lib/unicase/u-is-cased.h create mode 100644 lib/unicase/u-is-invariant.h create mode 100644 lib/unicase/u-totitle.h create mode 100644 lib/unicase/u16-casecmp.c create mode 100644 lib/unicase/u16-casecoll.c create mode 100644 lib/unicase/u16-casefold.c create mode 100644 lib/unicase/u16-casemap.c create mode 100644 lib/unicase/u16-casexfrm.c create mode 100644 lib/unicase/u16-ct-casefold.c create mode 100644 lib/unicase/u16-ct-tolower.c create mode 100644 lib/unicase/u16-ct-totitle.c create mode 100644 lib/unicase/u16-ct-toupper.c create mode 100644 lib/unicase/u16-is-cased.c create mode 100644 lib/unicase/u16-is-casefolded.c create mode 100644 lib/unicase/u16-is-invariant.c create mode 100644 lib/unicase/u16-is-lowercase.c create mode 100644 lib/unicase/u16-is-titlecase.c create mode 100644 lib/unicase/u16-is-uppercase.c create mode 100644 lib/unicase/u16-tolower.c create mode 100644 lib/unicase/u16-totitle.c create mode 100644 lib/unicase/u16-toupper.c create mode 100644 lib/unicase/u32-casecmp.c create mode 100644 lib/unicase/u32-casecoll.c create mode 100644 lib/unicase/u32-casefold.c create mode 100644 lib/unicase/u32-casemap.c create mode 100644 lib/unicase/u32-casexfrm.c create mode 100644 lib/unicase/u32-ct-casefold.c create mode 100644 lib/unicase/u32-ct-tolower.c create mode 100644 lib/unicase/u32-ct-totitle.c create mode 100644 lib/unicase/u32-ct-toupper.c create mode 100644 lib/unicase/u32-is-cased.c create mode 100644 lib/unicase/u32-is-casefolded.c create mode 100644 lib/unicase/u32-is-invariant.c create mode 100644 lib/unicase/u32-is-lowercase.c create mode 100644 lib/unicase/u32-is-titlecase.c create mode 100644 lib/unicase/u32-is-uppercase.c create mode 100644 lib/unicase/u32-tolower.c create mode 100644 lib/unicase/u32-totitle.c create mode 100644 lib/unicase/u32-toupper.c create mode 100644 lib/unicase/u8-casecmp.c create mode 100644 lib/unicase/u8-casecoll.c create mode 100644 lib/unicase/u8-casefold.c create mode 100644 lib/unicase/u8-casemap.c create mode 100644 lib/unicase/u8-casexfrm.c create mode 100644 lib/unicase/u8-ct-casefold.c create mode 100644 lib/unicase/u8-ct-tolower.c create mode 100644 lib/unicase/u8-ct-totitle.c create mode 100644 lib/unicase/u8-ct-toupper.c create mode 100644 lib/unicase/u8-is-cased.c create mode 100644 lib/unicase/u8-is-casefolded.c create mode 100644 lib/unicase/u8-is-invariant.c create mode 100644 lib/unicase/u8-is-lowercase.c create mode 100644 lib/unicase/u8-is-titlecase.c create mode 100644 lib/unicase/u8-is-uppercase.c create mode 100644 lib/unicase/u8-tolower.c create mode 100644 lib/unicase/u8-totitle.c create mode 100644 lib/unicase/u8-toupper.c create mode 100644 lib/unicase/ulc-casecmp.c create mode 100644 lib/unicase/ulc-casecoll.c create mode 100644 lib/unicase/ulc-casexfrm.c create mode 100644 lib/unicase/unicasemap.h (limited to 'lib/unicase') diff --git a/lib/unicase/cased.c b/lib/unicase/cased.c new file mode 100644 index 00000000..5fbf4cb7 --- /dev/null +++ b/lib/unicase/cased.c @@ -0,0 +1,53 @@ +/* Test whether a Unicode character is cased. + Copyright (C) 2002, 2006-2007, 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "caseprop.h" + +/* Quoting the Unicode standard: + Definition: A character is defined to be "cased" if it has the Lowercase + or Uppercase property or has a General_Category value of + Titlecase_Letter. */ + +#if 0 + +#include "unictype.h" + +bool +uc_is_cased (ucs4_t uc) +{ + return (uc_is_property_lowercase (uc) + || uc_is_property_uppercase (uc) + || uc_is_general_category (uc, UC_TITLECASE_LETTER)); +} + +#else + +#include "unictype/bitmap.h" + +/* Define u_casing_property_cased table. */ +#include "cased.h" + +bool +uc_is_cased (ucs4_t uc) +{ + return bitmap_lookup (&u_casing_property_cased, uc); +} + +#endif diff --git a/lib/unicase/cased.h b/lib/unicase/cased.h new file mode 100644 index 00000000..ea2c2eaa --- /dev/null +++ b/lib/unicase/cased.h @@ -0,0 +1,343 @@ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +/* Casing Properties of Unicode characters. */ +/* Generated automatically by gen-ctype.c for Unicode 5.1.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[2]; + short level2[2 << 7]; + /*unsigned*/ int level3[15 << 4]; + } +u_casing_property_cased = +{ + { 2 }, + { + 3 * sizeof (int) / sizeof (short) + 0, + 3 * sizeof (int) / sizeof (short) + 128 + }, + { + 3 + 256 * sizeof (short) / sizeof (int) + 0, + 3 + 256 * sizeof (short) / sizeof (int) + 16, + 3 + 256 * sizeof (short) / sizeof (int) + 32, + -1, + -1, + -1, + -1, + -1, + 3 + 256 * sizeof (short) / sizeof (int) + 48, + -1, + -1, + -1, + -1, + -1, + 3 + 256 * sizeof (short) / sizeof (int) + 64, + 3 + 256 * sizeof (short) / sizeof (int) + 80, + 3 + 256 * sizeof (short) / sizeof (int) + 96, + -1, + 3 + 256 * sizeof (short) / sizeof (int) + 112, + -1, + -1, + -1, + 3 + 256 * sizeof (short) / sizeof (int) + 128, + -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, + 3 + 256 * sizeof (short) / sizeof (int) + 144, + -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, + 3 + 256 * sizeof (short) / sizeof (int) + 160, + -1, + 3 + 256 * sizeof (short) / sizeof (int) + 176, + -1, + -1, + 3 + 256 * sizeof (short) / sizeof (int) + 192, + -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, + 3 + 256 * sizeof (short) / sizeof (int) + 208, + 3 + 256 * sizeof (short) / sizeof (int) + 224, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1 + }, + { + 0x00000000, 0x00000000, 0x07FFFFFE, 0x07FFFFFE, + 0x00000000, 0x04200400, 0xFF7FFFFF, 0xFF7FFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xF7FFFFFF, 0xFFFFFFF0, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFEFFFFF, 0x01FFFFFF, 0x00000003, 0x0000001F, + 0x00000000, 0x00000000, 0x00000020, 0x3CCF0000, + 0xFFFFD740, 0xFFFFFFFB, 0xFFFFFFFF, 0xFFBFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFC03, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFE000F, 0x007FFFFF, 0xFFFFFFFE, + 0x000000FF, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0xFFFFFFFF, 0x0000003F, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0x00000000, 0x00000000, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0x3F3FFFFF, 0xFFFFFFFF, 0xAAFF3F3F, 0x3FFFFFFF, + 0xFFFFFFFF, 0x5FDFFFFF, 0x0FCF1FDC, 0x1FDC1FFF, + 0x00000000, 0x00000000, 0x00000000, 0x80020000, + 0x001F0000, 0x00000000, 0x00000000, 0x00000000, + 0x3E2FFC84, 0xF21FBD50, 0x000043E0, 0xFFFFFFFF, + 0x00000018, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0xFFC00000, 0xFFFFFFFF, 0x000003FF, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xFFFFFFFF, 0xFFFF7FFF, 0x7FFFFFFF, 0x3FFEFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0000001F, + 0xFFFFFFFF, 0x0000003F, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xFFFFFFFF, 0x00003FFC, + 0x00FFFFFF, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0xFFFFFFFC, 0xFFFFFFFF, 0xFFFFFFFF, + 0x000018FF, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00F8007F, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x07FFFFFE, 0x07FFFFFE, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xFFFFFFFF, 0xFFFFFFFF, 0x0000FFFF, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFDFFFFF, 0xFFFFFFFF, + 0xDFFFFFFF, 0xEBFFDE64, 0xFFFFFFEF, 0xFFFFFFFF, + 0xDFDFE7BF, 0x7BFFFFFF, 0xFFFDFC5F, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFF3F, 0xF7FFFFFD, 0xF7FFFFFF, + 0xFFDFFFFF, 0xFFDFFFFF, 0xFFFF7FFF, 0xFFFF7FFF, + 0xFFFFFDFF, 0xFFFFFDFF, 0x00000FF7, 0x00000000 + } +}; diff --git a/lib/unicase/casefold.h b/lib/unicase/casefold.h new file mode 100644 index 00000000..d1f434ca --- /dev/null +++ b/lib/unicase/casefold.h @@ -0,0 +1,22 @@ +/* Casefolding of Unicode characters. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unitypes.h" + +/* Return the casefold mapping of a Unicode character. */ +extern ucs4_t + uc_tocasefold (ucs4_t uc); diff --git a/lib/unicase/caseprop.h b/lib/unicase/caseprop.h new file mode 100644 index 00000000..f84453ec --- /dev/null +++ b/lib/unicase/caseprop.h @@ -0,0 +1,32 @@ +/* Case related properties of Unicode characters. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 +#include "unitypes.h" + +/* Determine whether a character is "cased" according to the Unicode Standard, + , section 3.13, + definition D120. */ +extern bool + uc_is_cased (ucs4_t uc); + +/* Determine whether a character is "case-ignorable" + according to the Unicode Standard, + , section 3.13, + definition D121. */ +extern bool + uc_is_case_ignorable (ucs4_t uc); diff --git a/lib/unicase/context.h b/lib/unicase/context.h new file mode 100644 index 00000000..6a35798d --- /dev/null +++ b/lib/unicase/context.h @@ -0,0 +1,65 @@ +/* Case-mapping contexts of UTF-8/UTF-16/UTF-32 substring. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 . */ + + +/* The context of a prefix string combines the information of the "Before C" + conditions of the Unicode Standard, + , section 3.13, + table 3-14 "Context Specification for Casing". + + casing_prefix_context_t contains the following fields: + + // Helper for evaluating the FINAL_SIGMA condition: + // Last character that was not case-ignorable. + ucs4_t last_char_except_ignorable; + + // Helper for evaluating the AFTER_SOFT_DOTTED and AFTER_I conditions: + // Last character that was of combining class 230 ("Above") or 0. + ucs4_t last_char_normal_or_above; + + Three bits would be sufficient to carry the context information, but + that would require to invoke uc_is_cased and uc_is_property_soft_dotted + ahead of time, more often than actually needed. */ + + +/* The context of a suffix string combines the information of the "After C" + conditions of the Unicode Standard, + , section 3.13, + table 3-14 "Context Specification for Casing". + + casing_suffix_context_t contains the following fields: + + // For evaluating the FINAL_SIGMA condition: + // First character that was not case-ignorable. + ucs4_t first_char_except_ignorable; + + // For evaluating the MORE_ABOVE condition: + // Bit 0 is set if the suffix contains a character of combining class + // 230 (Above) with no character of combining class 0 or 230 (Above) + // before it. + // + // For evaluating the BEFORE_DOT condition: + // Bit 1 is set if the suffix contains a COMBINING DOT ABOVE (U+0307) + // with no character of combining class 0 or 230 (Above) before it. + // + uint32_t bits; + + Three bits would be sufficient to carry the context information, but + that would require to invoke uc_is_cased ahead of time, more often than + actually needed. */ +#define SCC_MORE_ABOVE_MASK 1 +#define SCC_BEFORE_DOT_MASK 2 diff --git a/lib/unicase/empty-prefix-context.c b/lib/unicase/empty-prefix-context.c new file mode 100644 index 00000000..3c46e9e3 --- /dev/null +++ b/lib/unicase/empty-prefix-context.c @@ -0,0 +1,27 @@ +/* Case-mapping context of empty prefix string. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +const casing_prefix_context_t unicase_empty_prefix_context = + { + 0xFFFD /* last_char_except_ignorable */, + 0xFFFD /* last_char_normal_or_above */ + }; diff --git a/lib/unicase/empty-suffix-context.c b/lib/unicase/empty-suffix-context.c new file mode 100644 index 00000000..4e00bffe --- /dev/null +++ b/lib/unicase/empty-suffix-context.c @@ -0,0 +1,27 @@ +/* Case-mapping context of empty suffix string. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +const casing_suffix_context_t unicase_empty_suffix_context = + { + 0xFFFD /* first_char_except_ignorable */, + 0 /* bits */ + }; diff --git a/lib/unicase/ignorable.c b/lib/unicase/ignorable.c new file mode 100644 index 00000000..84b2634c --- /dev/null +++ b/lib/unicase/ignorable.c @@ -0,0 +1,71 @@ +/* Test whether a Unicode character is case-ignorable. + Copyright (C) 2002, 2006-2007, 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "caseprop.h" + +/* Quoting the Unicode standard: + Definition: A character is defined to be "case-ignorable" if it has the + value MidLetter {or the value MidNumLet} for the Word_Break property or + its General_Category is one of Nonspacing_Mark (Mn), Enclosing_Mark (Me), + Format (Cf), Modifier_Letter (Lm), or Modifier_Symbol (Sk). + The text marked in braces was added in Unicode 5.1.0, see + section "Update of + Definition of case-ignorable". */ +/* Since this predicate is only used for the "Before C" and "After C" + conditions of FINAL_SIGMA, we exclude the "cased" characters here. + This simplifies the evaluation of the regular expressions + \p{cased} (\p{case-ignorable})* C + and + C (\p{case-ignorable})* \p{cased} + */ + +#if 0 + +#include "unictype.h" +#include "uniwbrk.h" + +bool +uc_is_case_ignorable (ucs4_t uc) +{ + int wbp = uc_wordbreak_property (uc); + + return (wbp == WBP_MIDLETTER || wbp == WBP_MIDNUMLET + || uc_is_general_category_withtable (uc, UC_CATEGORY_MASK_Mn + | UC_CATEGORY_MASK_Me + | UC_CATEGORY_MASK_Cf + | UC_CATEGORY_MASK_Lm + | UC_CATEGORY_MASK_Sk)) + && !uc_is_cased (uc); +} + +#else + +#include "unictype/bitmap.h" + +/* Define u_casing_property_case_ignorable table. */ +#include "ignorable.h" + +bool +uc_is_case_ignorable (ucs4_t uc) +{ + return bitmap_lookup (&u_casing_property_case_ignorable, uc); +} + +#endif diff --git a/lib/unicase/ignorable.h b/lib/unicase/ignorable.h new file mode 100644 index 00000000..3b29290f --- /dev/null +++ b/lib/unicase/ignorable.h @@ -0,0 +1,544 @@ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +/* Casing Properties of Unicode characters. */ +/* Generated automatically by gen-ctype.c for Unicode 5.1.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[15]; + short level2[3 << 7]; + /*unsigned*/ int level3[30 << 4]; + } +u_casing_property_case_ignorable = +{ + { 15 }, + { + 16 * sizeof (int) / sizeof (short) + 0, + 16 * sizeof (int) / sizeof (short) + 128, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + 16 * sizeof (int) / sizeof (short) + 256 + }, + { + 16 + 384 * sizeof (short) / sizeof (int) + 0, + 16 + 384 * sizeof (short) / sizeof (int) + 16, + 16 + 384 * sizeof (short) / sizeof (int) + 32, + 16 + 384 * sizeof (short) / sizeof (int) + 48, + 16 + 384 * sizeof (short) / sizeof (int) + 64, + 16 + 384 * sizeof (short) / sizeof (int) + 80, + 16 + 384 * sizeof (short) / sizeof (int) + 96, + 16 + 384 * sizeof (short) / sizeof (int) + 112, + 16 + 384 * sizeof (short) / sizeof (int) + 128, + 16 + 384 * sizeof (short) / sizeof (int) + 144, + -1, + 16 + 384 * sizeof (short) / sizeof (int) + 160, + 16 + 384 * sizeof (short) / sizeof (int) + 176, + 16 + 384 * sizeof (short) / sizeof (int) + 192, + 16 + 384 * sizeof (short) / sizeof (int) + 208, + 16 + 384 * sizeof (short) / sizeof (int) + 224, + 16 + 384 * sizeof (short) / sizeof (int) + 240, + -1, + -1, + -1, + -1, + -1, + 16 + 384 * sizeof (short) / sizeof (int) + 256, + 16 + 384 * sizeof (short) / sizeof (int) + 272, + 16 + 384 * sizeof (short) / sizeof (int) + 288, + -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, + 16 + 384 * sizeof (short) / sizeof (int) + 304, + -1, + -1, + 16 + 384 * sizeof (short) / sizeof (int) + 320, + 16 + 384 * sizeof (short) / sizeof (int) + 336, + 16 + 384 * sizeof (short) / sizeof (int) + 352, + -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, + 16 + 384 * sizeof (short) / sizeof (int) + 368, + -1, + 16 + 384 * sizeof (short) / sizeof (int) + 384, + 16 + 384 * sizeof (short) / sizeof (int) + 400, + -1, + -1, + -1, + -1, + 16 + 384 * sizeof (short) / sizeof (int) + 416, + -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, + 16 + 384 * sizeof (short) / sizeof (int) + 432, + 16 + 384 * sizeof (short) / sizeof (int) + 448, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + 16 + 384 * sizeof (short) / sizeof (int) + 464, + -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, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1 + }, + { + 0x00000000, 0x04004080, 0x40000000, 0x00000001, + 0x00000000, 0x0190A100, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0xFE000000, 0xFFFFFFFC, 0xFFFFFFE0, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFDF, 0x0030FFFF, + 0x000000B0, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x000003F8, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x02000000, 0x00000000, + 0xFFFE0000, 0xBFFFFFFF, 0x000000B6, 0x00100000, + 0x07FF000F, 0x00000000, 0x7FFFF801, 0x00010000, + 0x00000000, 0x00000000, 0xFFC00000, 0x00003DFF, + 0x00028000, 0xFFFF0000, 0x000007FF, 0x00000000, + 0x00000000, 0x0001FFC0, 0x00000000, 0x043FF800, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000006, 0x10000000, 0x001E21FE, 0x0002000C, + 0x00000002, 0x10000000, 0x0000201E, 0x0000000C, + 0x00000006, 0x10000000, 0x00023986, 0x00230000, + 0x00000006, 0x10000000, 0x000021BE, 0x0000000C, + 0x00000002, 0x90000000, 0x0040201E, 0x0000000C, + 0x00000004, 0x00000000, 0x00002001, 0x00000000, + 0x00000000, 0xC0000000, 0x00603DC1, 0x0000000C, + 0x00000000, 0x90000000, 0x00003040, 0x0000000C, + 0x00000000, 0x00000000, 0x0000201E, 0x0000000C, + 0x00000000, 0x00000000, 0x005C0400, 0x00000000, + 0x00000000, 0x07F20000, 0x00007FC0, 0x00000000, + 0x00000000, 0x1BF20000, 0x00003F40, 0x00000000, + 0x03000000, 0x02A00000, 0x00000000, 0x7FFE0000, + 0xFEFF00DF, 0x1FFFFFFF, 0x00000040, 0x00000000, + 0x00000000, 0x66FDE000, 0xC3000000, 0x001E0001, + 0x00002064, 0x00000000, 0x00000000, 0x10000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x80000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x001C0000, 0x001C0000, 0x000C0000, 0x000C0000, + 0x00000000, 0x3FB00000, 0x208FFE40, 0x00000000, + 0x00003800, 0x00000000, 0x00000008, 0x00000000, + 0x00000000, 0x00000200, 0x00000000, 0x00000000, + 0x00000000, 0x0E040187, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x01800000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x0000000F, 0x17D00000, 0x00000004, 0x000FF800, + 0x00000003, 0x0000033C, 0x00000000, 0x00000000, + 0x00000000, 0x00CFF000, 0x00000000, 0x3F000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xFFFFFFFF, 0xC000007F, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0xA0000000, 0xE000E003, 0x6000E000, + 0x0300F800, 0x00007C90, 0x00000000, 0x0000FC1F, + 0x00000000, 0x00000000, 0xFFFF0000, 0x0001FFFF, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00008000, + 0x00000000, 0x00000000, 0x00000000, 0xFFFFFFFF, + 0x00000000, 0x00008000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000020, 0x083EFC00, 0x00000000, 0x00000000, + 0x7E000000, 0x00000000, 0x00000000, 0x70000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00200000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00001000, 0x00000000, 0x00000000, 0xB0078000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xFFFFFFFF, 0x00000003, 0x00000000, 0x00000000, + 0x00000700, 0x00000000, 0x00000000, 0x00000000, + 0x00000844, 0x00000060, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000010, 0x00000000, + 0x00000000, 0x00003FC0, 0x0003FF80, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00667E00, 0x00001008, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x40000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x0008FFFF, 0x0000007F, 0x00240000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x80000000, + 0x04004080, 0x40000000, 0x00000001, 0x00010000, + 0xC0000000, 0x00000000, 0x00000000, 0x0E000008, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x20000000, + 0x0000F06E, 0x87000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0xFFF80380, + 0x00000FE7, 0x00003C00, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x0000001C, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000002, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0000FFFF + } +}; diff --git a/lib/unicase/invariant.h b/lib/unicase/invariant.h new file mode 100644 index 00000000..20151433 --- /dev/null +++ b/lib/unicase/invariant.h @@ -0,0 +1,45 @@ +/* Internal functions for Unicode character case mappings. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 +#include + +#include "unitypes.h" +#include "uninorm.h" + +/* Return true if mapping NFD(S) to via MAPPING is a no-op. */ +extern int + u8_is_invariant (const uint8_t *s, size_t n, + uint8_t * (*mapping) (const uint8_t *s, size_t n, const char *iso639_language, + uninorm_t nf, + uint8_t *resultbuf, size_t *lengthp), + const char *iso639_language, + bool *resultp); +extern int + u16_is_invariant (const uint16_t *s, size_t n, + uint16_t * (*mapping) (const uint16_t *s, size_t n, const char *iso639_language, + uninorm_t nf, + uint16_t *resultbuf, size_t *lengthp), + const char *iso639_language, + bool *resultp); +extern int + u32_is_invariant (const uint32_t *s, size_t n, + uint32_t * (*mapping) (const uint32_t *s, size_t n, const char *iso639_language, + uninorm_t nf, + uint32_t *resultbuf, size_t *lengthp), + const char *iso639_language, + bool *resultp); diff --git a/lib/unicase/locale-language.c b/lib/unicase/locale-language.c new file mode 100644 index 00000000..074baa41 --- /dev/null +++ b/lib/unicase/locale-language.c @@ -0,0 +1,55 @@ +/* Language code of current locale. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include +#include + +#include "localename.h" + +#include "unicase/locale-languages.h" + +const char * +uc_locale_language (void) +{ + const char *locale_name = gl_locale_name (LC_CTYPE, "LC_CTYPE"); + const char *p; + + /* Find the end of the language portion. */ + p = locale_name; + while (*p != '\0' && *p != '_' && *p != '.' && *p != '@') + p++; + + /* Return a statically allocated pointer to the language portion, so that the + caller of this function does not need to free() the result. + We could use a dynamically built unification table. But given that the + set of possible languages is small, it is easier (and excludes ENOMEM + error conditions) to allocate the unification table statically. */ + if (p != locale_name) + { + const char *language = + uc_locale_languages_lookup (locale_name, p - locale_name); + if (language != NULL) + return language; + } + + return ""; +} diff --git a/lib/unicase/locale-languages.gperf b/lib/unicase/locale-languages.gperf new file mode 100644 index 00000000..da0d94e7 --- /dev/null +++ b/lib/unicase/locale-languages.gperf @@ -0,0 +1,270 @@ +%language=ANSI-C +%define hash-function-name uc_locale_language_hash +%define lookup-function-name uc_locale_languages_lookup +%compare-lengths +%compare-strncmp +%readonly-tables +%pic +/* List of languages taken from gettext/gettext-tools/src/lang-table.c + on 2009-02-07. */ +%% +"aa", /* Afar" */ +"ab", /* Abkhazian" */ +"ace", /* Achinese" */ +"ae", /* Avestan" */ +"af", /* Afrikaans" */ +"ak", /* Akan" */ +"am", /* Amharic" */ +"an", /* Aragonese" */ +"ang", /* Old English" */ +"ar", /* Arabic" */ +"as", /* Assamese" */ +"ast", /* Asturian" */ +"av", /* Avaric" */ +"awa", /* Awadhi" */ +"ay", /* Aymara" */ +"az", /* Azerbaijani" */ +"ba", /* Bashkir" */ +"bal", /* Baluchi" */ +"ban", /* Balinese" */ +"be", /* Belarusian" */ +"bej", /* Beja" */ +"bem", /* Bemba" */ +"bg", /* Bulgarian" */ +"bh", /* Bihari" */ +"bho", /* Bhojpuri" */ +"bi", /* Bislama" */ +"bik", /* Bikol" */ +"bin", /* Bini" */ +"bm", /* Bambara" */ +"bn", /* Bengali" */ +"bo", /* Tibetan" */ +"br", /* Breton" */ +"bs", /* Bosnian" */ +"bug", /* Buginese" */ +"ca", /* Catalan" */ +"ce", /* Chechen" */ +"ceb", /* Cebuano" */ +"ch", /* Chamorro" */ +"co", /* Corsican" */ +"cr", /* Cree" */ +"crh", /* Crimean Tatar" */ +"cs", /* Czech" */ +"csb", /* Kashubian" */ +"cu", /* Church Slavic" */ +"cv", /* Chuvash" */ +"cy", /* Welsh" */ +"da", /* Danish" */ +"de", /* German" */ +"din", /* Dinka" */ +"doi", /* Dogri" */ +"dv", /* Divehi" */ +"dz", /* Dzongkha" */ +"ee", /* Ewe" */ +"el", /* Greek" */ +"en", /* English" */ +"eo", /* Esperanto" */ +"es", /* Spanish" */ +"et", /* Estonian" */ +"eu", /* Basque" */ +"fa", /* Persian" */ +"ff", /* Fulah" */ +"fi", /* Finnish" */ +"fil", /* Filipino" */ +"fj", /* Fijian" */ +"fo", /* Faroese" */ +"fon", /* Fon" */ +"fr", /* French" */ +"fur", /* Friulian" */ +"fy", /* Western Frisian" */ +"ga", /* Irish" */ +"gd", /* Scottish Gaelic" */ +"gl", /* Galician" */ +"gn", /* Guarani" */ +"gon", /* Gondi" */ +"gsw", /* Swiss German" */ +"gu", /* Gujarati" */ +"gv", /* Manx" */ +"ha", /* Hausa" */ +"he", /* Hebrew" */ +"hi", /* Hindi" */ +"hil", /* Hiligaynon" */ +"hmn", /* Hmong" */ +"ho", /* Hiri Motu" */ +"hr", /* Croatian" */ +"ht", /* Haitian" */ +"hu", /* Hungarian" */ +"hy", /* Armenian" */ +"hz", /* Herero" */ +"ia", /* Interlingua" */ +"id", /* Indonesian" */ +"ie", /* Interlingue" */ +"ig", /* Igbo" */ +"ii", /* Sichuan Yi" */ +"ik", /* Inupiak" */ +"ilo", /* Iloko" */ +"is", /* Icelandic" */ +"it", /* Italian" */ +"iu", /* Inuktitut" */ +"ja", /* Japanese" */ +"jab", /* Hyam" */ +"jv", /* Javanese" */ +"ka", /* Georgian" */ +"kab", /* Kabyle" */ +"kaj", /* Jju" */ +"kam", /* Kamba" */ +"kbd", /* Kabardian" */ +"kcg", /* Tyap" */ +"kdm", /* Kagoma" */ +"kg", /* Kongo" */ +"ki", /* Kikuyu" */ +"kj", /* Kuanyama" */ +"kk", /* Kazakh" */ +"kl", /* Kalaallisut" */ +"km", /* Central Khmer" */ +"kmb", /* Kimbundu" */ +"kn", /* Kannada" */ +"ko", /* Korean" */ +"kr", /* Kanuri" */ +"kru", /* Kurukh" */ +"ks", /* Kashmiri" */ +"ku", /* Kurdish" */ +"kv", /* Komi" */ +"kw", /* Cornish" */ +"ky", /* Kirghiz" */ +"kok", /* Konkani" */ +"la", /* Latin" */ +"lb", /* Letzeburgesch" */ +"lg", /* Ganda" */ +"li", /* Limburgish" */ +"ln", /* Lingala" */ +"lo", /* Laotian" */ +"lt", /* Lithuanian" */ +"lu", /* Luba-Katanga" */ +"lua", /* Luba-Lulua" */ +"luo", /* Luo" */ +"lv", /* Latvian" */ +"mad", /* Madurese" */ +"mag", /* Magahi" */ +"mai", /* Maithili" */ +"mak", /* Makasar" */ +"man", /* Mandingo" */ +"men", /* Mende" */ +"mg", /* Malagasy" */ +"mh", /* Marshallese" */ +"mi", /* Maori" */ +"min", /* Minangkabau" */ +"mk", /* Macedonian" */ +"ml", /* Malayalam" */ +"mn", /* Mongolian" */ +"mni", /* Manipuri" */ +"mo", /* Moldavian" */ +"mos", /* Mossi" */ +"mr", /* Marathi" */ +"ms", /* Malay" */ +"mt", /* Maltese" */ +"mwr", /* Marwari" */ +"my", /* Burmese" */ +"myn", /* Mayan" */ +"na", /* Nauru" */ +"nap", /* Neapolitan" */ +"nah", /* Nahuatl" */ +"nb", /* Norwegian Bokmal" */ +"nd", /* North Ndebele" */ +"nds", /* Low Saxon" */ +"ne", /* Nepali" */ +"ng", /* Ndonga" */ +"nl", /* Dutch" */ +"nn", /* Norwegian Nynorsk" */ +"no", /* Norwegian" */ +"nr", /* South Ndebele" */ +"nso", /* Northern Sotho" */ +"nv", /* Navajo" */ +"ny", /* Nyanja" */ +"nym", /* Nyamwezi" */ +"nyn", /* Nyankole" */ +"oc", /* Occitan" */ +"oj", /* Ojibwa" */ +"om", /* (Afan) Oromo" */ +"or", /* Oriya" */ +"os", /* Ossetian" */ +"pa", /* Punjabi" */ +"pag", /* Pangasinan" */ +"pam", /* Pampanga" */ +"pap", /* Papiamento" */ +"pbb", /* Páez" */ +"pi", /* Pali" */ +"pl", /* Polish" */ +"ps", /* Pashto" */ +"pt", /* Portuguese" */ +"qu", /* Quechua" */ +"raj", /* Rajasthani" */ +"rm", /* Romansh" */ +"rn", /* Kirundi" */ +"ro", /* Romanian" */ +"ru", /* Russian" */ +"rw", /* Kinyarwanda" */ +"sa", /* Sanskrit" */ +"sas", /* Sasak" */ +"sat", /* Santali" */ +"sc", /* Sardinian" */ +"scn", /* Sicilian" */ +"sd", /* Sindhi" */ +"se", /* Northern Sami" */ +"sg", /* Sango" */ +"shn", /* Shan" */ +"si", /* Sinhala" */ +"sid", /* Sidamo" */ +"sk", /* Slovak" */ +"sl", /* Slovenian" */ +"sm", /* Samoan" */ +"sn", /* Shona" */ +"so", /* Somali" */ +"sq", /* Albanian" */ +"sr", /* Serbian" */ +"srr", /* Serer" */ +"ss", /* Siswati" */ +"st", /* Sesotho" */ +"su", /* Sundanese" */ +"suk", /* Sukuma" */ +"sus", /* Susu" */ +"sv", /* Swedish" */ +"sw", /* Swahili" */ +"ta", /* Tamil" */ +"te", /* Telugu" */ +"tem", /* Timne" */ +"tet", /* Tetum" */ +"tg", /* Tajik" */ +"th", /* Thai" */ +"ti", /* Tigrinya" */ +"tiv", /* Tiv" */ +"tk", /* Turkmen" */ +"tl", /* Tagalog" */ +"tn", /* Setswana" */ +"to", /* Tonga" */ +"tr", /* Turkish" */ +"ts", /* Tsonga" */ +"tt", /* Tatar" */ +"tum", /* Tumbuka" */ +"tw", /* Twi" */ +"ty", /* Tahitian" */ +"ug", /* Uighur" */ +"uk", /* Ukrainian" */ +"umb", /* Umbundu" */ +"ur", /* Urdu" */ +"uz", /* Uzbek" */ +"ve", /* Venda" */ +"vi", /* Vietnamese" */ +"vo", /* Volapuk" */ +"wal", /* Walamo" */ +"war", /* Waray" */ +"wen", /* Sorbian" */ +"wo", /* Wolof" */ +"xh", /* Xhosa" */ +"yao", /* Yao" */ +"yi", /* Yiddish" */ +"yo", /* Yoruba" */ +"za", /* Zhuang" */ +"zh", /* Chinese" */ +"zu", /* Zulu" */ +"zap", /* Zapotec" */ diff --git a/lib/unicase/locale-languages.h b/lib/unicase/locale-languages.h new file mode 100644 index 00000000..96c241be --- /dev/null +++ b/lib/unicase/locale-languages.h @@ -0,0 +1,1034 @@ +/* ANSI-C code produced by gperf version 3.0.4 */ +/* Command-line: gperf -m 10 ./unicase/locale-languages.gperf */ +/* Computed positions: -k'1-3' */ + +#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ + && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ + && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ + && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ + && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ + && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ + && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ + && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ + && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ + && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ + && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ + && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ + && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ + && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ + && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ + && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ + && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ + && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ + && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ + && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ + && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ + && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ + && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)) +/* The character set is not based on ISO-646. */ +#error "gperf generated tables don't work with this execution character set. Please report a bug to ." +#endif + + +#define TOTAL_KEYWORDS 260 +#define MIN_WORD_LENGTH 2 +#define MAX_WORD_LENGTH 3 +#define MIN_HASH_VALUE 4 +#define MAX_HASH_VALUE 461 +/* maximum key range = 458, duplicates = 0 */ + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static unsigned int +uc_locale_language_hash (register const char *str, register unsigned int len) +{ + static const unsigned short asso_values[] = + { + 462, 462, 462, 462, 462, 462, 462, 462, 462, 462, + 462, 462, 462, 462, 462, 462, 462, 462, 462, 462, + 462, 462, 462, 462, 462, 462, 462, 462, 462, 462, + 462, 462, 462, 462, 462, 462, 462, 462, 462, 462, + 462, 462, 462, 462, 462, 462, 462, 462, 462, 462, + 462, 462, 462, 462, 462, 462, 462, 462, 462, 462, + 462, 462, 462, 462, 462, 462, 462, 462, 462, 462, + 462, 462, 462, 462, 462, 462, 462, 462, 462, 462, + 462, 462, 462, 462, 462, 462, 462, 462, 462, 462, + 462, 462, 462, 462, 462, 462, 462, 462, 462, 4, + 48, 12, 35, 124, 222, 107, 187, 191, 145, 241, + 11, 73, 0, 114, 4, 66, 213, 88, 2, 25, + 31, 209, 10, 160, 157, 154, 247, 175, 96, 462, + 0, 34, 49, 227, 52, 187, 245, 462, 207, 231, + 462, 462, 462, 462, 462, 462, 462, 462, 462, 462, + 462, 462, 462, 462, 462, 462, 462, 462, 462, 462, + 462, 462, 462, 462, 462, 462, 462, 462, 462, 462, + 462, 462, 462, 462, 462, 462, 462, 462, 462, 462, + 462, 462, 462, 462, 462, 462, 462, 462, 462, 462, + 462, 462, 462, 462, 462, 462, 462, 462, 462, 462, + 462, 462, 462, 462, 462, 462, 462, 462, 462, 462, + 462, 462, 462, 462, 462, 462, 462, 462, 462, 462, + 462, 462, 462, 462, 462, 462, 462, 462, 462, 462, + 462, 462, 462, 462, 462, 462, 462, 462, 462, 462, + 462, 462, 462, 462, 462, 462, 462, 462, 462, 462, + 462, 462, 462, 462, 462, 462, 462, 462, 462, 462, + 462, 462, 462, 462, 462, 462, 462, 462, 462, 462, + 462, 462, 462 + }; + register int hval = len; + + switch (hval) + { + default: + hval += asso_values[(unsigned char)str[2]+2]; + /*FALLTHROUGH*/ + case 2: + hval += asso_values[(unsigned char)str[1]+17]; + /*FALLTHROUGH*/ + case 1: + hval += asso_values[(unsigned char)str[0]+3]; + break; + } + return hval; +} + +#ifdef __GNUC__ +__inline +#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif +#endif +const char * +uc_locale_languages_lookup (register const char *str, register unsigned int len) +{ + struct stringpool_t + { + char stringpool_str4[sizeof("sq")]; + char stringpool_str5[sizeof("men")]; + char stringpool_str6[sizeof("se")]; + char stringpool_str7[sizeof("man")]; + char stringpool_str8[sizeof("sa")]; + char stringpool_str11[sizeof("sat")]; + char stringpool_str12[sizeof("mi")]; + char stringpool_str13[sizeof("min")]; + char stringpool_str14[sizeof("si")]; + char stringpool_str15[sizeof("wen")]; + char stringpool_str16[sizeof("be")]; + char stringpool_str17[sizeof("ka")]; + char stringpool_str18[sizeof("ba")]; + char stringpool_str19[sizeof("ban")]; + char stringpool_str23[sizeof("ki")]; + char stringpool_str24[sizeof("bi")]; + char stringpool_str25[sizeof("bin")]; + char stringpool_str28[sizeof("wal")]; + char stringpool_str29[sizeof("te")]; + char stringpool_str30[sizeof("bal")]; + char stringpool_str31[sizeof("ta")]; + char stringpool_str32[sizeof("tet")]; + char stringpool_str33[sizeof("mg")]; + char stringpool_str35[sizeof("sg")]; + char stringpool_str36[sizeof("mr")]; + char stringpool_str37[sizeof("ti")]; + char stringpool_str38[sizeof("sr")]; + char stringpool_str39[sizeof("ce")]; + char stringpool_str40[sizeof("or")]; + char stringpool_str41[sizeof("ca")]; + char stringpool_str42[sizeof("mad")]; + char stringpool_str44[sizeof("kg")]; + char stringpool_str45[sizeof("bg")]; + char stringpool_str47[sizeof("kr")]; + char stringpool_str48[sizeof("br")]; + char stringpool_str50[sizeof("sid")]; + char stringpool_str51[sizeof("ms")]; + char stringpool_str52[sizeof("ae")]; + char stringpool_str53[sizeof("ss")]; + char stringpool_str54[sizeof("aa")]; + char stringpool_str55[sizeof("os")]; + char stringpool_str56[sizeof("su")]; + char stringpool_str58[sizeof("tg")]; + char stringpool_str61[sizeof("tr")]; + char stringpool_str62[sizeof("ks")]; + char stringpool_str63[sizeof("bs")]; + char stringpool_str64[sizeof("ug")]; + char stringpool_str65[sizeof("ku")]; + char stringpool_str66[sizeof("kab")]; + char stringpool_str67[sizeof("ur")]; + char stringpool_str69[sizeof("tiv")]; + char stringpool_str71[sizeof("cr")]; + char stringpool_str72[sizeof("pa")]; + char stringpool_str73[sizeof("kru")]; + char stringpool_str75[sizeof("af")]; + char stringpool_str76[sizeof("ts")]; + char stringpool_str77[sizeof("pap")]; + char stringpool_str78[sizeof("pi")]; + char stringpool_str79[sizeof("la")]; + char stringpool_str84[sizeof("ar")]; + char stringpool_str85[sizeof("li")]; + char stringpool_str86[sizeof("cs")]; + char stringpool_str88[sizeof("ceb")]; + char stringpool_str89[sizeof("cu")]; + char stringpool_str90[sizeof("bem")]; + char stringpool_str91[sizeof("kam")]; + char stringpool_str92[sizeof("sd")]; + char stringpool_str97[sizeof("sas")]; + char stringpool_str98[sizeof("mo")]; + char stringpool_str99[sizeof("as")]; + char stringpool_str100[sizeof("so")]; + char stringpool_str102[sizeof("ast")]; + char stringpool_str103[sizeof("tem")]; + char stringpool_str106[sizeof("lg")]; + char stringpool_str108[sizeof("wo")]; + char stringpool_str109[sizeof("ko")]; + char stringpool_str110[sizeof("bo")]; + char stringpool_str113[sizeof("fa")]; + char stringpool_str114[sizeof("mag")]; + char stringpool_str115[sizeof("kbd")]; + char stringpool_str116[sizeof("ab")]; + char stringpool_str117[sizeof("ps")]; + char stringpool_str118[sizeof("ne")]; + char stringpool_str119[sizeof("fi")]; + char stringpool_str120[sizeof("na")]; + char stringpool_str123[sizeof("to")]; + char stringpool_str125[sizeof("nap")]; + char stringpool_str127[sizeof("lu")]; + char stringpool_str128[sizeof("de")]; + char stringpool_str130[sizeof("da")]; + char stringpool_str131[sizeof("fil")]; + char stringpool_str132[sizeof("lua")]; + char stringpool_str133[sizeof("co")]; + char stringpool_str134[sizeof("ff")]; + char stringpool_str135[sizeof("csb")]; + char stringpool_str137[sizeof("din")]; + char stringpool_str141[sizeof("lb")]; + char stringpool_str142[sizeof("ru")]; + char stringpool_str143[sizeof("fr")]; + char stringpool_str145[sizeof("sus")]; + char stringpool_str146[sizeof("pam")]; + char stringpool_str147[sizeof("ng")]; + char stringpool_str149[sizeof("ie")]; + char stringpool_str150[sizeof("nr")]; + char stringpool_str151[sizeof("ia")]; + char stringpool_str153[sizeof("tum")]; + char stringpool_str156[sizeof("ml")]; + char stringpool_str157[sizeof("ii")]; + char stringpool_str158[sizeof("sl")]; + char stringpool_str159[sizeof("mk")]; + char stringpool_str160[sizeof("za")]; + char stringpool_str161[sizeof("sk")]; + char stringpool_str162[sizeof("bej")]; + char stringpool_str163[sizeof("kaj")]; + char stringpool_str165[sizeof("zap")]; + char stringpool_str166[sizeof("oj")]; + char stringpool_str167[sizeof("kl")]; + char stringpool_str169[sizeof("yi")]; + char stringpool_str170[sizeof("kk")]; + char stringpool_str171[sizeof("lo")]; + char stringpool_str173[sizeof("kj")]; + char stringpool_str174[sizeof("bug")]; + char stringpool_str175[sizeof("kdm")]; + char stringpool_str177[sizeof("mn")]; + char stringpool_str178[sizeof("ig")]; + char stringpool_str179[sizeof("sn")]; + char stringpool_str180[sizeof("pag")]; + char stringpool_str181[sizeof("tl")]; + char stringpool_str182[sizeof("nb")]; + char stringpool_str183[sizeof("pbb")]; + char stringpool_str184[sizeof("tk")]; + char stringpool_str186[sizeof("ro")]; + char stringpool_str187[sizeof("mos")]; + char stringpool_str188[sizeof("kn")]; + char stringpool_str189[sizeof("bn")]; + char stringpool_str190[sizeof("uk")]; + char stringpool_str191[sizeof("sv")]; + char stringpool_str193[sizeof("ga")]; + char stringpool_str195[sizeof("he")]; + char stringpool_str196[sizeof("is")]; + char stringpool_str197[sizeof("ha")]; + char stringpool_str198[sizeof("mai")]; + char stringpool_str199[sizeof("iu")]; + char stringpool_str200[sizeof("kv")]; + char stringpool_str202[sizeof("tn")]; + char stringpool_str203[sizeof("hi")]; + char stringpool_str204[sizeof("nd")]; + char stringpool_str205[sizeof("fo")]; + char stringpool_str206[sizeof("fon")]; + char stringpool_str207[sizeof("ak")]; + char stringpool_str208[sizeof("zu")]; + char stringpool_str209[sizeof("my")]; + char stringpool_str210[sizeof("myn")]; + char stringpool_str211[sizeof("mh")]; + char stringpool_str212[sizeof("no")]; + char stringpool_str213[sizeof("ve")]; + char stringpool_str214[sizeof("shn")]; + char stringpool_str215[sizeof("hil")]; + char stringpool_str217[sizeof("sc")]; + char stringpool_str218[sizeof("scn")]; + char stringpool_str219[sizeof("oc")]; + char stringpool_str220[sizeof("ky")]; + char stringpool_str221[sizeof("vi")]; + char stringpool_str222[sizeof("pl")]; + char stringpool_str223[sizeof("bh")]; + char stringpool_str224[sizeof("cv")]; + char stringpool_str225[sizeof("an")]; + char stringpool_str226[sizeof("ee")]; + char stringpool_str227[sizeof("hr")]; + char stringpool_str229[sizeof("mt")]; + char stringpool_str230[sizeof("war")]; + char stringpool_str231[sizeof("st")]; + char stringpool_str234[sizeof("ty")]; + char stringpool_str235[sizeof("id")]; + char stringpool_str236[sizeof("th")]; + char stringpool_str237[sizeof("av")]; + char stringpool_str240[sizeof("raj")]; + char stringpool_str241[sizeof("gu")]; + char stringpool_str242[sizeof("luo")]; + char stringpool_str244[sizeof("cy")]; + char stringpool_str245[sizeof("hu")]; + char stringpool_str246[sizeof("ch")]; + char stringpool_str247[sizeof("ja")]; + char stringpool_str248[sizeof("mak")]; + char stringpool_str249[sizeof("sw")]; + char stringpool_str250[sizeof("ln")]; + char stringpool_str251[sizeof("sm")]; + char stringpool_str252[sizeof("srr")]; + char stringpool_str253[sizeof("om")]; + char stringpool_str254[sizeof("tt")]; + char stringpool_str255[sizeof("yo")]; + char stringpool_str257[sizeof("ay")]; + char stringpool_str258[sizeof("kw")]; + char stringpool_str259[sizeof("crh")]; + char stringpool_str260[sizeof("km")]; + char stringpool_str261[sizeof("bm")]; + char stringpool_str262[sizeof("lv")]; + char stringpool_str264[sizeof("uz")]; + char stringpool_str265[sizeof("rn")]; + char stringpool_str266[sizeof("bik")]; + char stringpool_str267[sizeof("qu")]; + char stringpool_str269[sizeof("fj")]; + char stringpool_str270[sizeof("nl")]; + char stringpool_str272[sizeof("tw")]; + char stringpool_str273[sizeof("es")]; + char stringpool_str276[sizeof("eu")]; + char stringpool_str277[sizeof("gd")]; + char stringpool_str278[sizeof("yao")]; + char stringpool_str280[sizeof("nso")]; + char stringpool_str281[sizeof("az")]; + char stringpool_str286[sizeof("gon")]; + char stringpool_str289[sizeof("ho")]; + char stringpool_str291[sizeof("nn")]; + char stringpool_str293[sizeof("nds")]; + char stringpool_str295[sizeof("pt")]; + char stringpool_str296[sizeof("jab")]; + char stringpool_str297[sizeof("am")]; + char stringpool_str298[sizeof("suk")]; + char stringpool_str300[sizeof("awa")]; + char stringpool_str302[sizeof("lt")]; + char stringpool_str303[sizeof("nv")]; + char stringpool_str304[sizeof("ik")]; + char stringpool_str307[sizeof("vo")]; + char stringpool_str308[sizeof("nah")]; + char stringpool_str309[sizeof("kmb")]; + char stringpool_str313[sizeof("dv")]; + char stringpool_str316[sizeof("fy")]; + char stringpool_str320[sizeof("eo")]; + char stringpool_str323[sizeof("ny")]; + char stringpool_str324[sizeof("nyn")]; + char stringpool_str329[sizeof("umb")]; + char stringpool_str333[sizeof("ang")]; + char stringpool_str334[sizeof("kcg")]; + char stringpool_str335[sizeof("rw")]; + char stringpool_str337[sizeof("rm")]; + char stringpool_str338[sizeof("bho")]; + char stringpool_str343[sizeof("gl")]; + char stringpool_str351[sizeof("kok")]; + char stringpool_str357[sizeof("dz")]; + char stringpool_str364[sizeof("gn")]; + char stringpool_str365[sizeof("zh")]; + char stringpool_str369[sizeof("mni")]; + char stringpool_str371[sizeof("xh")]; + char stringpool_str374[sizeof("it")]; + char stringpool_str375[sizeof("fur")]; + char stringpool_str376[sizeof("gv")]; + char stringpool_str378[sizeof("el")]; + char stringpool_str388[sizeof("ace")]; + char stringpool_str397[sizeof("nym")]; + char stringpool_str399[sizeof("en")]; + char stringpool_str400[sizeof("hy")]; + char stringpool_str414[sizeof("doi")]; + char stringpool_str416[sizeof("ilo")]; + char stringpool_str420[sizeof("ht")]; + char stringpool_str424[sizeof("hz")]; + char stringpool_str430[sizeof("jv")]; + char stringpool_str441[sizeof("hmn")]; + char stringpool_str448[sizeof("gsw")]; + char stringpool_str451[sizeof("et")]; + char stringpool_str461[sizeof("mwr")]; + }; + static const struct stringpool_t stringpool_contents = + { + "sq", + "men", + "se", + "man", + "sa", + "sat", + "mi", + "min", + "si", + "wen", + "be", + "ka", + "ba", + "ban", + "ki", + "bi", + "bin", + "wal", + "te", + "bal", + "ta", + "tet", + "mg", + "sg", + "mr", + "ti", + "sr", + "ce", + "or", + "ca", + "mad", + "kg", + "bg", + "kr", + "br", + "sid", + "ms", + "ae", + "ss", + "aa", + "os", + "su", + "tg", + "tr", + "ks", + "bs", + "ug", + "ku", + "kab", + "ur", + "tiv", + "cr", + "pa", + "kru", + "af", + "ts", + "pap", + "pi", + "la", + "ar", + "li", + "cs", + "ceb", + "cu", + "bem", + "kam", + "sd", + "sas", + "mo", + "as", + "so", + "ast", + "tem", + "lg", + "wo", + "ko", + "bo", + "fa", + "mag", + "kbd", + "ab", + "ps", + "ne", + "fi", + "na", + "to", + "nap", + "lu", + "de", + "da", + "fil", + "lua", + "co", + "ff", + "csb", + "din", + "lb", + "ru", + "fr", + "sus", + "pam", + "ng", + "ie", + "nr", + "ia", + "tum", + "ml", + "ii", + "sl", + "mk", + "za", + "sk", + "bej", + "kaj", + "zap", + "oj", + "kl", + "yi", + "kk", + "lo", + "kj", + "bug", + "kdm", + "mn", + "ig", + "sn", + "pag", + "tl", + "nb", + "pbb", + "tk", + "ro", + "mos", + "kn", + "bn", + "uk", + "sv", + "ga", + "he", + "is", + "ha", + "mai", + "iu", + "kv", + "tn", + "hi", + "nd", + "fo", + "fon", + "ak", + "zu", + "my", + "myn", + "mh", + "no", + "ve", + "shn", + "hil", + "sc", + "scn", + "oc", + "ky", + "vi", + "pl", + "bh", + "cv", + "an", + "ee", + "hr", + "mt", + "war", + "st", + "ty", + "id", + "th", + "av", + "raj", + "gu", + "luo", + "cy", + "hu", + "ch", + "ja", + "mak", + "sw", + "ln", + "sm", + "srr", + "om", + "tt", + "yo", + "ay", + "kw", + "crh", + "km", + "bm", + "lv", + "uz", + "rn", + "bik", + "qu", + "fj", + "nl", + "tw", + "es", + "eu", + "gd", + "yao", + "nso", + "az", + "gon", + "ho", + "nn", + "nds", + "pt", + "jab", + "am", + "suk", + "awa", + "lt", + "nv", + "ik", + "vo", + "nah", + "kmb", + "dv", + "fy", + "eo", + "ny", + "nyn", + "umb", + "ang", + "kcg", + "rw", + "rm", + "bho", + "gl", + "kok", + "dz", + "gn", + "zh", + "mni", + "xh", + "it", + "fur", + "gv", + "el", + "ace", + "nym", + "en", + "hy", + "doi", + "ilo", + "ht", + "hz", + "jv", + "hmn", + "gsw", + "et", + "mwr" + }; + #define stringpool ((const char *) &stringpool_contents) + static const unsigned char lengthtable[] = + { + 0, 0, 0, 0, 2, 3, 2, 3, 2, 0, 0, 3, 2, 3, + 2, 3, 2, 2, 2, 3, 0, 0, 0, 2, 2, 3, 0, 0, + 3, 2, 3, 2, 3, 2, 0, 2, 2, 2, 2, 2, 2, 2, + 3, 0, 2, 2, 0, 2, 2, 0, 3, 2, 2, 2, 2, 2, + 2, 0, 2, 0, 0, 2, 2, 2, 2, 2, 3, 2, 0, 3, + 0, 2, 2, 3, 0, 2, 2, 3, 2, 2, 0, 0, 0, 0, + 2, 2, 2, 0, 3, 2, 3, 3, 2, 0, 0, 0, 0, 3, + 2, 2, 2, 0, 3, 3, 0, 0, 2, 0, 2, 2, 2, 0, + 0, 2, 3, 3, 2, 2, 2, 2, 2, 0, 0, 2, 0, 3, + 0, 2, 2, 0, 2, 3, 3, 2, 2, 3, 0, 3, 0, 0, + 0, 2, 2, 2, 0, 3, 3, 2, 0, 2, 2, 2, 0, 3, + 0, 0, 2, 2, 2, 2, 2, 2, 3, 3, 0, 3, 2, 2, + 0, 2, 2, 2, 0, 2, 3, 3, 0, 2, 2, 2, 3, 2, + 2, 3, 2, 0, 2, 3, 2, 2, 2, 2, 0, 2, 0, 2, + 2, 2, 3, 2, 2, 0, 2, 2, 2, 2, 3, 2, 2, 2, + 3, 2, 2, 2, 3, 3, 0, 2, 3, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 0, 2, 3, 2, 0, 0, 2, 2, 2, 2, + 0, 0, 3, 2, 3, 0, 2, 2, 2, 2, 3, 2, 2, 2, + 3, 2, 2, 2, 0, 2, 2, 3, 2, 2, 2, 0, 2, 2, + 3, 2, 0, 2, 2, 0, 2, 2, 0, 0, 2, 2, 3, 0, + 3, 2, 0, 0, 0, 0, 3, 0, 0, 2, 0, 2, 0, 3, + 0, 2, 3, 2, 3, 0, 3, 0, 2, 2, 2, 0, 0, 2, + 3, 3, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 2, 0, + 0, 2, 3, 0, 0, 0, 0, 3, 0, 0, 0, 3, 3, 2, + 0, 2, 3, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, + 0, 3, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, + 2, 2, 0, 0, 0, 3, 0, 2, 0, 0, 2, 3, 2, 0, + 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 3, 0, 2, 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 3, 0, 0, 0, + 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3 + }; + static const int wordlist[] = + { + -1, -1, -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str4, + (int)(long)&((struct stringpool_t *)0)->stringpool_str5, + (int)(long)&((struct stringpool_t *)0)->stringpool_str6, + (int)(long)&((struct stringpool_t *)0)->stringpool_str7, + (int)(long)&((struct stringpool_t *)0)->stringpool_str8, + -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str11, + (int)(long)&((struct stringpool_t *)0)->stringpool_str12, + (int)(long)&((struct stringpool_t *)0)->stringpool_str13, + (int)(long)&((struct stringpool_t *)0)->stringpool_str14, + (int)(long)&((struct stringpool_t *)0)->stringpool_str15, + (int)(long)&((struct stringpool_t *)0)->stringpool_str16, + (int)(long)&((struct stringpool_t *)0)->stringpool_str17, + (int)(long)&((struct stringpool_t *)0)->stringpool_str18, + (int)(long)&((struct stringpool_t *)0)->stringpool_str19, + -1, -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str23, + (int)(long)&((struct stringpool_t *)0)->stringpool_str24, + (int)(long)&((struct stringpool_t *)0)->stringpool_str25, + -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str28, + (int)(long)&((struct stringpool_t *)0)->stringpool_str29, + (int)(long)&((struct stringpool_t *)0)->stringpool_str30, + (int)(long)&((struct stringpool_t *)0)->stringpool_str31, + (int)(long)&((struct stringpool_t *)0)->stringpool_str32, + (int)(long)&((struct stringpool_t *)0)->stringpool_str33, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str35, + (int)(long)&((struct stringpool_t *)0)->stringpool_str36, + (int)(long)&((struct stringpool_t *)0)->stringpool_str37, + (int)(long)&((struct stringpool_t *)0)->stringpool_str38, + (int)(long)&((struct stringpool_t *)0)->stringpool_str39, + (int)(long)&((struct stringpool_t *)0)->stringpool_str40, + (int)(long)&((struct stringpool_t *)0)->stringpool_str41, + (int)(long)&((struct stringpool_t *)0)->stringpool_str42, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str44, + (int)(long)&((struct stringpool_t *)0)->stringpool_str45, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str47, + (int)(long)&((struct stringpool_t *)0)->stringpool_str48, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str50, + (int)(long)&((struct stringpool_t *)0)->stringpool_str51, + (int)(long)&((struct stringpool_t *)0)->stringpool_str52, + (int)(long)&((struct stringpool_t *)0)->stringpool_str53, + (int)(long)&((struct stringpool_t *)0)->stringpool_str54, + (int)(long)&((struct stringpool_t *)0)->stringpool_str55, + (int)(long)&((struct stringpool_t *)0)->stringpool_str56, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str58, + -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str61, + (int)(long)&((struct stringpool_t *)0)->stringpool_str62, + (int)(long)&((struct stringpool_t *)0)->stringpool_str63, + (int)(long)&((struct stringpool_t *)0)->stringpool_str64, + (int)(long)&((struct stringpool_t *)0)->stringpool_str65, + (int)(long)&((struct stringpool_t *)0)->stringpool_str66, + (int)(long)&((struct stringpool_t *)0)->stringpool_str67, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str69, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str71, + (int)(long)&((struct stringpool_t *)0)->stringpool_str72, + (int)(long)&((struct stringpool_t *)0)->stringpool_str73, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str75, + (int)(long)&((struct stringpool_t *)0)->stringpool_str76, + (int)(long)&((struct stringpool_t *)0)->stringpool_str77, + (int)(long)&((struct stringpool_t *)0)->stringpool_str78, + (int)(long)&((struct stringpool_t *)0)->stringpool_str79, + -1, -1, -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str84, + (int)(long)&((struct stringpool_t *)0)->stringpool_str85, + (int)(long)&((struct stringpool_t *)0)->stringpool_str86, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str88, + (int)(long)&((struct stringpool_t *)0)->stringpool_str89, + (int)(long)&((struct stringpool_t *)0)->stringpool_str90, + (int)(long)&((struct stringpool_t *)0)->stringpool_str91, + (int)(long)&((struct stringpool_t *)0)->stringpool_str92, + -1, -1, -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str97, + (int)(long)&((struct stringpool_t *)0)->stringpool_str98, + (int)(long)&((struct stringpool_t *)0)->stringpool_str99, + (int)(long)&((struct stringpool_t *)0)->stringpool_str100, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str102, + (int)(long)&((struct stringpool_t *)0)->stringpool_str103, + -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str106, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str108, + (int)(long)&((struct stringpool_t *)0)->stringpool_str109, + (int)(long)&((struct stringpool_t *)0)->stringpool_str110, + -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str113, + (int)(long)&((struct stringpool_t *)0)->stringpool_str114, + (int)(long)&((struct stringpool_t *)0)->stringpool_str115, + (int)(long)&((struct stringpool_t *)0)->stringpool_str116, + (int)(long)&((struct stringpool_t *)0)->stringpool_str117, + (int)(long)&((struct stringpool_t *)0)->stringpool_str118, + (int)(long)&((struct stringpool_t *)0)->stringpool_str119, + (int)(long)&((struct stringpool_t *)0)->stringpool_str120, + -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str123, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str125, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str127, + (int)(long)&((struct stringpool_t *)0)->stringpool_str128, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str130, + (int)(long)&((struct stringpool_t *)0)->stringpool_str131, + (int)(long)&((struct stringpool_t *)0)->stringpool_str132, + (int)(long)&((struct stringpool_t *)0)->stringpool_str133, + (int)(long)&((struct stringpool_t *)0)->stringpool_str134, + (int)(long)&((struct stringpool_t *)0)->stringpool_str135, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str137, + -1, -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str141, + (int)(long)&((struct stringpool_t *)0)->stringpool_str142, + (int)(long)&((struct stringpool_t *)0)->stringpool_str143, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str145, + (int)(long)&((struct stringpool_t *)0)->stringpool_str146, + (int)(long)&((struct stringpool_t *)0)->stringpool_str147, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str149, + (int)(long)&((struct stringpool_t *)0)->stringpool_str150, + (int)(long)&((struct stringpool_t *)0)->stringpool_str151, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str153, + -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str156, + (int)(long)&((struct stringpool_t *)0)->stringpool_str157, + (int)(long)&((struct stringpool_t *)0)->stringpool_str158, + (int)(long)&((struct stringpool_t *)0)->stringpool_str159, + (int)(long)&((struct stringpool_t *)0)->stringpool_str160, + (int)(long)&((struct stringpool_t *)0)->stringpool_str161, + (int)(long)&((struct stringpool_t *)0)->stringpool_str162, + (int)(long)&((struct stringpool_t *)0)->stringpool_str163, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str165, + (int)(long)&((struct stringpool_t *)0)->stringpool_str166, + (int)(long)&((struct stringpool_t *)0)->stringpool_str167, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str169, + (int)(long)&((struct stringpool_t *)0)->stringpool_str170, + (int)(long)&((struct stringpool_t *)0)->stringpool_str171, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str173, + (int)(long)&((struct stringpool_t *)0)->stringpool_str174, + (int)(long)&((struct stringpool_t *)0)->stringpool_str175, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str177, + (int)(long)&((struct stringpool_t *)0)->stringpool_str178, + (int)(long)&((struct stringpool_t *)0)->stringpool_str179, + (int)(long)&((struct stringpool_t *)0)->stringpool_str180, + (int)(long)&((struct stringpool_t *)0)->stringpool_str181, + (int)(long)&((struct stringpool_t *)0)->stringpool_str182, + (int)(long)&((struct stringpool_t *)0)->stringpool_str183, + (int)(long)&((struct stringpool_t *)0)->stringpool_str184, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str186, + (int)(long)&((struct stringpool_t *)0)->stringpool_str187, + (int)(long)&((struct stringpool_t *)0)->stringpool_str188, + (int)(long)&((struct stringpool_t *)0)->stringpool_str189, + (int)(long)&((struct stringpool_t *)0)->stringpool_str190, + (int)(long)&((struct stringpool_t *)0)->stringpool_str191, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str193, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str195, + (int)(long)&((struct stringpool_t *)0)->stringpool_str196, + (int)(long)&((struct stringpool_t *)0)->stringpool_str197, + (int)(long)&((struct stringpool_t *)0)->stringpool_str198, + (int)(long)&((struct stringpool_t *)0)->stringpool_str199, + (int)(long)&((struct stringpool_t *)0)->stringpool_str200, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str202, + (int)(long)&((struct stringpool_t *)0)->stringpool_str203, + (int)(long)&((struct stringpool_t *)0)->stringpool_str204, + (int)(long)&((struct stringpool_t *)0)->stringpool_str205, + (int)(long)&((struct stringpool_t *)0)->stringpool_str206, + (int)(long)&((struct stringpool_t *)0)->stringpool_str207, + (int)(long)&((struct stringpool_t *)0)->stringpool_str208, + (int)(long)&((struct stringpool_t *)0)->stringpool_str209, + (int)(long)&((struct stringpool_t *)0)->stringpool_str210, + (int)(long)&((struct stringpool_t *)0)->stringpool_str211, + (int)(long)&((struct stringpool_t *)0)->stringpool_str212, + (int)(long)&((struct stringpool_t *)0)->stringpool_str213, + (int)(long)&((struct stringpool_t *)0)->stringpool_str214, + (int)(long)&((struct stringpool_t *)0)->stringpool_str215, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str217, + (int)(long)&((struct stringpool_t *)0)->stringpool_str218, + (int)(long)&((struct stringpool_t *)0)->stringpool_str219, + (int)(long)&((struct stringpool_t *)0)->stringpool_str220, + (int)(long)&((struct stringpool_t *)0)->stringpool_str221, + (int)(long)&((struct stringpool_t *)0)->stringpool_str222, + (int)(long)&((struct stringpool_t *)0)->stringpool_str223, + (int)(long)&((struct stringpool_t *)0)->stringpool_str224, + (int)(long)&((struct stringpool_t *)0)->stringpool_str225, + (int)(long)&((struct stringpool_t *)0)->stringpool_str226, + (int)(long)&((struct stringpool_t *)0)->stringpool_str227, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str229, + (int)(long)&((struct stringpool_t *)0)->stringpool_str230, + (int)(long)&((struct stringpool_t *)0)->stringpool_str231, + -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str234, + (int)(long)&((struct stringpool_t *)0)->stringpool_str235, + (int)(long)&((struct stringpool_t *)0)->stringpool_str236, + (int)(long)&((struct stringpool_t *)0)->stringpool_str237, + -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str240, + (int)(long)&((struct stringpool_t *)0)->stringpool_str241, + (int)(long)&((struct stringpool_t *)0)->stringpool_str242, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str244, + (int)(long)&((struct stringpool_t *)0)->stringpool_str245, + (int)(long)&((struct stringpool_t *)0)->stringpool_str246, + (int)(long)&((struct stringpool_t *)0)->stringpool_str247, + (int)(long)&((struct stringpool_t *)0)->stringpool_str248, + (int)(long)&((struct stringpool_t *)0)->stringpool_str249, + (int)(long)&((struct stringpool_t *)0)->stringpool_str250, + (int)(long)&((struct stringpool_t *)0)->stringpool_str251, + (int)(long)&((struct stringpool_t *)0)->stringpool_str252, + (int)(long)&((struct stringpool_t *)0)->stringpool_str253, + (int)(long)&((struct stringpool_t *)0)->stringpool_str254, + (int)(long)&((struct stringpool_t *)0)->stringpool_str255, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str257, + (int)(long)&((struct stringpool_t *)0)->stringpool_str258, + (int)(long)&((struct stringpool_t *)0)->stringpool_str259, + (int)(long)&((struct stringpool_t *)0)->stringpool_str260, + (int)(long)&((struct stringpool_t *)0)->stringpool_str261, + (int)(long)&((struct stringpool_t *)0)->stringpool_str262, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str264, + (int)(long)&((struct stringpool_t *)0)->stringpool_str265, + (int)(long)&((struct stringpool_t *)0)->stringpool_str266, + (int)(long)&((struct stringpool_t *)0)->stringpool_str267, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str269, + (int)(long)&((struct stringpool_t *)0)->stringpool_str270, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str272, + (int)(long)&((struct stringpool_t *)0)->stringpool_str273, + -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str276, + (int)(long)&((struct stringpool_t *)0)->stringpool_str277, + (int)(long)&((struct stringpool_t *)0)->stringpool_str278, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str280, + (int)(long)&((struct stringpool_t *)0)->stringpool_str281, + -1, -1, -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str286, + -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str289, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str291, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str293, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str295, + (int)(long)&((struct stringpool_t *)0)->stringpool_str296, + (int)(long)&((struct stringpool_t *)0)->stringpool_str297, + (int)(long)&((struct stringpool_t *)0)->stringpool_str298, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str300, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str302, + (int)(long)&((struct stringpool_t *)0)->stringpool_str303, + (int)(long)&((struct stringpool_t *)0)->stringpool_str304, + -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str307, + (int)(long)&((struct stringpool_t *)0)->stringpool_str308, + (int)(long)&((struct stringpool_t *)0)->stringpool_str309, + -1, -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str313, + -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str316, + -1, -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str320, + -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str323, + (int)(long)&((struct stringpool_t *)0)->stringpool_str324, + -1, -1, -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str329, + -1, -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str333, + (int)(long)&((struct stringpool_t *)0)->stringpool_str334, + (int)(long)&((struct stringpool_t *)0)->stringpool_str335, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str337, + (int)(long)&((struct stringpool_t *)0)->stringpool_str338, + -1, -1, -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str343, + -1, -1, -1, -1, -1, -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str351, + -1, -1, -1, -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str357, + -1, -1, -1, -1, -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str364, + (int)(long)&((struct stringpool_t *)0)->stringpool_str365, + -1, -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str369, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str371, + -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str374, + (int)(long)&((struct stringpool_t *)0)->stringpool_str375, + (int)(long)&((struct stringpool_t *)0)->stringpool_str376, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str378, + -1, -1, -1, -1, -1, -1, -1, -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str388, + -1, -1, -1, -1, -1, -1, -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str397, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str399, + (int)(long)&((struct stringpool_t *)0)->stringpool_str400, + -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str414, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str416, + -1, -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str420, + -1, -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str424, + -1, -1, -1, -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str430, + -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str441, + -1, -1, -1, -1, -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str448, + -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str451, + -1, -1, -1, -1, -1, -1, -1, -1, -1, + (int)(long)&((struct stringpool_t *)0)->stringpool_str461 + }; + + if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) + { + register int key = uc_locale_language_hash (str, len); + + if (key <= MAX_HASH_VALUE && key >= 0) + if (len == lengthtable[key]) + { + register const char *s = wordlist[key] + stringpool; + + if (*str == *s && !memcmp (str + 1, s + 1, len - 1)) + return s; + } + } + return 0; +} diff --git a/lib/unicase/simple-mapping.h b/lib/unicase/simple-mapping.h new file mode 100644 index 00000000..44cecc81 --- /dev/null +++ b/lib/unicase/simple-mapping.h @@ -0,0 +1,39 @@ +/* Simple case mapping for Unicode characters. + Copyright (C) 2002, 2006, 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 . */ + +ucs4_t +FUNC (ucs4_t uc) +{ + unsigned int index1 = uc >> mapping_header_0; + if (index1 < mapping_header_1) + { + int lookup1 = u_mapping.level1[index1]; + if (lookup1 >= 0) + { + unsigned int index2 = (uc >> mapping_header_2) & mapping_header_3; + int lookup2 = u_mapping.level2[lookup1 + index2]; + if (lookup2 >= 0) + { + unsigned int index3 = (uc & mapping_header_4); + int lookup3 = u_mapping.level3[lookup2 + index3]; + + return uc + lookup3; + } + } + } + return uc; +} diff --git a/lib/unicase/special-casing-table.gperf b/lib/unicase/special-casing-table.gperf new file mode 100644 index 00000000..78e8fcdd --- /dev/null +++ b/lib/unicase/special-casing-table.gperf @@ -0,0 +1,136 @@ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +/* Special casing rules of Unicode characters. */ +/* Generated automatically by gen-uni-tables.c for Unicode 5.1.0. */ +struct special_casing_rule { char code[3]; }; +%struct-type +%language=ANSI-C +%define slot-name code +%define hash-function-name gl_unicase_special_hash +%define lookup-function-name gl_unicase_special_lookup +%compare-lengths +%compare-strncmp +%readonly-tables +%omit-struct-type +%% +"\x00\x49\x00", 1, SCC_MORE_ABOVE , { 'l', 't' }, { 0x0049, 0, 0 }, { 0x0069, 0x0307, 0 }, { 0x0049, 0, 0 }, { 0x0069, 0, 0 } +"\x00\x49\x01", 1, -SCC_BEFORE_DOT , { 't', 'r' }, { 0x0049, 0, 0 }, { 0x0131, 0, 0 }, { 0x0049, 0, 0 }, { 0x0131, 0, 0 } +"\x00\x49\x02", 1, -SCC_BEFORE_DOT , { 'a', 'z' }, { 0x0049, 0, 0 }, { 0x0131, 0, 0 }, { 0x0049, 0, 0 }, { 0x0131, 0, 0 } +"\x00\x49\x03", 1, SCC_ALWAYS , { 't', 'r' }, { 0x0049, 0, 0 }, { 0x0069, 0, 0 }, { 0x0049, 0, 0 }, { 0x0131, 0, 0 } +"\x00\x49\x04", 0, SCC_ALWAYS , { 'a', 'z' }, { 0x0049, 0, 0 }, { 0x0069, 0, 0 }, { 0x0049, 0, 0 }, { 0x0131, 0, 0 } +"\x00\x4a\x00", 0, SCC_MORE_ABOVE , { 'l', 't' }, { 0x004A, 0, 0 }, { 0x006A, 0x0307, 0 }, { 0x004A, 0, 0 }, { 0x006A, 0, 0 } +"\x00\x69\x00", 1, SCC_ALWAYS , { 't', 'r' }, { 0x0130, 0, 0 }, { 0x0069, 0, 0 }, { 0x0130, 0, 0 }, { 0x0069, 0, 0 } +"\x00\x69\x01", 0, SCC_ALWAYS , { 'a', 'z' }, { 0x0130, 0, 0 }, { 0x0069, 0, 0 }, { 0x0130, 0, 0 }, { 0x0069, 0, 0 } +"\x00\xcc\x00", 0, SCC_ALWAYS , { 'l', 't' }, { 0x00CC, 0, 0 }, { 0x0069, 0x0307, 0x0300 }, { 0x00CC, 0, 0 }, { 0x00EC, 0, 0 } +"\x00\xcd\x00", 0, SCC_ALWAYS , { 'l', 't' }, { 0x00CD, 0, 0 }, { 0x0069, 0x0307, 0x0301 }, { 0x00CD, 0, 0 }, { 0x00ED, 0, 0 } +"\x00\xdf\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0053, 0x0053, 0 }, { 0x00DF, 0, 0 }, { 0x0053, 0x0073, 0 }, { 0x0073, 0x0073, 0 } +"\x01\x28\x00", 0, SCC_ALWAYS , { 'l', 't' }, { 0x0128, 0, 0 }, { 0x0069, 0x0307, 0x0303 }, { 0x0128, 0, 0 }, { 0x0129, 0, 0 } +"\x01\x2e\x00", 0, SCC_MORE_ABOVE , { 'l', 't' }, { 0x012E, 0, 0 }, { 0x012F, 0x0307, 0 }, { 0x012E, 0, 0 }, { 0x012F, 0, 0 } +"\x01\x30\x00", 1, SCC_ALWAYS , { 't', 'r' }, { 0x0130, 0, 0 }, { 0x0069, 0, 0 }, { 0x0130, 0, 0 }, { 0x0069, 0, 0 } +"\x01\x30\x01", 1, SCC_ALWAYS , { 'a', 'z' }, { 0x0130, 0, 0 }, { 0x0069, 0, 0 }, { 0x0130, 0, 0 }, { 0x0069, 0, 0 } +"\x01\x30\x02", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0130, 0, 0 }, { 0x0069, 0x0307, 0 }, { 0x0130, 0, 0 }, { 0x0069, 0x0307, 0 } +"\x01\x49\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x02BC, 0x004E, 0 }, { 0x0149, 0, 0 }, { 0x02BC, 0x004E, 0 }, { 0x02BC, 0x006E, 0 } +"\x01\xf0\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x004A, 0x030C, 0 }, { 0x01F0, 0, 0 }, { 0x004A, 0x030C, 0 }, { 0x006A, 0x030C, 0 } +"\x03\x07\x00", 1, SCC_AFTER_SOFT_DOTTED, { 'l', 't' }, { 0, 0, 0 }, { 0x0307, 0, 0 }, { 0, 0, 0 }, { 0x0307, 0, 0 } +"\x03\x07\x01", 1, SCC_AFTER_I , { 't', 'r' }, { 0x0307, 0, 0 }, { 0, 0, 0 }, { 0x0307, 0, 0 }, { 0x0307, 0, 0 } +"\x03\x07\x02", 0, SCC_AFTER_I , { 'a', 'z' }, { 0x0307, 0, 0 }, { 0, 0, 0 }, { 0x0307, 0, 0 }, { 0x0307, 0, 0 } +"\x03\x90\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0399, 0x0308, 0x0301 }, { 0x0390, 0, 0 }, { 0x0399, 0x0308, 0x0301 }, { 0x03B9, 0x0308, 0x0301 } +"\x03\xa3\x00", 0, SCC_FINAL_SIGMA , { '\0', '\0' }, { 0x03A3, 0, 0 }, { 0x03C2, 0, 0 }, { 0x03A3, 0, 0 }, { 0x03C3, 0, 0 } +"\x03\xb0\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x03A5, 0x0308, 0x0301 }, { 0x03B0, 0, 0 }, { 0x03A5, 0x0308, 0x0301 }, { 0x03C5, 0x0308, 0x0301 } +"\x05\x87\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0535, 0x0552, 0 }, { 0x0587, 0, 0 }, { 0x0535, 0x0582, 0 }, { 0x0565, 0x0582, 0 } +"\x1e\x96\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0048, 0x0331, 0 }, { 0x1E96, 0, 0 }, { 0x0048, 0x0331, 0 }, { 0x0068, 0x0331, 0 } +"\x1e\x97\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0054, 0x0308, 0 }, { 0x1E97, 0, 0 }, { 0x0054, 0x0308, 0 }, { 0x0074, 0x0308, 0 } +"\x1e\x98\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0057, 0x030A, 0 }, { 0x1E98, 0, 0 }, { 0x0057, 0x030A, 0 }, { 0x0077, 0x030A, 0 } +"\x1e\x99\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0059, 0x030A, 0 }, { 0x1E99, 0, 0 }, { 0x0059, 0x030A, 0 }, { 0x0079, 0x030A, 0 } +"\x1e\x9a\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0041, 0x02BE, 0 }, { 0x1E9A, 0, 0 }, { 0x0041, 0x02BE, 0 }, { 0x0061, 0x02BE, 0 } +"\x1e\x9e\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1E9E, 0, 0 }, { 0x00DF, 0, 0 }, { 0x1E9E, 0, 0 }, { 0x0073, 0x0073, 0 } +"\x1f\x50\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x03A5, 0x0313, 0 }, { 0x1F50, 0, 0 }, { 0x03A5, 0x0313, 0 }, { 0x03C5, 0x0313, 0 } +"\x1f\x52\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x03A5, 0x0313, 0x0300 }, { 0x1F52, 0, 0 }, { 0x03A5, 0x0313, 0x0300 }, { 0x03C5, 0x0313, 0x0300 } +"\x1f\x54\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x03A5, 0x0313, 0x0301 }, { 0x1F54, 0, 0 }, { 0x03A5, 0x0313, 0x0301 }, { 0x03C5, 0x0313, 0x0301 } +"\x1f\x56\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x03A5, 0x0313, 0x0342 }, { 0x1F56, 0, 0 }, { 0x03A5, 0x0313, 0x0342 }, { 0x03C5, 0x0313, 0x0342 } +"\x1f\x80\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F08, 0x0399, 0 }, { 0x1F80, 0, 0 }, { 0x1F88, 0, 0 }, { 0x1F00, 0x03B9, 0 } +"\x1f\x81\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F09, 0x0399, 0 }, { 0x1F81, 0, 0 }, { 0x1F89, 0, 0 }, { 0x1F01, 0x03B9, 0 } +"\x1f\x82\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F0A, 0x0399, 0 }, { 0x1F82, 0, 0 }, { 0x1F8A, 0, 0 }, { 0x1F02, 0x03B9, 0 } +"\x1f\x83\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F0B, 0x0399, 0 }, { 0x1F83, 0, 0 }, { 0x1F8B, 0, 0 }, { 0x1F03, 0x03B9, 0 } +"\x1f\x84\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F0C, 0x0399, 0 }, { 0x1F84, 0, 0 }, { 0x1F8C, 0, 0 }, { 0x1F04, 0x03B9, 0 } +"\x1f\x85\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F0D, 0x0399, 0 }, { 0x1F85, 0, 0 }, { 0x1F8D, 0, 0 }, { 0x1F05, 0x03B9, 0 } +"\x1f\x86\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F0E, 0x0399, 0 }, { 0x1F86, 0, 0 }, { 0x1F8E, 0, 0 }, { 0x1F06, 0x03B9, 0 } +"\x1f\x87\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F0F, 0x0399, 0 }, { 0x1F87, 0, 0 }, { 0x1F8F, 0, 0 }, { 0x1F07, 0x03B9, 0 } +"\x1f\x88\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F08, 0x0399, 0 }, { 0x1F80, 0, 0 }, { 0x1F88, 0, 0 }, { 0x1F00, 0x03B9, 0 } +"\x1f\x89\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F09, 0x0399, 0 }, { 0x1F81, 0, 0 }, { 0x1F89, 0, 0 }, { 0x1F01, 0x03B9, 0 } +"\x1f\x8a\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F0A, 0x0399, 0 }, { 0x1F82, 0, 0 }, { 0x1F8A, 0, 0 }, { 0x1F02, 0x03B9, 0 } +"\x1f\x8b\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F0B, 0x0399, 0 }, { 0x1F83, 0, 0 }, { 0x1F8B, 0, 0 }, { 0x1F03, 0x03B9, 0 } +"\x1f\x8c\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F0C, 0x0399, 0 }, { 0x1F84, 0, 0 }, { 0x1F8C, 0, 0 }, { 0x1F04, 0x03B9, 0 } +"\x1f\x8d\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F0D, 0x0399, 0 }, { 0x1F85, 0, 0 }, { 0x1F8D, 0, 0 }, { 0x1F05, 0x03B9, 0 } +"\x1f\x8e\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F0E, 0x0399, 0 }, { 0x1F86, 0, 0 }, { 0x1F8E, 0, 0 }, { 0x1F06, 0x03B9, 0 } +"\x1f\x8f\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F0F, 0x0399, 0 }, { 0x1F87, 0, 0 }, { 0x1F8F, 0, 0 }, { 0x1F07, 0x03B9, 0 } +"\x1f\x90\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F28, 0x0399, 0 }, { 0x1F90, 0, 0 }, { 0x1F98, 0, 0 }, { 0x1F20, 0x03B9, 0 } +"\x1f\x91\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F29, 0x0399, 0 }, { 0x1F91, 0, 0 }, { 0x1F99, 0, 0 }, { 0x1F21, 0x03B9, 0 } +"\x1f\x92\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F2A, 0x0399, 0 }, { 0x1F92, 0, 0 }, { 0x1F9A, 0, 0 }, { 0x1F22, 0x03B9, 0 } +"\x1f\x93\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F2B, 0x0399, 0 }, { 0x1F93, 0, 0 }, { 0x1F9B, 0, 0 }, { 0x1F23, 0x03B9, 0 } +"\x1f\x94\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F2C, 0x0399, 0 }, { 0x1F94, 0, 0 }, { 0x1F9C, 0, 0 }, { 0x1F24, 0x03B9, 0 } +"\x1f\x95\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F2D, 0x0399, 0 }, { 0x1F95, 0, 0 }, { 0x1F9D, 0, 0 }, { 0x1F25, 0x03B9, 0 } +"\x1f\x96\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F2E, 0x0399, 0 }, { 0x1F96, 0, 0 }, { 0x1F9E, 0, 0 }, { 0x1F26, 0x03B9, 0 } +"\x1f\x97\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F2F, 0x0399, 0 }, { 0x1F97, 0, 0 }, { 0x1F9F, 0, 0 }, { 0x1F27, 0x03B9, 0 } +"\x1f\x98\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F28, 0x0399, 0 }, { 0x1F90, 0, 0 }, { 0x1F98, 0, 0 }, { 0x1F20, 0x03B9, 0 } +"\x1f\x99\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F29, 0x0399, 0 }, { 0x1F91, 0, 0 }, { 0x1F99, 0, 0 }, { 0x1F21, 0x03B9, 0 } +"\x1f\x9a\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F2A, 0x0399, 0 }, { 0x1F92, 0, 0 }, { 0x1F9A, 0, 0 }, { 0x1F22, 0x03B9, 0 } +"\x1f\x9b\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F2B, 0x0399, 0 }, { 0x1F93, 0, 0 }, { 0x1F9B, 0, 0 }, { 0x1F23, 0x03B9, 0 } +"\x1f\x9c\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F2C, 0x0399, 0 }, { 0x1F94, 0, 0 }, { 0x1F9C, 0, 0 }, { 0x1F24, 0x03B9, 0 } +"\x1f\x9d\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F2D, 0x0399, 0 }, { 0x1F95, 0, 0 }, { 0x1F9D, 0, 0 }, { 0x1F25, 0x03B9, 0 } +"\x1f\x9e\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F2E, 0x0399, 0 }, { 0x1F96, 0, 0 }, { 0x1F9E, 0, 0 }, { 0x1F26, 0x03B9, 0 } +"\x1f\x9f\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F2F, 0x0399, 0 }, { 0x1F97, 0, 0 }, { 0x1F9F, 0, 0 }, { 0x1F27, 0x03B9, 0 } +"\x1f\xa0\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F68, 0x0399, 0 }, { 0x1FA0, 0, 0 }, { 0x1FA8, 0, 0 }, { 0x1F60, 0x03B9, 0 } +"\x1f\xa1\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F69, 0x0399, 0 }, { 0x1FA1, 0, 0 }, { 0x1FA9, 0, 0 }, { 0x1F61, 0x03B9, 0 } +"\x1f\xa2\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F6A, 0x0399, 0 }, { 0x1FA2, 0, 0 }, { 0x1FAA, 0, 0 }, { 0x1F62, 0x03B9, 0 } +"\x1f\xa3\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F6B, 0x0399, 0 }, { 0x1FA3, 0, 0 }, { 0x1FAB, 0, 0 }, { 0x1F63, 0x03B9, 0 } +"\x1f\xa4\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F6C, 0x0399, 0 }, { 0x1FA4, 0, 0 }, { 0x1FAC, 0, 0 }, { 0x1F64, 0x03B9, 0 } +"\x1f\xa5\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F6D, 0x0399, 0 }, { 0x1FA5, 0, 0 }, { 0x1FAD, 0, 0 }, { 0x1F65, 0x03B9, 0 } +"\x1f\xa6\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F6E, 0x0399, 0 }, { 0x1FA6, 0, 0 }, { 0x1FAE, 0, 0 }, { 0x1F66, 0x03B9, 0 } +"\x1f\xa7\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F6F, 0x0399, 0 }, { 0x1FA7, 0, 0 }, { 0x1FAF, 0, 0 }, { 0x1F67, 0x03B9, 0 } +"\x1f\xa8\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F68, 0x0399, 0 }, { 0x1FA0, 0, 0 }, { 0x1FA8, 0, 0 }, { 0x1F60, 0x03B9, 0 } +"\x1f\xa9\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F69, 0x0399, 0 }, { 0x1FA1, 0, 0 }, { 0x1FA9, 0, 0 }, { 0x1F61, 0x03B9, 0 } +"\x1f\xaa\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F6A, 0x0399, 0 }, { 0x1FA2, 0, 0 }, { 0x1FAA, 0, 0 }, { 0x1F62, 0x03B9, 0 } +"\x1f\xab\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F6B, 0x0399, 0 }, { 0x1FA3, 0, 0 }, { 0x1FAB, 0, 0 }, { 0x1F63, 0x03B9, 0 } +"\x1f\xac\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F6C, 0x0399, 0 }, { 0x1FA4, 0, 0 }, { 0x1FAC, 0, 0 }, { 0x1F64, 0x03B9, 0 } +"\x1f\xad\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F6D, 0x0399, 0 }, { 0x1FA5, 0, 0 }, { 0x1FAD, 0, 0 }, { 0x1F65, 0x03B9, 0 } +"\x1f\xae\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F6E, 0x0399, 0 }, { 0x1FA6, 0, 0 }, { 0x1FAE, 0, 0 }, { 0x1F66, 0x03B9, 0 } +"\x1f\xaf\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F6F, 0x0399, 0 }, { 0x1FA7, 0, 0 }, { 0x1FAF, 0, 0 }, { 0x1F67, 0x03B9, 0 } +"\x1f\xb2\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1FBA, 0x0399, 0 }, { 0x1FB2, 0, 0 }, { 0x1FBA, 0x0345, 0 }, { 0x1F70, 0x03B9, 0 } +"\x1f\xb3\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0391, 0x0399, 0 }, { 0x1FB3, 0, 0 }, { 0x1FBC, 0, 0 }, { 0x03B1, 0x03B9, 0 } +"\x1f\xb4\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0386, 0x0399, 0 }, { 0x1FB4, 0, 0 }, { 0x0386, 0x0345, 0 }, { 0x03AC, 0x03B9, 0 } +"\x1f\xb6\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0391, 0x0342, 0 }, { 0x1FB6, 0, 0 }, { 0x0391, 0x0342, 0 }, { 0x03B1, 0x0342, 0 } +"\x1f\xb7\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0391, 0x0342, 0x0399 }, { 0x1FB7, 0, 0 }, { 0x0391, 0x0342, 0x0345 }, { 0x03B1, 0x0342, 0x03B9 } +"\x1f\xbc\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0391, 0x0399, 0 }, { 0x1FB3, 0, 0 }, { 0x1FBC, 0, 0 }, { 0x03B1, 0x03B9, 0 } +"\x1f\xc2\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1FCA, 0x0399, 0 }, { 0x1FC2, 0, 0 }, { 0x1FCA, 0x0345, 0 }, { 0x1F74, 0x03B9, 0 } +"\x1f\xc3\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0397, 0x0399, 0 }, { 0x1FC3, 0, 0 }, { 0x1FCC, 0, 0 }, { 0x03B7, 0x03B9, 0 } +"\x1f\xc4\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0389, 0x0399, 0 }, { 0x1FC4, 0, 0 }, { 0x0389, 0x0345, 0 }, { 0x03AE, 0x03B9, 0 } +"\x1f\xc6\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0397, 0x0342, 0 }, { 0x1FC6, 0, 0 }, { 0x0397, 0x0342, 0 }, { 0x03B7, 0x0342, 0 } +"\x1f\xc7\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0397, 0x0342, 0x0399 }, { 0x1FC7, 0, 0 }, { 0x0397, 0x0342, 0x0345 }, { 0x03B7, 0x0342, 0x03B9 } +"\x1f\xcc\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0397, 0x0399, 0 }, { 0x1FC3, 0, 0 }, { 0x1FCC, 0, 0 }, { 0x03B7, 0x03B9, 0 } +"\x1f\xd2\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0399, 0x0308, 0x0300 }, { 0x1FD2, 0, 0 }, { 0x0399, 0x0308, 0x0300 }, { 0x03B9, 0x0308, 0x0300 } +"\x1f\xd3\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0399, 0x0308, 0x0301 }, { 0x1FD3, 0, 0 }, { 0x0399, 0x0308, 0x0301 }, { 0x03B9, 0x0308, 0x0301 } +"\x1f\xd6\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0399, 0x0342, 0 }, { 0x1FD6, 0, 0 }, { 0x0399, 0x0342, 0 }, { 0x03B9, 0x0342, 0 } +"\x1f\xd7\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0399, 0x0308, 0x0342 }, { 0x1FD7, 0, 0 }, { 0x0399, 0x0308, 0x0342 }, { 0x03B9, 0x0308, 0x0342 } +"\x1f\xe2\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x03A5, 0x0308, 0x0300 }, { 0x1FE2, 0, 0 }, { 0x03A5, 0x0308, 0x0300 }, { 0x03C5, 0x0308, 0x0300 } +"\x1f\xe3\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x03A5, 0x0308, 0x0301 }, { 0x1FE3, 0, 0 }, { 0x03A5, 0x0308, 0x0301 }, { 0x03C5, 0x0308, 0x0301 } +"\x1f\xe4\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x03A1, 0x0313, 0 }, { 0x1FE4, 0, 0 }, { 0x03A1, 0x0313, 0 }, { 0x03C1, 0x0313, 0 } +"\x1f\xe6\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x03A5, 0x0342, 0 }, { 0x1FE6, 0, 0 }, { 0x03A5, 0x0342, 0 }, { 0x03C5, 0x0342, 0 } +"\x1f\xe7\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x03A5, 0x0308, 0x0342 }, { 0x1FE7, 0, 0 }, { 0x03A5, 0x0308, 0x0342 }, { 0x03C5, 0x0308, 0x0342 } +"\x1f\xf2\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1FFA, 0x0399, 0 }, { 0x1FF2, 0, 0 }, { 0x1FFA, 0x0345, 0 }, { 0x1F7C, 0x03B9, 0 } +"\x1f\xf3\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x03A9, 0x0399, 0 }, { 0x1FF3, 0, 0 }, { 0x1FFC, 0, 0 }, { 0x03C9, 0x03B9, 0 } +"\x1f\xf4\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x038F, 0x0399, 0 }, { 0x1FF4, 0, 0 }, { 0x038F, 0x0345, 0 }, { 0x03CE, 0x03B9, 0 } +"\x1f\xf6\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x03A9, 0x0342, 0 }, { 0x1FF6, 0, 0 }, { 0x03A9, 0x0342, 0 }, { 0x03C9, 0x0342, 0 } +"\x1f\xf7\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x03A9, 0x0342, 0x0399 }, { 0x1FF7, 0, 0 }, { 0x03A9, 0x0342, 0x0345 }, { 0x03C9, 0x0342, 0x03B9 } +"\x1f\xfc\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x03A9, 0x0399, 0 }, { 0x1FF3, 0, 0 }, { 0x1FFC, 0, 0 }, { 0x03C9, 0x03B9, 0 } +"\xfb\x00\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0046, 0x0046, 0 }, { 0xFB00, 0, 0 }, { 0x0046, 0x0066, 0 }, { 0x0066, 0x0066, 0 } +"\xfb\x01\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0046, 0x0049, 0 }, { 0xFB01, 0, 0 }, { 0x0046, 0x0069, 0 }, { 0x0066, 0x0069, 0 } +"\xfb\x02\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0046, 0x004C, 0 }, { 0xFB02, 0, 0 }, { 0x0046, 0x006C, 0 }, { 0x0066, 0x006C, 0 } +"\xfb\x03\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0046, 0x0046, 0x0049 }, { 0xFB03, 0, 0 }, { 0x0046, 0x0066, 0x0069 }, { 0x0066, 0x0066, 0x0069 } +"\xfb\x04\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0046, 0x0046, 0x004C }, { 0xFB04, 0, 0 }, { 0x0046, 0x0066, 0x006C }, { 0x0066, 0x0066, 0x006C } +"\xfb\x05\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0053, 0x0054, 0 }, { 0xFB05, 0, 0 }, { 0x0053, 0x0074, 0 }, { 0x0073, 0x0074, 0 } +"\xfb\x06\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0053, 0x0054, 0 }, { 0xFB06, 0, 0 }, { 0x0053, 0x0074, 0 }, { 0x0073, 0x0074, 0 } +"\xfb\x13\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0544, 0x0546, 0 }, { 0xFB13, 0, 0 }, { 0x0544, 0x0576, 0 }, { 0x0574, 0x0576, 0 } +"\xfb\x14\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0544, 0x0535, 0 }, { 0xFB14, 0, 0 }, { 0x0544, 0x0565, 0 }, { 0x0574, 0x0565, 0 } +"\xfb\x15\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0544, 0x053B, 0 }, { 0xFB15, 0, 0 }, { 0x0544, 0x056B, 0 }, { 0x0574, 0x056B, 0 } +"\xfb\x16\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x054E, 0x0546, 0 }, { 0xFB16, 0, 0 }, { 0x054E, 0x0576, 0 }, { 0x057E, 0x0576, 0 } +"\xfb\x17\x00", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0544, 0x053D, 0 }, { 0xFB17, 0, 0 }, { 0x0544, 0x056D, 0 }, { 0x0574, 0x056D, 0 } diff --git a/lib/unicase/special-casing-table.h b/lib/unicase/special-casing-table.h new file mode 100644 index 00000000..c25bb94f --- /dev/null +++ b/lib/unicase/special-casing-table.h @@ -0,0 +1,339 @@ +/* ANSI-C code produced by gperf version 3.0.4 */ +/* Command-line: gperf -m 10 ./unicase/special-casing-table.gperf */ +/* Computed positions: -k'1-3' */ + + +#define TOTAL_KEYWORDS 122 +#define MIN_WORD_LENGTH 3 +#define MAX_WORD_LENGTH 3 +#define MIN_HASH_VALUE 0 +#define MAX_HASH_VALUE 121 +/* maximum key range = 122, duplicates = 0 */ + +#ifdef __GNUC__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +/*ARGSUSED*/ +static unsigned int +gl_unicase_special_hash (register const char *str, register unsigned int len) +{ + static const unsigned char asso_values[] = + { + 2, 0, 4, 5, 37, 12, 121, 4, 122, 122, + 122, 122, 122, 122, 122, 122, 122, 122, 122, 120, + 119, 118, 117, 116, 122, 122, 122, 122, 122, 122, + 5, 3, 122, 122, 122, 122, 122, 122, 122, 122, + 115, 122, 122, 122, 122, 122, 114, 122, 6, 122, + 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 122, 1, 111, 122, 122, 122, 122, 122, + 109, 122, 108, 122, 107, 122, 106, 122, 122, 122, + 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 122, 122, 122, 33, 122, 122, 122, 122, + 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, + 122, 122, 122, 122, 122, 122, 122, 122, 105, 104, + 103, 102, 101, 100, 99, 31, 98, 97, 96, 95, + 94, 93, 92, 91, 28, 90, 89, 88, 87, 86, + 27, 24, 23, 20, 19, 85, 84, 83, 16, 82, + 81, 80, 79, 15, 78, 77, 76, 75, 74, 73, + 72, 71, 70, 69, 68, 67, 64, 122, 65, 64, + 63, 122, 62, 61, 122, 122, 122, 122, 60, 122, + 122, 122, 122, 122, 59, 58, 57, 122, 56, 55, + 122, 122, 122, 122, 14, 55, 122, 122, 122, 122, + 53, 52, 122, 122, 51, 50, 122, 122, 122, 122, + 122, 122, 122, 50, 122, 122, 48, 47, 46, 122, + 45, 44, 122, 122, 122, 122, 122, 122, 122, 122, + 46, 122, 42, 41, 39, 122, 38, 35, 122, 122, + 122, 0, 33, 122, 122, 122, 122 + }; + return asso_values[(unsigned char)str[2]+1] + asso_values[(unsigned char)str[1]] + asso_values[(unsigned char)str[0]]; +} + +#ifdef __GNUC__ +__inline +#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif +#endif +const struct special_casing_rule * +gl_unicase_special_lookup (register const char *str, register unsigned int len) +{ + static const unsigned char lengthtable[] = + { + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 + }; + static const struct special_casing_rule wordlist[] = + { +#line 126 "./unicase/special-casing-table.gperf" + {"\373\001\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0046, 0x0049, 0 }, { 0xFB01, 0, 0 }, { 0x0046, 0x0069, 0 }, { 0x0066, 0x0069, 0 }}, +#line 31 "./unicase/special-casing-table.gperf" + {"\001I\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x02BC, 0x004E, 0 }, { 0x0149, 0, 0 }, { 0x02BC, 0x004E, 0 }, { 0x02BC, 0x006E, 0 }}, +#line 125 "./unicase/special-casing-table.gperf" + {"\373\000\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0046, 0x0046, 0 }, { 0xFB00, 0, 0 }, { 0x0046, 0x0066, 0 }, { 0x0066, 0x0066, 0 }}, +#line 15 "./unicase/special-casing-table.gperf" + {"\000I\000", 1, SCC_MORE_ABOVE , { 'l', 't' }, { 0x0049, 0, 0 }, { 0x0069, 0x0307, 0 }, { 0x0049, 0, 0 }, { 0x0069, 0, 0 }}, +#line 127 "./unicase/special-casing-table.gperf" + {"\373\002\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0046, 0x004C, 0 }, { 0xFB02, 0, 0 }, { 0x0046, 0x006C, 0 }, { 0x0066, 0x006C, 0 }}, +#line 128 "./unicase/special-casing-table.gperf" + {"\373\003\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0046, 0x0046, 0x0049 }, { 0xFB03, 0, 0 }, { 0x0046, 0x0066, 0x0069 }, { 0x0066, 0x0066, 0x0069 }}, +#line 28 "./unicase/special-casing-table.gperf" + {"\0010\000", 1, SCC_ALWAYS , { 't', 'r' }, { 0x0130, 0, 0 }, { 0x0069, 0, 0 }, { 0x0130, 0, 0 }, { 0x0069, 0, 0 }}, +#line 16 "./unicase/special-casing-table.gperf" + {"\000I\001", 1, -SCC_BEFORE_DOT , { 't', 'r' }, { 0x0049, 0, 0 }, { 0x0131, 0, 0 }, { 0x0049, 0, 0 }, { 0x0131, 0, 0 }}, +#line 17 "./unicase/special-casing-table.gperf" + {"\000I\002", 1, -SCC_BEFORE_DOT , { 'a', 'z' }, { 0x0049, 0, 0 }, { 0x0131, 0, 0 }, { 0x0049, 0, 0 }, { 0x0131, 0, 0 }}, +#line 33 "./unicase/special-casing-table.gperf" + {"\003\007\000", 1, SCC_AFTER_SOFT_DOTTED, { 'l', 't' }, { 0, 0, 0 }, { 0x0307, 0, 0 }, { 0, 0, 0 }, { 0x0307, 0, 0 }}, +#line 29 "./unicase/special-casing-table.gperf" + {"\0010\001", 1, SCC_ALWAYS , { 'a', 'z' }, { 0x0130, 0, 0 }, { 0x0069, 0, 0 }, { 0x0130, 0, 0 }, { 0x0069, 0, 0 }}, +#line 30 "./unicase/special-casing-table.gperf" + {"\0010\002", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0130, 0, 0 }, { 0x0069, 0x0307, 0 }, { 0x0130, 0, 0 }, { 0x0069, 0x0307, 0 }}, +#line 130 "./unicase/special-casing-table.gperf" + {"\373\005\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0053, 0x0054, 0 }, { 0xFB05, 0, 0 }, { 0x0053, 0x0074, 0 }, { 0x0073, 0x0074, 0 }}, +#line 34 "./unicase/special-casing-table.gperf" + {"\003\007\001", 1, SCC_AFTER_I , { 't', 'r' }, { 0x0307, 0, 0 }, { 0, 0, 0 }, { 0x0307, 0, 0 }, { 0x0307, 0, 0 }}, +#line 35 "./unicase/special-casing-table.gperf" + {"\003\007\002", 0, SCC_AFTER_I , { 'a', 'z' }, { 0x0307, 0, 0 }, { 0, 0, 0 }, { 0x0307, 0, 0 }, { 0x0307, 0, 0 }}, +#line 19 "./unicase/special-casing-table.gperf" + {"\000I\004", 0, SCC_ALWAYS , { 'a', 'z' }, { 0x0049, 0, 0 }, { 0x0069, 0, 0 }, { 0x0049, 0, 0 }, { 0x0131, 0, 0 }}, +#line 23 "./unicase/special-casing-table.gperf" + {"\000\314\000", 0, SCC_ALWAYS , { 'l', 't' }, { 0x00CC, 0, 0 }, { 0x0069, 0x0307, 0x0300 }, { 0x00CC, 0, 0 }, { 0x00EC, 0, 0 }}, +#line 109 "./unicase/special-casing-table.gperf" + {"\037\314\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0397, 0x0399, 0 }, { 0x1FC3, 0, 0 }, { 0x1FCC, 0, 0 }, { 0x03B7, 0x03B9, 0 }}, +#line 85 "./unicase/special-casing-table.gperf" + {"\037\243\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F6B, 0x0399, 0 }, { 0x1FA3, 0, 0 }, { 0x1FAB, 0, 0 }, { 0x1F63, 0x03B9, 0 }}, +#line 80 "./unicase/special-casing-table.gperf" + {"\037\236\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F2E, 0x0399, 0 }, { 0x1F96, 0, 0 }, { 0x1F9E, 0, 0 }, { 0x1F26, 0x03B9, 0 }}, +#line 37 "./unicase/special-casing-table.gperf" + {"\003\243\000", 0, SCC_FINAL_SIGMA , { '\0', '\0' }, { 0x03A3, 0, 0 }, { 0x03C2, 0, 0 }, { 0x03A3, 0, 0 }, { 0x03C3, 0, 0 }}, +#line 45 "./unicase/special-casing-table.gperf" + {"\036\236\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1E9E, 0, 0 }, { 0x00DF, 0, 0 }, { 0x1E9E, 0, 0 }, { 0x0073, 0x0073, 0 }}, +#line 76 "./unicase/special-casing-table.gperf" + {"\037\232\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F2A, 0x0399, 0 }, { 0x1F92, 0, 0 }, { 0x1F9A, 0, 0 }, { 0x1F22, 0x03B9, 0 }}, +#line 75 "./unicase/special-casing-table.gperf" + {"\037\231\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F29, 0x0399, 0 }, { 0x1F91, 0, 0 }, { 0x1F99, 0, 0 }, { 0x1F21, 0x03B9, 0 }}, +#line 44 "./unicase/special-casing-table.gperf" + {"\036\232\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0041, 0x02BE, 0 }, { 0x1E9A, 0, 0 }, { 0x0041, 0x02BE, 0 }, { 0x0061, 0x02BE, 0 }}, +#line 43 "./unicase/special-casing-table.gperf" + {"\036\231\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0059, 0x030A, 0 }, { 0x1E99, 0, 0 }, { 0x0059, 0x030A, 0 }, { 0x0079, 0x030A, 0 }}, +#line 74 "./unicase/special-casing-table.gperf" + {"\037\230\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F28, 0x0399, 0 }, { 0x1F90, 0, 0 }, { 0x1F98, 0, 0 }, { 0x1F20, 0x03B9, 0 }}, +#line 73 "./unicase/special-casing-table.gperf" + {"\037\227\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F2F, 0x0399, 0 }, { 0x1F97, 0, 0 }, { 0x1F9F, 0, 0 }, { 0x1F27, 0x03B9, 0 }}, +#line 42 "./unicase/special-casing-table.gperf" + {"\036\230\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0057, 0x030A, 0 }, { 0x1E98, 0, 0 }, { 0x0057, 0x030A, 0 }, { 0x0077, 0x030A, 0 }}, +#line 41 "./unicase/special-casing-table.gperf" + {"\036\227\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0054, 0x0308, 0 }, { 0x1E97, 0, 0 }, { 0x0054, 0x0308, 0 }, { 0x0074, 0x0308, 0 }}, +#line 72 "./unicase/special-casing-table.gperf" + {"\037\226\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F2E, 0x0399, 0 }, { 0x1F96, 0, 0 }, { 0x1F9E, 0, 0 }, { 0x1F26, 0x03B9, 0 }}, +#line 66 "./unicase/special-casing-table.gperf" + {"\037\220\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F28, 0x0399, 0 }, { 0x1F90, 0, 0 }, { 0x1F98, 0, 0 }, { 0x1F20, 0x03B9, 0 }}, +#line 40 "./unicase/special-casing-table.gperf" + {"\036\226\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0048, 0x0331, 0 }, { 0x1E96, 0, 0 }, { 0x0048, 0x0331, 0 }, { 0x0068, 0x0331, 0 }}, +#line 36 "./unicase/special-casing-table.gperf" + {"\003\220\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0399, 0x0308, 0x0301 }, { 0x0390, 0, 0 }, { 0x0399, 0x0308, 0x0301 }, { 0x03B9, 0x0308, 0x0301 }}, +#line 57 "./unicase/special-casing-table.gperf" + {"\037\207\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F0F, 0x0399, 0 }, { 0x1F87, 0, 0 }, { 0x1F8F, 0, 0 }, { 0x1F07, 0x03B9, 0 }}, +#line 21 "./unicase/special-casing-table.gperf" + {"\000i\000", 1, SCC_ALWAYS , { 't', 'r' }, { 0x0130, 0, 0 }, { 0x0069, 0, 0 }, { 0x0130, 0, 0 }, { 0x0069, 0, 0 }}, +#line 124 "./unicase/special-casing-table.gperf" + {"\037\374\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x03A9, 0x0399, 0 }, { 0x1FF3, 0, 0 }, { 0x1FFC, 0, 0 }, { 0x03C9, 0x03B9, 0 }}, +#line 129 "./unicase/special-casing-table.gperf" + {"\373\004\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0046, 0x0046, 0x004C }, { 0xFB04, 0, 0 }, { 0x0046, 0x0066, 0x006C }, { 0x0066, 0x0066, 0x006C }}, +#line 123 "./unicase/special-casing-table.gperf" + {"\037\367\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x03A9, 0x0342, 0x0399 }, { 0x1FF7, 0, 0 }, { 0x03A9, 0x0342, 0x0345 }, { 0x03C9, 0x0342, 0x03B9 }}, +#line 22 "./unicase/special-casing-table.gperf" + {"\000i\001", 0, SCC_ALWAYS , { 'a', 'z' }, { 0x0130, 0, 0 }, { 0x0069, 0, 0 }, { 0x0130, 0, 0 }, { 0x0069, 0, 0 }}, +#line 18 "./unicase/special-casing-table.gperf" + {"\000I\003", 1, SCC_ALWAYS , { 't', 'r' }, { 0x0049, 0, 0 }, { 0x0069, 0, 0 }, { 0x0049, 0, 0 }, { 0x0131, 0, 0 }}, +#line 122 "./unicase/special-casing-table.gperf" + {"\037\366\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x03A9, 0x0342, 0 }, { 0x1FF6, 0, 0 }, { 0x03A9, 0x0342, 0 }, { 0x03C9, 0x0342, 0 }}, +#line 121 "./unicase/special-casing-table.gperf" + {"\037\364\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x038F, 0x0399, 0 }, { 0x1FF4, 0, 0 }, { 0x038F, 0x0345, 0 }, { 0x03CE, 0x03B9, 0 }}, +#line 39 "./unicase/special-casing-table.gperf" + {"\005\207\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0535, 0x0552, 0 }, { 0x0587, 0, 0 }, { 0x0535, 0x0582, 0 }, { 0x0565, 0x0582, 0 }}, +#line 120 "./unicase/special-casing-table.gperf" + {"\037\363\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x03A9, 0x0399, 0 }, { 0x1FF3, 0, 0 }, { 0x1FFC, 0, 0 }, { 0x03C9, 0x03B9, 0 }}, +#line 119 "./unicase/special-casing-table.gperf" + {"\037\362\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1FFA, 0x0399, 0 }, { 0x1FF2, 0, 0 }, { 0x1FFA, 0x0345, 0 }, { 0x1F7C, 0x03B9, 0 }}, +#line 32 "./unicase/special-casing-table.gperf" + {"\001\360\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x004A, 0x030C, 0 }, { 0x01F0, 0, 0 }, { 0x004A, 0x030C, 0 }, { 0x006A, 0x030C, 0 }}, +#line 118 "./unicase/special-casing-table.gperf" + {"\037\347\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x03A5, 0x0308, 0x0342 }, { 0x1FE7, 0, 0 }, { 0x03A5, 0x0308, 0x0342 }, { 0x03C5, 0x0308, 0x0342 }}, +#line 117 "./unicase/special-casing-table.gperf" + {"\037\346\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x03A5, 0x0342, 0 }, { 0x1FE6, 0, 0 }, { 0x03A5, 0x0342, 0 }, { 0x03C5, 0x0342, 0 }}, +#line 116 "./unicase/special-casing-table.gperf" + {"\037\344\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x03A1, 0x0313, 0 }, { 0x1FE4, 0, 0 }, { 0x03A1, 0x0313, 0 }, { 0x03C1, 0x0313, 0 }}, +#line 115 "./unicase/special-casing-table.gperf" + {"\037\343\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x03A5, 0x0308, 0x0301 }, { 0x1FE3, 0, 0 }, { 0x03A5, 0x0308, 0x0301 }, { 0x03C5, 0x0308, 0x0301 }}, +#line 114 "./unicase/special-casing-table.gperf" + {"\037\342\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x03A5, 0x0308, 0x0300 }, { 0x1FE2, 0, 0 }, { 0x03A5, 0x0308, 0x0300 }, { 0x03C5, 0x0308, 0x0300 }}, +#line 25 "./unicase/special-casing-table.gperf" + {"\000\337\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0053, 0x0053, 0 }, { 0x00DF, 0, 0 }, { 0x0053, 0x0073, 0 }, { 0x0073, 0x0073, 0 }}, +#line 113 "./unicase/special-casing-table.gperf" + {"\037\327\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0399, 0x0308, 0x0342 }, { 0x1FD7, 0, 0 }, { 0x0399, 0x0308, 0x0342 }, { 0x03B9, 0x0308, 0x0342 }}, +#line 112 "./unicase/special-casing-table.gperf" + {"\037\326\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0399, 0x0342, 0 }, { 0x1FD6, 0, 0 }, { 0x0399, 0x0342, 0 }, { 0x03B9, 0x0342, 0 }}, +#line 111 "./unicase/special-casing-table.gperf" + {"\037\323\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0399, 0x0308, 0x0301 }, { 0x1FD3, 0, 0 }, { 0x0399, 0x0308, 0x0301 }, { 0x03B9, 0x0308, 0x0301 }}, +#line 110 "./unicase/special-casing-table.gperf" + {"\037\322\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0399, 0x0308, 0x0300 }, { 0x1FD2, 0, 0 }, { 0x0399, 0x0308, 0x0300 }, { 0x03B9, 0x0308, 0x0300 }}, +#line 24 "./unicase/special-casing-table.gperf" + {"\000\315\000", 0, SCC_ALWAYS , { 'l', 't' }, { 0x00CD, 0, 0 }, { 0x0069, 0x0307, 0x0301 }, { 0x00CD, 0, 0 }, { 0x00ED, 0, 0 }}, +#line 108 "./unicase/special-casing-table.gperf" + {"\037\307\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0397, 0x0342, 0x0399 }, { 0x1FC7, 0, 0 }, { 0x0397, 0x0342, 0x0345 }, { 0x03B7, 0x0342, 0x03B9 }}, +#line 107 "./unicase/special-casing-table.gperf" + {"\037\306\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0397, 0x0342, 0 }, { 0x1FC6, 0, 0 }, { 0x0397, 0x0342, 0 }, { 0x03B7, 0x0342, 0 }}, +#line 106 "./unicase/special-casing-table.gperf" + {"\037\304\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0389, 0x0399, 0 }, { 0x1FC4, 0, 0 }, { 0x0389, 0x0345, 0 }, { 0x03AE, 0x03B9, 0 }}, +#line 105 "./unicase/special-casing-table.gperf" + {"\037\303\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0397, 0x0399, 0 }, { 0x1FC3, 0, 0 }, { 0x1FCC, 0, 0 }, { 0x03B7, 0x03B9, 0 }}, +#line 104 "./unicase/special-casing-table.gperf" + {"\037\302\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1FCA, 0x0399, 0 }, { 0x1FC2, 0, 0 }, { 0x1FCA, 0x0345, 0 }, { 0x1F74, 0x03B9, 0 }}, +#line 103 "./unicase/special-casing-table.gperf" + {"\037\274\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0391, 0x0399, 0 }, { 0x1FB3, 0, 0 }, { 0x1FBC, 0, 0 }, { 0x03B1, 0x03B9, 0 }}, +#line 102 "./unicase/special-casing-table.gperf" + {"\037\267\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0391, 0x0342, 0x0399 }, { 0x1FB7, 0, 0 }, { 0x0391, 0x0342, 0x0345 }, { 0x03B1, 0x0342, 0x03B9 }}, +#line 101 "./unicase/special-casing-table.gperf" + {"\037\266\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0391, 0x0342, 0 }, { 0x1FB6, 0, 0 }, { 0x0391, 0x0342, 0 }, { 0x03B1, 0x0342, 0 }}, +#line 100 "./unicase/special-casing-table.gperf" + {"\037\264\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0386, 0x0399, 0 }, { 0x1FB4, 0, 0 }, { 0x0386, 0x0345, 0 }, { 0x03AC, 0x03B9, 0 }}, +#line 99 "./unicase/special-casing-table.gperf" + {"\037\263\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0391, 0x0399, 0 }, { 0x1FB3, 0, 0 }, { 0x1FBC, 0, 0 }, { 0x03B1, 0x03B9, 0 }}, +#line 98 "./unicase/special-casing-table.gperf" + {"\037\262\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1FBA, 0x0399, 0 }, { 0x1FB2, 0, 0 }, { 0x1FBA, 0x0345, 0 }, { 0x1F70, 0x03B9, 0 }}, +#line 38 "./unicase/special-casing-table.gperf" + {"\003\260\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x03A5, 0x0308, 0x0301 }, { 0x03B0, 0, 0 }, { 0x03A5, 0x0308, 0x0301 }, { 0x03C5, 0x0308, 0x0301 }}, +#line 97 "./unicase/special-casing-table.gperf" + {"\037\257\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F6F, 0x0399, 0 }, { 0x1FA7, 0, 0 }, { 0x1FAF, 0, 0 }, { 0x1F67, 0x03B9, 0 }}, +#line 96 "./unicase/special-casing-table.gperf" + {"\037\256\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F6E, 0x0399, 0 }, { 0x1FA6, 0, 0 }, { 0x1FAE, 0, 0 }, { 0x1F66, 0x03B9, 0 }}, +#line 95 "./unicase/special-casing-table.gperf" + {"\037\255\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F6D, 0x0399, 0 }, { 0x1FA5, 0, 0 }, { 0x1FAD, 0, 0 }, { 0x1F65, 0x03B9, 0 }}, +#line 94 "./unicase/special-casing-table.gperf" + {"\037\254\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F6C, 0x0399, 0 }, { 0x1FA4, 0, 0 }, { 0x1FAC, 0, 0 }, { 0x1F64, 0x03B9, 0 }}, +#line 93 "./unicase/special-casing-table.gperf" + {"\037\253\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F6B, 0x0399, 0 }, { 0x1FA3, 0, 0 }, { 0x1FAB, 0, 0 }, { 0x1F63, 0x03B9, 0 }}, +#line 92 "./unicase/special-casing-table.gperf" + {"\037\252\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F6A, 0x0399, 0 }, { 0x1FA2, 0, 0 }, { 0x1FAA, 0, 0 }, { 0x1F62, 0x03B9, 0 }}, +#line 91 "./unicase/special-casing-table.gperf" + {"\037\251\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F69, 0x0399, 0 }, { 0x1FA1, 0, 0 }, { 0x1FA9, 0, 0 }, { 0x1F61, 0x03B9, 0 }}, +#line 90 "./unicase/special-casing-table.gperf" + {"\037\250\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F68, 0x0399, 0 }, { 0x1FA0, 0, 0 }, { 0x1FA8, 0, 0 }, { 0x1F60, 0x03B9, 0 }}, +#line 89 "./unicase/special-casing-table.gperf" + {"\037\247\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F6F, 0x0399, 0 }, { 0x1FA7, 0, 0 }, { 0x1FAF, 0, 0 }, { 0x1F67, 0x03B9, 0 }}, +#line 88 "./unicase/special-casing-table.gperf" + {"\037\246\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F6E, 0x0399, 0 }, { 0x1FA6, 0, 0 }, { 0x1FAE, 0, 0 }, { 0x1F66, 0x03B9, 0 }}, +#line 87 "./unicase/special-casing-table.gperf" + {"\037\245\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F6D, 0x0399, 0 }, { 0x1FA5, 0, 0 }, { 0x1FAD, 0, 0 }, { 0x1F65, 0x03B9, 0 }}, +#line 86 "./unicase/special-casing-table.gperf" + {"\037\244\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F6C, 0x0399, 0 }, { 0x1FA4, 0, 0 }, { 0x1FAC, 0, 0 }, { 0x1F64, 0x03B9, 0 }}, +#line 84 "./unicase/special-casing-table.gperf" + {"\037\242\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F6A, 0x0399, 0 }, { 0x1FA2, 0, 0 }, { 0x1FAA, 0, 0 }, { 0x1F62, 0x03B9, 0 }}, +#line 83 "./unicase/special-casing-table.gperf" + {"\037\241\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F69, 0x0399, 0 }, { 0x1FA1, 0, 0 }, { 0x1FA9, 0, 0 }, { 0x1F61, 0x03B9, 0 }}, +#line 82 "./unicase/special-casing-table.gperf" + {"\037\240\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F68, 0x0399, 0 }, { 0x1FA0, 0, 0 }, { 0x1FA8, 0, 0 }, { 0x1F60, 0x03B9, 0 }}, +#line 81 "./unicase/special-casing-table.gperf" + {"\037\237\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F2F, 0x0399, 0 }, { 0x1F97, 0, 0 }, { 0x1F9F, 0, 0 }, { 0x1F27, 0x03B9, 0 }}, +#line 79 "./unicase/special-casing-table.gperf" + {"\037\235\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F2D, 0x0399, 0 }, { 0x1F95, 0, 0 }, { 0x1F9D, 0, 0 }, { 0x1F25, 0x03B9, 0 }}, +#line 78 "./unicase/special-casing-table.gperf" + {"\037\234\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F2C, 0x0399, 0 }, { 0x1F94, 0, 0 }, { 0x1F9C, 0, 0 }, { 0x1F24, 0x03B9, 0 }}, +#line 77 "./unicase/special-casing-table.gperf" + {"\037\233\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F2B, 0x0399, 0 }, { 0x1F93, 0, 0 }, { 0x1F9B, 0, 0 }, { 0x1F23, 0x03B9, 0 }}, +#line 71 "./unicase/special-casing-table.gperf" + {"\037\225\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F2D, 0x0399, 0 }, { 0x1F95, 0, 0 }, { 0x1F9D, 0, 0 }, { 0x1F25, 0x03B9, 0 }}, +#line 70 "./unicase/special-casing-table.gperf" + {"\037\224\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F2C, 0x0399, 0 }, { 0x1F94, 0, 0 }, { 0x1F9C, 0, 0 }, { 0x1F24, 0x03B9, 0 }}, +#line 69 "./unicase/special-casing-table.gperf" + {"\037\223\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F2B, 0x0399, 0 }, { 0x1F93, 0, 0 }, { 0x1F9B, 0, 0 }, { 0x1F23, 0x03B9, 0 }}, +#line 68 "./unicase/special-casing-table.gperf" + {"\037\222\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F2A, 0x0399, 0 }, { 0x1F92, 0, 0 }, { 0x1F9A, 0, 0 }, { 0x1F22, 0x03B9, 0 }}, +#line 67 "./unicase/special-casing-table.gperf" + {"\037\221\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F29, 0x0399, 0 }, { 0x1F91, 0, 0 }, { 0x1F99, 0, 0 }, { 0x1F21, 0x03B9, 0 }}, +#line 65 "./unicase/special-casing-table.gperf" + {"\037\217\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F0F, 0x0399, 0 }, { 0x1F87, 0, 0 }, { 0x1F8F, 0, 0 }, { 0x1F07, 0x03B9, 0 }}, +#line 64 "./unicase/special-casing-table.gperf" + {"\037\216\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F0E, 0x0399, 0 }, { 0x1F86, 0, 0 }, { 0x1F8E, 0, 0 }, { 0x1F06, 0x03B9, 0 }}, +#line 63 "./unicase/special-casing-table.gperf" + {"\037\215\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F0D, 0x0399, 0 }, { 0x1F85, 0, 0 }, { 0x1F8D, 0, 0 }, { 0x1F05, 0x03B9, 0 }}, +#line 62 "./unicase/special-casing-table.gperf" + {"\037\214\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F0C, 0x0399, 0 }, { 0x1F84, 0, 0 }, { 0x1F8C, 0, 0 }, { 0x1F04, 0x03B9, 0 }}, +#line 61 "./unicase/special-casing-table.gperf" + {"\037\213\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F0B, 0x0399, 0 }, { 0x1F83, 0, 0 }, { 0x1F8B, 0, 0 }, { 0x1F03, 0x03B9, 0 }}, +#line 60 "./unicase/special-casing-table.gperf" + {"\037\212\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F0A, 0x0399, 0 }, { 0x1F82, 0, 0 }, { 0x1F8A, 0, 0 }, { 0x1F02, 0x03B9, 0 }}, +#line 59 "./unicase/special-casing-table.gperf" + {"\037\211\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F09, 0x0399, 0 }, { 0x1F81, 0, 0 }, { 0x1F89, 0, 0 }, { 0x1F01, 0x03B9, 0 }}, +#line 58 "./unicase/special-casing-table.gperf" + {"\037\210\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F08, 0x0399, 0 }, { 0x1F80, 0, 0 }, { 0x1F88, 0, 0 }, { 0x1F00, 0x03B9, 0 }}, +#line 56 "./unicase/special-casing-table.gperf" + {"\037\206\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F0E, 0x0399, 0 }, { 0x1F86, 0, 0 }, { 0x1F8E, 0, 0 }, { 0x1F06, 0x03B9, 0 }}, +#line 55 "./unicase/special-casing-table.gperf" + {"\037\205\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F0D, 0x0399, 0 }, { 0x1F85, 0, 0 }, { 0x1F8D, 0, 0 }, { 0x1F05, 0x03B9, 0 }}, +#line 54 "./unicase/special-casing-table.gperf" + {"\037\204\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F0C, 0x0399, 0 }, { 0x1F84, 0, 0 }, { 0x1F8C, 0, 0 }, { 0x1F04, 0x03B9, 0 }}, +#line 53 "./unicase/special-casing-table.gperf" + {"\037\203\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F0B, 0x0399, 0 }, { 0x1F83, 0, 0 }, { 0x1F8B, 0, 0 }, { 0x1F03, 0x03B9, 0 }}, +#line 52 "./unicase/special-casing-table.gperf" + {"\037\202\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F0A, 0x0399, 0 }, { 0x1F82, 0, 0 }, { 0x1F8A, 0, 0 }, { 0x1F02, 0x03B9, 0 }}, +#line 51 "./unicase/special-casing-table.gperf" + {"\037\201\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F09, 0x0399, 0 }, { 0x1F81, 0, 0 }, { 0x1F89, 0, 0 }, { 0x1F01, 0x03B9, 0 }}, +#line 50 "./unicase/special-casing-table.gperf" + {"\037\200\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x1F08, 0x0399, 0 }, { 0x1F80, 0, 0 }, { 0x1F88, 0, 0 }, { 0x1F00, 0x03B9, 0 }}, +#line 49 "./unicase/special-casing-table.gperf" + {"\037V\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x03A5, 0x0313, 0x0342 }, { 0x1F56, 0, 0 }, { 0x03A5, 0x0313, 0x0342 }, { 0x03C5, 0x0313, 0x0342 }}, +#line 48 "./unicase/special-casing-table.gperf" + {"\037T\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x03A5, 0x0313, 0x0301 }, { 0x1F54, 0, 0 }, { 0x03A5, 0x0313, 0x0301 }, { 0x03C5, 0x0313, 0x0301 }}, +#line 47 "./unicase/special-casing-table.gperf" + {"\037R\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x03A5, 0x0313, 0x0300 }, { 0x1F52, 0, 0 }, { 0x03A5, 0x0313, 0x0300 }, { 0x03C5, 0x0313, 0x0300 }}, +#line 46 "./unicase/special-casing-table.gperf" + {"\037P\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x03A5, 0x0313, 0 }, { 0x1F50, 0, 0 }, { 0x03A5, 0x0313, 0 }, { 0x03C5, 0x0313, 0 }}, +#line 20 "./unicase/special-casing-table.gperf" + {"\000J\000", 0, SCC_MORE_ABOVE , { 'l', 't' }, { 0x004A, 0, 0 }, { 0x006A, 0x0307, 0 }, { 0x004A, 0, 0 }, { 0x006A, 0, 0 }}, +#line 27 "./unicase/special-casing-table.gperf" + {"\001.\000", 0, SCC_MORE_ABOVE , { 'l', 't' }, { 0x012E, 0, 0 }, { 0x012F, 0x0307, 0 }, { 0x012E, 0, 0 }, { 0x012F, 0, 0 }}, +#line 26 "./unicase/special-casing-table.gperf" + {"\001(\000", 0, SCC_ALWAYS , { 'l', 't' }, { 0x0128, 0, 0 }, { 0x0069, 0x0307, 0x0303 }, { 0x0128, 0, 0 }, { 0x0129, 0, 0 }}, +#line 136 "./unicase/special-casing-table.gperf" + {"\373\027\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0544, 0x053D, 0 }, { 0xFB17, 0, 0 }, { 0x0544, 0x056D, 0 }, { 0x0574, 0x056D, 0 }}, +#line 135 "./unicase/special-casing-table.gperf" + {"\373\026\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x054E, 0x0546, 0 }, { 0xFB16, 0, 0 }, { 0x054E, 0x0576, 0 }, { 0x057E, 0x0576, 0 }}, +#line 134 "./unicase/special-casing-table.gperf" + {"\373\025\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0544, 0x053B, 0 }, { 0xFB15, 0, 0 }, { 0x0544, 0x056B, 0 }, { 0x0574, 0x056B, 0 }}, +#line 133 "./unicase/special-casing-table.gperf" + {"\373\024\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0544, 0x0535, 0 }, { 0xFB14, 0, 0 }, { 0x0544, 0x0565, 0 }, { 0x0574, 0x0565, 0 }}, +#line 132 "./unicase/special-casing-table.gperf" + {"\373\023\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0544, 0x0546, 0 }, { 0xFB13, 0, 0 }, { 0x0544, 0x0576, 0 }, { 0x0574, 0x0576, 0 }}, +#line 131 "./unicase/special-casing-table.gperf" + {"\373\006\000", 0, SCC_ALWAYS , { '\0', '\0' }, { 0x0053, 0x0054, 0 }, { 0xFB06, 0, 0 }, { 0x0053, 0x0074, 0 }, { 0x0073, 0x0074, 0 }} + }; + + if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) + { + register int key = gl_unicase_special_hash (str, len); + + if (key <= MAX_HASH_VALUE && key >= 0) + if (len == lengthtable[key]) + { + register const char *s = wordlist[key].code; + + if (*str == *s && !memcmp (str + 1, s + 1, len - 1)) + return &wordlist[key]; + } + } + return 0; +} diff --git a/lib/unicase/special-casing.c b/lib/unicase/special-casing.c new file mode 100644 index 00000000..9cc207c6 --- /dev/null +++ b/lib/unicase/special-casing.c @@ -0,0 +1,25 @@ +/* Special casing table. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "special-casing.h" + +#include + +#include "unicase/special-casing-table.h" diff --git a/lib/unicase/special-casing.h b/lib/unicase/special-casing.h new file mode 100644 index 00000000..ab88b84d --- /dev/null +++ b/lib/unicase/special-casing.h @@ -0,0 +1,60 @@ +/* Special casing table. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 . */ + + +/* A special casing context. + A context is negated through x -> -x. */ +enum +{ + SCC_ALWAYS = 0, + SCC_FINAL_SIGMA = 1, + SCC_AFTER_SOFT_DOTTED = 2, + SCC_MORE_ABOVE = 3, + SCC_BEFORE_DOT = 4, + SCC_AFTER_I = 5 +}; + +struct special_casing_rule +{ + /* The first two bytes are the code, in big-endian order. The third byte + only distinguishes different rules pertaining to the same code. */ + /*unsigned*/ char code[3]; + + /* True when this rule is not the last one for the given code. */ + /*bool*/ unsigned int has_next : 1; + + /* Context. */ + signed int context : 7; + + /* Language, or an empty string. */ + char language[2]; + + /* Mapping to upper case. Between 0 and 3 characters. Filled with 0s. */ + unsigned short upper[3]; + + /* Mapping to lower case. Between 0 and 3 characters. Filled with 0s. */ + unsigned short lower[3]; + + /* Mapping to title case. Between 0 and 3 characters. Filled with 0s. */ + unsigned short title[3]; + + /* Casefolding mapping. Between 0 and 3 characters. Filled with 0s. */ + unsigned short casefold[3]; +}; + +extern const struct special_casing_rule * + gl_unicase_special_lookup (const char *str, unsigned int len); diff --git a/lib/unicase/tocasefold.c b/lib/unicase/tocasefold.c new file mode 100644 index 00000000..752ba60a --- /dev/null +++ b/lib/unicase/tocasefold.c @@ -0,0 +1,27 @@ +/* Casefold mapping for Unicode characters (locale and context independent). + Copyright (C) 2002, 2006, 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "casefold.h" + +/* Define u_mapping table. */ +#include "tocasefold.h" + +#define FUNC uc_tocasefold +#include "simple-mapping.h" diff --git a/lib/unicase/tocasefold.h b/lib/unicase/tocasefold.h new file mode 100644 index 00000000..59f26814 --- /dev/null +++ b/lib/unicase/tocasefold.h @@ -0,0 +1,567 @@ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +/* Simple character mapping of Unicode characters. */ +/* Generated automatically by gen-case.c for Unicode 5.1.0. */ +#define mapping_header_0 16 +#define mapping_header_1 2 +#define mapping_header_2 7 +#define mapping_header_3 511 +#define mapping_header_4 127 +static const +struct + { + int level1[2]; + short level2[2 << 9]; + int level3[26 << 7]; + } +u_mapping = +{ + { 0, 512 }, + { + 0, 128, 256, 384, 512, -1, 640, 768, + 896, 1024, 1152, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, 1280, -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, 1408, 1536, 1664, 1792, + -1, -1, 1920, 2048, -1, -1, -1, -1, + -1, 2176, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + 2304, 2432, -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, -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, + -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, 2560, 2688, 2816, 2944, + -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, -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, 3072, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + 3200, -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, + -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, -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, -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, -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 + }, + { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 775, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 0, + 32, 32, 32, 32, 32, 32, 32, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 0, 0, 1, 0, 1, 0, 1, 0, + 0, 1, 0, 1, 0, 1, 0, 1, + 0, 1, 0, 1, 0, 1, 0, 1, + 0, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + -121, 1, 0, 1, 0, 1, 0, -268, + 0, 210, 1, 0, 1, 0, 206, 1, + 0, 205, 205, 1, 0, 0, 79, 202, + 203, 1, 0, 205, 207, 0, 211, 209, + 1, 0, 0, 0, 211, 213, 0, 214, + 1, 0, 1, 0, 1, 0, 218, 1, + 0, 218, 0, 0, 1, 0, 218, 1, + 0, 217, 217, 1, 0, 1, 0, 219, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 2, 1, 0, 2, + 1, 0, 2, 1, 0, 1, 0, 1, + 0, 1, 0, 1, 0, 1, 0, 1, + 0, 1, 0, 1, 0, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 0, 2, 1, 0, 1, 0, -97, -56, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + -130, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 10795, 1, 0, -163, 10792, 0, + 0, 1, 0, -195, 69, 71, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 116, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 38, 0, + 37, 37, 37, 0, 64, 0, 63, 63, + 0, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 0, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 8, + -30, -25, 0, 0, 0, -15, -22, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + -54, -48, 0, 0, -60, -64, 0, 1, + 0, -7, 1, 0, 0, -130, -130, -130, + 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, + 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 15, 1, 0, 1, 0, 1, 0, 1, + 0, 1, 0, 1, 0, 1, 0, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7264, 7264, 7264, 7264, 7264, 7264, 7264, 7264, + 7264, 7264, 7264, 7264, 7264, 7264, 7264, 7264, + 7264, 7264, 7264, 7264, 7264, 7264, 7264, 7264, + 7264, 7264, 7264, 7264, 7264, 7264, 7264, 7264, + 7264, 7264, 7264, 7264, 7264, 7264, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, -58, 0, 0, 0, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -8, -8, -8, -8, -8, -8, -8, -8, + 0, 0, 0, 0, 0, 0, 0, 0, + -8, -8, -8, -8, -8, -8, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -8, -8, -8, -8, -8, -8, -8, -8, + 0, 0, 0, 0, 0, 0, 0, 0, + -8, -8, -8, -8, -8, -8, -8, -8, + 0, 0, 0, 0, 0, 0, 0, 0, + -8, -8, -8, -8, -8, -8, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -8, 0, -8, 0, -8, 0, -8, + 0, 0, 0, 0, 0, 0, 0, 0, + -8, -8, -8, -8, -8, -8, -8, -8, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -8, -8, -74, -74, 0, 0, -7173, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -86, -86, -86, -86, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -8, -8, -100, -100, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -8, -8, -112, -112, -7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -128, -128, -126, -126, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, -7517, 0, + 0, 0, -8383, -8262, 0, 0, 0, 0, + 0, 0, 28, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, -10743, -3814, -10727, 0, 0, 1, + 0, 1, 0, 1, 0, -10780, -10749, -10783, + 0, 0, 1, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 0, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 0, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 0, 1, 0, -35332, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 + } +}; diff --git a/lib/unicase/tolower.c b/lib/unicase/tolower.c new file mode 100644 index 00000000..5ed0c6d2 --- /dev/null +++ b/lib/unicase/tolower.c @@ -0,0 +1,27 @@ +/* Lowercase mapping for Unicode characters (locale and context independent). + Copyright (C) 2002, 2006, 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +/* Define u_mapping table. */ +#include "tolower.h" + +#define FUNC uc_tolower +#include "simple-mapping.h" diff --git a/lib/unicase/tolower.h b/lib/unicase/tolower.h new file mode 100644 index 00000000..e7b4b293 --- /dev/null +++ b/lib/unicase/tolower.h @@ -0,0 +1,567 @@ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +/* Simple character mapping of Unicode characters. */ +/* Generated automatically by gen-case.c for Unicode 5.1.0. */ +#define mapping_header_0 16 +#define mapping_header_1 2 +#define mapping_header_2 7 +#define mapping_header_3 511 +#define mapping_header_4 127 +static const +struct + { + int level1[2]; + short level2[2 << 9]; + int level3[26 << 7]; + } +u_mapping = +{ + { 0, 512 }, + { + 0, 128, 256, 384, 512, -1, 640, 768, + 896, 1024, 1152, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + -1, 1280, -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, 1408, 1536, 1664, 1792, + -1, -1, 1920, 2048, -1, -1, -1, -1, + -1, 2176, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + 2304, 2432, -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, -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, + -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, 2560, 2688, 2816, 2944, + -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, -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, 3072, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + 3200, -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, + -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, -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, -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, -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 + }, + { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 0, + 32, 32, 32, 32, 32, 32, 32, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + -199, 0, 1, 0, 1, 0, 1, 0, + 0, 1, 0, 1, 0, 1, 0, 1, + 0, 1, 0, 1, 0, 1, 0, 1, + 0, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + -121, 1, 0, 1, 0, 1, 0, 0, + 0, 210, 1, 0, 1, 0, 206, 1, + 0, 205, 205, 1, 0, 0, 79, 202, + 203, 1, 0, 205, 207, 0, 211, 209, + 1, 0, 0, 0, 211, 213, 0, 214, + 1, 0, 1, 0, 1, 0, 218, 1, + 0, 218, 0, 0, 1, 0, 218, 1, + 0, 217, 217, 1, 0, 1, 0, 219, + 1, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 2, 1, 0, 2, + 1, 0, 2, 1, 0, 1, 0, 1, + 0, 1, 0, 1, 0, 1, 0, 1, + 0, 1, 0, 1, 0, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 0, 2, 1, 0, 1, 0, -97, -56, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + -130, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 10795, 1, 0, -163, 10792, 0, + 0, 1, 0, -195, 69, 71, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 38, 0, + 37, 37, 37, 0, 64, 0, 63, 63, + 0, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 0, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 8, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 0, 0, 0, 0, -60, 0, 0, 1, + 0, -7, 1, 0, 0, -130, -130, -130, + 80, 80, 80, 80, 80, 80, 80, 80, + 80, 80, 80, 80, 80, 80, 80, 80, + 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 15, 1, 0, 1, 0, 1, 0, 1, + 0, 1, 0, 1, 0, 1, 0, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7264, 7264, 7264, 7264, 7264, 7264, 7264, 7264, + 7264, 7264, 7264, 7264, 7264, 7264, 7264, 7264, + 7264, 7264, 7264, 7264, 7264, 7264, 7264, 7264, + 7264, 7264, 7264, 7264, 7264, 7264, 7264, 7264, + 7264, 7264, 7264, 7264, 7264, 7264, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, -7615, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -8, -8, -8, -8, -8, -8, -8, -8, + 0, 0, 0, 0, 0, 0, 0, 0, + -8, -8, -8, -8, -8, -8, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -8, -8, -8, -8, -8, -8, -8, -8, + 0, 0, 0, 0, 0, 0, 0, 0, + -8, -8, -8, -8, -8, -8, -8, -8, + 0, 0, 0, 0, 0, 0, 0, 0, + -8, -8, -8, -8, -8, -8, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -8, 0, -8, 0, -8, 0, -8, + 0, 0, 0, 0, 0, 0, 0, 0, + -8, -8, -8, -8, -8, -8, -8, -8, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -8, -8, -8, -8, -8, -8, -8, -8, + 0, 0, 0, 0, 0, 0, 0, 0, + -8, -8, -8, -8, -8, -8, -8, -8, + 0, 0, 0, 0, 0, 0, 0, 0, + -8, -8, -8, -8, -8, -8, -8, -8, + 0, 0, 0, 0, 0, 0, 0, 0, + -8, -8, -74, -74, -9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -86, -86, -86, -86, -9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -8, -8, -100, -100, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -8, -8, -112, -112, -7, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -128, -128, -126, -126, -9, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, -7517, 0, + 0, 0, -8383, -8262, 0, 0, 0, 0, + 0, 0, 28, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 48, + 48, 48, 48, 48, 48, 48, 48, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, -10743, -3814, -10727, 0, 0, 1, + 0, 1, 0, 1, 0, -10780, -10749, -10783, + 0, 0, 1, 0, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 0, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 0, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 0, 1, 0, -35332, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, + 0, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 + } +}; diff --git a/lib/unicase/totitle.c b/lib/unicase/totitle.c new file mode 100644 index 00000000..0ca5a45b --- /dev/null +++ b/lib/unicase/totitle.c @@ -0,0 +1,27 @@ +/* Titlecase mapping for Unicode characters (locale and context independent). + Copyright (C) 2002, 2006, 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +/* Define u_mapping table. */ +#include "totitle.h" + +#define FUNC uc_totitle +#include "simple-mapping.h" diff --git a/lib/unicase/totitle.h b/lib/unicase/totitle.h new file mode 100644 index 00000000..66104371 --- /dev/null +++ b/lib/unicase/totitle.h @@ -0,0 +1,615 @@ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +/* Simple character mapping of Unicode characters. */ +/* Generated automatically by gen-case.c for Unicode 5.1.0. */ +#define mapping_header_0 16 +#define mapping_header_1 2 +#define mapping_header_2 7 +#define mapping_header_3 511 +#define mapping_header_4 127 +static const +struct + { + int level1[2]; + short level2[2 << 9]; + int level3[29 << 7]; + } +u_mapping = +{ + { 0, 512 }, + { + 0, 128, 256, 384, 512, 640, 768, 896, + 1024, 1152, 1280, 1408, -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, 1536, -1, 1664, 1792, 1920, 2048, + -1, -1, 2176, 2304, -1, -1, -1, -1, + -1, 2432, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + 2560, 2688, 2816, -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, -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, -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, 2944, 3072, 3200, 3328, + -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, -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, 3456, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + 3584, -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, + -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, -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, -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, -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 + }, + { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 743, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, 0, + -32, -32, -32, -32, -32, -32, -32, 121, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -232, 0, -1, 0, -1, 0, -1, + 0, 0, -1, 0, -1, 0, -1, 0, + -1, 0, -1, 0, -1, 0, -1, 0, + -1, 0, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, 0, -1, 0, -1, 0, -1, -300, + 195, 0, 0, -1, 0, -1, 0, 0, + -1, 0, 0, 0, -1, 0, 0, 0, + 0, 0, -1, 0, 0, 97, 0, 0, + 0, -1, 163, 0, 0, 0, 130, 0, + 0, -1, 0, -1, 0, -1, 0, 0, + -1, 0, 0, 0, 0, -1, 0, 0, + -1, 0, 0, 0, -1, 0, -1, 0, + 0, -1, 0, 0, 0, -1, 0, 56, + 0, 0, 0, 0, 1, 0, -1, 1, + 0, -1, 1, 0, -1, 0, -1, 0, + -1, 0, -1, 0, -1, 0, -1, 0, + -1, 0, -1, 0, -1, -79, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, 1, 0, -1, 0, -1, 0, 0, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, 0, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, 0, 0, 0, + 0, 0, 0, 0, -1, 0, 0, 0, + 0, 0, -1, 0, 0, 0, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 10783, 10780, 0, -210, -206, 0, -205, -205, + 0, -202, 0, -203, 0, 0, 0, 0, + -205, 0, 0, -207, 0, 0, 0, 0, + -209, -211, 0, 10743, 0, 0, 0, -211, + 0, 10749, -213, 0, 0, -214, 0, 0, + 0, 0, 0, 0, 0, 10727, 0, 0, + -218, 0, 0, -218, 0, 0, 0, 0, + -218, -69, -217, -217, -71, 0, 0, 0, + 0, 0, -219, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 84, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -1, 0, -1, 0, 0, 0, -1, + 0, 0, 0, 130, 130, 130, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -38, -37, -37, -37, + 0, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -31, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -64, -63, -63, 0, + -62, -57, 0, 0, 0, -47, -54, -8, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + -86, -80, 7, 0, 0, -96, 0, 0, + -1, 0, 0, -1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, + -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, 0, -1, 0, -1, 0, -1, 0, + -1, 0, -1, 0, -1, 0, -1, -15, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 35332, 0, 0, 0, 3814, 0, 0, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, 0, + 0, 0, 0, -59, 0, 0, 0, 0, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 8, 8, 8, 8, 8, 8, 8, 8, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 8, 8, 8, 8, 8, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 8, 8, 8, 8, 8, 8, 8, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 8, 8, 8, 8, 8, 8, 8, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 8, 8, 8, 8, 8, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 8, 0, 8, 0, 8, 0, 8, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 8, 8, 8, 8, 8, 8, 8, + 0, 0, 0, 0, 0, 0, 0, 0, + 74, 74, 86, 86, 86, 86, 100, 100, + 128, 128, 112, 112, 126, 126, 0, 0, + 8, 8, 8, 8, 8, 8, 8, 8, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 8, 8, 8, 8, 8, 8, 8, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 8, 8, 8, 8, 8, 8, 8, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 8, 0, 9, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, -7205, 0, + 0, 0, 0, 9, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 8, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 8, 0, 0, 0, 7, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 9, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, -28, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -16, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, -16, -16, -16, + 0, 0, 0, 0, -1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, 0, + 0, -1, 0, 0, 0, -10795, -10792, 0, + -1, 0, -1, 0, -1, 0, 0, 0, + 0, 0, 0, -1, 0, 0, -1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -7264, -7264, -7264, -7264, -7264, -7264, -7264, -7264, + -7264, -7264, -7264, -7264, -7264, -7264, -7264, -7264, + -7264, -7264, -7264, -7264, -7264, -7264, -7264, -7264, + -7264, -7264, -7264, -7264, -7264, -7264, -7264, -7264, + -7264, -7264, -7264, -7264, -7264, -7264, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, 0, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, 0, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -1, 0, -1, 0, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, 0, 0, 0, -1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -40, -40, -40, -40, -40, -40, -40, -40, + -40, -40, -40, -40, -40, -40, -40, -40, + -40, -40, -40, -40, -40, -40, -40, -40, + -40, -40, -40, -40, -40, -40, -40, -40, + -40, -40, -40, -40, -40, -40, -40, -40, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 + } +}; diff --git a/lib/unicase/toupper.c b/lib/unicase/toupper.c new file mode 100644 index 00000000..d74e45c7 --- /dev/null +++ b/lib/unicase/toupper.c @@ -0,0 +1,27 @@ +/* Uppercase mapping for Unicode characters (locale and context independent). + Copyright (C) 2002, 2006, 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +/* Define u_mapping table. */ +#include "toupper.h" + +#define FUNC uc_toupper +#include "simple-mapping.h" diff --git a/lib/unicase/toupper.h b/lib/unicase/toupper.h new file mode 100644 index 00000000..e5194f40 --- /dev/null +++ b/lib/unicase/toupper.h @@ -0,0 +1,615 @@ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +/* Simple character mapping of Unicode characters. */ +/* Generated automatically by gen-case.c for Unicode 5.1.0. */ +#define mapping_header_0 16 +#define mapping_header_1 2 +#define mapping_header_2 7 +#define mapping_header_3 511 +#define mapping_header_4 127 +static const +struct + { + int level1[2]; + short level2[2 << 9]; + int level3[29 << 7]; + } +u_mapping = +{ + { 0, 512 }, + { + 0, 128, 256, 384, 512, 640, 768, 896, + 1024, 1152, 1280, 1408, -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, 1536, -1, 1664, 1792, 1920, 2048, + -1, -1, 2176, 2304, -1, -1, -1, -1, + -1, 2432, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + 2560, 2688, 2816, -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, -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, -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, 2944, 3072, 3200, 3328, + -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, -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, 3456, -1, + -1, -1, -1, -1, -1, -1, -1, -1, + 3584, -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, + -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, -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, -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, -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 + }, + { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 743, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, 0, + -32, -32, -32, -32, -32, -32, -32, 121, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -232, 0, -1, 0, -1, 0, -1, + 0, 0, -1, 0, -1, 0, -1, 0, + -1, 0, -1, 0, -1, 0, -1, 0, + -1, 0, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, 0, -1, 0, -1, 0, -1, -300, + 195, 0, 0, -1, 0, -1, 0, 0, + -1, 0, 0, 0, -1, 0, 0, 0, + 0, 0, -1, 0, 0, 97, 0, 0, + 0, -1, 163, 0, 0, 0, 130, 0, + 0, -1, 0, -1, 0, -1, 0, 0, + -1, 0, 0, 0, 0, -1, 0, 0, + -1, 0, 0, 0, -1, 0, -1, 0, + 0, -1, 0, 0, 0, -1, 0, 56, + 0, 0, 0, 0, 0, -1, -2, 0, + -1, -2, 0, -1, -2, 0, -1, 0, + -1, 0, -1, 0, -1, 0, -1, 0, + -1, 0, -1, 0, -1, -79, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, 0, -1, -2, 0, -1, 0, 0, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, 0, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, 0, 0, 0, + 0, 0, 0, 0, -1, 0, 0, 0, + 0, 0, -1, 0, 0, 0, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 10783, 10780, 0, -210, -206, 0, -205, -205, + 0, -202, 0, -203, 0, 0, 0, 0, + -205, 0, 0, -207, 0, 0, 0, 0, + -209, -211, 0, 10743, 0, 0, 0, -211, + 0, 10749, -213, 0, 0, -214, 0, 0, + 0, 0, 0, 0, 0, 10727, 0, 0, + -218, 0, 0, -218, 0, 0, 0, 0, + -218, -69, -217, -217, -71, 0, 0, 0, + 0, 0, -219, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 84, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -1, 0, -1, 0, 0, 0, -1, + 0, 0, 0, 130, 130, 130, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -38, -37, -37, -37, + 0, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -31, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -64, -63, -63, 0, + -62, -57, 0, 0, 0, -47, -54, -8, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + -86, -80, 7, 0, 0, -96, 0, 0, + -1, 0, 0, -1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, + -80, -80, -80, -80, -80, -80, -80, -80, + -80, -80, -80, -80, -80, -80, -80, -80, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, 0, -1, 0, -1, 0, -1, 0, + -1, 0, -1, 0, -1, 0, -1, -15, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 35332, 0, 0, 0, 3814, 0, 0, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, 0, + 0, 0, 0, -59, 0, 0, 0, 0, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 8, 8, 8, 8, 8, 8, 8, 8, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 8, 8, 8, 8, 8, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 8, 8, 8, 8, 8, 8, 8, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 8, 8, 8, 8, 8, 8, 8, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 8, 8, 8, 8, 8, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 8, 0, 8, 0, 8, 0, 8, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 8, 8, 8, 8, 8, 8, 8, + 0, 0, 0, 0, 0, 0, 0, 0, + 74, 74, 86, 86, 86, 86, 100, 100, + 128, 128, 112, 112, 126, 126, 0, 0, + 8, 8, 8, 8, 8, 8, 8, 8, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 8, 8, 8, 8, 8, 8, 8, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 8, 8, 8, 8, 8, 8, 8, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 8, 0, 9, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, -7205, 0, + 0, 0, 0, 9, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 8, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 8, 8, 0, 0, 0, 7, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 9, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, -28, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -16, -16, -16, -16, -16, -16, -16, -16, + -16, -16, -16, -16, -16, -16, -16, -16, + 0, 0, 0, 0, -1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, -26, -26, -26, -26, -26, -26, + -26, -26, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, -48, + -48, -48, -48, -48, -48, -48, -48, 0, + 0, -1, 0, 0, 0, -10795, -10792, 0, + -1, 0, -1, 0, -1, 0, 0, 0, + 0, 0, 0, -1, 0, 0, -1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -7264, -7264, -7264, -7264, -7264, -7264, -7264, -7264, + -7264, -7264, -7264, -7264, -7264, -7264, -7264, -7264, + -7264, -7264, -7264, -7264, -7264, -7264, -7264, -7264, + -7264, -7264, -7264, -7264, -7264, -7264, -7264, -7264, + -7264, -7264, -7264, -7264, -7264, -7264, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, 0, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, 0, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -1, 0, -1, 0, 0, -1, + 0, -1, 0, -1, 0, -1, 0, -1, + 0, 0, 0, 0, -1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, -32, -32, -32, -32, -32, + -32, -32, -32, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + -40, -40, -40, -40, -40, -40, -40, -40, + -40, -40, -40, -40, -40, -40, -40, -40, + -40, -40, -40, -40, -40, -40, -40, -40, + -40, -40, -40, -40, -40, -40, -40, -40, + -40, -40, -40, -40, -40, -40, -40, -40, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 + } +}; diff --git a/lib/unicase/u-casecmp.h b/lib/unicase/u-casecmp.h new file mode 100644 index 00000000..e1cf99c4 --- /dev/null +++ b/lib/unicase/u-casecmp.h @@ -0,0 +1,69 @@ +/* Case and normalization insensitive comparison of Unicode strings. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 . */ + +int +FUNC (const SRC_UNIT *s1, size_t n1, const SRC_UNIT *s2, size_t n2, + const char *iso639_language, uninorm_t nf, int *resultp) +{ + UNIT buf1[2048 / sizeof (UNIT)]; + UNIT buf2[2048 / sizeof (UNIT)]; + UNIT *norms1; + size_t norms1_length; + UNIT *norms2; + size_t norms2_length; + int cmp; + + /* Optimization: There is no need to do canonical composition of each string. + Decomposition is enough. */ + if (nf != NULL) + nf = uninorm_decomposing_form (nf); + + /* Case-fold and normalize S1. */ + norms1_length = sizeof (buf1) / sizeof (UNIT); + norms1 = U_CASEFOLD (s1, n1, iso639_language, nf, buf1, &norms1_length); + if (norms1 == NULL) + /* errno is set here. */ + return -1; + + /* Case-fold and normalize S2. */ + norms2_length = sizeof (buf2) / sizeof (UNIT); + norms2 = U_CASEFOLD (s2, n2, iso639_language, nf, buf2, &norms2_length); + if (norms2 == NULL) + { + if (norms1 != buf1) + { + int saved_errno = errno; + free (norms1); + errno = saved_errno; + } + return -1; + } + + /* Compare the normalized strings. */ + cmp = U_CMP2 (norms1, norms1_length, norms2, norms2_length); + if (cmp > 0) + cmp = 1; + else if (cmp < 0) + cmp = -1; + + if (norms2 != buf2) + free (norms2); + if (norms1 != buf1) + free (norms1); + *resultp = cmp; + return 0; +} diff --git a/lib/unicase/u-casecoll.h b/lib/unicase/u-casecoll.h new file mode 100644 index 00000000..73094abe --- /dev/null +++ b/lib/unicase/u-casecoll.h @@ -0,0 +1,68 @@ +/* Locale dependent, case and normalization insensitive comparison of Unicode + strings. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 . */ + +int +FUNC (const UNIT *s1, size_t n1, const UNIT *s2, size_t n2, + const char *iso639_language, uninorm_t nf, int *resultp) +{ + char buf1[2048]; + char buf2[2048]; + char *transformed1; + size_t transformed1_length; + char *transformed2; + size_t transformed2_length; + int cmp; + + /* Normalize and transform S1. */ + transformed1_length = sizeof (buf1); + transformed1 = + U_CASEXFRM (s1, n1, iso639_language, nf, buf1, &transformed1_length); + if (transformed1 == NULL) + /* errno is set here. */ + return -1; + + /* Normalize and transform S2. */ + transformed2_length = sizeof (buf2); + transformed2 = + U_CASEXFRM (s2, n2, iso639_language, nf, buf2, &transformed2_length); + if (transformed2 == NULL) + { + if (transformed1 != buf1) + { + int saved_errno = errno; + free (transformed1); + errno = saved_errno; + } + return -1; + } + + /* Compare the transformed strings. */ + cmp = memcmp2 (transformed1, transformed1_length, + transformed2, transformed2_length); + if (cmp < 0) + cmp = -1; + else if (cmp > 0) + cmp = 1; + + if (transformed2 != buf2) + free (transformed2); + if (transformed1 != buf1) + free (transformed1); + *resultp = cmp; + return 0; +} diff --git a/lib/unicase/u-casefold.h b/lib/unicase/u-casefold.h new file mode 100644 index 00000000..c41f4e18 --- /dev/null +++ b/lib/unicase/u-casefold.h @@ -0,0 +1,28 @@ +/* Casefolding mapping for Unicode strings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 . */ + +UNIT * +FUNC (const UNIT *s, size_t n, const char *iso639_language, + uninorm_t nf, + UNIT *resultbuf, size_t *lengthp) +{ + return U_CT_CASEFOLD (s, n, + unicase_empty_prefix_context, unicase_empty_suffix_context, + iso639_language, + nf, + resultbuf, lengthp); +} diff --git a/lib/unicase/u-casemap.h b/lib/unicase/u-casemap.h new file mode 100644 index 00000000..ea41444a --- /dev/null +++ b/lib/unicase/u-casemap.h @@ -0,0 +1,416 @@ +/* Case mapping for UTF-8/UTF-16/UTF-32 strings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 . */ + +UNIT * +FUNC (const UNIT *s, size_t n, + casing_prefix_context_t prefix_context, + casing_suffix_context_t suffix_context, + const char *iso639_language, + ucs4_t (*single_character_map) (ucs4_t), + size_t offset_in_rule, /* offset in 'struct special_casing_rule' */ + uninorm_t nf, + UNIT *resultbuf, size_t *lengthp) +{ + /* The result being accumulated. */ + UNIT *result; + size_t length; + size_t allocated; + + /* Initialize the accumulator. */ + if (nf != NULL || resultbuf == NULL) + { + result = NULL; + allocated = 0; + } + else + { + result = resultbuf; + allocated = *lengthp; + } + length = 0; + + { + const UNIT *s_end = s + n; + + /* Helper for evaluating the FINAL_SIGMA condition: + Last character that was not case-ignorable. */ + ucs4_t last_char_except_ignorable = + prefix_context.last_char_except_ignorable; + + /* Helper for evaluating the AFTER_SOFT_DOTTED and AFTER_I conditions: + Last character that was of combining class 230 ("Above") or 0. */ + ucs4_t last_char_normal_or_above = + prefix_context.last_char_normal_or_above; + + while (s < s_end) + { + ucs4_t uc; + int count = U_MBTOUC_UNSAFE (&uc, s, s_end - s); + + ucs4_t mapped_uc[3]; + unsigned int mapped_count; + + if (uc < 0x10000) + { + /* Look first in the special-casing table. */ + char code[3]; + + code[0] = (uc >> 8) & 0xff; + code[1] = uc & 0xff; + + for (code[2] = 0; ; code[2]++) + { + const struct special_casing_rule *rule = + gl_unicase_special_lookup (code, 3); + + if (rule == NULL) + break; + + /* Test if the condition applies. */ + /* Does the language apply? */ + if (rule->language[0] == '\0' + || (iso639_language != NULL + && iso639_language[0] == rule->language[0] + && iso639_language[1] == rule->language[1])) + { + /* Does the context apply? */ + int context = rule->context; + bool applies; + + if (context < 0) + context = - context; + switch (context) + { + case SCC_ALWAYS: + applies = true; + break; + + case SCC_FINAL_SIGMA: + /* "Before" condition: preceded by a sequence + consisting of a cased letter and a case-ignorable + sequence. + "After" condition: not followed by a sequence + consisting of a case-ignorable sequence and then a + cased letter. */ + /* Test the "before" condition. */ + applies = uc_is_cased (last_char_except_ignorable); + /* Test the "after" condition. */ + if (applies) + { + const UNIT *s2 = s + count; + for (;;) + { + if (s2 < s_end) + { + ucs4_t uc2; + int count2 = U_MBTOUC_UNSAFE (&uc2, s2, s_end - s2); + /* Our uc_is_case_ignorable function is + known to return false for all cased + characters. So we can call + uc_is_case_ignorable first. */ + if (!uc_is_case_ignorable (uc2)) + { + applies = ! uc_is_cased (uc2); + break; + } + s2 += count2; + } + else + { + applies = ! uc_is_cased (suffix_context.first_char_except_ignorable); + break; + } + } + } + break; + + case SCC_AFTER_SOFT_DOTTED: + /* "Before" condition: There is a Soft_Dotted character + before it, with no intervening character of + combining class 0 or 230 (Above). */ + /* Test the "before" condition. */ + applies = uc_is_property_soft_dotted (last_char_normal_or_above); + break; + + case SCC_MORE_ABOVE: + /* "After" condition: followed by a character of + combining class 230 (Above) with no intervening + character of combining class 0 or 230 (Above). */ + /* Test the "after" condition. */ + { + const UNIT *s2 = s + count; + applies = false; + for (;;) + { + if (s2 < s_end) + { + ucs4_t uc2; + int count2 = U_MBTOUC_UNSAFE (&uc2, s2, s_end - s2); + int ccc = uc_combining_class (uc2); + if (ccc == UC_CCC_A) + { + applies = true; + break; + } + if (ccc == UC_CCC_NR) + break; + s2 += count2; + } + else + { + applies = ((suffix_context.bits & SCC_MORE_ABOVE_MASK) != 0); + break; + } + } + } + break; + + case SCC_BEFORE_DOT: + /* "After" condition: followed by COMBINING DOT ABOVE + (U+0307). Any sequence of characters with a + combining class that is neither 0 nor 230 may + intervene between the current character and the + combining dot above. */ + /* Test the "after" condition. */ + { + const UNIT *s2 = s + count; + applies = false; + for (;;) + { + if (s2 < s_end) + { + ucs4_t uc2; + int count2 = U_MBTOUC_UNSAFE (&uc2, s2, s_end - s2); + if (uc2 == 0x0307) /* COMBINING DOT ABOVE */ + { + applies = true; + break; + } + { + int ccc = uc_combining_class (uc2); + if (ccc == UC_CCC_A || ccc == UC_CCC_NR) + break; + } + s2 += count2; + } + else + { + applies = ((suffix_context.bits & SCC_BEFORE_DOT_MASK) != 0); + break; + } + } + } + break; + + case SCC_AFTER_I: + /* "Before" condition: There is an uppercase I before + it, and there is no intervening character of + combining class 0 or 230 (Above). */ + /* Test the "before" condition. */ + applies = (last_char_normal_or_above == 'I'); + break; + + default: + abort (); + } + if (rule->context < 0) + applies = !applies; + + if (applies) + { + /* The rule applies. + Look up the mapping (0 to 3 characters). */ + const unsigned short *mapped_in_rule = + (const unsigned short *)((const char *)rule + offset_in_rule); + + if (mapped_in_rule[0] == 0) + mapped_count = 0; + else + { + mapped_uc[0] = mapped_in_rule[0]; + if (mapped_in_rule[1] == 0) + mapped_count = 1; + else + { + mapped_uc[1] = mapped_in_rule[1]; + if (mapped_in_rule[2] == 0) + mapped_count = 2; + else + { + mapped_uc[2] = mapped_in_rule[2]; + mapped_count = 3; + } + } + } + goto found_mapping; + } + } + + /* Optimization: Save a hash table lookup in the next round. */ + if (!rule->has_next) + break; + } + } + + /* No special-cased mapping. So use the locale and context independent + mapping. */ + mapped_uc[0] = single_character_map (uc); + mapped_count = 1; + + found_mapping: + /* Found the mapping: uc maps to mapped_uc[0..mapped_count-1]. */ + { + unsigned int i; + + for (i = 0; i < mapped_count; i++) + { + ucs4_t muc = mapped_uc[i]; + + /* Append muc to the result accumulator. */ + if (length < allocated) + { + int ret = U_UCTOMB (result + length, muc, allocated - length); + if (ret == -1) + { + errno = EINVAL; + goto fail; + } + if (ret >= 0) + { + length += ret; + goto done_appending; + } + } + { + size_t old_allocated = allocated; + size_t new_allocated = 2 * old_allocated; + if (new_allocated < 64) + new_allocated = 64; + if (new_allocated < old_allocated) /* integer overflow? */ + abort (); + { + UNIT *larger_result; + if (result == NULL) + { + larger_result = (UNIT *) malloc (new_allocated * sizeof (UNIT)); + if (larger_result == NULL) + { + errno = ENOMEM; + goto fail; + } + } + else if (result == resultbuf) + { + larger_result = (UNIT *) malloc (new_allocated * sizeof (UNIT)); + if (larger_result == NULL) + { + errno = ENOMEM; + goto fail; + } + U_CPY (larger_result, resultbuf, length); + } + else + { + larger_result = + (UNIT *) realloc (result, new_allocated * sizeof (UNIT)); + if (larger_result == NULL) + { + errno = ENOMEM; + goto fail; + } + } + result = larger_result; + allocated = new_allocated; + { + int ret = U_UCTOMB (result + length, muc, allocated - length); + if (ret == -1) + { + errno = EINVAL; + goto fail; + } + if (ret < 0) + abort (); + length += ret; + goto done_appending; + } + } + } + done_appending: ; + } + } + + if (!uc_is_case_ignorable (uc)) + last_char_except_ignorable = uc; + + { + int ccc = uc_combining_class (uc); + if (ccc == UC_CCC_A || ccc == UC_CCC_NR) + last_char_normal_or_above = uc; + } + + s += count; + } + } + + if (nf != NULL) + { + /* Finally, normalize the result. */ + UNIT *normalized_result; + + normalized_result = U_NORMALIZE (nf, result, length, resultbuf, lengthp); + if (normalized_result == NULL) + goto fail; + + free (result); + return normalized_result; + } + + if (length == 0) + { + if (result == NULL) + { + /* Return a non-NULL value. NULL means error. */ + result = (UNIT *) malloc (1); + if (result == NULL) + { + errno = ENOMEM; + goto fail; + } + } + } + else if (result != resultbuf && length < allocated) + { + /* Shrink the allocated memory if possible. */ + UNIT *memory; + + memory = (UNIT *) realloc (result, length * sizeof (UNIT)); + if (memory != NULL) + result = memory; + } + + *lengthp = length; + return result; + + fail: + if (result != resultbuf) + { + int saved_errno = errno; + free (result); + errno = saved_errno; + } + return NULL; +} diff --git a/lib/unicase/u-casexfrm.h b/lib/unicase/u-casexfrm.h new file mode 100644 index 00000000..e36aff3b --- /dev/null +++ b/lib/unicase/u-casexfrm.h @@ -0,0 +1,88 @@ +/* Locale dependent transformation for case insensitive comparison of Unicode + strings. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 . */ + +char * +FUNC (const UNIT *s, size_t n, const char *iso639_language, uninorm_t nf, + char *resultbuf, size_t *lengthp) +{ + UNIT foldedsbuf[2048 / sizeof (UNIT)]; + UNIT *foldeds; + size_t foldeds_length; + char convsbuf[2048]; + char *convs; + size_t convs_length; + char *result; + + /* Casefold and normalize the Unicode string. */ + foldeds_length = sizeof (foldedsbuf) / sizeof (UNIT); + foldeds = U_CASEFOLD (s, n, iso639_language, nf, foldedsbuf, &foldeds_length); + if (foldeds == NULL) + /* errno is set here. */ + return NULL; + + /* Convert it to locale encoding. */ + convs_length = sizeof (convsbuf) - 1; + convs = U_CONV_TO_ENCODING (locale_charset (), + iconveh_error, + foldeds, foldeds_length, + NULL, + convsbuf, &convs_length); + if (convs == NULL) + { + if (foldeds != foldedsbuf) + { + int saved_errno = errno; + free (foldeds); + errno = saved_errno; + } + return NULL; + } + + if (foldeds != foldedsbuf) + free (foldeds); + + /* Ensure one more byte is available. */ + if (convs != convsbuf) + { + char *memory = (char *) realloc (convs, convs_length + 1); + if (memory == NULL) + { + free (convs); + errno = ENOMEM; + return NULL; + } + convs = memory; + } + + /* Apply locale dependent transformations for comparison. */ + result = memxfrm (convs, convs_length, resultbuf, lengthp); + if (result == NULL) + { + if (convs != convsbuf) + { + int saved_errno = errno; + free (convs); + errno = saved_errno; + } + return NULL; + } + + if (convs != convsbuf) + free (convs); + return result; +} diff --git a/lib/unicase/u-ct-casefold.h b/lib/unicase/u-ct-casefold.h new file mode 100644 index 00000000..d97be264 --- /dev/null +++ b/lib/unicase/u-ct-casefold.h @@ -0,0 +1,107 @@ +/* Casefolding mapping for Unicode substrings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 . */ + +UNIT * +FUNC (const UNIT *s, size_t n, + casing_prefix_context_t prefix_context, + casing_suffix_context_t suffix_context, + const char *iso639_language, + uninorm_t nf, + UNIT *resultbuf, size_t *lengthp) +{ + /* Implement the three definitions of caseless matching, as described in + Unicode 5.0, section "Default caseless matching": + - If no normalization is requested, simply apply the casefolding. + X -> toCasefold(X). + - If canonical normalization is requested, apply it, and apply an NFD + before. + X -> NFD(toCasefold(NFD(X))). + - If compatibility normalization is requested, apply it twice, apply + the normalization after each, and apply an NFD before: + X -> NFKD(toCasefold(NFKD(toCasefold(NFD(X))))). */ + if (nf == NULL) + /* X -> toCasefold(X) */ + return U_CASEMAP (s, n, prefix_context, suffix_context, iso639_language, + uc_tocasefold, offsetof (struct special_casing_rule, casefold[0]), + NULL, + resultbuf, lengthp); + else + { + uninorm_t nfd = uninorm_decomposing_form (nf); + /* X -> nf(toCasefold(NFD(X))) or + X -> nf(toCasefold(nfd(toCasefold(NFD(X))))) */ + int repeat = (uninorm_is_compat_decomposing (nf) ? 2 : 1); + UNIT tmpbuf1[2048 / sizeof (UNIT)]; + UNIT tmpbuf2[2048 / sizeof (UNIT)]; + UNIT *tmp1; + size_t tmp1_length; + UNIT *tmp2; + size_t tmp2_length; + + tmp1_length = sizeof (tmpbuf1) / sizeof (UNIT); + tmp1 = U_NORMALIZE (UNINORM_NFD, s, n, tmpbuf1, &tmp1_length); + if (tmp1 == NULL) + /* errno is set here. */ + return NULL; + + do + { + tmp2_length = sizeof (tmpbuf2) / sizeof (UNIT); + tmp2 = U_CASEMAP (tmp1, tmp1_length, + prefix_context, suffix_context, iso639_language, + uc_tocasefold, offsetof (struct special_casing_rule, casefold[0]), + NULL, + tmpbuf2, &tmp2_length); + if (tmp2 == NULL) + { + int saved_errno = errno; + if (tmp1 != tmpbuf1) + free (tmp1); + errno = saved_errno; + return NULL; + } + + if (tmp1 != tmpbuf1) + free (tmp1); + + if (repeat > 1) + { + tmp1_length = sizeof (tmpbuf1) / sizeof (UNIT); + tmp1 = U_NORMALIZE (nfd, tmp2, tmp2_length, + tmpbuf1, &tmp1_length); + } + else + /* Last run through this loop. */ + tmp1 = U_NORMALIZE (nf, tmp2, tmp2_length, + resultbuf, lengthp); + if (tmp1 == NULL) + { + int saved_errno = errno; + if (tmp2 != tmpbuf2) + free (tmp2); + errno = saved_errno; + return NULL; + } + + if (tmp2 != tmpbuf2) + free (tmp2); + } + while (--repeat > 0); + + return tmp1; + } +} diff --git a/lib/unicase/u-ct-totitle.h b/lib/unicase/u-ct-totitle.h new file mode 100644 index 00000000..f0d4fd77 --- /dev/null +++ b/lib/unicase/u-ct-totitle.h @@ -0,0 +1,501 @@ +/* Titlecase mapping for UTF-8/UTF-16/UTF-32 substrings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 . */ + +/* Quoting the Unicode standard, section "Default Case Algorithms": + Find the word boundaries in X according to Unicode Standard Annex #29, + “Text Boundaries.” For each word boundary, find the first cased character + F following the word boundary. If F exists, map F to Titlecase_Mapping(F); + then map all characters C between F and the following word boundary to + Lowercase_Mapping(C). */ + +UNIT * +FUNC (const UNIT *s, size_t n, + casing_prefix_context_t prefix_context, + casing_suffix_context_t suffix_context, + const char *iso639_language, + uninorm_t nf, + UNIT *resultbuf, size_t *lengthp) +{ + /* The result being accumulated. */ + UNIT *result; + size_t length; + size_t allocated; + /* An array containing the word break positions. */ + char *wordbreaks; + + /* Initialize the accumulator. */ + if (nf != NULL || resultbuf == NULL) + { + result = NULL; + allocated = 0; + } + else + { + result = resultbuf; + allocated = *lengthp; + } + length = 0; + + /* Initialize the word breaks array. */ + if (n > 0) + { + wordbreaks = (char *) malloc (n); + if (wordbreaks == NULL) + { + errno = ENOMEM; + goto fail2; + } + U_WORDBREAKS (s, n, wordbreaks); + } + else + wordbreaks = NULL; + + { + const UNIT *s_end = s + n; + const char *wp = wordbreaks; + + /* When considering the string as segmented by word boundaries: For each + such segment: + - In the first part, we are searching for the first cased character. + In this state, in_word_first_part = true, and no conversion takes + place. + - In the second part, we are converting every character: the first + among these characters to title case, the other ones to lower case. + In this state, in_word_first_part = false. */ + bool in_word_first_part = true; + + /* Helper for evaluating the FINAL_SIGMA condition: + Last character that was not case-ignorable. */ + ucs4_t last_char_except_ignorable = + prefix_context.last_char_except_ignorable; + + /* Helper for evaluating the AFTER_SOFT_DOTTED and AFTER_I conditions: + Last character that was of combining class 230 ("Above") or 0. */ + ucs4_t last_char_normal_or_above = + prefix_context.last_char_normal_or_above; + + while (s < s_end) + { + /* Fetch the next character. */ + ucs4_t uc; + int count = U_MBTOUC_UNSAFE (&uc, s, s_end - s); + + ucs4_t (*single_character_map) (ucs4_t); + size_t offset_in_rule; /* offset in 'struct special_casing_rule' */ + + ucs4_t mapped_uc[3]; + unsigned int mapped_count; + + if (*wp) + /* Crossing a word boundary. */ + in_word_first_part = true; + + /* Determine single_character_map, offset_in_rule. + There are three possibilities: + - uc should not be converted. + - uc should be titlecased. + - uc should be lowercased. */ + if (in_word_first_part) + { + if (uc_is_cased (uc)) + { + /* uc is to be titlecased. */ + single_character_map = uc_totitle; + offset_in_rule = offsetof (struct special_casing_rule, title[0]); + in_word_first_part = false; + } + else + { + /* uc is not converted. */ + single_character_map = NULL; + offset_in_rule = 0; + } + } + else + { + /* uc is to be lowercased. */ + single_character_map = uc_tolower; + offset_in_rule = offsetof (struct special_casing_rule, lower[0]); + } + + /* Actually map uc. */ + if (single_character_map == NULL) + { + mapped_uc[0] = uc; + mapped_count = 1; + goto found_mapping; + } + + if (uc < 0x10000) + { + /* Look first in the special-casing table. */ + char code[3]; + + code[0] = (uc >> 8) & 0xff; + code[1] = uc & 0xff; + + for (code[2] = 0; ; code[2]++) + { + const struct special_casing_rule *rule = + gl_unicase_special_lookup (code, 3); + + if (rule == NULL) + break; + + /* Test if the condition applies. */ + /* Does the language apply? */ + if (rule->language[0] == '\0' + || (iso639_language != NULL + && iso639_language[0] == rule->language[0] + && iso639_language[1] == rule->language[1])) + { + /* Does the context apply? */ + int context = rule->context; + bool applies; + + if (context < 0) + context = - context; + switch (context) + { + case SCC_ALWAYS: + applies = true; + break; + + case SCC_FINAL_SIGMA: + /* "Before" condition: preceded by a sequence + consisting of a cased letter and a case-ignorable + sequence. + "After" condition: not followed by a sequence + consisting of a case-ignorable sequence and then a + cased letter. */ + /* Test the "before" condition. */ + applies = uc_is_cased (last_char_except_ignorable); + /* Test the "after" condition. */ + if (applies) + { + const UNIT *s2 = s + count; + for (;;) + { + if (s2 < s_end) + { + ucs4_t uc2; + int count2 = U_MBTOUC_UNSAFE (&uc2, s2, s_end - s2); + /* Our uc_is_case_ignorable function is + known to return false for all cased + characters. So we can call + uc_is_case_ignorable first. */ + if (!uc_is_case_ignorable (uc2)) + { + applies = ! uc_is_cased (uc2); + break; + } + s2 += count2; + } + else + { + applies = ! uc_is_cased (suffix_context.first_char_except_ignorable); + break; + } + } + } + break; + + case SCC_AFTER_SOFT_DOTTED: + /* "Before" condition: There is a Soft_Dotted character + before it, with no intervening character of + combining class 0 or 230 (Above). */ + /* Test the "before" condition. */ + applies = uc_is_property_soft_dotted (last_char_normal_or_above); + break; + + case SCC_MORE_ABOVE: + /* "After" condition: followed by a character of + combining class 230 (Above) with no intervening + character of combining class 0 or 230 (Above). */ + /* Test the "after" condition. */ + { + const UNIT *s2 = s + count; + applies = false; + for (;;) + { + if (s2 < s_end) + { + ucs4_t uc2; + int count2 = U_MBTOUC_UNSAFE (&uc2, s2, s_end - s2); + int ccc = uc_combining_class (uc2); + if (ccc == UC_CCC_A) + { + applies = true; + break; + } + if (ccc == UC_CCC_NR) + break; + s2 += count2; + } + else + { + applies = ((suffix_context.bits & SCC_MORE_ABOVE_MASK) != 0); + break; + } + } + } + break; + + case SCC_BEFORE_DOT: + /* "After" condition: followed by COMBINING DOT ABOVE + (U+0307). Any sequence of characters with a + combining class that is neither 0 nor 230 may + intervene between the current character and the + combining dot above. */ + /* Test the "after" condition. */ + { + const UNIT *s2 = s + count; + applies = false; + for (;;) + { + if (s2 < s_end) + { + ucs4_t uc2; + int count2 = U_MBTOUC_UNSAFE (&uc2, s2, s_end - s2); + if (uc2 == 0x0307) /* COMBINING DOT ABOVE */ + { + applies = true; + break; + } + { + int ccc = uc_combining_class (uc2); + if (ccc == UC_CCC_A || ccc == UC_CCC_NR) + break; + } + s2 += count2; + } + else + { + applies = ((suffix_context.bits & SCC_BEFORE_DOT_MASK) != 0); + break; + } + } + } + break; + + case SCC_AFTER_I: + /* "Before" condition: There is an uppercase I before + it, and there is no intervening character of + combining class 0 or 230 (Above). */ + /* Test the "before" condition. */ + applies = (last_char_normal_or_above == 'I'); + break; + + default: + abort (); + } + if (rule->context < 0) + applies = !applies; + + if (applies) + { + /* The rule applies. + Look up the mapping (0 to 3 characters). */ + const unsigned short *mapped_in_rule = + (const unsigned short *)((const char *)rule + offset_in_rule); + + if (mapped_in_rule[0] == 0) + mapped_count = 0; + else + { + mapped_uc[0] = mapped_in_rule[0]; + if (mapped_in_rule[1] == 0) + mapped_count = 1; + else + { + mapped_uc[1] = mapped_in_rule[1]; + if (mapped_in_rule[2] == 0) + mapped_count = 2; + else + { + mapped_uc[2] = mapped_in_rule[2]; + mapped_count = 3; + } + } + } + goto found_mapping; + } + } + + /* Optimization: Save a hash table lookup in the next round. */ + if (!rule->has_next) + break; + } + } + + /* No special-cased mapping. So use the locale and context independent + mapping. */ + mapped_uc[0] = single_character_map (uc); + mapped_count = 1; + + found_mapping: + /* Found the mapping: uc maps to mapped_uc[0..mapped_count-1]. */ + { + unsigned int i; + + for (i = 0; i < mapped_count; i++) + { + ucs4_t muc = mapped_uc[i]; + + /* Append muc to the result accumulator. */ + if (length < allocated) + { + int ret = U_UCTOMB (result + length, muc, allocated - length); + if (ret == -1) + { + errno = EINVAL; + goto fail1; + } + if (ret >= 0) + { + length += ret; + goto done_appending; + } + } + { + size_t old_allocated = allocated; + size_t new_allocated = 2 * old_allocated; + if (new_allocated < 64) + new_allocated = 64; + if (new_allocated < old_allocated) /* integer overflow? */ + abort (); + { + UNIT *larger_result; + if (result == NULL) + { + larger_result = (UNIT *) malloc (new_allocated * sizeof (UNIT)); + if (larger_result == NULL) + { + errno = ENOMEM; + goto fail1; + } + } + else if (result == resultbuf) + { + larger_result = (UNIT *) malloc (new_allocated * sizeof (UNIT)); + if (larger_result == NULL) + { + errno = ENOMEM; + goto fail1; + } + U_CPY (larger_result, resultbuf, length); + } + else + { + larger_result = + (UNIT *) realloc (result, new_allocated * sizeof (UNIT)); + if (larger_result == NULL) + { + errno = ENOMEM; + goto fail1; + } + } + result = larger_result; + allocated = new_allocated; + { + int ret = U_UCTOMB (result + length, muc, allocated - length); + if (ret == -1) + { + errno = EINVAL; + goto fail1; + } + if (ret < 0) + abort (); + length += ret; + goto done_appending; + } + } + } + done_appending: ; + } + } + + if (!uc_is_case_ignorable (uc)) + last_char_except_ignorable = uc; + + { + int ccc = uc_combining_class (uc); + if (ccc == UC_CCC_A || ccc == UC_CCC_NR) + last_char_normal_or_above = uc; + } + + s += count; + wp += count; + } + } + + free (wordbreaks); + + if (nf != NULL) + { + /* Finally, normalize the result. */ + UNIT *normalized_result; + + normalized_result = U_NORMALIZE (nf, result, length, resultbuf, lengthp); + if (normalized_result == NULL) + goto fail2; + + free (result); + return normalized_result; + } + + if (length == 0) + { + if (result == NULL) + { + /* Return a non-NULL value. NULL means error. */ + result = (UNIT *) malloc (1); + if (result == NULL) + { + errno = ENOMEM; + goto fail2; + } + } + } + else if (result != resultbuf && length < allocated) + { + /* Shrink the allocated memory if possible. */ + UNIT *memory; + + memory = (UNIT *) realloc (result, length * sizeof (UNIT)); + if (memory != NULL) + result = memory; + } + + *lengthp = length; + return result; + + fail1: + { + int saved_errno = errno; + free (wordbreaks); + errno = saved_errno; + } + fail2: + if (result != resultbuf) + { + int saved_errno = errno; + free (result); + errno = saved_errno; + } + return NULL; +} diff --git a/lib/unicase/u-is-cased.h b/lib/unicase/u-is-cased.h new file mode 100644 index 00000000..b96a60f0 --- /dev/null +++ b/lib/unicase/u-is-cased.h @@ -0,0 +1,128 @@ +/* Test whether case matters for a Unicode string. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 . */ + +int +FUNC (const UNIT *s, size_t n, const char *iso639_language, + bool *resultp) +{ + UNIT normsbuf[2048 / sizeof (UNIT)]; + UNIT *norms; + size_t norms_length; + UNIT mappedbuf[2048 / sizeof (UNIT)]; + UNIT *mapped_toupper; + UNIT *mapped_tolower; + UNIT *mapped_totitle; + size_t mapped_length; + + /* Apply canonical decomposition to S. */ + norms_length = sizeof (normsbuf) / sizeof (UNIT); + norms = U_NORMALIZE (UNINORM_NFD, s, n, normsbuf, &norms_length); + if (norms == NULL) + /* errno is set here. */ + return -1; + + mapped_length = sizeof (mappedbuf) / sizeof (UNIT); + + /* Apply toupper mapping. */ + mapped_toupper = U_TOUPPER (norms, norms_length, iso639_language, NULL, + mappedbuf, &mapped_length); + if (mapped_toupper == NULL) + goto fail; + + /* Compare. */ + if (!(mapped_length == norms_length + && U_CMP (mapped_toupper, norms, norms_length) == 0)) + { + if (mapped_toupper != mappedbuf) + free (mapped_toupper); + goto yes; + } + + /* Apply tolower mapping. */ + mapped_tolower = U_TOLOWER (norms, norms_length, iso639_language, NULL, + mapped_toupper, &mapped_length); + if (mapped_tolower == NULL) + { + if (mapped_toupper != mappedbuf) + { + int saved_errno = errno; + free (mapped_toupper); + errno = saved_errno; + } + goto fail; + } + + if (mapped_toupper != mapped_tolower && mapped_toupper != mappedbuf) + free (mapped_toupper); + + /* Compare. */ + if (!(mapped_length == norms_length + && U_CMP (mapped_tolower, norms, norms_length) == 0)) + { + if (mapped_tolower != mappedbuf) + free (mapped_tolower); + goto yes; + } + + /* Apply totitle mapping. */ + mapped_totitle = U_TOTITLE (norms, norms_length, iso639_language, NULL, + mapped_tolower, &mapped_length); + if (mapped_totitle == NULL) + { + if (mapped_tolower != mappedbuf) + { + int saved_errno = errno; + free (mapped_tolower); + errno = saved_errno; + } + goto fail; + } + + if (mapped_tolower != mapped_totitle && mapped_tolower != mappedbuf) + free (mapped_tolower); + + /* Compare. */ + if (!(mapped_length == norms_length + && U_CMP (mapped_totitle, norms, norms_length) == 0)) + { + if (mapped_totitle != mappedbuf) + free (mapped_totitle); + goto yes; + } + + if (mapped_totitle != mappedbuf) + free (mapped_totitle); + if (norms != normsbuf) + free (norms); + *resultp = false; + return 0; + + yes: + if (norms != normsbuf) + free (norms); + *resultp = true; + return 0; + + fail: + if (norms != normsbuf) + { + int saved_errno = errno; + free (norms); + errno = saved_errno; + } + return -1; +} diff --git a/lib/unicase/u-is-invariant.h b/lib/unicase/u-is-invariant.h new file mode 100644 index 00000000..e6b7fbb4 --- /dev/null +++ b/lib/unicase/u-is-invariant.h @@ -0,0 +1,64 @@ +/* Test whether a Unicode string is invariant under a given case mapping. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 . */ + +int +FUNC (const UNIT *s, size_t n, + UNIT * (*mapping) (const UNIT *s, size_t n, const char *iso639_language, + uninorm_t nf, + UNIT *resultbuf, size_t *lengthp), + const char *iso639_language, + bool *resultp) +{ + UNIT normsbuf[2048 / sizeof (UNIT)]; + UNIT *norms; + size_t norms_length; + UNIT mappedbuf[2048 / sizeof (UNIT)]; + UNIT *mapped; + size_t mapped_length; + + /* Apply canonical decomposition to S. */ + norms_length = sizeof (normsbuf) / sizeof (UNIT); + norms = U_NORMALIZE (UNINORM_NFD, s, n, normsbuf, &norms_length); + if (norms == NULL) + /* errno is set here. */ + return -1; + + /* Apply mapping. */ + mapped_length = sizeof (mappedbuf) / sizeof (UNIT); + mapped = mapping (norms, norms_length, iso639_language, NULL, + mappedbuf, &mapped_length); + if (mapped == NULL) + { + if (norms != normsbuf) + { + int saved_errno = errno; + free (norms); + errno = saved_errno; + } + return -1; + } + + /* Compare. */ + *resultp = (mapped_length == norms_length + && U_CMP (mapped, norms, norms_length) == 0); + + if (mapped != mappedbuf) + free (mapped); + if (norms != normsbuf) + free (norms); + return 0; +} diff --git a/lib/unicase/u-totitle.h b/lib/unicase/u-totitle.h new file mode 100644 index 00000000..431f000a --- /dev/null +++ b/lib/unicase/u-totitle.h @@ -0,0 +1,28 @@ +/* Titlecase mapping for UTF-8/UTF-16/UTF-32 strings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 . */ + +UNIT * +FUNC (const UNIT *s, size_t n, const char *iso639_language, + uninorm_t nf, + UNIT *resultbuf, size_t *lengthp) +{ + return U_CT_TOTITLE (s, n, + unicase_empty_prefix_context, unicase_empty_suffix_context, + iso639_language, + nf, + resultbuf, lengthp); +} diff --git a/lib/unicase/u16-casecmp.c b/lib/unicase/u16-casecmp.c new file mode 100644 index 00000000..1110874e --- /dev/null +++ b/lib/unicase/u16-casecmp.c @@ -0,0 +1,35 @@ +/* Case and normalization insensitive comparison of UTF-16 strings. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include +#include + +#include "minmax.h" +#include "uninorm.h" +#include "unistr.h" + +#define FUNC u16_casecmp +#define UNIT uint16_t +#define SRC_UNIT uint16_t +#define U_CASEFOLD u16_casefold +#define U_CMP2 u16_cmp2 +#include "u-casecmp.h" diff --git a/lib/unicase/u16-casecoll.c b/lib/unicase/u16-casecoll.c new file mode 100644 index 00000000..882039cf --- /dev/null +++ b/lib/unicase/u16-casecoll.c @@ -0,0 +1,32 @@ +/* Locale dependent, case and normalization insensitive comparison of UTF-16 + strings. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include +#include + +#include "memcmp2.h" + +#define FUNC u16_casecoll +#define UNIT uint16_t +#define U_CASEXFRM u16_casexfrm +#include "u-casecoll.h" diff --git a/lib/unicase/u16-casefold.c b/lib/unicase/u16-casefold.c new file mode 100644 index 00000000..55522753 --- /dev/null +++ b/lib/unicase/u16-casefold.c @@ -0,0 +1,26 @@ +/* Casefolding mapping for UTF-16 strings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#define FUNC u16_casefold +#define UNIT uint16_t +#define U_CT_CASEFOLD u16_ct_casefold +#include "u-casefold.h" diff --git a/lib/unicase/u16-casemap.c b/lib/unicase/u16-casemap.c new file mode 100644 index 00000000..0766de92 --- /dev/null +++ b/lib/unicase/u16-casemap.c @@ -0,0 +1,40 @@ +/* Case mapping for UTF-16 strings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicasemap.h" + +#include +#include +#include + +#include "unistr.h" +#include "unictype.h" +#include "uninorm.h" +#include "caseprop.h" +#include "context.h" +#include "special-casing.h" + +#define FUNC u16_casemap +#define UNIT uint16_t +#define U_MBTOUC_UNSAFE u16_mbtouc_unsafe +#define U_UCTOMB u16_uctomb +#define U_CPY u16_cpy +#define U_NORMALIZE u16_normalize +#include "u-casemap.h" diff --git a/lib/unicase/u16-casexfrm.c b/lib/unicase/u16-casexfrm.c new file mode 100644 index 00000000..09d08ce1 --- /dev/null +++ b/lib/unicase/u16-casexfrm.c @@ -0,0 +1,35 @@ +/* Locale dependent transformation for case insensitive comparison of UTF-16 + strings. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include +#include + +#include "localcharset.h" +#include "uniconv.h" +#include "memxfrm.h" + +#define FUNC u16_casexfrm +#define UNIT uint16_t +#define U_CASEFOLD u16_casefold +#define U_CONV_TO_ENCODING u16_conv_to_encoding +#include "u-casexfrm.h" diff --git a/lib/unicase/u16-ct-casefold.c b/lib/unicase/u16-ct-casefold.c new file mode 100644 index 00000000..6dff77d7 --- /dev/null +++ b/lib/unicase/u16-ct-casefold.c @@ -0,0 +1,35 @@ +/* Casefolding mapping for UTF-16 substrings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include +#include +#include + +#include "unicasemap.h" +#include "special-casing.h" +#include "casefold.h" + +#define FUNC u16_ct_casefold +#define UNIT uint16_t +#define U_CASEMAP u16_casemap +#define U_NORMALIZE u16_normalize +#include "u-ct-casefold.h" diff --git a/lib/unicase/u16-ct-tolower.c b/lib/unicase/u16-ct-tolower.c new file mode 100644 index 00000000..36b34e04 --- /dev/null +++ b/lib/unicase/u16-ct-tolower.c @@ -0,0 +1,40 @@ +/* Lowercase mapping for UTF-16 substrings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include + +#include "unicasemap.h" +#include "special-casing.h" + +uint16_t * +u16_ct_tolower (const uint16_t *s, size_t n, + casing_prefix_context_t prefix_context, + casing_suffix_context_t suffix_context, + const char *iso639_language, + uninorm_t nf, + uint16_t *resultbuf, size_t *lengthp) +{ + return u16_casemap (s, n, prefix_context, suffix_context, iso639_language, + uc_tolower, offsetof (struct special_casing_rule, lower[0]), + nf, + resultbuf, lengthp); +} diff --git a/lib/unicase/u16-ct-totitle.c b/lib/unicase/u16-ct-totitle.c new file mode 100644 index 00000000..c01021b8 --- /dev/null +++ b/lib/unicase/u16-ct-totitle.c @@ -0,0 +1,43 @@ +/* Titlecase mapping for UTF-16 substrings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include +#include +#include +#include + +#include "unistr.h" +#include "unictype.h" +#include "uniwbrk.h" +#include "uninorm.h" +#include "caseprop.h" +#include "context.h" +#include "special-casing.h" + +#define FUNC u16_ct_totitle +#define UNIT uint16_t +#define U_WORDBREAKS u16_wordbreaks +#define U_MBTOUC_UNSAFE u16_mbtouc_unsafe +#define U_UCTOMB u16_uctomb +#define U_CPY u16_cpy +#define U_NORMALIZE u16_normalize +#include "u-ct-totitle.h" diff --git a/lib/unicase/u16-ct-toupper.c b/lib/unicase/u16-ct-toupper.c new file mode 100644 index 00000000..029c74b4 --- /dev/null +++ b/lib/unicase/u16-ct-toupper.c @@ -0,0 +1,40 @@ +/* Uppercase mapping for UTF-16 substrings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include + +#include "unicasemap.h" +#include "special-casing.h" + +uint16_t * +u16_ct_toupper (const uint16_t *s, size_t n, + casing_prefix_context_t prefix_context, + casing_suffix_context_t suffix_context, + const char *iso639_language, + uninorm_t nf, + uint16_t *resultbuf, size_t *lengthp) +{ + return u16_casemap (s, n, prefix_context, suffix_context, iso639_language, + uc_toupper, offsetof (struct special_casing_rule, upper[0]), + nf, + resultbuf, lengthp); +} diff --git a/lib/unicase/u16-is-cased.c b/lib/unicase/u16-is-cased.c new file mode 100644 index 00000000..c2196cef --- /dev/null +++ b/lib/unicase/u16-is-cased.c @@ -0,0 +1,36 @@ +/* Test whether case matters for an UTF-16 string. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include +#include + +#include "uninorm.h" +#include "unistr.h" + +#define FUNC u16_is_cased +#define UNIT uint16_t +#define U_NORMALIZE u16_normalize +#define U_TOUPPER u16_toupper +#define U_TOLOWER u16_tolower +#define U_TOTITLE u16_totitle +#define U_CMP u16_cmp +#include "u-is-cased.h" diff --git a/lib/unicase/u16-is-casefolded.c b/lib/unicase/u16-is-casefolded.c new file mode 100644 index 00000000..64a4ec18 --- /dev/null +++ b/lib/unicase/u16-is-casefolded.c @@ -0,0 +1,30 @@ +/* Test whether an UTF-16 string is already case-folded. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include "unicase/invariant.h" + +int +u16_is_casefolded (const uint16_t *s, size_t n, const char *iso639_language, + bool *resultp) +{ + return u16_is_invariant (s, n, u16_casefold, iso639_language, resultp); +} diff --git a/lib/unicase/u16-is-invariant.c b/lib/unicase/u16-is-invariant.c new file mode 100644 index 00000000..cace25a7 --- /dev/null +++ b/lib/unicase/u16-is-invariant.c @@ -0,0 +1,33 @@ +/* Test whether an UTF-16 string is invariant under a given case mapping. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase/invariant.h" + +#include +#include + +#include "uninorm.h" +#include "unistr.h" + +#define FUNC u16_is_invariant +#define UNIT uint16_t +#define U_NORMALIZE u16_normalize +#define U_CMP u16_cmp +#include "u-is-invariant.h" diff --git a/lib/unicase/u16-is-lowercase.c b/lib/unicase/u16-is-lowercase.c new file mode 100644 index 00000000..36a01512 --- /dev/null +++ b/lib/unicase/u16-is-lowercase.c @@ -0,0 +1,30 @@ +/* Test whether an UTF-16 string is entirely lower case. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include "unicase/invariant.h" + +int +u16_is_lowercase (const uint16_t *s, size_t n, const char *iso639_language, + bool *resultp) +{ + return u16_is_invariant (s, n, u16_tolower, iso639_language, resultp); +} diff --git a/lib/unicase/u16-is-titlecase.c b/lib/unicase/u16-is-titlecase.c new file mode 100644 index 00000000..19aacea1 --- /dev/null +++ b/lib/unicase/u16-is-titlecase.c @@ -0,0 +1,30 @@ +/* Test whether an UTF-16 string is entirely title case. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include "unicase/invariant.h" + +int +u16_is_titlecase (const uint16_t *s, size_t n, const char *iso639_language, + bool *resultp) +{ + return u16_is_invariant (s, n, u16_totitle, iso639_language, resultp); +} diff --git a/lib/unicase/u16-is-uppercase.c b/lib/unicase/u16-is-uppercase.c new file mode 100644 index 00000000..53e697fd --- /dev/null +++ b/lib/unicase/u16-is-uppercase.c @@ -0,0 +1,30 @@ +/* Test whether an UTF-16 string is entirely upper case. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include "unicase/invariant.h" + +int +u16_is_uppercase (const uint16_t *s, size_t n, const char *iso639_language, + bool *resultp) +{ + return u16_is_invariant (s, n, u16_toupper, iso639_language, resultp); +} diff --git a/lib/unicase/u16-tolower.c b/lib/unicase/u16-tolower.c new file mode 100644 index 00000000..0629cb4d --- /dev/null +++ b/lib/unicase/u16-tolower.c @@ -0,0 +1,39 @@ +/* Lowercase mapping for UTF-16 strings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include + +#include "unicasemap.h" +#include "special-casing.h" + +uint16_t * +u16_tolower (const uint16_t *s, size_t n, const char *iso639_language, + uninorm_t nf, + uint16_t *resultbuf, size_t *lengthp) +{ + return u16_casemap (s, n, + unicase_empty_prefix_context, unicase_empty_suffix_context, + iso639_language, + uc_tolower, offsetof (struct special_casing_rule, lower[0]), + nf, + resultbuf, lengthp); +} diff --git a/lib/unicase/u16-totitle.c b/lib/unicase/u16-totitle.c new file mode 100644 index 00000000..e0d14e83 --- /dev/null +++ b/lib/unicase/u16-totitle.c @@ -0,0 +1,27 @@ +/* Titlecase mapping for UTF-16 strings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#define FUNC u16_totitle +#define UNIT uint16_t +#define U_CT_TOTITLE u16_ct_totitle +#include "u-totitle.h" + diff --git a/lib/unicase/u16-toupper.c b/lib/unicase/u16-toupper.c new file mode 100644 index 00000000..f92989aa --- /dev/null +++ b/lib/unicase/u16-toupper.c @@ -0,0 +1,39 @@ +/* Uppercase mapping for UTF-16 strings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include + +#include "unicasemap.h" +#include "special-casing.h" + +uint16_t * +u16_toupper (const uint16_t *s, size_t n, const char *iso639_language, + uninorm_t nf, + uint16_t *resultbuf, size_t *lengthp) +{ + return u16_casemap (s, n, + unicase_empty_prefix_context, unicase_empty_suffix_context, + iso639_language, + uc_toupper, offsetof (struct special_casing_rule, upper[0]), + nf, + resultbuf, lengthp); +} diff --git a/lib/unicase/u32-casecmp.c b/lib/unicase/u32-casecmp.c new file mode 100644 index 00000000..e964915f --- /dev/null +++ b/lib/unicase/u32-casecmp.c @@ -0,0 +1,35 @@ +/* Case and normalization insensitive comparison of UTF-32 strings. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include +#include + +#include "minmax.h" +#include "uninorm.h" +#include "unistr.h" + +#define FUNC u32_casecmp +#define UNIT uint32_t +#define SRC_UNIT uint32_t +#define U_CASEFOLD u32_casefold +#define U_CMP2 u32_cmp2 +#include "u-casecmp.h" diff --git a/lib/unicase/u32-casecoll.c b/lib/unicase/u32-casecoll.c new file mode 100644 index 00000000..88d994a0 --- /dev/null +++ b/lib/unicase/u32-casecoll.c @@ -0,0 +1,32 @@ +/* Locale dependent, case and normalization insensitive comparison of UTF-32 + strings. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include +#include + +#include "memcmp2.h" + +#define FUNC u32_casecoll +#define UNIT uint32_t +#define U_CASEXFRM u32_casexfrm +#include "u-casecoll.h" diff --git a/lib/unicase/u32-casefold.c b/lib/unicase/u32-casefold.c new file mode 100644 index 00000000..aff44f82 --- /dev/null +++ b/lib/unicase/u32-casefold.c @@ -0,0 +1,26 @@ +/* Casefolding mapping for UTF-32 strings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#define FUNC u32_casefold +#define UNIT uint32_t +#define U_CT_CASEFOLD u32_ct_casefold +#include "u-casefold.h" diff --git a/lib/unicase/u32-casemap.c b/lib/unicase/u32-casemap.c new file mode 100644 index 00000000..43e2641c --- /dev/null +++ b/lib/unicase/u32-casemap.c @@ -0,0 +1,40 @@ +/* Case mapping for UTF-32 strings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicasemap.h" + +#include +#include +#include + +#include "unistr.h" +#include "unictype.h" +#include "uninorm.h" +#include "caseprop.h" +#include "context.h" +#include "special-casing.h" + +#define FUNC u32_casemap +#define UNIT uint32_t +#define U_MBTOUC_UNSAFE u32_mbtouc_unsafe +#define U_UCTOMB u32_uctomb +#define U_CPY u32_cpy +#define U_NORMALIZE u32_normalize +#include "u-casemap.h" diff --git a/lib/unicase/u32-casexfrm.c b/lib/unicase/u32-casexfrm.c new file mode 100644 index 00000000..cf8fee67 --- /dev/null +++ b/lib/unicase/u32-casexfrm.c @@ -0,0 +1,35 @@ +/* Locale dependent transformation for case insensitive comparison of UTF-32 + strings. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include +#include + +#include "localcharset.h" +#include "uniconv.h" +#include "memxfrm.h" + +#define FUNC u32_casexfrm +#define UNIT uint32_t +#define U_CASEFOLD u32_casefold +#define U_CONV_TO_ENCODING u32_conv_to_encoding +#include "u-casexfrm.h" diff --git a/lib/unicase/u32-ct-casefold.c b/lib/unicase/u32-ct-casefold.c new file mode 100644 index 00000000..e206b677 --- /dev/null +++ b/lib/unicase/u32-ct-casefold.c @@ -0,0 +1,35 @@ +/* Casefolding mapping for UTF-32 substrings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include +#include +#include + +#include "unicasemap.h" +#include "special-casing.h" +#include "casefold.h" + +#define FUNC u32_ct_casefold +#define UNIT uint32_t +#define U_CASEMAP u32_casemap +#define U_NORMALIZE u32_normalize +#include "u-ct-casefold.h" diff --git a/lib/unicase/u32-ct-tolower.c b/lib/unicase/u32-ct-tolower.c new file mode 100644 index 00000000..83e9fa84 --- /dev/null +++ b/lib/unicase/u32-ct-tolower.c @@ -0,0 +1,40 @@ +/* Lowercase mapping for UTF-32 substrings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include + +#include "unicasemap.h" +#include "special-casing.h" + +uint32_t * +u32_ct_tolower (const uint32_t *s, size_t n, + casing_prefix_context_t prefix_context, + casing_suffix_context_t suffix_context, + const char *iso639_language, + uninorm_t nf, + uint32_t *resultbuf, size_t *lengthp) +{ + return u32_casemap (s, n, prefix_context, suffix_context, iso639_language, + uc_tolower, offsetof (struct special_casing_rule, lower[0]), + nf, + resultbuf, lengthp); +} diff --git a/lib/unicase/u32-ct-totitle.c b/lib/unicase/u32-ct-totitle.c new file mode 100644 index 00000000..f2a38782 --- /dev/null +++ b/lib/unicase/u32-ct-totitle.c @@ -0,0 +1,43 @@ +/* Titlecase mapping for UTF-32 substrings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include +#include +#include +#include + +#include "unistr.h" +#include "unictype.h" +#include "uniwbrk.h" +#include "uninorm.h" +#include "caseprop.h" +#include "context.h" +#include "special-casing.h" + +#define FUNC u32_ct_totitle +#define UNIT uint32_t +#define U_WORDBREAKS u32_wordbreaks +#define U_MBTOUC_UNSAFE u32_mbtouc_unsafe +#define U_UCTOMB u32_uctomb +#define U_CPY u32_cpy +#define U_NORMALIZE u32_normalize +#include "u-ct-totitle.h" diff --git a/lib/unicase/u32-ct-toupper.c b/lib/unicase/u32-ct-toupper.c new file mode 100644 index 00000000..9043ddeb --- /dev/null +++ b/lib/unicase/u32-ct-toupper.c @@ -0,0 +1,40 @@ +/* Uppercase mapping for UTF-32 substrings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include + +#include "unicasemap.h" +#include "special-casing.h" + +uint32_t * +u32_ct_toupper (const uint32_t *s, size_t n, + casing_prefix_context_t prefix_context, + casing_suffix_context_t suffix_context, + const char *iso639_language, + uninorm_t nf, + uint32_t *resultbuf, size_t *lengthp) +{ + return u32_casemap (s, n, prefix_context, suffix_context, iso639_language, + uc_toupper, offsetof (struct special_casing_rule, upper[0]), + nf, + resultbuf, lengthp); +} diff --git a/lib/unicase/u32-is-cased.c b/lib/unicase/u32-is-cased.c new file mode 100644 index 00000000..783e57e9 --- /dev/null +++ b/lib/unicase/u32-is-cased.c @@ -0,0 +1,36 @@ +/* Test whether case matters for an UTF-32 string. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include +#include + +#include "uninorm.h" +#include "unistr.h" + +#define FUNC u32_is_cased +#define UNIT uint32_t +#define U_NORMALIZE u32_normalize +#define U_TOUPPER u32_toupper +#define U_TOLOWER u32_tolower +#define U_TOTITLE u32_totitle +#define U_CMP u32_cmp +#include "u-is-cased.h" diff --git a/lib/unicase/u32-is-casefolded.c b/lib/unicase/u32-is-casefolded.c new file mode 100644 index 00000000..a71c767d --- /dev/null +++ b/lib/unicase/u32-is-casefolded.c @@ -0,0 +1,30 @@ +/* Test whether an UTF-32 string is already case-folded. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include "unicase/invariant.h" + +int +u32_is_casefolded (const uint32_t *s, size_t n, const char *iso639_language, + bool *resultp) +{ + return u32_is_invariant (s, n, u32_casefold, iso639_language, resultp); +} diff --git a/lib/unicase/u32-is-invariant.c b/lib/unicase/u32-is-invariant.c new file mode 100644 index 00000000..190a30fe --- /dev/null +++ b/lib/unicase/u32-is-invariant.c @@ -0,0 +1,33 @@ +/* Test whether an UTF-32 string is invariant under a given case mapping. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase/invariant.h" + +#include +#include + +#include "uninorm.h" +#include "unistr.h" + +#define FUNC u32_is_invariant +#define UNIT uint32_t +#define U_NORMALIZE u32_normalize +#define U_CMP u32_cmp +#include "u-is-invariant.h" diff --git a/lib/unicase/u32-is-lowercase.c b/lib/unicase/u32-is-lowercase.c new file mode 100644 index 00000000..104afaae --- /dev/null +++ b/lib/unicase/u32-is-lowercase.c @@ -0,0 +1,30 @@ +/* Test whether an UTF-32 string is entirely lower case. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include "unicase/invariant.h" + +int +u32_is_lowercase (const uint32_t *s, size_t n, const char *iso639_language, + bool *resultp) +{ + return u32_is_invariant (s, n, u32_tolower, iso639_language, resultp); +} diff --git a/lib/unicase/u32-is-titlecase.c b/lib/unicase/u32-is-titlecase.c new file mode 100644 index 00000000..5b07c8dd --- /dev/null +++ b/lib/unicase/u32-is-titlecase.c @@ -0,0 +1,30 @@ +/* Test whether an UTF-32 string is entirely title case. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include "unicase/invariant.h" + +int +u32_is_titlecase (const uint32_t *s, size_t n, const char *iso639_language, + bool *resultp) +{ + return u32_is_invariant (s, n, u32_totitle, iso639_language, resultp); +} diff --git a/lib/unicase/u32-is-uppercase.c b/lib/unicase/u32-is-uppercase.c new file mode 100644 index 00000000..bb38fc69 --- /dev/null +++ b/lib/unicase/u32-is-uppercase.c @@ -0,0 +1,30 @@ +/* Test whether an UTF-32 string is entirely upper case. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include "unicase/invariant.h" + +int +u32_is_uppercase (const uint32_t *s, size_t n, const char *iso639_language, + bool *resultp) +{ + return u32_is_invariant (s, n, u32_toupper, iso639_language, resultp); +} diff --git a/lib/unicase/u32-tolower.c b/lib/unicase/u32-tolower.c new file mode 100644 index 00000000..daa5c4d3 --- /dev/null +++ b/lib/unicase/u32-tolower.c @@ -0,0 +1,39 @@ +/* Lowercase mapping for UTF-32 strings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include + +#include "unicasemap.h" +#include "special-casing.h" + +uint32_t * +u32_tolower (const uint32_t *s, size_t n, const char *iso639_language, + uninorm_t nf, + uint32_t *resultbuf, size_t *lengthp) +{ + return u32_casemap (s, n, + unicase_empty_prefix_context, unicase_empty_suffix_context, + iso639_language, + uc_tolower, offsetof (struct special_casing_rule, lower[0]), + nf, + resultbuf, lengthp); +} diff --git a/lib/unicase/u32-totitle.c b/lib/unicase/u32-totitle.c new file mode 100644 index 00000000..21e1b0d1 --- /dev/null +++ b/lib/unicase/u32-totitle.c @@ -0,0 +1,26 @@ +/* Titlecase mapping for UTF-32 strings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#define FUNC u32_totitle +#define UNIT uint32_t +#define U_CT_TOTITLE u32_ct_totitle +#include "u-totitle.h" diff --git a/lib/unicase/u32-toupper.c b/lib/unicase/u32-toupper.c new file mode 100644 index 00000000..3430ad95 --- /dev/null +++ b/lib/unicase/u32-toupper.c @@ -0,0 +1,39 @@ +/* Uppercase mapping for UTF-32 strings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include + +#include "unicasemap.h" +#include "special-casing.h" + +uint32_t * +u32_toupper (const uint32_t *s, size_t n, const char *iso639_language, + uninorm_t nf, + uint32_t *resultbuf, size_t *lengthp) +{ + return u32_casemap (s, n, + unicase_empty_prefix_context, unicase_empty_suffix_context, + iso639_language, + uc_toupper, offsetof (struct special_casing_rule, upper[0]), + nf, + resultbuf, lengthp); +} diff --git a/lib/unicase/u8-casecmp.c b/lib/unicase/u8-casecmp.c new file mode 100644 index 00000000..4a55de91 --- /dev/null +++ b/lib/unicase/u8-casecmp.c @@ -0,0 +1,35 @@ +/* Case and normalization insensitive comparison of UTF-8 strings. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include +#include + +#include "minmax.h" +#include "uninorm.h" +#include "unistr.h" + +#define FUNC u8_casecmp +#define UNIT uint8_t +#define SRC_UNIT uint8_t +#define U_CASEFOLD u8_casefold +#define U_CMP2 u8_cmp2 +#include "u-casecmp.h" diff --git a/lib/unicase/u8-casecoll.c b/lib/unicase/u8-casecoll.c new file mode 100644 index 00000000..28170e54 --- /dev/null +++ b/lib/unicase/u8-casecoll.c @@ -0,0 +1,32 @@ +/* Locale dependent, case and normalization insensitive comparison of UTF-8 + strings. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include +#include + +#include "memcmp2.h" + +#define FUNC u8_casecoll +#define UNIT uint8_t +#define U_CASEXFRM u8_casexfrm +#include "u-casecoll.h" diff --git a/lib/unicase/u8-casefold.c b/lib/unicase/u8-casefold.c new file mode 100644 index 00000000..32108137 --- /dev/null +++ b/lib/unicase/u8-casefold.c @@ -0,0 +1,107 @@ +/* Casefolding mapping for UTF-8 strings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#define FUNC u8_casefold +#define UNIT uint8_t +#define U_CT_CASEFOLD u8_ct_casefold +#include "u-casefold.h" + + +#ifdef TEST + +#include +#include +#include +#include + +/* Read the contents of an input stream, and return it, terminated with a NUL + byte. */ +char * +read_file (FILE *stream) +{ +#define BUFSIZE 4096 + char *buf = NULL; + int alloc = 0; + int size = 0; + int count; + + while (! feof (stream)) + { + if (size + BUFSIZE > alloc) + { + alloc = alloc + alloc / 2; + if (alloc < size + BUFSIZE) + alloc = size + BUFSIZE; + buf = realloc (buf, alloc); + if (buf == NULL) + { + fprintf (stderr, "out of memory\n"); + exit (1); + } + } + count = fread (buf + size, 1, BUFSIZE, stream); + if (count == 0) + { + if (ferror (stream)) + { + perror ("fread"); + exit (1); + } + } + else + size += count; + } + buf = realloc (buf, size + 1); + if (buf == NULL) + { + fprintf (stderr, "out of memory\n"); + exit (1); + } + buf[size] = '\0'; + return buf; +#undef BUFSIZE +} + +int +main (int argc, char * argv[]) +{ + setlocale (LC_ALL, ""); + if (argc == 1) + { + /* Display the case folded input string. */ + char *input = read_file (stdin); + int length = strlen (input); + size_t output_length; + uint8_t *output = + u8_casefold ((uint8_t *) input, length, uc_locale_language (), + NULL, + NULL, &output_length); + + fwrite (output, 1, output_length, stdout); + + return 0; + } + else + return 1; +} + +#endif /* TEST */ diff --git a/lib/unicase/u8-casemap.c b/lib/unicase/u8-casemap.c new file mode 100644 index 00000000..6f329155 --- /dev/null +++ b/lib/unicase/u8-casemap.c @@ -0,0 +1,40 @@ +/* Case mapping for UTF-8 strings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicasemap.h" + +#include +#include +#include + +#include "unistr.h" +#include "unictype.h" +#include "uninorm.h" +#include "caseprop.h" +#include "context.h" +#include "special-casing.h" + +#define FUNC u8_casemap +#define UNIT uint8_t +#define U_MBTOUC_UNSAFE u8_mbtouc_unsafe +#define U_UCTOMB u8_uctomb +#define U_CPY u8_cpy +#define U_NORMALIZE u8_normalize +#include "u-casemap.h" diff --git a/lib/unicase/u8-casexfrm.c b/lib/unicase/u8-casexfrm.c new file mode 100644 index 00000000..7e1d767c --- /dev/null +++ b/lib/unicase/u8-casexfrm.c @@ -0,0 +1,35 @@ +/* Locale dependent transformation for case insensitive comparison of UTF-8 + strings. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include +#include + +#include "localcharset.h" +#include "uniconv.h" +#include "memxfrm.h" + +#define FUNC u8_casexfrm +#define UNIT uint8_t +#define U_CASEFOLD u8_casefold +#define U_CONV_TO_ENCODING u8_conv_to_encoding +#include "u-casexfrm.h" diff --git a/lib/unicase/u8-ct-casefold.c b/lib/unicase/u8-ct-casefold.c new file mode 100644 index 00000000..4cc149c3 --- /dev/null +++ b/lib/unicase/u8-ct-casefold.c @@ -0,0 +1,35 @@ +/* Casefolding mapping for UTF-8 substrings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include +#include +#include + +#include "unicasemap.h" +#include "special-casing.h" +#include "casefold.h" + +#define FUNC u8_ct_casefold +#define UNIT uint8_t +#define U_CASEMAP u8_casemap +#define U_NORMALIZE u8_normalize +#include "u-ct-casefold.h" diff --git a/lib/unicase/u8-ct-tolower.c b/lib/unicase/u8-ct-tolower.c new file mode 100644 index 00000000..3755821e --- /dev/null +++ b/lib/unicase/u8-ct-tolower.c @@ -0,0 +1,40 @@ +/* Lowercase mapping for UTF-8 substrings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include + +#include "unicasemap.h" +#include "special-casing.h" + +uint8_t * +u8_ct_tolower (const uint8_t *s, size_t n, + casing_prefix_context_t prefix_context, + casing_suffix_context_t suffix_context, + const char *iso639_language, + uninorm_t nf, + uint8_t *resultbuf, size_t *lengthp) +{ + return u8_casemap (s, n, prefix_context, suffix_context, iso639_language, + uc_tolower, offsetof (struct special_casing_rule, lower[0]), + nf, + resultbuf, lengthp); +} diff --git a/lib/unicase/u8-ct-totitle.c b/lib/unicase/u8-ct-totitle.c new file mode 100644 index 00000000..64891afd --- /dev/null +++ b/lib/unicase/u8-ct-totitle.c @@ -0,0 +1,43 @@ +/* Titlecase mapping for UTF-8 substrings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include +#include +#include +#include + +#include "unistr.h" +#include "unictype.h" +#include "uniwbrk.h" +#include "uninorm.h" +#include "caseprop.h" +#include "context.h" +#include "special-casing.h" + +#define FUNC u8_ct_totitle +#define UNIT uint8_t +#define U_WORDBREAKS u8_wordbreaks +#define U_MBTOUC_UNSAFE u8_mbtouc_unsafe +#define U_UCTOMB u8_uctomb +#define U_CPY u8_cpy +#define U_NORMALIZE u8_normalize +#include "u-ct-totitle.h" diff --git a/lib/unicase/u8-ct-toupper.c b/lib/unicase/u8-ct-toupper.c new file mode 100644 index 00000000..9dca2fca --- /dev/null +++ b/lib/unicase/u8-ct-toupper.c @@ -0,0 +1,40 @@ +/* Uppercase mapping for UTF-8 substrings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include + +#include "unicasemap.h" +#include "special-casing.h" + +uint8_t * +u8_ct_toupper (const uint8_t *s, size_t n, + casing_prefix_context_t prefix_context, + casing_suffix_context_t suffix_context, + const char *iso639_language, + uninorm_t nf, + uint8_t *resultbuf, size_t *lengthp) +{ + return u8_casemap (s, n, prefix_context, suffix_context, iso639_language, + uc_toupper, offsetof (struct special_casing_rule, upper[0]), + nf, + resultbuf, lengthp); +} diff --git a/lib/unicase/u8-is-cased.c b/lib/unicase/u8-is-cased.c new file mode 100644 index 00000000..5cdcc33b --- /dev/null +++ b/lib/unicase/u8-is-cased.c @@ -0,0 +1,36 @@ +/* Test whether case matters for an UTF-8 string. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include +#include + +#include "uninorm.h" +#include "unistr.h" + +#define FUNC u8_is_cased +#define UNIT uint8_t +#define U_NORMALIZE u8_normalize +#define U_TOUPPER u8_toupper +#define U_TOLOWER u8_tolower +#define U_TOTITLE u8_totitle +#define U_CMP u8_cmp +#include "u-is-cased.h" diff --git a/lib/unicase/u8-is-casefolded.c b/lib/unicase/u8-is-casefolded.c new file mode 100644 index 00000000..30122b78 --- /dev/null +++ b/lib/unicase/u8-is-casefolded.c @@ -0,0 +1,30 @@ +/* Test whether an UTF-8 string is already case-folded. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include "unicase/invariant.h" + +int +u8_is_casefolded (const uint8_t *s, size_t n, const char *iso639_language, + bool *resultp) +{ + return u8_is_invariant (s, n, u8_casefold, iso639_language, resultp); +} diff --git a/lib/unicase/u8-is-invariant.c b/lib/unicase/u8-is-invariant.c new file mode 100644 index 00000000..2c4913bf --- /dev/null +++ b/lib/unicase/u8-is-invariant.c @@ -0,0 +1,33 @@ +/* Test whether an UTF-8 string is invariant under a given case mapping. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase/invariant.h" + +#include +#include + +#include "uninorm.h" +#include "unistr.h" + +#define FUNC u8_is_invariant +#define UNIT uint8_t +#define U_NORMALIZE u8_normalize +#define U_CMP u8_cmp +#include "u-is-invariant.h" diff --git a/lib/unicase/u8-is-lowercase.c b/lib/unicase/u8-is-lowercase.c new file mode 100644 index 00000000..5b0df8be --- /dev/null +++ b/lib/unicase/u8-is-lowercase.c @@ -0,0 +1,30 @@ +/* Test whether an UTF-8 string is entirely lower case. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include "unicase/invariant.h" + +int +u8_is_lowercase (const uint8_t *s, size_t n, const char *iso639_language, + bool *resultp) +{ + return u8_is_invariant (s, n, u8_tolower, iso639_language, resultp); +} diff --git a/lib/unicase/u8-is-titlecase.c b/lib/unicase/u8-is-titlecase.c new file mode 100644 index 00000000..474502a7 --- /dev/null +++ b/lib/unicase/u8-is-titlecase.c @@ -0,0 +1,30 @@ +/* Test whether an UTF-8 string is entirely title case. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include "unicase/invariant.h" + +int +u8_is_titlecase (const uint8_t *s, size_t n, const char *iso639_language, + bool *resultp) +{ + return u8_is_invariant (s, n, u8_totitle, iso639_language, resultp); +} diff --git a/lib/unicase/u8-is-uppercase.c b/lib/unicase/u8-is-uppercase.c new file mode 100644 index 00000000..7f14f924 --- /dev/null +++ b/lib/unicase/u8-is-uppercase.c @@ -0,0 +1,30 @@ +/* Test whether an UTF-8 string is entirely upper case. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include "unicase/invariant.h" + +int +u8_is_uppercase (const uint8_t *s, size_t n, const char *iso639_language, + bool *resultp) +{ + return u8_is_invariant (s, n, u8_toupper, iso639_language, resultp); +} diff --git a/lib/unicase/u8-tolower.c b/lib/unicase/u8-tolower.c new file mode 100644 index 00000000..1cd7cfa4 --- /dev/null +++ b/lib/unicase/u8-tolower.c @@ -0,0 +1,120 @@ +/* Lowercase mapping for UTF-8 strings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include + +#include "unicasemap.h" +#include "special-casing.h" + +uint8_t * +u8_tolower (const uint8_t *s, size_t n, const char *iso639_language, + uninorm_t nf, + uint8_t *resultbuf, size_t *lengthp) +{ + return u8_casemap (s, n, + unicase_empty_prefix_context, unicase_empty_suffix_context, + iso639_language, + uc_tolower, offsetof (struct special_casing_rule, lower[0]), + nf, + resultbuf, lengthp); +} + + +#ifdef TEST + +#include +#include +#include +#include + +/* Read the contents of an input stream, and return it, terminated with a NUL + byte. */ +char * +read_file (FILE *stream) +{ +#define BUFSIZE 4096 + char *buf = NULL; + int alloc = 0; + int size = 0; + int count; + + while (! feof (stream)) + { + if (size + BUFSIZE > alloc) + { + alloc = alloc + alloc / 2; + if (alloc < size + BUFSIZE) + alloc = size + BUFSIZE; + buf = realloc (buf, alloc); + if (buf == NULL) + { + fprintf (stderr, "out of memory\n"); + exit (1); + } + } + count = fread (buf + size, 1, BUFSIZE, stream); + if (count == 0) + { + if (ferror (stream)) + { + perror ("fread"); + exit (1); + } + } + else + size += count; + } + buf = realloc (buf, size + 1); + if (buf == NULL) + { + fprintf (stderr, "out of memory\n"); + exit (1); + } + buf[size] = '\0'; + return buf; +#undef BUFSIZE +} + +int +main (int argc, char * argv[]) +{ + setlocale (LC_ALL, ""); + if (argc == 1) + { + /* Display the lower case of the input string. */ + char *input = read_file (stdin); + int length = strlen (input); + size_t output_length; + uint8_t *output = + u8_tolower ((uint8_t *) input, length, uc_locale_language (), + NULL, + NULL, &output_length); + + fwrite (output, 1, output_length, stdout); + + return 0; + } + else + return 1; +} + +#endif /* TEST */ diff --git a/lib/unicase/u8-totitle.c b/lib/unicase/u8-totitle.c new file mode 100644 index 00000000..cf29c1ba --- /dev/null +++ b/lib/unicase/u8-totitle.c @@ -0,0 +1,107 @@ +/* Titlecase mapping for UTF-8 strings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#define FUNC u8_totitle +#define UNIT uint8_t +#define U_CT_TOTITLE u8_ct_totitle +#include "u-totitle.h" + + +#ifdef TEST + +#include +#include +#include +#include + +/* Read the contents of an input stream, and return it, terminated with a NUL + byte. */ +char * +read_file (FILE *stream) +{ +#define BUFSIZE 4096 + char *buf = NULL; + int alloc = 0; + int size = 0; + int count; + + while (! feof (stream)) + { + if (size + BUFSIZE > alloc) + { + alloc = alloc + alloc / 2; + if (alloc < size + BUFSIZE) + alloc = size + BUFSIZE; + buf = realloc (buf, alloc); + if (buf == NULL) + { + fprintf (stderr, "out of memory\n"); + exit (1); + } + } + count = fread (buf + size, 1, BUFSIZE, stream); + if (count == 0) + { + if (ferror (stream)) + { + perror ("fread"); + exit (1); + } + } + else + size += count; + } + buf = realloc (buf, size + 1); + if (buf == NULL) + { + fprintf (stderr, "out of memory\n"); + exit (1); + } + buf[size] = '\0'; + return buf; +#undef BUFSIZE +} + +int +main (int argc, char * argv[]) +{ + setlocale (LC_ALL, ""); + if (argc == 1) + { + /* Display the upper case of the input string. */ + char *input = read_file (stdin); + int length = strlen (input); + size_t output_length; + uint8_t *output = + u8_toupper ((uint8_t *) input, length, uc_locale_language (), + NULL, + NULL, &output_length); + + fwrite (output, 1, output_length, stdout); + + return 0; + } + else + return 1; +} + +#endif /* TEST */ diff --git a/lib/unicase/u8-toupper.c b/lib/unicase/u8-toupper.c new file mode 100644 index 00000000..a97d98ce --- /dev/null +++ b/lib/unicase/u8-toupper.c @@ -0,0 +1,120 @@ +/* Uppercase mapping for UTF-8 strings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include + +#include "unicasemap.h" +#include "special-casing.h" + +uint8_t * +u8_toupper (const uint8_t *s, size_t n, const char *iso639_language, + uninorm_t nf, + uint8_t *resultbuf, size_t *lengthp) +{ + return u8_casemap (s, n, + unicase_empty_prefix_context, unicase_empty_suffix_context, + iso639_language, + uc_toupper, offsetof (struct special_casing_rule, upper[0]), + nf, + resultbuf, lengthp); +} + + +#ifdef TEST + +#include +#include +#include +#include + +/* Read the contents of an input stream, and return it, terminated with a NUL + byte. */ +char * +read_file (FILE *stream) +{ +#define BUFSIZE 4096 + char *buf = NULL; + int alloc = 0; + int size = 0; + int count; + + while (! feof (stream)) + { + if (size + BUFSIZE > alloc) + { + alloc = alloc + alloc / 2; + if (alloc < size + BUFSIZE) + alloc = size + BUFSIZE; + buf = realloc (buf, alloc); + if (buf == NULL) + { + fprintf (stderr, "out of memory\n"); + exit (1); + } + } + count = fread (buf + size, 1, BUFSIZE, stream); + if (count == 0) + { + if (ferror (stream)) + { + perror ("fread"); + exit (1); + } + } + else + size += count; + } + buf = realloc (buf, size + 1); + if (buf == NULL) + { + fprintf (stderr, "out of memory\n"); + exit (1); + } + buf[size] = '\0'; + return buf; +#undef BUFSIZE +} + +int +main (int argc, char * argv[]) +{ + setlocale (LC_ALL, ""); + if (argc == 1) + { + /* Display the upper case of the input string. */ + char *input = read_file (stdin); + int length = strlen (input); + size_t output_length; + uint8_t *output = + u8_toupper ((uint8_t *) input, length, uc_locale_language (), + NULL, + NULL, &output_length); + + fwrite (output, 1, output_length, stdout); + + return 0; + } + else + return 1; +} + +#endif /* TEST */ diff --git a/lib/unicase/ulc-casecmp.c b/lib/unicase/ulc-casecmp.c new file mode 100644 index 00000000..e0710219 --- /dev/null +++ b/lib/unicase/ulc-casecmp.c @@ -0,0 +1,74 @@ +/* Case and normalization insensitive comparison of strings. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include +#include + +#include "minmax.h" +#include "uninorm.h" +#include "uniconv.h" +#include "unistr.h" + +static uint8_t * +ulc_u8_casefold (const char *s, size_t n, const char *iso639_language, + uninorm_t nf, + uint8_t *resultbuf, size_t *lengthp) +{ + uint8_t convbuf[2048 / sizeof (uint8_t)]; + uint8_t *conv; + size_t conv_length; + uint8_t *result; + + /* Convert the string to UTF-8. */ + conv_length = sizeof (convbuf) / sizeof (uint8_t); + conv = + u8_conv_from_encoding (locale_charset (), iconveh_error, s, n, NULL, + convbuf, &conv_length); + if (conv == NULL) + /* errno is set here. */ + return NULL; + + /* Case-fold and normalize. */ + result = u8_casefold (conv, conv_length, iso639_language, nf, + resultbuf, lengthp); + if (result == NULL) + { + if (conv != convbuf) + { + int saved_errno = errno; + free (conv); + errno = saved_errno; + } + return NULL; + } + + if (conv != convbuf) + free (conv); + return result; +} + +#define FUNC ulc_casecmp +#define UNIT uint8_t +#define SRC_UNIT char +#define U_CASEFOLD ulc_u8_casefold +#define U_CMP2 u8_cmp2 +#include "u-casecmp.h" diff --git a/lib/unicase/ulc-casecoll.c b/lib/unicase/ulc-casecoll.c new file mode 100644 index 00000000..9730b6dc --- /dev/null +++ b/lib/unicase/ulc-casecoll.c @@ -0,0 +1,31 @@ +/* Locale dependent, case and normalization insensitive comparison of strings. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include +#include + +#include "memcmp2.h" + +#define FUNC ulc_casecoll +#define UNIT char +#define U_CASEXFRM ulc_casexfrm +#include "u-casecoll.h" diff --git a/lib/unicase/ulc-casexfrm.c b/lib/unicase/ulc-casexfrm.c new file mode 100644 index 00000000..aded556f --- /dev/null +++ b/lib/unicase/ulc-casexfrm.c @@ -0,0 +1,64 @@ +/* Locale dependent transformation for case insensitive comparison of strings. + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "unicase.h" + +#include +#include + +#include "uniconv.h" + +char * +ulc_casexfrm (const char *s, size_t n, const char *iso639_language, + uninorm_t nf, + char *resultbuf, size_t *lengthp) +{ + uint8_t convbuf[2048 / sizeof (uint8_t)]; + uint8_t *conv; + size_t conv_length; + char *result; + + /* Convert the string to UTF-8. */ + conv_length = sizeof (convbuf) / sizeof (uint8_t); + conv = + u8_conv_from_encoding (locale_charset (), iconveh_error, s, n, NULL, + convbuf, &conv_length); + if (conv == NULL) + /* errno is set here. */ + return NULL; + + /* Case-fold and normalize. */ + result = u8_casexfrm (conv, conv_length, iso639_language, nf, + resultbuf, lengthp); + if (result == NULL) + { + if (conv != convbuf) + { + int saved_errno = errno; + free (conv); + errno = saved_errno; + } + return NULL; + } + + if (conv != convbuf) + free (conv); + return result; +} diff --git a/lib/unicase/unicasemap.h b/lib/unicase/unicasemap.h new file mode 100644 index 00000000..8da8c51d --- /dev/null +++ b/lib/unicase/unicasemap.h @@ -0,0 +1,52 @@ +/* Case mapping for UTF-8/UTF-16/UTF-32 strings (locale dependent). + Copyright (C) 2009 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 + +#include "unitypes.h" +#include "unicase.h" +#include "uninorm.h" + +extern uint8_t * + u8_casemap (const uint8_t *s, size_t n, + casing_prefix_context_t prefix_context, + casing_suffix_context_t suffix_context, + const char *iso639_language, + ucs4_t (*single_character_map) (ucs4_t), + size_t offset_in_rule, /* offset in 'struct special_casing_rule' */ + uninorm_t nf, + uint8_t *resultbuf, size_t *lengthp); + +extern uint16_t * + u16_casemap (const uint16_t *s, size_t n, + casing_prefix_context_t prefix_context, + casing_suffix_context_t suffix_context, + const char *iso639_language, + ucs4_t (*single_character_map) (ucs4_t), + size_t offset_in_rule, /* offset in 'struct special_casing_rule' */ + uninorm_t nf, + uint16_t *resultbuf, size_t *lengthp); + +extern uint32_t * + u32_casemap (const uint32_t *s, size_t n, + casing_prefix_context_t prefix_context, + casing_suffix_context_t suffix_context, + const char *iso639_language, + ucs4_t (*single_character_map) (ucs4_t), + size_t offset_in_rule, /* offset in 'struct special_casing_rule' */ + uninorm_t nf, + uint32_t *resultbuf, size_t *lengthp); -- cgit v1.2.3