[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
new module ctype
From: |
Bruno Haible |
Subject: |
new module ctype |
Date: |
Sun, 18 Oct 2009 21:52:14 +0200 |
User-agent: |
KMail/1.9.9 |
Here is the 'ctype' module:
2009-10-18 Bruno Haible <address@hidden>
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.
=============================== lib/ctype.in.h ===============================
/* A substitute for ISO C99 <ctype.h>, 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 <ctype.h> for platforms on which it is incomplete.
* <http://www.opengroup.org/onlinepubs/9699919799/basedefs/ctype.h.html>
*/
#ifndef _GL_CTYPE_H
#if __GNUC__ >= 3
@PRAGMA_SYSTEM_HEADER@
#endif
/* Include the original <ctype.h>. */
/* The include_next requires a split double-inclusion guard. */
address@hidden@ @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 address@hidden@
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 */
================================ m4/ctype.m4 ================================
# 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])
])
=============================== modules/ctype ===============================
Description:
A <ctype.h> 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 <ctype.h> when the system
# doesn't have one that works with the given compiler.
ctype.h: ctype.in.h
$(AM_V_GEN)rm -f address@hidden $@ && \
{ 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; \
} > address@hidden && \
mv address@hidden $@
MOSTLYCLEANFILES += ctype.h ctype.h-t
Include:
<ctype.h>
License:
LGPLv2+
Maintainer:
Bruno Haible
==============================================================================
--- doc/posix-headers/ctype.texi.orig 2009-10-18 21:07:15.000000000 +0200
+++ doc/posix-headers/ctype.texi 2009-10-07 11:14:43.000000000 +0200
@@ -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