c32isdigit: New module.
authorBruno Haible <bruno@clisp.org>
Sat, 25 Jan 2020 22:52:46 +0000 (23:52 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 25 Jan 2020 22:52:46 +0000 (23:52 +0100)
* lib/c32isdigit.c: New file.
* modules/c32isdigit: New file.
* doc/posix-functions/iswdigit.texi: Mention the new module.

ChangeLog
doc/posix-functions/iswdigit.texi
lib/c32isdigit.c [new file with mode: 0644]
modules/c32isdigit [new file with mode: 0644]

index d42ac07f6deb446068c92226463c82fa7dcd34e8..4f87966933b6d8af21ad16c9c73297cbef3c5836 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2020-01-25  Bruno Haible  <bruno@clisp.org>
+
+       c32isdigit: New module.
+       * lib/c32isdigit.c: New file.
+       * modules/c32isdigit: New file.
+       * doc/posix-functions/iswdigit.texi: Mention the new module.
+
 2020-01-25  Bruno Haible  <bruno@clisp.org>
 
        c32iscntrl: Add tests.
index 3bf89e27fc99d14afa0edf2bb35b850d12e51a9f..f0d178d6c37a0ade4e49da95c8d050b06ee14042 100644 (file)
@@ -23,6 +23,9 @@ FreeBSD 12, NetBSD 8.0, Solaris 11.4, mingw, MSVC 14.
 Portability problems not fixed by Gnulib:
 @itemize
 @item
-On Windows and 32-bit AIX platforms, @code{wchar_t} is a 16-bit type and therefore cannot
-accommodate all Unicode characters.
+On Windows and 32-bit AIX platforms, @code{wchar_t} is a 16-bit type and
+therefore cannot accommodate all Unicode characters.
+However, the Gnulib function @code{c32isdigit}, provided by Gnulib module
+@code{c32isdigit}, operates on 32-bit wide characters and therefore does not
+have this limitation.
 @end itemize
diff --git a/lib/c32isdigit.c b/lib/c32isdigit.c
new file mode 100644 (file)
index 0000000..93c8235
--- /dev/null
@@ -0,0 +1,25 @@
+/* Test 32-bit wide character for being a digit.
+   Copyright (C) 2020 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <uchar.h>
+
+#define FUNC c32isdigit
+#define WCHAR_FUNC iswdigit
+#define UCS_FUNC uc_is_digit
+#include "c32is-impl.h"
diff --git a/modules/c32isdigit b/modules/c32isdigit
new file mode 100644 (file)
index 0000000..3e31fdb
--- /dev/null
@@ -0,0 +1,34 @@
+Description:
+c32isdigit() function: test 32-bit wide character for being a digit.
+
+Files:
+lib/c32isdigit.c
+lib/c32is-impl.h
+m4/mbrtoc32.m4
+
+Depends-on:
+uchar
+wchar
+wctype-h
+iswdigit
+localcharset    [test $REPLACE_MBSTATE_T = 1]
+streq           [test $REPLACE_MBSTATE_T = 1]
+unictype/ctype-digit
+verify
+
+configure.ac:
+AC_REQUIRE([gl_UCHAR_H])
+AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+gl_UCHAR_MODULE_INDICATOR([c32isdigit])
+
+Makefile.am:
+lib_SOURCES += c32isdigit.c
+
+Include:
+<uchar.h>
+
+License:
+LGPLv3+ or GPLv2
+
+Maintainer:
+Bruno Haible