Mercurial > hg > octave-kai > gnulib-hg
changeset 14473:acd1454e6a45
New module 'unictype/category-LC'.
* lib/unictype.in.h (UC_CATEGORY_MASK_LC): New enumeration value.
(UC_CATEGORY_LC): New declaration.
(UC_CASED_LETTER): New macro.
* lib/gen-uni-tables.c (is_category_LC): New function.
(output_categories): Also handle category LC.
(UC_CATEGORY_MASK_LC): New enumeration value.
(general_category_byname): Also handle category LC.
* lib/unictype/categ_LC.c: New file.
* lib/unictype/categ_LC.h: New file, automatically generated.
* lib/unictype/categ_name.c (uc_general_category_name): Also handle
category LC.
* lib/unictype/categ_byname.c (uc_general_category_byname): Likewise.
* modules/unictype/category-LC: New file.
* modules/unictype/category-all (Depends-on): Add unictype/category-LC.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Fri, 25 Mar 2011 20:23:43 +0100 |
parents | 17beee3610b7 |
children | c48f17015dd5 |
files | ChangeLog lib/gen-uni-tables.c lib/unictype.in.h lib/unictype/categ_LC.c lib/unictype/categ_LC.h lib/unictype/categ_byname.c lib/unictype/categ_name.c modules/unictype/category-LC modules/unictype/category-all |
diffstat | 9 files changed, 433 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2011-03-25 Bruno Haible <bruno@clisp.org> + + New module 'unictype/category-LC'. + * lib/unictype.in.h (UC_CATEGORY_MASK_LC): New enumeration value. + (UC_CATEGORY_LC): New declaration. + (UC_CASED_LETTER): New macro. + * lib/gen-uni-tables.c (is_category_LC): New function. + (output_categories): Also handle category LC. + (UC_CATEGORY_MASK_LC): New enumeration value. + (general_category_byname): Also handle category LC. + * lib/unictype/categ_LC.c: New file. + * lib/unictype/categ_LC.h: New file, automatically generated. + * lib/unictype/categ_name.c (uc_general_category_name): Also handle + category LC. + * lib/unictype/categ_byname.c (uc_general_category_byname): Likewise. + * modules/unictype/category-LC: New file. + * modules/unictype/category-all (Depends-on): Add unictype/category-LC. + 2011-03-25 Eric Blake <eblake@redhat.com> xmalloc: revert yesterday's regression
--- a/lib/gen-uni-tables.c +++ b/lib/gen-uni-tables.c @@ -282,6 +282,17 @@ } static bool +is_category_LC (unsigned int ch) +{ + /* See PropertyValueAliases.txt. */ + return (unicode_attributes[ch].name != NULL + && unicode_attributes[ch].category[0] == 'L' + && (unicode_attributes[ch].category[1] == 'u' + || unicode_attributes[ch].category[1] == 'l' + || unicode_attributes[ch].category[1] == 't')); +} + +static bool is_category_Lu (unsigned int ch) { return (unicode_attributes[ch].name != NULL @@ -805,6 +816,7 @@ output_predicate_test ("../tests/unictype/test-categ_" #C ".c", is_category_ ## C, "uc_is_general_category (c, UC_CATEGORY_" #C ")"); \ output_predicate ("unictype/categ_" #C ".h", is_category_ ## C, "u_categ_" #C, "Categories", version); CATEGORY (L) + CATEGORY (LC) CATEGORY (Lu) CATEGORY (Ll) CATEGORY (Lt) @@ -847,6 +859,7 @@ enum { UC_CATEGORY_MASK_L = 0x0000001f, + UC_CATEGORY_MASK_LC = 0x00000007, UC_CATEGORY_MASK_Lu = 0x00000001, UC_CATEGORY_MASK_Ll = 0x00000002, UC_CATEGORY_MASK_Lt = 0x00000004, @@ -896,6 +909,7 @@ switch (category_name[1]) { case '\0': return UC_CATEGORY_MASK_L; + case 'C': return UC_CATEGORY_MASK_LC; case 'u': return UC_CATEGORY_MASK_Lu; case 'l': return UC_CATEGORY_MASK_Ll; case 't': return UC_CATEGORY_MASK_Lt;
--- a/lib/unictype.in.h +++ b/lib/unictype.in.h @@ -61,6 +61,7 @@ enum { UC_CATEGORY_MASK_L = 0x0000001f, + UC_CATEGORY_MASK_LC = 0x00000007, UC_CATEGORY_MASK_Lu = 0x00000001, UC_CATEGORY_MASK_Ll = 0x00000002, UC_CATEGORY_MASK_Lt = 0x00000004, @@ -101,6 +102,7 @@ /* Predefined General category values. */ extern const uc_general_category_t UC_CATEGORY_L; +extern const uc_general_category_t UC_CATEGORY_LC; extern const uc_general_category_t UC_CATEGORY_Lu; extern const uc_general_category_t UC_CATEGORY_Ll; extern const uc_general_category_t UC_CATEGORY_Lt; @@ -142,6 +144,7 @@ /* Alias names for predefined General category values. */ #define UC_LETTER UC_CATEGORY_L +#define UC_CASED_LETTER UC_CATEGORY_LC #define UC_UPPERCASE_LETTER UC_CATEGORY_Lu #define UC_LOWERCASE_LETTER UC_CATEGORY_Ll #define UC_TITLECASE_LETTER UC_CATEGORY_Lt
new file mode 100644 --- /dev/null +++ b/lib/unictype/categ_LC.c @@ -0,0 +1,27 @@ +/* Categories of Unicode characters. + Copyright (C) 2002, 2006-2007, 2011 Free Software Foundation, Inc. + Written by Bruno Haible <bruno@clisp.org>, 2011. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +/* Specification. */ +#include "unictype.h" + +/* Define u_categ_LC table. */ +#include "categ_LC.h" + +const uc_general_category_t UC_CATEGORY_LC = + { UC_CATEGORY_MASK_LC, 0, { &u_categ_LC } };
new file mode 100644 --- /dev/null +++ b/lib/unictype/categ_LC.h @@ -0,0 +1,339 @@ +/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ +/* Categories of Unicode characters. */ +/* Generated automatically by gen-uni-tables.c for Unicode 6.0.0. */ +#define header_0 16 +#define header_2 9 +#define header_3 127 +#define header_4 15 +static const +struct + { + int header[1]; + int level1[2]; + short level2[2 << 7]; + /*unsigned*/ int level3[14 << 4]; + } +u_categ_LC = +{ + { 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, + -1, + -1, + -1, + -1, + 3 + 256 * sizeof (short) / sizeof (int) + 112, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -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) + 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, + 3 + 256 * sizeof (short) / sizeof (int) + 144, + -1, + 3 + 256 * sizeof (short) / sizeof (int) + 160, + -1, + -1, + 3 + 256 * sizeof (short) / sizeof (int) + 176, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -1, + -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) + 192, + 3 + 256 * sizeof (short) / sizeof (int) + 208, + -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, 0x0000FFFF, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x38CF0000, + 0xFFFFD740, 0xFFFFFFFB, 0xFFFFFFFF, 0xFFBFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFC03, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFE00FF, 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, 0x00000FFF, 0x00000000, 0xFEFFFFFC, + 0x07FFFFFF, 0x00000000, 0x00000000, 0x00000000, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + 0x3F3FFFFF, 0xFFFFFFFF, 0xAAFF3F3F, 0x3FFFFFFF, + 0xFFFFFFFF, 0x5FDFFFFF, 0x0FCF1FDC, 0x1FDC1FFF, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x3E2FFC84, 0xF21FBD50, 0x000043E0, 0x00000000, + 0x00000018, 0x00000000, 0x00000000, 0x00000000, + 0xFFFFFFFF, 0xFFFF7FFF, 0x7FFFFFFF, 0xDFFFFFFF, + 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0000781F, + 0xFFFFFFFF, 0x0000003F, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0xFFFFFFFF, 0x00003FFF, + 0x00FFFFFF, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0xFFFFFFFC, 0xFFFFFFFF, 0xFFFEFFFF, + 0x000378FF, 0x000003FF, 0x00000000, 0x04000000, + 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 + } +};
--- a/lib/unictype/categ_byname.c +++ b/lib/unictype/categ_byname.c @@ -1,5 +1,5 @@ /* Categories of Unicode characters. - Copyright (C) 2002, 2006-2007, 2009-2011 Free Software Foundation, Inc. + Copyright (C) 2002, 2006-2007, 2011 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2002. This program is free software: you can redistribute it and/or modify it @@ -31,6 +31,7 @@ switch (category_name[1]) { case '\0': return UC_CATEGORY_L; + case 'C': return UC_CATEGORY_LC; case 'u': return UC_CATEGORY_Lu; case 'l': return UC_CATEGORY_Ll; case 't': return UC_CATEGORY_Lt;
--- a/lib/unictype/categ_name.c +++ b/lib/unictype/categ_name.c @@ -1,5 +1,5 @@ /* Categories of Unicode characters. - Copyright (C) 2002, 2006-2007, 2009-2011 Free Software Foundation, Inc. + Copyright (C) 2002, 2006-2007, 2011 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2002. This program is free software: you can redistribute it and/or modify it @@ -59,6 +59,8 @@ { if (bitmask == UC_CATEGORY_MASK_L) return "L"; + if (bitmask == UC_CATEGORY_MASK_LC) + return "LC"; if (bitmask == UC_CATEGORY_MASK_M) return "M"; if (bitmask == UC_CATEGORY_MASK_N)
new file mode 100644 --- /dev/null +++ b/modules/unictype/category-LC @@ -0,0 +1,26 @@ +Description: +Test whether a Unicode character is of general category LC. + +Files: +lib/unictype/categ_LC.c +lib/unictype/categ_LC.h + +Depends-on: +unictype/base + +configure.ac: +gl_LIBUNISTRING_MODULE([0.9.4], [unictype/category-LC]) + +Makefile.am: +if LIBUNISTRING_COMPILE_UNICTYPE_CATEGORY_LC +lib_SOURCES += unictype/categ_LC.c +endif + +Include: +"unictype.h" + +License: +LGPL + +Maintainer: +Bruno Haible