X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fgen-uni-tables.c;h=1ea6ecc16a8b0646c88de2721c9f20e6e4f59962;hb=f62a2da1390a78aebe7dcbc5753ba7a2b34cf1fd;hp=9713200c04486383feb40233fdf5385675d4c65b;hpb=08ca5cc80822b0f45f7a6090425df540c27c2d90;p=gnulib.git diff --git a/lib/gen-uni-tables.c b/lib/gen-uni-tables.c index 9713200c0..1ea6ecc16 100644 --- a/lib/gen-uni-tables.c +++ b/lib/gen-uni-tables.c @@ -1,7 +1,7 @@ /* Generate Unicode conforming character classification tables and line break properties tables and word break property tables and decomposition/composition and case mapping tables from a UnicodeData file. - Copyright (C) 2000-2002, 2004, 2007-2011 Free Software Foundation, Inc. + Copyright (C) 2000-2002, 2004, 2007-2012 Free Software Foundation, Inc. Written by Bruno Haible , 2000-2002. This program is free software: you can redistribute it and/or modify @@ -92,7 +92,7 @@ fill_attribute (unsigned int i, exit (1); } if (strcmp (field2, "Cs") == 0) - /* Surrogates are UTF-16 artefacts, not real characters. Ignore them. */ + /* Surrogates are UTF-16 artifacts, not real characters. Ignore them. */ return; uni = &unicode_attributes[i]; /* Copy the strings. */ @@ -282,6 +282,17 @@ is_category_L (unsigned int ch) } 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_categories (const char *version) 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 @@ output_categories (const char *version) 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 @@ general_category_byname (const char *category_name) 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; @@ -5658,7 +5672,7 @@ output_tables (const char *filename, const char *version) fprintf (stream, "escape_char /\n"); fprintf (stream, "comment_char %%\n"); fprintf (stream, "\n"); - fprintf (stream, "%% Generated automatically by gen-unicode-ctype for Unicode %s.\n", + fprintf (stream, "%% Generated automatically by gen-uni-tables.c for Unicode %s.\n", version); fprintf (stream, "\n"); @@ -5684,7 +5698,7 @@ output_tables (const char *filename, const char *version) fprintf (stream, "END LC_IDENTIFICATION\n"); fprintf (stream, "\n"); - /* Verifications. */ + /* Verification. */ for (ch = 0; ch < 0x110000; ch++) { /* toupper restriction: "Only characters specified for the keywords @@ -7283,7 +7297,7 @@ output_lbrk_tables (const char *filename1, const char *filename2, const char *ve fprintf (stream, "/* DO NOT EDIT! GENERATED AUTOMATICALLY! */\n"); fprintf (stream, "/* Line breaking properties of Unicode characters. */\n"); - fprintf (stream, "/* Generated automatically by gen-lbrk for Unicode %s. */\n", + fprintf (stream, "/* Generated automatically by gen-uni-tables.c for Unicode %s. */\n", version); fprintf (stream, "\n"); @@ -7764,7 +7778,7 @@ output_wbrk_tables (const char *filename, const char *version) fprintf (stream, "/* DO NOT EDIT! GENERATED AUTOMATICALLY! */\n"); fprintf (stream, "/* Line breaking properties of Unicode characters. */\n"); - fprintf (stream, "/* Generated automatically by gen-uni-tables for Unicode %s. */\n", + fprintf (stream, "/* Generated automatically by gen-uni-tables.c for Unicode %s. */\n", version); fprintf (stream, "\n"); @@ -8514,7 +8528,7 @@ output_composition_tables (const char *filename, const char *version) fprintf (stream, "/* DO NOT EDIT! GENERATED AUTOMATICALLY! */\n"); fprintf (stream, "/* Canonical composition of Unicode characters. */\n"); - fprintf (stream, "/* Generated automatically by gen-uni-tables for Unicode %s. */\n", + fprintf (stream, "/* Generated automatically by gen-uni-tables.c for Unicode %s. */\n", version); fprintf (stream, "\n"); @@ -8647,7 +8661,7 @@ output_simple_mapping_test (const char *filename, fprintf (stream, " You should have received a copy of the GNU General Public License\n"); fprintf (stream, " along with this program. If not, see . */\n"); fprintf (stream, "\n"); - fprintf (stream, "/* Generated automatically by gen-case.c for Unicode %s. */\n", + fprintf (stream, "/* Generated automatically by gen-uni-tables.c for Unicode %s. */\n", version); fprintf (stream, "\n"); fprintf (stream, "#include \"test-mapping-part1.h\"\n"); @@ -8709,7 +8723,7 @@ output_simple_mapping (const char *filename, fprintf (stream, "/* DO NOT EDIT! GENERATED AUTOMATICALLY! */\n"); fprintf (stream, "/* Simple character mapping of Unicode characters. */\n"); - fprintf (stream, "/* Generated automatically by gen-case.c for Unicode %s. */\n", + fprintf (stream, "/* Generated automatically by gen-uni-tables.c for Unicode %s. */\n", version); t.p = 7; @@ -9687,7 +9701,7 @@ main (int argc, char * argv[]) output_categories (version); output_category ("unictype/categ_of.h", version); - output_combclass ("unictype/combining.h", version); + output_combclass ("unictype/combiningclass.h", version); output_bidi_category ("unictype/bidi_of.h", version); output_decimal_digit_test ("../tests/unictype/test-decdigit.h", version); output_decimal_digit ("unictype/decdigit.h", version);