]> Savannah Git Hosting - gnulib.git/commitdiff
c32isxdigit: New module.
authorBruno Haible <bruno@clisp.org>
Sat, 25 Jan 2020 23:04:38 +0000 (00:04 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 25 Jan 2020 23:17:37 +0000 (00:17 +0100)
* lib/c32isxdigit.c: New file.
* modules/c32isxdigit: New file.
* doc/posix-functions/iswxdigit.texi: Mention the new module.

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

index 5cebfea47c5143c2678fbef84251e29ee1052d92..ce84fa11bed0688462858e56a859418d9398576f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2020-01-25  Bruno Haible  <bruno@clisp.org>
+
+       c32isxdigit: New module.
+       * lib/c32isxdigit.c: New file.
+       * modules/c32isxdigit: New file.
+       * doc/posix-functions/iswxdigit.texi: Mention the new module.
+
 2020-01-25  Bruno Haible  <bruno@clisp.org>
 
        c32isupper: Add tests.
index 705c829d0401fc16f5a9cdc23b4c059f47219d5d..042bba57e913db0f2d5df615f25d2af2407c60b7 100644 (file)
@@ -23,6 +23,9 @@ FreeBSD 12, NetBSD 8.0, Solaris 11.4, 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{c32isxdigit}, provided by Gnulib module
+@code{c32isxdigit}, operates on 32-bit wide characters and therefore does not
+have this limitation.
 @end itemize
diff --git a/lib/c32isxdigit.c b/lib/c32isxdigit.c
new file mode 100644 (file)
index 0000000..3a23195
--- /dev/null
@@ -0,0 +1,25 @@
+/* Test 32-bit wide character for being a hexadecimal 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 c32isxdigit
+#define WCHAR_FUNC iswxdigit
+#define UCS_FUNC uc_is_xdigit
+#include "c32is-impl.h"
diff --git a/modules/c32isxdigit b/modules/c32isxdigit
new file mode 100644 (file)
index 0000000..4572deb
--- /dev/null
@@ -0,0 +1,35 @@
+Description:
+c32isxdigit() function: test 32-bit wide character for being a hexadecimal
+digit.
+
+Files:
+lib/c32isxdigit.c
+lib/c32is-impl.h
+m4/mbrtoc32.m4
+
+Depends-on:
+uchar
+wchar
+wctype-h
+iswxdigit
+localcharset    [test $REPLACE_MBSTATE_T = 1]
+streq           [test $REPLACE_MBSTATE_T = 1]
+unictype/ctype-xdigit
+verify
+
+configure.ac:
+AC_REQUIRE([gl_UCHAR_H])
+AC_REQUIRE([gl_MBRTOC32_SANITYCHECK])
+gl_UCHAR_MODULE_INDICATOR([c32isxdigit])
+
+Makefile.am:
+lib_SOURCES += c32isxdigit.c
+
+Include:
+<uchar.h>
+
+License:
+LGPLv3+ or GPLv2
+
+Maintainer:
+Bruno Haible