* modules/iswctype: New file.
* lib/wctype.in.h (iswctype): New declaration.
* lib/iswctype.c: New file.
* lib/iswctype-impl.h: New file.
* m4/iswctype.m4: New file.
* m4/wctype_h.m4 (gl_WCTYPE_H): Test whether iswctype is declared.
(gl_WCTYPE_H_DEFAULTS): Initialize GNULIB_ISWCTYPE.
* modules/wctype-h (Makefile.am): Substitute GNULIB_ISWCTYPE.
* tests/test-wctype-h-c++.cc: Test the declaration of iswctype.
* doc/posix-functions/iswctype.texi: Mention the new module and the
HP-UX 11.00 problem.
+2011-02-06 Bruno Haible <bruno@clisp.org>
+
+ New module 'iswctype'.
+ * modules/iswctype: New file.
+ * lib/wctype.in.h (iswctype): New declaration.
+ * lib/iswctype.c: New file.
+ * lib/iswctype-impl.h: New file.
+ * m4/iswctype.m4: New file.
+ * m4/wctype_h.m4 (gl_WCTYPE_H): Test whether iswctype is declared.
+ (gl_WCTYPE_H_DEFAULTS): Initialize GNULIB_ISWCTYPE.
+ * modules/wctype-h (Makefile.am): Substitute GNULIB_ISWCTYPE.
+ * tests/test-wctype-h-c++.cc: Test the declaration of iswctype.
+ * doc/posix-functions/iswctype.texi: Mention the new module and the
+ HP-UX 11.00 problem.
+
2011-02-06 Bruno Haible <bruno@clisp.org>
New module 'wctype'.
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/iswctype.html}
-Gnulib module: ---
+Gnulib module: iswctype
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+IRIX 5.3, Solaris 2.5.1.
+@item
+This function is declared in @code{<wchar.h>}, not in @code{<wctype.h>}, on
+some platforms:
+HP-UX 11.00.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
-This function is missing on some platforms:
-IRIX 5.3, Solaris 2.5.1.
-@item
On AIX and Windows platforms, @code{wchar_t} is a 16-bit type and therefore cannot
accommodate all Unicode characters.
@end itemize
--- /dev/null
+/* Test whether a wide character has a given property.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ 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 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 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 <http://www.gnu.org/licenses/>. */
+
+int
+iswctype (wint_t wc, wctype_t desc)
+{
+ return ((int (*) (wint_t)) desc) (wc);
+}
--- /dev/null
+/* Test whether a wide character has a given property.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+ 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 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 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 <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include <wctype.h>
+
+#include "iswctype-impl.h"
# endif
#endif
+/* Test whether a wide character has a given property.
+ The argument WC must be either a wchar_t value or WEOF.
+ The argument DESC must have been returned by the wctype() function. */
+#if @GNULIB_ISWCTYPE@
+# if !@HAVE_WCTYPE_T@
+_GL_FUNCDECL_SYS (iswctype, int, (wint_t wc, wctype_t desc));
+# endif
+_GL_CXXALIAS_SYS (iswctype, int, (wint_t wc, wctype_t desc));
+_GL_CXXALIASWARN (iswctype);
+#elif defined GNULIB_POSIXCHECK
+# undef iswctype
+# if HAVE_RAW_DECL_ISWCTYPE
+_GL_WARN_ON_USE (iswctype, "iswctype is unportable - "
+ "use gnulib module iswctype for portability");
+# endif
+#endif
+
#if @REPLACE_ISWCNTRL@ || defined __MINGW32__
_GL_CXXALIAS_RPL (towlower, wint_t, (wint_t wc));
_GL_CXXALIAS_RPL (towupper, wint_t, (wint_t wc));
--- /dev/null
+# iswctype.m4 serial 1
+dnl Copyright (C) 2011 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_ISWCTYPE],
+[
+ AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
+ AC_REQUIRE([gl_WCTYPE_H])
+ if test $HAVE_WCTYPE_T = 0; then
+ AC_LIBOBJ([iswctype])
+ fi
+])
#endif
#include <wctype.h>
]],
- [wctype
+ [wctype iswctype
])
])
[
GNULIB_ISWBLANK=0; AC_SUBST([GNULIB_ISWBLANK])
GNULIB_WCTYPE=0; AC_SUBST([GNULIB_WCTYPE])
+ GNULIB_ISWCTYPE=0; AC_SUBST([GNULIB_ISWCTYPE])
dnl Assume proper GNU behavior unless another module says otherwise.
HAVE_ISWBLANK=1; AC_SUBST([HAVE_ISWBLANK])
HAVE_WCTYPE_T=1; AC_SUBST([HAVE_WCTYPE_T])
--- /dev/null
+Description:
+iswctype() function: test whether a wide character has a given property.
+
+Status:
+obsolete
+
+Notice:
+This module is obsolete.
+
+Files:
+lib/iswctype.c
+lib/iswctype-impl.h
+m4/iswctype.m4
+
+Depends-on:
+wctype-h
+
+configure.ac:
+gl_FUNC_ISWCTYPE
+gl_WCTYPE_MODULE_INDICATOR([iswctype])
+
+Makefile.am:
+
+Include:
+<wctype.h>
+
+License:
+LGPL
+
+Maintainer:
+Bruno Haible
-e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \
-e 's/@''GNULIB_ISWBLANK''@/$(GNULIB_ISWBLANK)/g' \
-e 's/@''GNULIB_WCTYPE''@/$(GNULIB_WCTYPE)/g' \
+ -e 's/@''GNULIB_ISWCTYPE''@/$(GNULIB_ISWCTYPE)/g' \
-e 's/@''HAVE_ISWBLANK''@/$(HAVE_ISWBLANK)/g' \
-e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \
-e 's/@''HAVE_WCTYPE_T''@/$(HAVE_WCTYPE_T)/g' \
SIGNATURE_CHECK (GNULIB_NAMESPACE::wctype, wctype_t, (const char *));
#endif
+#if GNULIB_TEST_ISWCTYPE
+SIGNATURE_CHECK (GNULIB_NAMESPACE::iswctype, int, (wint_t, wctype_t));
+#endif
+
SIGNATURE_CHECK (GNULIB_NAMESPACE::towlower, wint_t, (wint_t));
SIGNATURE_CHECK (GNULIB_NAMESPACE::towupper, wint_t, (wint_t));