From: Bruno Haible Date: Sun, 18 Oct 2009 19:12:31 +0000 (+0200) Subject: New module 'ctype'. X-Git-Tag: v0.1~5304 X-Git-Url: http://erislabs.net/gitweb/?a=commitdiff_plain;h=0d976c6e8c8b73a72565449a59adee827a57e1b7;p=gnulib.git New module 'ctype'. --- diff --git a/ChangeLog b/ChangeLog index b583da3a0..caeadf26c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-10-18 Bruno Haible + + New module 'ctype'. + * lib/ctype.in.h: New file. + * m4/ctype.m4: New file. + * modules/ctype: New file. + * doc/posix-headers/ctype.texi: Mention the new module. + 2009-10-18 Jim Meyering m4: stylistic-only: hoist AC_SUBST to be adjacent to initialization diff --git a/doc/posix-headers/ctype.texi b/doc/posix-headers/ctype.texi index 65dc745ce..643bf379b 100644 --- a/doc/posix-headers/ctype.texi +++ b/doc/posix-headers/ctype.texi @@ -3,7 +3,7 @@ POSIX specification: @url{http://www.opengroup.org/susv3xbd/ctype.h.html} -Gnulib module: --- +Gnulib module: ctype Portability problems fixed by Gnulib: @itemize diff --git a/lib/ctype.in.h b/lib/ctype.in.h new file mode 100644 index 000000000..d1a3c5bca --- /dev/null +++ b/lib/ctype.in.h @@ -0,0 +1,53 @@ +/* A substitute for ISO C99 , for platforms on which it is incomplete. + + Copyright (C) 2009 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, write to the Free Software Foundation, + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + +/* Written by Bruno Haible. */ + +/* + * ISO C 99 for platforms on which it is incomplete. + * + */ + +#ifndef _GL_CTYPE_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif + +/* Include the original . */ +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_CTYPE_H@ + +#ifndef _GL_CTYPE_H +#define _GL_CTYPE_H + +/* Return non-zero if c is a blank, i.e. a space or tab character. */ +#if @GNULIB_ISBLANK@ +# if !@HAVE_ISBLANK@ +extern int isblank (int c); +# endif +#elif defined GNULIB_POSIXCHECK +# undef isblank +# define isblank(c) \ + (GL_LINK_WARNING ("isblank is unportable - " \ + "use gnulib module isblank for portability"), \ + isblank (c)) +#endif + +#endif /* _GL_CTYPE_H */ +#endif /* _GL_CTYPE_H */ diff --git a/m4/ctype.m4 b/m4/ctype.m4 new file mode 100644 index 000000000..51e5333f6 --- /dev/null +++ b/m4/ctype.m4 @@ -0,0 +1,28 @@ +# ctype_h.m4 serial 1 +dnl Copyright (C) 2009 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_CTYPE_H], +[ + AC_REQUIRE([gl_CTYPE_H_DEFAULTS]) + dnl Execute this unconditionally, because CTYPE_H may be set by other + dnl modules, after this code is executed. + gl_CHECK_NEXT_HEADERS([ctype.h]) +]) + +AC_DEFUN([gl_CTYPE_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_CTYPE_H_DEFAULTS]) + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 +]) + +AC_DEFUN([gl_CTYPE_H_DEFAULTS], +[ + GNULIB_ISBLANK=0; AC_SUBST([GNULIB_ISBLANK]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_ISBLANK=1; AC_SUBST([HAVE_ISBLANK]) + CTYPE_H=''; AC_SUBST([CTYPE_H]) +]) diff --git a/modules/ctype b/modules/ctype new file mode 100644 index 000000000..b0ebf1b37 --- /dev/null +++ b/modules/ctype @@ -0,0 +1,39 @@ +Description: +A that conforms to C99. + +Files: +lib/ctype.in.h +m4/ctype.m4 + +Depends-on: +include_next + +configure.ac: +gl_CTYPE_H + +Makefile.am: +BUILT_SOURCES += $(CTYPE_H) + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +ctype.h: ctype.in.h + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''NEXT_CTYPE_H''@|$(NEXT_CTYPE_H)|g' \ + -e 's/@''GNULIB_ISBLANK''@/$(GNULIB_ISBLANK)/g' \ + -e 's/@''HAVE_ISBLANK''@/$(HAVE_ISBLANK)/g' \ + < $(srcdir)/ctype.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += ctype.h ctype.h-t + +Include: + + +License: +LGPLv2+ + +Maintainer: +Bruno Haible