diff --git a/.gitignore b/.gitignore
index ca73a98b79..964580c8a0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -34,3 +34,4 @@ stamp-h
stamp-h.in
stamp-h1
update.log
+tests/*.log
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000000..7acb1ea19c
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "gnulib"]
+ path = .gnulib
+ url = git://git.sv.gnu.org/gnulib.git
diff --git a/.gnulib b/.gnulib
new file mode 160000
index 0000000000..1203e8d1f6
--- /dev/null
+++ b/.gnulib
@@ -0,0 +1 @@
+Subproject commit 1203e8d1f62dec3d2436dffadd5c20793cf84366
diff --git a/bootstrap b/bootstrap
index baf52e7dfd..7ce28da93b 100755
--- a/bootstrap
+++ b/bootstrap
@@ -40,25 +40,31 @@ do
esac
done
-cleanup_gnulib() {
- st=$?
- rm -fr .gnulib
- exit $st
-}
+# Get gnulib files.
case ${GNULIB_SRCDIR--} in
-)
- if [ ! -d .gnulib ]; then
- echo "$0: getting gnulib files..."
-
- trap cleanup_gnulib 1 2 13 15
-
- git clone --depth 1 git://git.sv.gnu.org/gnulib .gnulib ||
- cleanup_gnulib
-
- trap - 1 2 13 15
- fi
+ echo "$0: getting gnulib files..."
+ git submodule init || exit $?
+ git submodule update || exit $?
GNULIB_SRCDIR=.gnulib
+ ;;
+*)
+ # Redirect the gnulib submodule to the directory on the command line
+ # if possible.
+ if test -d "$GNULIB_SRCDIR"/.git && \
+ git config --file .gitmodules submodule.gnulib.url >/dev/null; then
+ git submodule init
+ GNULIB_SRCDIR=`cd $GNULIB_SRCDIR && pwd`
+ git config --replace-all submodule.gnulib.url $GNULIB_SRCDIR
+ echo "$0: getting gnulib files..."
+ git submodule update || exit $?
+ GNULIB_SRCDIR=.gnulib
+ else
+ echo >&2 "$0: invalid gnulib srcdir: $GNULIB_SRCDIR"
+ exit 1
+ fi
+ ;;
esac
gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
@@ -103,20 +109,9 @@ vc-list-files
# put *.[ch] files in new gnulib/lib/ dir.
$gnulib_tool \
- --no-vc-files \
--lgpl=2 \
--with-tests \
--m4-base=gnulib/m4 \
--source-base=gnulib/lib \
--tests-base=gnulib/tests \
--import $modules
-
-rm -f \
- .gitignore \
- gnulib/lib/.gitignore \
- gnulib/m4/.gitignore \
- gnulib/tests/.gitignore
-
-(cd gnulib/lib &&
- (cat .cvsignore; \
- ls -1 *.in.h|sed 's/\.in\.h/.h/') | sort -u > .t; mv .t .cvsignore)
diff --git a/build-aux/useless-if-before-free b/build-aux/useless-if-before-free
deleted file mode 100755
index 0bae2c4d05..0000000000
--- a/build-aux/useless-if-before-free
+++ /dev/null
@@ -1,180 +0,0 @@
-#!/usr/bin/perl -T
-# Detect instances of "if (p) free (p);".
-# Likewise for "if (p != NULL) free (p);". And with braces.
-
-my $VERSION = '2008-05-25 17:36'; # UTC
-# The definition above must lie within the first 8 lines in order
-# for the Emacs time-stamp write hook (at end) to update it.
-# If you change this file with Emacs, please let the write hook
-# do its job. Otherwise, update this string manually.
-
-# Copyright (C) 2008 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 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 .
-
-# Written by Jim Meyering
-
-use strict;
-use warnings;
-use Getopt::Long;
-
-(my $ME = $0) =~ s|.*/||;
-
-# use File::Coda; # http://meyering.net/code/Coda/
-END {
- defined fileno STDOUT or return;
- close STDOUT and return;
- warn "$ME: failed to close standard output: $!\n";
- $? ||= 1;
-}
-
-sub usage ($)
-{
- my ($exit_code) = @_;
- my $STREAM = ($exit_code == 0 ? *STDOUT : *STDERR);
- if ($exit_code != 0)
- {
- print $STREAM "Try `$ME --help' for more information.\n";
- }
- else
- {
- print $STREAM < sub { usage 0 },
- version => sub { print "$ME version $VERSION\n"; exit },
- list => \$list,
- 'name=s@' => \@name,
- ) or usage 1;
-
- # Make sure we have the right number of non-option arguments.
- # Always tell the user why we fail.
- @ARGV < 1
- and (warn "$ME: missing FILE argument\n"), usage EXIT_ERROR;
-
- my $or = join '|', @name;
- my $regexp = qr/(?:$or)/;
-
- # Set the input record separator.
- # Note: this makes it impractical to print line numbers.
- $/ = '"';
-
- my $found_match = 0;
- FILE:
- foreach my $file (@ARGV)
- {
- open FH, '<', $file
- or (warn "$ME: can't open `$file' for reading: $!\n"),
- $err = EXIT_ERROR, next;
- while (defined (my $line = ))
- {
- while ($line =~
- /\b(if\s*\(\s*([^)]+?)(?:\s*!=\s*NULL)?\s*\)
- (?: \s*$regexp\s*\((?:\s*\([^)]+\))?\s*([^)]+)\)|
- \s*\{\s*$regexp\s*\((?:\s*\([^)]+\))?\s*([^)]+)\)\s*;\s*\}))/sxg)
- {
- # Compare "if" expression and free'd expression,
- # without regard to white space.
- (my $e1 = $2) =~ tr/ \t//d;
- my $e2 = defined $3 ? $3 : $4;
- $e2 =~ tr/ \t//d;
- if ($e1 eq $e2)
- {
- $found_match = 1;
- $list
- and (print "$file\0"), next FILE;
- print "$file: $1\n";
- }
- }
- }
- }
- continue
- {
- close FH;
- }
-
- $found_match && $err == EXIT_NO_MATCH
- and $err = EXIT_MATCH;
-
- exit $err;
-}
-
-my $foo = <<'EOF';
-# The above is to *find* them.
-# This adjusts them, removing the unnecessary "if (p)" part.
-
-# FIXME: do something like this as an option (doesn't do braces):
-useless-if-before-free -l $(lid -knone free) | xargs -0 \
- perl -0x3b -pi -e \
- 's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*NULL)?\s*\)\s+(free\s*\((?:\s*\([^)]+\))?\s*\1\s*\))/$2/s'
-
-# Or, with git:
-git ls-files -z |xargs -0 perl -0x3b -pi -e '...'
-
-Be careful that the result of the above transformation is valid.
-If the matched string is followed by "else", then obviously, it won't be.
-
-When modifying files, refuse to process anything other than a regular file.
-EOF
-
-## Local Variables:
-## indent-tabs-mode: nil
-## eval: (add-hook 'write-file-hooks 'time-stamp)
-## time-stamp-start: "my $VERSION = '"
-## time-stamp-format: "%:y-%02m-%02d %02H:%02M"
-## time-stamp-time-zone: "UTC"
-## time-stamp-end: "'; # UTC"
-## End:
diff --git a/build-aux/vc-list-files b/build-aux/vc-list-files
deleted file mode 100755
index 419ab2acab..0000000000
--- a/build-aux/vc-list-files
+++ /dev/null
@@ -1,107 +0,0 @@
-#!/bin/sh
-# List version-controlled file names.
-
-# Print a version string.
-scriptversion=2008-07-11.19
-
-# Copyright (C) 2006-2008 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 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 .
-
-
-# List the specified version-controlled files.
-# With no argument, list them all. With a single DIRECTORY argument,
-# list the version-controlled files in that directory.
-
-# If there's an argument, it must be a single, "."-relative directory name.
-# cvsu is part of the cvsutils package: http://www.red-bean.com/cvsutils/
-
-postprocess=
-case $1 in
- --help) cat <.
-EOF
- exit ;;
-
- --version)
- year=`echo "$scriptversion" | sed 's/[^0-9].*//'`
- cat <
-This is free software: you are free to change and redistribute it.
-There is NO WARRANTY, to the extent permitted by law.
-EOF
- exit ;;
-
- -C)
- test "$2" = . || postprocess="| sed 's|^|$2/|'"
- cd "$2" || exit 1
- shift; shift ;;
-esac
-
-dir=
-case $# in
- 0) ;;
- 1) dir=$1 ;;
- *) echo "$0: too many arguments" 1>&2
- echo "Usage: $0 [-C srcdir] [DIR]" 1>&2; exit 1;;
-esac
-
-test "x$dir" = x && dir=.
-
-if test -d .git; then
- eval exec git ls-files '"$dir"' $postprocess
-elif test -d .hg; then
- eval exec hg locate '"$dir/*"' $postprocess
-elif test -d .bzr; then
- test "$postprocess" = '' && postprocess="| sed 's|^\./||'"
- eval exec bzr ls --versioned '"$dir"' $postprocess
-elif test -d CVS; then
- test "$postprocess" = '' && postprocess="| sed 's|^\./||'"
- if test -x build-aux/cvsu; then
- eval build-aux/cvsu --find --types=AFGM '"$dir"' $postprocess
- elif (cvsu --help) >/dev/null 2>&1; then
- eval cvsu --find --types=AFGM '"$dir"' $postprocess
- else
- eval awk -F/ \''{ \
- if (!$1 && $3 !~ /^-/) { \
- f=FILENAME; \
- if (f ~ /CVS\/Entries$/) \
- f = substr(f, 0, length(f)-11); \
- print f $2; \
- }}'\'' \
- `find "$dir" -name Entries -print` /dev/null' $postprocess
- fi
-else
- echo "$0: Failed to determine type of version control used in `pwd`" 1>&2
- exit 1
-fi
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
-# End:
diff --git a/gnulib/lib/.cvsignore b/gnulib/lib/.cvsignore
deleted file mode 100644
index 9d6b35f849..0000000000
--- a/gnulib/lib/.cvsignore
+++ /dev/null
@@ -1,26 +0,0 @@
-*.la
-*.lo
-.deps
-.libs
-Makefile
-Makefile.in
-alloca.h
-arpa_inet.h
-errno.h
-float.h
-netdb.h
-netinet_in.h
-poll.h
-stdbool.h
-stdint.h
-stdio.h
-stdlib.h
-string.h
-sys_ioctl.h
-sys_select.h
-sys_socket.h
-sys_stat.h
-sys_time.h
-time.h
-unistd.h
-wchar.h
diff --git a/gnulib/lib/.gitignore b/gnulib/lib/.gitignore
deleted file mode 100644
index 9d6b35f849..0000000000
--- a/gnulib/lib/.gitignore
+++ /dev/null
@@ -1,26 +0,0 @@
-*.la
-*.lo
-.deps
-.libs
-Makefile
-Makefile.in
-alloca.h
-arpa_inet.h
-errno.h
-float.h
-netdb.h
-netinet_in.h
-poll.h
-stdbool.h
-stdint.h
-stdio.h
-stdlib.h
-string.h
-sys_ioctl.h
-sys_select.h
-sys_socket.h
-sys_stat.h
-sys_time.h
-time.h
-unistd.h
-wchar.h
diff --git a/gnulib/lib/Makefile.am b/gnulib/lib/Makefile.am
deleted file mode 100644
index 62ded7b300..0000000000
--- a/gnulib/lib/Makefile.am
+++ /dev/null
@@ -1,1241 +0,0 @@
-## DO NOT EDIT! GENERATED AUTOMATICALLY!
-## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2009 Free Software Foundation, Inc.
-#
-# This file is free software, distributed under the terms of the GNU
-# General Public License. As a special exception to the GNU General
-# Public License, this file may be distributed as part of a program
-# that contains a configuration script generated by Autoconf, under
-# the same distribution terms as the rest of that program.
-#
-# Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --tests-base=gnulib/tests --aux-dir=build-aux --with-tests --lgpl=2 --libtool --macro-prefix=gl --no-vc-files c-ctype close connect getaddrinfo gethostname getpass gettext inet_pton ioctl mkstemp mktempd perror physmem poll posix-shell random_r recv send setsockopt socket stpcpy strerror strndup strsep sys_stat time_r useless-if-before-free vasprintf vc-list-files verify
-
-AUTOMAKE_OPTIONS = 1.5 gnits
-
-SUBDIRS =
-noinst_HEADERS =
-noinst_LIBRARIES =
-noinst_LTLIBRARIES =
-EXTRA_DIST =
-BUILT_SOURCES =
-SUFFIXES =
-MOSTLYCLEANFILES = core *.stackdump
-MOSTLYCLEANDIRS =
-CLEANFILES =
-DISTCLEANFILES =
-MAINTAINERCLEANFILES =
-
-AM_CPPFLAGS =
-
-noinst_LTLIBRARIES += libgnu.la
-
-libgnu_la_SOURCES =
-libgnu_la_LIBADD = $(gl_LTLIBOBJS)
-libgnu_la_DEPENDENCIES = $(gl_LTLIBOBJS)
-EXTRA_libgnu_la_SOURCES =
-libgnu_la_LDFLAGS = $(AM_LDFLAGS)
-
-## begin gnulib module alloca
-
-
-EXTRA_DIST += alloca.c
-
-EXTRA_libgnu_la_SOURCES += alloca.c
-
-libgnu_la_LIBADD += @LTALLOCA@
-libgnu_la_DEPENDENCIES += @LTALLOCA@
-## end gnulib module alloca
-
-## begin gnulib module alloca-opt
-
-BUILT_SOURCES += $(ALLOCA_H)
-
-# We need the following in order to create when the system
-# doesn't have one that works with the given compiler.
-alloca.h: alloca.in.h
- { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
- cat $(srcdir)/alloca.in.h; \
- } > $@-t
- mv -f $@-t $@
-MOSTLYCLEANFILES += alloca.h alloca.h-t
-
-EXTRA_DIST += alloca.in.h
-
-## end gnulib module alloca-opt
-
-## begin gnulib module arpa_inet
-
-BUILT_SOURCES += $(ARPA_INET_H)
-
-# We need the following in order to create when the system
-# doesn't have one.
-arpa/inet.h:
- @MKDIR_P@ arpa
- 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_ARPA_INET_H''@|$(NEXT_ARPA_INET_H)|g' \
- -e 's|@''HAVE_ARPA_INET_H''@|$(HAVE_ARPA_INET_H)|g' \
- -e 's|@''GNULIB_INET_NTOP''@|$(GNULIB_INET_NTOP)|g' \
- -e 's|@''GNULIB_INET_PTON''@|$(GNULIB_INET_PTON)|g' \
- -e 's|@''HAVE_DECL_INET_NTOP''@|$(HAVE_DECL_INET_NTOP)|g' \
- -e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \
- -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
- < $(srcdir)/arpa_inet.in.h; \
- } > $@-t
- mv $@-t $@
-MOSTLYCLEANFILES += arpa/inet.h arpa/inet.h-t
-MOSTLYCLEANDIRS += arpa
-
-EXTRA_DIST += arpa_inet.in.h
-
-## end gnulib module arpa_inet
-
-## begin gnulib module c-ctype
-
-libgnu_la_SOURCES += c-ctype.h c-ctype.c
-
-## end gnulib module c-ctype
-
-## begin gnulib module close
-
-
-EXTRA_DIST += close.c w32sock.h
-
-EXTRA_libgnu_la_SOURCES += close.c
-
-## end gnulib module close
-
-## begin gnulib module connect
-
-
-EXTRA_DIST += connect.c w32sock.h
-
-EXTRA_libgnu_la_SOURCES += connect.c
-
-## end gnulib module connect
-
-## begin gnulib module errno
-
-BUILT_SOURCES += $(ERRNO_H)
-
-# We need the following in order to create when the system
-# doesn't have one that is POSIX compliant.
-errno.h: errno.in.h
- 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_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \
- -e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \
- -e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \
- -e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \
- -e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \
- -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \
- -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \
- < $(srcdir)/errno.in.h; \
- } > $@-t
- mv $@-t $@
-MOSTLYCLEANFILES += errno.h errno.h-t
-
-EXTRA_DIST += errno.in.h
-
-## end gnulib module errno
-
-## begin gnulib module fclose
-
-
-EXTRA_DIST += fclose.c
-
-EXTRA_libgnu_la_SOURCES += fclose.c
-
-## end gnulib module fclose
-
-## begin gnulib module float
-
-BUILT_SOURCES += $(FLOAT_H)
-
-# We need the following in order to create when the system
-# doesn't have one that works with the given compiler.
-float.h: float.in.h
- 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_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \
- < $(srcdir)/float.in.h; \
- } > $@-t
- mv $@-t $@
-MOSTLYCLEANFILES += float.h float.h-t
-
-EXTRA_DIST += float.in.h
-
-## end gnulib module float
-
-## begin gnulib module fseeko
-
-
-EXTRA_DIST += fseeko.c stdio-impl.h
-
-EXTRA_libgnu_la_SOURCES += fseeko.c
-
-## end gnulib module fseeko
-
-## begin gnulib module getaddrinfo
-
-
-EXTRA_DIST += gai_strerror.c getaddrinfo.c
-
-EXTRA_libgnu_la_SOURCES += gai_strerror.c getaddrinfo.c
-
-## end gnulib module getaddrinfo
-
-## begin gnulib module getdelim
-
-
-EXTRA_DIST += getdelim.c
-
-EXTRA_libgnu_la_SOURCES += getdelim.c
-
-## end gnulib module getdelim
-
-## begin gnulib module gethostname
-
-
-EXTRA_DIST += gethostname.c
-
-EXTRA_libgnu_la_SOURCES += gethostname.c
-
-## end gnulib module gethostname
-
-## begin gnulib module getline
-
-
-EXTRA_DIST += getline.c
-
-EXTRA_libgnu_la_SOURCES += getline.c
-
-## end gnulib module getline
-
-## begin gnulib module getpass
-
-
-EXTRA_DIST += getpass.c getpass.h
-
-EXTRA_libgnu_la_SOURCES += getpass.c
-
-## end gnulib module getpass
-
-## begin gnulib module gettext
-
-# This is for those projects which use "gettextize --intl" to put a source-code
-# copy of libintl into their package. In such projects, every Makefile.am needs
-# -I$(top_builddir)/intl, so that can be found in this directory.
-# For the Makefile.ams in other directories it is the maintainer's
-# responsibility; for the one from gnulib we do it here.
-# This option has no effect when the user disables NLS (because then the intl
-# directory contains no libintl.h file) or when the project does not use
-# "gettextize --intl".
-AM_CPPFLAGS += -I$(top_builddir)/intl
-
-EXTRA_DIST += $(top_srcdir)/build-aux/config.rpath
-
-## end gnulib module gettext
-
-## begin gnulib module gettext-h
-
-libgnu_la_SOURCES += gettext.h
-
-## end gnulib module gettext-h
-
-## begin gnulib module gettimeofday
-
-
-EXTRA_DIST += gettimeofday.c
-
-EXTRA_libgnu_la_SOURCES += gettimeofday.c
-
-## end gnulib module gettimeofday
-
-## begin gnulib module havelib
-
-
-EXTRA_DIST += $(top_srcdir)/build-aux/config.rpath
-
-## end gnulib module havelib
-
-## begin gnulib module inet_ntop
-
-
-EXTRA_DIST += inet_ntop.c
-
-EXTRA_libgnu_la_SOURCES += inet_ntop.c
-
-## end gnulib module inet_ntop
-
-## begin gnulib module inet_pton
-
-
-EXTRA_DIST += inet_pton.c
-
-EXTRA_libgnu_la_SOURCES += inet_pton.c
-
-## end gnulib module inet_pton
-
-## begin gnulib module intprops
-
-
-EXTRA_DIST += intprops.h
-
-## end gnulib module intprops
-
-## begin gnulib module ioctl
-
-
-EXTRA_DIST += ioctl.c w32sock.h
-
-EXTRA_libgnu_la_SOURCES += ioctl.c
-
-## end gnulib module ioctl
-
-## begin gnulib module link-warning
-
-LINK_WARNING_H=$(top_srcdir)/build-aux/link-warning.h
-
-EXTRA_DIST += $(top_srcdir)/build-aux/link-warning.h
-
-## end gnulib module link-warning
-
-## begin gnulib module lseek
-
-
-EXTRA_DIST += lseek.c
-
-EXTRA_libgnu_la_SOURCES += lseek.c
-
-## end gnulib module lseek
-
-## begin gnulib module lstat
-
-
-EXTRA_DIST += lstat.c
-
-EXTRA_libgnu_la_SOURCES += lstat.c
-
-## end gnulib module lstat
-
-## begin gnulib module malloc-posix
-
-
-EXTRA_DIST += malloc.c
-
-EXTRA_libgnu_la_SOURCES += malloc.c
-
-## end gnulib module malloc-posix
-
-## begin gnulib module mkstemp
-
-
-EXTRA_DIST += mkstemp.c
-
-EXTRA_libgnu_la_SOURCES += mkstemp.c
-
-## end gnulib module mkstemp
-
-## begin gnulib module mktempd
-
-
-EXTRA_DIST += $(top_srcdir)/build-aux/mktempd
-
-## end gnulib module mktempd
-
-## begin gnulib module netdb
-
-BUILT_SOURCES += $(NETDB_H)
-
-# We need the following in order to create when the system
-# doesn't have one that works with the given compiler.
-netdb.h: netdb.in.h
- 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_NETDB_H''@|$(NEXT_NETDB_H)|g' \
- -e 's|@''HAVE_NETDB_H''@|$(HAVE_NETDB_H)|g' \
- -e 's|@''GNULIB_GETADDRINFO''@|$(GNULIB_GETADDRINFO)|g' \
- -e 's|@''HAVE_STRUCT_ADDRINFO''@|$(HAVE_STRUCT_ADDRINFO)|g' \
- -e 's|@''HAVE_DECL_FREEADDRINFO''@|$(HAVE_DECL_FREEADDRINFO)|g' \
- -e 's|@''HAVE_DECL_GAI_STRERROR''@|$(HAVE_DECL_GAI_STRERROR)|g' \
- -e 's|@''HAVE_DECL_GETADDRINFO''@|$(HAVE_DECL_GETADDRINFO)|g' \
- -e 's|@''HAVE_DECL_GETNAMEINFO''@|$(HAVE_DECL_GETNAMEINFO)|g' \
- < $(srcdir)/netdb.in.h; \
- } > $@-t
- mv $@-t $@
-MOSTLYCLEANFILES += netdb.h netdb.h-t
-
-EXTRA_DIST += netdb.in.h
-
-## end gnulib module netdb
-
-## begin gnulib module netinet_in
-
-BUILT_SOURCES += $(NETINET_IN_H)
-
-# We need the following in order to create when the system
-# doesn't have one.
-netinet/in.h: netinet_in.in.h
- @MKDIR_P@ netinet
- 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_NETINET_IN_H''@|$(NEXT_NETINET_IN_H)|g' \
- -e 's|@''HAVE_NETINET_IN_H''@|$(HAVE_NETINET_IN_H)|g' \
- < $(srcdir)/netinet_in.in.h; \
- } > $@-t
- mv $@-t $@
-MOSTLYCLEANFILES += netinet/in.h netinet/in.h-t
-MOSTLYCLEANDIRS += netinet
-
-EXTRA_DIST += netinet_in.in.h
-
-## end gnulib module netinet_in
-
-## begin gnulib module perror
-
-
-EXTRA_DIST += perror.c
-
-EXTRA_libgnu_la_SOURCES += perror.c
-
-## end gnulib module perror
-
-## begin gnulib module physmem
-
-
-EXTRA_DIST += physmem.c physmem.h
-
-EXTRA_libgnu_la_SOURCES += physmem.c
-
-## end gnulib module physmem
-
-## begin gnulib module poll
-
-BUILT_SOURCES += $(POLL_H)
-
-# We need the following in order to create when the system
-# doesn't have one.
-poll.h: poll.in.h
- { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
- cat $(srcdir)/poll.in.h; \
- } > $@-t
- mv -f $@-t $@
-MOSTLYCLEANFILES += poll.h poll.h-t
-
-EXTRA_DIST += poll.c poll.in.h
-
-EXTRA_libgnu_la_SOURCES += poll.c
-
-## end gnulib module poll
-
-## begin gnulib module posix-shell
-
-##Sample usage of posix-shell module:
-#script: script.in
-# rm -f $@-t $@
-# sed -e 's#@''PREFERABLY_POSIX_SHELL''@#$(PREFERABLY_POSIX_SHELL)#g' \
-# -e 's#@''POSIX_SHELL''@#$(POSIX_SHELL)#g' \
-# -e $(srcdir)/$@.in >$@-t
-# chmod a+x $@-t
-# mv $@-t $@
-#EXTRA_DIST += script.in
-#MOSTLYCLEANFILES += script script-t
-
-## end gnulib module posix-shell
-
-## begin gnulib module random_r
-
-
-EXTRA_DIST += random_r.c
-
-EXTRA_libgnu_la_SOURCES += random_r.c
-
-## end gnulib module random_r
-
-## begin gnulib module realloc-posix
-
-
-EXTRA_DIST += realloc.c
-
-EXTRA_libgnu_la_SOURCES += realloc.c
-
-## end gnulib module realloc-posix
-
-## begin gnulib module recv
-
-
-EXTRA_DIST += recv.c w32sock.h
-
-EXTRA_libgnu_la_SOURCES += recv.c
-
-## end gnulib module recv
-
-## begin gnulib module send
-
-
-EXTRA_DIST += send.c w32sock.h
-
-EXTRA_libgnu_la_SOURCES += send.c
-
-## end gnulib module send
-
-## begin gnulib module setsockopt
-
-
-EXTRA_DIST += setsockopt.c w32sock.h
-
-EXTRA_libgnu_la_SOURCES += setsockopt.c
-
-## end gnulib module setsockopt
-
-## begin gnulib module size_max
-
-libgnu_la_SOURCES += size_max.h
-
-## end gnulib module size_max
-
-## begin gnulib module snprintf
-
-
-EXTRA_DIST += snprintf.c
-
-EXTRA_libgnu_la_SOURCES += snprintf.c
-
-## end gnulib module snprintf
-
-## begin gnulib module socket
-
-
-EXTRA_DIST += socket.c w32sock.h
-
-EXTRA_libgnu_la_SOURCES += socket.c
-
-## end gnulib module socket
-
-## begin gnulib module stdbool
-
-BUILT_SOURCES += $(STDBOOL_H)
-
-# We need the following in order to create when the system
-# doesn't have one that works.
-stdbool.h: stdbool.in.h
- rm -f $@-t $@
- { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
- sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \
- } > $@-t
- mv $@-t $@
-MOSTLYCLEANFILES += stdbool.h stdbool.h-t
-
-EXTRA_DIST += stdbool.in.h
-
-## end gnulib module stdbool
-
-## begin gnulib module stdint
-
-BUILT_SOURCES += $(STDINT_H)
-
-# We need the following in order to create when the system
-# doesn't have one that works with the given compiler.
-stdint.h: stdint.in.h
- rm -f $@-t $@
- { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
- sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
- -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
- -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
- -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \
- -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \
- -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
- -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
- -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
- -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
- -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
- -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
- -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \
- -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \
- -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \
- -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \
- -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \
- -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \
- -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \
- -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \
- -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \
- -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \
- -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \
- -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
- -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
- < $(srcdir)/stdint.in.h; \
- } > $@-t
- mv $@-t $@
-MOSTLYCLEANFILES += stdint.h stdint.h-t
-
-EXTRA_DIST += stdint.in.h
-
-## end gnulib module stdint
-
-## begin gnulib module stdio
-
-BUILT_SOURCES += stdio.h
-
-# We need the following in order to create when the system
-# doesn't have one that works with the given compiler.
-stdio.h: stdio.in.h
- 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_STDIO_H''@|$(NEXT_STDIO_H)|g' \
- -e 's|@''GNULIB_FPRINTF''@|$(GNULIB_FPRINTF)|g' \
- -e 's|@''GNULIB_FPRINTF_POSIX''@|$(GNULIB_FPRINTF_POSIX)|g' \
- -e 's|@''GNULIB_PRINTF''@|$(GNULIB_PRINTF)|g' \
- -e 's|@''GNULIB_PRINTF_POSIX''@|$(GNULIB_PRINTF_POSIX)|g' \
- -e 's|@''GNULIB_SNPRINTF''@|$(GNULIB_SNPRINTF)|g' \
- -e 's|@''GNULIB_SPRINTF_POSIX''@|$(GNULIB_SPRINTF_POSIX)|g' \
- -e 's|@''GNULIB_VFPRINTF''@|$(GNULIB_VFPRINTF)|g' \
- -e 's|@''GNULIB_VFPRINTF_POSIX''@|$(GNULIB_VFPRINTF_POSIX)|g' \
- -e 's|@''GNULIB_VPRINTF''@|$(GNULIB_VPRINTF)|g' \
- -e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \
- -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \
- -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \
- -e 's|@''GNULIB_DPRINTF''@|$(GNULIB_DPRINTF)|g' \
- -e 's|@''GNULIB_VDPRINTF''@|$(GNULIB_VDPRINTF)|g' \
- -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \
- -e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \
- -e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \
- -e 's|@''GNULIB_FOPEN''@|$(GNULIB_FOPEN)|g' \
- -e 's|@''GNULIB_FREOPEN''@|$(GNULIB_FREOPEN)|g' \
- -e 's|@''GNULIB_FSEEK''@|$(GNULIB_FSEEK)|g' \
- -e 's|@''GNULIB_FSEEKO''@|$(GNULIB_FSEEKO)|g' \
- -e 's|@''GNULIB_FTELL''@|$(GNULIB_FTELL)|g' \
- -e 's|@''GNULIB_FTELLO''@|$(GNULIB_FTELLO)|g' \
- -e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \
- -e 's|@''GNULIB_FCLOSE''@|$(GNULIB_FCLOSE)|g' \
- -e 's|@''GNULIB_FPUTC''@|$(GNULIB_FPUTC)|g' \
- -e 's|@''GNULIB_PUTC''@|$(GNULIB_PUTC)|g' \
- -e 's|@''GNULIB_PUTCHAR''@|$(GNULIB_PUTCHAR)|g' \
- -e 's|@''GNULIB_FPUTS''@|$(GNULIB_FPUTS)|g' \
- -e 's|@''GNULIB_PUTS''@|$(GNULIB_PUTS)|g' \
- -e 's|@''GNULIB_FWRITE''@|$(GNULIB_FWRITE)|g' \
- -e 's|@''GNULIB_GETDELIM''@|$(GNULIB_GETDELIM)|g' \
- -e 's|@''GNULIB_GETLINE''@|$(GNULIB_GETLINE)|g' \
- -e 's|@''GNULIB_PERROR''@|$(GNULIB_PERROR)|g' \
- -e 's|@''GNULIB_STDIO_H_SIGPIPE''@|$(GNULIB_STDIO_H_SIGPIPE)|g' \
- -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \
- -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
- -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
- -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \
- -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
- -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
- -e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
- -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
- -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
- -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
- -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
- -e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \
- -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \
- -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \
- -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \
- -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
- -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
- -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
- -e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \
- -e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \
- -e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \
- -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
- -e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \
- -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
- -e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \
- -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
- -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \
- -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
- -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
- -e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \
- -e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \
- -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
- < $(srcdir)/stdio.in.h; \
- } > $@-t
- mv $@-t $@
-MOSTLYCLEANFILES += stdio.h stdio.h-t
-
-EXTRA_DIST += stdio-write.c stdio.in.h
-
-EXTRA_libgnu_la_SOURCES += stdio-write.c
-
-## end gnulib module stdio
-
-## begin gnulib module stdlib
-
-BUILT_SOURCES += stdlib.h
-
-# We need the following in order to create when the system
-# doesn't have one that works with the given compiler.
-stdlib.h: stdlib.in.h
- 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_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \
- -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \
- -e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \
- -e 's|@''GNULIB_REALLOC_POSIX''@|$(GNULIB_REALLOC_POSIX)|g' \
- -e 's|@''GNULIB_CALLOC_POSIX''@|$(GNULIB_CALLOC_POSIX)|g' \
- -e 's|@''GNULIB_ATOLL''@|$(GNULIB_ATOLL)|g' \
- -e 's|@''GNULIB_GETLOADAVG''@|$(GNULIB_GETLOADAVG)|g' \
- -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \
- -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \
- -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \
- -e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \
- -e 's|@''GNULIB_RANDOM_R''@|$(GNULIB_RANDOM_R)|g' \
- -e 's|@''GNULIB_RPMATCH''@|$(GNULIB_RPMATCH)|g' \
- -e 's|@''GNULIB_SETENV''@|$(GNULIB_SETENV)|g' \
- -e 's|@''GNULIB_STRTOD''@|$(GNULIB_STRTOD)|g' \
- -e 's|@''GNULIB_STRTOLL''@|$(GNULIB_STRTOLL)|g' \
- -e 's|@''GNULIB_STRTOULL''@|$(GNULIB_STRTOULL)|g' \
- -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \
- -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
- -e 's|@''HAVE_CALLOC_POSIX''@|$(HAVE_CALLOC_POSIX)|g' \
- -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
- -e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \
- -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
- -e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \
- -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
- -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
- -e 's|@''HAVE_SETENV''@|$(HAVE_SETENV)|g' \
- -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
- -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \
- -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \
- -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \
- -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \
- -e 's|@''HAVE_UNSETENV''@|$(HAVE_UNSETENV)|g' \
- -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \
- -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
- -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
- -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \
- -e 's|@''VOID_UNSETENV''@|$(VOID_UNSETENV)|g' \
- -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
- < $(srcdir)/stdlib.in.h; \
- } > $@-t
- mv $@-t $@
-MOSTLYCLEANFILES += stdlib.h stdlib.h-t
-
-EXTRA_DIST += stdlib.in.h
-
-## end gnulib module stdlib
-
-## begin gnulib module stpcpy
-
-
-EXTRA_DIST += stpcpy.c
-
-EXTRA_libgnu_la_SOURCES += stpcpy.c
-
-## end gnulib module stpcpy
-
-## begin gnulib module strdup-posix
-
-
-EXTRA_DIST += strdup.c
-
-EXTRA_libgnu_la_SOURCES += strdup.c
-
-## end gnulib module strdup-posix
-
-## begin gnulib module strerror
-
-
-EXTRA_DIST += strerror.c
-
-EXTRA_libgnu_la_SOURCES += strerror.c
-
-## end gnulib module strerror
-
-## begin gnulib module string
-
-BUILT_SOURCES += string.h
-
-# We need the following in order to create when the system
-# doesn't have one that works with the given compiler.
-string.h: string.in.h
- 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_STRING_H''@|$(NEXT_STRING_H)|g' \
- -e 's|@''GNULIB_MBSLEN''@|$(GNULIB_MBSLEN)|g' \
- -e 's|@''GNULIB_MBSNLEN''@|$(GNULIB_MBSNLEN)|g' \
- -e 's|@''GNULIB_MBSCHR''@|$(GNULIB_MBSCHR)|g' \
- -e 's|@''GNULIB_MBSRCHR''@|$(GNULIB_MBSRCHR)|g' \
- -e 's|@''GNULIB_MBSSTR''@|$(GNULIB_MBSSTR)|g' \
- -e 's|@''GNULIB_MBSCASECMP''@|$(GNULIB_MBSCASECMP)|g' \
- -e 's|@''GNULIB_MBSNCASECMP''@|$(GNULIB_MBSNCASECMP)|g' \
- -e 's|@''GNULIB_MBSPCASECMP''@|$(GNULIB_MBSPCASECMP)|g' \
- -e 's|@''GNULIB_MBSCASESTR''@|$(GNULIB_MBSCASESTR)|g' \
- -e 's|@''GNULIB_MBSCSPN''@|$(GNULIB_MBSCSPN)|g' \
- -e 's|@''GNULIB_MBSPBRK''@|$(GNULIB_MBSPBRK)|g' \
- -e 's|@''GNULIB_MBSSPN''@|$(GNULIB_MBSSPN)|g' \
- -e 's|@''GNULIB_MBSSEP''@|$(GNULIB_MBSSEP)|g' \
- -e 's|@''GNULIB_MBSTOK_R''@|$(GNULIB_MBSTOK_R)|g' \
- -e 's|@''GNULIB_MEMMEM''@|$(GNULIB_MEMMEM)|g' \
- -e 's|@''GNULIB_MEMPCPY''@|$(GNULIB_MEMPCPY)|g' \
- -e 's|@''GNULIB_MEMRCHR''@|$(GNULIB_MEMRCHR)|g' \
- -e 's|@''GNULIB_RAWMEMCHR''@|$(GNULIB_RAWMEMCHR)|g' \
- -e 's|@''GNULIB_STPCPY''@|$(GNULIB_STPCPY)|g' \
- -e 's|@''GNULIB_STPNCPY''@|$(GNULIB_STPNCPY)|g' \
- -e 's|@''GNULIB_STRCHRNUL''@|$(GNULIB_STRCHRNUL)|g' \
- -e 's|@''GNULIB_STRDUP''@|$(GNULIB_STRDUP)|g' \
- -e 's|@''GNULIB_STRNDUP''@|$(GNULIB_STRNDUP)|g' \
- -e 's|@''GNULIB_STRNLEN''@|$(GNULIB_STRNLEN)|g' \
- -e 's|@''GNULIB_STRPBRK''@|$(GNULIB_STRPBRK)|g' \
- -e 's|@''GNULIB_STRSEP''@|$(GNULIB_STRSEP)|g' \
- -e 's|@''GNULIB_STRSTR''@|$(GNULIB_STRSTR)|g' \
- -e 's|@''GNULIB_STRCASESTR''@|$(GNULIB_STRCASESTR)|g' \
- -e 's|@''GNULIB_STRTOK_R''@|$(GNULIB_STRTOK_R)|g' \
- -e 's|@''GNULIB_STRERROR''@|$(GNULIB_STRERROR)|g' \
- -e 's|@''GNULIB_STRSIGNAL''@|$(GNULIB_STRSIGNAL)|g' \
- -e 's|@''GNULIB_STRVERSCMP''@|$(GNULIB_STRVERSCMP)|g' \
- -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
- -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
- -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
- -e 's|@''HAVE_RAWMEMCHR''@|$(HAVE_RAWMEMCHR)|g' \
- -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \
- -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \
- -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \
- -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \
- -e 's|@''HAVE_STRNDUP''@|$(HAVE_STRNDUP)|g' \
- -e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \
- -e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \
- -e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \
- -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \
- -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \
- -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \
- -e 's|@''HAVE_DECL_STRERROR''@|$(HAVE_DECL_STRERROR)|g' \
- -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \
- -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \
- -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
- -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
- -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \
- -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
- -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
- -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
- -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
- < $(srcdir)/string.in.h; \
- } > $@-t
- mv $@-t $@
-MOSTLYCLEANFILES += string.h string.h-t
-
-EXTRA_DIST += string.in.h
-
-## end gnulib module string
-
-## begin gnulib module strndup
-
-
-EXTRA_DIST += strndup.c
-
-EXTRA_libgnu_la_SOURCES += strndup.c
-
-## end gnulib module strndup
-
-## begin gnulib module strnlen
-
-
-EXTRA_DIST += strnlen.c
-
-EXTRA_libgnu_la_SOURCES += strnlen.c
-
-## end gnulib module strnlen
-
-## begin gnulib module strsep
-
-
-EXTRA_DIST += strsep.c
-
-EXTRA_libgnu_la_SOURCES += strsep.c
-
-## end gnulib module strsep
-
-## begin gnulib module sys_ioctl
-
-BUILT_SOURCES += $(SYS_IOCTL_H)
-
-# We need the following in order to create when the system
-# does not have a complete one.
-sys/ioctl.h: sys_ioctl.in.h
- @MKDIR_P@ sys
- rm -f $@-t $@
- { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
- sed -e 's|@''HAVE_SYS_IOCTL_H''@|$(HAVE_SYS_IOCTL_H)|g' \
- -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
- -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
- -e 's|@''NEXT_SYS_IOCTL_H''@|$(NEXT_SYS_IOCTL_H)|g' \
- -e 's|@''GNULIB_IOCTL''@|$(GNULIB_IOCTL)|g' \
- -e 's|@''SYS_IOCTL_H_HAVE_WINSOCK2_H''@|$(SYS_IOCTL_H_HAVE_WINSOCK2_H)|g' \
- -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
- < $(srcdir)/sys_ioctl.in.h; \
- } > $@-t
- mv $@-t $@
-MOSTLYCLEANFILES += sys/ioctl.h sys/ioctl.h-t
-MOSTLYCLEANDIRS += sys
-
-EXTRA_DIST += sys_ioctl.in.h
-
-## end gnulib module sys_ioctl
-
-## begin gnulib module sys_select
-
-BUILT_SOURCES += $(SYS_SELECT_H)
-
-# We need the following in order to create when the system
-# doesn't have one that works with the given compiler.
-sys/select.h: sys_select.in.h
- @MKDIR_P@ sys
- 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_SYS_SELECT_H''@|$(NEXT_SYS_SELECT_H)|g' \
- -e 's|@''HAVE_SYS_SELECT_H''@|$(HAVE_SYS_SELECT_H)|g' \
- -e 's|@''GNULIB_SELECT''@|$(GNULIB_SELECT)|g' \
- -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
- -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
- < $(srcdir)/sys_select.in.h; \
- } > $@-t
- mv $@-t $@
-MOSTLYCLEANFILES += sys/select.h sys/select.h-t
-MOSTLYCLEANDIRS += sys
-
-EXTRA_DIST += sys_select.in.h
-
-## end gnulib module sys_select
-
-## begin gnulib module sys_socket
-
-BUILT_SOURCES += $(SYS_SOCKET_H)
-
-# We need the following in order to create when the system
-# doesn't have one that works with the given compiler.
-sys/socket.h: sys_socket.in.h
- @MKDIR_P@ sys
- { 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_SYS_SOCKET_H''@|$(NEXT_SYS_SOCKET_H)|g' \
- -e 's|@''HAVE_SYS_SOCKET_H''@|$(HAVE_SYS_SOCKET_H)|g' \
- -e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|g' \
- -e 's|@''GNULIB_SOCKET''@|$(GNULIB_SOCKET)|g' \
- -e 's|@''GNULIB_CONNECT''@|$(GNULIB_CONNECT)|g' \
- -e 's|@''GNULIB_ACCEPT''@|$(GNULIB_ACCEPT)|g' \
- -e 's|@''GNULIB_BIND''@|$(GNULIB_BIND)|g' \
- -e 's|@''GNULIB_GETPEERNAME''@|$(GNULIB_GETPEERNAME)|g' \
- -e 's|@''GNULIB_GETSOCKNAME''@|$(GNULIB_GETSOCKNAME)|g' \
- -e 's|@''GNULIB_GETSOCKOPT''@|$(GNULIB_GETSOCKOPT)|g' \
- -e 's|@''GNULIB_LISTEN''@|$(GNULIB_LISTEN)|g' \
- -e 's|@''GNULIB_RECV''@|$(GNULIB_RECV)|g' \
- -e 's|@''GNULIB_SEND''@|$(GNULIB_SEND)|g' \
- -e 's|@''GNULIB_RECVFROM''@|$(GNULIB_RECVFROM)|g' \
- -e 's|@''GNULIB_SENDTO''@|$(GNULIB_SENDTO)|g' \
- -e 's|@''GNULIB_SETSOCKOPT''@|$(GNULIB_SETSOCKOPT)|g' \
- -e 's|@''GNULIB_SHUTDOWN''@|$(GNULIB_SHUTDOWN)|g' \
- -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
- -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \
- -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
- < $(srcdir)/sys_socket.in.h; \
- } > $@-t
- mv -f $@-t $@
-MOSTLYCLEANFILES += sys/socket.h sys/socket.h-t
-MOSTLYCLEANDIRS += sys
-
-EXTRA_DIST += sys_socket.in.h
-
-## end gnulib module sys_socket
-
-## begin gnulib module sys_stat
-
-BUILT_SOURCES += $(SYS_STAT_H)
-
-# We need the following in order to create when the system
-# has one that is incomplete.
-sys/stat.h: sys_stat.in.h
- @MKDIR_P@ sys
- 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_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
- -e 's|@''GNULIB_LCHMOD''@|$(GNULIB_LCHMOD)|g' \
- -e 's|@''GNULIB_LSTAT''@|$(GNULIB_LSTAT)|g' \
- -e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \
- -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \
- -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \
- -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \
- -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
- < $(srcdir)/sys_stat.in.h; \
- } > $@-t
- mv $@-t $@
-MOSTLYCLEANFILES += sys/stat.h sys/stat.h-t
-MOSTLYCLEANDIRS += sys
-
-EXTRA_DIST += sys_stat.in.h
-
-## end gnulib module sys_stat
-
-## begin gnulib module sys_time
-
-BUILT_SOURCES += $(SYS_TIME_H)
-
-# We need the following in order to create when the system
-# doesn't have one that works with the given compiler.
-sys/time.h: sys_time.in.h
- @MKDIR_P@ sys
- rm -f $@-t $@
- { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
- sed -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \
- -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
- -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
- -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \
- -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \
- -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \
- < $(srcdir)/sys_time.in.h; \
- } > $@-t
- mv $@-t $@
-MOSTLYCLEANFILES += sys/time.h sys/time.h-t
-
-EXTRA_DIST += sys_time.in.h
-
-## end gnulib module sys_time
-
-## begin gnulib module tempname
-
-
-EXTRA_DIST += tempname.c tempname.h
-
-EXTRA_libgnu_la_SOURCES += tempname.c
-
-## end gnulib module tempname
-
-## begin gnulib module time
-
-BUILT_SOURCES += time.h
-
-# We need the following in order to create when the system
-# doesn't have one that works with the given compiler.
-time.h: time.in.h
- 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_TIME_H''@|$(NEXT_TIME_H)|g' \
- -e 's|@REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \
- -e 's|@REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \
- -e 's|@REPLACE_STRPTIME''@|$(REPLACE_STRPTIME)|g' \
- -e 's|@REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \
- -e 's|@SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
- -e 's|@TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
- < $(srcdir)/time.in.h; \
- } > $@-t
- mv $@-t $@
-MOSTLYCLEANFILES += time.h time.h-t
-
-EXTRA_DIST += time.in.h
-
-## end gnulib module time
-
-## begin gnulib module time_r
-
-
-EXTRA_DIST += time_r.c
-
-EXTRA_libgnu_la_SOURCES += time_r.c
-
-## end gnulib module time_r
-
-## begin gnulib module unistd
-
-BUILT_SOURCES += unistd.h
-
-# We need the following in order to create an empty placeholder for
-# when the system doesn't have one.
-unistd.h: unistd.in.h
- rm -f $@-t $@
- { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
- sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
- -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
- -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
- -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \
- -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \
- -e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|g' \
- -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \
- -e 's|@''GNULIB_ENVIRON''@|$(GNULIB_ENVIRON)|g' \
- -e 's|@''GNULIB_EUIDACCESS''@|$(GNULIB_EUIDACCESS)|g' \
- -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \
- -e 's|@''GNULIB_FSYNC''@|$(GNULIB_FSYNC)|g' \
- -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \
- -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \
- -e 's|@''GNULIB_GETDOMAINNAME''@|$(GNULIB_GETDOMAINNAME)|g' \
- -e 's|@''GNULIB_GETDTABLESIZE''@|$(GNULIB_GETDTABLESIZE)|g' \
- -e 's|@''GNULIB_GETHOSTNAME''@|$(GNULIB_GETHOSTNAME)|g' \
- -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \
- -e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \
- -e 's|@''GNULIB_GETUSERSHELL''@|$(GNULIB_GETUSERSHELL)|g' \
- -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \
- -e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \
- -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \
- -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \
- -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \
- -e 's|@''GNULIB_UNISTD_H_SIGPIPE''@|$(GNULIB_UNISTD_H_SIGPIPE)|g' \
- -e 's|@''GNULIB_WRITE''@|$(GNULIB_WRITE)|g' \
- -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \
- -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \
- -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \
- -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \
- -e 's|@''HAVE_GETDOMAINNAME''@|$(HAVE_GETDOMAINNAME)|g' \
- -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \
- -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
- -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
- -e 's|@''HAVE_GETUSERSHELL''@|$(HAVE_GETUSERSHELL)|g' \
- -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \
- -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \
- -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
- -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \
- -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
- -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
- -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \
- -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
- -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \
- -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \
- -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
- -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
- -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
- -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
- -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \
- -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \
- -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
- < $(srcdir)/unistd.in.h; \
- } > $@-t
- mv $@-t $@
-MOSTLYCLEANFILES += unistd.h unistd.h-t
-
-EXTRA_DIST += unistd.in.h
-
-## end gnulib module unistd
-
-## begin gnulib module useless-if-before-free
-
-
-EXTRA_DIST += $(top_srcdir)/build-aux/useless-if-before-free
-
-## end gnulib module useless-if-before-free
-
-## begin gnulib module vasnprintf
-
-
-EXTRA_DIST += asnprintf.c float+.h printf-args.c printf-args.h printf-parse.c printf-parse.h vasnprintf.c vasnprintf.h
-
-EXTRA_libgnu_la_SOURCES += asnprintf.c printf-args.c printf-parse.c vasnprintf.c
-
-## end gnulib module vasnprintf
-
-## begin gnulib module vasprintf
-
-
-EXTRA_DIST += asprintf.c vasprintf.c
-
-EXTRA_libgnu_la_SOURCES += asprintf.c vasprintf.c
-
-## end gnulib module vasprintf
-
-## begin gnulib module vc-list-files
-
-
-EXTRA_DIST += $(top_srcdir)/build-aux/vc-list-files
-
-## end gnulib module vc-list-files
-
-## begin gnulib module verify
-
-libgnu_la_SOURCES += verify.h
-
-## end gnulib module verify
-
-## begin gnulib module wchar
-
-BUILT_SOURCES += $(WCHAR_H)
-
-# We need the following in order to create when the system
-# version does not work standalone.
-wchar.h: wchar.in.h
- 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_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
- -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \
- -e 's|@''GNULIB_BTOWC''@|$(GNULIB_BTOWC)|g' \
- -e 's|@''GNULIB_WCTOB''@|$(GNULIB_WCTOB)|g' \
- -e 's|@''GNULIB_MBSINIT''@|$(GNULIB_MBSINIT)|g' \
- -e 's|@''GNULIB_MBRTOWC''@|$(GNULIB_MBRTOWC)|g' \
- -e 's|@''GNULIB_MBRLEN''@|$(GNULIB_MBRLEN)|g' \
- -e 's|@''GNULIB_MBSRTOWCS''@|$(GNULIB_MBSRTOWCS)|g' \
- -e 's|@''GNULIB_MBSNRTOWCS''@|$(GNULIB_MBSNRTOWCS)|g' \
- -e 's|@''GNULIB_WCRTOMB''@|$(GNULIB_WCRTOMB)|g' \
- -e 's|@''GNULIB_WCSRTOMBS''@|$(GNULIB_WCSRTOMBS)|g' \
- -e 's|@''GNULIB_WCSNRTOMBS''@|$(GNULIB_WCSNRTOMBS)|g' \
- -e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \
- -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
- -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \
- -e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \
- -e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \
- -e 's|@''HAVE_MBRLEN''@|$(HAVE_MBRLEN)|g' \
- -e 's|@''HAVE_MBSRTOWCS''@|$(HAVE_MBSRTOWCS)|g' \
- -e 's|@''HAVE_MBSNRTOWCS''@|$(HAVE_MBSNRTOWCS)|g' \
- -e 's|@''HAVE_WCRTOMB''@|$(HAVE_WCRTOMB)|g' \
- -e 's|@''HAVE_WCSRTOMBS''@|$(HAVE_WCSRTOMBS)|g' \
- -e 's|@''HAVE_WCSNRTOMBS''@|$(HAVE_WCSNRTOMBS)|g' \
- -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \
- -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \
- -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \
- -e 's|@''REPLACE_BTOWC''@|$(REPLACE_BTOWC)|g' \
- -e 's|@''REPLACE_WCTOB''@|$(REPLACE_WCTOB)|g' \
- -e 's|@''REPLACE_MBSINIT''@|$(REPLACE_MBSINIT)|g' \
- -e 's|@''REPLACE_MBRTOWC''@|$(REPLACE_MBRTOWC)|g' \
- -e 's|@''REPLACE_MBRLEN''@|$(REPLACE_MBRLEN)|g' \
- -e 's|@''REPLACE_MBSRTOWCS''@|$(REPLACE_MBSRTOWCS)|g' \
- -e 's|@''REPLACE_MBSNRTOWCS''@|$(REPLACE_MBSNRTOWCS)|g' \
- -e 's|@''REPLACE_WCRTOMB''@|$(REPLACE_WCRTOMB)|g' \
- -e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \
- -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
- -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
- < $(srcdir)/wchar.in.h; \
- } > $@-t
- mv $@-t $@
-MOSTLYCLEANFILES += wchar.h wchar.h-t
-
-EXTRA_DIST += wchar.in.h
-
-## end gnulib module wchar
-
-## begin gnulib module xsize
-
-libgnu_la_SOURCES += xsize.h
-
-## end gnulib module xsize
-
-
-mostlyclean-local: mostlyclean-generic
- @for dir in '' $(MOSTLYCLEANDIRS); do \
- if test -n "$$dir" && test -d $$dir; then \
- echo "rmdir $$dir"; rmdir $$dir; \
- fi; \
- done; \
- :
diff --git a/gnulib/lib/alloca.c b/gnulib/lib/alloca.c
deleted file mode 100644
index f9e1ce74d9..0000000000
--- a/gnulib/lib/alloca.c
+++ /dev/null
@@ -1,489 +0,0 @@
-/* alloca.c -- allocate automatically reclaimed memory
- (Mostly) portable public-domain implementation -- D A Gwyn
-
- This implementation of the PWB library alloca function,
- which is used to allocate space off the run-time stack so
- that it is automatically reclaimed upon procedure exit,
- was inspired by discussions with J. Q. Johnson of Cornell.
- J.Otto Tennant contributed the Cray support.
-
- There are some preprocessor constants that can
- be defined when compiling for your specific system, for
- improved efficiency; however, the defaults should be okay.
-
- The general concept of this implementation is to keep
- track of all alloca-allocated blocks, and reclaim any
- that are found to be deeper in the stack than the current
- invocation. This heuristic does not reclaim storage as
- soon as it becomes invalid, but it will do so eventually.
-
- As a special case, alloca(0) reclaims storage without
- allocating any. It is a good idea to use alloca(0) in
- your main control loop, etc. to force garbage collection. */
-
-#include
-
-#include
-
-#include
-#include
-
-#ifdef emacs
-# include "lisp.h"
-# include "blockinput.h"
-# ifdef EMACS_FREE
-# undef free
-# define free EMACS_FREE
-# endif
-#else
-# define memory_full() abort ()
-#endif
-
-/* If compiling with GCC 2, this file's not needed. */
-#if !defined (__GNUC__) || __GNUC__ < 2
-
-/* If someone has defined alloca as a macro,
- there must be some other way alloca is supposed to work. */
-# ifndef alloca
-
-# ifdef emacs
-# ifdef static
-/* actually, only want this if static is defined as ""
- -- this is for usg, in which emacs must undefine static
- in order to make unexec workable
- */
-# ifndef STACK_DIRECTION
-you
-lose
--- must know STACK_DIRECTION at compile-time
-/* Using #error here is not wise since this file should work for
- old and obscure compilers. */
-# endif /* STACK_DIRECTION undefined */
-# endif /* static */
-# endif /* emacs */
-
-/* If your stack is a linked list of frames, you have to
- provide an "address metric" ADDRESS_FUNCTION macro. */
-
-# if defined (CRAY) && defined (CRAY_STACKSEG_END)
-long i00afunc ();
-# define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
-# else
-# define ADDRESS_FUNCTION(arg) &(arg)
-# endif
-
-/* Define STACK_DIRECTION if you know the direction of stack
- growth for your system; otherwise it will be automatically
- deduced at run-time.
-
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown */
-
-# ifndef STACK_DIRECTION
-# define STACK_DIRECTION 0 /* Direction unknown. */
-# endif
-
-# if STACK_DIRECTION != 0
-
-# define STACK_DIR STACK_DIRECTION /* Known at compile-time. */
-
-# else /* STACK_DIRECTION == 0; need run-time code. */
-
-static int stack_dir; /* 1 or -1 once known. */
-# define STACK_DIR stack_dir
-
-static void
-find_stack_direction (void)
-{
- static char *addr = NULL; /* Address of first `dummy', once known. */
- auto char dummy; /* To get stack address. */
-
- if (addr == NULL)
- { /* Initial entry. */
- addr = ADDRESS_FUNCTION (dummy);
-
- find_stack_direction (); /* Recurse once. */
- }
- else
- {
- /* Second entry. */
- if (ADDRESS_FUNCTION (dummy) > addr)
- stack_dir = 1; /* Stack grew upward. */
- else
- stack_dir = -1; /* Stack grew downward. */
- }
-}
-
-# endif /* STACK_DIRECTION == 0 */
-
-/* An "alloca header" is used to:
- (a) chain together all alloca'ed blocks;
- (b) keep track of stack depth.
-
- It is very important that sizeof(header) agree with malloc
- alignment chunk size. The following default should work okay. */
-
-# ifndef ALIGN_SIZE
-# define ALIGN_SIZE sizeof(double)
-# endif
-
-typedef union hdr
-{
- char align[ALIGN_SIZE]; /* To force sizeof(header). */
- struct
- {
- union hdr *next; /* For chaining headers. */
- char *deep; /* For stack depth measure. */
- } h;
-} header;
-
-static header *last_alloca_header = NULL; /* -> last alloca header. */
-
-/* Return a pointer to at least SIZE bytes of storage,
- which will be automatically reclaimed upon exit from
- the procedure that called alloca. Originally, this space
- was supposed to be taken from the current stack frame of the
- caller, but that method cannot be made to work for some
- implementations of C, for example under Gould's UTX/32. */
-
-void *
-alloca (size_t size)
-{
- auto char probe; /* Probes stack depth: */
- register char *depth = ADDRESS_FUNCTION (probe);
-
-# if STACK_DIRECTION == 0
- if (STACK_DIR == 0) /* Unknown growth direction. */
- find_stack_direction ();
-# endif
-
- /* Reclaim garbage, defined as all alloca'd storage that
- was allocated from deeper in the stack than currently. */
-
- {
- register header *hp; /* Traverses linked list. */
-
-# ifdef emacs
- BLOCK_INPUT;
-# endif
-
- for (hp = last_alloca_header; hp != NULL;)
- if ((STACK_DIR > 0 && hp->h.deep > depth)
- || (STACK_DIR < 0 && hp->h.deep < depth))
- {
- register header *np = hp->h.next;
-
- free (hp); /* Collect garbage. */
-
- hp = np; /* -> next header. */
- }
- else
- break; /* Rest are not deeper. */
-
- last_alloca_header = hp; /* -> last valid storage. */
-
-# ifdef emacs
- UNBLOCK_INPUT;
-# endif
- }
-
- if (size == 0)
- return NULL; /* No allocation required. */
-
- /* Allocate combined header + user data storage. */
-
- {
- /* Address of header. */
- register header *new;
-
- size_t combined_size = sizeof (header) + size;
- if (combined_size < sizeof (header))
- memory_full ();
-
- new = malloc (combined_size);
-
- if (! new)
- memory_full ();
-
- new->h.next = last_alloca_header;
- new->h.deep = depth;
-
- last_alloca_header = new;
-
- /* User storage begins just after header. */
-
- return (void *) (new + 1);
- }
-}
-
-# if defined (CRAY) && defined (CRAY_STACKSEG_END)
-
-# ifdef DEBUG_I00AFUNC
-# include
-# endif
-
-# ifndef CRAY_STACK
-# define CRAY_STACK
-# ifndef CRAY2
-/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */
-struct stack_control_header
- {
- long shgrow:32; /* Number of times stack has grown. */
- long shaseg:32; /* Size of increments to stack. */
- long shhwm:32; /* High water mark of stack. */
- long shsize:32; /* Current size of stack (all segments). */
- };
-
-/* The stack segment linkage control information occurs at
- the high-address end of a stack segment. (The stack
- grows from low addresses to high addresses.) The initial
- part of the stack segment linkage control information is
- 0200 (octal) words. This provides for register storage
- for the routine which overflows the stack. */
-
-struct stack_segment_linkage
- {
- long ss[0200]; /* 0200 overflow words. */
- long sssize:32; /* Number of words in this segment. */
- long ssbase:32; /* Offset to stack base. */
- long:32;
- long sspseg:32; /* Offset to linkage control of previous
- segment of stack. */
- long:32;
- long sstcpt:32; /* Pointer to task common address block. */
- long sscsnm; /* Private control structure number for
- microtasking. */
- long ssusr1; /* Reserved for user. */
- long ssusr2; /* Reserved for user. */
- long sstpid; /* Process ID for pid based multi-tasking. */
- long ssgvup; /* Pointer to multitasking thread giveup. */
- long sscray[7]; /* Reserved for Cray Research. */
- long ssa0;
- long ssa1;
- long ssa2;
- long ssa3;
- long ssa4;
- long ssa5;
- long ssa6;
- long ssa7;
- long sss0;
- long sss1;
- long sss2;
- long sss3;
- long sss4;
- long sss5;
- long sss6;
- long sss7;
- };
-
-# else /* CRAY2 */
-/* The following structure defines the vector of words
- returned by the STKSTAT library routine. */
-struct stk_stat
- {
- long now; /* Current total stack size. */
- long maxc; /* Amount of contiguous space which would
- be required to satisfy the maximum
- stack demand to date. */
- long high_water; /* Stack high-water mark. */
- long overflows; /* Number of stack overflow ($STKOFEN) calls. */
- long hits; /* Number of internal buffer hits. */
- long extends; /* Number of block extensions. */
- long stko_mallocs; /* Block allocations by $STKOFEN. */
- long underflows; /* Number of stack underflow calls ($STKRETN). */
- long stko_free; /* Number of deallocations by $STKRETN. */
- long stkm_free; /* Number of deallocations by $STKMRET. */
- long segments; /* Current number of stack segments. */
- long maxs; /* Maximum number of stack segments so far. */
- long pad_size; /* Stack pad size. */
- long current_address; /* Current stack segment address. */
- long current_size; /* Current stack segment size. This
- number is actually corrupted by STKSTAT to
- include the fifteen word trailer area. */
- long initial_address; /* Address of initial segment. */
- long initial_size; /* Size of initial segment. */
- };
-
-/* The following structure describes the data structure which trails
- any stack segment. I think that the description in 'asdef' is
- out of date. I only describe the parts that I am sure about. */
-
-struct stk_trailer
- {
- long this_address; /* Address of this block. */
- long this_size; /* Size of this block (does not include
- this trailer). */
- long unknown2;
- long unknown3;
- long link; /* Address of trailer block of previous
- segment. */
- long unknown5;
- long unknown6;
- long unknown7;
- long unknown8;
- long unknown9;
- long unknown10;
- long unknown11;
- long unknown12;
- long unknown13;
- long unknown14;
- };
-
-# endif /* CRAY2 */
-# endif /* not CRAY_STACK */
-
-# ifdef CRAY2
-/* Determine a "stack measure" for an arbitrary ADDRESS.
- I doubt that "lint" will like this much. */
-
-static long
-i00afunc (long *address)
-{
- struct stk_stat status;
- struct stk_trailer *trailer;
- long *block, size;
- long result = 0;
-
- /* We want to iterate through all of the segments. The first
- step is to get the stack status structure. We could do this
- more quickly and more directly, perhaps, by referencing the
- $LM00 common block, but I know that this works. */
-
- STKSTAT (&status);
-
- /* Set up the iteration. */
-
- trailer = (struct stk_trailer *) (status.current_address
- + status.current_size
- - 15);
-
- /* There must be at least one stack segment. Therefore it is
- a fatal error if "trailer" is null. */
-
- if (trailer == 0)
- abort ();
-
- /* Discard segments that do not contain our argument address. */
-
- while (trailer != 0)
- {
- block = (long *) trailer->this_address;
- size = trailer->this_size;
- if (block == 0 || size == 0)
- abort ();
- trailer = (struct stk_trailer *) trailer->link;
- if ((block <= address) && (address < (block + size)))
- break;
- }
-
- /* Set the result to the offset in this segment and add the sizes
- of all predecessor segments. */
-
- result = address - block;
-
- if (trailer == 0)
- {
- return result;
- }
-
- do
- {
- if (trailer->this_size <= 0)
- abort ();
- result += trailer->this_size;
- trailer = (struct stk_trailer *) trailer->link;
- }
- while (trailer != 0);
-
- /* We are done. Note that if you present a bogus address (one
- not in any segment), you will get a different number back, formed
- from subtracting the address of the first block. This is probably
- not what you want. */
-
- return (result);
-}
-
-# else /* not CRAY2 */
-/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP.
- Determine the number of the cell within the stack,
- given the address of the cell. The purpose of this
- routine is to linearize, in some sense, stack addresses
- for alloca. */
-
-static long
-i00afunc (long address)
-{
- long stkl = 0;
-
- long size, pseg, this_segment, stack;
- long result = 0;
-
- struct stack_segment_linkage *ssptr;
-
- /* Register B67 contains the address of the end of the
- current stack segment. If you (as a subprogram) store
- your registers on the stack and find that you are past
- the contents of B67, you have overflowed the segment.
-
- B67 also points to the stack segment linkage control
- area, which is what we are really interested in. */
-
- stkl = CRAY_STACKSEG_END ();
- ssptr = (struct stack_segment_linkage *) stkl;
-
- /* If one subtracts 'size' from the end of the segment,
- one has the address of the first word of the segment.
-
- If this is not the first segment, 'pseg' will be
- nonzero. */
-
- pseg = ssptr->sspseg;
- size = ssptr->sssize;
-
- this_segment = stkl - size;
-
- /* It is possible that calling this routine itself caused
- a stack overflow. Discard stack segments which do not
- contain the target address. */
-
- while (!(this_segment <= address && address <= stkl))
- {
-# ifdef DEBUG_I00AFUNC
- fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl);
-# endif
- if (pseg == 0)
- break;
- stkl = stkl - pseg;
- ssptr = (struct stack_segment_linkage *) stkl;
- size = ssptr->sssize;
- pseg = ssptr->sspseg;
- this_segment = stkl - size;
- }
-
- result = address - this_segment;
-
- /* If you subtract pseg from the current end of the stack,
- you get the address of the previous stack segment's end.
- This seems a little convoluted to me, but I'll bet you save
- a cycle somewhere. */
-
- while (pseg != 0)
- {
-# ifdef DEBUG_I00AFUNC
- fprintf (stderr, "%011o %011o\n", pseg, size);
-# endif
- stkl = stkl - pseg;
- ssptr = (struct stack_segment_linkage *) stkl;
- size = ssptr->sssize;
- pseg = ssptr->sspseg;
- result += size;
- }
- return (result);
-}
-
-# endif /* not CRAY2 */
-# endif /* CRAY */
-
-# endif /* no alloca */
-#endif /* not GCC version 2.1 */
diff --git a/gnulib/lib/alloca.in.h b/gnulib/lib/alloca.in.h
deleted file mode 100644
index 38b20c3973..0000000000
--- a/gnulib/lib/alloca.in.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Memory allocation on the stack.
-
- Copyright (C) 1995, 1999, 2001-2004, 2006-2008 Free Software
- Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published
- by the Free Software Foundation; either version 2.1, 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 Lesser 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. */
-
-/* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H
- means there is a real alloca function. */
-#ifndef _GL_ALLOCA_H
-#define _GL_ALLOCA_H
-
-/* alloca (N) returns a pointer to N bytes of memory
- allocated on the stack, which will last until the function returns.
- Use of alloca should be avoided:
- - inside arguments of function calls - undefined behaviour,
- - in inline functions - the allocation may actually last until the
- calling function returns,
- - for huge N (say, N >= 65536) - you never know how large (or small)
- the stack is, and when the stack cannot fulfill the memory allocation
- request, the program just crashes.
- */
-
-#ifndef alloca
-# ifdef __GNUC__
-# define alloca __builtin_alloca
-# elif defined _AIX
-# define alloca __alloca
-# elif defined _MSC_VER
-# include
-# define alloca _alloca
-# elif defined __DECC && defined __VMS
-# define alloca __ALLOCA
-# else
-# include
-# ifdef __cplusplus
-extern "C"
-# endif
-void *alloca (size_t);
-# endif
-#endif
-
-#endif /* _GL_ALLOCA_H */
diff --git a/gnulib/lib/arpa/.cvsignore b/gnulib/lib/arpa/.cvsignore
deleted file mode 100644
index b9013ae267..0000000000
--- a/gnulib/lib/arpa/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-inet.h
diff --git a/gnulib/lib/arpa/.gitignore b/gnulib/lib/arpa/.gitignore
deleted file mode 100644
index b9013ae267..0000000000
--- a/gnulib/lib/arpa/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-inet.h
diff --git a/gnulib/lib/arpa_inet.in.h b/gnulib/lib/arpa_inet.in.h
deleted file mode 100644
index ba55ba2236..0000000000
--- a/gnulib/lib/arpa_inet.in.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* A GNU-like .
-
- Copyright (C) 2005-2006, 2008 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser 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. */
-
-#ifndef _GL_ARPA_INET_H
-
-/* Gnulib's sys/socket.h is responsible for pulling in winsock2.h etc
- under MinGW. */
-#include
-
-#if @HAVE_ARPA_INET_H@
-
-# if __GNUC__ >= 3
-@PRAGMA_SYSTEM_HEADER@
-# endif
-
-/* The include_next requires a split double-inclusion guard. */
-# @INCLUDE_NEXT@ @NEXT_ARPA_INET_H@
-
-#endif
-
-#ifndef _GL_ARPA_INET_H
-#define _GL_ARPA_INET_H
-
-/* The definition of GL_LINK_WARNING is copied here. */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if @GNULIB_INET_NTOP@
-# if !@HAVE_DECL_INET_NTOP@
-/* Converts an internet address from internal format to a printable,
- presentable format.
- AF is an internet address family, such as AF_INET or AF_INET6.
- SRC points to a 'struct in_addr' (for AF_INET) or 'struct in6_addr'
- (for AF_INET6).
- DST points to a buffer having room for CNT bytes.
- The printable representation of the address (in numeric form, not
- surrounded by [...], no reverse DNS is done) is placed in DST, and
- DST is returned. If an error occurs, the return value is NULL and
- errno is set. If CNT bytes are not sufficient to hold the result,
- the return value is NULL and errno is set to ENOSPC. A good value
- for CNT is 46.
-
- For more details, see the POSIX:2001 specification
- . */
-extern const char *inet_ntop (int af, const void *restrict src,
- char *restrict dst, socklen_t cnt);
-# endif
-#elif defined GNULIB_POSIXCHECK
-# undef inet_ntop
-# define inet_ntop(af,src,dst,cnt) \
- (GL_LINK_WARNING ("inet_ntop is unportable - " \
- "use gnulib module inet_ntop for portability"), \
- inet_ntop (af, src, dst, cnt))
-#endif
-
-#if @GNULIB_INET_PTON@
-# if !@HAVE_DECL_INET_PTON@
-extern int inet_pton (int af, const char *restrict src, void *restrict dst);
-# endif
-#elif defined GNULIB_POSIXCHECK
-# undef inet_pton
-# define inet_pton(af,src,dst) \
- (GL_LINK_WARNING ("inet_pton is unportable - " \
- "use gnulib module inet_pton for portability"), \
- inet_pton (af, src, dst))
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _GL_ARPA_INET_H */
-#endif /* _GL_ARPA_INET_H */
diff --git a/gnulib/lib/asnprintf.c b/gnulib/lib/asnprintf.c
deleted file mode 100644
index bf989a89a2..0000000000
--- a/gnulib/lib/asnprintf.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Formatted output to strings.
- Copyright (C) 1999, 2002, 2006 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser 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. */
-
-#include
-
-/* Specification. */
-#include "vasnprintf.h"
-
-#include
-
-char *
-asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
-{
- va_list args;
- char *result;
-
- va_start (args, format);
- result = vasnprintf (resultbuf, lengthp, format, args);
- va_end (args);
- return result;
-}
diff --git a/gnulib/lib/asprintf.c b/gnulib/lib/asprintf.c
deleted file mode 100644
index 2df1d4b0ec..0000000000
--- a/gnulib/lib/asprintf.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Formatted output to strings.
- Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser 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. */
-
-#include
-
-/* Specification. */
-#ifdef IN_LIBASPRINTF
-# include "vasprintf.h"
-#else
-# include
-#endif
-
-#include
-
-int
-asprintf (char **resultp, const char *format, ...)
-{
- va_list args;
- int result;
-
- va_start (args, format);
- result = vasprintf (resultp, format, args);
- va_end (args);
- return result;
-}
diff --git a/gnulib/lib/c-ctype.c b/gnulib/lib/c-ctype.c
deleted file mode 100644
index 1c685c549d..0000000000
--- a/gnulib/lib/c-ctype.c
+++ /dev/null
@@ -1,396 +0,0 @@
-/* Character handling in C locale.
-
- Copyright 2000-2003, 2006 Free Software Foundation, Inc.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published by
-the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser 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. */
-
-#include
-
-/* Specification. */
-#define NO_C_CTYPE_MACROS
-#include "c-ctype.h"
-
-/* The function isascii is not locale dependent. Its use in EBCDIC is
- questionable. */
-bool
-c_isascii (int c)
-{
- return (c >= 0x00 && c <= 0x7f);
-}
-
-bool
-c_isalnum (int c)
-{
-#if C_CTYPE_CONSECUTIVE_DIGITS \
- && C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
-#if C_CTYPE_ASCII
- return ((c >= '0' && c <= '9')
- || ((c & ~0x20) >= 'A' && (c & ~0x20) <= 'Z'));
-#else
- return ((c >= '0' && c <= '9')
- || (c >= 'A' && c <= 'Z')
- || (c >= 'a' && c <= 'z'));
-#endif
-#else
- switch (c)
- {
- case '0': case '1': case '2': case '3': case '4': case '5':
- case '6': case '7': case '8': case '9':
- case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
- case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
- case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
- case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
- case 'Y': case 'Z':
- case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
- case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
- case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
- case 's': case 't': case 'u': case 'v': case 'w': case 'x':
- case 'y': case 'z':
- return 1;
- default:
- return 0;
- }
-#endif
-}
-
-bool
-c_isalpha (int c)
-{
-#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
-#if C_CTYPE_ASCII
- return ((c & ~0x20) >= 'A' && (c & ~0x20) <= 'Z');
-#else
- return ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'));
-#endif
-#else
- switch (c)
- {
- case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
- case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
- case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
- case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
- case 'Y': case 'Z':
- case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
- case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
- case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
- case 's': case 't': case 'u': case 'v': case 'w': case 'x':
- case 'y': case 'z':
- return 1;
- default:
- return 0;
- }
-#endif
-}
-
-bool
-c_isblank (int c)
-{
- return (c == ' ' || c == '\t');
-}
-
-bool
-c_iscntrl (int c)
-{
-#if C_CTYPE_ASCII
- return ((c & ~0x1f) == 0 || c == 0x7f);
-#else
- switch (c)
- {
- case ' ': case '!': case '"': case '#': case '$': case '%':
- case '&': case '\'': case '(': case ')': case '*': case '+':
- case ',': case '-': case '.': case '/':
- case '0': case '1': case '2': case '3': case '4': case '5':
- case '6': case '7': case '8': case '9':
- case ':': case ';': case '<': case '=': case '>': case '?':
- case '@':
- case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
- case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
- case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
- case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
- case 'Y': case 'Z':
- case '[': case '\\': case ']': case '^': case '_': case '`':
- case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
- case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
- case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
- case 's': case 't': case 'u': case 'v': case 'w': case 'x':
- case 'y': case 'z':
- case '{': case '|': case '}': case '~':
- return 0;
- default:
- return 1;
- }
-#endif
-}
-
-bool
-c_isdigit (int c)
-{
-#if C_CTYPE_CONSECUTIVE_DIGITS
- return (c >= '0' && c <= '9');
-#else
- switch (c)
- {
- case '0': case '1': case '2': case '3': case '4': case '5':
- case '6': case '7': case '8': case '9':
- return 1;
- default:
- return 0;
- }
-#endif
-}
-
-bool
-c_islower (int c)
-{
-#if C_CTYPE_CONSECUTIVE_LOWERCASE
- return (c >= 'a' && c <= 'z');
-#else
- switch (c)
- {
- case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
- case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
- case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
- case 's': case 't': case 'u': case 'v': case 'w': case 'x':
- case 'y': case 'z':
- return 1;
- default:
- return 0;
- }
-#endif
-}
-
-bool
-c_isgraph (int c)
-{
-#if C_CTYPE_ASCII
- return (c >= '!' && c <= '~');
-#else
- switch (c)
- {
- case '!': case '"': case '#': case '$': case '%': case '&':
- case '\'': case '(': case ')': case '*': case '+': case ',':
- case '-': case '.': case '/':
- case '0': case '1': case '2': case '3': case '4': case '5':
- case '6': case '7': case '8': case '9':
- case ':': case ';': case '<': case '=': case '>': case '?':
- case '@':
- case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
- case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
- case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
- case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
- case 'Y': case 'Z':
- case '[': case '\\': case ']': case '^': case '_': case '`':
- case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
- case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
- case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
- case 's': case 't': case 'u': case 'v': case 'w': case 'x':
- case 'y': case 'z':
- case '{': case '|': case '}': case '~':
- return 1;
- default:
- return 0;
- }
-#endif
-}
-
-bool
-c_isprint (int c)
-{
-#if C_CTYPE_ASCII
- return (c >= ' ' && c <= '~');
-#else
- switch (c)
- {
- case ' ': case '!': case '"': case '#': case '$': case '%':
- case '&': case '\'': case '(': case ')': case '*': case '+':
- case ',': case '-': case '.': case '/':
- case '0': case '1': case '2': case '3': case '4': case '5':
- case '6': case '7': case '8': case '9':
- case ':': case ';': case '<': case '=': case '>': case '?':
- case '@':
- case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
- case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
- case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
- case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
- case 'Y': case 'Z':
- case '[': case '\\': case ']': case '^': case '_': case '`':
- case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
- case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
- case 'm': case 'n': case 'o': case 'p': case 'q': case 'r':
- case 's': case 't': case 'u': case 'v': case 'w': case 'x':
- case 'y': case 'z':
- case '{': case '|': case '}': case '~':
- return 1;
- default:
- return 0;
- }
-#endif
-}
-
-bool
-c_ispunct (int c)
-{
-#if C_CTYPE_ASCII
- return ((c >= '!' && c <= '~')
- && !((c >= '0' && c <= '9')
- || ((c & ~0x20) >= 'A' && (c & ~0x20) <= 'Z')));
-#else
- switch (c)
- {
- case '!': case '"': case '#': case '$': case '%': case '&':
- case '\'': case '(': case ')': case '*': case '+': case ',':
- case '-': case '.': case '/':
- case ':': case ';': case '<': case '=': case '>': case '?':
- case '@':
- case '[': case '\\': case ']': case '^': case '_': case '`':
- case '{': case '|': case '}': case '~':
- return 1;
- default:
- return 0;
- }
-#endif
-}
-
-bool
-c_isspace (int c)
-{
- return (c == ' ' || c == '\t'
- || c == '\n' || c == '\v' || c == '\f' || c == '\r');
-}
-
-bool
-c_isupper (int c)
-{
-#if C_CTYPE_CONSECUTIVE_UPPERCASE
- return (c >= 'A' && c <= 'Z');
-#else
- switch (c)
- {
- case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
- case 'G': case 'H': case 'I': case 'J': case 'K': case 'L':
- case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R':
- case 'S': case 'T': case 'U': case 'V': case 'W': case 'X':
- case 'Y': case 'Z':
- return 1;
- default:
- return 0;
- }
-#endif
-}
-
-bool
-c_isxdigit (int c)
-{
-#if C_CTYPE_CONSECUTIVE_DIGITS \
- && C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
-#if C_CTYPE_ASCII
- return ((c >= '0' && c <= '9')
- || ((c & ~0x20) >= 'A' && (c & ~0x20) <= 'F'));
-#else
- return ((c >= '0' && c <= '9')
- || (c >= 'A' && c <= 'F')
- || (c >= 'a' && c <= 'f'));
-#endif
-#else
- switch (c)
- {
- case '0': case '1': case '2': case '3': case '4': case '5':
- case '6': case '7': case '8': case '9':
- case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
- case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
- return 1;
- default:
- return 0;
- }
-#endif
-}
-
-int
-c_tolower (int c)
-{
-#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
- return (c >= 'A' && c <= 'Z' ? c - 'A' + 'a' : c);
-#else
- switch (c)
- {
- case 'A': return 'a';
- case 'B': return 'b';
- case 'C': return 'c';
- case 'D': return 'd';
- case 'E': return 'e';
- case 'F': return 'f';
- case 'G': return 'g';
- case 'H': return 'h';
- case 'I': return 'i';
- case 'J': return 'j';
- case 'K': return 'k';
- case 'L': return 'l';
- case 'M': return 'm';
- case 'N': return 'n';
- case 'O': return 'o';
- case 'P': return 'p';
- case 'Q': return 'q';
- case 'R': return 'r';
- case 'S': return 's';
- case 'T': return 't';
- case 'U': return 'u';
- case 'V': return 'v';
- case 'W': return 'w';
- case 'X': return 'x';
- case 'Y': return 'y';
- case 'Z': return 'z';
- default: return c;
- }
-#endif
-}
-
-int
-c_toupper (int c)
-{
-#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
- return (c >= 'a' && c <= 'z' ? c - 'a' + 'A' : c);
-#else
- switch (c)
- {
- case 'a': return 'A';
- case 'b': return 'B';
- case 'c': return 'C';
- case 'd': return 'D';
- case 'e': return 'E';
- case 'f': return 'F';
- case 'g': return 'G';
- case 'h': return 'H';
- case 'i': return 'I';
- case 'j': return 'J';
- case 'k': return 'K';
- case 'l': return 'L';
- case 'm': return 'M';
- case 'n': return 'N';
- case 'o': return 'O';
- case 'p': return 'P';
- case 'q': return 'Q';
- case 'r': return 'R';
- case 's': return 'S';
- case 't': return 'T';
- case 'u': return 'U';
- case 'v': return 'V';
- case 'w': return 'W';
- case 'x': return 'X';
- case 'y': return 'Y';
- case 'z': return 'Z';
- default: return c;
- }
-#endif
-}
diff --git a/gnulib/lib/c-ctype.h b/gnulib/lib/c-ctype.h
deleted file mode 100644
index 2bce9d105c..0000000000
--- a/gnulib/lib/c-ctype.h
+++ /dev/null
@@ -1,295 +0,0 @@
-/* Character handling in C locale.
-
- These functions work like the corresponding functions in ,
- except that they have the C (POSIX) locale hardwired, whereas the
- functions' behaviour depends on the current locale set via
- setlocale.
-
- Copyright (C) 2000-2003, 2006, 2008 Free Software Foundation, Inc.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published by
-the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser 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. */
-
-#ifndef C_CTYPE_H
-#define C_CTYPE_H
-
-#include
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/* The functions defined in this file assume the "C" locale and a character
- set without diacritics (ASCII-US or EBCDIC-US or something like that).
- Even if the "C" locale on a particular system is an extension of the ASCII
- character set (like on BeOS, where it is UTF-8, or on AmigaOS, where it
- is ISO-8859-1), the functions in this file recognize only the ASCII
- characters. */
-
-
-/* Check whether the ASCII optimizations apply. */
-
-/* ANSI C89 (and ISO C99 5.2.1.3 too) already guarantees that
- '0', '1', ..., '9' have consecutive integer values. */
-#define C_CTYPE_CONSECUTIVE_DIGITS 1
-
-#if ('A' <= 'Z') \
- && ('A' + 1 == 'B') && ('B' + 1 == 'C') && ('C' + 1 == 'D') \
- && ('D' + 1 == 'E') && ('E' + 1 == 'F') && ('F' + 1 == 'G') \
- && ('G' + 1 == 'H') && ('H' + 1 == 'I') && ('I' + 1 == 'J') \
- && ('J' + 1 == 'K') && ('K' + 1 == 'L') && ('L' + 1 == 'M') \
- && ('M' + 1 == 'N') && ('N' + 1 == 'O') && ('O' + 1 == 'P') \
- && ('P' + 1 == 'Q') && ('Q' + 1 == 'R') && ('R' + 1 == 'S') \
- && ('S' + 1 == 'T') && ('T' + 1 == 'U') && ('U' + 1 == 'V') \
- && ('V' + 1 == 'W') && ('W' + 1 == 'X') && ('X' + 1 == 'Y') \
- && ('Y' + 1 == 'Z')
-#define C_CTYPE_CONSECUTIVE_UPPERCASE 1
-#endif
-
-#if ('a' <= 'z') \
- && ('a' + 1 == 'b') && ('b' + 1 == 'c') && ('c' + 1 == 'd') \
- && ('d' + 1 == 'e') && ('e' + 1 == 'f') && ('f' + 1 == 'g') \
- && ('g' + 1 == 'h') && ('h' + 1 == 'i') && ('i' + 1 == 'j') \
- && ('j' + 1 == 'k') && ('k' + 1 == 'l') && ('l' + 1 == 'm') \
- && ('m' + 1 == 'n') && ('n' + 1 == 'o') && ('o' + 1 == 'p') \
- && ('p' + 1 == 'q') && ('q' + 1 == 'r') && ('r' + 1 == 's') \
- && ('s' + 1 == 't') && ('t' + 1 == 'u') && ('u' + 1 == 'v') \
- && ('v' + 1 == 'w') && ('w' + 1 == 'x') && ('x' + 1 == 'y') \
- && ('y' + 1 == 'z')
-#define C_CTYPE_CONSECUTIVE_LOWERCASE 1
-#endif
-
-#if (' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
- && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
- && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
- && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
- && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
- && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
- && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
- && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
- && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
- && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
- && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
- && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
- && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
- && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
- && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
- && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
- && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
- && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
- && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
- && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
- && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
- && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
- && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)
-/* The character set is ASCII or one of its variants or extensions, not EBCDIC.
- Testing the value of '\n' and '\r' is not relevant. */
-#define C_CTYPE_ASCII 1
-#endif
-
-
-/* Function declarations. */
-
-/* Unlike the functions in , which require an argument in the range
- of the 'unsigned char' type, the functions here operate on values that are
- in the 'unsigned char' range or in the 'char' range. In other words,
- when you have a 'char' value, you need to cast it before using it as
- argument to a function:
-
- const char *s = ...;
- if (isalpha ((unsigned char) *s)) ...
-
- but you don't need to cast it for the functions defined in this file:
-
- const char *s = ...;
- if (c_isalpha (*s)) ...
- */
-
-extern bool c_isascii (int c); /* not locale dependent */
-
-extern bool c_isalnum (int c);
-extern bool c_isalpha (int c);
-extern bool c_isblank (int c);
-extern bool c_iscntrl (int c);
-extern bool c_isdigit (int c);
-extern bool c_islower (int c);
-extern bool c_isgraph (int c);
-extern bool c_isprint (int c);
-extern bool c_ispunct (int c);
-extern bool c_isspace (int c);
-extern bool c_isupper (int c);
-extern bool c_isxdigit (int c);
-
-extern int c_tolower (int c);
-extern int c_toupper (int c);
-
-
-#if defined __GNUC__ && defined __OPTIMIZE__ && !defined __OPTIMIZE_SIZE__ && !defined NO_C_CTYPE_MACROS
-
-/* ASCII optimizations. */
-
-#undef c_isascii
-#define c_isascii(c) \
- ({ int __c = (c); \
- (__c >= 0x00 && __c <= 0x7f); \
- })
-
-#if C_CTYPE_CONSECUTIVE_DIGITS \
- && C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
-#if C_CTYPE_ASCII
-#undef c_isalnum
-#define c_isalnum(c) \
- ({ int __c = (c); \
- ((__c >= '0' && __c <= '9') \
- || ((__c & ~0x20) >= 'A' && (__c & ~0x20) <= 'Z')); \
- })
-#else
-#undef c_isalnum
-#define c_isalnum(c) \
- ({ int __c = (c); \
- ((__c >= '0' && __c <= '9') \
- || (__c >= 'A' && __c <= 'Z') \
- || (__c >= 'a' && __c <= 'z')); \
- })
-#endif
-#endif
-
-#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
-#if C_CTYPE_ASCII
-#undef c_isalpha
-#define c_isalpha(c) \
- ({ int __c = (c); \
- ((__c & ~0x20) >= 'A' && (__c & ~0x20) <= 'Z'); \
- })
-#else
-#undef c_isalpha
-#define c_isalpha(c) \
- ({ int __c = (c); \
- ((__c >= 'A' && __c <= 'Z') || (__c >= 'a' && __c <= 'z')); \
- })
-#endif
-#endif
-
-#undef c_isblank
-#define c_isblank(c) \
- ({ int __c = (c); \
- (__c == ' ' || __c == '\t'); \
- })
-
-#if C_CTYPE_ASCII
-#undef c_iscntrl
-#define c_iscntrl(c) \
- ({ int __c = (c); \
- ((__c & ~0x1f) == 0 || __c == 0x7f); \
- })
-#endif
-
-#if C_CTYPE_CONSECUTIVE_DIGITS
-#undef c_isdigit
-#define c_isdigit(c) \
- ({ int __c = (c); \
- (__c >= '0' && __c <= '9'); \
- })
-#endif
-
-#if C_CTYPE_CONSECUTIVE_LOWERCASE
-#undef c_islower
-#define c_islower(c) \
- ({ int __c = (c); \
- (__c >= 'a' && __c <= 'z'); \
- })
-#endif
-
-#if C_CTYPE_ASCII
-#undef c_isgraph
-#define c_isgraph(c) \
- ({ int __c = (c); \
- (__c >= '!' && __c <= '~'); \
- })
-#endif
-
-#if C_CTYPE_ASCII
-#undef c_isprint
-#define c_isprint(c) \
- ({ int __c = (c); \
- (__c >= ' ' && __c <= '~'); \
- })
-#endif
-
-#if C_CTYPE_ASCII
-#undef c_ispunct
-#define c_ispunct(c) \
- ({ int _c = (c); \
- (c_isgraph (_c) && ! c_isalnum (_c)); \
- })
-#endif
-
-#undef c_isspace
-#define c_isspace(c) \
- ({ int __c = (c); \
- (__c == ' ' || __c == '\t' \
- || __c == '\n' || __c == '\v' || __c == '\f' || __c == '\r'); \
- })
-
-#if C_CTYPE_CONSECUTIVE_UPPERCASE
-#undef c_isupper
-#define c_isupper(c) \
- ({ int __c = (c); \
- (__c >= 'A' && __c <= 'Z'); \
- })
-#endif
-
-#if C_CTYPE_CONSECUTIVE_DIGITS \
- && C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
-#if C_CTYPE_ASCII
-#undef c_isxdigit
-#define c_isxdigit(c) \
- ({ int __c = (c); \
- ((__c >= '0' && __c <= '9') \
- || ((__c & ~0x20) >= 'A' && (__c & ~0x20) <= 'F')); \
- })
-#else
-#undef c_isxdigit
-#define c_isxdigit(c) \
- ({ int __c = (c); \
- ((__c >= '0' && __c <= '9') \
- || (__c >= 'A' && __c <= 'F') \
- || (__c >= 'a' && __c <= 'f')); \
- })
-#endif
-#endif
-
-#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
-#undef c_tolower
-#define c_tolower(c) \
- ({ int __c = (c); \
- (__c >= 'A' && __c <= 'Z' ? __c - 'A' + 'a' : __c); \
- })
-#undef c_toupper
-#define c_toupper(c) \
- ({ int __c = (c); \
- (__c >= 'a' && __c <= 'z' ? __c - 'a' + 'A' : __c); \
- })
-#endif
-
-#endif /* optimizing for speed */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* C_CTYPE_H */
diff --git a/gnulib/lib/close.c b/gnulib/lib/close.c
deleted file mode 100644
index 14243e47f1..0000000000
--- a/gnulib/lib/close.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/* close replacement.
- Copyright (C) 2008 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see . */
-
-#include
-
-/* Specification. */
-#include
-
-#if GNULIB_SYS_SOCKET
-# define WIN32_LEAN_AND_MEAN
-# include
-#endif
-
-#if HAVE__GL_CLOSE_FD_MAYBE_SOCKET
-
-/* Get set_winsock_errno, FD_TO_SOCKET etc. */
-#include "w32sock.h"
-
-static int
-_gl_close_fd_maybe_socket (int fd)
-{
- SOCKET sock = FD_TO_SOCKET (fd);
- WSANETWORKEVENTS ev;
-
- ev.lNetworkEvents = 0xDEADBEEF;
- WSAEnumNetworkEvents (sock, NULL, &ev);
- if (ev.lNetworkEvents != 0xDEADBEEF)
- {
- /* FIXME: other applications, like squid, use an undocumented
- _free_osfhnd free function. But this is not enough: The 'osfile'
- flags for fd also needs to be cleared, but it is hard to access it.
- Instead, here we just close twice the file descriptor. */
- if (closesocket (sock))
- {
- set_winsock_errno ();
- return -1;
- }
- else
- {
- /* This call frees the file descriptor and does a
- CloseHandle ((HANDLE) _get_osfhandle (fd)), which fails. */
- _close (fd);
- return 0;
- }
- }
- else
- return _close (fd);
-}
-#endif
-
-/* Override close() to call into other gnulib modules. */
-
-int
-rpl_close (int fd)
-#undef close
-{
-#if HAVE__GL_CLOSE_FD_MAYBE_SOCKET
- int retval = _gl_close_fd_maybe_socket (fd);
-#else
- int retval = close (fd);
-#endif
-
-#ifdef FCHDIR_REPLACEMENT
- if (retval >= 0)
- _gl_unregister_fd (fd);
-#endif
-
- return retval;
-}
diff --git a/gnulib/lib/connect.c b/gnulib/lib/connect.c
deleted file mode 100644
index 54aa2f5a88..0000000000
--- a/gnulib/lib/connect.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* connect.c --- wrappers for Windows connect function
-
- Copyright (C) 2008 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see . */
-
-/* Written by Paolo Bonzini */
-
-#include
-
-#define WIN32_LEAN_AND_MEAN
-/* Get winsock2.h. */
-#include
-
-/* Get set_winsock_errno, FD_TO_SOCKET etc. */
-#include "w32sock.h"
-
-#undef connect
-
-int
-rpl_connect (int fd, struct sockaddr *sockaddr, int len)
-{
- SOCKET sock = FD_TO_SOCKET (fd);
- int r = connect (sock, sockaddr, len);
- if (r < 0)
- {
- /* EINPROGRESS is not returned by WinSock 2.0; for backwards
- compatibility, connect(2) uses EWOULDBLOCK. */
- if (WSAGetLastError () == WSAEWOULDBLOCK)
- WSASetLastError (WSAEINPROGRESS);
-
- set_winsock_errno ();
- }
-
- return r;
-}
diff --git a/gnulib/lib/errno.in.h b/gnulib/lib/errno.in.h
deleted file mode 100644
index 1dd67a15e4..0000000000
--- a/gnulib/lib/errno.in.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/* A POSIX-like .
-
- Copyright (C) 2008 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser 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. */
-
-#ifndef _GL_ERRNO_H
-
-#if __GNUC__ >= 3
-@PRAGMA_SYSTEM_HEADER@
-#endif
-
-/* The include_next requires a split double-inclusion guard. */
-#@INCLUDE_NEXT@ @NEXT_ERRNO_H@
-
-#ifndef _GL_ERRNO_H
-#define _GL_ERRNO_H
-
-
-/* On native Windows platforms, many macros are not defined. */
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-
-/* POSIX says that EAGAIN and EWOULDBLOCK may have the same value. */
-# define EWOULDBLOCK EAGAIN
-
-/* Values >= 100 seem safe to use. */
-# define ETXTBSY 100
-# define GNULIB_defined_ETXTBSY 1
-
-/* These are intentionally the same values as the WSA* error numbers, defined
- in . */
-# define EINPROGRESS 10036
-# define EALREADY 10037
-# define ENOTSOCK 10038
-# define EDESTADDRREQ 10039
-# define EMSGSIZE 10040
-# define EPROTOTYPE 10041
-# define ENOPROTOOPT 10042
-# define EPROTONOSUPPORT 10043
-# define ESOCKTNOSUPPORT 10044 /* not required by POSIX */
-# define EOPNOTSUPP 10045
-# define EPFNOSUPPORT 10046 /* not required by POSIX */
-# define EAFNOSUPPORT 10047
-# define EADDRINUSE 10048
-# define EADDRNOTAVAIL 10049
-# define ENETDOWN 10050
-# define ENETUNREACH 10051
-# define ENETRESET 10052
-# define ECONNABORTED 10053
-# define ECONNRESET 10054
-# define ENOBUFS 10055
-# define EISCONN 10056
-# define ENOTCONN 10057
-# define ESHUTDOWN 10058 /* not required by POSIX */
-# define ETOOMANYREFS 10059 /* not required by POSIX */
-# define ETIMEDOUT 10060
-# define ECONNREFUSED 10061
-# define ELOOP 10062
-# define EHOSTDOWN 10064 /* not required by POSIX */
-# define EHOSTUNREACH 10065
-# define EPROCLIM 10067 /* not required by POSIX */
-# define EUSERS 10068 /* not required by POSIX */
-# define EDQUOT 10069
-# define ESTALE 10070
-# define EREMOTE 10071 /* not required by POSIX */
-# define GNULIB_defined_ESOCK 1
-
-# endif
-
-
-/* On OSF/1 5.1, when _XOPEN_SOURCE_EXTENDED is not defined, the macros
- EMULTIHOP, ENOLINK, EOVERFLOW are not defined. */
-# if @EMULTIHOP_HIDDEN@
-# define EMULTIHOP @EMULTIHOP_VALUE@
-# define GNULIB_defined_EMULTIHOP 1
-# endif
-# if @ENOLINK_HIDDEN@
-# define ENOLINK @ENOLINK_VALUE@
-# define GNULIB_defined_ENOLINK 1
-# endif
-# if @EOVERFLOW_HIDDEN@
-# define EOVERFLOW @EOVERFLOW_VALUE@
-# define GNULIB_defined_EOVERFLOW 1
-# endif
-
-
-/* On OpenBSD 4.0 and on native Windows, the macros ENOMSG, EIDRM, ENOLINK,
- EPROTO, EMULTIHOP, EBADMSG, EOVERFLOW, ENOTSUP, ECANCELED are not defined.
- Define them here. Values >= 2000 seem safe to use: Solaris ESTALE = 151,
- HP-UX EWOULDBLOCK = 246, IRIX EDQUOT = 1133.
-
- Note: When one of these systems defines some of these macros some day,
- binaries will have to be recompiled so that they recognizes the new
- errno values from the system. */
-
-# ifndef ENOMSG
-# define ENOMSG 2000
-# define GNULIB_defined_ENOMSG 1
-# endif
-
-# ifndef EIDRM
-# define EIDRM 2001
-# define GNULIB_defined_EIDRM 1
-# endif
-
-# ifndef ENOLINK
-# define ENOLINK 2002
-# define GNULIB_defined_ENOLINK 1
-# endif
-
-# ifndef EPROTO
-# define EPROTO 2003
-# define GNULIB_defined_EPROTO 1
-# endif
-
-# ifndef EMULTIHOP
-# define EMULTIHOP 2004
-# define GNULIB_defined_EMULTIHOP 1
-# endif
-
-# ifndef EBADMSG
-# define EBADMSG 2005
-# define GNULIB_defined_EBADMSG 1
-# endif
-
-# ifndef EOVERFLOW
-# define EOVERFLOW 2006
-# define GNULIB_defined_EOVERFLOW 1
-# endif
-
-# ifndef ENOTSUP
-# define ENOTSUP 2007
-# define GNULIB_defined_ENOTSUP 1
-# endif
-
-# ifndef ECANCELED
-# define ECANCELED 2008
-# define GNULIB_defined_ECANCELED 1
-# endif
-
-
-#endif /* _GL_ERRNO_H */
-#endif /* _GL_ERRNO_H */
diff --git a/gnulib/lib/fclose.c b/gnulib/lib/fclose.c
deleted file mode 100644
index cab8610170..0000000000
--- a/gnulib/lib/fclose.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* fclose replacement.
- Copyright (C) 2008 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see . */
-
-#include
-
-/* Specification. */
-#include
-
-#include
-#include
-
-/* Override fclose() to call the overridden close(). */
-
-int
-rpl_fclose (FILE *fp)
-#undef fclose
-{
- int saved_errno = 0;
-
- if (fflush (fp))
- saved_errno = errno;
-
- if (close (fileno (fp)) < 0 && saved_errno == 0)
- saved_errno = errno;
-
- fclose (fp); /* will fail with errno = EBADF */
-
- if (saved_errno != 0)
- {
- errno = saved_errno;
- return EOF;
- }
- return 0;
-}
diff --git a/gnulib/lib/float+.h b/gnulib/lib/float+.h
deleted file mode 100644
index f0c0c18966..0000000000
--- a/gnulib/lib/float+.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/* Supplemental information about the floating-point formats.
- Copyright (C) 2007 Free Software Foundation, Inc.
- Written by Bruno Haible , 2007.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser 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. */
-
-#ifndef _FLOATPLUS_H
-#define _FLOATPLUS_H
-
-#include
-#include
-
-/* Number of bits in the mantissa of a floating-point number, including the
- "hidden bit". */
-#if FLT_RADIX == 2
-# define FLT_MANT_BIT FLT_MANT_DIG
-# define DBL_MANT_BIT DBL_MANT_DIG
-# define LDBL_MANT_BIT LDBL_MANT_DIG
-#elif FLT_RADIX == 4
-# define FLT_MANT_BIT (FLT_MANT_DIG * 2)
-# define DBL_MANT_BIT (DBL_MANT_DIG * 2)
-# define LDBL_MANT_BIT (LDBL_MANT_DIG * 2)
-#elif FLT_RADIX == 16
-# define FLT_MANT_BIT (FLT_MANT_DIG * 4)
-# define DBL_MANT_BIT (DBL_MANT_DIG * 4)
-# define LDBL_MANT_BIT (LDBL_MANT_DIG * 4)
-#endif
-
-/* Bit mask that can be used to mask the exponent, as an unsigned number. */
-#define FLT_EXP_MASK ((FLT_MAX_EXP - FLT_MIN_EXP) | 7)
-#define DBL_EXP_MASK ((DBL_MAX_EXP - DBL_MIN_EXP) | 7)
-#define LDBL_EXP_MASK ((LDBL_MAX_EXP - LDBL_MIN_EXP) | 7)
-
-/* Number of bits used for the exponent of a floating-point number, including
- the exponent's sign. */
-#define FLT_EXP_BIT \
- (FLT_EXP_MASK < 0x100 ? 8 : \
- FLT_EXP_MASK < 0x200 ? 9 : \
- FLT_EXP_MASK < 0x400 ? 10 : \
- FLT_EXP_MASK < 0x800 ? 11 : \
- FLT_EXP_MASK < 0x1000 ? 12 : \
- FLT_EXP_MASK < 0x2000 ? 13 : \
- FLT_EXP_MASK < 0x4000 ? 14 : \
- FLT_EXP_MASK < 0x8000 ? 15 : \
- FLT_EXP_MASK < 0x10000 ? 16 : \
- FLT_EXP_MASK < 0x20000 ? 17 : \
- FLT_EXP_MASK < 0x40000 ? 18 : \
- FLT_EXP_MASK < 0x80000 ? 19 : \
- FLT_EXP_MASK < 0x100000 ? 20 : \
- FLT_EXP_MASK < 0x200000 ? 21 : \
- FLT_EXP_MASK < 0x400000 ? 22 : \
- FLT_EXP_MASK < 0x800000 ? 23 : \
- FLT_EXP_MASK < 0x1000000 ? 24 : \
- FLT_EXP_MASK < 0x2000000 ? 25 : \
- FLT_EXP_MASK < 0x4000000 ? 26 : \
- FLT_EXP_MASK < 0x8000000 ? 27 : \
- FLT_EXP_MASK < 0x10000000 ? 28 : \
- FLT_EXP_MASK < 0x20000000 ? 29 : \
- FLT_EXP_MASK < 0x40000000 ? 30 : \
- FLT_EXP_MASK <= 0x7fffffff ? 31 : \
- 32)
-#define DBL_EXP_BIT \
- (DBL_EXP_MASK < 0x100 ? 8 : \
- DBL_EXP_MASK < 0x200 ? 9 : \
- DBL_EXP_MASK < 0x400 ? 10 : \
- DBL_EXP_MASK < 0x800 ? 11 : \
- DBL_EXP_MASK < 0x1000 ? 12 : \
- DBL_EXP_MASK < 0x2000 ? 13 : \
- DBL_EXP_MASK < 0x4000 ? 14 : \
- DBL_EXP_MASK < 0x8000 ? 15 : \
- DBL_EXP_MASK < 0x10000 ? 16 : \
- DBL_EXP_MASK < 0x20000 ? 17 : \
- DBL_EXP_MASK < 0x40000 ? 18 : \
- DBL_EXP_MASK < 0x80000 ? 19 : \
- DBL_EXP_MASK < 0x100000 ? 20 : \
- DBL_EXP_MASK < 0x200000 ? 21 : \
- DBL_EXP_MASK < 0x400000 ? 22 : \
- DBL_EXP_MASK < 0x800000 ? 23 : \
- DBL_EXP_MASK < 0x1000000 ? 24 : \
- DBL_EXP_MASK < 0x2000000 ? 25 : \
- DBL_EXP_MASK < 0x4000000 ? 26 : \
- DBL_EXP_MASK < 0x8000000 ? 27 : \
- DBL_EXP_MASK < 0x10000000 ? 28 : \
- DBL_EXP_MASK < 0x20000000 ? 29 : \
- DBL_EXP_MASK < 0x40000000 ? 30 : \
- DBL_EXP_MASK <= 0x7fffffff ? 31 : \
- 32)
-#define LDBL_EXP_BIT \
- (LDBL_EXP_MASK < 0x100 ? 8 : \
- LDBL_EXP_MASK < 0x200 ? 9 : \
- LDBL_EXP_MASK < 0x400 ? 10 : \
- LDBL_EXP_MASK < 0x800 ? 11 : \
- LDBL_EXP_MASK < 0x1000 ? 12 : \
- LDBL_EXP_MASK < 0x2000 ? 13 : \
- LDBL_EXP_MASK < 0x4000 ? 14 : \
- LDBL_EXP_MASK < 0x8000 ? 15 : \
- LDBL_EXP_MASK < 0x10000 ? 16 : \
- LDBL_EXP_MASK < 0x20000 ? 17 : \
- LDBL_EXP_MASK < 0x40000 ? 18 : \
- LDBL_EXP_MASK < 0x80000 ? 19 : \
- LDBL_EXP_MASK < 0x100000 ? 20 : \
- LDBL_EXP_MASK < 0x200000 ? 21 : \
- LDBL_EXP_MASK < 0x400000 ? 22 : \
- LDBL_EXP_MASK < 0x800000 ? 23 : \
- LDBL_EXP_MASK < 0x1000000 ? 24 : \
- LDBL_EXP_MASK < 0x2000000 ? 25 : \
- LDBL_EXP_MASK < 0x4000000 ? 26 : \
- LDBL_EXP_MASK < 0x8000000 ? 27 : \
- LDBL_EXP_MASK < 0x10000000 ? 28 : \
- LDBL_EXP_MASK < 0x20000000 ? 29 : \
- LDBL_EXP_MASK < 0x40000000 ? 30 : \
- LDBL_EXP_MASK <= 0x7fffffff ? 31 : \
- 32)
-
-/* Number of bits used for a floating-point number: the mantissa (not
- counting the "hidden bit", since it may or may not be explicit), the
- exponent, and the sign. */
-#define FLT_TOTAL_BIT ((FLT_MANT_BIT - 1) + FLT_EXP_BIT + 1)
-#define DBL_TOTAL_BIT ((DBL_MANT_BIT - 1) + DBL_EXP_BIT + 1)
-#define LDBL_TOTAL_BIT ((LDBL_MANT_BIT - 1) + LDBL_EXP_BIT + 1)
-
-/* Number of bytes used for a floating-point number.
- This can be smaller than the 'sizeof'. For example, on i386 systems,
- 'long double' most often have LDBL_MANT_BIT = 64, LDBL_EXP_BIT = 16, hence
- LDBL_TOTAL_BIT = 80 bits, i.e. 10 bytes of consecutive memory, but
- sizeof (long double) = 12 or = 16. */
-#define SIZEOF_FLT ((FLT_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
-#define SIZEOF_DBL ((DBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
-#define SIZEOF_LDBL ((LDBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
-
-/* Verify that SIZEOF_FLT <= sizeof (float) etc. */
-typedef int verify_sizeof_flt[2 * (SIZEOF_FLT <= sizeof (float)) - 1];
-typedef int verify_sizeof_dbl[2 * (SIZEOF_DBL <= sizeof (double)) - 1];
-typedef int verify_sizeof_ldbl[2 * (SIZEOF_LDBL <= sizeof (long double)) - 1];
-
-#endif /* _FLOATPLUS_H */
diff --git a/gnulib/lib/float.in.h b/gnulib/lib/float.in.h
deleted file mode 100644
index 1600d05afc..0000000000
--- a/gnulib/lib/float.in.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* A correct .
-
- Copyright (C) 2007-2008 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see . */
-
-#ifndef _GL_FLOAT_H
-
-#if __GNUC__ >= 3
-@PRAGMA_SYSTEM_HEADER@
-#endif
-
-/* The include_next requires a split double-inclusion guard. */
-#@INCLUDE_NEXT@ @NEXT_FLOAT_H@
-
-#ifndef _GL_FLOAT_H
-#define _GL_FLOAT_H
-
-/* 'long double' properties. */
-#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
-/* Number of mantissa units, in base FLT_RADIX. */
-# undef LDBL_MANT_DIG
-# define LDBL_MANT_DIG 64
-/* Number of decimal digits that is sufficient for representing a number. */
-# undef LDBL_DIG
-# define LDBL_DIG 18
-/* x-1 where x is the smallest representable number > 1. */
-# undef LDBL_EPSILON
-# define LDBL_EPSILON 1.0842021724855044340E-19L
-/* Minimum e such that FLT_RADIX^(e-1) is a normalized number. */
-# undef LDBL_MIN_EXP
-# define LDBL_MIN_EXP (-16381)
-/* Maximum e such that FLT_RADIX^(e-1) is a representable finite number. */
-# undef LDBL_MAX_EXP
-# define LDBL_MAX_EXP 16384
-/* Minimum positive normalized number. */
-# undef LDBL_MIN
-# define LDBL_MIN 3.3621031431120935063E-4932L
-/* Maximum representable finite number. */
-# undef LDBL_MAX
-# define LDBL_MAX 1.1897314953572317650E+4932L
-/* Minimum e such that 10^e is in the range of normalized numbers. */
-# undef LDBL_MIN_10_EXP
-# define LDBL_MIN_10_EXP (-4931)
-/* Maximum e such that 10^e is in the range of representable finite numbers. */
-# undef LDBL_MAX_10_EXP
-# define LDBL_MAX_10_EXP 4932
-#endif
-
-#endif /* _GL_FLOAT_H */
-#endif /* _GL_FLOAT_H */
diff --git a/gnulib/lib/fseeko.c b/gnulib/lib/fseeko.c
deleted file mode 100644
index 7ba8e58431..0000000000
--- a/gnulib/lib/fseeko.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/* An fseeko() function that, together with fflush(), is POSIX compliant.
- Copyright (C) 2007-2009 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser 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. */
-
-#include
-
-/* Specification. */
-#include
-
-/* Get off_t and lseek. */
-#include
-
-#include "stdio-impl.h"
-
-#undef fseeko
-#if !HAVE_FSEEKO
-# undef fseek
-# define fseeko fseek
-#endif
-
-int
-rpl_fseeko (FILE *fp, off_t offset, int whence)
-{
-#if LSEEK_PIPE_BROKEN
- /* mingw gives bogus answers rather than failure on non-seekable files. */
- if (lseek (fileno (fp), 0, SEEK_CUR) == -1)
- return EOF;
-#endif
-
- /* These tests are based on fpurge.c. */
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- if (fp->_IO_read_end == fp->_IO_read_ptr
- && fp->_IO_write_ptr == fp->_IO_write_base
- && fp->_IO_save_base == NULL)
-#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
-# if defined __SL64 && defined __SCLE /* Cygwin */
- if ((fp->_flags & __SL64) == 0)
- {
- /* Cygwin 1.5.0 through 1.5.24 failed to open stdin in 64-bit
- mode; but has an fseeko that requires 64-bit mode. */
- FILE *tmp = fopen ("/dev/null", "r");
- if (!tmp)
- return -1;
- fp->_flags |= __SL64;
- fp->_seek64 = tmp->_seek64;
- fclose (tmp);
- }
-# endif
- if (fp_->_p == fp_->_bf._base
- && fp_->_r == 0
- && fp_->_w == ((fp_->_flags & (__SLBF | __SNBF | __SRD)) == 0 /* fully buffered and not currently reading? */
- ? fp_->_bf._size
- : 0)
- && fp_ub._base == NULL)
-#elif defined __EMX__ /* emx+gcc */
- if (fp->_ptr == fp->_buffer
- && fp->_rcount == 0
- && fp->_wcount == 0
- && fp->_ungetc_count == 0)
-#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
- if (fp_->_ptr == fp_->_base
- && (fp_->_ptr == NULL || fp_->_cnt == 0))
-#elif defined __UCLIBC__ /* uClibc */
- if (((fp->__modeflags & __FLAG_WRITING) == 0
- || fp->__bufpos == fp->__bufstart)
- && ((fp->__modeflags & (__FLAG_READONLY | __FLAG_READING)) == 0
- || fp->__bufpos == fp->__bufread))
-#elif defined __QNX__ /* QNX */
- if ((fp->_Mode & _MWRITE ? fp->_Next == fp->_Buf : fp->_Next == fp->_Rend)
- && fp->_Rback == fp->_Back + sizeof (fp->_Back)
- && fp->_Rsave == NULL)
-#else
- #error "Please port gnulib fseeko.c to your platform! Look at the code in fpurge.c, then report this to bug-gnulib."
-#endif
- {
- /* We get here when an fflush() call immediately preceded this one. We
- know there are no buffers.
- POSIX requires us to modify the file descriptor's position.
- But we cannot position beyond end of file here. */
- off_t pos =
- lseek (fileno (fp),
- whence == SEEK_END && offset > 0 ? 0 : offset,
- whence);
- if (pos == -1)
- {
-#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
- fp_->_flags &= ~__SOFF;
-#endif
- return -1;
- }
-
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
- fp->_flags &= ~_IO_EOF_SEEN;
-#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */
- fp_->_offset = pos;
- fp_->_flags |= __SOFF;
- fp_->_flags &= ~__SEOF;
-#elif defined __EMX__ /* emx+gcc */
- fp->_flags &= ~_IOEOF;
-#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
- fp->_flag &= ~_IOEOF;
-#endif
- /* If we were not requested to position beyond end of file, we're
- done. */
- if (!(whence == SEEK_END && offset > 0))
- return 0;
- }
- return fseeko (fp, offset, whence);
-}
diff --git a/gnulib/lib/gai_strerror.c b/gnulib/lib/gai_strerror.c
deleted file mode 100644
index 51d39d756c..0000000000
--- a/gnulib/lib/gai_strerror.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006, 2008 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Philip Blundell , 1997.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser 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. */
-
-#ifndef _LIBC
-# include
-#endif
-
-#include
-#include
-
-#ifdef _LIBC
-# include
-#else
-# include "gettext.h"
-# define _(String) gettext (String)
-# define N_(String) String
-#endif
-
-static struct
- {
- int code;
- const char *msg;
- }
-values[] =
- {
- { EAI_ADDRFAMILY, N_("Address family for hostname not supported") },
- { EAI_AGAIN, N_("Temporary failure in name resolution") },
- { EAI_BADFLAGS, N_("Bad value for ai_flags") },
- { EAI_FAIL, N_("Non-recoverable failure in name resolution") },
- { EAI_FAMILY, N_("ai_family not supported") },
- { EAI_MEMORY, N_("Memory allocation failure") },
- { EAI_NODATA, N_("No address associated with hostname") },
- { EAI_NONAME, N_("Name or service not known") },
- { EAI_SERVICE, N_("Servname not supported for ai_socktype") },
- { EAI_SOCKTYPE, N_("ai_socktype not supported") },
- { EAI_SYSTEM, N_("System error") },
- { EAI_OVERFLOW, N_("Argument buffer too small") },
-#ifdef __USE_GNU
- { EAI_INPROGRESS, N_("Processing request in progress") },
- { EAI_CANCELED, N_("Request canceled") },
- { EAI_NOTCANCELED, N_("Request not canceled") },
- { EAI_ALLDONE, N_("All requests done") },
- { EAI_INTR, N_("Interrupted by a signal") },
- { EAI_IDN_ENCODE, N_("Parameter string not correctly encoded") }
-#endif
- };
-
-const char *
-gai_strerror (int code)
-{
- size_t i;
- for (i = 0; i < sizeof (values) / sizeof (values[0]); ++i)
- if (values[i].code == code)
- return _(values[i].msg);
-
- return _("Unknown error");
-}
-#ifdef _LIBC
-libc_hidden_def (gai_strerror)
-#endif
diff --git a/gnulib/lib/getaddrinfo.c b/gnulib/lib/getaddrinfo.c
deleted file mode 100644
index 84b6af6f83..0000000000
--- a/gnulib/lib/getaddrinfo.c
+++ /dev/null
@@ -1,435 +0,0 @@
-/* Get address information (partial implementation).
- Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006, 2007, 2008 Free Software
- Foundation, Inc.
- Contributed by Simon Josefsson .
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser 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. */
-
-#include
-
-#include
-
-#if HAVE_NETINET_IN_H
-# include
-#endif
-
-/* Get inet_ntop. */
-#include
-
-/* Get calloc. */
-#include
-
-/* Get memcpy, strdup. */
-#include
-
-/* Get snprintf. */
-#include
-
-#include
-
-#include "gettext.h"
-#define _(String) gettext (String)
-#define N_(String) String
-
-/* BeOS has AF_INET, but not PF_INET. */
-#ifndef PF_INET
-# define PF_INET AF_INET
-#endif
-/* BeOS also lacks PF_UNSPEC. */
-#ifndef PF_UNSPEC
-# define PF_UNSPEC 0
-#endif
-
-#if defined _WIN32 || defined __WIN32__
-# define WIN32_NATIVE
-#endif
-
-#ifdef WIN32_NATIVE
-typedef int (WSAAPI *getaddrinfo_func) (const char*, const char*,
- const struct addrinfo*,
- struct addrinfo**);
-typedef void (WSAAPI *freeaddrinfo_func) (struct addrinfo*);
-typedef int (WSAAPI *getnameinfo_func) (const struct sockaddr*,
- socklen_t, char*, DWORD,
- char*, DWORD, int);
-
-static getaddrinfo_func getaddrinfo_ptr = NULL;
-static freeaddrinfo_func freeaddrinfo_ptr = NULL;
-static getnameinfo_func getnameinfo_ptr = NULL;
-
-static int
-use_win32_p (void)
-{
- static int done = 0;
- HMODULE h;
-
- if (done)
- return getaddrinfo_ptr ? 1 : 0;
-
- done = 1;
-
- h = GetModuleHandle ("ws2_32.dll");
-
- if (h)
- {
- getaddrinfo_ptr = (getaddrinfo_func) GetProcAddress (h, "getaddrinfo");
- freeaddrinfo_ptr = (freeaddrinfo_func) GetProcAddress (h, "freeaddrinfo");
- getnameinfo_ptr = (getnameinfo_func) GetProcAddress (h, "getnameinfo");
- }
-
- /* If either is missing, something is odd. */
- if (!getaddrinfo_ptr || !freeaddrinfo_ptr || !getnameinfo_ptr)
- {
- getaddrinfo_ptr = NULL;
- freeaddrinfo_ptr = NULL;
- getnameinfo_ptr = NULL;
- return 0;
- }
-
- return 1;
-}
-#endif
-
-static inline bool
-validate_family (int family)
-{
- /* FIXME: Support more families. */
-#if HAVE_IPV4
- if (family == PF_INET)
- return true;
-#endif
-#if HAVE_IPV6
- if (family == PF_INET6)
- return true;
-#endif
- if (family == PF_UNSPEC)
- return true;
- return false;
-}
-
-/* Translate name of a service location and/or a service name to set of
- socket addresses. */
-int
-getaddrinfo (const char *restrict nodename,
- const char *restrict servname,
- const struct addrinfo *restrict hints,
- struct addrinfo **restrict res)
-{
- struct addrinfo *tmp;
- int port = 0;
- struct hostent *he;
- void *storage;
- size_t size;
-#if HAVE_IPV6
- struct v6_pair {
- struct addrinfo addrinfo;
- struct sockaddr_in6 sockaddr_in6;
- };
-#endif
-#if HAVE_IPV4
- struct v4_pair {
- struct addrinfo addrinfo;
- struct sockaddr_in sockaddr_in;
- };
-#endif
-
-#ifdef WIN32_NATIVE
- if (use_win32_p ())
- return getaddrinfo_ptr (nodename, servname, hints, res);
-#endif
-
- if (hints && (hints->ai_flags & ~(AI_CANONNAME|AI_PASSIVE)))
- /* FIXME: Support more flags. */
- return EAI_BADFLAGS;
-
- if (hints && !validate_family (hints->ai_family))
- return EAI_FAMILY;
-
- if (hints &&
- hints->ai_socktype != SOCK_STREAM && hints->ai_socktype != SOCK_DGRAM)
- /* FIXME: Support other socktype. */
- return EAI_SOCKTYPE; /* FIXME: Better return code? */
-
- if (!nodename)
- {
- if (!(hints->ai_flags & AI_PASSIVE))
- return EAI_NONAME;
-
-#ifdef HAVE_IPV6
- nodename = (hints->ai_family == AF_INET6) ? "::" : "0.0.0.0";
-#else
- nodename = "0.0.0.0";
-#endif
- }
-
- if (servname)
- {
- struct servent *se = NULL;
- const char *proto =
- (hints && hints->ai_socktype == SOCK_DGRAM) ? "udp" : "tcp";
-
- if (hints == NULL || !(hints->ai_flags & AI_NUMERICSERV))
- /* FIXME: Use getservbyname_r if available. */
- se = getservbyname (servname, proto);
-
- if (!se)
- {
- char *c;
- if (!(*servname >= '0' && *servname <= '9'))
- return EAI_NONAME;
- port = strtoul (servname, &c, 10);
- if (*c || port > 0xffff)
- return EAI_NONAME;
- port = htons (port);
- }
- else
- port = se->s_port;
- }
-
- /* FIXME: Use gethostbyname_r if available. */
- he = gethostbyname (nodename);
- if (!he || he->h_addr_list[0] == NULL)
- return EAI_NONAME;
-
- switch (he->h_addrtype)
- {
-#if HAVE_IPV6
- case PF_INET6:
- size = sizeof (struct v6_pair);
- break;
-#endif
-
-#if HAVE_IPV4
- case PF_INET:
- size = sizeof (struct v4_pair);
- break;
-#endif
-
- default:
- return EAI_NODATA;
- }
-
- storage = calloc (1, size);
- if (!storage)
- return EAI_MEMORY;
-
- switch (he->h_addrtype)
- {
-#if HAVE_IPV6
- case PF_INET6:
- {
- struct v6_pair *p = storage;
- struct sockaddr_in6 *sinp = &p->sockaddr_in6;
- tmp = &p->addrinfo;
-
- if (port)
- sinp->sin6_port = port;
-
- if (he->h_length != sizeof (sinp->sin6_addr))
- {
- free (storage);
- return EAI_SYSTEM; /* FIXME: Better return code? Set errno? */
- }
-
- memcpy (&sinp->sin6_addr, he->h_addr_list[0], sizeof sinp->sin6_addr);
-
- tmp->ai_addr = (struct sockaddr *) sinp;
- tmp->ai_addrlen = sizeof *sinp;
- }
- break;
-#endif
-
-#if HAVE_IPV4
- case PF_INET:
- {
- struct v4_pair *p = storage;
- struct sockaddr_in *sinp = &p->sockaddr_in;
- tmp = &p->addrinfo;
-
- if (port)
- sinp->sin_port = port;
-
- if (he->h_length != sizeof (sinp->sin_addr))
- {
- free (storage);
- return EAI_SYSTEM; /* FIXME: Better return code? Set errno? */
- }
-
- memcpy (&sinp->sin_addr, he->h_addr_list[0], sizeof sinp->sin_addr);
-
- tmp->ai_addr = (struct sockaddr *) sinp;
- tmp->ai_addrlen = sizeof *sinp;
- }
- break;
-#endif
-
- default:
- free (storage);
- return EAI_NODATA;
- }
-
- if (hints && hints->ai_flags & AI_CANONNAME)
- {
- const char *cn;
- if (he->h_name)
- cn = he->h_name;
- else
- cn = nodename;
-
- tmp->ai_canonname = strdup (cn);
- if (!tmp->ai_canonname)
- {
- free (storage);
- return EAI_MEMORY;
- }
- }
-
- tmp->ai_protocol = (hints) ? hints->ai_protocol : 0;
- tmp->ai_socktype = (hints) ? hints->ai_socktype : 0;
- tmp->ai_addr->sa_family = he->h_addrtype;
- tmp->ai_family = he->h_addrtype;
-
-#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
- switch (he->h_addrtype)
- {
-#if HAVE_IPV4
- case AF_INET:
- tmp->ai_addr->sa_len = sizeof (struct sockaddr_in);
- break;
-#endif
-#if HAVE_IPV6
- case AF_INET6:
- tmp->ai_addr->sa_len = sizeof (struct sockaddr_in6);
- break;
-#endif
- }
-#endif
-
- /* FIXME: If more than one address, create linked list of addrinfo's. */
-
- *res = tmp;
-
- return 0;
-}
-
-/* Free `addrinfo' structure AI including associated storage. */
-void
-freeaddrinfo (struct addrinfo *ai)
-{
-#ifdef WIN32_NATIVE
- if (use_win32_p ())
- {
- freeaddrinfo_ptr (ai);
- return;
- }
-#endif
-
- while (ai)
- {
- struct addrinfo *cur;
-
- cur = ai;
- ai = ai->ai_next;
-
- free (cur->ai_canonname);
- free (cur);
- }
-}
-
-int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen,
- char *restrict node, socklen_t nodelen,
- char *restrict service, socklen_t servicelen,
- int flags)
-{
-#ifdef WIN32_NATIVE
- if (use_win32_p ())
- return getnameinfo_ptr (sa, salen, node, nodelen,
- service, servicelen, flags);
-#endif
-
- /* FIXME: Support other flags. */
- if ((node && nodelen > 0 && !(flags & NI_NUMERICHOST)) ||
- (service && servicelen > 0 && !(flags & NI_NUMERICHOST)) ||
- (flags & ~(NI_NUMERICHOST|NI_NUMERICSERV)))
- return EAI_BADFLAGS;
-
- if (sa == NULL || salen < sizeof (sa->sa_family))
- return EAI_FAMILY;
-
- switch (sa->sa_family)
- {
-#if HAVE_IPV4
- case AF_INET:
- if (salen < sizeof (struct sockaddr_in))
- return EAI_FAMILY;
- break;
-#endif
-#if HAVE_IPV6
- case AF_INET6:
- if (salen < sizeof (struct sockaddr_in6))
- return EAI_FAMILY;
- break;
-#endif
- default:
- return EAI_FAMILY;
- }
-
- if (node && nodelen > 0 && flags & NI_NUMERICHOST)
- {
- switch (sa->sa_family)
- {
-#if HAVE_IPV4
- case AF_INET:
- if (!inet_ntop (AF_INET,
- &(((const struct sockaddr_in *) sa)->sin_addr),
- node, nodelen))
- return EAI_SYSTEM;
- break;
-#endif
-
-#if HAVE_IPV6
- case AF_INET6:
- if (!inet_ntop (AF_INET6,
- &(((const struct sockaddr_in6 *) sa)->sin6_addr),
- node, nodelen))
- return EAI_SYSTEM;
- break;
-#endif
-
- default:
- return EAI_FAMILY;
- }
- }
-
- if (service && servicelen > 0 && flags & NI_NUMERICSERV)
- switch (sa->sa_family)
- {
-#if HAVE_IPV4
- case AF_INET:
-#endif
-#if HAVE_IPV6
- case AF_INET6:
-#endif
- {
- unsigned short int port
- = ntohs (((const struct sockaddr_in *) sa)->sin_port);
- if (servicelen <= snprintf (service, servicelen, "%u", port))
- return EAI_OVERFLOW;
- }
- break;
- }
-
- return 0;
-}
diff --git a/gnulib/lib/getdelim.c b/gnulib/lib/getdelim.c
deleted file mode 100644
index c905b69b07..0000000000
--- a/gnulib/lib/getdelim.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/* getdelim.c --- Implementation of replacement getdelim function.
- Copyright (C) 1994, 1996, 1997, 1998, 2001, 2003, 2005, 2006, 2007, 2008 Free
- Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1, 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 Lesser 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. */
-
-/* Ported from glibc by Simon Josefsson. */
-
-#include
-
-#include
-
-#include
-#include
-#include
-
-#ifndef SIZE_MAX
-# define SIZE_MAX ((size_t) -1)
-#endif
-#ifndef SSIZE_MAX
-# define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2))
-#endif
-
-#if USE_UNLOCKED_IO
-# include "unlocked-io.h"
-# define getc_maybe_unlocked(fp) getc(fp)
-#elif !HAVE_FLOCKFILE || !HAVE_FUNLOCKFILE || !HAVE_DECL_GETC_UNLOCKED
-# undef flockfile
-# undef funlockfile
-# define flockfile(x) ((void) 0)
-# define funlockfile(x) ((void) 0)
-# define getc_maybe_unlocked(fp) getc(fp)
-#else
-# define getc_maybe_unlocked(fp) getc_unlocked(fp)
-#endif
-
-/* Read up to (and including) a DELIMITER from FP into *LINEPTR (and
- NUL-terminate it). *LINEPTR is a pointer returned from malloc (or
- NULL), pointing to *N characters of space. It is realloc'ed as
- necessary. Returns the number of characters read (not including
- the null terminator), or -1 on error or EOF. */
-
-ssize_t
-getdelim (char **lineptr, size_t *n, int delimiter, FILE *fp)
-{
- ssize_t result;
- size_t cur_len = 0;
-
- if (lineptr == NULL || n == NULL || fp == NULL)
- {
- errno = EINVAL;
- return -1;
- }
-
- flockfile (fp);
-
- if (*lineptr == NULL || *n == 0)
- {
- char *new_lineptr;
- *n = 120;
- new_lineptr = (char *) realloc (*lineptr, *n);
- if (new_lineptr == NULL)
- {
- result = -1;
- goto unlock_return;
- }
- *lineptr = new_lineptr;
- }
-
- for (;;)
- {
- int i;
-
- i = getc_maybe_unlocked (fp);
- if (i == EOF)
- {
- result = -1;
- break;
- }
-
- /* Make enough space for len+1 (for final NUL) bytes. */
- if (cur_len + 1 >= *n)
- {
- size_t needed_max =
- SSIZE_MAX < SIZE_MAX ? (size_t) SSIZE_MAX + 1 : SIZE_MAX;
- size_t needed = 2 * *n + 1; /* Be generous. */
- char *new_lineptr;
-
- if (needed_max < needed)
- needed = needed_max;
- if (cur_len + 1 >= needed)
- {
- result = -1;
- errno = EOVERFLOW;
- goto unlock_return;
- }
-
- new_lineptr = (char *) realloc (*lineptr, needed);
- if (new_lineptr == NULL)
- {
- result = -1;
- goto unlock_return;
- }
-
- *lineptr = new_lineptr;
- *n = needed;
- }
-
- (*lineptr)[cur_len] = i;
- cur_len++;
-
- if (i == delimiter)
- break;
- }
- (*lineptr)[cur_len] = '\0';
- result = cur_len ? cur_len : result;
-
- unlock_return:
- funlockfile (fp); /* doesn't set errno */
-
- return result;
-}
diff --git a/gnulib/lib/gethostname.c b/gnulib/lib/gethostname.c
deleted file mode 100644
index 87175a22d3..0000000000
--- a/gnulib/lib/gethostname.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/* gethostname emulation for SysV and POSIX.1.
-
- Copyright (C) 1992, 2003, 2006, 2008 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see . */
-
-/* David MacKenzie */
-
-#include
-
-/* Specification. */
-#include
-
-#ifdef HAVE_UNAME
-# include
-#endif
-
-#include
-
-/* Put up to LEN chars of the host name into NAME.
- Null terminate it if the name is shorter than LEN.
- Return 0 if ok, -1 if error. */
-
-#include
-
-int
-gethostname (char *name, size_t len)
-{
-#ifdef HAVE_UNAME
- struct utsname uts;
-
- if (uname (&uts) == -1)
- return -1;
- if (len > sizeof (uts.nodename))
- {
- /* More space than we need is available. */
- name[sizeof (uts.nodename)] = '\0';
- len = sizeof (uts.nodename);
- }
- strncpy (name, uts.nodename, len);
-#else
- strcpy (name, ""); /* Hardcode your system name if you want. */
-#endif
- return 0;
-}
diff --git a/gnulib/lib/getline.c b/gnulib/lib/getline.c
deleted file mode 100644
index 2be81c05ec..0000000000
--- a/gnulib/lib/getline.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* getline.c --- Implementation of replacement getline function.
- Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1, 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 Lesser 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 Simon Josefsson. */
-
-#include
-
-#include
-
-ssize_t
-getline (char **lineptr, size_t *n, FILE *stream)
-{
- return getdelim (lineptr, n, '\n', stream);
-}
diff --git a/gnulib/lib/getpass.c b/gnulib/lib/getpass.c
deleted file mode 100644
index 814e523850..0000000000
--- a/gnulib/lib/getpass.c
+++ /dev/null
@@ -1,231 +0,0 @@
-/* Copyright (C) 1992-2001, 2003, 2004, 2005, 2006, 2007 Free Software
- Foundation, Inc.
-
- This file is part of the GNU C Library.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser 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. */
-
-#ifndef _LIBC
-# include
-#endif
-
-#include "getpass.h"
-
-#include
-
-#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
-
-#include
-
-#if HAVE_DECL___FSETLOCKING && HAVE___FSETLOCKING
-# if HAVE_STDIO_EXT_H
-# include
-# endif
-#else
-# define __fsetlocking(stream, type) /* empty */
-#endif
-
-#if HAVE_TERMIOS_H
-# include
-#endif
-
-#if USE_UNLOCKED_IO
-# include "unlocked-io.h"
-#else
-# if !HAVE_DECL_FFLUSH_UNLOCKED
-# undef fflush_unlocked
-# define fflush_unlocked(x) fflush (x)
-# endif
-# if !HAVE_DECL_FLOCKFILE
-# undef flockfile
-# define flockfile(x) ((void) 0)
-# endif
-# if !HAVE_DECL_FUNLOCKFILE
-# undef funlockfile
-# define funlockfile(x) ((void) 0)
-# endif
-# if !HAVE_DECL_FPUTS_UNLOCKED
-# undef fputs_unlocked
-# define fputs_unlocked(str,stream) fputs (str, stream)
-# endif
-# if !HAVE_DECL_PUTC_UNLOCKED
-# undef putc_unlocked
-# define putc_unlocked(c,stream) putc (c, stream)
-# endif
-#endif
-
-/* It is desirable to use this bit on systems that have it.
- The only bit of terminal state we want to twiddle is echoing, which is
- done in software; there is no need to change the state of the terminal
- hardware. */
-
-#ifndef TCSASOFT
-# define TCSASOFT 0
-#endif
-
-static void
-call_fclose (void *arg)
-{
- if (arg != NULL)
- fclose (arg);
-}
-
-char *
-getpass (const char *prompt)
-{
- FILE *tty;
- FILE *in, *out;
- struct termios s, t;
- bool tty_changed = false;
- static char *buf;
- static size_t bufsize;
- ssize_t nread;
-
- /* Try to write to and read from the terminal if we can.
- If we can't open the terminal, use stderr and stdin. */
-
- tty = fopen ("/dev/tty", "w+");
- if (tty == NULL)
- {
- in = stdin;
- out = stderr;
- }
- else
- {
- /* We do the locking ourselves. */
- __fsetlocking (tty, FSETLOCKING_BYCALLER);
-
- out = in = tty;
- }
-
- flockfile (out);
-
- /* Turn echoing off if it is on now. */
-#if HAVE_TCGETATTR
- if (tcgetattr (fileno (in), &t) == 0)
- {
- /* Save the old one. */
- s = t;
- /* Tricky, tricky. */
- t.c_lflag &= ~(ECHO | ISIG);
- tty_changed = (tcsetattr (fileno (in), TCSAFLUSH | TCSASOFT, &t) == 0);
- }
-#endif
-
- /* Write the prompt. */
- fputs_unlocked (prompt, out);
- fflush_unlocked (out);
-
- /* Read the password. */
- nread = getline (&buf, &bufsize, in);
-
- /* According to the C standard, input may not be followed by output
- on the same stream without an intervening call to a file
- positioning function. Suppose in == out; then without this fseek
- call, on Solaris, HP-UX, AIX, OSF/1, the previous input gets
- echoed, whereas on IRIX, the following newline is not output as
- it should be. POSIX imposes similar restrictions if fileno (in)
- == fileno (out). The POSIX restrictions are tricky and change
- from POSIX version to POSIX version, so play it safe and invoke
- fseek even if in != out. */
- fseeko (out, 0, SEEK_CUR);
-
- if (buf != NULL)
- {
- if (nread < 0)
- buf[0] = '\0';
- else if (buf[nread - 1] == '\n')
- {
- /* Remove the newline. */
- buf[nread - 1] = '\0';
- if (tty_changed)
- {
- /* Write the newline that was not echoed. */
- putc_unlocked ('\n', out);
- }
- }
- }
-
- /* Restore the original setting. */
-#if HAVE_TCSETATTR
- if (tty_changed)
- tcsetattr (fileno (in), TCSAFLUSH | TCSASOFT, &s);
-#endif
-
- funlockfile (out);
-
- call_fclose (tty);
-
- return buf;
-}
-
-#else /* W32 native */
-
-/* Windows implementation by Martin Lambers ,
- improved by Simon Josefsson. */
-
-/* For PASS_MAX. */
-#include
-/* For _getch(). */
-#include
-/* For strdup(). */
-#include
-
-#ifndef PASS_MAX
-# define PASS_MAX 512
-#endif
-
-char *
-getpass (const char *prompt)
-{
- char getpassbuf[PASS_MAX + 1];
- size_t i = 0;
- int c;
-
- if (prompt)
- {
- fputs (prompt, stderr);
- fflush (stderr);
- }
-
- for (;;)
- {
- c = _getch ();
- if (c == '\r')
- {
- getpassbuf[i] = '\0';
- break;
- }
- else if (i < PASS_MAX)
- {
- getpassbuf[i++] = c;
- }
-
- if (i >= PASS_MAX)
- {
- getpassbuf[i] = '\0';
- break;
- }
- }
-
- if (prompt)
- {
- fputs ("\r\n", stderr);
- fflush (stderr);
- }
-
- return strdup (getpassbuf);
-}
-#endif
diff --git a/gnulib/lib/getpass.h b/gnulib/lib/getpass.h
deleted file mode 100644
index a8c392b30d..0000000000
--- a/gnulib/lib/getpass.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* getpass.h -- Read a password of arbitrary length from /dev/tty or stdin.
- Copyright (C) 2004 Free Software Foundation, Inc.
- Contributed by Simon Josefsson , 2004.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser 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. */
-
-#ifndef GETPASS_H
-# define GETPASS_H
-
-/* Get getpass declaration, if available. */
-# include
-
-# if defined HAVE_DECL_GETPASS && !HAVE_DECL_GETPASS
-/* Read a password of arbitrary length from /dev/tty or stdin. */
-char *getpass (const char *prompt);
-
-# endif
-
-#endif /* GETPASS_H */
diff --git a/gnulib/lib/gettext.h b/gnulib/lib/gettext.h
deleted file mode 100644
index bd214d5cec..0000000000
--- a/gnulib/lib/gettext.h
+++ /dev/null
@@ -1,270 +0,0 @@
-/* Convenience header for conditional use of GNU .
- Copyright (C) 1995-1998, 2000-2002, 2004-2006 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser 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. */
-
-#ifndef _LIBGETTEXT_H
-#define _LIBGETTEXT_H 1
-
-/* NLS can be disabled through the configure --disable-nls option. */
-#if ENABLE_NLS
-
-/* Get declarations of GNU message catalog functions. */
-# include
-
-/* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by
- the gettext() and ngettext() macros. This is an alternative to calling
- textdomain(), and is useful for libraries. */
-# ifdef DEFAULT_TEXT_DOMAIN
-# undef gettext
-# define gettext(Msgid) \
- dgettext (DEFAULT_TEXT_DOMAIN, Msgid)
-# undef ngettext
-# define ngettext(Msgid1, Msgid2, N) \
- dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N)
-# endif
-
-#else
-
-/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
- chokes if dcgettext is defined as a macro. So include it now, to make
- later inclusions of a NOP. We don't include
- as well because people using "gettext.h" will not include ,
- and also including would fail on SunOS 4, whereas
- is OK. */
-#if defined(__sun)
-# include
-#endif
-
-/* Many header files from the libstdc++ coming with g++ 3.3 or newer include
- , which chokes if dcgettext is defined as a macro. So include
- it now, to make later inclusions of a NOP. */
-#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3)
-# include
-# if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H
-# include
-# endif
-#endif
-
-/* Disabled NLS.
- The casts to 'const char *' serve the purpose of producing warnings
- for invalid uses of the value returned from these functions.
- On pre-ANSI systems without 'const', the config.h file is supposed to
- contain "#define const". */
-# define gettext(Msgid) ((const char *) (Msgid))
-# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid))
-# define dcgettext(Domainname, Msgid, Category) \
- ((void) (Category), dgettext (Domainname, Msgid))
-# define ngettext(Msgid1, Msgid2, N) \
- ((N) == 1 \
- ? ((void) (Msgid2), (const char *) (Msgid1)) \
- : ((void) (Msgid1), (const char *) (Msgid2)))
-# define dngettext(Domainname, Msgid1, Msgid2, N) \
- ((void) (Domainname), ngettext (Msgid1, Msgid2, N))
-# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
- ((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N))
-# define textdomain(Domainname) ((const char *) (Domainname))
-# define bindtextdomain(Domainname, Dirname) \
- ((void) (Domainname), (const char *) (Dirname))
-# define bind_textdomain_codeset(Domainname, Codeset) \
- ((void) (Domainname), (const char *) (Codeset))
-
-#endif
-
-/* A pseudo function call that serves as a marker for the automated
- extraction of messages, but does not call gettext(). The run-time
- translation is done at a different place in the code.
- The argument, String, should be a literal string. Concatenated strings
- and other string expressions won't work.
- The macro's expansion is not parenthesized, so that it is suitable as
- initializer for static 'char[]' or 'const char[]' variables. */
-#define gettext_noop(String) String
-
-/* The separator between msgctxt and msgid in a .mo file. */
-#define GETTEXT_CONTEXT_GLUE "\004"
-
-/* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a
- MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be
- short and rarely need to change.
- The letter 'p' stands for 'particular' or 'special'. */
-#ifdef DEFAULT_TEXT_DOMAIN
-# define pgettext(Msgctxt, Msgid) \
- pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
-#else
-# define pgettext(Msgctxt, Msgid) \
- pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
-#endif
-#define dpgettext(Domainname, Msgctxt, Msgid) \
- pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
-#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \
- pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category)
-#ifdef DEFAULT_TEXT_DOMAIN
-# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
- npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
-#else
-# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
- npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
-#endif
-#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
- npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
-#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \
- npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category)
-
-#ifdef __GNUC__
-__inline
-#else
-#ifdef __cplusplus
-inline
-#endif
-#endif
-static const char *
-pgettext_aux (const char *domain,
- const char *msg_ctxt_id, const char *msgid,
- int category)
-{
- const char *translation = dcgettext (domain, msg_ctxt_id, category);
- if (translation == msg_ctxt_id)
- return msgid;
- else
- return translation;
-}
-
-#ifdef __GNUC__
-__inline
-#else
-#ifdef __cplusplus
-inline
-#endif
-#endif
-static const char *
-npgettext_aux (const char *domain,
- const char *msg_ctxt_id, const char *msgid,
- const char *msgid_plural, unsigned long int n,
- int category)
-{
- const char *translation =
- dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
- if (translation == msg_ctxt_id || translation == msgid_plural)
- return (n == 1 ? msgid : msgid_plural);
- else
- return translation;
-}
-
-/* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID
- can be arbitrary expressions. But for string literals these macros are
- less efficient than those above. */
-
-#include
-
-#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \
- (((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \
- /* || __STDC_VERSION__ >= 199901L */ )
-
-#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
-#include
-#endif
-
-#define pgettext_expr(Msgctxt, Msgid) \
- dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES)
-#define dpgettext_expr(Domainname, Msgctxt, Msgid) \
- dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES)
-
-#ifdef __GNUC__
-__inline
-#else
-#ifdef __cplusplus
-inline
-#endif
-#endif
-static const char *
-dcpgettext_expr (const char *domain,
- const char *msgctxt, const char *msgid,
- int category)
-{
- size_t msgctxt_len = strlen (msgctxt) + 1;
- size_t msgid_len = strlen (msgid) + 1;
- const char *translation;
-#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
- char msg_ctxt_id[msgctxt_len + msgid_len];
-#else
- char buf[1024];
- char *msg_ctxt_id =
- (msgctxt_len + msgid_len <= sizeof (buf)
- ? buf
- : (char *) malloc (msgctxt_len + msgid_len));
- if (msg_ctxt_id != NULL)
-#endif
- {
- memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
- msg_ctxt_id[msgctxt_len - 1] = '\004';
- memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
- translation = dcgettext (domain, msg_ctxt_id, category);
-#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
- if (msg_ctxt_id != buf)
- free (msg_ctxt_id);
-#endif
- if (translation != msg_ctxt_id)
- return translation;
- }
- return msgid;
-}
-
-#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \
- dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
-#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
- dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
-
-#ifdef __GNUC__
-__inline
-#else
-#ifdef __cplusplus
-inline
-#endif
-#endif
-static const char *
-dcnpgettext_expr (const char *domain,
- const char *msgctxt, const char *msgid,
- const char *msgid_plural, unsigned long int n,
- int category)
-{
- size_t msgctxt_len = strlen (msgctxt) + 1;
- size_t msgid_len = strlen (msgid) + 1;
- const char *translation;
-#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
- char msg_ctxt_id[msgctxt_len + msgid_len];
-#else
- char buf[1024];
- char *msg_ctxt_id =
- (msgctxt_len + msgid_len <= sizeof (buf)
- ? buf
- : (char *) malloc (msgctxt_len + msgid_len));
- if (msg_ctxt_id != NULL)
-#endif
- {
- memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
- msg_ctxt_id[msgctxt_len - 1] = '\004';
- memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
- translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
-#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
- if (msg_ctxt_id != buf)
- free (msg_ctxt_id);
-#endif
- if (!(translation == msg_ctxt_id || translation == msgid_plural))
- return translation;
- }
- return (n == 1 ? msgid : msgid_plural);
-}
-
-#endif /* _LIBGETTEXT_H */
diff --git a/gnulib/lib/gettimeofday.c b/gnulib/lib/gettimeofday.c
deleted file mode 100644
index abe290449e..0000000000
--- a/gnulib/lib/gettimeofday.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/* Provide gettimeofday for systems that don't have it or for which it's broken.
-
- Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007 Free Software
- Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser 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 Jim Meyering */
-
-#include
-
-/* Specification. */
-#include
-
-#include
-
-#if HAVE_SYS_TIMEB_H
-# include
-#endif
-
-#if GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME
-
-/* Work around the bug in some systems whereby gettimeofday clobbers
- the static buffer that localtime uses for its return value. The
- gettimeofday function from Mac OS X 10.0.4 (i.e., Darwin 1.3.7) has
- this problem. The tzset replacement is necessary for at least
- Solaris 2.5, 2.5.1, and 2.6. */
-
-static struct tm tm_zero_buffer;
-static struct tm *localtime_buffer_addr = &tm_zero_buffer;
-
-#undef localtime
-extern struct tm *localtime (time_t const *);
-
-#undef gmtime
-extern struct tm *gmtime (time_t const *);
-
-/* This is a wrapper for localtime. It is used only on systems for which
- gettimeofday clobbers the static buffer used for localtime's result.
-
- On the first call, record the address of the static buffer that
- localtime uses for its result. */
-
-struct tm *
-rpl_localtime (time_t const *timep)
-{
- struct tm *tm = localtime (timep);
-
- if (localtime_buffer_addr == &tm_zero_buffer)
- localtime_buffer_addr = tm;
-
- return tm;
-}
-
-/* Same as above, since gmtime and localtime use the same buffer. */
-struct tm *
-rpl_gmtime (time_t const *timep)
-{
- struct tm *tm = gmtime (timep);
-
- if (localtime_buffer_addr == &tm_zero_buffer)
- localtime_buffer_addr = tm;
-
- return tm;
-}
-
-#endif /* GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME */
-
-#if TZSET_CLOBBERS_LOCALTIME
-
-#undef tzset
-extern void tzset (void);
-
-/* This is a wrapper for tzset, for systems on which tzset may clobber
- the static buffer used for localtime's result. */
-void
-rpl_tzset (void)
-{
- /* Save and restore the contents of the buffer used for localtime's
- result around the call to tzset. */
- struct tm save = *localtime_buffer_addr;
- tzset ();
- *localtime_buffer_addr = save;
-}
-#endif
-
-/* This is a wrapper for gettimeofday. It is used only on systems
- that lack this function, or whose implementation of this function
- causes problems. */
-
-int
-rpl_gettimeofday (struct timeval *restrict tv, void *restrict tz)
-{
-#undef gettimeofday
-#if HAVE_GETTIMEOFDAY
-# if GETTIMEOFDAY_CLOBBERS_LOCALTIME
- /* Save and restore the contents of the buffer used for localtime's
- result around the call to gettimeofday. */
- struct tm save = *localtime_buffer_addr;
-# endif
-
- int result = gettimeofday (tv, tz);
-
-# if GETTIMEOFDAY_CLOBBERS_LOCALTIME
- *localtime_buffer_addr = save;
-# endif
-
- return result;
-
-#else
-
-# if HAVE__FTIME
-
- struct _timeb timebuf;
- _ftime (&timebuf);
- tv->tv_sec = timebuf.time;
- tv->tv_usec = timebuf.millitm * 1000;
-
-# else
-
-# if !defined OK_TO_USE_1S_CLOCK
-# error "Only 1-second nominal clock resolution found. Is that intended?" \
- "If so, compile with the -DOK_TO_USE_1S_CLOCK option."
-# endif
- tv->tv_sec = time (NULL);
- tv->tv_usec = 0;
-
-# endif
-
- return 0;
-
-#endif
-}
diff --git a/gnulib/lib/inet_ntop.c b/gnulib/lib/inet_ntop.c
deleted file mode 100644
index 23b6cfc79a..0000000000
--- a/gnulib/lib/inet_ntop.c
+++ /dev/null
@@ -1,238 +0,0 @@
-/* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form
-
- Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser 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. */
-
-/*
- * Copyright (c) 1996-1999 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#include
-
-/* Specification. */
-#include
-
-#include
-#include
-#include
-
-#ifndef EAFNOSUPPORT
-# define EAFNOSUPPORT EINVAL
-#endif
-
-#define NS_IN6ADDRSZ 16
-#define NS_INT16SZ 2
-
-/*
- * WARNING: Don't even consider trying to compile this on a system where
- * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
- */
-typedef int verify_int_size[2 * sizeof (int) - 7];
-
-static const char *inet_ntop4 (const unsigned char *src, char *dst, socklen_t size);
-#if HAVE_IPV6
-static const char *inet_ntop6 (const unsigned char *src, char *dst, socklen_t size);
-#endif
-
-
-/* char *
- * inet_ntop(af, src, dst, size)
- * convert a network format address to presentation format.
- * return:
- * pointer to presentation format address (`dst'), or NULL (see errno).
- * author:
- * Paul Vixie, 1996.
- */
-const char *
-inet_ntop (int af, const void *restrict src,
- char *restrict dst, socklen_t cnt)
-{
- switch (af)
- {
-#if HAVE_IPV4
- case AF_INET:
- return (inet_ntop4 (src, dst, cnt));
-#endif
-
-#if HAVE_IPV6
- case AF_INET6:
- return (inet_ntop6 (src, dst, cnt));
-#endif
-
- default:
- errno = EAFNOSUPPORT;
- return (NULL);
- }
- /* NOTREACHED */
-}
-
-/* const char *
- * inet_ntop4(src, dst, size)
- * format an IPv4 address
- * return:
- * `dst' (as a const)
- * notes:
- * (1) uses no statics
- * (2) takes a u_char* not an in_addr as input
- * author:
- * Paul Vixie, 1996.
- */
-static const char *
-inet_ntop4 (const unsigned char *src, char *dst, socklen_t size)
-{
- char tmp[sizeof "255.255.255.255"];
- int len;
-
- len = sprintf (tmp, "%u.%u.%u.%u", src[0], src[1], src[2], src[3]);
- if (len < 0)
- return NULL;
-
- if (len > size)
- {
- errno = ENOSPC;
- return NULL;
- }
-
- return strcpy (dst, tmp);
-}
-
-#if HAVE_IPV6
-
-/* const char *
- * inet_ntop6(src, dst, size)
- * convert IPv6 binary address into presentation (printable) format
- * author:
- * Paul Vixie, 1996.
- */
-static const char *
-inet_ntop6 (const unsigned char *src, char *dst, socklen_t size)
-{
- /*
- * Note that int32_t and int16_t need only be "at least" large enough
- * to contain a value of the specified size. On some systems, like
- * Crays, there is no such thing as an integer variable with 16 bits.
- * Keep this in mind if you think this function should have been coded
- * to use pointer overlays. All the world's not a VAX.
- */
- char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;
- struct
- {
- int base, len;
- } best, cur;
- unsigned int words[NS_IN6ADDRSZ / NS_INT16SZ];
- int i;
-
- /*
- * Preprocess:
- * Copy the input (bytewise) array into a wordwise array.
- * Find the longest run of 0x00's in src[] for :: shorthanding.
- */
- memset (words, '\0', sizeof words);
- for (i = 0; i < NS_IN6ADDRSZ; i += 2)
- words[i / 2] = (src[i] << 8) | src[i + 1];
- best.base = -1;
- cur.base = -1;
- for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++)
- {
- if (words[i] == 0)
- {
- if (cur.base == -1)
- cur.base = i, cur.len = 1;
- else
- cur.len++;
- }
- else
- {
- if (cur.base != -1)
- {
- if (best.base == -1 || cur.len > best.len)
- best = cur;
- cur.base = -1;
- }
- }
- }
- if (cur.base != -1)
- {
- if (best.base == -1 || cur.len > best.len)
- best = cur;
- }
- if (best.base != -1 && best.len < 2)
- best.base = -1;
-
- /*
- * Format the result.
- */
- tp = tmp;
- for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++)
- {
- /* Are we inside the best run of 0x00's? */
- if (best.base != -1 && i >= best.base && i < (best.base + best.len))
- {
- if (i == best.base)
- *tp++ = ':';
- continue;
- }
- /* Are we following an initial run of 0x00s or any real hex? */
- if (i != 0)
- *tp++ = ':';
- /* Is this address an encapsulated IPv4? */
- if (i == 6 && best.base == 0 &&
- (best.len == 6 || (best.len == 5 && words[5] == 0xffff)))
- {
- if (!inet_ntop4 (src + 12, tp, sizeof tmp - (tp - tmp)))
- return (NULL);
- tp += strlen (tp);
- break;
- }
- {
- int len = sprintf (tp, "%x", words[i]);
- if (len < 0)
- return NULL;
- tp += len;
- }
- }
- /* Was it a trailing run of 0x00's? */
- if (best.base != -1 && (best.base + best.len) ==
- (NS_IN6ADDRSZ / NS_INT16SZ))
- *tp++ = ':';
- *tp++ = '\0';
-
- /*
- * Check for overflow, copy, and we're done.
- */
- if ((socklen_t) (tp - tmp) > size)
- {
- errno = ENOSPC;
- return NULL;
- }
-
- return strcpy (dst, tmp);
-}
-
-#endif
diff --git a/gnulib/lib/inet_pton.c b/gnulib/lib/inet_pton.c
deleted file mode 100644
index 3c4a035fd8..0000000000
--- a/gnulib/lib/inet_pton.c
+++ /dev/null
@@ -1,257 +0,0 @@
-/* inet_pton.c -- convert IPv4 and IPv6 addresses from text to binary form
-
- Copyright (C) 2006, 2008 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see . */
-
-/*
- * Copyright (c) 1996,1999 by Internet Software Consortium.
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
- * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
- * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
- * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#include
-
-/* Specification. */
-#include
-
-#include
-#include
-#include
-
-#ifndef EAFNOSUPPORT
-# define EAFNOSUPPORT EINVAL
-#endif
-
-#define NS_INADDRSZ 4
-#define NS_IN6ADDRSZ 16
-#define NS_INT16SZ 2
-
-/*
- * WARNING: Don't even consider trying to compile this on a system where
- * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
- */
-
-static int inet_pton4 (const char *src, unsigned char *dst);
-#if HAVE_IPV6
-static int inet_pton6 (const char *src, unsigned char *dst);
-#endif
-
-/* int
- * inet_pton(af, src, dst)
- * convert from presentation format (which usually means ASCII printable)
- * to network format (which is usually some kind of binary format).
- * return:
- * 1 if the address was valid for the specified address family
- * 0 if the address wasn't valid (`dst' is untouched in this case)
- * -1 if some other error occurred (`dst' is untouched in this case, too)
- * author:
- * Paul Vixie, 1996.
- */
-int
-inet_pton (int af, const char *restrict src, void *restrict dst)
-{
- switch (af)
- {
- case AF_INET:
- return (inet_pton4 (src, dst));
-
-#if HAVE_IPV6
- case AF_INET6:
- return (inet_pton6 (src, dst));
-#endif
-
- default:
- errno = EAFNOSUPPORT;
- return (-1);
- }
- /* NOTREACHED */
-}
-
-/* int
- * inet_pton4(src, dst)
- * like inet_aton() but without all the hexadecimal, octal (with the
- * exception of 0) and shorthand.
- * return:
- * 1 if `src' is a valid dotted quad, else 0.
- * notice:
- * does not touch `dst' unless it's returning 1.
- * author:
- * Paul Vixie, 1996.
- */
-static int
-inet_pton4 (const char *restrict src, unsigned char *restrict dst)
-{
- int saw_digit, octets, ch;
- unsigned char tmp[NS_INADDRSZ], *tp;
-
- saw_digit = 0;
- octets = 0;
- *(tp = tmp) = 0;
- while ((ch = *src++) != '\0')
- {
-
- if (ch >= '0' && ch <= '9')
- {
- unsigned new = *tp * 10 + (ch - '0');
-
- if (saw_digit && *tp == 0)
- return (0);
- if (new > 255)
- return (0);
- *tp = new;
- if (!saw_digit)
- {
- if (++octets > 4)
- return (0);
- saw_digit = 1;
- }
- }
- else if (ch == '.' && saw_digit)
- {
- if (octets == 4)
- return (0);
- *++tp = 0;
- saw_digit = 0;
- }
- else
- return (0);
- }
- if (octets < 4)
- return (0);
- memcpy (dst, tmp, NS_INADDRSZ);
- return (1);
-}
-
-#if HAVE_IPV6
-
-/* int
- * inet_pton6(src, dst)
- * convert presentation level address to network order binary form.
- * return:
- * 1 if `src' is a valid [RFC1884 2.2] address, else 0.
- * notice:
- * (1) does not touch `dst' unless it's returning 1.
- * (2) :: in a full address is silently ignored.
- * credit:
- * inspired by Mark Andrews.
- * author:
- * Paul Vixie, 1996.
- */
-static int
-inet_pton6 (const char *restrict src, unsigned char *restrict dst)
-{
- static const char xdigits[] = "0123456789abcdef";
- unsigned char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
- const char *curtok;
- int ch, saw_xdigit;
- unsigned val;
-
- tp = memset (tmp, '\0', NS_IN6ADDRSZ);
- endp = tp + NS_IN6ADDRSZ;
- colonp = NULL;
- /* Leading :: requires some special handling. */
- if (*src == ':')
- if (*++src != ':')
- return (0);
- curtok = src;
- saw_xdigit = 0;
- val = 0;
- while ((ch = c_tolower (*src++)) != '\0')
- {
- const char *pch;
-
- pch = strchr (xdigits, ch);
- if (pch != NULL)
- {
- val <<= 4;
- val |= (pch - xdigits);
- if (val > 0xffff)
- return (0);
- saw_xdigit = 1;
- continue;
- }
- if (ch == ':')
- {
- curtok = src;
- if (!saw_xdigit)
- {
- if (colonp)
- return (0);
- colonp = tp;
- continue;
- }
- else if (*src == '\0')
- {
- return (0);
- }
- if (tp + NS_INT16SZ > endp)
- return (0);
- *tp++ = (u_char) (val >> 8) & 0xff;
- *tp++ = (u_char) val & 0xff;
- saw_xdigit = 0;
- val = 0;
- continue;
- }
- if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
- inet_pton4 (curtok, tp) > 0)
- {
- tp += NS_INADDRSZ;
- saw_xdigit = 0;
- break; /* '\0' was seen by inet_pton4(). */
- }
- return (0);
- }
- if (saw_xdigit)
- {
- if (tp + NS_INT16SZ > endp)
- return (0);
- *tp++ = (u_char) (val >> 8) & 0xff;
- *tp++ = (u_char) val & 0xff;
- }
- if (colonp != NULL)
- {
- /*
- * Since some memmove()'s erroneously fail to handle
- * overlapping regions, we'll do the shift by hand.
- */
- const int n = tp - colonp;
- int i;
-
- if (tp == endp)
- return (0);
- for (i = 1; i <= n; i++)
- {
- endp[-i] = colonp[n - i];
- colonp[n - i] = 0;
- }
- tp = endp;
- }
- if (tp != endp)
- return (0);
- memcpy (dst, tmp, NS_IN6ADDRSZ);
- return (1);
-}
-#endif
diff --git a/gnulib/lib/intprops.h b/gnulib/lib/intprops.h
deleted file mode 100644
index b6b7723566..0000000000
--- a/gnulib/lib/intprops.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* intprops.h -- properties of integer types
-
- Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see . */
-
-/* Written by Paul Eggert. */
-
-#include
-
-/* The extra casts in the following macros work around compiler bugs,
- e.g., in Cray C 5.0.3.0. */
-
-/* True if the arithmetic type T is an integer type. bool counts as
- an integer. */
-#define TYPE_IS_INTEGER(t) ((t) 1.5 == 1)
-
-/* True if negative values of the signed integer type T use two's
- complement, ones' complement, or signed magnitude representation,
- respectively. Much GNU code assumes two's complement, but some
- people like to be portable to all possible C hosts. */
-#define TYPE_TWOS_COMPLEMENT(t) ((t) ~ (t) 0 == (t) -1)
-#define TYPE_ONES_COMPLEMENT(t) ((t) ~ (t) 0 == 0)
-#define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1)
-
-/* True if the arithmetic type T is signed. */
-#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
-
-/* The maximum and minimum values for the integer type T. These
- macros have undefined behavior if T is signed and has padding bits.
- If this is a problem for you, please let us know how to fix it for
- your host. */
-#define TYPE_MINIMUM(t) \
- ((t) (! TYPE_SIGNED (t) \
- ? (t) 0 \
- : TYPE_SIGNED_MAGNITUDE (t) \
- ? ~ (t) 0 \
- : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))
-#define TYPE_MAXIMUM(t) \
- ((t) (! TYPE_SIGNED (t) \
- ? (t) -1 \
- : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
-
-/* Return zero if T can be determined to be an unsigned type.
- Otherwise, return 1.
- When compiling with GCC, INT_STRLEN_BOUND uses this macro to obtain a
- tighter bound. Otherwise, it overestimates the true bound by one byte
- when applied to unsigned types of size 2, 4, 16, ... bytes.
- The symbol signed_type_or_expr__ is private to this header file. */
-#if __GNUC__ >= 2
-# define signed_type_or_expr__(t) TYPE_SIGNED (__typeof__ (t))
-#else
-# define signed_type_or_expr__(t) 1
-#endif
-
-/* Bound on length of the string representing an integer type or expression T.
- Subtract 1 for the sign bit if T is signed; log10 (2.0) < 146/485;
- add 1 for integer division truncation; add 1 more for a minus sign
- if needed. */
-#define INT_STRLEN_BOUND(t) \
- ((sizeof (t) * CHAR_BIT - signed_type_or_expr__ (t)) * 146 / 485 \
- + signed_type_or_expr__ (t) + 1)
-
-/* Bound on buffer size needed to represent an integer type or expression T,
- including the terminating null. */
-#define INT_BUFSIZE_BOUND(t) (INT_STRLEN_BOUND (t) + 1)
diff --git a/gnulib/lib/ioctl.c b/gnulib/lib/ioctl.c
deleted file mode 100644
index 1c2d73a841..0000000000
--- a/gnulib/lib/ioctl.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/* ioctl.c --- wrappers for Windows ioctl function
-
- Copyright (C) 2008, 2009 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see . */
-
-/* Written by Paolo Bonzini */
-
-#include
-
-#include
-
-#include
-
-#define WIN32_LEAN_AND_MEAN
-/* Get winsock2.h. */
-#include
-
-/* Get set_winsock_errno, FD_TO_SOCKET etc. */
-#include "w32sock.h"
-
-int
-rpl_ioctl (int fd, int req, ...)
-{
- void *buf;
- va_list args;
- SOCKET sock;
- int r;
-
- va_start (args, req);
- buf = va_arg (args, void *);
- va_end (args);
-
- sock = FD_TO_SOCKET (fd);
- r = ioctlsocket (sock, req, buf);
- if (r < 0)
- set_winsock_errno ();
-
- return r;
-}
diff --git a/gnulib/lib/lseek.c b/gnulib/lib/lseek.c
deleted file mode 100644
index feec8310bd..0000000000
--- a/gnulib/lib/lseek.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/* An lseek() function that detects pipes.
- Copyright (C) 2007 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser 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. */
-
-#include
-
-/* Specification. */
-#include
-
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-/* Windows platforms. */
-/* Get GetFileType. */
-# include
-#else
-# include
-#endif
-#include
-
-#undef lseek
-
-off_t
-rpl_lseek (int fd, off_t offset, int whence)
-{
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
- /* mingw lseek mistakenly succeeds on pipes, sockets, and terminals. */
- HANDLE h = (HANDLE) _get_osfhandle (fd);
- if (h == INVALID_HANDLE_VALUE)
- {
- errno = EBADF;
- return -1;
- }
- if (GetFileType (h) != FILE_TYPE_DISK)
- {
- errno = ESPIPE;
- return -1;
- }
-#else
- /* BeOS lseek mistakenly succeeds on pipes... */
- struct stat statbuf;
- if (fstat (fd, &statbuf) < 0)
- return -1;
- if (!S_ISREG (statbuf.st_mode))
- {
- errno = ESPIPE;
- return -1;
- }
-#endif
- return lseek (fd, offset, whence);
-}
diff --git a/gnulib/lib/lstat.c b/gnulib/lib/lstat.c
deleted file mode 100644
index 3d1bca8953..0000000000
--- a/gnulib/lib/lstat.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/* Work around a bug of lstat on some systems
-
- Copyright (C) 1997-1999, 2000-2006, 2008 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see . */
-
-/* written by Jim Meyering */
-
-#include
-
-/* Get the original definition of open. It might be defined as a macro. */
-#define __need_system_sys_stat_h
-#include
-#include
-#undef __need_system_sys_stat_h
-
-static inline int
-orig_lstat (const char *filename, struct stat *buf)
-{
- return lstat (filename, buf);
-}
-
-/* Specification. */
-#include
-
-#include
-#include
-
-/* lstat works differently on Linux and Solaris systems. POSIX (see
- `pathname resolution' in the glossary) requires that programs like
- `ls' take into consideration the fact that FILE has a trailing slash
- when FILE is a symbolic link. On Linux and Solaris 10 systems, the
- lstat function already has the desired semantics (in treating
- `lstat ("symlink/", sbuf)' just like `lstat ("symlink/.", sbuf)',
- but on Solaris 9 and earlier it does not.
-
- If FILE has a trailing slash and specifies a symbolic link,
- then use stat() to get more info on the referent of FILE.
- If the referent is a non-directory, then set errno to ENOTDIR
- and return -1. Otherwise, return stat's result. */
-
-int
-rpl_lstat (const char *file, struct stat *sbuf)
-{
- size_t len;
- int lstat_result = orig_lstat (file, sbuf);
-
- if (lstat_result != 0 || !S_ISLNK (sbuf->st_mode))
- return lstat_result;
-
- len = strlen (file);
- if (len == 0 || file[len - 1] != '/')
- return 0;
-
- /* FILE refers to a symbolic link and the name ends with a slash.
- Call stat() to get info about the link's referent. */
-
- /* If stat fails, then we do the same. */
- if (stat (file, sbuf) != 0)
- return -1;
-
- /* If FILE references a directory, return 0. */
- if (S_ISDIR (sbuf->st_mode))
- return 0;
-
- /* Here, we know stat succeeded and FILE references a non-directory.
- But it was specified via a name including a trailing slash.
- Fail with errno set to ENOTDIR to indicate the contradiction. */
- errno = ENOTDIR;
- return -1;
-}
diff --git a/gnulib/lib/malloc.c b/gnulib/lib/malloc.c
deleted file mode 100644
index df86e46c58..0000000000
--- a/gnulib/lib/malloc.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/* malloc() function that is glibc compatible.
-
- Copyright (C) 1997, 1998, 2006, 2007 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser 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 Jim Meyering and Bruno Haible */
-
-#include
-/* Only the AC_FUNC_MALLOC macro defines 'malloc' already in config.h. */
-#ifdef malloc
-# define NEED_MALLOC_GNU
-# undef malloc
-#endif
-
-/* Specification. */
-#include
-
-#include
-
-/* Call the system's malloc below. */
-#undef malloc
-
-/* Allocate an N-byte block of memory from the heap.
- If N is zero, allocate a 1-byte block. */
-
-void *
-rpl_malloc (size_t n)
-{
- void *result;
-
-#ifdef NEED_MALLOC_GNU
- if (n == 0)
- n = 1;
-#endif
-
- result = malloc (n);
-
-#if !HAVE_MALLOC_POSIX
- if (result == NULL)
- errno = ENOMEM;
-#endif
-
- return result;
-}
diff --git a/gnulib/lib/mkstemp.c b/gnulib/lib/mkstemp.c
deleted file mode 100644
index fcd44d993f..0000000000
--- a/gnulib/lib/mkstemp.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Copyright (C) 1998, 1999, 2001, 2005, 2006, 2007 Free Software Foundation, Inc.
- This file is derived from the one in the GNU C Library.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see . */
-
-#if !_LIBC
-# include
-#endif
-
-#include
-
-#if !_LIBC
-# include "tempname.h"
-# define __gen_tempname gen_tempname
-# define __GT_FILE GT_FILE
-#endif
-
-#include
-
-#ifndef __GT_FILE
-# define __GT_FILE 0
-#endif
-
-/* Generate a unique temporary file name from TEMPLATE.
- The last six characters of TEMPLATE must be "XXXXXX";
- they are replaced with a string that makes the file name unique.
- Then open the file and return a fd. */
-int
-mkstemp (template)
- char *template;
-{
- return __gen_tempname (template, __GT_FILE);
-}
diff --git a/gnulib/lib/netdb.in.h b/gnulib/lib/netdb.in.h
deleted file mode 100644
index a81e2b4378..0000000000
--- a/gnulib/lib/netdb.in.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/* Provide a netdb.h header file for systems lacking it (read: MinGW).
- Copyright (C) 2008 Free Software Foundation, Inc.
- Written by Simon Josefsson.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser 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. */
-
-/* This file is supposed to be used on platforms that lack .
- It is intended to provide definitions and prototypes needed by an
- application. */
-
-#ifndef _GL_NETDB_H
-
-#if @HAVE_NETDB_H@
-
-# if __GNUC__ >= 3
-@PRAGMA_SYSTEM_HEADER@
-# endif
-
-/* The include_next requires a split double-inclusion guard. */
-# @INCLUDE_NEXT@ @NEXT_NETDB_H@
-
-#endif
-
-#ifndef _GL_NETDB_H
-#define _GL_NETDB_H
-
-/* Get netdb.h definitions such as struct hostent for MinGW. */
-#include
-
-/* Declarations for a platform that lacks , or where it is
- incomplete. */
-
-#if @GNULIB_GETADDRINFO@
-
-# if !@HAVE_STRUCT_ADDRINFO@
-
-/* Structure to contain information about address of a service provider. */
-struct addrinfo
-{
- int ai_flags; /* Input flags. */
- int ai_family; /* Protocol family for socket. */
- int ai_socktype; /* Socket type. */
- int ai_protocol; /* Protocol for socket. */
- socklen_t ai_addrlen; /* Length of socket address. */
- struct sockaddr *ai_addr; /* Socket address for socket. */
- char *ai_canonname; /* Canonical name for service location. */
- struct addrinfo *ai_next; /* Pointer to next in list. */
-};
-# endif
-
-/* Possible values for `ai_flags' field in `addrinfo' structure. */
-# ifndef AI_PASSIVE
-# define AI_PASSIVE 0x0001 /* Socket address is intended for `bind'. */
-# endif
-# ifndef AI_CANONNAME
-# define AI_CANONNAME 0x0002 /* Request for canonical name. */
-# endif
-# ifndef AI_NUMERICSERV
-# define AI_NUMERICSERV 0x0400 /* Don't use name resolution. */
-# endif
-
-# if 0
-/* The commented out definitions below are not yet implemented in the
- GNULIB getaddrinfo() replacement, so are not yet needed and may, in fact,
- cause conflicts on systems with a getaddrinfo() function which does not
- define them.
-
- If they are restored, be sure to protect the definitions with #ifndef. */
-# define AI_NUMERICHOST 0x0004 /* Don't use name resolution. */
-# define AI_V4MAPPED 0x0008 /* IPv4 mapped addresses are acceptable. */
-# define AI_ALL 0x0010 /* Return IPv4 mapped and IPv6 addresses. */
-# define AI_ADDRCONFIG 0x0020 /* Use configuration of this host to choose
- returned address type.. */
-# endif /* 0 */
-
-/* Error values for `getaddrinfo' function. */
-# ifndef EAI_BADFLAGS
-# define EAI_BADFLAGS -1 /* Invalid value for `ai_flags' field. */
-# define EAI_NONAME -2 /* NAME or SERVICE is unknown. */
-# define EAI_AGAIN -3 /* Temporary failure in name resolution. */
-# define EAI_FAIL -4 /* Non-recoverable failure in name res. */
-# define EAI_NODATA -5 /* No address associated with NAME. */
-# define EAI_FAMILY -6 /* `ai_family' not supported. */
-# define EAI_SOCKTYPE -7 /* `ai_socktype' not supported. */
-# define EAI_SERVICE -8 /* SERVICE not supported for `ai_socktype'. */
-# define EAI_MEMORY -10 /* Memory allocation failure. */
-# endif
-
-/* Since EAI_NODATA is deprecated by RFC3493, some systems (at least
- FreeBSD, which does define EAI_BADFLAGS) have removed the definition
- in favor of EAI_NONAME. */
-# if !defined EAI_NODATA && defined EAI_NONAME
-# define EAI_NODATA EAI_NONAME
-# endif
-
-# ifndef EAI_OVERFLOW
-/* Not defined on mingw32 and Haiku. */
-# define EAI_OVERFLOW -12 /* Argument buffer overflow. */
-# endif
-# ifndef EAI_ADDRFAMILY
-/* Not defined on mingw32. */
-# define EAI_ADDRFAMILY -9 /* Address family for NAME not supported. */
-# endif
-# ifndef EAI_SYSTEM
-/* Not defined on mingw32. */
-# define EAI_SYSTEM -11 /* System error returned in `errno'. */
-# endif
-
-# if 0
-/* The commented out definitions below are not yet implemented in the
- GNULIB getaddrinfo() replacement, so are not yet needed.
-
- If they are restored, be sure to protect the definitions with #ifndef. */
-# ifndef EAI_INPROGRESS
-# define EAI_INPROGRESS -100 /* Processing request in progress. */
-# define EAI_CANCELED -101 /* Request canceled. */
-# define EAI_NOTCANCELED -102 /* Request not canceled. */
-# define EAI_ALLDONE -103 /* All requests done. */
-# define EAI_INTR -104 /* Interrupted by a signal. */
-# define EAI_IDN_ENCODE -105 /* IDN encoding failed. */
-# endif
-# endif
-
-# if !@HAVE_DECL_GETADDRINFO@
-/* Translate name of a service location and/or a service name to set of
- socket addresses.
- For more details, see the POSIX:2001 specification
- . */
-extern int getaddrinfo (const char *restrict nodename,
- const char *restrict servname,
- const struct addrinfo *restrict hints,
- struct addrinfo **restrict res);
-# endif
-
-# if !@HAVE_DECL_FREEADDRINFO@
-/* Free `addrinfo' structure AI including associated storage.
- For more details, see the POSIX:2001 specification
- . */
-extern void freeaddrinfo (struct addrinfo *ai);
-# endif
-
-# if !@HAVE_DECL_GAI_STRERROR@
-/* Convert error return from getaddrinfo() to a string.
- For more details, see the POSIX:2001 specification
- . */
-extern const char *gai_strerror (int ecode);
-# endif
-
-# if !@HAVE_DECL_GETNAMEINFO@
-/* Convert socket address to printable node and service names.
- For more details, see the POSIX:2001 specification
- . */
-extern int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen,
- char *restrict node, socklen_t nodelen,
- char *restrict service, socklen_t servicelen,
- int flags);
-# endif
-
-/* Possible flags for getnameinfo. */
-# ifndef NI_NUMERICHOST
-# define NI_NUMERICHOST 1
-# endif
-# ifndef NI_NUMERICSERV
-# define NI_NUMERICSERV 2
-# endif
-
-#endif /* @GNULIB_GETADDRINFO@ */
-
-#endif /* _GL_NETDB_H */
-#endif /* _GL_NETDB_H */
diff --git a/gnulib/lib/netinet/.cvsignore b/gnulib/lib/netinet/.cvsignore
deleted file mode 100644
index 00fea9e8c8..0000000000
--- a/gnulib/lib/netinet/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-in.h
diff --git a/gnulib/lib/netinet/.gitignore b/gnulib/lib/netinet/.gitignore
deleted file mode 100644
index 00fea9e8c8..0000000000
--- a/gnulib/lib/netinet/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-in.h
diff --git a/gnulib/lib/netinet_in.in.h b/gnulib/lib/netinet_in.in.h
deleted file mode 100644
index 7c2b68f454..0000000000
--- a/gnulib/lib/netinet_in.in.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Substitute for .
- Copyright (C) 2007-2008 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser 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. */
-
-#ifndef _GL_NETINET_IN_H
-
-#if @HAVE_NETINET_IN_H@
-
-# if __GNUC__ >= 3
-@PRAGMA_SYSTEM_HEADER@
-# endif
-
-/* On many platforms, assumes prior inclusion of
- . */
-# include
-
-/* The include_next requires a split double-inclusion guard. */
-# @INCLUDE_NEXT@ @NEXT_NETINET_IN_H@
-
-#endif
-
-#ifndef _GL_NETINET_IN_H
-#define _GL_NETINET_IN_H
-
-#if !@HAVE_NETINET_IN_H@
-
-/* A platform that lacks . */
-
-# include
-
-#endif
-
-#endif /* _GL_NETINET_IN_H */
-#endif /* _GL_NETINET_IN_H */
diff --git a/gnulib/lib/perror.c b/gnulib/lib/perror.c
deleted file mode 100644
index f5f137e0fa..0000000000
--- a/gnulib/lib/perror.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Print a message describing error code.
- Copyright (C) 2008 Free Software Foundation, Inc.
- Written by Bruno Haible and Simon Josefsson.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see . */
-
-#include
-
-/* Specification. */
-#include
-
-#include
-#include
-
-void
-perror (const char *string)
-{
- const char *errno_description = strerror (errno);
-
- if (string != NULL && *string != '\0')
- fprintf (stderr, "%s: %s\n", string, errno_description);
- else
- fprintf (stderr, "%s\n", errno_description);
-}
diff --git a/gnulib/lib/physmem.c b/gnulib/lib/physmem.c
deleted file mode 100644
index cf80dde938..0000000000
--- a/gnulib/lib/physmem.c
+++ /dev/null
@@ -1,304 +0,0 @@
-/* Calculate the size of physical memory.
-
- Copyright (C) 2000, 2001, 2003, 2005, 2006 Free Software
- Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see . */
-
-/* Written by Paul Eggert. */
-
-#include
-
-#include "physmem.h"
-
-#include
-
-#if HAVE_SYS_PSTAT_H
-# include
-#endif
-
-#if HAVE_SYS_SYSMP_H
-# include
-#endif
-
-#if HAVE_SYS_SYSINFO_H && HAVE_MACHINE_HAL_SYSINFO_H
-# include
-# include
-#endif
-
-#if HAVE_SYS_TABLE_H
-# include
-#endif
-
-#include
-
-#if HAVE_SYS_PARAM_H
-# include
-#endif
-
-#if HAVE_SYS_SYSCTL_H
-# include
-#endif
-
-#if HAVE_SYS_SYSTEMCFG_H
-# include
-#endif
-
-#ifdef _WIN32
-# define WIN32_LEAN_AND_MEAN
-# include
-/* MEMORYSTATUSEX is missing from older windows headers, so define
- a local replacement. */
-typedef struct
-{
- DWORD dwLength;
- DWORD dwMemoryLoad;
- DWORDLONG ullTotalPhys;
- DWORDLONG ullAvailPhys;
- DWORDLONG ullTotalPageFile;
- DWORDLONG ullAvailPageFile;
- DWORDLONG ullTotalVirtual;
- DWORDLONG ullAvailVirtual;
- DWORDLONG ullAvailExtendedVirtual;
-} lMEMORYSTATUSEX;
-typedef WINBOOL (WINAPI *PFN_MS_EX) (lMEMORYSTATUSEX*);
-#endif
-
-#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
-
-/* Return the total amount of physical memory. */
-double
-physmem_total (void)
-{
-#if defined _SC_PHYS_PAGES && defined _SC_PAGESIZE
- { /* This works on linux-gnu, solaris2 and cygwin. */
- double pages = sysconf (_SC_PHYS_PAGES);
- double pagesize = sysconf (_SC_PAGESIZE);
- if (0 <= pages && 0 <= pagesize)
- return pages * pagesize;
- }
-#endif
-
-#if HAVE_PSTAT_GETSTATIC
- { /* This works on hpux11. */
- struct pst_static pss;
- if (0 <= pstat_getstatic (&pss, sizeof pss, 1, 0))
- {
- double pages = pss.physical_memory;
- double pagesize = pss.page_size;
- if (0 <= pages && 0 <= pagesize)
- return pages * pagesize;
- }
- }
-#endif
-
-#if HAVE_SYSMP && defined MP_SAGET && defined MPSA_RMINFO && defined _SC_PAGESIZE
- { /* This works on irix6. */
- struct rminfo realmem;
- if (sysmp (MP_SAGET, MPSA_RMINFO, &realmem, sizeof realmem) == 0)
- {
- double pagesize = sysconf (_SC_PAGESIZE);
- double pages = realmem.physmem;
- if (0 <= pages && 0 <= pagesize)
- return pages * pagesize;
- }
- }
-#endif
-
-#if HAVE_GETSYSINFO && defined GSI_PHYSMEM
- { /* This works on Tru64 UNIX V4/5. */
- int physmem;
-
- if (getsysinfo (GSI_PHYSMEM, (caddr_t) &physmem, sizeof (physmem),
- NULL, NULL, NULL) == 1)
- {
- double kbytes = physmem;
-
- if (0 <= kbytes)
- return kbytes * 1024.0;
- }
- }
-#endif
-
-#if HAVE_SYSCTL && defined HW_PHYSMEM
- { /* This works on *bsd and darwin. */
- unsigned int physmem;
- size_t len = sizeof physmem;
- static int mib[2] = { CTL_HW, HW_PHYSMEM };
-
- if (sysctl (mib, ARRAY_SIZE (mib), &physmem, &len, NULL, 0) == 0
- && len == sizeof (physmem))
- return (double) physmem;
- }
-#endif
-
-#if HAVE__SYSTEM_CONFIGURATION
- /* This works on AIX. */
- return _system_configuration.physmem;
-#endif
-
-#if defined _WIN32
- { /* this works on windows */
- PFN_MS_EX pfnex;
- HMODULE h = GetModuleHandle ("kernel32.dll");
-
- if (!h)
- return 0.0;
-
- /* Use GlobalMemoryStatusEx if available. */
- if ((pfnex = (PFN_MS_EX) GetProcAddress (h, "GlobalMemoryStatusEx")))
- {
- lMEMORYSTATUSEX lms_ex;
- lms_ex.dwLength = sizeof lms_ex;
- if (!pfnex (&lms_ex))
- return 0.0;
- return (double) lms_ex.ullTotalPhys;
- }
-
- /* Fall back to GlobalMemoryStatus which is always available.
- but returns wrong results for physical memory > 4GB. */
- else
- {
- MEMORYSTATUS ms;
- GlobalMemoryStatus (&ms);
- return (double) ms.dwTotalPhys;
- }
- }
-#endif
-
- /* Guess 64 MB. It's probably an older host, so guess small. */
- return 64 * 1024 * 1024;
-}
-
-/* Return the amount of physical memory available. */
-double
-physmem_available (void)
-{
-#if defined _SC_AVPHYS_PAGES && defined _SC_PAGESIZE
- { /* This works on linux-gnu, solaris2 and cygwin. */
- double pages = sysconf (_SC_AVPHYS_PAGES);
- double pagesize = sysconf (_SC_PAGESIZE);
- if (0 <= pages && 0 <= pagesize)
- return pages * pagesize;
- }
-#endif
-
-#if HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC
- { /* This works on hpux11. */
- struct pst_static pss;
- struct pst_dynamic psd;
- if (0 <= pstat_getstatic (&pss, sizeof pss, 1, 0)
- && 0 <= pstat_getdynamic (&psd, sizeof psd, 1, 0))
- {
- double pages = psd.psd_free;
- double pagesize = pss.page_size;
- if (0 <= pages && 0 <= pagesize)
- return pages * pagesize;
- }
- }
-#endif
-
-#if HAVE_SYSMP && defined MP_SAGET && defined MPSA_RMINFO && defined _SC_PAGESIZE
- { /* This works on irix6. */
- struct rminfo realmem;
- if (sysmp (MP_SAGET, MPSA_RMINFO, &realmem, sizeof realmem) == 0)
- {
- double pagesize = sysconf (_SC_PAGESIZE);
- double pages = realmem.availrmem;
- if (0 <= pages && 0 <= pagesize)
- return pages * pagesize;
- }
- }
-#endif
-
-#if HAVE_TABLE && defined TBL_VMSTATS
- { /* This works on Tru64 UNIX V4/5. */
- struct tbl_vmstats vmstats;
-
- if (table (TBL_VMSTATS, 0, &vmstats, 1, sizeof (vmstats)) == 1)
- {
- double pages = vmstats.free_count;
- double pagesize = vmstats.pagesize;
-
- if (0 <= pages && 0 <= pagesize)
- return pages * pagesize;
- }
- }
-#endif
-
-#if HAVE_SYSCTL && defined HW_USERMEM
- { /* This works on *bsd and darwin. */
- unsigned int usermem;
- size_t len = sizeof usermem;
- static int mib[2] = { CTL_HW, HW_USERMEM };
-
- if (sysctl (mib, ARRAY_SIZE (mib), &usermem, &len, NULL, 0) == 0
- && len == sizeof (usermem))
- return (double) usermem;
- }
-#endif
-
-#if defined _WIN32
- { /* this works on windows */
- PFN_MS_EX pfnex;
- HMODULE h = GetModuleHandle ("kernel32.dll");
-
- if (!h)
- return 0.0;
-
- /* Use GlobalMemoryStatusEx if available. */
- if ((pfnex = (PFN_MS_EX) GetProcAddress (h, "GlobalMemoryStatusEx")))
- {
- lMEMORYSTATUSEX lms_ex;
- lms_ex.dwLength = sizeof lms_ex;
- if (!pfnex (&lms_ex))
- return 0.0;
- return (double) lms_ex.ullAvailPhys;
- }
-
- /* Fall back to GlobalMemoryStatus which is always available.
- but returns wrong results for physical memory > 4GB */
- else
- {
- MEMORYSTATUS ms;
- GlobalMemoryStatus (&ms);
- return (double) ms.dwAvailPhys;
- }
- }
-#endif
-
- /* Guess 25% of physical memory. */
- return physmem_total () / 4;
-}
-
-
-#if DEBUG
-
-# include
-# include
-
-int
-main (void)
-{
- printf ("%12.f %12.f\n", physmem_total (), physmem_available ());
- exit (0);
-}
-
-#endif /* DEBUG */
-
-/*
-Local Variables:
-compile-command: "gcc -DDEBUG -g -O -Wall -W physmem.c"
-End:
-*/
diff --git a/gnulib/lib/physmem.h b/gnulib/lib/physmem.h
deleted file mode 100644
index b2862d50c8..0000000000
--- a/gnulib/lib/physmem.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Calculate the size of physical memory.
-
- Copyright (C) 2000, 2003 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see . */
-
-/* Written by Paul Eggert. */
-
-#ifndef PHYSMEM_H_
-# define PHYSMEM_H_ 1
-
-double physmem_total (void);
-double physmem_available (void);
-
-#endif /* PHYSMEM_H_ */
diff --git a/gnulib/lib/poll.c b/gnulib/lib/poll.c
deleted file mode 100644
index ae4f4b5e94..0000000000
--- a/gnulib/lib/poll.c
+++ /dev/null
@@ -1,566 +0,0 @@
-/* Emulation for poll(2)
- Contributed by Paolo Bonzini.
-
- Copyright 2001-2003, 2006-2009 Free Software Foundation, Inc.
-
- This file is part of gnulib.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser 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. */
-
-/* Tell gcc not to warn about the (nfd < 0) tests, below. */
-#if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__
-# pragma GCC diagnostic ignored "-Wtype-limits"
-#endif
-
-#include
-#include
-
-#include
-#include "poll.h"
-#include
-#include
-#include
-
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-# define WIN32_NATIVE
-# include
-# include
-# include
-# include
-# include
-#else
-# include
-# include
-# include
-# include
-#endif
-
-#ifdef HAVE_SYS_IOCTL_H
-# include
-#endif
-#ifdef HAVE_SYS_FILIO_H
-# include
-#endif
-
-#include
-
-#ifndef INFTIM
-# define INFTIM (-1)
-#endif
-
-/* BeOS does not have MSG_PEEK. */
-#ifndef MSG_PEEK
-# define MSG_PEEK 0
-#endif
-
-#ifdef WIN32_NATIVE
-
-/* Declare data structures for ntdll functions. */
-typedef struct _FILE_PIPE_LOCAL_INFORMATION {
- ULONG NamedPipeType;
- ULONG NamedPipeConfiguration;
- ULONG MaximumInstances;
- ULONG CurrentInstances;
- ULONG InboundQuota;
- ULONG ReadDataAvailable;
- ULONG OutboundQuota;
- ULONG WriteQuotaAvailable;
- ULONG NamedPipeState;
- ULONG NamedPipeEnd;
-} FILE_PIPE_LOCAL_INFORMATION, *PFILE_PIPE_LOCAL_INFORMATION;
-
-typedef struct _IO_STATUS_BLOCK
-{
- union {
- DWORD Status;
- PVOID Pointer;
- } u;
- ULONG_PTR Information;
-} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
-
-typedef enum _FILE_INFORMATION_CLASS {
- FilePipeLocalInformation = 24
-} FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
-
-typedef DWORD (WINAPI *PNtQueryInformationFile)
- (HANDLE, IO_STATUS_BLOCK *, VOID *, ULONG, FILE_INFORMATION_CLASS);
-
-# ifndef PIPE_BUF
-# define PIPE_BUF 512
-# endif
-
-/* Compute revents values for file handle H. */
-
-static int
-win32_compute_revents (HANDLE h, int sought)
-{
- int i, ret, happened;
- INPUT_RECORD *irbuffer;
- DWORD avail, nbuffer;
- BOOL bRet;
- IO_STATUS_BLOCK iosb;
- FILE_PIPE_LOCAL_INFORMATION fpli;
- static PNtQueryInformationFile NtQueryInformationFile;
- static BOOL once_only;
-
- switch (GetFileType (h))
- {
- case FILE_TYPE_PIPE:
- if (!once_only)
- {
- NtQueryInformationFile = (PNtQueryInformationFile)
- GetProcAddress (GetModuleHandle ("ntdll.dll"),
- "NtQueryInformationFile");
- once_only = TRUE;
- }
-
- happened = 0;
- if (PeekNamedPipe (h, NULL, 0, NULL, &avail, NULL) != 0)
- {
- if (avail)
- happened |= sought & (POLLIN | POLLRDNORM);
- }
-
- else
- {
- /* It was the write-end of the pipe. Check if it is writable.
- If NtQueryInformationFile fails, optimistically assume the pipe is
- writable. This could happen on Win9x, where NtQueryInformationFile
- is not available, or if we inherit a pipe that doesn't permit
- FILE_READ_ATTRIBUTES access on the write end (I think this should
- not happen since WinXP SP2; WINE seems fine too). Otherwise,
- ensure that enough space is available for atomic writes. */
- memset (&iosb, 0, sizeof (iosb));
- memset (&fpli, 0, sizeof (fpli));
-
- if (!NtQueryInformationFile
- || NtQueryInformationFile (h, &iosb, &fpli, sizeof (fpli),
- FilePipeLocalInformation)
- || fpli.WriteQuotaAvailable >= PIPE_BUF
- || (fpli.OutboundQuota < PIPE_BUF &&
- fpli.WriteQuotaAvailable == fpli.OutboundQuota))
- happened |= sought & (POLLOUT | POLLWRNORM | POLLWRBAND);
- }
- return happened;
-
- case FILE_TYPE_CHAR:
- ret = WaitForSingleObject (h, 0);
- if (ret == WAIT_OBJECT_0)
- {
- nbuffer = avail = 0;
- bRet = GetNumberOfConsoleInputEvents (h, &nbuffer);
- if (!bRet || nbuffer == 0)
- return POLLHUP;
-
- irbuffer = (INPUT_RECORD *) alloca (nbuffer * sizeof (INPUT_RECORD));
- bRet = PeekConsoleInput (h, irbuffer, nbuffer, &avail);
- if (!bRet || avail == 0)
- return POLLHUP;
-
- for (i = 0; i < avail; i++)
- if (irbuffer[i].EventType == KEY_EVENT)
- return sought & ~(POLLPRI | POLLRDBAND);
- }
- break;
-
- default:
- ret = WaitForSingleObject (h, 0);
- if (ret == WAIT_OBJECT_0)
- return sought & ~(POLLPRI | POLLRDBAND);
-
- break;
- }
-
- return sought & (POLLOUT | POLLWRNORM | POLLWRBAND);
-}
-
-/* Convert fd_sets returned by select into revents values. */
-
-static int
-win32_compute_revents_socket (SOCKET h, int sought, long lNetworkEvents)
-{
- int happened = 0;
-
- if ((lNetworkEvents & (FD_READ | FD_ACCEPT | FD_CLOSE)) == FD_ACCEPT)
- happened |= (POLLIN | POLLRDNORM) & sought;
-
- else if (lNetworkEvents & (FD_READ | FD_ACCEPT | FD_CLOSE))
- {
- int r, error;
-
- char data[64];
- WSASetLastError (0);
- r = recv (h, data, sizeof (data), MSG_PEEK);
- error = WSAGetLastError ();
- WSASetLastError (0);
-
- if (r > 0 || error == WSAENOTCONN)
- happened |= (POLLIN | POLLRDNORM) & sought;
-
- /* Distinguish hung-up sockets from other errors. */
- else if (r == 0 || error == WSAESHUTDOWN || error == WSAECONNRESET
- || error == WSAECONNABORTED || error == WSAENETRESET)
- happened |= POLLHUP;
-
- else
- happened |= POLLERR;
- }
-
- if (lNetworkEvents & (FD_WRITE | FD_CONNECT))
- happened |= (POLLOUT | POLLWRNORM | POLLWRBAND) & sought;
-
- if (lNetworkEvents & FD_OOB)
- happened |= (POLLPRI | POLLRDBAND) & sought;
-
- return happened;
-}
-
-#else /* !MinGW */
-
-/* Convert select(2) returned fd_sets into poll(2) revents values. */
-static int
-compute_revents (int fd, int sought, fd_set *rfds, fd_set *wfds, fd_set *efds)
-{
- int happened = 0;
- if (FD_ISSET (fd, rfds))
- {
- int r;
- int socket_errno;
-
-# if defined __MACH__ && defined __APPLE__
- /* There is a bug in Mac OS X that causes it to ignore MSG_PEEK
- for some kinds of descriptors. Detect if this descriptor is a
- connected socket, a server socket, or something else using a
- 0-byte recv, and use ioctl(2) to detect POLLHUP. */
- r = recv (fd, NULL, 0, MSG_PEEK);
- socket_errno = (r < 0) ? errno : 0;
- if (r == 0 || socket_errno == ENOTSOCK)
- ioctl (fd, FIONREAD, &r);
-# else
- char data[64];
- r = recv (fd, data, sizeof (data), MSG_PEEK);
- socket_errno = (r < 0) ? errno : 0;
-# endif
- if (r == 0)
- happened |= POLLHUP;
-
- /* If the event happened on an unconnected server socket,
- that's fine. */
- else if (r > 0 || ( /* (r == -1) && */ socket_errno == ENOTCONN))
- happened |= (POLLIN | POLLRDNORM) & sought;
-
- /* Distinguish hung-up sockets from other errors. */
- else if (socket_errno == ESHUTDOWN || socket_errno == ECONNRESET
- || socket_errno == ECONNABORTED || socket_errno == ENETRESET)
- happened |= POLLHUP;
-
- else
- happened |= POLLERR;
- }
-
- if (FD_ISSET (fd, wfds))
- happened |= (POLLOUT | POLLWRNORM | POLLWRBAND) & sought;
-
- if (FD_ISSET (fd, efds))
- happened |= (POLLPRI | POLLRDBAND) & sought;
-
- return happened;
-}
-#endif /* !MinGW */
-
-int
-poll (pfd, nfd, timeout)
- struct pollfd *pfd;
- nfds_t nfd;
- int timeout;
-{
-#ifndef WIN32_NATIVE
- fd_set rfds, wfds, efds;
- struct timeval tv;
- struct timeval *ptv;
- int maxfd, rc;
- nfds_t i;
-
-# ifdef _SC_OPEN_MAX
- static int sc_open_max = -1;
-
- if (nfd < 0
- || (nfd > sc_open_max
- && (sc_open_max != -1
- || nfd > (sc_open_max = sysconf (_SC_OPEN_MAX)))))
- {
- errno = EINVAL;
- return -1;
- }
-# else /* !_SC_OPEN_MAX */
-# ifdef OPEN_MAX
- if (nfd < 0 || nfd > OPEN_MAX)
- {
- errno = EINVAL;
- return -1;
- }
-# endif /* OPEN_MAX -- else, no check is needed */
-# endif /* !_SC_OPEN_MAX */
-
- /* EFAULT is not necessary to implement, but let's do it in the
- simplest case. */
- if (!pfd)
- {
- errno = EFAULT;
- return -1;
- }
-
- /* convert timeout number into a timeval structure */
- if (timeout == 0)
- {
- ptv = &tv;
- ptv->tv_sec = 0;
- ptv->tv_usec = 0;
- }
- else if (timeout > 0)
- {
- ptv = &tv;
- ptv->tv_sec = timeout / 1000;
- ptv->tv_usec = (timeout % 1000) * 1000;
- }
- else if (timeout == INFTIM)
- /* wait forever */
- ptv = NULL;
- else
- {
- errno = EINVAL;
- return -1;
- }
-
- /* create fd sets and determine max fd */
- maxfd = -1;
- FD_ZERO (&rfds);
- FD_ZERO (&wfds);
- FD_ZERO (&efds);
- for (i = 0; i < nfd; i++)
- {
- if (pfd[i].fd < 0)
- continue;
-
- if (pfd[i].events & (POLLIN | POLLRDNORM))
- FD_SET (pfd[i].fd, &rfds);
-
- /* see select(2): "the only exceptional condition detectable
- is out-of-band data received on a socket", hence we push
- POLLWRBAND events onto wfds instead of efds. */
- if (pfd[i].events & (POLLOUT | POLLWRNORM | POLLWRBAND))
- FD_SET (pfd[i].fd, &wfds);
- if (pfd[i].events & (POLLPRI | POLLRDBAND))
- FD_SET (pfd[i].fd, &efds);
- if (pfd[i].fd >= maxfd
- && (pfd[i].events & (POLLIN | POLLOUT | POLLPRI
- | POLLRDNORM | POLLRDBAND
- | POLLWRNORM | POLLWRBAND)))
- {
- maxfd = pfd[i].fd;
- if (maxfd > FD_SETSIZE)
- {
- errno = EOVERFLOW;
- return -1;
- }
- }
- }
-
- /* examine fd sets */
- rc = select (maxfd + 1, &rfds, &wfds, &efds, ptv);
- if (rc < 0)
- return rc;
-
- /* establish results */
- rc = 0;
- for (i = 0; i < nfd; i++)
- if (pfd[i].fd < 0)
- pfd[i].revents = 0;
- else
- {
- int happened = compute_revents (pfd[i].fd, pfd[i].events,
- &rfds, &wfds, &efds);
- if (happened)
- {
- pfd[i].revents = happened;
- rc++;
- }
- }
-
- return rc;
-#else
- static struct timeval tv0;
- static HANDLE hEvent;
- WSANETWORKEVENTS ev;
- HANDLE h, handle_array[FD_SETSIZE + 2];
- DWORD ret, wait_timeout, nhandles;
- fd_set rfds, wfds, xfds;
- BOOL poll_again;
- MSG msg;
- int rc = 0;
- nfds_t i;
-
- if (nfd < 0 || timeout < -1)
- {
- errno = EINVAL;
- return -1;
- }
-
- if (!hEvent)
- hEvent = CreateEvent (NULL, FALSE, FALSE, NULL);
-
- handle_array[0] = hEvent;
- nhandles = 1;
- FD_ZERO (&rfds);
- FD_ZERO (&wfds);
- FD_ZERO (&xfds);
-
- /* Classify socket handles and create fd sets. */
- for (i = 0; i < nfd; i++)
- {
- pfd[i].revents = 0;
- if (pfd[i].fd < 0)
- continue;
- if (!(pfd[i].events & (POLLIN | POLLRDNORM |
- POLLOUT | POLLWRNORM | POLLWRBAND)))
- continue;
-
- h = (HANDLE) _get_osfhandle (pfd[i].fd);
- assert (h != NULL);
-
- /* Under Wine, it seems that getsockopt returns 0 for pipes too.
- WSAEnumNetworkEvents instead distinguishes the two correctly. */
- ev.lNetworkEvents = 0xDEADBEEF;
- WSAEnumNetworkEvents ((SOCKET) h, NULL, &ev);
- if (ev.lNetworkEvents != 0xDEADBEEF)
- {
- int requested = FD_CLOSE;
-
- /* see above; socket handles are mapped onto select. */
- if (pfd[i].events & (POLLIN | POLLRDNORM))
- {
- requested |= FD_READ | FD_ACCEPT;
- FD_SET ((SOCKET) h, &rfds);
- }
- if (pfd[i].events & (POLLOUT | POLLWRNORM | POLLWRBAND))
- {
- requested |= FD_WRITE | FD_CONNECT;
- FD_SET ((SOCKET) h, &wfds);
- }
- if (pfd[i].events & (POLLPRI | POLLRDBAND))
- {
- requested |= FD_OOB;
- FD_SET ((SOCKET) h, &xfds);
- }
-
- if (requested)
- WSAEventSelect ((SOCKET) h, hEvent, requested);
- }
- else
- {
- handle_array[nhandles++] = h;
-
- /* Poll now. If we get an event, do not poll again. */
- pfd[i].revents = win32_compute_revents (h, pfd[i].events);
- if (pfd[i].revents)
- wait_timeout = 0;
- }
- }
-
- if (select (0, &rfds, &wfds, &xfds, &tv0) > 0)
- {
- /* Do MsgWaitForMultipleObjects anyway to dispatch messages, but
- no need to call select again. */
- poll_again = FALSE;
- wait_timeout = 0;
- }
- else
- {
- poll_again = TRUE;
- if (timeout == INFTIM)
- wait_timeout = INFINITE;
- else
- wait_timeout = timeout;
- }
-
- for (;;)
- {
- ret = MsgWaitForMultipleObjects (nhandles, handle_array, FALSE,
- wait_timeout, QS_ALLINPUT);
-
- if (ret == WAIT_OBJECT_0 + nhandles)
- {
- /* new input of some other kind */
- BOOL bRet;
- while ((bRet = PeekMessage (&msg, NULL, 0, 0, PM_REMOVE)) != 0)
- {
- TranslateMessage (&msg);
- DispatchMessage (&msg);
- }
- }
- else
- break;
- }
-
- if (poll_again)
- select (0, &rfds, &wfds, &xfds, &tv0);
-
- /* Place a sentinel at the end of the array. */
- handle_array[nhandles] = NULL;
- nhandles = 1;
- for (i = 0; i < nfd; i++)
- {
- int happened;
-
- if (pfd[i].fd < 0)
- continue;
- if (!(pfd[i].events & (POLLIN | POLLRDNORM |
- POLLOUT | POLLWRNORM | POLLWRBAND)))
- continue;
-
- h = (HANDLE) _get_osfhandle (pfd[i].fd);
- if (h != handle_array[nhandles])
- {
- /* It's a socket. */
- WSAEnumNetworkEvents ((SOCKET) h, NULL, &ev);
- WSAEventSelect ((SOCKET) h, 0, 0);
-
- /* If we're lucky, WSAEnumNetworkEvents already provided a way
- to distinguish FD_READ and FD_ACCEPT; this saves a recv later. */
- if (FD_ISSET ((SOCKET) h, &rfds)
- && !(ev.lNetworkEvents & (FD_READ | FD_ACCEPT)))
- ev.lNetworkEvents |= FD_READ | FD_ACCEPT;
- if (FD_ISSET ((SOCKET) h, &wfds))
- ev.lNetworkEvents |= FD_WRITE | FD_CONNECT;
- if (FD_ISSET ((SOCKET) h, &xfds))
- ev.lNetworkEvents |= FD_OOB;
-
- happened = win32_compute_revents_socket ((SOCKET) h, pfd[i].events,
- ev.lNetworkEvents);
- }
- else
- {
- /* Not a socket. */
- nhandles++;
- happened = win32_compute_revents (h, pfd[i].events);
- }
-
- if ((pfd[i].revents |= happened) != 0)
- rc++;
- }
-
- return rc;
-#endif
-}
diff --git a/gnulib/lib/poll.in.h b/gnulib/lib/poll.in.h
deleted file mode 100644
index 5653173970..0000000000
--- a/gnulib/lib/poll.in.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Header for poll(2) emulation
- Contributed by Paolo Bonzini.
-
- Copyright 2001, 2002, 2003, 2007 Free Software Foundation, Inc.
-
- This file is part of gnulib.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser 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. */
-
-#ifndef _GL_POLL_H
-#define _GL_POLL_H
-
-/* fake a poll(2) environment */
-#define POLLIN 0x0001 /* any readable data available */
-#define POLLPRI 0x0002 /* OOB/Urgent readable data */
-#define POLLOUT 0x0004 /* file descriptor is writeable */
-#define POLLERR 0x0008 /* some poll error occurred */
-#define POLLHUP 0x0010 /* file descriptor was "hung up" */
-#define POLLNVAL 0x0020 /* requested events "invalid" */
-#define POLLRDNORM 0x0040
-#define POLLRDBAND 0x0080
-#define POLLWRNORM 0x0100
-#define POLLWRBAND 0x0200
-
-struct pollfd
-{
- int fd; /* which file descriptor to poll */
- short events; /* events we are interested in */
- short revents; /* events found on return */
-};
-
-typedef unsigned long nfds_t;
-
-extern int poll (struct pollfd *pfd, nfds_t nfd, int timeout);
-
-/* Define INFTIM only if doing so conforms to POSIX. */
-#if !defined (_POSIX_C_SOURCE) && !defined (_XOPEN_SOURCE)
-#define INFTIM (-1)
-#endif
-
-#endif /* _GL_POLL_H */
diff --git a/gnulib/lib/printf-args.c b/gnulib/lib/printf-args.c
deleted file mode 100644
index bf2e60b724..0000000000
--- a/gnulib/lib/printf-args.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/* Decomposed printf argument list.
- Copyright (C) 1999, 2002-2003, 2005-2007 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser 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. */
-
-/* This file can be parametrized with the following macros:
- ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions.
- PRINTF_FETCHARGS Name of the function to be defined.
- STATIC Set to 'static' to declare the function static. */
-
-#ifndef PRINTF_FETCHARGS
-# include
-#endif
-
-/* Specification. */
-#ifndef PRINTF_FETCHARGS
-# include "printf-args.h"
-#endif
-
-#ifdef STATIC
-STATIC
-#endif
-int
-PRINTF_FETCHARGS (va_list args, arguments *a)
-{
- size_t i;
- argument *ap;
-
- for (i = 0, ap = &a->arg[0]; i < a->count; i++, ap++)
- switch (ap->type)
- {
- case TYPE_SCHAR:
- ap->a.a_schar = va_arg (args, /*signed char*/ int);
- break;
- case TYPE_UCHAR:
- ap->a.a_uchar = va_arg (args, /*unsigned char*/ int);
- break;
- case TYPE_SHORT:
- ap->a.a_short = va_arg (args, /*short*/ int);
- break;
- case TYPE_USHORT:
- ap->a.a_ushort = va_arg (args, /*unsigned short*/ int);
- break;
- case TYPE_INT:
- ap->a.a_int = va_arg (args, int);
- break;
- case TYPE_UINT:
- ap->a.a_uint = va_arg (args, unsigned int);
- break;
- case TYPE_LONGINT:
- ap->a.a_longint = va_arg (args, long int);
- break;
- case TYPE_ULONGINT:
- ap->a.a_ulongint = va_arg (args, unsigned long int);
- break;
-#if HAVE_LONG_LONG_INT
- case TYPE_LONGLONGINT:
- ap->a.a_longlongint = va_arg (args, long long int);
- break;
- case TYPE_ULONGLONGINT:
- ap->a.a_ulonglongint = va_arg (args, unsigned long long int);
- break;
-#endif
- case TYPE_DOUBLE:
- ap->a.a_double = va_arg (args, double);
- break;
- case TYPE_LONGDOUBLE:
- ap->a.a_longdouble = va_arg (args, long double);
- break;
- case TYPE_CHAR:
- ap->a.a_char = va_arg (args, int);
- break;
-#if HAVE_WINT_T
- case TYPE_WIDE_CHAR:
- /* Although ISO C 99 7.24.1.(2) says that wint_t is "unchanged by
- default argument promotions", this is not the case in mingw32,
- where wint_t is 'unsigned short'. */
- ap->a.a_wide_char =
- (sizeof (wint_t) < sizeof (int)
- ? va_arg (args, int)
- : va_arg (args, wint_t));
- break;
-#endif
- case TYPE_STRING:
- ap->a.a_string = va_arg (args, const char *);
- /* A null pointer is an invalid argument for "%s", but in practice
- it occurs quite frequently in printf statements that produce
- debug output. Use a fallback in this case. */
- if (ap->a.a_string == NULL)
- ap->a.a_string = "(NULL)";
- break;
-#if HAVE_WCHAR_T
- case TYPE_WIDE_STRING:
- ap->a.a_wide_string = va_arg (args, const wchar_t *);
- /* A null pointer is an invalid argument for "%ls", but in practice
- it occurs quite frequently in printf statements that produce
- debug output. Use a fallback in this case. */
- if (ap->a.a_wide_string == NULL)
- {
- static const wchar_t wide_null_string[] =
- {
- (wchar_t)'(',
- (wchar_t)'N', (wchar_t)'U', (wchar_t)'L', (wchar_t)'L',
- (wchar_t)')',
- (wchar_t)0
- };
- ap->a.a_wide_string = wide_null_string;
- }
- break;
-#endif
- case TYPE_POINTER:
- ap->a.a_pointer = va_arg (args, void *);
- break;
- case TYPE_COUNT_SCHAR_POINTER:
- ap->a.a_count_schar_pointer = va_arg (args, signed char *);
- break;
- case TYPE_COUNT_SHORT_POINTER:
- ap->a.a_count_short_pointer = va_arg (args, short *);
- break;
- case TYPE_COUNT_INT_POINTER:
- ap->a.a_count_int_pointer = va_arg (args, int *);
- break;
- case TYPE_COUNT_LONGINT_POINTER:
- ap->a.a_count_longint_pointer = va_arg (args, long int *);
- break;
-#if HAVE_LONG_LONG_INT
- case TYPE_COUNT_LONGLONGINT_POINTER:
- ap->a.a_count_longlongint_pointer = va_arg (args, long long int *);
- break;
-#endif
-#if ENABLE_UNISTDIO
- /* The unistdio extensions. */
- case TYPE_U8_STRING:
- ap->a.a_u8_string = va_arg (args, const uint8_t *);
- /* A null pointer is an invalid argument for "%U", but in practice
- it occurs quite frequently in printf statements that produce
- debug output. Use a fallback in this case. */
- if (ap->a.a_u8_string == NULL)
- {
- static const uint8_t u8_null_string[] =
- { '(', 'N', 'U', 'L', 'L', ')', 0 };
- ap->a.a_u8_string = u8_null_string;
- }
- break;
- case TYPE_U16_STRING:
- ap->a.a_u16_string = va_arg (args, const uint16_t *);
- /* A null pointer is an invalid argument for "%lU", but in practice
- it occurs quite frequently in printf statements that produce
- debug output. Use a fallback in this case. */
- if (ap->a.a_u16_string == NULL)
- {
- static const uint16_t u16_null_string[] =
- { '(', 'N', 'U', 'L', 'L', ')', 0 };
- ap->a.a_u16_string = u16_null_string;
- }
- break;
- case TYPE_U32_STRING:
- ap->a.a_u32_string = va_arg (args, const uint32_t *);
- /* A null pointer is an invalid argument for "%llU", but in practice
- it occurs quite frequently in printf statements that produce
- debug output. Use a fallback in this case. */
- if (ap->a.a_u32_string == NULL)
- {
- static const uint32_t u32_null_string[] =
- { '(', 'N', 'U', 'L', 'L', ')', 0 };
- ap->a.a_u32_string = u32_null_string;
- }
- break;
-#endif
- default:
- /* Unknown type. */
- return -1;
- }
- return 0;
-}
diff --git a/gnulib/lib/printf-args.h b/gnulib/lib/printf-args.h
deleted file mode 100644
index b663a63b17..0000000000
--- a/gnulib/lib/printf-args.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/* Decomposed printf argument list.
- Copyright (C) 1999, 2002-2003, 2006-2007 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser 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. */
-
-#ifndef _PRINTF_ARGS_H
-#define _PRINTF_ARGS_H
-
-/* This file can be parametrized with the following macros:
- ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions.
- PRINTF_FETCHARGS Name of the function to be declared.
- STATIC Set to 'static' to declare the function static. */
-
-/* Default parameters. */
-#ifndef PRINTF_FETCHARGS
-# define PRINTF_FETCHARGS printf_fetchargs
-#endif
-
-/* Get size_t. */
-#include
-
-/* Get wchar_t. */
-#if HAVE_WCHAR_T
-# include
-#endif
-
-/* Get wint_t. */
-#if HAVE_WINT_T
-# include
-#endif
-
-/* Get va_list. */
-#include
-
-
-/* Argument types */
-typedef enum
-{
- TYPE_NONE,
- TYPE_SCHAR,
- TYPE_UCHAR,
- TYPE_SHORT,
- TYPE_USHORT,
- TYPE_INT,
- TYPE_UINT,
- TYPE_LONGINT,
- TYPE_ULONGINT,
-#if HAVE_LONG_LONG_INT
- TYPE_LONGLONGINT,
- TYPE_ULONGLONGINT,
-#endif
- TYPE_DOUBLE,
- TYPE_LONGDOUBLE,
- TYPE_CHAR,
-#if HAVE_WINT_T
- TYPE_WIDE_CHAR,
-#endif
- TYPE_STRING,
-#if HAVE_WCHAR_T
- TYPE_WIDE_STRING,
-#endif
- TYPE_POINTER,
- TYPE_COUNT_SCHAR_POINTER,
- TYPE_COUNT_SHORT_POINTER,
- TYPE_COUNT_INT_POINTER,
- TYPE_COUNT_LONGINT_POINTER
-#if HAVE_LONG_LONG_INT
-, TYPE_COUNT_LONGLONGINT_POINTER
-#endif
-#if ENABLE_UNISTDIO
- /* The unistdio extensions. */
-, TYPE_U8_STRING
-, TYPE_U16_STRING
-, TYPE_U32_STRING
-#endif
-} arg_type;
-
-/* Polymorphic argument */
-typedef struct
-{
- arg_type type;
- union
- {
- signed char a_schar;
- unsigned char a_uchar;
- short a_short;
- unsigned short a_ushort;
- int a_int;
- unsigned int a_uint;
- long int a_longint;
- unsigned long int a_ulongint;
-#if HAVE_LONG_LONG_INT
- long long int a_longlongint;
- unsigned long long int a_ulonglongint;
-#endif
- float a_float;
- double a_double;
- long double a_longdouble;
- int a_char;
-#if HAVE_WINT_T
- wint_t a_wide_char;
-#endif
- const char* a_string;
-#if HAVE_WCHAR_T
- const wchar_t* a_wide_string;
-#endif
- void* a_pointer;
- signed char * a_count_schar_pointer;
- short * a_count_short_pointer;
- int * a_count_int_pointer;
- long int * a_count_longint_pointer;
-#if HAVE_LONG_LONG_INT
- long long int * a_count_longlongint_pointer;
-#endif
-#if ENABLE_UNISTDIO
- /* The unistdio extensions. */
- const uint8_t * a_u8_string;
- const uint16_t * a_u16_string;
- const uint32_t * a_u32_string;
-#endif
- }
- a;
-}
-argument;
-
-typedef struct
-{
- size_t count;
- argument *arg;
-}
-arguments;
-
-
-/* Fetch the arguments, putting them into a. */
-#ifdef STATIC
-STATIC
-#else
-extern
-#endif
-int PRINTF_FETCHARGS (va_list args, arguments *a);
-
-#endif /* _PRINTF_ARGS_H */
diff --git a/gnulib/lib/printf-parse.c b/gnulib/lib/printf-parse.c
deleted file mode 100644
index 66b45a73f2..0000000000
--- a/gnulib/lib/printf-parse.c
+++ /dev/null
@@ -1,627 +0,0 @@
-/* Formatted output to strings.
- Copyright (C) 1999-2000, 2002-2003, 2006-2008 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser 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. */
-
-/* This file can be parametrized with the following macros:
- CHAR_T The element type of the format string.
- CHAR_T_ONLY_ASCII Set to 1 to enable verification that all characters
- in the format string are ASCII.
- DIRECTIVE Structure denoting a format directive.
- Depends on CHAR_T.
- DIRECTIVES Structure denoting the set of format directives of a
- format string. Depends on CHAR_T.
- PRINTF_PARSE Function that parses a format string.
- Depends on CHAR_T.
- STATIC Set to 'static' to declare the function static.
- ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions. */
-
-#ifndef PRINTF_PARSE
-# include
-#endif
-
-/* Specification. */
-#ifndef PRINTF_PARSE
-# include "printf-parse.h"
-#endif
-
-/* Default parameters. */
-#ifndef PRINTF_PARSE
-# define PRINTF_PARSE printf_parse
-# define CHAR_T char
-# define DIRECTIVE char_directive
-# define DIRECTIVES char_directives
-#endif
-
-/* Get size_t, NULL. */
-#include
-
-/* Get intmax_t. */
-#if defined IN_LIBINTL || defined IN_LIBASPRINTF
-# if HAVE_STDINT_H_WITH_UINTMAX
-# include
-# endif
-# if HAVE_INTTYPES_H_WITH_UINTMAX
-# include
-# endif
-#else
-# include
-#endif
-
-/* malloc(), realloc(), free(). */
-#include
-
-/* errno. */
-#include
-
-/* Checked size_t computations. */
-#include "xsize.h"
-
-#if CHAR_T_ONLY_ASCII
-/* c_isascii(). */
-# include "c-ctype.h"
-#endif
-
-#ifdef STATIC
-STATIC
-#endif
-int
-PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
-{
- const CHAR_T *cp = format; /* pointer into format */
- size_t arg_posn = 0; /* number of regular arguments consumed */
- size_t d_allocated; /* allocated elements of d->dir */
- size_t a_allocated; /* allocated elements of a->arg */
- size_t max_width_length = 0;
- size_t max_precision_length = 0;
-
- d->count = 0;
- d_allocated = 1;
- d->dir = (DIRECTIVE *) malloc (d_allocated * sizeof (DIRECTIVE));
- if (d->dir == NULL)
- /* Out of memory. */
- goto out_of_memory_1;
-
- a->count = 0;
- a_allocated = 0;
- a->arg = NULL;
-
-#define REGISTER_ARG(_index_,_type_) \
- { \
- size_t n = (_index_); \
- if (n >= a_allocated) \
- { \
- size_t memory_size; \
- argument *memory; \
- \
- a_allocated = xtimes (a_allocated, 2); \
- if (a_allocated <= n) \
- a_allocated = xsum (n, 1); \
- memory_size = xtimes (a_allocated, sizeof (argument)); \
- if (size_overflow_p (memory_size)) \
- /* Overflow, would lead to out of memory. */ \
- goto out_of_memory; \
- memory = (argument *) (a->arg \
- ? realloc (a->arg, memory_size) \
- : malloc (memory_size)); \
- if (memory == NULL) \
- /* Out of memory. */ \
- goto out_of_memory; \
- a->arg = memory; \
- } \
- while (a->count <= n) \
- a->arg[a->count++].type = TYPE_NONE; \
- if (a->arg[n].type == TYPE_NONE) \
- a->arg[n].type = (_type_); \
- else if (a->arg[n].type != (_type_)) \
- /* Ambiguous type for positional argument. */ \
- goto error; \
- }
-
- while (*cp != '\0')
- {
- CHAR_T c = *cp++;
- if (c == '%')
- {
- size_t arg_index = ARG_NONE;
- DIRECTIVE *dp = &d->dir[d->count]; /* pointer to next directive */
-
- /* Initialize the next directive. */
- dp->dir_start = cp - 1;
- dp->flags = 0;
- dp->width_start = NULL;
- dp->width_end = NULL;
- dp->width_arg_index = ARG_NONE;
- dp->precision_start = NULL;
- dp->precision_end = NULL;
- dp->precision_arg_index = ARG_NONE;
- dp->arg_index = ARG_NONE;
-
- /* Test for positional argument. */
- if (*cp >= '0' && *cp <= '9')
- {
- const CHAR_T *np;
-
- for (np = cp; *np >= '0' && *np <= '9'; np++)
- ;
- if (*np == '$')
- {
- size_t n = 0;
-
- for (np = cp; *np >= '0' && *np <= '9'; np++)
- n = xsum (xtimes (n, 10), *np - '0');
- if (n == 0)
- /* Positional argument 0. */
- goto error;
- if (size_overflow_p (n))
- /* n too large, would lead to out of memory later. */
- goto error;
- arg_index = n - 1;
- cp = np + 1;
- }
- }
-
- /* Read the flags. */
- for (;;)
- {
- if (*cp == '\'')
- {
- dp->flags |= FLAG_GROUP;
- cp++;
- }
- else if (*cp == '-')
- {
- dp->flags |= FLAG_LEFT;
- cp++;
- }
- else if (*cp == '+')
- {
- dp->flags |= FLAG_SHOWSIGN;
- cp++;
- }
- else if (*cp == ' ')
- {
- dp->flags |= FLAG_SPACE;
- cp++;
- }
- else if (*cp == '#')
- {
- dp->flags |= FLAG_ALT;
- cp++;
- }
- else if (*cp == '0')
- {
- dp->flags |= FLAG_ZERO;
- cp++;
- }
- else
- break;
- }
-
- /* Parse the field width. */
- if (*cp == '*')
- {
- dp->width_start = cp;
- cp++;
- dp->width_end = cp;
- if (max_width_length < 1)
- max_width_length = 1;
-
- /* Test for positional argument. */
- if (*cp >= '0' && *cp <= '9')
- {
- const CHAR_T *np;
-
- for (np = cp; *np >= '0' && *np <= '9'; np++)
- ;
- if (*np == '$')
- {
- size_t n = 0;
-
- for (np = cp; *np >= '0' && *np <= '9'; np++)
- n = xsum (xtimes (n, 10), *np - '0');
- if (n == 0)
- /* Positional argument 0. */
- goto error;
- if (size_overflow_p (n))
- /* n too large, would lead to out of memory later. */
- goto error;
- dp->width_arg_index = n - 1;
- cp = np + 1;
- }
- }
- if (dp->width_arg_index == ARG_NONE)
- {
- dp->width_arg_index = arg_posn++;
- if (dp->width_arg_index == ARG_NONE)
- /* arg_posn wrapped around. */
- goto error;
- }
- REGISTER_ARG (dp->width_arg_index, TYPE_INT);
- }
- else if (*cp >= '0' && *cp <= '9')
- {
- size_t width_length;
-
- dp->width_start = cp;
- for (; *cp >= '0' && *cp <= '9'; cp++)
- ;
- dp->width_end = cp;
- width_length = dp->width_end - dp->width_start;
- if (max_width_length < width_length)
- max_width_length = width_length;
- }
-
- /* Parse the precision. */
- if (*cp == '.')
- {
- cp++;
- if (*cp == '*')
- {
- dp->precision_start = cp - 1;
- cp++;
- dp->precision_end = cp;
- if (max_precision_length < 2)
- max_precision_length = 2;
-
- /* Test for positional argument. */
- if (*cp >= '0' && *cp <= '9')
- {
- const CHAR_T *np;
-
- for (np = cp; *np >= '0' && *np <= '9'; np++)
- ;
- if (*np == '$')
- {
- size_t n = 0;
-
- for (np = cp; *np >= '0' && *np <= '9'; np++)
- n = xsum (xtimes (n, 10), *np - '0');
- if (n == 0)
- /* Positional argument 0. */
- goto error;
- if (size_overflow_p (n))
- /* n too large, would lead to out of memory
- later. */
- goto error;
- dp->precision_arg_index = n - 1;
- cp = np + 1;
- }
- }
- if (dp->precision_arg_index == ARG_NONE)
- {
- dp->precision_arg_index = arg_posn++;
- if (dp->precision_arg_index == ARG_NONE)
- /* arg_posn wrapped around. */
- goto error;
- }
- REGISTER_ARG (dp->precision_arg_index, TYPE_INT);
- }
- else
- {
- size_t precision_length;
-
- dp->precision_start = cp - 1;
- for (; *cp >= '0' && *cp <= '9'; cp++)
- ;
- dp->precision_end = cp;
- precision_length = dp->precision_end - dp->precision_start;
- if (max_precision_length < precision_length)
- max_precision_length = precision_length;
- }
- }
-
- {
- arg_type type;
-
- /* Parse argument type/size specifiers. */
- {
- int flags = 0;
-
- for (;;)
- {
- if (*cp == 'h')
- {
- flags |= (1 << (flags & 1));
- cp++;
- }
- else if (*cp == 'L')
- {
- flags |= 4;
- cp++;
- }
- else if (*cp == 'l')
- {
- flags += 8;
- cp++;
- }
- else if (*cp == 'j')
- {
- if (sizeof (intmax_t) > sizeof (long))
- {
- /* intmax_t = long long */
- flags += 16;
- }
- else if (sizeof (intmax_t) > sizeof (int))
- {
- /* intmax_t = long */
- flags += 8;
- }
- cp++;
- }
- else if (*cp == 'z' || *cp == 'Z')
- {
- /* 'z' is standardized in ISO C 99, but glibc uses 'Z'
- because the warning facility in gcc-2.95.2 understands
- only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784). */
- if (sizeof (size_t) > sizeof (long))
- {
- /* size_t = long long */
- flags += 16;
- }
- else if (sizeof (size_t) > sizeof (int))
- {
- /* size_t = long */
- flags += 8;
- }
- cp++;
- }
- else if (*cp == 't')
- {
- if (sizeof (ptrdiff_t) > sizeof (long))
- {
- /* ptrdiff_t = long long */
- flags += 16;
- }
- else if (sizeof (ptrdiff_t) > sizeof (int))
- {
- /* ptrdiff_t = long */
- flags += 8;
- }
- cp++;
- }
-#if defined __APPLE__ && defined __MACH__
- /* On MacOS X 10.3, PRIdMAX is defined as "qd".
- We cannot change it to "lld" because PRIdMAX must also
- be understood by the system's printf routines. */
- else if (*cp == 'q')
- {
- if (64 / 8 > sizeof (long))
- {
- /* int64_t = long long */
- flags += 16;
- }
- else
- {
- /* int64_t = long */
- flags += 8;
- }
- cp++;
- }
-#endif
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
- /* On native Win32, PRIdMAX is defined as "I64d".
- We cannot change it to "lld" because PRIdMAX must also
- be understood by the system's printf routines. */
- else if (*cp == 'I' && cp[1] == '6' && cp[2] == '4')
- {
- if (64 / 8 > sizeof (long))
- {
- /* __int64 = long long */
- flags += 16;
- }
- else
- {
- /* __int64 = long */
- flags += 8;
- }
- cp += 3;
- }
-#endif
- else
- break;
- }
-
- /* Read the conversion character. */
- c = *cp++;
- switch (c)
- {
- case 'd': case 'i':
-#if HAVE_LONG_LONG_INT
- /* If 'long long' exists and is larger than 'long': */
- if (flags >= 16 || (flags & 4))
- type = TYPE_LONGLONGINT;
- else
-#endif
- /* If 'long long' exists and is the same as 'long', we parse
- "lld" into TYPE_LONGINT. */
- if (flags >= 8)
- type = TYPE_LONGINT;
- else if (flags & 2)
- type = TYPE_SCHAR;
- else if (flags & 1)
- type = TYPE_SHORT;
- else
- type = TYPE_INT;
- break;
- case 'o': case 'u': case 'x': case 'X':
-#if HAVE_LONG_LONG_INT
- /* If 'long long' exists and is larger than 'long': */
- if (flags >= 16 || (flags & 4))
- type = TYPE_ULONGLONGINT;
- else
-#endif
- /* If 'unsigned long long' exists and is the same as
- 'unsigned long', we parse "llu" into TYPE_ULONGINT. */
- if (flags >= 8)
- type = TYPE_ULONGINT;
- else if (flags & 2)
- type = TYPE_UCHAR;
- else if (flags & 1)
- type = TYPE_USHORT;
- else
- type = TYPE_UINT;
- break;
- case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
- case 'a': case 'A':
- if (flags >= 16 || (flags & 4))
- type = TYPE_LONGDOUBLE;
- else
- type = TYPE_DOUBLE;
- break;
- case 'c':
- if (flags >= 8)
-#if HAVE_WINT_T
- type = TYPE_WIDE_CHAR;
-#else
- goto error;
-#endif
- else
- type = TYPE_CHAR;
- break;
-#if HAVE_WINT_T
- case 'C':
- type = TYPE_WIDE_CHAR;
- c = 'c';
- break;
-#endif
- case 's':
- if (flags >= 8)
-#if HAVE_WCHAR_T
- type = TYPE_WIDE_STRING;
-#else
- goto error;
-#endif
- else
- type = TYPE_STRING;
- break;
-#if HAVE_WCHAR_T
- case 'S':
- type = TYPE_WIDE_STRING;
- c = 's';
- break;
-#endif
- case 'p':
- type = TYPE_POINTER;
- break;
- case 'n':
-#if HAVE_LONG_LONG_INT
- /* If 'long long' exists and is larger than 'long': */
- if (flags >= 16 || (flags & 4))
- type = TYPE_COUNT_LONGLONGINT_POINTER;
- else
-#endif
- /* If 'long long' exists and is the same as 'long', we parse
- "lln" into TYPE_COUNT_LONGINT_POINTER. */
- if (flags >= 8)
- type = TYPE_COUNT_LONGINT_POINTER;
- else if (flags & 2)
- type = TYPE_COUNT_SCHAR_POINTER;
- else if (flags & 1)
- type = TYPE_COUNT_SHORT_POINTER;
- else
- type = TYPE_COUNT_INT_POINTER;
- break;
-#if ENABLE_UNISTDIO
- /* The unistdio extensions. */
- case 'U':
- if (flags >= 16)
- type = TYPE_U32_STRING;
- else if (flags >= 8)
- type = TYPE_U16_STRING;
- else
- type = TYPE_U8_STRING;
- break;
-#endif
- case '%':
- type = TYPE_NONE;
- break;
- default:
- /* Unknown conversion character. */
- goto error;
- }
- }
-
- if (type != TYPE_NONE)
- {
- dp->arg_index = arg_index;
- if (dp->arg_index == ARG_NONE)
- {
- dp->arg_index = arg_posn++;
- if (dp->arg_index == ARG_NONE)
- /* arg_posn wrapped around. */
- goto error;
- }
- REGISTER_ARG (dp->arg_index, type);
- }
- dp->conversion = c;
- dp->dir_end = cp;
- }
-
- d->count++;
- if (d->count >= d_allocated)
- {
- size_t memory_size;
- DIRECTIVE *memory;
-
- d_allocated = xtimes (d_allocated, 2);
- memory_size = xtimes (d_allocated, sizeof (DIRECTIVE));
- if (size_overflow_p (memory_size))
- /* Overflow, would lead to out of memory. */
- goto out_of_memory;
- memory = (DIRECTIVE *) realloc (d->dir, memory_size);
- if (memory == NULL)
- /* Out of memory. */
- goto out_of_memory;
- d->dir = memory;
- }
- }
-#if CHAR_T_ONLY_ASCII
- else if (!c_isascii (c))
- {
- /* Non-ASCII character. Not supported. */
- goto error;
- }
-#endif
- }
- d->dir[d->count].dir_start = cp;
-
- d->max_width_length = max_width_length;
- d->max_precision_length = max_precision_length;
- return 0;
-
-error:
- if (a->arg)
- free (a->arg);
- if (d->dir)
- free (d->dir);
- errno = EINVAL;
- return -1;
-
-out_of_memory:
- if (a->arg)
- free (a->arg);
- if (d->dir)
- free (d->dir);
-out_of_memory_1:
- errno = ENOMEM;
- return -1;
-}
-
-#undef PRINTF_PARSE
-#undef DIRECTIVES
-#undef DIRECTIVE
-#undef CHAR_T_ONLY_ASCII
-#undef CHAR_T
diff --git a/gnulib/lib/printf-parse.h b/gnulib/lib/printf-parse.h
deleted file mode 100644
index 196aa19692..0000000000
--- a/gnulib/lib/printf-parse.h
+++ /dev/null
@@ -1,179 +0,0 @@
-/* Parse printf format string.
- Copyright (C) 1999, 2002-2003, 2005, 2007 Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser 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. */
-
-#ifndef _PRINTF_PARSE_H
-#define _PRINTF_PARSE_H
-
-/* This file can be parametrized with the following macros:
- ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions.
- STATIC Set to 'static' to declare the function static. */
-
-#include "printf-args.h"
-
-
-/* Flags */
-#define FLAG_GROUP 1 /* ' flag */
-#define FLAG_LEFT 2 /* - flag */
-#define FLAG_SHOWSIGN 4 /* + flag */
-#define FLAG_SPACE 8 /* space flag */
-#define FLAG_ALT 16 /* # flag */
-#define FLAG_ZERO 32
-
-/* arg_index value indicating that no argument is consumed. */
-#define ARG_NONE (~(size_t)0)
-
-/* xxx_directive: A parsed directive.
- xxx_directives: A parsed format string. */
-
-/* A parsed directive. */
-typedef struct
-{
- const char* dir_start;
- const char* dir_end;
- int flags;
- const char* width_start;
- const char* width_end;
- size_t width_arg_index;
- const char* precision_start;
- const char* precision_end;
- size_t precision_arg_index;
- char conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
- size_t arg_index;
-}
-char_directive;
-
-/* A parsed format string. */
-typedef struct
-{
- size_t count;
- char_directive *dir;
- size_t max_width_length;
- size_t max_precision_length;
-}
-char_directives;
-
-#if ENABLE_UNISTDIO
-
-/* A parsed directive. */
-typedef struct
-{
- const uint8_t* dir_start;
- const uint8_t* dir_end;
- int flags;
- const uint8_t* width_start;
- const uint8_t* width_end;
- size_t width_arg_index;
- const uint8_t* precision_start;
- const uint8_t* precision_end;
- size_t precision_arg_index;
- uint8_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
- size_t arg_index;
-}
-u8_directive;
-
-/* A parsed format string. */
-typedef struct
-{
- size_t count;
- u8_directive *dir;
- size_t max_width_length;
- size_t max_precision_length;
-}
-u8_directives;
-
-/* A parsed directive. */
-typedef struct
-{
- const uint16_t* dir_start;
- const uint16_t* dir_end;
- int flags;
- const uint16_t* width_start;
- const uint16_t* width_end;
- size_t width_arg_index;
- const uint16_t* precision_start;
- const uint16_t* precision_end;
- size_t precision_arg_index;
- uint16_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
- size_t arg_index;
-}
-u16_directive;
-
-/* A parsed format string. */
-typedef struct
-{
- size_t count;
- u16_directive *dir;
- size_t max_width_length;
- size_t max_precision_length;
-}
-u16_directives;
-
-/* A parsed directive. */
-typedef struct
-{
- const uint32_t* dir_start;
- const uint32_t* dir_end;
- int flags;
- const uint32_t* width_start;
- const uint32_t* width_end;
- size_t width_arg_index;
- const uint32_t* precision_start;
- const uint32_t* precision_end;
- size_t precision_arg_index;
- uint32_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
- size_t arg_index;
-}
-u32_directive;
-
-/* A parsed format string. */
-typedef struct
-{
- size_t count;
- u32_directive *dir;
- size_t max_width_length;
- size_t max_precision_length;
-}
-u32_directives;
-
-#endif
-
-
-/* Parses the format string. Fills in the number N of directives, and fills
- in directives[0], ..., directives[N-1], and sets directives[N].dir_start
- to the end of the format string. Also fills in the arg_type fields of the
- arguments and the needed count of arguments. */
-#if ENABLE_UNISTDIO
-extern int
- ulc_printf_parse (const char *format, char_directives *d, arguments *a);
-extern int
- u8_printf_parse (const uint8_t *format, u8_directives *d, arguments *a);
-extern int
- u16_printf_parse (const uint16_t *format, u16_directives *d,
- arguments *a);
-extern int
- u32_printf_parse (const uint32_t *format, u32_directives *d,
- arguments *a);
-#else
-# ifdef STATIC
-STATIC
-# else
-extern
-# endif
-int printf_parse (const char *format, char_directives *d, arguments *a);
-#endif
-
-#endif /* _PRINTF_PARSE_H */
diff --git a/gnulib/lib/random_r.c b/gnulib/lib/random_r.c
deleted file mode 100644
index 3b1d4b6f16..0000000000
--- a/gnulib/lib/random_r.c
+++ /dev/null
@@ -1,420 +0,0 @@
-/*
- Copyright (C) 1995, 2005, 2008 Free Software Foundation
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library 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
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-/*
- Copyright (C) 1983 Regents of the University of California.
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- 4. Neither the name of the University nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.*/
-
-/*
- * This is derived from the Berkeley source:
- * @(#)random.c 5.5 (Berkeley) 7/6/88
- * It was reworked for the GNU C Library by Roland McGrath.
- * Rewritten to be reentrant by Ulrich Drepper, 1995
- */
-
-#include
-
-#include
-#include
-#include
-#include
-#include
-
-
-/* An improved random number generation package. In addition to the standard
- rand()/srand() like interface, this package also has a special state info
- interface. The initstate() routine is called with a seed, an array of
- bytes, and a count of how many bytes are being passed in; this array is
- then initialized to contain information for random number generation with
- that much state information. Good sizes for the amount of state
- information are 32, 64, 128, and 256 bytes. The state can be switched by
- calling the setstate() function with the same array as was initialized
- with initstate(). By default, the package runs with 128 bytes of state
- information and generates far better random numbers than a linear
- congruential generator. If the amount of state information is less than
- 32 bytes, a simple linear congruential R.N.G. is used. Internally, the
- state information is treated as an array of longs; the zeroth element of
- the array is the type of R.N.G. being used (small integer); the remainder
- of the array is the state information for the R.N.G. Thus, 32 bytes of
- state information will give 7 longs worth of state information, which will
- allow a degree seven polynomial. (Note: The zeroth word of state
- information also has some other information stored in it; see setstate
- for details). The random number generation technique is a linear feedback
- shift register approach, employing trinomials (since there are fewer terms
- to sum up that way). In this approach, the least significant bit of all
- the numbers in the state table will act as a linear feedback shift register,
- and will have period 2^deg - 1 (where deg is the degree of the polynomial
- being used, assuming that the polynomial is irreducible and primitive).
- The higher order bits will have longer periods, since their values are
- also influenced by pseudo-random carries out of the lower bits. The
- total period of the generator is approximately deg*(2**deg - 1); thus
- doubling the amount of state information has a vast influence on the
- period of the generator. Note: The deg*(2**deg - 1) is an approximation
- only good for large deg, when the period of the shift register is the
- dominant factor. With deg equal to seven, the period is actually much
- longer than the 7*(2**7 - 1) predicted by this formula. */
-
-
-
-/* For each of the currently supported random number generators, we have a
- break value on the amount of state information (you need at least this many
- bytes of state info to support this random number generator), a degree for
- the polynomial (actually a trinomial) that the R.N.G. is based on, and
- separation between the two lower order coefficients of the trinomial. */
-
-/* Linear congruential. */
-#define TYPE_0 0
-#define BREAK_0 8
-#define DEG_0 0
-#define SEP_0 0
-
-/* x**7 + x**3 + 1. */
-#define TYPE_1 1
-#define BREAK_1 32
-#define DEG_1 7
-#define SEP_1 3
-
-/* x**15 + x + 1. */
-#define TYPE_2 2
-#define BREAK_2 64
-#define DEG_2 15
-#define SEP_2 1
-
-/* x**31 + x**3 + 1. */
-#define TYPE_3 3
-#define BREAK_3 128
-#define DEG_3 31
-#define SEP_3 3
-
-/* x**63 + x + 1. */
-#define TYPE_4 4
-#define BREAK_4 256
-#define DEG_4 63
-#define SEP_4 1
-
-
-/* Array versions of the above information to make code run faster.
- Relies on fact that TYPE_i == i. */
-
-#define MAX_TYPES 5 /* Max number of types above. */
-
-struct random_poly_info
-{
- int seps[MAX_TYPES];
- int degrees[MAX_TYPES];
-};
-
-static const struct random_poly_info random_poly_info =
-{
- { SEP_0, SEP_1, SEP_2, SEP_3, SEP_4 },
- { DEG_0, DEG_1, DEG_2, DEG_3, DEG_4 }
-};
-
-#ifndef _LIBC
-# define weak_alias(local, symbol)
-# define __set_errno(e) errno = (e)
-# define __srandom_r srandom_r
-# define __initstate_r initstate_r
-# define __setstate_r setstate_r
-# define __random_r random_r
-#endif
-
-
-
-/* Initialize the random number generator based on the given seed. If the
- type is the trivial no-state-information type, just remember the seed.
- Otherwise, initializes state[] based on the given "seed" via a linear
- congruential generator. Then, the pointers are set to known locations
- that are exactly rand_sep places apart. Lastly, it cycles the state
- information a given number of times to get rid of any initial dependencies
- introduced by the L.C.R.N.G. Note that the initialization of randtbl[]
- for default usage relies on values produced by this routine. */
-int
-__srandom_r (unsigned int seed, struct random_data *buf)
-{
- int type;
- int32_t *state;
- long int i;
- long int word;
- int32_t *dst;
- int kc;
-
- if (buf == NULL)
- goto fail;
- type = buf->rand_type;
- if ((unsigned int) type >= MAX_TYPES)
- goto fail;
-
- state = buf->state;
- /* We must make sure the seed is not 0. Take arbitrarily 1 in this case. */
- if (seed == 0)
- seed = 1;
- state[0] = seed;
- if (type == TYPE_0)
- goto done;
-
- dst = state;
- word = seed;
- kc = buf->rand_deg;
- for (i = 1; i < kc; ++i)
- {
- /* This does:
- state[i] = (16807 * state[i - 1]) % 2147483647;
- but avoids overflowing 31 bits. */
- long int hi = word / 127773;
- long int lo = word % 127773;
- word = 16807 * lo - 2836 * hi;
- if (word < 0)
- word += 2147483647;
- *++dst = word;
- }
-
- buf->fptr = &state[buf->rand_sep];
- buf->rptr = &state[0];
- kc *= 10;
- while (--kc >= 0)
- {
- int32_t discard;
- (void) __random_r (buf, &discard);
- }
-
- done:
- return 0;
-
- fail:
- return -1;
-}
-
-weak_alias (__srandom_r, srandom_r)
-
-/* Initialize the state information in the given array of N bytes for
- future random number generation. Based on the number of bytes we
- are given, and the break values for the different R.N.G.'s, we choose
- the best (largest) one we can and set things up for it. srandom is
- then called to initialize the state information. Note that on return
- from srandom, we set state[-1] to be the type multiplexed with the current
- value of the rear pointer; this is so successive calls to initstate won't
- lose this information and will be able to restart with setstate.
- Note: The first thing we do is save the current state, if any, just like
- setstate so that it doesn't matter when initstate is called.
- Returns a pointer to the old state. */
-int
-__initstate_r (unsigned int seed, char *arg_state, size_t n,
- struct random_data *buf)
-{
- int32_t *old_state;
- int32_t *state;
- int type;
- int degree;
- int separation;
-
- if (buf == NULL)
- goto fail;
-
- old_state = buf->state;
- if (old_state != NULL)
- {
- int old_type = buf->rand_type;
- if (old_type == TYPE_0)
- old_state[-1] = TYPE_0;
- else
- old_state[-1] = (MAX_TYPES * (buf->rptr - old_state)) + old_type;
- }
-
- if (n >= BREAK_3)
- type = n < BREAK_4 ? TYPE_3 : TYPE_4;
- else if (n < BREAK_1)
- {
- if (n < BREAK_0)
- {
- __set_errno (EINVAL);
- goto fail;
- }
- type = TYPE_0;
- }
- else
- type = n < BREAK_2 ? TYPE_1 : TYPE_2;
-
- degree = random_poly_info.degrees[type];
- separation = random_poly_info.seps[type];
-
- buf->rand_type = type;
- buf->rand_sep = separation;
- buf->rand_deg = degree;
- state = &((int32_t *) arg_state)[1]; /* First location. */
- /* Must set END_PTR before srandom. */
- buf->end_ptr = &state[degree];
-
- buf->state = state;
-
- __srandom_r (seed, buf);
-
- state[-1] = TYPE_0;
- if (type != TYPE_0)
- state[-1] = (buf->rptr - state) * MAX_TYPES + type;
-
- return 0;
-
- fail:
- __set_errno (EINVAL);
- return -1;
-}
-
-weak_alias (__initstate_r, initstate_r)
-
-/* Restore the state from the given state array.
- Note: It is important that we also remember the locations of the pointers
- in the current state information, and restore the locations of the pointers
- from the old state information. This is done by multiplexing the pointer
- location into the zeroth word of the state information. Note that due
- to the order in which things are done, it is OK to call setstate with the
- same state as the current state
- Returns a pointer to the old state information. */
-int
-__setstate_r (char *arg_state, struct random_data *buf)
-{
- int32_t *new_state = 1 + (int32_t *) arg_state;
- int type;
- int old_type;
- int32_t *old_state;
- int degree;
- int separation;
-
- if (arg_state == NULL || buf == NULL)
- goto fail;
-
- old_type = buf->rand_type;
- old_state = buf->state;
- if (old_type == TYPE_0)
- old_state[-1] = TYPE_0;
- else
- old_state[-1] = (MAX_TYPES * (buf->rptr - old_state)) + old_type;
-
- type = new_state[-1] % MAX_TYPES;
- if (type < TYPE_0 || type > TYPE_4)
- goto fail;
-
- buf->rand_deg = degree = random_poly_info.degrees[type];
- buf->rand_sep = separation = random_poly_info.seps[type];
- buf->rand_type = type;
-
- if (type != TYPE_0)
- {
- int rear = new_state[-1] / MAX_TYPES;
- buf->rptr = &new_state[rear];
- buf->fptr = &new_state[(rear + separation) % degree];
- }
- buf->state = new_state;
- /* Set end_ptr too. */
- buf->end_ptr = &new_state[degree];
-
- return 0;
-
- fail:
- __set_errno (EINVAL);
- return -1;
-}
-
-weak_alias (__setstate_r, setstate_r)
-
-/* If we are using the trivial TYPE_0 R.N.G., just do the old linear
- congruential bit. Otherwise, we do our fancy trinomial stuff, which is the
- same in all the other cases due to all the global variables that have been
- set up. The basic operation is to add the number at the rear pointer into
- the one at the front pointer. Then both pointers are advanced to the next
- location cyclically in the table. The value returned is the sum generated,
- reduced to 31 bits by throwing away the "least random" low bit.
- Note: The code takes advantage of the fact that both the front and
- rear pointers can't wrap on the same call by not testing the rear
- pointer if the front one has wrapped. Returns a 31-bit random number. */
-
-int
-__random_r (struct random_data *buf, int32_t *result)
-{
- int32_t *state;
-
- if (buf == NULL || result == NULL)
- goto fail;
-
- state = buf->state;
-
- if (buf->rand_type == TYPE_0)
- {
- int32_t val = state[0];
- val = ((state[0] * 1103515245) + 12345) & 0x7fffffff;
- state[0] = val;
- *result = val;
- }
- else
- {
- int32_t *fptr = buf->fptr;
- int32_t *rptr = buf->rptr;
- int32_t *end_ptr = buf->end_ptr;
- int32_t val;
-
- val = *fptr += *rptr;
- /* Chucking least random bit. */
- *result = (val >> 1) & 0x7fffffff;
- ++fptr;
- if (fptr >= end_ptr)
- {
- fptr = state;
- ++rptr;
- }
- else
- {
- ++rptr;
- if (rptr >= end_ptr)
- rptr = state;
- }
- buf->fptr = fptr;
- buf->rptr = rptr;
- }
- return 0;
-
- fail:
- __set_errno (EINVAL);
- return -1;
-}
-
-weak_alias (__random_r, random_r)
diff --git a/gnulib/lib/realloc.c b/gnulib/lib/realloc.c
deleted file mode 100644
index 64b7d78c57..0000000000
--- a/gnulib/lib/realloc.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/* realloc() function that is glibc compatible.
-
- Copyright (C) 1997, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see . */
-
-/* written by Jim Meyering and Bruno Haible */
-
-#include
-
-/* Only the AC_FUNC_REALLOC macro defines 'realloc' already in config.h. */
-#ifdef realloc
-# define NEED_REALLOC_GNU 1
-#endif
-
-/* Infer the properties of the system's malloc function.
- Only the AC_FUNC_MALLOC macro defines 'malloc' already in config.h. */
-#if GNULIB_MALLOC_GNU && !defined malloc
-# define SYSTEM_MALLOC_GLIBC_COMPATIBLE 1
-#endif
-
-/* Below we want to call the system's malloc and realloc.
- Undefine the symbols here so that including provides a
- declaration of malloc(), not of rpl_malloc(), and likewise for realloc. */
-#undef malloc
-#undef realloc
-
-/* Specification. */
-#include
-
-#include
-
-/* Below we want to call the system's malloc and realloc.
- Undefine the symbols, if they were defined by gnulib's
- replacement. */
-#undef malloc
-#undef realloc
-
-/* Change the size of an allocated block of memory P to N bytes,
- with error checking. If N is zero, change it to 1. If P is NULL,
- use malloc. */
-
-void *
-rpl_realloc (void *p, size_t n)
-{
- void *result;
-
-#if NEED_REALLOC_GNU
- if (n == 0)
- {
- n = 1;
-
- /* In theory realloc might fail, so don't rely on it to free. */
- free (p);
- p = NULL;
- }
-#endif
-
- if (p == NULL)
- {
-#if GNULIB_REALLOC_GNU && !NEED_REALLOC_GNU && !SYSTEM_MALLOC_GLIBC_COMPATIBLE
- if (n == 0)
- n = 1;
-#endif
- result = malloc (n);
- }
- else
- result = realloc (p, n);
-
-#if !HAVE_REALLOC_POSIX
- if (result == NULL)
- errno = ENOMEM;
-#endif
-
- return result;
-}
diff --git a/gnulib/lib/recv.c b/gnulib/lib/recv.c
deleted file mode 100644
index 699e68d88c..0000000000
--- a/gnulib/lib/recv.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* recv.c --- wrappers for Windows recv function
-
- Copyright (C) 2008 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see . */
-
-/* Written by Paolo Bonzini */
-
-#include
-
-#define WIN32_LEAN_AND_MEAN
-/* Get winsock2.h. */
-#include
-
-/* Get set_winsock_errno, FD_TO_SOCKET etc. */
-#include "w32sock.h"
-
-#undef recv
-
-int
-rpl_recv (int fd, void *buf, int len, int flags)
-{
- SOCKET sock = FD_TO_SOCKET (fd);
- int r = recv (sock, buf, len, flags);
- if (r < 0)
- set_winsock_errno ();
-
- return r;
-}
diff --git a/gnulib/lib/send.c b/gnulib/lib/send.c
deleted file mode 100644
index b314b11268..0000000000
--- a/gnulib/lib/send.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* send.c --- wrappers for Windows send function
-
- Copyright (C) 2008 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see . */
-
-/* Written by Paolo Bonzini */
-
-#include
-
-#define WIN32_LEAN_AND_MEAN
-/* Get winsock2.h. */
-#include
-
-/* Get set_winsock_errno, FD_TO_SOCKET etc. */
-#include "w32sock.h"
-
-#undef send
-
-int
-rpl_send (int fd, const void *buf, int len, int flags)
-{
- SOCKET sock = FD_TO_SOCKET (fd);
- int r = send (sock, buf, len, flags);
- if (r < 0)
- set_winsock_errno ();
-
- return r;
-}
diff --git a/gnulib/lib/setsockopt.c b/gnulib/lib/setsockopt.c
deleted file mode 100644
index 931b07ba1e..0000000000
--- a/gnulib/lib/setsockopt.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* setsockopt.c --- wrappers for Windows setsockopt function
-
- Copyright (C) 2008 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see . */
-
-/* Written by Paolo Bonzini */
-
-#include
-
-#define WIN32_LEAN_AND_MEAN
-/* Get winsock2.h. */
-#include
-
-/* Get set_winsock_errno, FD_TO_SOCKET etc. */
-#include "w32sock.h"
-
-#undef setsockopt
-
-int
-rpl_setsockopt (int fd, int level, int optname, const void *optval, int optlen)
-{
- SOCKET sock = FD_TO_SOCKET (fd);
- int r = setsockopt (sock, level, optname, optval, optlen);
- if (r < 0)
- set_winsock_errno ();
-
- return r;
-}
diff --git a/gnulib/lib/size_max.h b/gnulib/lib/size_max.h
deleted file mode 100644
index 68f3409202..0000000000
--- a/gnulib/lib/size_max.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* size_max.h -- declare SIZE_MAX through system headers
- Copyright (C) 2005-2006 Free Software Foundation, Inc.
- Written by Simon Josefsson.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser 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. */
-
-#ifndef GNULIB_SIZE_MAX_H
-#define GNULIB_SIZE_MAX_H
-
-/* Get SIZE_MAX declaration on systems like Solaris 7/8/9. */
-# include
-/* Get SIZE_MAX declaration on systems like glibc 2. */
-# if HAVE_STDINT_H
-# include
-# endif
-/* On systems where these include files don't define it, SIZE_MAX is defined
- in config.h. */
-
-#endif /* GNULIB_SIZE_MAX_H */
diff --git a/gnulib/lib/snprintf.c b/gnulib/lib/snprintf.c
deleted file mode 100644
index 65434a94c1..0000000000
--- a/gnulib/lib/snprintf.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Formatted output to strings.
- Copyright (C) 2004, 2006-2008 Free Software Foundation, Inc.
- Written by Simon Josefsson and Paul Eggert.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser 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. */
-
-#include
-
-/* Specification. */
-#include
-
-#include
-#include
-#include
-#include
-#include
-
-#include "vasnprintf.h"
-
-/* Print formatted output to string STR. Similar to sprintf, but
- additional length SIZE limit how much is written into STR. Returns
- string length of formatted string (which may be larger than SIZE).
- STR may be NULL, in which case nothing will be written. On error,
- return a negative value. */
-int
-snprintf (char *str, size_t size, const char *format, ...)
-{
- char *output;
- size_t len;
- size_t lenbuf = size;
- va_list args;
-
- va_start (args, format);
- output = vasnprintf (str, &lenbuf, format, args);
- len = lenbuf;
- va_end (args);
-
- if (!output)
- return -1;
-
- if (output != str)
- {
- if (size)
- {
- size_t pruned_len = (len < size ? len : size - 1);
- memcpy (str, output, pruned_len);
- str[pruned_len] = '\0';
- }
-
- free (output);
- }
-
- if (INT_MAX < len)
- {
- errno = EOVERFLOW;
- return -1;
- }
-
- return len;
-}
diff --git a/gnulib/lib/socket.c b/gnulib/lib/socket.c
deleted file mode 100644
index 93367c6c8b..0000000000
--- a/gnulib/lib/socket.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* socket.c --- wrappers for Windows socket function
-
- Copyright (C) 2008 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with this program. If not, see . */
-
-/* Written by Paolo Bonzini */
-
-#include
-
-#define WIN32_LEAN_AND_MEAN
-/* Get winsock2.h. */
-#include
-
-/* Get set_winsock_errno, FD_TO_SOCKET etc. */
-#include "w32sock.h"
-
-int
-rpl_socket (int domain, int type, int protocol)
-{
- /* We have to use WSASocket() to create non-overlapped IO sockets.
- Overlapped IO sockets cannot be used with read/write. */
- SOCKET fh = WSASocket (domain, type, protocol, NULL, 0, 0);
-
- if (fh == INVALID_SOCKET)
- {
- set_winsock_errno ();
- return -1;
- }
- else
- return SOCKET_TO_FD (fh);
-}
diff --git a/gnulib/lib/stdbool.in.h b/gnulib/lib/stdbool.in.h
deleted file mode 100644
index 45375b367e..0000000000
--- a/gnulib/lib/stdbool.in.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/* Copyright (C) 2001-2003, 2006-2008 Free Software Foundation, Inc.
- Written by Bruno Haible , 2001.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser 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. */
-
-#ifndef _GL_STDBOOL_H
-#define _GL_STDBOOL_H
-
-/* ISO C 99 for platforms that lack it. */
-
-/* Usage suggestions:
-
- Programs that use should be aware of some limitations
- and standards compliance issues.
-
- Standards compliance:
-
- - must be #included before 'bool', 'false', 'true'
- can be used.
-
- - You cannot assume that sizeof (bool) == 1.
-
- - Programs should not undefine the macros bool, true, and false,
- as C99 lists that as an "obsolescent feature".
-
- Limitations of this substitute, when used in a C89 environment:
-
- - must be #included before the '_Bool' type can be used.
-
- - You cannot assume that _Bool is a typedef; it might be a macro.
-
- - Bit-fields of type 'bool' are not supported. Portable code
- should use 'unsigned int foo : 1;' rather than 'bool foo : 1;'.
-
- - In C99, casts and automatic conversions to '_Bool' or 'bool' are
- performed in such a way that every nonzero value gets converted
- to 'true', and zero gets converted to 'false'. This doesn't work
- with this substitute. With this substitute, only the values 0 and 1
- give the expected result when converted to _Bool' or 'bool'.
-
- Also, it is suggested that programs use 'bool' rather than '_Bool';
- this isn't required, but 'bool' is more common. */
-
-
-/* 7.16. Boolean type and values */
-
-/* BeOS already #defines false 0, true 1. We use the same
- definitions below, but temporarily we have to #undef them. */
-#if defined __BEOS__ && !defined __HAIKU__
-# include /* defines bool but not _Bool */
-# undef false
-# undef true
-#endif
-
-/* For the sake of symbolic names in gdb, we define true and false as
- enum constants, not only as macros.
- It is tempting to write
- typedef enum { false = 0, true = 1 } _Bool;
- so that gdb prints values of type 'bool' symbolically. But if we do
- this, values of type '_Bool' may promote to 'int' or 'unsigned int'
- (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int'
- (see ISO C 99 6.3.1.1.(2)). So we add a negative value to the
- enum; this ensures that '_Bool' promotes to 'int'. */
-#if defined __cplusplus || (defined __BEOS__ && !defined __HAIKU__)
- /* A compiler known to have 'bool'. */
- /* If the compiler already has both 'bool' and '_Bool', we can assume they
- are the same types. */
-# if !@HAVE__BOOL@
-typedef bool _Bool;
-# endif
-#else
-# if !defined __GNUC__
- /* If @HAVE__BOOL@:
- Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when
- the built-in _Bool type is used. See
- http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
- http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
- http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
- Similar bugs are likely with other compilers as well; this file
- wouldn't be used if was working.
- So we override the _Bool type.
- If !@HAVE__BOOL@:
- Need to define _Bool ourselves. As 'signed char' or as an enum type?
- Use of a typedef, with SunPRO C, leads to a stupid
- "warning: _Bool is a keyword in ISO C99".
- Use of an enum type, with IRIX cc, leads to a stupid
- "warning(1185): enumerated type mixed with another type".
- Even the existence of an enum type, without a typedef,
- "Invalid enumerator. (badenum)" with HP-UX cc on Tru64.
- The only benefit of the enum, debuggability, is not important
- with these compilers. So use 'signed char' and no enum. */
-# define _Bool signed char
-# else
- /* With this compiler, trust the _Bool type if the compiler has it. */
-# if !@HAVE__BOOL@
-typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool;
-# endif
-# endif
-#endif
-#define bool _Bool
-
-/* The other macros must be usable in preprocessor directives. */
-#define false 0
-#define true 1
-#define __bool_true_false_are_defined 1
-
-#endif /* _GL_STDBOOL_H */
diff --git a/gnulib/lib/stdint.in.h b/gnulib/lib/stdint.in.h
deleted file mode 100644
index 7cbfc2cf7e..0000000000
--- a/gnulib/lib/stdint.in.h
+++ /dev/null
@@ -1,567 +0,0 @@
-/* Copyright (C) 2001-2002, 2004-2009 Free Software Foundation, Inc.
- Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
- This file is part of gnulib.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1, 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser 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. */
-
-/*
- * ISO C 99 for platforms that lack it.
- *
- */
-
-#ifndef _GL_STDINT_H
-
-/* When including a system file that in turn includes ,
- use the system , not our substitute. This avoids
- problems with (for example) VMS, whose