>From 93103b36955bd8d22c35e982365659a5afc373d0 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 25 Jan 2020 23:54:38 +0100 Subject: [PATCH 12/25] c32isgraph: New module. * lib/c32isgraph.c: New file. * modules/c32isgraph: New file. * doc/posix-functions/iswgraph.texi: Mention the new module. --- ChangeLog | 7 +++++++ doc/posix-functions/iswgraph.texi | 7 +++++-- lib/c32isgraph.c | 25 +++++++++++++++++++++++++ modules/c32isgraph | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 70 insertions(+), 2 deletions(-) create mode 100644 lib/c32isgraph.c create mode 100644 modules/c32isgraph diff --git a/ChangeLog b/ChangeLog index 2da6916..7603d00 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2020-01-25 Bruno Haible + c32isgraph: New module. + * lib/c32isgraph.c: New file. + * modules/c32isgraph: New file. + * doc/posix-functions/iswgraph.texi: Mention the new module. + +2020-01-25 Bruno Haible + c32isdigit: Add tests. * tests/test-c32isdigit.c: New file, based on tests/test-iswdigit.c. * tests/test-c32isdigit.sh: New file. diff --git a/doc/posix-functions/iswgraph.texi b/doc/posix-functions/iswgraph.texi index 3a94f41..87c5b59 100644 --- a/doc/posix-functions/iswgraph.texi +++ b/doc/posix-functions/iswgraph.texi @@ -20,6 +20,9 @@ OS X 10.8. 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{c32isgraph}, provided by Gnulib module +@code{c32isgraph}, operates on 32-bit wide characters and therefore does not +have this limitation. @end itemize diff --git a/lib/c32isgraph.c b/lib/c32isgraph.c new file mode 100644 index 0000000..b333eec --- /dev/null +++ b/lib/c32isgraph.c @@ -0,0 +1,25 @@ +/* Test 32-bit wide character for being graphic. + 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 . */ + +#include + +/* Specification. */ +#include + +#define FUNC c32isgraph +#define WCHAR_FUNC iswgraph +#define UCS_FUNC uc_is_graph +#include "c32is-impl.h" diff --git a/modules/c32isgraph b/modules/c32isgraph new file mode 100644 index 0000000..9c14ab0 --- /dev/null +++ b/modules/c32isgraph @@ -0,0 +1,33 @@ +Description: +c32isgraph() function: test 32-bit wide character for being graphic. + +Files: +lib/c32isgraph.c +lib/c32is-impl.h +m4/mbrtoc32.m4 + +Depends-on: +uchar +wchar +wctype-h +localcharset [test $REPLACE_MBSTATE_T = 1] +streq [test $REPLACE_MBSTATE_T = 1] +unictype/ctype-graph +verify + +configure.ac: +AC_REQUIRE([gl_UCHAR_H]) +AC_REQUIRE([gl_MBRTOC32_SANITYCHECK]) +gl_UCHAR_MODULE_INDICATOR([c32isgraph]) + +Makefile.am: +lib_SOURCES += c32isgraph.c + +Include: + + +License: +LGPLv3+ or GPLv2 + +Maintainer: +Bruno Haible -- 2.7.4