2009-06-29 Bruno Haible <bruno@clisp.org>
+ New module 'unicase/cased'.
+ * lib/unicase/caseprop.h: New file.
+ * lib/unicase/cased.c: New file.
+ * modules/unicase/cased: New file.
+
New functions for case mapping of substrings.
* lib/unicase.h (casing_prefix_context_t): New type.
(unicase_empty_prefix_context): New variable.
--- /dev/null
+/* Test whether a Unicode character is cased.
+ Copyright (C) 2009 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 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 <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "caseprop.h"
+
+#include "unictype.h"
+
+bool
+uc_is_cased (ucs4_t uc)
+{
+ /* 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. */
+ return (uc_is_property_lowercase (uc)
+ || uc_is_property_uppercase (uc)
+ || uc_is_general_category (uc, UC_TITLECASE_LETTER));
+}
--- /dev/null
+/* Case related properties of Unicode characters.
+ Copyright (C) 2009 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 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 <http://www.gnu.org/licenses/>. */
+
+#include <stdbool.h>
+#include "unitypes.h"
+
+/* Determine whether a character is "cased" according to the Unicode Standard,
+ <http://www.unicode.org/versions/Unicode5.0.0/ch03.pdf>, 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,
+ <http://www.unicode.org/versions/Unicode5.0.0/ch03.pdf>, section 3.13,
+ definition D121. */
+extern bool
+ uc_is_case_ignorable (ucs4_t uc);
--- /dev/null
+Description:
+Test whether a Unicode character is "cased".
+
+Files:
+lib/unicase/caseprop.h
+lib/unicase/cased.c
+
+Depends-on:
+unictype/category-test
+unictype/category-Lt
+unictype/property-lowercase
+unictype/property-uppercase
+unitypes
+stdbool
+
+configure.ac:
+
+Makefile.am:
+lib_SOURCES += unicase/cased.c
+
+Include:
+"unicase/caseprop.h"
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
+