mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
Update Gnulib to 68b6ade.
Also add --conditional-dependencies to the flags. See: https://lists.gnu.org/archive/html/guile-devel/2016-07/msg00012.html
This commit is contained in:
parent
0d191d1394
commit
d484bfbace
411 changed files with 6048 additions and 2457 deletions
|
@ -5,7 +5,7 @@
|
||||||
# It is necessary if you want to build targets usually of interest
|
# It is necessary if you want to build targets usually of interest
|
||||||
# only to the maintainer.
|
# only to the maintainer.
|
||||||
|
|
||||||
# Copyright (C) 2001, 2003, 2006-2014 Free Software Foundation, Inc.
|
# Copyright (C) 2001, 2003, 2006-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}'
|
eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"'
|
||||||
& eval 'exec perl -wS "$0" $argv:q'
|
& eval 'exec perl -wS "$0" $argv:q'
|
||||||
if 0;
|
if 0;
|
||||||
# Generate a release announcement message.
|
# Generate a release announcement message.
|
||||||
|
|
||||||
my $VERSION = '2012-06-08 06:53'; # UTC
|
my $VERSION = '2016-01-12 23:09'; # UTC
|
||||||
# The definition above must lie within the first 8 lines in order
|
# The definition above must lie within the first 8 lines in order
|
||||||
# for the Emacs time-stamp write hook (at end) to update it.
|
# for the Emacs time-stamp write hook (at end) to update it.
|
||||||
# If you change this file with Emacs, please let the write hook
|
# If you change this file with Emacs, please let the write hook
|
||||||
# do its job. Otherwise, update this string manually.
|
# do its job. Otherwise, update this string manually.
|
||||||
|
|
||||||
# Copyright (C) 2002-2014 Free Software Foundation, Inc.
|
# Copyright (C) 2002-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -29,15 +29,18 @@ my $VERSION = '2012-06-08 06:53'; # UTC
|
||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
use Digest::MD5;
|
|
||||||
eval { require Digest::SHA; }
|
|
||||||
or eval 'use Digest::SHA1';
|
|
||||||
use POSIX qw(strftime);
|
use POSIX qw(strftime);
|
||||||
|
|
||||||
(my $ME = $0) =~ s|.*/||;
|
(my $ME = $0) =~ s|.*/||;
|
||||||
|
|
||||||
my %valid_release_types = map {$_ => 1} qw (alpha beta stable);
|
my %valid_release_types = map {$_ => 1} qw (alpha beta stable);
|
||||||
my @archive_suffixes = ('tar.gz', 'tar.bz2', 'tar.lzma', 'tar.xz');
|
my @archive_suffixes = ('tar.gz', 'tar.bz2', 'tar.lzma', 'tar.xz');
|
||||||
|
my %digest_classes =
|
||||||
|
(
|
||||||
|
'md5' => (eval { require Digest::MD5; } and 'Digest::MD5'),
|
||||||
|
'sha1' => ((eval { require Digest::SHA; } and 'Digest::SHA')
|
||||||
|
or (eval { require Digest::SHA1; } and 'Digest::SHA1'))
|
||||||
|
);
|
||||||
my $srcdir = '.';
|
my $srcdir = '.';
|
||||||
|
|
||||||
sub usage ($)
|
sub usage ($)
|
||||||
|
@ -157,15 +160,13 @@ sub print_checksums (@)
|
||||||
|
|
||||||
foreach my $meth (qw (md5 sha1))
|
foreach my $meth (qw (md5 sha1))
|
||||||
{
|
{
|
||||||
|
my $class = $digest_classes{$meth} or next;
|
||||||
foreach my $f (@file)
|
foreach my $f (@file)
|
||||||
{
|
{
|
||||||
open IN, '<', $f
|
open IN, '<', $f
|
||||||
or die "$ME: $f: cannot open for reading: $!\n";
|
or die "$ME: $f: cannot open for reading: $!\n";
|
||||||
binmode IN;
|
binmode IN;
|
||||||
my $dig =
|
my $dig = $class->new->addfile(*IN)->hexdigest;
|
||||||
($meth eq 'md5'
|
|
||||||
? Digest::MD5->new->addfile(*IN)->hexdigest
|
|
||||||
: Digest::SHA1->new->addfile(*IN)->hexdigest);
|
|
||||||
close IN;
|
close IN;
|
||||||
print "$dig $f\n";
|
print "$dig $f\n";
|
||||||
}
|
}
|
||||||
|
@ -416,14 +417,15 @@ sub get_tool_versions ($$)
|
||||||
@url_dir_list
|
@url_dir_list
|
||||||
or (warn "URL directory name(s) not specified\n"), $fail = 1;
|
or (warn "URL directory name(s) not specified\n"), $fail = 1;
|
||||||
|
|
||||||
my @tool_list = split ',', $bootstrap_tools;
|
my @tool_list = split ',', $bootstrap_tools
|
||||||
|
if $bootstrap_tools;
|
||||||
|
|
||||||
grep (/^gnulib$/, @tool_list) ^ defined $gnulib_version
|
grep (/^gnulib$/, @tool_list) ^ defined $gnulib_version
|
||||||
and (warn "when specifying gnulib as a tool, you must also specify\n"
|
and (warn "when specifying gnulib as a tool, you must also specify\n"
|
||||||
. "--gnulib-version=V, where V is the result of running git describe\n"
|
. "--gnulib-version=V, where V is the result of running git describe\n"
|
||||||
. "in the gnulib source directory.\n"), $fail = 1;
|
. "in the gnulib source directory.\n"), $fail = 1;
|
||||||
|
|
||||||
exists $valid_release_types{$release_type}
|
!$release_type || exists $valid_release_types{$release_type}
|
||||||
or (warn "'$release_type': invalid release type\n"), $fail = 1;
|
or (warn "'$release_type': invalid release type\n"), $fail = 1;
|
||||||
|
|
||||||
@ARGV
|
@ARGV
|
||||||
|
@ -550,6 +552,6 @@ EOF
|
||||||
## eval: (add-hook 'write-file-hooks 'time-stamp)
|
## eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
## time-stamp-start: "my $VERSION = '"
|
## time-stamp-start: "my $VERSION = '"
|
||||||
## time-stamp-format: "%:y-%02m-%02d %02H:%02M"
|
## time-stamp-format: "%:y-%02m-%02d %02H:%02M"
|
||||||
## time-stamp-time-zone: "UTC"
|
## time-stamp-time-zone: "UTC0"
|
||||||
## time-stamp-end: "'; # UTC"
|
## time-stamp-end: "'; # UTC"
|
||||||
## End:
|
## End:
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# Output a system dependent set of variables, describing how to set the
|
# Output a system dependent set of variables, describing how to set the
|
||||||
# run time search path of shared libraries in an executable.
|
# run time search path of shared libraries in an executable.
|
||||||
#
|
#
|
||||||
# Copyright 1996-2014 Free Software Foundation, Inc.
|
# Copyright 1996-2016 Free Software Foundation, Inc.
|
||||||
# Taken from GNU libtool, 2001
|
# Taken from GNU libtool, 2001
|
||||||
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
||||||
#
|
#
|
||||||
|
@ -367,11 +367,7 @@ else
|
||||||
dgux*)
|
dgux*)
|
||||||
hardcode_libdir_flag_spec='-L$libdir'
|
hardcode_libdir_flag_spec='-L$libdir'
|
||||||
;;
|
;;
|
||||||
freebsd2.2*)
|
freebsd2.[01]*)
|
||||||
hardcode_libdir_flag_spec='-R$libdir'
|
|
||||||
hardcode_direct=yes
|
|
||||||
;;
|
|
||||||
freebsd2*)
|
|
||||||
hardcode_direct=yes
|
hardcode_direct=yes
|
||||||
hardcode_minus_L=yes
|
hardcode_minus_L=yes
|
||||||
;;
|
;;
|
||||||
|
@ -548,13 +544,11 @@ case "$host_os" in
|
||||||
dgux*)
|
dgux*)
|
||||||
library_names_spec='$libname$shrext'
|
library_names_spec='$libname$shrext'
|
||||||
;;
|
;;
|
||||||
|
freebsd[23].*)
|
||||||
|
library_names_spec='$libname$shrext$versuffix'
|
||||||
|
;;
|
||||||
freebsd* | dragonfly*)
|
freebsd* | dragonfly*)
|
||||||
case "$host_os" in
|
library_names_spec='$libname$shrext'
|
||||||
freebsd[123]*)
|
|
||||||
library_names_spec='$libname$shrext$versuffix' ;;
|
|
||||||
*)
|
|
||||||
library_names_spec='$libname$shrext' ;;
|
|
||||||
esac
|
|
||||||
;;
|
;;
|
||||||
gnu*)
|
gnu*)
|
||||||
library_names_spec='$libname$shrext'
|
library_names_spec='$libname$shrext'
|
||||||
|
|
|
@ -2,10 +2,9 @@
|
||||||
# gendocs.sh -- generate a GNU manual in many formats. This script is
|
# gendocs.sh -- generate a GNU manual in many formats. This script is
|
||||||
# mentioned in maintain.texi. See the help message below for usage details.
|
# mentioned in maintain.texi. See the help message below for usage details.
|
||||||
|
|
||||||
scriptversion=2013-10-10.09
|
scriptversion=2016-05-20.09
|
||||||
|
|
||||||
# Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
|
# Copyright 2003-2016 Free Software Foundation, Inc.
|
||||||
# Free Software Foundation, Inc.
|
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -21,17 +20,16 @@ scriptversion=2013-10-10.09
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
# Original author: Mohit Agarwal.
|
# Original author: Mohit Agarwal.
|
||||||
# Send bug reports and any other correspondence to bug-texinfo@gnu.org.
|
# Send bug reports and any other correspondence to bug-gnulib@gnu.org.
|
||||||
#
|
#
|
||||||
# The latest version of this script, and the companion template, is
|
# The latest version of this script, and the companion template, is
|
||||||
# available from Texinfo CVS:
|
# available from the Gnulib repository:
|
||||||
# http://savannah.gnu.org/cgi-bin/viewcvs/texinfo/texinfo/util/gendocs.sh
|
|
||||||
# http://savannah.gnu.org/cgi-bin/viewcvs/texinfo/texinfo/util/gendocs_template
|
|
||||||
#
|
#
|
||||||
# An up-to-date copy is also maintained in Gnulib (gnu.org/software/gnulib).
|
# http://git.savannah.gnu.org/cgit/gnulib.git/tree/build-aux/gendocs.sh
|
||||||
|
# http://git.savannah.gnu.org/cgit/gnulib.git/tree/doc/gendocs_template
|
||||||
|
|
||||||
# TODO:
|
# TODO:
|
||||||
# - image importation was only implemented for HTML generated by
|
# - image importing was only implemented for HTML generated by
|
||||||
# makeinfo. But it should be simple enough to adjust.
|
# makeinfo. But it should be simple enough to adjust.
|
||||||
# - images are not imported in the source tarball. All the needed
|
# - images are not imported in the source tarball. All the needed
|
||||||
# formats (PDF, PNG, etc.) should be included.
|
# formats (PDF, PNG, etc.) should be included.
|
||||||
|
@ -39,12 +37,12 @@ scriptversion=2013-10-10.09
|
||||||
prog=`basename "$0"`
|
prog=`basename "$0"`
|
||||||
srcdir=`pwd`
|
srcdir=`pwd`
|
||||||
|
|
||||||
scripturl="http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/texinfo/texinfo/util/gendocs.sh"
|
scripturl="http://git.savannah.gnu.org/cgit/gnulib.git/plain/build-aux/gendocs.sh"
|
||||||
templateurl="http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/texinfo/texinfo/util/gendocs_template"
|
templateurl="http://git.savannah.gnu.org/cgit/gnulib.git/plain/doc/gendocs_template"
|
||||||
|
|
||||||
: ${SETLANG="env LANG= LC_MESSAGES= LC_ALL= LANGUAGE="}
|
: ${SETLANG="env LANG= LC_MESSAGES= LC_ALL= LANGUAGE="}
|
||||||
: ${MAKEINFO="makeinfo"}
|
: ${MAKEINFO="makeinfo"}
|
||||||
: ${TEXI2DVI="texi2dvi -t @finalout"}
|
: ${TEXI2DVI="texi2dvi"}
|
||||||
: ${DOCBOOK2HTML="docbook2html"}
|
: ${DOCBOOK2HTML="docbook2html"}
|
||||||
: ${DOCBOOK2PDF="docbook2pdf"}
|
: ${DOCBOOK2PDF="docbook2pdf"}
|
||||||
: ${DOCBOOK2TXT="docbook2txt"}
|
: ${DOCBOOK2TXT="docbook2txt"}
|
||||||
|
@ -54,9 +52,27 @@ templateurl="http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/texinfo/texinfo/
|
||||||
unset CDPATH
|
unset CDPATH
|
||||||
unset use_texi2html
|
unset use_texi2html
|
||||||
|
|
||||||
|
MANUAL_TITLE=
|
||||||
|
PACKAGE=
|
||||||
|
EMAIL=webmasters@gnu.org # please override with --email
|
||||||
|
commonarg= # passed to all makeinfo/texi2html invcations.
|
||||||
|
dirargs= # passed to all tools (-I dir).
|
||||||
|
dirs= # -I directories.
|
||||||
|
htmlarg="--css-ref=/software/gnulib/manual.css -c TOP_NODE_UP_URL=/manual"
|
||||||
|
infoarg=--no-split
|
||||||
|
generate_ascii=true
|
||||||
|
generate_html=true
|
||||||
|
generate_info=true
|
||||||
|
generate_tex=true
|
||||||
|
outdir=manual
|
||||||
|
source_extra=
|
||||||
|
split=node
|
||||||
|
srcfile=
|
||||||
|
texarg="-t @finalout"
|
||||||
|
|
||||||
version="gendocs.sh $scriptversion
|
version="gendocs.sh $scriptversion
|
||||||
|
|
||||||
Copyright 2013 Free Software Foundation, Inc.
|
Copyright 2016 Free Software Foundation, Inc.
|
||||||
There is NO warranty. You may redistribute this software
|
There is NO warranty. You may redistribute this software
|
||||||
under the terms of the GNU General Public License.
|
under the terms of the GNU General Public License.
|
||||||
For more information about these matters, see the files named COPYING."
|
For more information about these matters, see the files named COPYING."
|
||||||
|
@ -75,11 +91,16 @@ Options:
|
||||||
-o OUTDIR write files into OUTDIR, instead of manual/.
|
-o OUTDIR write files into OUTDIR, instead of manual/.
|
||||||
-I DIR append DIR to the Texinfo search path.
|
-I DIR append DIR to the Texinfo search path.
|
||||||
--common ARG pass ARG in all invocations.
|
--common ARG pass ARG in all invocations.
|
||||||
--html ARG pass ARG to makeinfo or texi2html for HTML targets.
|
--html ARG pass ARG to makeinfo or texi2html for HTML targets,
|
||||||
|
instead of '$htmlarg'.
|
||||||
--info ARG pass ARG to makeinfo for Info, instead of --no-split.
|
--info ARG pass ARG to makeinfo for Info, instead of --no-split.
|
||||||
--no-ascii skip generating the plain text output.
|
--no-ascii skip generating the plain text output.
|
||||||
|
--no-html skip generating the html output.
|
||||||
|
--no-info skip generating the info output.
|
||||||
|
--no-tex skip generating the dvi and pdf output.
|
||||||
--source ARG include ARG in tar archive of sources.
|
--source ARG include ARG in tar archive of sources.
|
||||||
--split HOW make split HTML by node, section, chapter; default node.
|
--split HOW make split HTML by node, section, chapter; default node.
|
||||||
|
--tex ARG pass ARG to texi2dvi for DVI and PDF, instead of -t @finalout.
|
||||||
|
|
||||||
--texi2html use texi2html to make HTML target, with all split versions.
|
--texi2html use texi2html to make HTML target, with all split versions.
|
||||||
--docbook convert through DocBook too (xml, txt, html, pdf).
|
--docbook convert through DocBook too (xml, txt, html, pdf).
|
||||||
|
@ -131,23 +152,9 @@ locale, since that's the language of most Texinfo manuals. If you
|
||||||
happen to have a non-English manual and non-English web site, see the
|
happen to have a non-English manual and non-English web site, see the
|
||||||
SETLANG setting in the source.
|
SETLANG setting in the source.
|
||||||
|
|
||||||
Email bug reports or enhancement requests to bug-texinfo@gnu.org.
|
Email bug reports or enhancement requests to bug-gnulib@gnu.org.
|
||||||
"
|
"
|
||||||
|
|
||||||
MANUAL_TITLE=
|
|
||||||
PACKAGE=
|
|
||||||
EMAIL=webmasters@gnu.org # please override with --email
|
|
||||||
commonarg= # passed to all makeinfo/texi2html invcations.
|
|
||||||
dirargs= # passed to all tools (-I dir).
|
|
||||||
dirs= # -I's directories.
|
|
||||||
htmlarg=
|
|
||||||
infoarg=--no-split
|
|
||||||
generate_ascii=true
|
|
||||||
outdir=manual
|
|
||||||
source_extra=
|
|
||||||
split=node
|
|
||||||
srcfile=
|
|
||||||
|
|
||||||
while test $# -gt 0; do
|
while test $# -gt 0; do
|
||||||
case $1 in
|
case $1 in
|
||||||
-s) shift; srcfile=$1;;
|
-s) shift; srcfile=$1;;
|
||||||
|
@ -159,8 +166,12 @@ while test $# -gt 0; do
|
||||||
--html) shift; htmlarg=$1;;
|
--html) shift; htmlarg=$1;;
|
||||||
--info) shift; infoarg=$1;;
|
--info) shift; infoarg=$1;;
|
||||||
--no-ascii) generate_ascii=false;;
|
--no-ascii) generate_ascii=false;;
|
||||||
|
--no-html) generate_ascii=false;;
|
||||||
|
--no-info) generate_info=false;;
|
||||||
|
--no-tex) generate_tex=false;;
|
||||||
--source) shift; source_extra=$1;;
|
--source) shift; source_extra=$1;;
|
||||||
--split) shift; split=$1;;
|
--split) shift; split=$1;;
|
||||||
|
--tex) shift; texarg=$1;;
|
||||||
--texi2html) use_texi2html=1;;
|
--texi2html) use_texi2html=1;;
|
||||||
|
|
||||||
--help) echo "$usage"; exit 0;;
|
--help) echo "$usage"; exit 0;;
|
||||||
|
@ -221,8 +232,9 @@ calcsize()
|
||||||
|
|
||||||
# copy_images OUTDIR HTML-FILE...
|
# copy_images OUTDIR HTML-FILE...
|
||||||
# -------------------------------
|
# -------------------------------
|
||||||
# Copy all the images needed by the HTML-FILEs into OUTDIR. Look
|
# Copy all the images needed by the HTML-FILEs into OUTDIR.
|
||||||
# for them in the -I directories.
|
# Look for them in . and the -I directories; this is simpler than what
|
||||||
|
# makeinfo supports with -I, but hopefully it will suffice.
|
||||||
copy_images()
|
copy_images()
|
||||||
{
|
{
|
||||||
local odir
|
local odir
|
||||||
|
@ -232,7 +244,7 @@ copy_images()
|
||||||
BEGIN {
|
BEGIN {
|
||||||
\$me = '$prog';
|
\$me = '$prog';
|
||||||
\$odir = '$odir';
|
\$odir = '$odir';
|
||||||
@dirs = qw($dirs);
|
@dirs = qw(. $dirs);
|
||||||
}
|
}
|
||||||
" -e '
|
" -e '
|
||||||
/<img src="(.*?)"/g && ++$need{$1};
|
/<img src="(.*?)"/g && ++$need{$1};
|
||||||
|
@ -270,32 +282,39 @@ echo "Making output for $srcfile"
|
||||||
echo " in `pwd`"
|
echo " in `pwd`"
|
||||||
mkdir -p "$outdir/"
|
mkdir -p "$outdir/"
|
||||||
|
|
||||||
cmd="$SETLANG $MAKEINFO -o $PACKAGE.info $commonarg $infoarg \"$srcfile\""
|
#
|
||||||
echo "Generating info... ($cmd)"
|
if $generate_info; then
|
||||||
rm -f $PACKAGE.info* # get rid of any strays
|
cmd="$SETLANG $MAKEINFO -o $PACKAGE.info $commonarg $infoarg \"$srcfile\""
|
||||||
eval "$cmd"
|
echo "Generating info... ($cmd)"
|
||||||
tar czf "$outdir/$PACKAGE.info.tar.gz" $PACKAGE.info*
|
rm -f $PACKAGE.info* # get rid of any strays
|
||||||
ls -l "$outdir/$PACKAGE.info.tar.gz"
|
eval "$cmd"
|
||||||
info_tgz_size=`calcsize "$outdir/$PACKAGE.info.tar.gz"`
|
tar czf "$outdir/$PACKAGE.info.tar.gz" $PACKAGE.info*
|
||||||
# do not mv the info files, there's no point in having them available
|
ls -l "$outdir/$PACKAGE.info.tar.gz"
|
||||||
# separately on the web.
|
info_tgz_size=`calcsize "$outdir/$PACKAGE.info.tar.gz"`
|
||||||
|
# do not mv the info files, there's no point in having them available
|
||||||
|
# separately on the web.
|
||||||
|
fi # end info
|
||||||
|
|
||||||
cmd="$SETLANG $TEXI2DVI $dirargs \"$srcfile\""
|
#
|
||||||
printf "\nGenerating dvi... ($cmd)\n"
|
if $generate_tex; then
|
||||||
eval "$cmd"
|
cmd="$SETLANG $TEXI2DVI $dirargs $texarg \"$srcfile\""
|
||||||
# compress/finish dvi:
|
printf "\nGenerating dvi... ($cmd)\n"
|
||||||
gzip -f -9 $PACKAGE.dvi
|
eval "$cmd"
|
||||||
dvi_gz_size=`calcsize $PACKAGE.dvi.gz`
|
# compress/finish dvi:
|
||||||
mv $PACKAGE.dvi.gz "$outdir/"
|
gzip -f -9 $PACKAGE.dvi
|
||||||
ls -l "$outdir/$PACKAGE.dvi.gz"
|
dvi_gz_size=`calcsize $PACKAGE.dvi.gz`
|
||||||
|
mv $PACKAGE.dvi.gz "$outdir/"
|
||||||
|
ls -l "$outdir/$PACKAGE.dvi.gz"
|
||||||
|
|
||||||
cmd="$SETLANG $TEXI2DVI --pdf $dirargs \"$srcfile\""
|
cmd="$SETLANG $TEXI2DVI --pdf $dirargs $texarg \"$srcfile\""
|
||||||
printf "\nGenerating pdf... ($cmd)\n"
|
printf "\nGenerating pdf... ($cmd)\n"
|
||||||
eval "$cmd"
|
eval "$cmd"
|
||||||
pdf_size=`calcsize $PACKAGE.pdf`
|
pdf_size=`calcsize $PACKAGE.pdf`
|
||||||
mv $PACKAGE.pdf "$outdir/"
|
mv $PACKAGE.pdf "$outdir/"
|
||||||
ls -l "$outdir/$PACKAGE.pdf"
|
ls -l "$outdir/$PACKAGE.pdf"
|
||||||
|
fi # end tex (dvi + pdf)
|
||||||
|
|
||||||
|
#
|
||||||
if $generate_ascii; then
|
if $generate_ascii; then
|
||||||
opt="-o $PACKAGE.txt --no-split --no-headers $commonarg"
|
opt="-o $PACKAGE.txt --no-split --no-headers $commonarg"
|
||||||
cmd="$SETLANG $MAKEINFO $opt \"$srcfile\""
|
cmd="$SETLANG $MAKEINFO $opt \"$srcfile\""
|
||||||
|
@ -308,6 +327,9 @@ if $generate_ascii; then
|
||||||
ls -l "$outdir/$PACKAGE.txt" "$outdir/$PACKAGE.txt.gz"
|
ls -l "$outdir/$PACKAGE.txt" "$outdir/$PACKAGE.txt.gz"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
|
||||||
|
if $generate_html; then
|
||||||
# Split HTML at level $1. Used for texi2html.
|
# Split HTML at level $1. Used for texi2html.
|
||||||
html_split()
|
html_split()
|
||||||
{
|
{
|
||||||
|
@ -382,7 +404,9 @@ else # use texi2html:
|
||||||
html_split chapter
|
html_split chapter
|
||||||
html_split section
|
html_split section
|
||||||
fi
|
fi
|
||||||
|
fi # end html
|
||||||
|
|
||||||
|
#
|
||||||
printf "\nMaking .tar.gz for sources...\n"
|
printf "\nMaking .tar.gz for sources...\n"
|
||||||
d=`dirname $srcfile`
|
d=`dirname $srcfile`
|
||||||
(
|
(
|
||||||
|
@ -393,6 +417,8 @@ d=`dirname $srcfile`
|
||||||
)
|
)
|
||||||
texi_tgz_size=`calcsize "$outdir/$PACKAGE.texi.tar.gz"`
|
texi_tgz_size=`calcsize "$outdir/$PACKAGE.texi.tar.gz"`
|
||||||
|
|
||||||
|
#
|
||||||
|
# Do everything again through docbook.
|
||||||
if test -n "$docbook"; then
|
if test -n "$docbook"; then
|
||||||
opt="-o - --docbook $commonarg"
|
opt="-o - --docbook $commonarg"
|
||||||
cmd="$SETLANG $MAKEINFO $opt \"$srcfile\" >${srcdir}/$PACKAGE-db.xml"
|
cmd="$SETLANG $MAKEINFO $opt \"$srcfile\" >${srcdir}/$PACKAGE-db.xml"
|
||||||
|
@ -431,7 +457,8 @@ if test -n "$docbook"; then
|
||||||
mv $PACKAGE-db.pdf "$outdir/"
|
mv $PACKAGE-db.pdf "$outdir/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "\nMaking index file...\n"
|
#
|
||||||
|
printf "\nMaking index.html for $PACKAGE...\n"
|
||||||
if test -z "$use_texi2html"; then
|
if test -z "$use_texi2html"; then
|
||||||
CONDS="/%%IF *HTML_SECTION%%/,/%%ENDIF *HTML_SECTION%%/d;\
|
CONDS="/%%IF *HTML_SECTION%%/,/%%ENDIF *HTML_SECTION%%/d;\
|
||||||
/%%IF *HTML_CHAPTER%%/,/%%ENDIF *HTML_CHAPTER%%/d"
|
/%%IF *HTML_CHAPTER%%/,/%%ENDIF *HTML_CHAPTER%%/d"
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Print a version string.
|
# Print a version string.
|
||||||
scriptversion=2012-12-31.23; # UTC
|
scriptversion=2016-05-08.18; # UTC
|
||||||
|
|
||||||
# Copyright (C) 2007-2014 Free Software Foundation, Inc.
|
# Copyright (C) 2007-2016 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -85,9 +85,10 @@ Print a version string.
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
|
|
||||||
--prefix prefix of git tags (default 'v')
|
--prefix PREFIX prefix of git tags (default 'v')
|
||||||
--match pattern for git tags to match (default: '\$prefix*')
|
--match pattern for git tags to match (default: '\$prefix*')
|
||||||
--fallback fallback version to use if \"git --version\" fails
|
--fallback VERSION
|
||||||
|
fallback version to use if \"git --version\" fails
|
||||||
|
|
||||||
--help display this help and exit
|
--help display this help and exit
|
||||||
--version output version information and exit
|
--version output version information and exit
|
||||||
|
@ -104,9 +105,9 @@ while test $# -gt 0; do
|
||||||
case $1 in
|
case $1 in
|
||||||
--help) echo "$usage"; exit 0;;
|
--help) echo "$usage"; exit 0;;
|
||||||
--version) echo "$version"; exit 0;;
|
--version) echo "$version"; exit 0;;
|
||||||
--prefix) shift; prefix="$1";;
|
--prefix) shift; prefix=${1?};;
|
||||||
--match) shift; match="$1";;
|
--match) shift; match="$1";;
|
||||||
--fallback) shift; fallback="$1";;
|
--fallback) shift; fallback=${1?};;
|
||||||
-*)
|
-*)
|
||||||
echo "$0: Unknown option '$1'." >&2
|
echo "$0: Unknown option '$1'." >&2
|
||||||
echo "$0: Try '--help' for more information." >&2
|
echo "$0: Try '--help' for more information." >&2
|
||||||
|
@ -220,12 +221,12 @@ if test "x$v_from_git" != x; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Omit the trailing newline, so that m4_esyscmd can use the result directly.
|
# Omit the trailing newline, so that m4_esyscmd can use the result directly.
|
||||||
echo "$v" | tr -d "$nl"
|
printf %s "$v"
|
||||||
|
|
||||||
# Local variables:
|
# Local variables:
|
||||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
# time-stamp-start: "scriptversion="
|
# time-stamp-start: "scriptversion="
|
||||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
# time-stamp-time-zone: "UTC"
|
# time-stamp-time-zone: "UTC0"
|
||||||
# time-stamp-end: "; # UTC"
|
# time-stamp-end: "; # UTC"
|
||||||
# End:
|
# End:
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}'
|
eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"'
|
||||||
& eval 'exec perl -wS "$0" $argv:q'
|
& eval 'exec perl -wS "$0" $argv:q'
|
||||||
if 0;
|
if 0;
|
||||||
# Convert git log output to ChangeLog format.
|
# Convert git log output to ChangeLog format.
|
||||||
|
|
||||||
my $VERSION = '2012-07-29 06:11'; # UTC
|
my $VERSION = '2016-03-22 21:49'; # UTC
|
||||||
# The definition above must lie within the first 8 lines in order
|
# The definition above must lie within the first 8 lines in order
|
||||||
# for the Emacs time-stamp write hook (at end) to update it.
|
# for the Emacs time-stamp write hook (at end) to update it.
|
||||||
# If you change this file with Emacs, please let the write hook
|
# If you change this file with Emacs, please let the write hook
|
||||||
# do its job. Otherwise, update this string manually.
|
# do its job. Otherwise, update this string manually.
|
||||||
|
|
||||||
# Copyright (C) 2008-2014 Free Software Foundation, Inc.
|
# Copyright (C) 2008-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -72,6 +72,9 @@ OPTIONS:
|
||||||
directory can be derived.
|
directory can be derived.
|
||||||
--since=DATE convert only the logs since DATE;
|
--since=DATE convert only the logs since DATE;
|
||||||
the default is to convert all log entries.
|
the default is to convert all log entries.
|
||||||
|
--until=DATE convert only the logs older than DATE.
|
||||||
|
--ignore-matching=PAT ignore commit messages whose first lines match PAT.
|
||||||
|
--ignore-line=PAT ignore lines of commit messages that match PAT.
|
||||||
--format=FMT set format string for commit subject and body;
|
--format=FMT set format string for commit subject and body;
|
||||||
see 'man git-log' for the list of format metacharacters;
|
see 'man git-log' for the list of format metacharacters;
|
||||||
the default is '%s%n%b%n'
|
the default is '%s%n%b%n'
|
||||||
|
@ -220,10 +223,13 @@ sub git_dir_option($)
|
||||||
|
|
||||||
{
|
{
|
||||||
my $since_date;
|
my $since_date;
|
||||||
|
my $until_date;
|
||||||
my $format_string = '%s%n%b%n';
|
my $format_string = '%s%n%b%n';
|
||||||
my $amend_file;
|
my $amend_file;
|
||||||
my $append_dot = 0;
|
my $append_dot = 0;
|
||||||
my $cluster = 1;
|
my $cluster = 1;
|
||||||
|
my $ignore_matching;
|
||||||
|
my $ignore_line;
|
||||||
my $strip_tab = 0;
|
my $strip_tab = 0;
|
||||||
my $strip_cherry_pick = 0;
|
my $strip_cherry_pick = 0;
|
||||||
my $srcdir;
|
my $srcdir;
|
||||||
|
@ -232,10 +238,13 @@ sub git_dir_option($)
|
||||||
help => sub { usage 0 },
|
help => sub { usage 0 },
|
||||||
version => sub { print "$ME version $VERSION\n"; exit },
|
version => sub { print "$ME version $VERSION\n"; exit },
|
||||||
'since=s' => \$since_date,
|
'since=s' => \$since_date,
|
||||||
|
'until=s' => \$until_date,
|
||||||
'format=s' => \$format_string,
|
'format=s' => \$format_string,
|
||||||
'amend=s' => \$amend_file,
|
'amend=s' => \$amend_file,
|
||||||
'append-dot' => \$append_dot,
|
'append-dot' => \$append_dot,
|
||||||
'cluster!' => \$cluster,
|
'cluster!' => \$cluster,
|
||||||
|
'ignore-matching=s' => \$ignore_matching,
|
||||||
|
'ignore-line=s' => \$ignore_line,
|
||||||
'strip-tab' => \$strip_tab,
|
'strip-tab' => \$strip_tab,
|
||||||
'strip-cherry-pick' => \$strip_cherry_pick,
|
'strip-cherry-pick' => \$strip_cherry_pick,
|
||||||
'srcdir=s' => \$srcdir,
|
'srcdir=s' => \$srcdir,
|
||||||
|
@ -243,6 +252,8 @@ sub git_dir_option($)
|
||||||
|
|
||||||
defined $since_date
|
defined $since_date
|
||||||
and unshift @ARGV, "--since=$since_date";
|
and unshift @ARGV, "--since=$since_date";
|
||||||
|
defined $until_date
|
||||||
|
and unshift @ARGV, "--until=$until_date";
|
||||||
|
|
||||||
# This is a hash that maps an SHA1 to perl code (i.e., s/old/new/)
|
# This is a hash that maps an SHA1 to perl code (i.e., s/old/new/)
|
||||||
# that makes a correction in the log or attribution of that commit.
|
# that makes a correction in the log or attribution of that commit.
|
||||||
|
@ -259,6 +270,7 @@ sub git_dir_option($)
|
||||||
my $prev_multi_paragraph;
|
my $prev_multi_paragraph;
|
||||||
my $prev_date_line = '';
|
my $prev_date_line = '';
|
||||||
my @prev_coauthors = ();
|
my @prev_coauthors = ();
|
||||||
|
my @skipshas = ();
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
defined (my $in = <PIPE>)
|
defined (my $in = <PIPE>)
|
||||||
|
@ -279,6 +291,19 @@ sub git_dir_option($)
|
||||||
$sha =~ /^[0-9a-fA-F]{40}$/
|
$sha =~ /^[0-9a-fA-F]{40}$/
|
||||||
or die "$ME:$.: invalid SHA1: $sha\n";
|
or die "$ME:$.: invalid SHA1: $sha\n";
|
||||||
|
|
||||||
|
my $skipflag = 0;
|
||||||
|
if (@skipshas)
|
||||||
|
{
|
||||||
|
foreach(@skipshas)
|
||||||
|
{
|
||||||
|
if ($sha =~ /^$_/)
|
||||||
|
{
|
||||||
|
$skipflag = $_;
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# If this commit's log requires any transformation, do it now.
|
# If this commit's log requires any transformation, do it now.
|
||||||
my $code = $amend_code->{$sha};
|
my $code = $amend_code->{$sha};
|
||||||
if (defined $code)
|
if (defined $code)
|
||||||
|
@ -306,7 +331,7 @@ sub git_dir_option($)
|
||||||
$rest =~ s/^\s*\(cherry picked from commit [\da-f]+\)\n//m;
|
$rest =~ s/^\s*\(cherry picked from commit [\da-f]+\)\n//m;
|
||||||
}
|
}
|
||||||
|
|
||||||
my @line = split "\n", $rest;
|
my @line = split /[ \t]*\n/, $rest;
|
||||||
my $author_line = shift @line;
|
my $author_line = shift @line;
|
||||||
defined $author_line
|
defined $author_line
|
||||||
or die "$ME:$.: unexpected EOF\n";
|
or die "$ME:$.: unexpected EOF\n";
|
||||||
|
@ -316,17 +341,18 @@ sub git_dir_option($)
|
||||||
|
|
||||||
# Format 'Copyright-paperwork-exempt: Yes' as a standard ChangeLog
|
# Format 'Copyright-paperwork-exempt: Yes' as a standard ChangeLog
|
||||||
# `(tiny change)' annotation.
|
# `(tiny change)' annotation.
|
||||||
my $tiny = (grep (/^Copyright-paperwork-exempt:\s+[Yy]es$/, @line)
|
my $tiny = (grep (/^(?:Copyright-paperwork-exempt|Tiny-change):\s+[Yy]es$/, @line)
|
||||||
? ' (tiny change)' : '');
|
? ' (tiny change)' : '');
|
||||||
|
|
||||||
my $date_line = sprintf "%s %s$tiny\n",
|
my $date_line = sprintf "%s %s$tiny\n",
|
||||||
strftime ("%F", localtime ($1)), $2;
|
strftime ("%Y-%m-%d", localtime ($1)), $2;
|
||||||
|
|
||||||
my @coauthors = grep /^Co-authored-by:.*$/, @line;
|
my @coauthors = grep /^Co-authored-by:.*$/, @line;
|
||||||
# Omit meta-data lines we've already interpreted.
|
# Omit meta-data lines we've already interpreted.
|
||||||
@line = grep !/^(?:Signed-off-by:[ ].*>$
|
@line = grep !/^(?:Signed-off-by:[ ].*>$
|
||||||
|Co-authored-by:[ ]
|
|Co-authored-by:[ ]
|
||||||
|Copyright-paperwork-exempt:[ ]
|
|Copyright-paperwork-exempt:[ ]
|
||||||
|
|Tiny-change:[ ]
|
||||||
)/x, @line;
|
)/x, @line;
|
||||||
|
|
||||||
# Remove leading and trailing blank lines.
|
# Remove leading and trailing blank lines.
|
||||||
|
@ -336,68 +362,109 @@ sub git_dir_option($)
|
||||||
while ($line[$#line] =~ /^\s*$/) { pop @line; }
|
while ($line[$#line] =~ /^\s*$/) { pop @line; }
|
||||||
}
|
}
|
||||||
|
|
||||||
# Record whether there are two or more paragraphs.
|
# Handle Emacs gitmerge.el "skipped" commits.
|
||||||
my $multi_paragraph = grep /^\s*$/, @line;
|
# Yes, this should be controlled by an option. So sue me.
|
||||||
|
if ( grep /^(; )?Merge from /, @line )
|
||||||
|
{
|
||||||
|
my $found = 0;
|
||||||
|
foreach (@line)
|
||||||
|
{
|
||||||
|
if (grep /^The following commit.*skipped:$/, $_)
|
||||||
|
{
|
||||||
|
$found = 1;
|
||||||
|
## Reset at each merge to reduce chance of false matches.
|
||||||
|
@skipshas = ();
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
if ($found && $_ =~ /^([0-9a-fA-F]{7,}) [^ ]/)
|
||||||
|
{
|
||||||
|
push ( @skipshas, $1 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Format 'Co-authored-by: A U Thor <email@example.com>' lines in
|
# Ignore commits that match the --ignore-matching pattern, if specified.
|
||||||
# standard multi-author ChangeLog format.
|
if (defined $ignore_matching && @line && $line[0] =~ /$ignore_matching/)
|
||||||
for (@coauthors)
|
|
||||||
{
|
{
|
||||||
s/^Co-authored-by:\s*/\t /;
|
$skipflag = 1;
|
||||||
s/\s*</ </;
|
}
|
||||||
|
elsif ($skipflag)
|
||||||
/<.*?@.*\..*>/
|
{
|
||||||
or warn "$ME: warning: missing email address for "
|
## Perhaps only warn if a pattern matches more than once?
|
||||||
. substr ($_, 5) . "\n";
|
warn "$ME: warning: skipping $sha due to $skipflag\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
# If clustering of commit messages has been disabled, if this header
|
if (! $skipflag)
|
||||||
# would be different from the previous date/name/email/coauthors header,
|
|
||||||
# or if this or the previous entry consists of two or more paragraphs,
|
|
||||||
# then print the header.
|
|
||||||
if ( ! $cluster
|
|
||||||
|| $date_line ne $prev_date_line
|
|
||||||
|| "@coauthors" ne "@prev_coauthors"
|
|
||||||
|| $multi_paragraph
|
|
||||||
|| $prev_multi_paragraph)
|
|
||||||
{
|
{
|
||||||
$prev_date_line eq ''
|
if (defined $ignore_line && @line)
|
||||||
or print "\n";
|
|
||||||
print $date_line;
|
|
||||||
@coauthors
|
|
||||||
and print join ("\n", @coauthors), "\n";
|
|
||||||
}
|
|
||||||
$prev_date_line = $date_line;
|
|
||||||
@prev_coauthors = @coauthors;
|
|
||||||
$prev_multi_paragraph = $multi_paragraph;
|
|
||||||
|
|
||||||
# If there were any lines
|
|
||||||
if (@line == 0)
|
|
||||||
{
|
|
||||||
warn "$ME: warning: empty commit message:\n $date_line\n";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ($append_dot)
|
|
||||||
{
|
{
|
||||||
# If the first line of the message has enough room, then
|
@line = grep ! /$ignore_line/, @line;
|
||||||
if (length $line[0] < 72)
|
while ($line[$#line] =~ /^\s*$/) { pop @line; }
|
||||||
{
|
|
||||||
# append a dot if there is no other punctuation or blank
|
|
||||||
# at the end.
|
|
||||||
$line[0] =~ /[[:punct:]\s]$/
|
|
||||||
or $line[0] .= '.';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Remove one additional leading TAB from each line.
|
# Record whether there are two or more paragraphs.
|
||||||
$strip_tab
|
my $multi_paragraph = grep /^\s*$/, @line;
|
||||||
and map { s/^\t// } @line;
|
|
||||||
|
|
||||||
# Prefix each non-empty line with a TAB.
|
# Format 'Co-authored-by: A U Thor <email@example.com>' lines in
|
||||||
@line = map { length $_ ? "\t$_" : '' } @line;
|
# standard multi-author ChangeLog format.
|
||||||
|
for (@coauthors)
|
||||||
|
{
|
||||||
|
s/^Co-authored-by:\s*/\t /;
|
||||||
|
s/\s*</ </;
|
||||||
|
|
||||||
print "\n", join ("\n", @line), "\n";
|
/<.*?@.*\..*>/
|
||||||
|
or warn "$ME: warning: missing email address for "
|
||||||
|
. substr ($_, 5) . "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
# If clustering of commit messages has been disabled, if this header
|
||||||
|
# would be different from the previous date/name/etc. header,
|
||||||
|
# or if this or the previous entry consists of two or more paragraphs,
|
||||||
|
# then print the header.
|
||||||
|
if ( ! $cluster
|
||||||
|
|| $date_line ne $prev_date_line
|
||||||
|
|| "@coauthors" ne "@prev_coauthors"
|
||||||
|
|| $multi_paragraph
|
||||||
|
|| $prev_multi_paragraph)
|
||||||
|
{
|
||||||
|
$prev_date_line eq ''
|
||||||
|
or print "\n";
|
||||||
|
print $date_line;
|
||||||
|
@coauthors
|
||||||
|
and print join ("\n", @coauthors), "\n";
|
||||||
|
}
|
||||||
|
$prev_date_line = $date_line;
|
||||||
|
@prev_coauthors = @coauthors;
|
||||||
|
$prev_multi_paragraph = $multi_paragraph;
|
||||||
|
|
||||||
|
# If there were any lines
|
||||||
|
if (@line == 0)
|
||||||
|
{
|
||||||
|
warn "$ME: warning: empty commit message:\n $date_line\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($append_dot)
|
||||||
|
{
|
||||||
|
# If the first line of the message has enough room, then
|
||||||
|
if (length $line[0] < 72)
|
||||||
|
{
|
||||||
|
# append a dot if there is no other punctuation or blank
|
||||||
|
# at the end.
|
||||||
|
$line[0] =~ /[[:punct:]\s]$/
|
||||||
|
or $line[0] .= '.';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Remove one additional leading TAB from each line.
|
||||||
|
$strip_tab
|
||||||
|
and map { s/^\t// } @line;
|
||||||
|
|
||||||
|
# Prefix each non-empty line with a TAB.
|
||||||
|
@line = map { length $_ ? "\t$_" : '' } @line;
|
||||||
|
|
||||||
|
print "\n", join ("\n", @line), "\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
defined ($in = <PIPE>)
|
defined ($in = <PIPE>)
|
||||||
|
@ -427,6 +494,6 @@ sub git_dir_option($)
|
||||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
# time-stamp-start: "my $VERSION = '"
|
# time-stamp-start: "my $VERSION = '"
|
||||||
# time-stamp-format: "%:y-%02m-%02d %02H:%02M"
|
# time-stamp-format: "%:y-%02m-%02d %02H:%02M"
|
||||||
# time-stamp-time-zone: "UTC"
|
# time-stamp-time-zone: "UTC0"
|
||||||
# time-stamp-end: "'; # UTC"
|
# time-stamp-end: "'; # UTC"
|
||||||
# End:
|
# End:
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
# Run this after each non-alpha release, to update the web documentation at
|
# Run this after each non-alpha release, to update the web documentation at
|
||||||
# http://www.gnu.org/software/$pkg/manual/
|
# http://www.gnu.org/software/$pkg/manual/
|
||||||
|
|
||||||
VERSION=2012-12-16.14; # UTC
|
VERSION=2016-01-12.23; # UTC
|
||||||
|
|
||||||
# Copyright (C) 2009-2014 Free Software Foundation, Inc.
|
# Copyright (C) 2009-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -40,6 +40,7 @@ assumes all documentation is in the doc/ sub-directory.
|
||||||
Options:
|
Options:
|
||||||
-C, --builddir=DIR location of (configured) Makefile (default: .)
|
-C, --builddir=DIR location of (configured) Makefile (default: .)
|
||||||
-n, --dry-run don't actually commit anything
|
-n, --dry-run don't actually commit anything
|
||||||
|
-m, --mirror remove out of date files from document server
|
||||||
--help print this help, then exit
|
--help print this help, then exit
|
||||||
--version print version number, then exit
|
--version print version number, then exit
|
||||||
|
|
||||||
|
@ -107,6 +108,7 @@ find_tool XARGS gxargs xargs
|
||||||
|
|
||||||
builddir=.
|
builddir=.
|
||||||
dryrun=
|
dryrun=
|
||||||
|
rm_stale='echo'
|
||||||
while test $# != 0
|
while test $# != 0
|
||||||
do
|
do
|
||||||
# Handle --option=value by splitting apart and putting back on argv.
|
# Handle --option=value by splitting apart and putting back on argv.
|
||||||
|
@ -115,7 +117,7 @@ do
|
||||||
opt=$(echo "$1" | sed -e 's/=.*//')
|
opt=$(echo "$1" | sed -e 's/=.*//')
|
||||||
val=$(echo "$1" | sed -e 's/[^=]*=//')
|
val=$(echo "$1" | sed -e 's/[^=]*=//')
|
||||||
shift
|
shift
|
||||||
set dummy "$opt" "$val" ${1+"$@"}; shift
|
set dummy "$opt" "$val" "$@"; shift
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
@ -123,6 +125,7 @@ do
|
||||||
--help|--version) ${1#--};;
|
--help|--version) ${1#--};;
|
||||||
-C|--builddir) shift; builddir=$1; shift ;;
|
-C|--builddir) shift; builddir=$1; shift ;;
|
||||||
-n|--dry-run) dryrun=echo; shift;;
|
-n|--dry-run) dryrun=echo; shift;;
|
||||||
|
-m|--mirror) rm_stale=''; shift;;
|
||||||
--*) die "unrecognized option: $1";;
|
--*) die "unrecognized option: $1";;
|
||||||
*) break;;
|
*) break;;
|
||||||
esac
|
esac
|
||||||
|
@ -159,6 +162,7 @@ $GIT submodule update --recursive
|
||||||
./bootstrap
|
./bootstrap
|
||||||
srcdir=$(pwd)
|
srcdir=$(pwd)
|
||||||
cd "$builddir"
|
cd "$builddir"
|
||||||
|
builddir=$(pwd)
|
||||||
./config.status --recheck
|
./config.status --recheck
|
||||||
./config.status
|
./config.status
|
||||||
make
|
make
|
||||||
|
@ -175,13 +179,25 @@ $RSYNC -avP "$builddir"/doc/manual/ $tmp/$pkg/manual
|
||||||
cd $tmp/$pkg/manual
|
cd $tmp/$pkg/manual
|
||||||
|
|
||||||
# Add all the files. This is simpler than trying to add only the
|
# Add all the files. This is simpler than trying to add only the
|
||||||
# new ones because of new directories: it would require iterating on
|
# new ones because of new directories
|
||||||
# adding the outer directories, and then their contents.
|
# First add non empty dirs individually
|
||||||
#
|
find . -name CVS -prune -o -type d \! -empty -print \
|
||||||
# find guarantees that we add outer directories first.
|
| $XARGS -n1 --no-run-if-empty -- $dryrun $CVS add -ko
|
||||||
find . -name CVS -prune -o -print \
|
# Now add all files
|
||||||
|
find . -name CVS -prune -o -type f -print \
|
||||||
| $XARGS --no-run-if-empty -- $dryrun $CVS add -ko
|
| $XARGS --no-run-if-empty -- $dryrun $CVS add -ko
|
||||||
|
|
||||||
|
# Report/Remove stale files
|
||||||
|
# excluding doc server specific files like CVS/* and .symlinks
|
||||||
|
if test -n "$rm_stale"; then
|
||||||
|
echo 'Consider the --mirror option if all of the manual is generated,' >&2
|
||||||
|
echo 'which will run `cvs remove` to remove stale files.' >&2
|
||||||
|
fi
|
||||||
|
{ find . \( -name CVS -o -type f -name '.*' \) -prune -o -type f -print
|
||||||
|
(cd "$builddir"/doc/manual/ && find . -type f -print | sed p)
|
||||||
|
} | sort | uniq -u \
|
||||||
|
| $XARGS --no-run-if-empty -- ${rm_stale:-$dryrun} $CVS remove -f
|
||||||
|
|
||||||
$dryrun $CVS ci -m $version
|
$dryrun $CVS ci -m $version
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -189,6 +205,6 @@ $RSYNC -avP "$builddir"/doc/manual/ $tmp/$pkg/manual
|
||||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
# time-stamp-start: "VERSION="
|
# time-stamp-start: "VERSION="
|
||||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
# time-stamp-time-zone: "UTC"
|
# time-stamp-time-zone: "UTC0"
|
||||||
# time-stamp-end: "; # UTC"
|
# time-stamp-end: "; # UTC"
|
||||||
# End:
|
# End:
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Sign files and upload them.
|
# Sign files and upload them.
|
||||||
|
|
||||||
scriptversion=2013-03-19.17; # UTC
|
scriptversion=2016-01-11.22; # UTC
|
||||||
|
|
||||||
# Copyright (C) 2004-2014 Free Software Foundation, Inc.
|
# Copyright (C) 2004-2016 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -435,6 +435,6 @@ exit 0
|
||||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
# time-stamp-start: "scriptversion="
|
# time-stamp-start: "scriptversion="
|
||||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
# time-stamp-time-zone: "UTC"
|
# time-stamp-time-zone: "UTC0"
|
||||||
# time-stamp-end: "; # UTC"
|
# time-stamp-end: "; # UTC"
|
||||||
# End:
|
# End:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* A C macro for declaring that specific arguments must not be NULL.
|
/* A C macro for declaring that specific arguments must not be NULL.
|
||||||
Copyright (C) 2009-2014 Free Software Foundation, Inc.
|
Copyright (C) 2009-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify it
|
This program is free software: you can redistribute it and/or modify it
|
||||||
under the terms of the GNU General Public License as published
|
under the terms of the GNU General Public License as published
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* C++ compatible function declaration macros.
|
/* C++ compatible function declaration macros.
|
||||||
Copyright (C) 2010-2014 Free Software Foundation, Inc.
|
Copyright (C) 2010-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify it
|
This program is free software: you can redistribute it and/or modify it
|
||||||
under the terms of the GNU General Public License as published
|
under the terms of the GNU General Public License as published
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* A C macro for declaring that specific function parameters are not used.
|
/* A C macro for declaring that specific function parameters are not used.
|
||||||
Copyright (C) 2008-2014 Free Software Foundation, Inc.
|
Copyright (C) 2008-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify it
|
This program is free software: you can redistribute it and/or modify it
|
||||||
under the terms of the GNU General Public License as published
|
under the terms of the GNU General Public License as published
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* A C macro for emitting warnings if a function is used.
|
/* A C macro for emitting warnings if a function is used.
|
||||||
Copyright (C) 2010-2014 Free Software Foundation, Inc.
|
Copyright (C) 2010-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify it
|
This program is free software: you can redistribute it and/or modify it
|
||||||
under the terms of the GNU General Public License as published
|
under the terms of the GNU General Public License as published
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
eval '(exit $?0)' && eval 'exec perl -wST "$0" ${1+"$@"}'
|
eval '(exit $?0)' && eval 'exec perl -wST "$0" "$@"'
|
||||||
& eval 'exec perl -wST "$0" $argv:q'
|
& eval 'exec perl -wST "$0" $argv:q'
|
||||||
if 0;
|
if 0;
|
||||||
# Detect instances of "if (p) free (p);".
|
# Detect instances of "if (p) free (p);".
|
||||||
# Likewise "if (p != 0)", "if (0 != p)", or with NULL; and with braces.
|
# Likewise "if (p != 0)", "if (0 != p)", or with NULL; and with braces.
|
||||||
|
|
||||||
my $VERSION = '2012-01-06 07:23'; # UTC
|
my $VERSION = '2016-01-12 23:13'; # UTC
|
||||||
# The definition above must lie within the first 8 lines in order
|
# The definition above must lie within the first 8 lines in order
|
||||||
# for the Emacs time-stamp write hook (at end) to update it.
|
# for the Emacs time-stamp write hook (at end) to update it.
|
||||||
# If you change this file with Emacs, please let the write hook
|
# If you change this file with Emacs, please let the write hook
|
||||||
# do its job. Otherwise, update this string manually.
|
# do its job. Otherwise, update this string manually.
|
||||||
|
|
||||||
# Copyright (C) 2008-2014 Free Software Foundation, Inc.
|
# Copyright (C) 2008-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -202,6 +202,6 @@ EOF
|
||||||
## eval: (add-hook 'write-file-hooks 'time-stamp)
|
## eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
## time-stamp-start: "my $VERSION = '"
|
## time-stamp-start: "my $VERSION = '"
|
||||||
## time-stamp-format: "%:y-%02m-%02d %02H:%02M"
|
## time-stamp-format: "%:y-%02m-%02d %02H:%02M"
|
||||||
## time-stamp-time-zone: "UTC"
|
## time-stamp-time-zone: "UTC0"
|
||||||
## time-stamp-end: "'; # UTC"
|
## time-stamp-end: "'; # UTC"
|
||||||
## End:
|
## End:
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
# List version-controlled file names.
|
# List version-controlled file names.
|
||||||
|
|
||||||
# Print a version string.
|
# Print a version string.
|
||||||
scriptversion=2011-05-16.22; # UTC
|
scriptversion=2016-01-11.22; # UTC
|
||||||
|
|
||||||
# Copyright (C) 2006-2014 Free Software Foundation, Inc.
|
# Copyright (C) 2006-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -108,6 +108,6 @@ done
|
||||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||||
# time-stamp-start: "scriptversion="
|
# time-stamp-start: "scriptversion="
|
||||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||||
# time-stamp-time-zone: "UTC"
|
# time-stamp-time-zone: "UTC0"
|
||||||
# time-stamp-end: "; # UTC"
|
# time-stamp-end: "; # UTC"
|
||||||
# End:
|
# End:
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<!--#include virtual="/server/header.html" -->
|
<!--#include virtual="/server/header.html" -->
|
||||||
<title>%%TITLE%% - GNU Project - Free Software Foundation (FSF)</title>
|
<!-- Parent-Version: 1.77 -->
|
||||||
|
<title>%%TITLE%% - GNU Project - Free Software Foundation</title>
|
||||||
<!--#include virtual="/server/banner.html" -->
|
<!--#include virtual="/server/banner.html" -->
|
||||||
<h2>%%TITLE%%</h2>
|
<h2>%%TITLE%%</h2>
|
||||||
|
|
||||||
|
@ -67,19 +68,22 @@ script</a>.)</p>
|
||||||
</div><!-- for id="content", starts in the include above -->
|
</div><!-- for id="content", starts in the include above -->
|
||||||
<!--#include virtual="/server/footer.html" -->
|
<!--#include virtual="/server/footer.html" -->
|
||||||
<div id="footer">
|
<div id="footer">
|
||||||
|
<div class="unprintable">
|
||||||
|
|
||||||
<p>Please send general FSF & GNU inquiries to
|
<p>Please send general FSF & GNU inquiries to
|
||||||
<a href="mailto:gnu@gnu.org"><gnu@gnu.org></a>.
|
<a href="mailto:gnu@gnu.org"><gnu@gnu.org></a>.
|
||||||
There are also <a href="/contact/">other ways to contact</a>
|
There are also <a href="/contact/">other ways to contact</a>
|
||||||
the FSF.<br />
|
the FSF. Broken links and other corrections or suggestions can be sent
|
||||||
Please send broken links and other corrections or suggestions to
|
to <a href="mailto:%%EMAIL%%"><%%EMAIL%%></a>.</p>
|
||||||
<a href="mailto:%%EMAIL%%"><%%EMAIL%%></a>.</p>
|
</div>
|
||||||
|
|
||||||
<p>Copyright © 2014 Free Software Foundation, Inc.</p>
|
<p>Copyright © 2016 Free Software Foundation, Inc.</p>
|
||||||
|
|
||||||
<p>Verbatim copying and distribution of this entire article are
|
<p>This page is licensed under a <a rel="license"
|
||||||
permitted worldwide, without royalty, in any medium, provided this
|
href="http://creativecommons.org/licenses/by-nd/3.0/us/">Creative
|
||||||
notice, and the copyright notice, are preserved.</p>
|
Commons Attribution-NoDerivs 3.0 United States License</a>.</p>
|
||||||
|
|
||||||
|
<!--#include virtual="/server/bottom-notes.html" -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
93
doc/gendocs_template_min
Normal file
93
doc/gendocs_template_min
Normal file
|
@ -0,0 +1,93 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||||
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title>%%TITLE%% - GNU Project - Free Software Foundation</title>
|
||||||
|
<meta http-equiv="content-type" content='text/html; charset=utf-8' />
|
||||||
|
<link rel="stylesheet" type="text/css" href="/gnu.css" />
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<h3>%%TITLE%%</h3>
|
||||||
|
|
||||||
|
<address>Free Software Foundation</address>
|
||||||
|
<address>last updated %%DATE%%</address>
|
||||||
|
<p>
|
||||||
|
<a href="/graphics/gnu-head.jpg">
|
||||||
|
<img src="/graphics/gnu-head-sm.jpg"
|
||||||
|
alt=" [image of the head of a GNU] " width="129" height="122"/>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
<hr />
|
||||||
|
|
||||||
|
<p>This manual (%%PACKAGE%%) is available in the following formats:</p>
|
||||||
|
|
||||||
|
<ul>
|
||||||
|
<li><a href="%%PACKAGE%%.html">HTML
|
||||||
|
(%%HTML_MONO_SIZE%%K bytes)</a> - entirely on one web page.</li>
|
||||||
|
<li><a href="html_node/index.html">HTML</a> - with one web page per
|
||||||
|
node.</li>
|
||||||
|
%%IF HTML_SECTION%%
|
||||||
|
<li><a href="html_section/index.html">HTML</a> - with one web page per
|
||||||
|
section.</li>
|
||||||
|
%%ENDIF HTML_SECTION%%
|
||||||
|
%%IF HTML_CHAPTER%%
|
||||||
|
<li><a href="html_chapter/index.html">HTML</a> - with one web page per
|
||||||
|
chapter.</li>
|
||||||
|
%%ENDIF HTML_CHAPTER%%
|
||||||
|
<li><a href="%%PACKAGE%%.html.gz">HTML compressed
|
||||||
|
(%%HTML_MONO_GZ_SIZE%%K gzipped characters)</a> - entirely on
|
||||||
|
one web page.</li>
|
||||||
|
<li><a href="%%PACKAGE%%.html_node.tar.gz">HTML compressed
|
||||||
|
(%%HTML_NODE_TGZ_SIZE%%K gzipped tar file)</a> -
|
||||||
|
with one web page per node.</li>
|
||||||
|
%%IF HTML_SECTION%%
|
||||||
|
<li><a href="%%PACKAGE%%.html_section.tar.gz">HTML compressed
|
||||||
|
(%%HTML_SECTION_TGZ_SIZE%%K gzipped tar file)</a> -
|
||||||
|
with one web page per section.</li>
|
||||||
|
%%ENDIF HTML_SECTION%%
|
||||||
|
%%IF HTML_CHAPTER%%
|
||||||
|
<li><a href="%%PACKAGE%%.html_chapter.tar.gz">HTML compressed
|
||||||
|
(%%HTML_CHAPTER_TGZ_SIZE%%K gzipped tar file)</a> -
|
||||||
|
with one web page per chapter.</li>
|
||||||
|
%%ENDIF HTML_CHAPTER%%
|
||||||
|
<li><a href="%%PACKAGE%%.info.tar.gz">Info document
|
||||||
|
(%%INFO_TGZ_SIZE%%K bytes gzipped tar file)</a>.</li>
|
||||||
|
<li><a href="%%PACKAGE%%.txt">ASCII text
|
||||||
|
(%%ASCII_SIZE%%K bytes)</a>.</li>
|
||||||
|
<li><a href="%%PACKAGE%%.txt.gz">ASCII text compressed
|
||||||
|
(%%ASCII_GZ_SIZE%%K bytes gzipped)</a>.</li>
|
||||||
|
<li><a href="%%PACKAGE%%.dvi.gz">TeX dvi file
|
||||||
|
(%%DVI_GZ_SIZE%%K bytes gzipped)</a>.</li>
|
||||||
|
<li><a href="%%PACKAGE%%.pdf">PDF file
|
||||||
|
(%%PDF_SIZE%%K bytes)</a>.</li>
|
||||||
|
<li><a href="%%PACKAGE%%.texi.tar.gz">Texinfo source
|
||||||
|
(%%TEXI_TGZ_SIZE%%K bytes gzipped tar file).</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>(This page generated by the <a href="%%SCRIPTURL%%">%%SCRIPTNAME%%
|
||||||
|
script</a>.)</p>
|
||||||
|
|
||||||
|
<div id="footer" class="copyright">
|
||||||
|
|
||||||
|
<p>Please send general FSF & GNU inquiries to
|
||||||
|
<a href="mailto:gnu@gnu.org"><gnu@gnu.org></a>.
|
||||||
|
There are also <a href="/contact/">other ways to contact</a>
|
||||||
|
the FSF. Broken links and other corrections or suggestions can be sent
|
||||||
|
to <a href="mailto:%%EMAIL%%"><%%EMAIL%%></a>.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p>Copyright © 2016 Free Software Foundation, Inc.</p>
|
||||||
|
|
||||||
|
<p>This page is licensed under a <a rel="license"
|
||||||
|
href="http://creativecommons.org/licenses/by-nd/3.0/us/">Creative
|
||||||
|
Commons Attribution-NoDerivs 3.0 United States License</a>.</p>
|
||||||
|
|
||||||
|
<!--#include virtual="/server/bottom-notes.html" -->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
178
lib/Makefile.am
178
lib/Makefile.am
|
@ -1,6 +1,6 @@
|
||||||
## DO NOT EDIT! GENERATED AUTOMATICALLY!
|
## DO NOT EDIT! GENERATED AUTOMATICALLY!
|
||||||
## Process this file with automake to produce Makefile.in.
|
## Process this file with automake to produce Makefile.in.
|
||||||
# Copyright (C) 2002-2014 Free Software Foundation, Inc.
|
# Copyright (C) 2002-2016 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This file is free software; you can redistribute it and/or modify
|
# This file is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
@ -21,7 +21,7 @@
|
||||||
# the same distribution terms as the rest of that program.
|
# the same distribution terms as the rest of that program.
|
||||||
#
|
#
|
||||||
# Generated by gnulib-tool.
|
# Generated by gnulib-tool.
|
||||||
# Reproduce by: gnulib-tool --import --dir=. --local-dir=gnulib-local --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=lock --lgpl=3 --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alignof alloca-opt announce-gen autobuild bind byteswap c-strcase canonicalize-lgpl ceil clock-time close connect copysign dirfd duplocale environ extensions flock floor fpieee frexp fstat fsync full-read full-write func gendocs getaddrinfo getlogin getpeername getsockname getsockopt git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton isfinite isinf isnan ldexp lib-symbol-versions lib-symbol-visibility libunistring link listen localcharset locale log1p lstat maintainer-makefile malloc-gnu malloca mkdir mkstemp nl_langinfo nproc open pipe-posix pipe2 poll putenv readlink recv recvfrom regex rename rmdir select send sendto setenv setsockopt shutdown socket stat-time stdlib strftime striconveh string sys_stat time times trunc unistd verify vsnprintf warnings wchar
|
# Reproduce by: gnulib-tool --import --local-dir=gnulib-local --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=lock --lgpl=3 --conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alignof alloca-opt announce-gen autobuild bind byteswap c-strcase canonicalize-lgpl ceil clock-time close connect copysign dirfd duplocale environ extensions flock floor fpieee frexp fstat fsync full-read full-write func gendocs getaddrinfo getlogin getpeername getsockname getsockopt git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton isfinite isinf isnan ldexp lib-symbol-versions lib-symbol-visibility libunistring link listen localcharset locale log1p lstat maintainer-makefile malloc-gnu malloca mkdir mkstemp nl_langinfo nproc open pipe-posix pipe2 poll putenv readlink recv recvfrom regex rename rmdir select send sendto setenv setsockopt shutdown socket stat-time stdlib strftime striconveh string sys_stat time times trunc unistd verify vsnprintf warnings wchar
|
||||||
|
|
||||||
AUTOMAKE_OPTIONS = 1.9.6 gnits subdir-objects
|
AUTOMAKE_OPTIONS = 1.9.6 gnits subdir-objects
|
||||||
|
|
||||||
|
@ -101,9 +101,11 @@ EXTRA_DIST += alignof.h
|
||||||
|
|
||||||
## begin gnulib module alloca
|
## begin gnulib module alloca
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_alloca
|
||||||
|
|
||||||
libgnu_la_LIBADD += @LTALLOCA@
|
libgnu_la_LIBADD += @LTALLOCA@
|
||||||
libgnu_la_DEPENDENCIES += @LTALLOCA@
|
libgnu_la_DEPENDENCIES += @LTALLOCA@
|
||||||
|
endif
|
||||||
EXTRA_DIST += alloca.c
|
EXTRA_DIST += alloca.c
|
||||||
|
|
||||||
EXTRA_libgnu_la_SOURCES += alloca.c
|
EXTRA_libgnu_la_SOURCES += alloca.c
|
||||||
|
@ -176,6 +178,15 @@ EXTRA_DIST += arpa_inet.in.h
|
||||||
|
|
||||||
## end gnulib module arpa_inet
|
## end gnulib module arpa_inet
|
||||||
|
|
||||||
|
## begin gnulib module assure
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_assure
|
||||||
|
|
||||||
|
endif
|
||||||
|
EXTRA_DIST += assure.h
|
||||||
|
|
||||||
|
## end gnulib module assure
|
||||||
|
|
||||||
## begin gnulib module binary-io
|
## begin gnulib module binary-io
|
||||||
|
|
||||||
libgnu_la_SOURCES += binary-io.h binary-io.c
|
libgnu_la_SOURCES += binary-io.h binary-io.c
|
||||||
|
@ -193,7 +204,9 @@ EXTRA_libgnu_la_SOURCES += bind.c
|
||||||
|
|
||||||
## begin gnulib module btowc
|
## begin gnulib module btowc
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_btowc
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += btowc.c
|
EXTRA_DIST += btowc.c
|
||||||
|
|
||||||
EXTRA_libgnu_la_SOURCES += btowc.c
|
EXTRA_libgnu_la_SOURCES += btowc.c
|
||||||
|
@ -391,22 +404,28 @@ EXTRA_libgnu_la_SOURCES += dirfd.c
|
||||||
|
|
||||||
## begin gnulib module dirname-lgpl
|
## begin gnulib module dirname-lgpl
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_a691da99c1d83b83238e45f41a696f5c
|
||||||
libgnu_la_SOURCES += dirname-lgpl.c basename-lgpl.c stripslash.c
|
libgnu_la_SOURCES += dirname-lgpl.c basename-lgpl.c stripslash.c
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += dirname.h
|
EXTRA_DIST += dirname.h
|
||||||
|
|
||||||
## end gnulib module dirname-lgpl
|
## end gnulib module dirname-lgpl
|
||||||
|
|
||||||
## begin gnulib module dosname
|
## begin gnulib module dosname
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_dosname
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += dosname.h
|
EXTRA_DIST += dosname.h
|
||||||
|
|
||||||
## end gnulib module dosname
|
## end gnulib module dosname
|
||||||
|
|
||||||
## begin gnulib module dup2
|
## begin gnulib module dup2
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_dup2
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += dup2.c
|
EXTRA_DIST += dup2.c
|
||||||
|
|
||||||
EXTRA_libgnu_la_SOURCES += dup2.c
|
EXTRA_libgnu_la_SOURCES += dup2.c
|
||||||
|
@ -493,8 +512,10 @@ EXTRA_DIST += fcntl.in.h
|
||||||
|
|
||||||
## begin gnulib module fd-hook
|
## begin gnulib module fd-hook
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_43fe87a341d9b4b93c47c3ad819a5239
|
||||||
libgnu_la_SOURCES += fd-hook.c
|
libgnu_la_SOURCES += fd-hook.c
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += fd-hook.h
|
EXTRA_DIST += fd-hook.h
|
||||||
|
|
||||||
## end gnulib module fd-hook
|
## end gnulib module fd-hook
|
||||||
|
@ -645,8 +666,10 @@ EXTRA_libgnu_la_SOURCES += getsockopt.c
|
||||||
|
|
||||||
## begin gnulib module gettext-h
|
## begin gnulib module gettext-h
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_be453cec5eecf5731a274f2de7f2db36
|
||||||
libgnu_la_SOURCES += gettext.h
|
libgnu_la_SOURCES += gettext.h
|
||||||
|
|
||||||
|
endif
|
||||||
## end gnulib module gettext-h
|
## end gnulib module gettext-h
|
||||||
|
|
||||||
## begin gnulib module gettimeofday
|
## begin gnulib module gettimeofday
|
||||||
|
@ -699,9 +722,22 @@ EXTRA_DIST += $(top_srcdir)/build-aux/gnupload
|
||||||
## begin gnulib module gperf
|
## begin gnulib module gperf
|
||||||
|
|
||||||
GPERF = gperf
|
GPERF = gperf
|
||||||
|
V_GPERF = $(V_GPERF_@AM_V@)
|
||||||
|
V_GPERF_ = $(V_GPERF_@AM_DEFAULT_V@)
|
||||||
|
V_GPERF_0 = @echo " GPERF " $@;
|
||||||
|
|
||||||
## end gnulib module gperf
|
## end gnulib module gperf
|
||||||
|
|
||||||
|
## begin gnulib module hard-locale
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_30838f5439487421042f2225bed3af76
|
||||||
|
libgnu_la_SOURCES += hard-locale.c
|
||||||
|
|
||||||
|
endif
|
||||||
|
EXTRA_DIST += hard-locale.h
|
||||||
|
|
||||||
|
## end gnulib module hard-locale
|
||||||
|
|
||||||
## begin gnulib module havelib
|
## begin gnulib module havelib
|
||||||
|
|
||||||
|
|
||||||
|
@ -748,19 +784,19 @@ EXTRA_DIST += iconv.in.h
|
||||||
## begin gnulib module iconv_open
|
## begin gnulib module iconv_open
|
||||||
|
|
||||||
iconv_open-aix.h: iconv_open-aix.gperf
|
iconv_open-aix.h: iconv_open-aix.gperf
|
||||||
$(GPERF) -m 10 $(srcdir)/iconv_open-aix.gperf > $(srcdir)/iconv_open-aix.h-t
|
$(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-aix.gperf > $(srcdir)/iconv_open-aix.h-t && \
|
||||||
mv $(srcdir)/iconv_open-aix.h-t $(srcdir)/iconv_open-aix.h
|
mv $(srcdir)/iconv_open-aix.h-t $(srcdir)/iconv_open-aix.h
|
||||||
iconv_open-hpux.h: iconv_open-hpux.gperf
|
iconv_open-hpux.h: iconv_open-hpux.gperf
|
||||||
$(GPERF) -m 10 $(srcdir)/iconv_open-hpux.gperf > $(srcdir)/iconv_open-hpux.h-t
|
$(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-hpux.gperf > $(srcdir)/iconv_open-hpux.h-t && \
|
||||||
mv $(srcdir)/iconv_open-hpux.h-t $(srcdir)/iconv_open-hpux.h
|
mv $(srcdir)/iconv_open-hpux.h-t $(srcdir)/iconv_open-hpux.h
|
||||||
iconv_open-irix.h: iconv_open-irix.gperf
|
iconv_open-irix.h: iconv_open-irix.gperf
|
||||||
$(GPERF) -m 10 $(srcdir)/iconv_open-irix.gperf > $(srcdir)/iconv_open-irix.h-t
|
$(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-irix.gperf > $(srcdir)/iconv_open-irix.h-t && \
|
||||||
mv $(srcdir)/iconv_open-irix.h-t $(srcdir)/iconv_open-irix.h
|
mv $(srcdir)/iconv_open-irix.h-t $(srcdir)/iconv_open-irix.h
|
||||||
iconv_open-osf.h: iconv_open-osf.gperf
|
iconv_open-osf.h: iconv_open-osf.gperf
|
||||||
$(GPERF) -m 10 $(srcdir)/iconv_open-osf.gperf > $(srcdir)/iconv_open-osf.h-t
|
$(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-osf.gperf > $(srcdir)/iconv_open-osf.h-t && \
|
||||||
mv $(srcdir)/iconv_open-osf.h-t $(srcdir)/iconv_open-osf.h
|
mv $(srcdir)/iconv_open-osf.h-t $(srcdir)/iconv_open-osf.h
|
||||||
iconv_open-solaris.h: iconv_open-solaris.gperf
|
iconv_open-solaris.h: iconv_open-solaris.gperf
|
||||||
$(GPERF) -m 10 $(srcdir)/iconv_open-solaris.gperf > $(srcdir)/iconv_open-solaris.h-t
|
$(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-solaris.gperf > $(srcdir)/iconv_open-solaris.h-t && \
|
||||||
mv $(srcdir)/iconv_open-solaris.h-t $(srcdir)/iconv_open-solaris.h
|
mv $(srcdir)/iconv_open-solaris.h-t $(srcdir)/iconv_open-solaris.h
|
||||||
BUILT_SOURCES += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h
|
BUILT_SOURCES += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h
|
||||||
MOSTLYCLEANFILES += iconv_open-aix.h-t iconv_open-hpux.h-t iconv_open-irix.h-t iconv_open-osf.h-t iconv_open-solaris.h-t
|
MOSTLYCLEANFILES += iconv_open-aix.h-t iconv_open-hpux.h-t iconv_open-irix.h-t iconv_open-osf.h-t iconv_open-solaris.h-t
|
||||||
|
@ -791,6 +827,15 @@ EXTRA_libgnu_la_SOURCES += inet_pton.c
|
||||||
|
|
||||||
## end gnulib module inet_pton
|
## end gnulib module inet_pton
|
||||||
|
|
||||||
|
## begin gnulib module intprops
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_intprops
|
||||||
|
|
||||||
|
endif
|
||||||
|
EXTRA_DIST += intprops.h
|
||||||
|
|
||||||
|
## end gnulib module intprops
|
||||||
|
|
||||||
## begin gnulib module isfinite
|
## begin gnulib module isfinite
|
||||||
|
|
||||||
|
|
||||||
|
@ -820,7 +865,9 @@ EXTRA_libgnu_la_SOURCES += isnan.c isnand.c
|
||||||
|
|
||||||
## begin gnulib module isnand-nolibm
|
## begin gnulib module isnand-nolibm
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_b1df7117b479d2da59d76deba468ee21
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += float+.h isnan.c isnand-nolibm.h isnand.c
|
EXTRA_DIST += float+.h isnan.c isnand-nolibm.h isnand.c
|
||||||
|
|
||||||
EXTRA_libgnu_la_SOURCES += isnan.c isnand.c
|
EXTRA_libgnu_la_SOURCES += isnan.c isnand.c
|
||||||
|
@ -838,7 +885,9 @@ EXTRA_libgnu_la_SOURCES += isnan.c isnanf.c
|
||||||
|
|
||||||
## begin gnulib module isnanf-nolibm
|
## begin gnulib module isnanf-nolibm
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_3f0e593033d1fc2c127581960f641b66
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += float+.h isnan.c isnanf-nolibm.h isnanf.c
|
EXTRA_DIST += float+.h isnan.c isnanf-nolibm.h isnanf.c
|
||||||
|
|
||||||
EXTRA_libgnu_la_SOURCES += isnan.c isnanf.c
|
EXTRA_libgnu_la_SOURCES += isnan.c isnanf.c
|
||||||
|
@ -856,7 +905,9 @@ EXTRA_libgnu_la_SOURCES += isnan.c isnanl.c
|
||||||
|
|
||||||
## begin gnulib module isnanl-nolibm
|
## begin gnulib module isnanl-nolibm
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_dbdf22868a5367f28bf18e0013ac6f8f
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += float+.h isnan.c isnanl-nolibm.h isnanl.c
|
EXTRA_DIST += float+.h isnan.c isnanl-nolibm.h isnanl.c
|
||||||
|
|
||||||
EXTRA_libgnu_la_SOURCES += isnan.c isnanl.c
|
EXTRA_libgnu_la_SOURCES += isnan.c isnanl.c
|
||||||
|
@ -1042,7 +1093,9 @@ EXTRA_DIST += locale.in.h
|
||||||
|
|
||||||
## begin gnulib module localeconv
|
## begin gnulib module localeconv
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_localeconv
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += localeconv.c
|
EXTRA_DIST += localeconv.c
|
||||||
|
|
||||||
EXTRA_libgnu_la_SOURCES += localeconv.c
|
EXTRA_libgnu_la_SOURCES += localeconv.c
|
||||||
|
@ -1051,7 +1104,9 @@ EXTRA_libgnu_la_SOURCES += localeconv.c
|
||||||
|
|
||||||
## begin gnulib module log
|
## begin gnulib module log
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_log
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += log.c
|
EXTRA_DIST += log.c
|
||||||
|
|
||||||
EXTRA_libgnu_la_SOURCES += log.c
|
EXTRA_libgnu_la_SOURCES += log.c
|
||||||
|
@ -1394,7 +1449,9 @@ EXTRA_DIST += math.in.h
|
||||||
|
|
||||||
## begin gnulib module mbrtowc
|
## begin gnulib module mbrtowc
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_mbrtowc
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += mbrtowc.c
|
EXTRA_DIST += mbrtowc.c
|
||||||
|
|
||||||
EXTRA_libgnu_la_SOURCES += mbrtowc.c
|
EXTRA_libgnu_la_SOURCES += mbrtowc.c
|
||||||
|
@ -1403,7 +1460,9 @@ EXTRA_libgnu_la_SOURCES += mbrtowc.c
|
||||||
|
|
||||||
## begin gnulib module mbsinit
|
## begin gnulib module mbsinit
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_mbsinit
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += mbsinit.c
|
EXTRA_DIST += mbsinit.c
|
||||||
|
|
||||||
EXTRA_libgnu_la_SOURCES += mbsinit.c
|
EXTRA_libgnu_la_SOURCES += mbsinit.c
|
||||||
|
@ -1412,7 +1471,9 @@ EXTRA_libgnu_la_SOURCES += mbsinit.c
|
||||||
|
|
||||||
## begin gnulib module mbtowc
|
## begin gnulib module mbtowc
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_mbtowc
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += mbtowc-impl.h mbtowc.c
|
EXTRA_DIST += mbtowc-impl.h mbtowc.c
|
||||||
|
|
||||||
EXTRA_libgnu_la_SOURCES += mbtowc.c
|
EXTRA_libgnu_la_SOURCES += mbtowc.c
|
||||||
|
@ -1421,7 +1482,9 @@ EXTRA_libgnu_la_SOURCES += mbtowc.c
|
||||||
|
|
||||||
## begin gnulib module memchr
|
## begin gnulib module memchr
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_memchr
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += memchr.c memchr.valgrind
|
EXTRA_DIST += memchr.c memchr.valgrind
|
||||||
|
|
||||||
EXTRA_libgnu_la_SOURCES += memchr.c
|
EXTRA_libgnu_la_SOURCES += memchr.c
|
||||||
|
@ -1446,9 +1509,33 @@ EXTRA_libgnu_la_SOURCES += mkstemp.c
|
||||||
|
|
||||||
## end gnulib module mkstemp
|
## end gnulib module mkstemp
|
||||||
|
|
||||||
|
## begin gnulib module mktime
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_mktime
|
||||||
|
|
||||||
|
endif
|
||||||
|
EXTRA_DIST += mktime-internal.h mktime.c
|
||||||
|
|
||||||
|
EXTRA_libgnu_la_SOURCES += mktime.c
|
||||||
|
|
||||||
|
## end gnulib module mktime
|
||||||
|
|
||||||
|
## begin gnulib module mktime-internal
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_5264294aa0a5557541b53c8c741f7f31
|
||||||
|
|
||||||
|
endif
|
||||||
|
EXTRA_DIST += mktime-internal.h mktime.c
|
||||||
|
|
||||||
|
EXTRA_libgnu_la_SOURCES += mktime.c
|
||||||
|
|
||||||
|
## end gnulib module mktime-internal
|
||||||
|
|
||||||
## begin gnulib module msvc-inval
|
## begin gnulib module msvc-inval
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_f691f076f650964c9f5598c3ee487616
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += msvc-inval.c msvc-inval.h
|
EXTRA_DIST += msvc-inval.c msvc-inval.h
|
||||||
|
|
||||||
EXTRA_libgnu_la_SOURCES += msvc-inval.c
|
EXTRA_libgnu_la_SOURCES += msvc-inval.c
|
||||||
|
@ -1457,7 +1544,9 @@ EXTRA_libgnu_la_SOURCES += msvc-inval.c
|
||||||
|
|
||||||
## begin gnulib module msvc-nothrow
|
## begin gnulib module msvc-nothrow
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_676220fa4366efa9bdbfccf11a857c07
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += msvc-nothrow.c msvc-nothrow.h
|
EXTRA_DIST += msvc-nothrow.c msvc-nothrow.h
|
||||||
|
|
||||||
EXTRA_libgnu_la_SOURCES += msvc-nothrow.c
|
EXTRA_libgnu_la_SOURCES += msvc-nothrow.c
|
||||||
|
@ -1557,7 +1646,9 @@ EXTRA_libgnu_la_SOURCES += open.c
|
||||||
|
|
||||||
## begin gnulib module pathmax
|
## begin gnulib module pathmax
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_pathmax
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += pathmax.h
|
EXTRA_DIST += pathmax.h
|
||||||
|
|
||||||
## end gnulib module pathmax
|
## end gnulib module pathmax
|
||||||
|
@ -1626,7 +1717,9 @@ EXTRA_libgnu_la_SOURCES += putenv.c
|
||||||
|
|
||||||
## begin gnulib module raise
|
## begin gnulib module raise
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_raise
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += raise.c
|
EXTRA_DIST += raise.c
|
||||||
|
|
||||||
EXTRA_libgnu_la_SOURCES += raise.c
|
EXTRA_libgnu_la_SOURCES += raise.c
|
||||||
|
@ -1698,7 +1791,9 @@ EXTRA_libgnu_la_SOURCES += rmdir.c
|
||||||
|
|
||||||
## begin gnulib module round
|
## begin gnulib module round
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_round
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += round.c
|
EXTRA_DIST += round.c
|
||||||
|
|
||||||
EXTRA_libgnu_la_SOURCES += round.c
|
EXTRA_libgnu_la_SOURCES += round.c
|
||||||
|
@ -1725,14 +1820,18 @@ EXTRA_libgnu_la_SOURCES += safe-read.c
|
||||||
|
|
||||||
## begin gnulib module same-inode
|
## begin gnulib module same-inode
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_9bc5f216d57e231e4834049d67d0db62
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += same-inode.h
|
EXTRA_DIST += same-inode.h
|
||||||
|
|
||||||
## end gnulib module same-inode
|
## end gnulib module same-inode
|
||||||
|
|
||||||
## begin gnulib module secure_getenv
|
## begin gnulib module secure_getenv
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_secure_getenv
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += secure_getenv.c
|
EXTRA_DIST += secure_getenv.c
|
||||||
|
|
||||||
EXTRA_libgnu_la_SOURCES += secure_getenv.c
|
EXTRA_libgnu_la_SOURCES += secure_getenv.c
|
||||||
|
@ -1837,7 +1936,9 @@ EXTRA_DIST += signal.in.h
|
||||||
|
|
||||||
## begin gnulib module signbit
|
## begin gnulib module signbit
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_signbit
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += float+.h signbitd.c signbitf.c signbitl.c
|
EXTRA_DIST += float+.h signbitd.c signbitf.c signbitl.c
|
||||||
|
|
||||||
EXTRA_libgnu_la_SOURCES += signbitd.c signbitf.c signbitl.c
|
EXTRA_libgnu_la_SOURCES += signbitd.c signbitf.c signbitl.c
|
||||||
|
@ -1846,8 +1947,10 @@ EXTRA_libgnu_la_SOURCES += signbitd.c signbitf.c signbitl.c
|
||||||
|
|
||||||
## begin gnulib module size_max
|
## begin gnulib module size_max
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_size_max
|
||||||
libgnu_la_SOURCES += size_max.h
|
libgnu_la_SOURCES += size_max.h
|
||||||
|
|
||||||
|
endif
|
||||||
## end gnulib module size_max
|
## end gnulib module size_max
|
||||||
|
|
||||||
## begin gnulib module snippet/_Noreturn
|
## begin gnulib module snippet/_Noreturn
|
||||||
|
@ -1958,7 +2061,9 @@ EXTRA_DIST += $(top_srcdir)/build-aux/snippet/warn-on-use.h
|
||||||
|
|
||||||
## begin gnulib module snprintf
|
## begin gnulib module snprintf
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_snprintf
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += snprintf.c
|
EXTRA_DIST += snprintf.c
|
||||||
|
|
||||||
EXTRA_libgnu_la_SOURCES += snprintf.c
|
EXTRA_libgnu_la_SOURCES += snprintf.c
|
||||||
|
@ -1976,15 +2081,19 @@ EXTRA_libgnu_la_SOURCES += socket.c
|
||||||
|
|
||||||
## begin gnulib module sockets
|
## begin gnulib module sockets
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_sockets
|
||||||
libgnu_la_SOURCES += sockets.h sockets.c
|
libgnu_la_SOURCES += sockets.h sockets.c
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += w32sock.h
|
EXTRA_DIST += w32sock.h
|
||||||
|
|
||||||
## end gnulib module sockets
|
## end gnulib module sockets
|
||||||
|
|
||||||
## begin gnulib module stat
|
## begin gnulib module stat
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_stat
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += stat.c
|
EXTRA_DIST += stat.c
|
||||||
|
|
||||||
EXTRA_libgnu_la_SOURCES += stat.c
|
EXTRA_libgnu_la_SOURCES += stat.c
|
||||||
|
@ -2060,6 +2169,7 @@ stddef.h: stddef.in.h $(top_builddir)/config.status
|
||||||
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
|
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
|
||||||
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
|
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
|
||||||
-e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \
|
-e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \
|
||||||
|
-e 's|@''HAVE_MAX_ALIGN_T''@|$(HAVE_MAX_ALIGN_T)|g' \
|
||||||
-e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \
|
-e 's|@''HAVE_WCHAR_T''@|$(HAVE_WCHAR_T)|g' \
|
||||||
-e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \
|
-e 's|@''REPLACE_NULL''@|$(REPLACE_NULL)|g' \
|
||||||
< $(srcdir)/stddef.in.h; \
|
< $(srcdir)/stddef.in.h; \
|
||||||
|
@ -2286,6 +2396,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
|
||||||
-e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \
|
-e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \
|
||||||
-e 's/@''GNULIB_PTSNAME_R''@/$(GNULIB_PTSNAME_R)/g' \
|
-e 's/@''GNULIB_PTSNAME_R''@/$(GNULIB_PTSNAME_R)/g' \
|
||||||
-e 's/@''GNULIB_PUTENV''@/$(GNULIB_PUTENV)/g' \
|
-e 's/@''GNULIB_PUTENV''@/$(GNULIB_PUTENV)/g' \
|
||||||
|
-e 's/@''GNULIB_QSORT_R''@/$(GNULIB_QSORT_R)/g' \
|
||||||
-e 's/@''GNULIB_RANDOM''@/$(GNULIB_RANDOM)/g' \
|
-e 's/@''GNULIB_RANDOM''@/$(GNULIB_RANDOM)/g' \
|
||||||
-e 's/@''GNULIB_RANDOM_R''@/$(GNULIB_RANDOM_R)/g' \
|
-e 's/@''GNULIB_RANDOM_R''@/$(GNULIB_RANDOM_R)/g' \
|
||||||
-e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \
|
-e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \
|
||||||
|
@ -2337,6 +2448,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
|
||||||
-e 's|@''REPLACE_PTSNAME''@|$(REPLACE_PTSNAME)|g' \
|
-e 's|@''REPLACE_PTSNAME''@|$(REPLACE_PTSNAME)|g' \
|
||||||
-e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \
|
-e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \
|
||||||
-e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
|
-e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
|
||||||
|
-e 's|@''REPLACE_QSORT_R''@|$(REPLACE_QSORT_R)|g' \
|
||||||
-e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \
|
-e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \
|
||||||
-e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \
|
-e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \
|
||||||
-e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \
|
-e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \
|
||||||
|
@ -2358,7 +2470,9 @@ EXTRA_DIST += stdlib.in.h
|
||||||
|
|
||||||
## begin gnulib module strdup-posix
|
## begin gnulib module strdup-posix
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_f9850631dca91859e9cddac9359921c0
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += strdup.c
|
EXTRA_DIST += strdup.c
|
||||||
|
|
||||||
EXTRA_libgnu_la_SOURCES += strdup.c
|
EXTRA_libgnu_la_SOURCES += strdup.c
|
||||||
|
@ -2367,7 +2481,9 @@ EXTRA_libgnu_la_SOURCES += strdup.c
|
||||||
|
|
||||||
## begin gnulib module streq
|
## begin gnulib module streq
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_streq
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += streq.h
|
EXTRA_DIST += streq.h
|
||||||
|
|
||||||
## end gnulib module streq
|
## end gnulib module streq
|
||||||
|
@ -2786,8 +2902,10 @@ EXTRA_DIST += sys_uio.in.h
|
||||||
|
|
||||||
## begin gnulib module tempname
|
## begin gnulib module tempname
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_tempname
|
||||||
libgnu_la_SOURCES += tempname.c
|
libgnu_la_SOURCES += tempname.c
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += tempname.h
|
EXTRA_DIST += tempname.h
|
||||||
|
|
||||||
## end gnulib module tempname
|
## end gnulib module tempname
|
||||||
|
@ -2812,10 +2930,12 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
|
||||||
-e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \
|
-e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \
|
||||||
-e 's/@''GNULIB_TIMEGM''@/$(GNULIB_TIMEGM)/g' \
|
-e 's/@''GNULIB_TIMEGM''@/$(GNULIB_TIMEGM)/g' \
|
||||||
-e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \
|
-e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \
|
||||||
|
-e 's/@''GNULIB_TIME_RZ''@/$(GNULIB_TIME_RZ)/g' \
|
||||||
-e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \
|
-e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \
|
||||||
-e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \
|
-e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \
|
||||||
-e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \
|
-e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \
|
||||||
-e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \
|
-e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \
|
||||||
|
-e 's|@''HAVE_TIMEZONE_T''@|$(HAVE_TIMEZONE_T)|g' \
|
||||||
-e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \
|
-e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \
|
||||||
-e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \
|
-e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \
|
||||||
-e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \
|
-e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \
|
||||||
|
@ -2825,6 +2945,7 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
|
||||||
-e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \
|
-e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \
|
||||||
-e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|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' \
|
-e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
|
||||||
|
-e 's|@''UNISTD_H_DEFINES_STRUCT_TIMESPEC''@|$(UNISTD_H_DEFINES_STRUCT_TIMESPEC)|g' \
|
||||||
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
|
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
|
||||||
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
|
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
|
||||||
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
|
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
|
||||||
|
@ -2839,13 +2960,35 @@ EXTRA_DIST += time.in.h
|
||||||
|
|
||||||
## begin gnulib module time_r
|
## begin gnulib module time_r
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_time_r
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += time_r.c
|
EXTRA_DIST += time_r.c
|
||||||
|
|
||||||
EXTRA_libgnu_la_SOURCES += time_r.c
|
EXTRA_libgnu_la_SOURCES += time_r.c
|
||||||
|
|
||||||
## end gnulib module time_r
|
## end gnulib module time_r
|
||||||
|
|
||||||
|
## begin gnulib module time_rz
|
||||||
|
|
||||||
|
|
||||||
|
EXTRA_DIST += time-internal.h time_rz.c
|
||||||
|
|
||||||
|
EXTRA_libgnu_la_SOURCES += time_rz.c
|
||||||
|
|
||||||
|
## end gnulib module time_rz
|
||||||
|
|
||||||
|
## begin gnulib module timegm
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_timegm
|
||||||
|
|
||||||
|
endif
|
||||||
|
EXTRA_DIST += mktime-internal.h timegm.c
|
||||||
|
|
||||||
|
EXTRA_libgnu_la_SOURCES += timegm.c
|
||||||
|
|
||||||
|
## end gnulib module timegm
|
||||||
|
|
||||||
## begin gnulib module times
|
## begin gnulib module times
|
||||||
|
|
||||||
|
|
||||||
|
@ -2995,9 +3138,11 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
|
||||||
-e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \
|
-e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \
|
||||||
-e 's|@''REPLACE_READ''@|$(REPLACE_READ)|g' \
|
-e 's|@''REPLACE_READ''@|$(REPLACE_READ)|g' \
|
||||||
-e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \
|
-e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \
|
||||||
|
-e 's|@''REPLACE_READLINKAT''@|$(REPLACE_READLINKAT)|g' \
|
||||||
-e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \
|
-e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \
|
||||||
-e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \
|
-e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \
|
||||||
-e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \
|
-e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \
|
||||||
|
-e 's|@''REPLACE_SYMLINKAT''@|$(REPLACE_SYMLINKAT)|g' \
|
||||||
-e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \
|
-e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \
|
||||||
-e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \
|
-e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \
|
||||||
-e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \
|
-e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \
|
||||||
|
@ -3088,6 +3233,17 @@ EXTRA_DIST += unitypes.in.h
|
||||||
|
|
||||||
## end gnulib module unitypes
|
## end gnulib module unitypes
|
||||||
|
|
||||||
|
## begin gnulib module unsetenv
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_unsetenv
|
||||||
|
|
||||||
|
endif
|
||||||
|
EXTRA_DIST += unsetenv.c
|
||||||
|
|
||||||
|
EXTRA_libgnu_la_SOURCES += unsetenv.c
|
||||||
|
|
||||||
|
## end gnulib module unsetenv
|
||||||
|
|
||||||
## begin gnulib module useless-if-before-free
|
## begin gnulib module useless-if-before-free
|
||||||
|
|
||||||
|
|
||||||
|
@ -3097,7 +3253,9 @@ EXTRA_DIST += $(top_srcdir)/build-aux/useless-if-before-free
|
||||||
|
|
||||||
## begin gnulib module vasnprintf
|
## begin gnulib module vasnprintf
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_vasnprintf
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += asnprintf.c float+.h printf-args.c printf-args.h printf-parse.c printf-parse.h vasnprintf.c vasnprintf.h
|
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
|
EXTRA_libgnu_la_SOURCES += asnprintf.c printf-args.c printf-parse.c vasnprintf.c
|
||||||
|
@ -3250,7 +3408,9 @@ EXTRA_DIST += wchar.in.h
|
||||||
|
|
||||||
## begin gnulib module wcrtomb
|
## begin gnulib module wcrtomb
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_wcrtomb
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += wcrtomb.c
|
EXTRA_DIST += wcrtomb.c
|
||||||
|
|
||||||
EXTRA_libgnu_la_SOURCES += wcrtomb.c
|
EXTRA_libgnu_la_SOURCES += wcrtomb.c
|
||||||
|
@ -3259,6 +3419,7 @@ EXTRA_libgnu_la_SOURCES += wcrtomb.c
|
||||||
|
|
||||||
## begin gnulib module wctype-h
|
## begin gnulib module wctype-h
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_3dcce957eadc896e63ab5f137947b410
|
||||||
BUILT_SOURCES += wctype.h
|
BUILT_SOURCES += wctype.h
|
||||||
libgnu_la_SOURCES += wctype-h.c
|
libgnu_la_SOURCES += wctype-h.c
|
||||||
|
|
||||||
|
@ -3293,6 +3454,7 @@ wctype.h: wctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H
|
||||||
mv $@-t $@
|
mv $@-t $@
|
||||||
MOSTLYCLEANFILES += wctype.h wctype.h-t
|
MOSTLYCLEANFILES += wctype.h wctype.h-t
|
||||||
|
|
||||||
|
endif
|
||||||
EXTRA_DIST += wctype.in.h
|
EXTRA_DIST += wctype.in.h
|
||||||
|
|
||||||
## end gnulib module wctype-h
|
## end gnulib module wctype-h
|
||||||
|
@ -3308,8 +3470,10 @@ EXTRA_libgnu_la_SOURCES += write.c
|
||||||
|
|
||||||
## begin gnulib module xsize
|
## begin gnulib module xsize
|
||||||
|
|
||||||
|
if gl_GNULIB_ENABLED_xsize
|
||||||
libgnu_la_SOURCES += xsize.h xsize.c
|
libgnu_la_SOURCES += xsize.h xsize.c
|
||||||
|
|
||||||
|
endif
|
||||||
## end gnulib module xsize
|
## end gnulib module xsize
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* accept.c --- wrappers for Windows accept function
|
/* accept.c --- wrappers for Windows accept function
|
||||||
|
|
||||||
Copyright (C) 2008-2014 Free Software Foundation, Inc.
|
Copyright (C) 2008-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Determine alignment of types.
|
/* Determine alignment of types.
|
||||||
Copyright (C) 2003-2004, 2006, 2009-2014 Free Software Foundation, Inc.
|
Copyright (C) 2003-2004, 2006, 2009-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* Memory allocation on the stack.
|
/* Memory allocation on the stack.
|
||||||
|
|
||||||
Copyright (C) 1995, 1999, 2001-2004, 2006-2014 Free Software Foundation,
|
Copyright (C) 1995, 1999, 2001-2004, 2006-2016 Free Software Foundation,
|
||||||
Inc.
|
Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify it
|
This program is free software; you can redistribute it and/or modify it
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* A GNU-like <arpa/inet.h>.
|
/* A GNU-like <arpa/inet.h>.
|
||||||
|
|
||||||
Copyright (C) 2005-2006, 2008-2014 Free Software Foundation, Inc.
|
Copyright (C) 2005-2006, 2008-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Formatted output to strings.
|
/* Formatted output to strings.
|
||||||
Copyright (C) 1999, 2002, 2006, 2009-2014 Free Software Foundation, Inc.
|
Copyright (C) 1999, 2002, 2006, 2009-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
37
lib/assure.h
Normal file
37
lib/assure.h
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
/* Run-time assert-like macros.
|
||||||
|
|
||||||
|
Copyright (C) 2014-2016 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 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 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 <http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
/* Written by Paul Eggert. */
|
||||||
|
|
||||||
|
#ifndef _GL_ASSURE_H
|
||||||
|
#define _GL_ASSURE_H
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
|
/* Check E's value at runtime, and report an error and abort if not.
|
||||||
|
However, do nothng if NDEBUG is defined.
|
||||||
|
|
||||||
|
Unlike standard 'assert', this macro always compiles E even when NDEBUG
|
||||||
|
is defined, so as to catch typos and avoid some GCC warnings. */
|
||||||
|
|
||||||
|
#ifdef NDEBUG
|
||||||
|
# define assure(E) ((void) (0 && (E)))
|
||||||
|
#else
|
||||||
|
# define assure(E) assert (E)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
|
@ -1,6 +1,6 @@
|
||||||
/* basename.c -- return the last element in a file name
|
/* basename.c -- return the last element in a file name
|
||||||
|
|
||||||
Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2014 Free Software
|
Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2016 Free Software
|
||||||
Foundation, Inc.
|
Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#define BINARY_IO_INLINE _GL_EXTERN_INLINE
|
#define BINARY_IO_INLINE _GL_EXTERN_INLINE
|
||||||
#include "binary-io.h"
|
#include "binary-io.h"
|
||||||
|
typedef int dummy;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Binary mode I/O.
|
/* Binary mode I/O.
|
||||||
Copyright (C) 2001, 2003, 2005, 2008-2014 Free Software Foundation, Inc.
|
Copyright (C) 2001, 2003, 2005, 2008-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
@ -60,7 +60,7 @@ set_binary_mode (int fd, int mode)
|
||||||
|
|
||||||
/* SET_BINARY (fd);
|
/* SET_BINARY (fd);
|
||||||
changes the file descriptor fd to perform binary I/O. */
|
changes the file descriptor fd to perform binary I/O. */
|
||||||
#ifdef __DJGPP__
|
#if defined __DJGPP__ || defined __EMX__
|
||||||
# include <unistd.h> /* declares isatty() */
|
# include <unistd.h> /* declares isatty() */
|
||||||
/* Avoid putting stdin/stdout in binary mode if it is connected to
|
/* Avoid putting stdin/stdout in binary mode if it is connected to
|
||||||
the console, because that would make it impossible for the user
|
the console, because that would make it impossible for the user
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* bind.c --- wrappers for Windows bind function
|
/* bind.c --- wrappers for Windows bind function
|
||||||
|
|
||||||
Copyright (C) 2008-2014 Free Software Foundation, Inc.
|
Copyright (C) 2008-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Convert unibyte character to wide character.
|
/* Convert unibyte character to wide character.
|
||||||
Copyright (C) 2008, 2010-2014 Free Software Foundation, Inc.
|
Copyright (C) 2008, 2010-2016 Free Software Foundation, Inc.
|
||||||
Written by Bruno Haible <bruno@clisp.org>, 2008.
|
Written by Bruno Haible <bruno@clisp.org>, 2008.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* byteswap.h - Byte swapping
|
/* byteswap.h - Byte swapping
|
||||||
Copyright (C) 2005, 2007, 2009-2014 Free Software Foundation, Inc.
|
Copyright (C) 2005, 2007, 2009-2016 Free Software Foundation, Inc.
|
||||||
Written by Oskar Liljeblad <oskar@osk.mine.nu>, 2005.
|
Written by Oskar Liljeblad <oskar@osk.mine.nu>, 2005.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|
394
lib/c-ctype.c
394
lib/c-ctype.c
|
@ -1,395 +1,3 @@
|
||||||
/* Character handling in C locale.
|
|
||||||
|
|
||||||
Copyright 2000-2003, 2006, 2009-2014 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 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 <http://www.gnu.org/licenses/>. */
|
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
#define C_CTYPE_INLINE _GL_EXTERN_INLINE
|
||||||
/* Specification. */
|
|
||||||
#define NO_C_CTYPE_MACROS
|
|
||||||
#include "c-ctype.h"
|
#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
|
|
||||||
}
|
|
||||||
|
|
453
lib/c-ctype.h
453
lib/c-ctype.h
|
@ -5,7 +5,7 @@
|
||||||
<ctype.h> functions' behaviour depends on the current locale set via
|
<ctype.h> functions' behaviour depends on the current locale set via
|
||||||
setlocale.
|
setlocale.
|
||||||
|
|
||||||
Copyright (C) 2000-2003, 2006, 2008-2014 Free Software Foundation, Inc.
|
Copyright (C) 2000-2003, 2006, 2008-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
@ -25,6 +25,13 @@ along with this program; if not, see <http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
#ifndef _GL_INLINE_HEADER_BEGIN
|
||||||
|
#error "Please include config.h first."
|
||||||
|
#endif
|
||||||
|
_GL_INLINE_HEADER_BEGIN
|
||||||
|
#ifndef C_CTYPE_INLINE
|
||||||
|
# define C_CTYPE_INLINE _GL_INLINE
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -39,38 +46,6 @@ extern "C" {
|
||||||
characters. */
|
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) \
|
#if (' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
|
||||||
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
|
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
|
||||||
&& (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
|
&& (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
|
||||||
|
@ -96,11 +71,84 @@ extern "C" {
|
||||||
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)
|
&& ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)
|
||||||
/* The character set is ASCII or one of its variants or extensions, not EBCDIC.
|
/* The character set is ASCII or one of its variants or extensions, not EBCDIC.
|
||||||
Testing the value of '\n' and '\r' is not relevant. */
|
Testing the value of '\n' and '\r' is not relevant. */
|
||||||
#define C_CTYPE_ASCII 1
|
# define C_CTYPE_ASCII 1
|
||||||
|
#elif ! (' ' == '\x40' && '0' == '\xf0' \
|
||||||
|
&& 'A' == '\xc1' && 'J' == '\xd1' && 'S' == '\xe2' \
|
||||||
|
&& 'a' == '\x81' && 'j' == '\x91' && 's' == '\xa2')
|
||||||
|
# error "Only ASCII and EBCDIC are supported"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if 'A' < 0
|
||||||
|
# error "EBCDIC and char is signed -- not supported"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Function declarations. */
|
/* Cases for control characters. */
|
||||||
|
|
||||||
|
#define _C_CTYPE_CNTRL \
|
||||||
|
case '\a': case '\b': case '\f': case '\n': \
|
||||||
|
case '\r': case '\t': case '\v': \
|
||||||
|
_C_CTYPE_OTHER_CNTRL
|
||||||
|
|
||||||
|
/* ASCII control characters other than those with \-letter escapes. */
|
||||||
|
|
||||||
|
#if C_CTYPE_ASCII
|
||||||
|
# define _C_CTYPE_OTHER_CNTRL \
|
||||||
|
case '\x00': case '\x01': case '\x02': case '\x03': \
|
||||||
|
case '\x04': case '\x05': case '\x06': case '\x0e': \
|
||||||
|
case '\x0f': case '\x10': case '\x11': case '\x12': \
|
||||||
|
case '\x13': case '\x14': case '\x15': case '\x16': \
|
||||||
|
case '\x17': case '\x18': case '\x19': case '\x1a': \
|
||||||
|
case '\x1b': case '\x1c': case '\x1d': case '\x1e': \
|
||||||
|
case '\x1f': case '\x7f'
|
||||||
|
#else
|
||||||
|
/* Use EBCDIC code page 1047's assignments for ASCII control chars;
|
||||||
|
assume all EBCDIC code pages agree about these assignments. */
|
||||||
|
# define _C_CTYPE_OTHER_CNTRL \
|
||||||
|
case '\x00': case '\x01': case '\x02': case '\x03': \
|
||||||
|
case '\x07': case '\x0e': case '\x0f': case '\x10': \
|
||||||
|
case '\x11': case '\x12': case '\x13': case '\x18': \
|
||||||
|
case '\x19': case '\x1c': case '\x1d': case '\x1e': \
|
||||||
|
case '\x1f': case '\x26': case '\x27': case '\x2d': \
|
||||||
|
case '\x2e': case '\x32': case '\x37': case '\x3c': \
|
||||||
|
case '\x3d': case '\x3f'
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Cases for lowercase hex letters, and lowercase letters, all offset by N. */
|
||||||
|
|
||||||
|
#define _C_CTYPE_LOWER_A_THRU_F_N(n) \
|
||||||
|
case 'a' + (n): case 'b' + (n): case 'c' + (n): case 'd' + (n): \
|
||||||
|
case 'e' + (n): case 'f' + (n)
|
||||||
|
#define _C_CTYPE_LOWER_N(n) \
|
||||||
|
_C_CTYPE_LOWER_A_THRU_F_N(n): \
|
||||||
|
case 'g' + (n): case 'h' + (n): case 'i' + (n): case 'j' + (n): \
|
||||||
|
case 'k' + (n): case 'l' + (n): case 'm' + (n): case 'n' + (n): \
|
||||||
|
case 'o' + (n): case 'p' + (n): case 'q' + (n): case 'r' + (n): \
|
||||||
|
case 's' + (n): case 't' + (n): case 'u' + (n): case 'v' + (n): \
|
||||||
|
case 'w' + (n): case 'x' + (n): case 'y' + (n): case 'z' + (n)
|
||||||
|
|
||||||
|
/* Cases for hex letters, digits, lower, punct, and upper. */
|
||||||
|
|
||||||
|
#define _C_CTYPE_A_THRU_F \
|
||||||
|
_C_CTYPE_LOWER_A_THRU_F_N (0): \
|
||||||
|
_C_CTYPE_LOWER_A_THRU_F_N ('A' - 'a')
|
||||||
|
#define _C_CTYPE_DIGIT \
|
||||||
|
case '0': case '1': case '2': case '3': \
|
||||||
|
case '4': case '5': case '6': case '7': \
|
||||||
|
case '8': case '9'
|
||||||
|
#define _C_CTYPE_LOWER _C_CTYPE_LOWER_N (0)
|
||||||
|
#define _C_CTYPE_PUNCT \
|
||||||
|
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 '~'
|
||||||
|
#define _C_CTYPE_UPPER _C_CTYPE_LOWER_N ('A' - 'a')
|
||||||
|
|
||||||
|
|
||||||
|
/* Function definitions. */
|
||||||
|
|
||||||
/* Unlike the functions in <ctype.h>, which require an argument in the range
|
/* Unlike the functions in <ctype.h>, which require an argument in the range
|
||||||
of the 'unsigned char' type, the functions here operate on values that are
|
of the 'unsigned char' type, the functions here operate on values that are
|
||||||
|
@ -117,179 +165,202 @@ extern "C" {
|
||||||
if (c_isalpha (*s)) ...
|
if (c_isalpha (*s)) ...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern bool c_isascii (int c) _GL_ATTRIBUTE_CONST; /* not locale dependent */
|
C_CTYPE_INLINE bool
|
||||||
|
c_isalnum (int c)
|
||||||
|
{
|
||||||
|
switch (c)
|
||||||
|
{
|
||||||
|
_C_CTYPE_DIGIT:
|
||||||
|
_C_CTYPE_LOWER:
|
||||||
|
_C_CTYPE_UPPER:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
extern bool c_isalnum (int c) _GL_ATTRIBUTE_CONST;
|
C_CTYPE_INLINE bool
|
||||||
extern bool c_isalpha (int c) _GL_ATTRIBUTE_CONST;
|
c_isalpha (int c)
|
||||||
extern bool c_isblank (int c) _GL_ATTRIBUTE_CONST;
|
{
|
||||||
extern bool c_iscntrl (int c) _GL_ATTRIBUTE_CONST;
|
switch (c)
|
||||||
extern bool c_isdigit (int c) _GL_ATTRIBUTE_CONST;
|
{
|
||||||
extern bool c_islower (int c) _GL_ATTRIBUTE_CONST;
|
_C_CTYPE_LOWER:
|
||||||
extern bool c_isgraph (int c) _GL_ATTRIBUTE_CONST;
|
_C_CTYPE_UPPER:
|
||||||
extern bool c_isprint (int c) _GL_ATTRIBUTE_CONST;
|
return true;
|
||||||
extern bool c_ispunct (int c) _GL_ATTRIBUTE_CONST;
|
default:
|
||||||
extern bool c_isspace (int c) _GL_ATTRIBUTE_CONST;
|
return false;
|
||||||
extern bool c_isupper (int c) _GL_ATTRIBUTE_CONST;
|
}
|
||||||
extern bool c_isxdigit (int c) _GL_ATTRIBUTE_CONST;
|
}
|
||||||
|
|
||||||
extern int c_tolower (int c) _GL_ATTRIBUTE_CONST;
|
/* The function isascii is not locale dependent.
|
||||||
extern int c_toupper (int c) _GL_ATTRIBUTE_CONST;
|
Its use in EBCDIC is questionable. */
|
||||||
|
C_CTYPE_INLINE bool
|
||||||
|
c_isascii (int c)
|
||||||
|
{
|
||||||
|
switch (c)
|
||||||
|
{
|
||||||
|
case ' ':
|
||||||
|
_C_CTYPE_CNTRL:
|
||||||
|
_C_CTYPE_DIGIT:
|
||||||
|
_C_CTYPE_LOWER:
|
||||||
|
_C_CTYPE_PUNCT:
|
||||||
|
_C_CTYPE_UPPER:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
C_CTYPE_INLINE bool
|
||||||
|
c_isblank (int c)
|
||||||
|
{
|
||||||
|
return c == ' ' || c == '\t';
|
||||||
|
}
|
||||||
|
|
||||||
#if (defined __GNUC__ && !defined __STRICT_ANSI__ && defined __OPTIMIZE__ \
|
C_CTYPE_INLINE bool
|
||||||
&& !defined __OPTIMIZE_SIZE__ && !defined NO_C_CTYPE_MACROS)
|
c_iscntrl (int c)
|
||||||
|
{
|
||||||
|
switch (c)
|
||||||
|
{
|
||||||
|
_C_CTYPE_CNTRL:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* ASCII optimizations. */
|
C_CTYPE_INLINE bool
|
||||||
|
c_isdigit (int c)
|
||||||
|
{
|
||||||
|
switch (c)
|
||||||
|
{
|
||||||
|
_C_CTYPE_DIGIT:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#undef c_isascii
|
C_CTYPE_INLINE bool
|
||||||
#define c_isascii(c) \
|
c_isgraph (int c)
|
||||||
({ int __c = (c); \
|
{
|
||||||
(__c >= 0x00 && __c <= 0x7f); \
|
switch (c)
|
||||||
})
|
{
|
||||||
|
_C_CTYPE_DIGIT:
|
||||||
|
_C_CTYPE_LOWER:
|
||||||
|
_C_CTYPE_PUNCT:
|
||||||
|
_C_CTYPE_UPPER:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#if C_CTYPE_CONSECUTIVE_DIGITS \
|
C_CTYPE_INLINE bool
|
||||||
&& C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
|
c_islower (int c)
|
||||||
#if C_CTYPE_ASCII
|
{
|
||||||
#undef c_isalnum
|
switch (c)
|
||||||
#define c_isalnum(c) \
|
{
|
||||||
({ int __c = (c); \
|
_C_CTYPE_LOWER:
|
||||||
((__c >= '0' && __c <= '9') \
|
return true;
|
||||||
|| ((__c & ~0x20) >= 'A' && (__c & ~0x20) <= 'Z')); \
|
default:
|
||||||
})
|
return false;
|
||||||
#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
|
C_CTYPE_INLINE bool
|
||||||
#if C_CTYPE_ASCII
|
c_isprint (int c)
|
||||||
#undef c_isalpha
|
{
|
||||||
#define c_isalpha(c) \
|
switch (c)
|
||||||
({ int __c = (c); \
|
{
|
||||||
((__c & ~0x20) >= 'A' && (__c & ~0x20) <= 'Z'); \
|
case ' ':
|
||||||
})
|
_C_CTYPE_DIGIT:
|
||||||
#else
|
_C_CTYPE_LOWER:
|
||||||
#undef c_isalpha
|
_C_CTYPE_PUNCT:
|
||||||
#define c_isalpha(c) \
|
_C_CTYPE_UPPER:
|
||||||
({ int __c = (c); \
|
return true;
|
||||||
((__c >= 'A' && __c <= 'Z') || (__c >= 'a' && __c <= 'z')); \
|
default:
|
||||||
})
|
return false;
|
||||||
#endif
|
}
|
||||||
#endif
|
}
|
||||||
|
|
||||||
#undef c_isblank
|
C_CTYPE_INLINE bool
|
||||||
#define c_isblank(c) \
|
c_ispunct (int c)
|
||||||
({ int __c = (c); \
|
{
|
||||||
(__c == ' ' || __c == '\t'); \
|
switch (c)
|
||||||
})
|
{
|
||||||
|
_C_CTYPE_PUNCT:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#if C_CTYPE_ASCII
|
C_CTYPE_INLINE bool
|
||||||
#undef c_iscntrl
|
c_isspace (int c)
|
||||||
#define c_iscntrl(c) \
|
{
|
||||||
({ int __c = (c); \
|
switch (c)
|
||||||
((__c & ~0x1f) == 0 || __c == 0x7f); \
|
{
|
||||||
})
|
case ' ': case '\t': case '\n': case '\v': case '\f': case '\r':
|
||||||
#endif
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#if C_CTYPE_CONSECUTIVE_DIGITS
|
C_CTYPE_INLINE bool
|
||||||
#undef c_isdigit
|
c_isupper (int c)
|
||||||
#define c_isdigit(c) \
|
{
|
||||||
({ int __c = (c); \
|
switch (c)
|
||||||
(__c >= '0' && __c <= '9'); \
|
{
|
||||||
})
|
_C_CTYPE_UPPER:
|
||||||
#endif
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#if C_CTYPE_CONSECUTIVE_LOWERCASE
|
C_CTYPE_INLINE bool
|
||||||
#undef c_islower
|
c_isxdigit (int c)
|
||||||
#define c_islower(c) \
|
{
|
||||||
({ int __c = (c); \
|
switch (c)
|
||||||
(__c >= 'a' && __c <= 'z'); \
|
{
|
||||||
})
|
_C_CTYPE_DIGIT:
|
||||||
#endif
|
_C_CTYPE_A_THRU_F:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#if C_CTYPE_ASCII
|
C_CTYPE_INLINE int
|
||||||
#undef c_isgraph
|
c_tolower (int c)
|
||||||
#define c_isgraph(c) \
|
{
|
||||||
({ int __c = (c); \
|
switch (c)
|
||||||
(__c >= '!' && __c <= '~'); \
|
{
|
||||||
})
|
_C_CTYPE_UPPER:
|
||||||
#endif
|
return c - 'A' + 'a';
|
||||||
|
default:
|
||||||
#if C_CTYPE_ASCII
|
return c;
|
||||||
#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 */
|
|
||||||
|
|
||||||
|
C_CTYPE_INLINE int
|
||||||
|
c_toupper (int c)
|
||||||
|
{
|
||||||
|
switch (c)
|
||||||
|
{
|
||||||
|
_C_CTYPE_LOWER:
|
||||||
|
return c - 'a' + 'A';
|
||||||
|
default:
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
_GL_INLINE_HEADER_END
|
||||||
|
|
||||||
#endif /* C_CTYPE_H */
|
#endif /* C_CTYPE_H */
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Case-insensitive string comparison functions in C locale.
|
/* Case-insensitive string comparison functions in C locale.
|
||||||
Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2014 Free Software
|
Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2016 Free Software
|
||||||
Foundation, Inc.
|
Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* c-strcasecmp.c -- case insensitive string comparator in C locale
|
/* c-strcasecmp.c -- case insensitive string comparator in C locale
|
||||||
Copyright (C) 1998-1999, 2005-2006, 2009-2014 Free Software Foundation, Inc.
|
Copyright (C) 1998-1999, 2005-2006, 2009-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Optimized case-insensitive string comparison in C locale.
|
/* Optimized case-insensitive string comparison in C locale.
|
||||||
Copyright (C) 2001-2002, 2007, 2009-2014 Free Software Foundation, Inc.
|
Copyright (C) 2001-2002, 2007, 2009-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify it
|
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
|
under the terms of the GNU Lesser General Public License as published
|
||||||
|
@ -33,9 +33,6 @@
|
||||||
# if C_CTYPE_ASCII
|
# if C_CTYPE_ASCII
|
||||||
# define CASEEQ(other,upper) \
|
# define CASEEQ(other,upper) \
|
||||||
(c_isupper (upper) ? ((other) & ~0x20) == (upper) : (other) == (upper))
|
(c_isupper (upper) ? ((other) & ~0x20) == (upper) : (other) == (upper))
|
||||||
# elif C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE
|
|
||||||
# define CASEEQ(other,upper) \
|
|
||||||
(c_isupper (upper) ? (other) == (upper) || (other) == (upper) - 'A' + 'a' : (other) == (upper))
|
|
||||||
# else
|
# else
|
||||||
# define CASEEQ(other,upper) \
|
# define CASEEQ(other,upper) \
|
||||||
(c_toupper (other) == (upper))
|
(c_toupper (other) == (upper))
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* c-strncasecmp.c -- case insensitive string comparator in C locale
|
/* c-strncasecmp.c -- case insensitive string comparator in C locale
|
||||||
Copyright (C) 1998-1999, 2005-2006, 2009-2014 Free Software Foundation, Inc.
|
Copyright (C) 1998-1999, 2005-2006, 2009-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Return the canonical absolute name of a given file.
|
/* Return the canonical absolute name of a given file.
|
||||||
Copyright (C) 1996-2014 Free Software Foundation, Inc.
|
Copyright (C) 1996-2016 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Round towards positive infinity.
|
/* Round towards positive infinity.
|
||||||
Copyright (C) 2007, 2010-2014 Free Software Foundation, Inc.
|
Copyright (C) 2007, 2010-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* close replacement.
|
/* close replacement.
|
||||||
Copyright (C) 2008-2014 Free Software Foundation, Inc.
|
Copyright (C) 2008-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Output a system dependent table of character encoding aliases.
|
# Output a system dependent table of character encoding aliases.
|
||||||
#
|
#
|
||||||
# Copyright (C) 2000-2004, 2006-2014 Free Software Foundation, Inc.
|
# Copyright (C) 2000-2004, 2006-2016 Free Software Foundation, Inc.
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# 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
|
# it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
@ -348,12 +348,10 @@ case "$os" in
|
||||||
#echo "sun_eu_greek ?" # what is this?
|
#echo "sun_eu_greek ?" # what is this?
|
||||||
echo "UTF-8 UTF-8"
|
echo "UTF-8 UTF-8"
|
||||||
;;
|
;;
|
||||||
freebsd* | os2*)
|
freebsd*)
|
||||||
# FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore
|
# FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore
|
||||||
# localcharset.c falls back to using the full locale name
|
# localcharset.c falls back to using the full locale name
|
||||||
# from the environment variables.
|
# from the environment variables.
|
||||||
# Likewise for OS/2. OS/2 has XFree86 just like FreeBSD. Just
|
|
||||||
# reuse FreeBSD's locale data for OS/2.
|
|
||||||
echo "C ASCII"
|
echo "C ASCII"
|
||||||
echo "US-ASCII ASCII"
|
echo "US-ASCII ASCII"
|
||||||
for l in la_LN lt_LN; do
|
for l in la_LN lt_LN; do
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* connect.c --- wrappers for Windows connect function
|
/* connect.c --- wrappers for Windows connect function
|
||||||
|
|
||||||
Copyright (C) 2008-2014 Free Software Foundation, Inc.
|
Copyright (C) 2008-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Copy sign into another 'double' number.
|
/* Copy sign into another 'double' number.
|
||||||
Copyright (C) 2011-2014 Free Software Foundation, Inc.
|
Copyright (C) 2011-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* A GNU-like <dirent.h>.
|
/* A GNU-like <dirent.h>.
|
||||||
Copyright (C) 2006-2014 Free Software Foundation, Inc.
|
Copyright (C) 2006-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
@ -77,6 +77,7 @@ typedef struct gl_directory DIR;
|
||||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||||
# undef opendir
|
# undef opendir
|
||||||
# define opendir rpl_opendir
|
# define opendir rpl_opendir
|
||||||
|
# define GNULIB_defined_opendir 1
|
||||||
# endif
|
# endif
|
||||||
_GL_FUNCDECL_RPL (opendir, DIR *, (const char *dir_name) _GL_ARG_NONNULL ((1)));
|
_GL_FUNCDECL_RPL (opendir, DIR *, (const char *dir_name) _GL_ARG_NONNULL ((1)));
|
||||||
_GL_CXXALIAS_RPL (opendir, DIR *, (const char *dir_name));
|
_GL_CXXALIAS_RPL (opendir, DIR *, (const char *dir_name));
|
||||||
|
@ -128,6 +129,7 @@ _GL_WARN_ON_USE (rewinddir, "rewinddir is not portable - "
|
||||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||||
# undef closedir
|
# undef closedir
|
||||||
# define closedir rpl_closedir
|
# define closedir rpl_closedir
|
||||||
|
# define GNULIB_defined_closedir 1
|
||||||
# endif
|
# endif
|
||||||
_GL_FUNCDECL_RPL (closedir, int, (DIR *dirp) _GL_ARG_NONNULL ((1)));
|
_GL_FUNCDECL_RPL (closedir, int, (DIR *dirp) _GL_ARG_NONNULL ((1)));
|
||||||
_GL_CXXALIAS_RPL (closedir, int, (DIR *dirp));
|
_GL_CXXALIAS_RPL (closedir, int, (DIR *dirp));
|
||||||
|
@ -156,6 +158,13 @@ _GL_WARN_ON_USE (closedir, "closedir is not portable - "
|
||||||
# endif
|
# endif
|
||||||
_GL_FUNCDECL_RPL (dirfd, int, (DIR *) _GL_ARG_NONNULL ((1)));
|
_GL_FUNCDECL_RPL (dirfd, int, (DIR *) _GL_ARG_NONNULL ((1)));
|
||||||
_GL_CXXALIAS_RPL (dirfd, int, (DIR *));
|
_GL_CXXALIAS_RPL (dirfd, int, (DIR *));
|
||||||
|
|
||||||
|
# ifdef __KLIBC__
|
||||||
|
/* Gnulib internal hooks needed to maintain the dirfd metadata. */
|
||||||
|
_GL_EXTERN_C int _gl_register_dirp_fd (int fd, DIR *dirp)
|
||||||
|
_GL_ARG_NONNULL ((2));
|
||||||
|
_GL_EXTERN_C void _gl_unregister_dirp_fd (int fd);
|
||||||
|
# endif
|
||||||
# else
|
# else
|
||||||
# if defined __cplusplus && defined GNULIB_NAMESPACE && defined dirfd
|
# if defined __cplusplus && defined GNULIB_NAMESPACE && defined dirfd
|
||||||
/* dirfd is defined as a macro and not as a function.
|
/* dirfd is defined as a macro and not as a function.
|
||||||
|
|
68
lib/dirfd.c
68
lib/dirfd.c
|
@ -1,6 +1,6 @@
|
||||||
/* dirfd.c -- return the file descriptor associated with an open DIR*
|
/* dirfd.c -- return the file descriptor associated with an open DIR*
|
||||||
|
|
||||||
Copyright (C) 2001, 2006, 2008-2014 Free Software Foundation, Inc.
|
Copyright (C) 2001, 2006, 2008-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
@ -22,11 +22,77 @@
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
#ifdef __KLIBC__
|
||||||
|
# include <stdlib.h>
|
||||||
|
# include <io.h>
|
||||||
|
|
||||||
|
static struct dirp_fd_list
|
||||||
|
{
|
||||||
|
DIR *dirp;
|
||||||
|
int fd;
|
||||||
|
struct dirp_fd_list *next;
|
||||||
|
} *dirp_fd_start = NULL;
|
||||||
|
|
||||||
|
/* Register fd associated with dirp to dirp_fd_list. */
|
||||||
|
int
|
||||||
|
_gl_register_dirp_fd (int fd, DIR *dirp)
|
||||||
|
{
|
||||||
|
struct dirp_fd_list *new_dirp_fd = malloc (sizeof *new_dirp_fd);
|
||||||
|
if (!new_dirp_fd)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
new_dirp_fd->dirp = dirp;
|
||||||
|
new_dirp_fd->fd = fd;
|
||||||
|
new_dirp_fd->next = dirp_fd_start;
|
||||||
|
|
||||||
|
dirp_fd_start = new_dirp_fd;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Unregister fd from dirp_fd_list with closing it */
|
||||||
|
void
|
||||||
|
_gl_unregister_dirp_fd (int fd)
|
||||||
|
{
|
||||||
|
struct dirp_fd_list *dirp_fd;
|
||||||
|
struct dirp_fd_list *dirp_fd_prev;
|
||||||
|
|
||||||
|
for (dirp_fd_prev = NULL, dirp_fd = dirp_fd_start; dirp_fd;
|
||||||
|
dirp_fd_prev = dirp_fd, dirp_fd = dirp_fd->next)
|
||||||
|
{
|
||||||
|
if (dirp_fd->fd == fd)
|
||||||
|
{
|
||||||
|
if (dirp_fd_prev)
|
||||||
|
dirp_fd_prev->next = dirp_fd->next;
|
||||||
|
else /* dirp_fd == dirp_fd_start */
|
||||||
|
dirp_fd_start = dirp_fd_start->next;
|
||||||
|
|
||||||
|
close (fd);
|
||||||
|
free (dirp_fd);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
dirfd (DIR *dir_p)
|
dirfd (DIR *dir_p)
|
||||||
{
|
{
|
||||||
int fd = DIR_TO_FD (dir_p);
|
int fd = DIR_TO_FD (dir_p);
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
|
#ifndef __KLIBC__
|
||||||
errno = ENOTSUP;
|
errno = ENOTSUP;
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
struct dirp_fd_list *dirp_fd;
|
||||||
|
|
||||||
|
for (dirp_fd = dirp_fd_start; dirp_fd; dirp_fd = dirp_fd->next)
|
||||||
|
if (dirp_fd->dirp == dir_p)
|
||||||
|
return dirp_fd->fd;
|
||||||
|
|
||||||
|
errno = EINVAL;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* dirname.c -- return all but the last element in a file name
|
/* dirname.c -- return all but the last element in a file name
|
||||||
|
|
||||||
Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2014 Free Software
|
Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2016 Free Software
|
||||||
Foundation, Inc.
|
Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* Take file names apart into directory and base names.
|
/* Take file names apart into directory and base names.
|
||||||
|
|
||||||
Copyright (C) 1998, 2001, 2003-2006, 2009-2014 Free Software Foundation,
|
Copyright (C) 1998, 2001, 2003-2006, 2009-2016 Free Software Foundation,
|
||||||
Inc.
|
Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
@ -31,6 +31,10 @@
|
||||||
# define DOUBLE_SLASH_IS_DISTINCT_ROOT 0
|
# define DOUBLE_SLASH_IS_DISTINCT_ROOT 0
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
# if GNULIB_DIRNAME
|
# if GNULIB_DIRNAME
|
||||||
char *base_name (char const *file);
|
char *base_name (char const *file);
|
||||||
char *dir_name (char const *file);
|
char *dir_name (char const *file);
|
||||||
|
@ -43,4 +47,8 @@ char *last_component (char const *file) _GL_ATTRIBUTE_PURE;
|
||||||
|
|
||||||
bool strip_trailing_slashes (char *file);
|
bool strip_trailing_slashes (char *file);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} /* extern "C" */
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* not DIRNAME_H_ */
|
#endif /* not DIRNAME_H_ */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* File names on MS-DOS/Windows systems.
|
/* File names on MS-DOS/Windows systems.
|
||||||
|
|
||||||
Copyright (C) 2000-2001, 2004-2006, 2009-2014 Free Software Foundation, Inc.
|
Copyright (C) 2000-2001, 2004-2006, 2009-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
53
lib/dup2.c
53
lib/dup2.c
|
@ -1,6 +1,6 @@
|
||||||
/* Duplicate an open file descriptor to a specified file descriptor.
|
/* Duplicate an open file descriptor to a specified file descriptor.
|
||||||
|
|
||||||
Copyright (C) 1999, 2004-2007, 2009-2014 Free Software Foundation, Inc.
|
Copyright (C) 1999, 2004-2007, 2009-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
@ -85,6 +85,57 @@ ms_windows_dup2 (int fd, int desired_fd)
|
||||||
|
|
||||||
# define dup2 ms_windows_dup2
|
# define dup2 ms_windows_dup2
|
||||||
|
|
||||||
|
# elif defined __KLIBC__
|
||||||
|
|
||||||
|
# include <InnoTekLIBC/backend.h>
|
||||||
|
|
||||||
|
static int
|
||||||
|
klibc_dup2dirfd (int fd, int desired_fd)
|
||||||
|
{
|
||||||
|
int tempfd;
|
||||||
|
int dupfd;
|
||||||
|
|
||||||
|
tempfd = open ("NUL", O_RDONLY);
|
||||||
|
if (tempfd == -1)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (tempfd == desired_fd)
|
||||||
|
{
|
||||||
|
close (tempfd);
|
||||||
|
|
||||||
|
char path[_MAX_PATH];
|
||||||
|
if (__libc_Back_ioFHToPath (fd, path, sizeof (path)))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return open(path, O_RDONLY);
|
||||||
|
}
|
||||||
|
|
||||||
|
dupfd = klibc_dup2dirfd (fd, desired_fd);
|
||||||
|
|
||||||
|
close (tempfd);
|
||||||
|
|
||||||
|
return dupfd;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
klibc_dup2 (int fd, int desired_fd)
|
||||||
|
{
|
||||||
|
int dupfd;
|
||||||
|
struct stat sbuf;
|
||||||
|
|
||||||
|
dupfd = dup2 (fd, desired_fd);
|
||||||
|
if (dupfd == -1 && errno == ENOTSUP \
|
||||||
|
&& !fstat (fd, &sbuf) && S_ISDIR (sbuf.st_mode))
|
||||||
|
{
|
||||||
|
close (desired_fd);
|
||||||
|
|
||||||
|
return klibc_dup2dirfd (fd, desired_fd);
|
||||||
|
}
|
||||||
|
|
||||||
|
return dupfd;
|
||||||
|
}
|
||||||
|
|
||||||
|
# define dup2 klibc_dup2
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Duplicate a locale object.
|
/* Duplicate a locale object.
|
||||||
Copyright (C) 2009-2014 Free Software Foundation, Inc.
|
Copyright (C) 2009-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* A POSIX-like <errno.h>.
|
/* A POSIX-like <errno.h>.
|
||||||
|
|
||||||
Copyright (C) 2008-2014 Free Software Foundation, Inc.
|
Copyright (C) 2008-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* Like <fcntl.h>, but with non-working flags defined to 0.
|
/* Like <fcntl.h>, but with non-working flags defined to 0.
|
||||||
|
|
||||||
Copyright (C) 2006-2014 Free Software Foundation, Inc.
|
Copyright (C) 2006-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
extern "C" { ... } block, which leads to errors in C++ mode with the
|
extern "C" { ... } block, which leads to errors in C++ mode with the
|
||||||
overridden <sys/stat.h> from gnulib. These errors are known to be gone
|
overridden <sys/stat.h> from gnulib. These errors are known to be gone
|
||||||
with g++ version >= 4.3. */
|
with g++ version >= 4.3. */
|
||||||
#if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
|
#if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && (defined __ICC || !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))))
|
||||||
# include <sys/stat.h>
|
# include <sys/stat.h>
|
||||||
#endif
|
#endif
|
||||||
#@INCLUDE_NEXT@ @NEXT_FCNTL_H@
|
#@INCLUDE_NEXT@ @NEXT_FCNTL_H@
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
extern "C" { ... } block, which leads to errors in C++ mode with the
|
extern "C" { ... } block, which leads to errors in C++ mode with the
|
||||||
overridden <sys/stat.h> from gnulib. These errors are known to be gone
|
overridden <sys/stat.h> from gnulib. These errors are known to be gone
|
||||||
with g++ version >= 4.3. */
|
with g++ version >= 4.3. */
|
||||||
#if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
|
#if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && (defined __ICC || !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))))
|
||||||
# include <sys/stat.h>
|
# include <sys/stat.h>
|
||||||
#endif
|
#endif
|
||||||
/* The include_next requires a split double-inclusion guard. */
|
/* The include_next requires a split double-inclusion guard. */
|
||||||
|
@ -186,6 +186,22 @@ _GL_WARN_ON_USE (openat, "openat is not portable - "
|
||||||
|
|
||||||
/* Fix up the O_* macros. */
|
/* Fix up the O_* macros. */
|
||||||
|
|
||||||
|
/* AIX 7.1 with XL C 12.1 defines O_CLOEXEC, O_NOFOLLOW, and O_TTY_INIT
|
||||||
|
to values outside 'int' range, so omit these misdefinitions.
|
||||||
|
But avoid namespace pollution on non-AIX systems. */
|
||||||
|
#ifdef _AIX
|
||||||
|
# include <limits.h>
|
||||||
|
# if defined O_CLOEXEC && ! (INT_MIN <= O_CLOEXEC && O_CLOEXEC <= INT_MAX)
|
||||||
|
# undef O_CLOEXEC
|
||||||
|
# endif
|
||||||
|
# if defined O_NOFOLLOW && ! (INT_MIN <= O_NOFOLLOW && O_NOFOLLOW <= INT_MAX)
|
||||||
|
# undef O_NOFOLLOW
|
||||||
|
# endif
|
||||||
|
# if defined O_TTY_INIT && ! (INT_MIN <= O_TTY_INIT && O_TTY_INIT <= INT_MAX)
|
||||||
|
# undef O_TTY_INIT
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined O_DIRECT && defined O_DIRECTIO
|
#if !defined O_DIRECT && defined O_DIRECTIO
|
||||||
/* Tru64 spells it 'O_DIRECTIO'. */
|
/* Tru64 spells it 'O_DIRECTIO'. */
|
||||||
# define O_DIRECT O_DIRECTIO
|
# define O_DIRECT O_DIRECTIO
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Hook for making making file descriptor functions close(), ioctl() extensible.
|
/* Hook for making making file descriptor functions close(), ioctl() extensible.
|
||||||
Copyright (C) 2009-2014 Free Software Foundation, Inc.
|
Copyright (C) 2009-2016 Free Software Foundation, Inc.
|
||||||
Written by Bruno Haible <bruno@clisp.org>, 2009.
|
Written by Bruno Haible <bruno@clisp.org>, 2009.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify it
|
This program is free software: you can redistribute it and/or modify it
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Hook for making making file descriptor functions close(), ioctl() extensible.
|
/* Hook for making making file descriptor functions close(), ioctl() extensible.
|
||||||
Copyright (C) 2009-2014 Free Software Foundation, Inc.
|
Copyright (C) 2009-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify it
|
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
|
under the terms of the GNU Lesser General Public License as published
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Supplemental information about the floating-point formats.
|
/* Supplemental information about the floating-point formats.
|
||||||
Copyright (C) 2007, 2009-2014 Free Software Foundation, Inc.
|
Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
|
||||||
Written by Bruno Haible <bruno@clisp.org>, 2007.
|
Written by Bruno Haible <bruno@clisp.org>, 2007.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Auxiliary definitions for <float.h>.
|
/* Auxiliary definitions for <float.h>.
|
||||||
Copyright (C) 2011-2014 Free Software Foundation, Inc.
|
Copyright (C) 2011-2016 Free Software Foundation, Inc.
|
||||||
Written by Bruno Haible <bruno@clisp.org>, 2011.
|
Written by Bruno Haible <bruno@clisp.org>, 2011.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* A correct <float.h>.
|
/* A correct <float.h>.
|
||||||
|
|
||||||
Copyright (C) 2007-2014 Free Software Foundation, Inc.
|
Copyright (C) 2007-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
Written by Richard W.M. Jones <rjones.at.redhat.com>
|
Written by Richard W.M. Jones <rjones.at.redhat.com>
|
||||||
|
|
||||||
Copyright (C) 2008-2014 Free Software Foundation, Inc.
|
Copyright (C) 2008-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Lesser General Public
|
modify it under the terms of the GNU Lesser General Public
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Round towards negative infinity.
|
/* Round towards negative infinity.
|
||||||
Copyright (C) 2007, 2010-2014 Free Software Foundation, Inc.
|
Copyright (C) 2007, 2010-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Split a double into fraction and mantissa.
|
/* Split a double into fraction and mantissa.
|
||||||
Copyright (C) 2007-2014 Free Software Foundation, Inc.
|
Copyright (C) 2007-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* fstat() replacement.
|
/* fstat() replacement.
|
||||||
Copyright (C) 2011-2014 Free Software Foundation, Inc.
|
Copyright (C) 2011-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
Written by Richard W.M. Jones <rjones.at.redhat.com>
|
Written by Richard W.M. Jones <rjones.at.redhat.com>
|
||||||
|
|
||||||
Copyright (C) 2008-2014 Free Software Foundation, Inc.
|
Copyright (C) 2008-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Lesser General Public
|
modify it under the terms of the GNU Lesser General Public
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* An interface to read that retries after partial reads and interrupts.
|
/* An interface to read that retries after partial reads and interrupts.
|
||||||
Copyright (C) 2002-2003, 2009-2014 Free Software Foundation, Inc.
|
Copyright (C) 2002-2003, 2009-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* An interface to read() that reads all it is asked to read.
|
/* An interface to read() that reads all it is asked to read.
|
||||||
|
|
||||||
Copyright (C) 2002, 2009-2014 Free Software Foundation, Inc.
|
Copyright (C) 2002, 2009-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
@ -13,7 +13,6 @@
|
||||||
GNU Lesser General Public License for more details.
|
GNU Lesser General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
You should have received a copy of the GNU Lesser General Public License
|
||||||
along with this program; if not, read to the Free Software Foundation,
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* An interface to read and write that retries (if necessary) until complete.
|
/* An interface to read and write that retries (if necessary) until complete.
|
||||||
|
|
||||||
Copyright (C) 1993-1994, 1997-2006, 2009-2014 Free Software Foundation, Inc.
|
Copyright (C) 1993-1994, 1997-2006, 2009-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* An interface to write() that writes all it is asked to write.
|
/* An interface to write() that writes all it is asked to write.
|
||||||
|
|
||||||
Copyright (C) 2002-2003, 2009-2014 Free Software Foundation, Inc.
|
Copyright (C) 2002-2003, 2009-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* Copyright (C) 1997, 2001-2002, 2004-2006, 2008-2014 Free Software
|
/* Copyright (C) 1997, 2001-2002, 2004-2006, 2008-2016 Free Software
|
||||||
Foundation, Inc.
|
Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
Contributed by Philip Blundell <pjb27@cam.ac.uk>, 1997.
|
Contributed by Philip Blundell <pjb27@cam.ac.uk>, 1997.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Get address information (partial implementation).
|
/* Get address information (partial implementation).
|
||||||
Copyright (C) 1997, 2001-2002, 2004-2014 Free Software Foundation, Inc.
|
Copyright (C) 1997, 2001-2002, 2004-2016 Free Software Foundation, Inc.
|
||||||
Contributed by Simon Josefsson <simon@josefsson.org>.
|
Contributed by Simon Josefsson <simon@josefsson.org>.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* Provide a working getlogin for systems which lack it.
|
/* Provide a working getlogin for systems which lack it.
|
||||||
|
|
||||||
Copyright (C) 2010-2014 Free Software Foundation, Inc.
|
Copyright (C) 2010-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* getpeername.c --- wrappers for Windows getpeername function
|
/* getpeername.c --- wrappers for Windows getpeername function
|
||||||
|
|
||||||
Copyright (C) 2008-2014 Free Software Foundation, Inc.
|
Copyright (C) 2008-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* getsockname.c --- wrappers for Windows getsockname function
|
/* getsockname.c --- wrappers for Windows getsockname function
|
||||||
|
|
||||||
Copyright (C) 2008-2014 Free Software Foundation, Inc.
|
Copyright (C) 2008-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* getsockopt.c --- wrappers for Windows getsockopt function
|
/* getsockopt.c --- wrappers for Windows getsockopt function
|
||||||
|
|
||||||
Copyright (C) 2008-2014 Free Software Foundation, Inc.
|
Copyright (C) 2008-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Convenience header for conditional use of GNU <libintl.h>.
|
/* Convenience header for conditional use of GNU <libintl.h>.
|
||||||
Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2014 Free Software
|
Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2016 Free Software
|
||||||
Foundation, Inc.
|
Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
@ -225,15 +225,17 @@ dcpgettext_expr (const char *domain,
|
||||||
if (msg_ctxt_id != NULL)
|
if (msg_ctxt_id != NULL)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
int found_translation;
|
||||||
memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
|
memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
|
||||||
msg_ctxt_id[msgctxt_len - 1] = '\004';
|
msg_ctxt_id[msgctxt_len - 1] = '\004';
|
||||||
memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
|
memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
|
||||||
translation = dcgettext (domain, msg_ctxt_id, category);
|
translation = dcgettext (domain, msg_ctxt_id, category);
|
||||||
|
found_translation = (translation != msg_ctxt_id);
|
||||||
#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
|
#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
|
||||||
if (msg_ctxt_id != buf)
|
if (msg_ctxt_id != buf)
|
||||||
free (msg_ctxt_id);
|
free (msg_ctxt_id);
|
||||||
#endif
|
#endif
|
||||||
if (translation != msg_ctxt_id)
|
if (found_translation)
|
||||||
return translation;
|
return translation;
|
||||||
}
|
}
|
||||||
return msgid;
|
return msgid;
|
||||||
|
@ -271,15 +273,17 @@ dcnpgettext_expr (const char *domain,
|
||||||
if (msg_ctxt_id != NULL)
|
if (msg_ctxt_id != NULL)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
int found_translation;
|
||||||
memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
|
memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
|
||||||
msg_ctxt_id[msgctxt_len - 1] = '\004';
|
msg_ctxt_id[msgctxt_len - 1] = '\004';
|
||||||
memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
|
memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
|
||||||
translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
|
translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
|
||||||
|
found_translation = !(translation == msg_ctxt_id || translation == msgid_plural);
|
||||||
#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
|
#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
|
||||||
if (msg_ctxt_id != buf)
|
if (msg_ctxt_id != buf)
|
||||||
free (msg_ctxt_id);
|
free (msg_ctxt_id);
|
||||||
#endif
|
#endif
|
||||||
if (!(translation == msg_ctxt_id || translation == msgid_plural))
|
if (found_translation)
|
||||||
return translation;
|
return translation;
|
||||||
}
|
}
|
||||||
return (n == 1 ? msgid : msgid_plural);
|
return (n == 1 ? msgid : msgid_plural);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* Provide gettimeofday for systems that don't have it or for which it's broken.
|
/* Provide gettimeofday for systems that don't have it or for which it's broken.
|
||||||
|
|
||||||
Copyright (C) 2001-2003, 2005-2007, 2009-2014 Free Software Foundation, Inc.
|
Copyright (C) 2001-2003, 2005-2007, 2009-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
72
lib/hard-locale.c
Normal file
72
lib/hard-locale.c
Normal file
|
@ -0,0 +1,72 @@
|
||||||
|
/* hard-locale.c -- Determine whether a locale is hard.
|
||||||
|
|
||||||
|
Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2016 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 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 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 <http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
|
#include "hard-locale.h"
|
||||||
|
|
||||||
|
#include <locale.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#ifdef __GLIBC__
|
||||||
|
# define GLIBC_VERSION __GLIBC__
|
||||||
|
#elif defined __UCLIBC__
|
||||||
|
# define GLIBC_VERSION 2
|
||||||
|
#else
|
||||||
|
# define GLIBC_VERSION 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Return true if the current CATEGORY locale is hard, i.e. if you
|
||||||
|
can't get away with assuming traditional C or POSIX behavior. */
|
||||||
|
bool
|
||||||
|
hard_locale (int category)
|
||||||
|
{
|
||||||
|
bool hard = true;
|
||||||
|
char const *p = setlocale (category, NULL);
|
||||||
|
|
||||||
|
if (p)
|
||||||
|
{
|
||||||
|
if (2 <= GLIBC_VERSION)
|
||||||
|
{
|
||||||
|
if (strcmp (p, "C") == 0 || strcmp (p, "POSIX") == 0)
|
||||||
|
hard = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
char *locale = strdup (p);
|
||||||
|
if (locale)
|
||||||
|
{
|
||||||
|
/* Temporarily set the locale to the "C" and "POSIX" locales
|
||||||
|
to find their names, so that we can determine whether one
|
||||||
|
or the other is the caller's locale. */
|
||||||
|
if (((p = setlocale (category, "C"))
|
||||||
|
&& strcmp (p, locale) == 0)
|
||||||
|
|| ((p = setlocale (category, "POSIX"))
|
||||||
|
&& strcmp (p, locale) == 0))
|
||||||
|
hard = false;
|
||||||
|
|
||||||
|
/* Restore the caller's locale. */
|
||||||
|
setlocale (category, locale);
|
||||||
|
free (locale);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return hard;
|
||||||
|
}
|
25
lib/hard-locale.h
Normal file
25
lib/hard-locale.h
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
/* Determine whether a locale is hard.
|
||||||
|
|
||||||
|
Copyright (C) 1999, 2003-2004, 2009-2016 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 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 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 <http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
#ifndef HARD_LOCALE_H_
|
||||||
|
# define HARD_LOCALE_H_ 1
|
||||||
|
|
||||||
|
# include <stdbool.h>
|
||||||
|
|
||||||
|
bool hard_locale (int);
|
||||||
|
|
||||||
|
#endif /* HARD_LOCALE_H_ */
|
|
@ -1,5 +1,5 @@
|
||||||
/* Character set conversion.
|
/* Character set conversion.
|
||||||
Copyright (C) 1999-2001, 2007, 2009-2014 Free Software Foundation, Inc.
|
Copyright (C) 1999-2001, 2007, 2009-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* A GNU-like <iconv.h>.
|
/* A GNU-like <iconv.h>.
|
||||||
|
|
||||||
Copyright (C) 2007-2014 Free Software Foundation, Inc.
|
Copyright (C) 2007-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Character set conversion.
|
/* Character set conversion.
|
||||||
Copyright (C) 2007, 2009-2014 Free Software Foundation, Inc.
|
Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Character set conversion.
|
/* Character set conversion.
|
||||||
Copyright (C) 2007, 2009-2014 Free Software Foundation, Inc.
|
Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Character set conversion handler type.
|
/* Character set conversion handler type.
|
||||||
Copyright (C) 2001-2007, 2009-2014 Free Software Foundation, Inc.
|
Copyright (C) 2001-2007, 2009-2016 Free Software Foundation, Inc.
|
||||||
Written by Bruno Haible.
|
Written by Bruno Haible.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form
|
/* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form
|
||||||
|
|
||||||
Copyright (C) 2005-2006, 2008-2014 Free Software Foundation, Inc.
|
Copyright (C) 2005-2006, 2008-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
/* Use this to suppress gcc's "...may be used before initialized" warnings.
|
/* Use this to suppress gcc's "...may be used before initialized" warnings.
|
||||||
Beware: The Code argument must not contain commas. */
|
Beware: The Code argument must not contain commas. */
|
||||||
#ifndef IF_LINT
|
#ifndef IF_LINT
|
||||||
# ifdef lint
|
# if defined GCC_LINT || defined lint
|
||||||
# define IF_LINT(Code) Code
|
# define IF_LINT(Code) Code
|
||||||
# else
|
# else
|
||||||
# define IF_LINT(Code) /* empty */
|
# define IF_LINT(Code) /* empty */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* inet_pton.c -- convert IPv4 and IPv6 addresses from text to binary form
|
/* inet_pton.c -- convert IPv4 and IPv6 addresses from text to binary form
|
||||||
|
|
||||||
Copyright (C) 2006, 2008-2014 Free Software Foundation, Inc.
|
Copyright (C) 2006, 2008-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
445
lib/intprops.h
Normal file
445
lib/intprops.h
Normal file
|
@ -0,0 +1,445 @@
|
||||||
|
/* intprops.h -- properties of integer types
|
||||||
|
|
||||||
|
Copyright (C) 2001-2016 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 <http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
/* Written by Paul Eggert. */
|
||||||
|
|
||||||
|
#ifndef _GL_INTPROPS_H
|
||||||
|
#define _GL_INTPROPS_H
|
||||||
|
|
||||||
|
#include <limits.h>
|
||||||
|
#include <verify.h>
|
||||||
|
|
||||||
|
/* Return a value with the common real type of E and V and the value of V. */
|
||||||
|
#define _GL_INT_CONVERT(e, v) (0 * (e) + (v))
|
||||||
|
|
||||||
|
/* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see
|
||||||
|
<http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00406.html>. */
|
||||||
|
#define _GL_INT_NEGATE_CONVERT(e, v) (0 * (e) - (v))
|
||||||
|
|
||||||
|
/* 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 the real type T is signed. */
|
||||||
|
#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
|
||||||
|
|
||||||
|
/* Return 1 if the real expression E, after promotion, has a
|
||||||
|
signed or floating type. */
|
||||||
|
#define EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0)
|
||||||
|
|
||||||
|
|
||||||
|
/* Minimum and maximum values for integer types and expressions. */
|
||||||
|
|
||||||
|
/* The maximum and minimum values for the integer type T. */
|
||||||
|
#define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t))
|
||||||
|
#define TYPE_MAXIMUM(t) \
|
||||||
|
((t) (! TYPE_SIGNED (t) \
|
||||||
|
? (t) -1 \
|
||||||
|
: ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
|
||||||
|
|
||||||
|
/* The maximum and minimum values for the type of the expression E,
|
||||||
|
after integer promotion. E should not have side effects. */
|
||||||
|
#define _GL_INT_MINIMUM(e) \
|
||||||
|
(EXPR_SIGNED (e) \
|
||||||
|
? ~ _GL_SIGNED_INT_MAXIMUM (e) \
|
||||||
|
: _GL_INT_CONVERT (e, 0))
|
||||||
|
#define _GL_INT_MAXIMUM(e) \
|
||||||
|
(EXPR_SIGNED (e) \
|
||||||
|
? _GL_SIGNED_INT_MAXIMUM (e) \
|
||||||
|
: _GL_INT_NEGATE_CONVERT (e, 1))
|
||||||
|
#define _GL_SIGNED_INT_MAXIMUM(e) \
|
||||||
|
(((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) * 2 + 1)
|
||||||
|
|
||||||
|
/* This include file assumes that signed types are two's complement without
|
||||||
|
padding bits; the above macros have undefined behavior otherwise.
|
||||||
|
If this is a problem for you, please let us know how to fix it for your host.
|
||||||
|
As a sanity check, test the assumption for some signed types that
|
||||||
|
<limits.h> bounds. */
|
||||||
|
verify (TYPE_MINIMUM (signed char) == SCHAR_MIN);
|
||||||
|
verify (TYPE_MAXIMUM (signed char) == SCHAR_MAX);
|
||||||
|
verify (TYPE_MINIMUM (short int) == SHRT_MIN);
|
||||||
|
verify (TYPE_MAXIMUM (short int) == SHRT_MAX);
|
||||||
|
verify (TYPE_MINIMUM (int) == INT_MIN);
|
||||||
|
verify (TYPE_MAXIMUM (int) == INT_MAX);
|
||||||
|
verify (TYPE_MINIMUM (long int) == LONG_MIN);
|
||||||
|
verify (TYPE_MAXIMUM (long int) == LONG_MAX);
|
||||||
|
#ifdef LLONG_MAX
|
||||||
|
verify (TYPE_MINIMUM (long long int) == LLONG_MIN);
|
||||||
|
verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Does the __typeof__ keyword work? This could be done by
|
||||||
|
'configure', but for now it's easier to do it by hand. */
|
||||||
|
#if (2 <= __GNUC__ || defined __IBM__TYPEOF__ \
|
||||||
|
|| (0x5110 <= __SUNPRO_C && !__STDC__))
|
||||||
|
# define _GL_HAVE___TYPEOF__ 1
|
||||||
|
#else
|
||||||
|
# define _GL_HAVE___TYPEOF__ 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Return 1 if the integer type or expression T might be signed. Return 0
|
||||||
|
if it is definitely unsigned. This macro does not evaluate its argument,
|
||||||
|
and expands to an integer constant expression. */
|
||||||
|
#if _GL_HAVE___TYPEOF__
|
||||||
|
# define _GL_SIGNED_TYPE_OR_EXPR(t) TYPE_SIGNED (__typeof__ (t))
|
||||||
|
#else
|
||||||
|
# define _GL_SIGNED_TYPE_OR_EXPR(t) 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Bound on length of the string representing an unsigned integer
|
||||||
|
value representable in B bits. log10 (2.0) < 146/485. The
|
||||||
|
smallest value of B where this bound is not tight is 2621. */
|
||||||
|
#define INT_BITS_STRLEN_BOUND(b) (((b) * 146 + 484) / 485)
|
||||||
|
|
||||||
|
/* Bound on length of the string representing an integer type or expression T.
|
||||||
|
Subtract 1 for the sign bit if T is signed, and then add 1 more for
|
||||||
|
a minus sign if needed.
|
||||||
|
|
||||||
|
Because _GL_SIGNED_TYPE_OR_EXPR sometimes returns 0 when its argument is
|
||||||
|
signed, this macro may overestimate the true bound by one byte when
|
||||||
|
applied to unsigned types of size 2, 4, 16, ... bytes. */
|
||||||
|
#define INT_STRLEN_BOUND(t) \
|
||||||
|
(INT_BITS_STRLEN_BOUND (sizeof (t) * CHAR_BIT \
|
||||||
|
- _GL_SIGNED_TYPE_OR_EXPR (t)) \
|
||||||
|
+ _GL_SIGNED_TYPE_OR_EXPR (t))
|
||||||
|
|
||||||
|
/* 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)
|
||||||
|
|
||||||
|
|
||||||
|
/* Range overflow checks.
|
||||||
|
|
||||||
|
The INT_<op>_RANGE_OVERFLOW macros return 1 if the corresponding C
|
||||||
|
operators might not yield numerically correct answers due to
|
||||||
|
arithmetic overflow. They do not rely on undefined or
|
||||||
|
implementation-defined behavior. Their implementations are simple
|
||||||
|
and straightforward, but they are a bit harder to use than the
|
||||||
|
INT_<op>_OVERFLOW macros described below.
|
||||||
|
|
||||||
|
Example usage:
|
||||||
|
|
||||||
|
long int i = ...;
|
||||||
|
long int j = ...;
|
||||||
|
if (INT_MULTIPLY_RANGE_OVERFLOW (i, j, LONG_MIN, LONG_MAX))
|
||||||
|
printf ("multiply would overflow");
|
||||||
|
else
|
||||||
|
printf ("product is %ld", i * j);
|
||||||
|
|
||||||
|
Restrictions on *_RANGE_OVERFLOW macros:
|
||||||
|
|
||||||
|
These macros do not check for all possible numerical problems or
|
||||||
|
undefined or unspecified behavior: they do not check for division
|
||||||
|
by zero, for bad shift counts, or for shifting negative numbers.
|
||||||
|
|
||||||
|
These macros may evaluate their arguments zero or multiple times,
|
||||||
|
so the arguments should not have side effects. The arithmetic
|
||||||
|
arguments (including the MIN and MAX arguments) must be of the same
|
||||||
|
integer type after the usual arithmetic conversions, and the type
|
||||||
|
must have minimum value MIN and maximum MAX. Unsigned types should
|
||||||
|
use a zero MIN of the proper type.
|
||||||
|
|
||||||
|
These macros are tuned for constant MIN and MAX. For commutative
|
||||||
|
operations such as A + B, they are also tuned for constant B. */
|
||||||
|
|
||||||
|
/* Return 1 if A + B would overflow in [MIN,MAX] arithmetic.
|
||||||
|
See above for restrictions. */
|
||||||
|
#define INT_ADD_RANGE_OVERFLOW(a, b, min, max) \
|
||||||
|
((b) < 0 \
|
||||||
|
? (a) < (min) - (b) \
|
||||||
|
: (max) - (b) < (a))
|
||||||
|
|
||||||
|
/* Return 1 if A - B would overflow in [MIN,MAX] arithmetic.
|
||||||
|
See above for restrictions. */
|
||||||
|
#define INT_SUBTRACT_RANGE_OVERFLOW(a, b, min, max) \
|
||||||
|
((b) < 0 \
|
||||||
|
? (max) + (b) < (a) \
|
||||||
|
: (a) < (min) + (b))
|
||||||
|
|
||||||
|
/* Return 1 if - A would overflow in [MIN,MAX] arithmetic.
|
||||||
|
See above for restrictions. */
|
||||||
|
#define INT_NEGATE_RANGE_OVERFLOW(a, min, max) \
|
||||||
|
((min) < 0 \
|
||||||
|
? (a) < - (max) \
|
||||||
|
: 0 < (a))
|
||||||
|
|
||||||
|
/* Return 1 if A * B would overflow in [MIN,MAX] arithmetic.
|
||||||
|
See above for restrictions. Avoid && and || as they tickle
|
||||||
|
bugs in Sun C 5.11 2010/08/13 and other compilers; see
|
||||||
|
<http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00401.html>. */
|
||||||
|
#define INT_MULTIPLY_RANGE_OVERFLOW(a, b, min, max) \
|
||||||
|
((b) < 0 \
|
||||||
|
? ((a) < 0 \
|
||||||
|
? (a) < (max) / (b) \
|
||||||
|
: (b) == -1 \
|
||||||
|
? 0 \
|
||||||
|
: (min) / (b) < (a)) \
|
||||||
|
: (b) == 0 \
|
||||||
|
? 0 \
|
||||||
|
: ((a) < 0 \
|
||||||
|
? (a) < (min) / (b) \
|
||||||
|
: (max) / (b) < (a)))
|
||||||
|
|
||||||
|
/* Return 1 if A / B would overflow in [MIN,MAX] arithmetic.
|
||||||
|
See above for restrictions. Do not check for division by zero. */
|
||||||
|
#define INT_DIVIDE_RANGE_OVERFLOW(a, b, min, max) \
|
||||||
|
((min) < 0 && (b) == -1 && (a) < - (max))
|
||||||
|
|
||||||
|
/* Return 1 if A % B would overflow in [MIN,MAX] arithmetic.
|
||||||
|
See above for restrictions. Do not check for division by zero.
|
||||||
|
Mathematically, % should never overflow, but on x86-like hosts
|
||||||
|
INT_MIN % -1 traps, and the C standard permits this, so treat this
|
||||||
|
as an overflow too. */
|
||||||
|
#define INT_REMAINDER_RANGE_OVERFLOW(a, b, min, max) \
|
||||||
|
INT_DIVIDE_RANGE_OVERFLOW (a, b, min, max)
|
||||||
|
|
||||||
|
/* Return 1 if A << B would overflow in [MIN,MAX] arithmetic.
|
||||||
|
See above for restrictions. Here, MIN and MAX are for A only, and B need
|
||||||
|
not be of the same type as the other arguments. The C standard says that
|
||||||
|
behavior is undefined for shifts unless 0 <= B < wordwidth, and that when
|
||||||
|
A is negative then A << B has undefined behavior and A >> B has
|
||||||
|
implementation-defined behavior, but do not check these other
|
||||||
|
restrictions. */
|
||||||
|
#define INT_LEFT_SHIFT_RANGE_OVERFLOW(a, b, min, max) \
|
||||||
|
((a) < 0 \
|
||||||
|
? (a) < (min) >> (b) \
|
||||||
|
: (max) >> (b) < (a))
|
||||||
|
|
||||||
|
/* True if __builtin_add_overflow (A, B, P) works when P is null. */
|
||||||
|
#define _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL (7 <= __GNUC__)
|
||||||
|
|
||||||
|
/* The _GL*_OVERFLOW macros have the same restrictions as the
|
||||||
|
*_RANGE_OVERFLOW macros, except that they do not assume that operands
|
||||||
|
(e.g., A and B) have the same type as MIN and MAX. Instead, they assume
|
||||||
|
that the result (e.g., A + B) has that type. */
|
||||||
|
#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
|
||||||
|
# define _GL_ADD_OVERFLOW(a, b, min, max)
|
||||||
|
__builtin_add_overflow (a, b, (__typeof__ ((a) + (b)) *) 0)
|
||||||
|
# define _GL_SUBTRACT_OVERFLOW(a, b, min, max)
|
||||||
|
__builtin_sub_overflow (a, b, (__typeof__ ((a) - (b)) *) 0)
|
||||||
|
# define _GL_MULTIPLY_OVERFLOW(a, b, min, max)
|
||||||
|
__builtin_mul_overflow (a, b, (__typeof__ ((a) * (b)) *) 0)
|
||||||
|
#else
|
||||||
|
# define _GL_ADD_OVERFLOW(a, b, min, max) \
|
||||||
|
((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min, max) \
|
||||||
|
: (a) < 0 ? (b) <= (a) + (b) \
|
||||||
|
: (b) < 0 ? (a) <= (a) + (b) \
|
||||||
|
: (a) + (b) < (b))
|
||||||
|
# define _GL_SUBTRACT_OVERFLOW(a, b, min, max) \
|
||||||
|
((min) < 0 ? INT_SUBTRACT_RANGE_OVERFLOW (a, b, min, max) \
|
||||||
|
: (a) < 0 ? 1 \
|
||||||
|
: (b) < 0 ? (a) - (b) <= (a) \
|
||||||
|
: (a) < (b))
|
||||||
|
# define _GL_MULTIPLY_OVERFLOW(a, b, min, max) \
|
||||||
|
(((min) == 0 && (((a) < 0 && 0 < (b)) || ((b) < 0 && 0 < (a)))) \
|
||||||
|
|| INT_MULTIPLY_RANGE_OVERFLOW (a, b, min, max))
|
||||||
|
#endif
|
||||||
|
#define _GL_DIVIDE_OVERFLOW(a, b, min, max) \
|
||||||
|
((min) < 0 ? (b) == _GL_INT_NEGATE_CONVERT (min, 1) && (a) < - (max) \
|
||||||
|
: (a) < 0 ? (b) <= (a) + (b) - 1 \
|
||||||
|
: (b) < 0 && (a) + (b) <= (a))
|
||||||
|
#define _GL_REMAINDER_OVERFLOW(a, b, min, max) \
|
||||||
|
((min) < 0 ? (b) == _GL_INT_NEGATE_CONVERT (min, 1) && (a) < - (max) \
|
||||||
|
: (a) < 0 ? (a) % (b) != ((max) - (b) + 1) % (b) \
|
||||||
|
: (b) < 0 && ! _GL_UNSIGNED_NEG_MULTIPLE (a, b, max))
|
||||||
|
|
||||||
|
/* Return a nonzero value if A is a mathematical multiple of B, where
|
||||||
|
A is unsigned, B is negative, and MAX is the maximum value of A's
|
||||||
|
type. A's type must be the same as (A % B)'s type. Normally (A %
|
||||||
|
-B == 0) suffices, but things get tricky if -B would overflow. */
|
||||||
|
#define _GL_UNSIGNED_NEG_MULTIPLE(a, b, max) \
|
||||||
|
(((b) < -_GL_SIGNED_INT_MAXIMUM (b) \
|
||||||
|
? (_GL_SIGNED_INT_MAXIMUM (b) == (max) \
|
||||||
|
? (a) \
|
||||||
|
: (a) % (_GL_INT_CONVERT (a, _GL_SIGNED_INT_MAXIMUM (b)) + 1)) \
|
||||||
|
: (a) % - (b)) \
|
||||||
|
== 0)
|
||||||
|
|
||||||
|
/* Check for integer overflow, and report low order bits of answer.
|
||||||
|
|
||||||
|
The INT_<op>_OVERFLOW macros return 1 if the corresponding C operators
|
||||||
|
might not yield numerically correct answers due to arithmetic overflow.
|
||||||
|
The INT_<op>_WRAPV macros also store the low-order bits of the answer.
|
||||||
|
These macros work correctly on all known practical hosts, and do not rely
|
||||||
|
on undefined behavior due to signed arithmetic overflow.
|
||||||
|
|
||||||
|
Example usage, assuming A and B are long int:
|
||||||
|
|
||||||
|
if (INT_MULTIPLY_OVERFLOW (a, b))
|
||||||
|
printf ("result would overflow\n");
|
||||||
|
else
|
||||||
|
printf ("result is %ld (no overflow)\n", a * b);
|
||||||
|
|
||||||
|
Example usage with WRAPV flavor:
|
||||||
|
|
||||||
|
long int result;
|
||||||
|
bool overflow = INT_MULTIPLY_WRAPV (a, b, &result);
|
||||||
|
printf ("result is %ld (%s)\n", result,
|
||||||
|
overflow ? "after overflow" : "no overflow");
|
||||||
|
|
||||||
|
Restrictions on these macros:
|
||||||
|
|
||||||
|
These macros do not check for all possible numerical problems or
|
||||||
|
undefined or unspecified behavior: they do not check for division
|
||||||
|
by zero, for bad shift counts, or for shifting negative numbers.
|
||||||
|
|
||||||
|
These macros may evaluate their arguments zero or multiple times, so the
|
||||||
|
arguments should not have side effects.
|
||||||
|
|
||||||
|
The WRAPV macros are not constant expressions. They support only
|
||||||
|
+, binary -, and *. The result type must be signed.
|
||||||
|
|
||||||
|
These macros are tuned for their last argument being a constant.
|
||||||
|
|
||||||
|
Return 1 if the integer expressions A * B, A - B, -A, A * B, A / B,
|
||||||
|
A % B, and A << B would overflow, respectively. */
|
||||||
|
|
||||||
|
#define INT_ADD_OVERFLOW(a, b) \
|
||||||
|
_GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW)
|
||||||
|
#define INT_SUBTRACT_OVERFLOW(a, b) \
|
||||||
|
_GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW)
|
||||||
|
#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL
|
||||||
|
# define INT_NEGATE_OVERFLOW(a) INT_SUBTRACT_OVERFLOW (0, a)
|
||||||
|
#else
|
||||||
|
# define INT_NEGATE_OVERFLOW(a) \
|
||||||
|
INT_NEGATE_RANGE_OVERFLOW (a, _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a))
|
||||||
|
#endif
|
||||||
|
#define INT_MULTIPLY_OVERFLOW(a, b) \
|
||||||
|
_GL_BINARY_OP_OVERFLOW (a, b, _GL_MULTIPLY_OVERFLOW)
|
||||||
|
#define INT_DIVIDE_OVERFLOW(a, b) \
|
||||||
|
_GL_BINARY_OP_OVERFLOW (a, b, _GL_DIVIDE_OVERFLOW)
|
||||||
|
#define INT_REMAINDER_OVERFLOW(a, b) \
|
||||||
|
_GL_BINARY_OP_OVERFLOW (a, b, _GL_REMAINDER_OVERFLOW)
|
||||||
|
#define INT_LEFT_SHIFT_OVERFLOW(a, b) \
|
||||||
|
INT_LEFT_SHIFT_RANGE_OVERFLOW (a, b, \
|
||||||
|
_GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a))
|
||||||
|
|
||||||
|
/* Return 1 if the expression A <op> B would overflow,
|
||||||
|
where OP_RESULT_OVERFLOW (A, B, MIN, MAX) does the actual test,
|
||||||
|
assuming MIN and MAX are the minimum and maximum for the result type.
|
||||||
|
Arguments should be free of side effects. */
|
||||||
|
#define _GL_BINARY_OP_OVERFLOW(a, b, op_result_overflow) \
|
||||||
|
op_result_overflow (a, b, \
|
||||||
|
_GL_INT_MINIMUM (0 * (b) + (a)), \
|
||||||
|
_GL_INT_MAXIMUM (0 * (b) + (a)))
|
||||||
|
|
||||||
|
/* Store the low-order bits of A + B, A - B, A * B, respectively, into *R.
|
||||||
|
Return 1 if the result overflows. See above for restrictions. */
|
||||||
|
#define INT_ADD_WRAPV(a, b, r) \
|
||||||
|
_GL_INT_OP_WRAPV (a, b, r, +, __builtin_add_overflow, INT_ADD_OVERFLOW)
|
||||||
|
#define INT_SUBTRACT_WRAPV(a, b, r) \
|
||||||
|
_GL_INT_OP_WRAPV (a, b, r, -, __builtin_sub_overflow, INT_SUBTRACT_OVERFLOW)
|
||||||
|
#define INT_MULTIPLY_WRAPV(a, b, r) \
|
||||||
|
_GL_INT_OP_WRAPV (a, b, r, *, __builtin_mul_overflow, INT_MULTIPLY_OVERFLOW)
|
||||||
|
|
||||||
|
#ifndef __has_builtin
|
||||||
|
# define __has_builtin(x) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390. See:
|
||||||
|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193
|
||||||
|
https://llvm.org/bugs/show_bug.cgi?id=25390
|
||||||
|
For now, assume all versions of GCC-like compilers generate bogus
|
||||||
|
warnings for _Generic. This matters only for older compilers that
|
||||||
|
lack __builtin_add_overflow. */
|
||||||
|
#if __GNUC__
|
||||||
|
# define _GL__GENERIC_BOGUS 1
|
||||||
|
#else
|
||||||
|
# define _GL__GENERIC_BOGUS 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Store the low-order bits of A <op> B into *R, where OP specifies
|
||||||
|
the operation. BUILTIN is the builtin operation, and OVERFLOW the
|
||||||
|
overflow predicate. Return 1 if the result overflows. See above
|
||||||
|
for restrictions. */
|
||||||
|
#if 5 <= __GNUC__ || __has_builtin (__builtin_add_overflow)
|
||||||
|
# define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) builtin (a, b, r)
|
||||||
|
#elif 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS
|
||||||
|
# define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \
|
||||||
|
(_Generic \
|
||||||
|
(*(r), \
|
||||||
|
signed char: \
|
||||||
|
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned char, \
|
||||||
|
signed char, SCHAR_MIN, SCHAR_MAX), \
|
||||||
|
short int: \
|
||||||
|
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned short int, \
|
||||||
|
short int, SHRT_MIN, SHRT_MAX), \
|
||||||
|
int: \
|
||||||
|
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
|
||||||
|
int, INT_MIN, INT_MAX), \
|
||||||
|
long int: \
|
||||||
|
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
|
||||||
|
long int, LONG_MIN, LONG_MAX), \
|
||||||
|
long long int: \
|
||||||
|
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
|
||||||
|
long long int, LLONG_MIN, LLONG_MAX)))
|
||||||
|
#else
|
||||||
|
# define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \
|
||||||
|
(sizeof *(r) == sizeof (signed char) \
|
||||||
|
? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned char, \
|
||||||
|
signed char, SCHAR_MIN, SCHAR_MAX) \
|
||||||
|
: sizeof *(r) == sizeof (short int) \
|
||||||
|
? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned short int, \
|
||||||
|
short int, SHRT_MIN, SHRT_MAX) \
|
||||||
|
: sizeof *(r) == sizeof (int) \
|
||||||
|
? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
|
||||||
|
int, INT_MIN, INT_MAX) \
|
||||||
|
: _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow))
|
||||||
|
# ifdef LLONG_MAX
|
||||||
|
# define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
|
||||||
|
(sizeof *(r) == sizeof (long int) \
|
||||||
|
? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
|
||||||
|
long int, LONG_MIN, LONG_MAX) \
|
||||||
|
: _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
|
||||||
|
long long int, LLONG_MIN, LLONG_MAX))
|
||||||
|
# else
|
||||||
|
# define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
|
||||||
|
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
|
||||||
|
long int, LONG_MIN, LONG_MAX))
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Store the low-order bits of A <op> B into *R, where the operation
|
||||||
|
is given by OP. Use the unsigned type UT for calculation to avoid
|
||||||
|
overflow problems. *R's type is T, with extremal values TMIN and
|
||||||
|
TMAX. T must be a signed integer type. Return 1 if the result
|
||||||
|
overflows. */
|
||||||
|
#define _GL_INT_OP_CALC(a, b, r, op, overflow, ut, t, tmin, tmax) \
|
||||||
|
(sizeof ((a) op (b)) < sizeof (t) \
|
||||||
|
? _GL_INT_OP_CALC1 ((t) (a), (t) (b), r, op, overflow, ut, t, tmin, tmax) \
|
||||||
|
: _GL_INT_OP_CALC1 (a, b, r, op, overflow, ut, t, tmin, tmax))
|
||||||
|
#define _GL_INT_OP_CALC1(a, b, r, op, overflow, ut, t, tmin, tmax) \
|
||||||
|
((overflow (a, b) \
|
||||||
|
|| (EXPR_SIGNED ((a) op (b)) && ((a) op (b)) < (tmin)) \
|
||||||
|
|| (tmax) < ((a) op (b))) \
|
||||||
|
? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t, tmin, tmax), 1) \
|
||||||
|
: (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t, tmin, tmax), 0))
|
||||||
|
|
||||||
|
/* Return A <op> B, where the operation is given by OP. Use the
|
||||||
|
unsigned type UT for calculation to avoid overflow problems.
|
||||||
|
Convert the result to type T without overflow by subtracting TMIN
|
||||||
|
from large values before converting, and adding it afterwards.
|
||||||
|
Compilers can optimize all the operations except OP. */
|
||||||
|
#define _GL_INT_OP_WRAPV_VIA_UNSIGNED(a, b, op, ut, t, tmin, tmax) \
|
||||||
|
(((ut) (a) op (ut) (b)) <= (tmax) \
|
||||||
|
? (t) ((ut) (a) op (ut) (b)) \
|
||||||
|
: ((t) (((ut) (a) op (ut) (b)) - (tmin)) + (tmin)))
|
||||||
|
|
||||||
|
#endif /* _GL_INTPROPS_H */
|
|
@ -1,5 +1,5 @@
|
||||||
/* Test for finite value (zero, subnormal, or normal, and not infinite or NaN).
|
/* Test for finite value (zero, subnormal, or normal, and not infinite or NaN).
|
||||||
Copyright (C) 2007-2014 Free Software Foundation, Inc.
|
Copyright (C) 2007-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Test for positive or negative infinity.
|
/* Test for positive or negative infinity.
|
||||||
Copyright (C) 2007-2014 Free Software Foundation, Inc.
|
Copyright (C) 2007-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Test for NaN that does not need libm.
|
/* Test for NaN that does not need libm.
|
||||||
Copyright (C) 2007-2014 Free Software Foundation, Inc.
|
Copyright (C) 2007-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Test for NaN that does not need libm.
|
/* Test for NaN that does not need libm.
|
||||||
Copyright (C) 2007-2014 Free Software Foundation, Inc.
|
Copyright (C) 2007-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Test for NaN that does not need libm.
|
/* Test for NaN that does not need libm.
|
||||||
Copyright (C) 2008-2014 Free Software Foundation, Inc.
|
Copyright (C) 2008-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Test for NaN that does not need libm.
|
/* Test for NaN that does not need libm.
|
||||||
Copyright (C) 2007-2014 Free Software Foundation, Inc.
|
Copyright (C) 2007-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Test for NaN that does not need libm.
|
/* Test for NaN that does not need libm.
|
||||||
Copyright (C) 2007, 2009-2014 Free Software Foundation, Inc.
|
Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Test for NaN that does not need libm.
|
/* Test for NaN that does not need libm.
|
||||||
Copyright (C) 2007-2014 Free Software Foundation, Inc.
|
Copyright (C) 2007-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Test for NaN that does not need libm.
|
/* Test for NaN that does not need libm.
|
||||||
Copyright (C) 2007, 2009-2014 Free Software Foundation, Inc.
|
Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Replacement for 'int' to 'long double' conversion routine.
|
/* Replacement for 'int' to 'long double' conversion routine.
|
||||||
Copyright (C) 2011-2014 Free Software Foundation, Inc.
|
Copyright (C) 2011-2016 Free Software Foundation, Inc.
|
||||||
Written by Bruno Haible <bruno@clisp.org>, 2011.
|
Written by Bruno Haible <bruno@clisp.org>, 2011.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Substitute for and wrapper around <langinfo.h>.
|
/* Substitute for and wrapper around <langinfo.h>.
|
||||||
Copyright (C) 2009-2014 Free Software Foundation, Inc.
|
Copyright (C) 2009-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
@ -49,7 +49,10 @@ typedef int nl_item;
|
||||||
# define CODESET 10000
|
# define CODESET 10000
|
||||||
/* nl_langinfo items of the LC_NUMERIC category */
|
/* nl_langinfo items of the LC_NUMERIC category */
|
||||||
# define RADIXCHAR 10001
|
# define RADIXCHAR 10001
|
||||||
|
# define DECIMAL_POINT RADIXCHAR
|
||||||
# define THOUSEP 10002
|
# define THOUSEP 10002
|
||||||
|
# define THOUSANDS_SEP THOUSEP
|
||||||
|
# define GROUPING 10114
|
||||||
/* nl_langinfo items of the LC_TIME category */
|
/* nl_langinfo items of the LC_TIME category */
|
||||||
# define D_T_FMT 10003
|
# define D_T_FMT 10003
|
||||||
# define D_FMT 10004
|
# define D_FMT 10004
|
||||||
|
@ -102,6 +105,21 @@ typedef int nl_item;
|
||||||
# define ALT_DIGITS 10051
|
# define ALT_DIGITS 10051
|
||||||
/* nl_langinfo items of the LC_MONETARY category */
|
/* nl_langinfo items of the LC_MONETARY category */
|
||||||
# define CRNCYSTR 10052
|
# define CRNCYSTR 10052
|
||||||
|
# define CURRENCY_SYMBOL CRNCYSTR
|
||||||
|
# define INT_CURR_SYMBOL 10100
|
||||||
|
# define MON_DECIMAL_POINT 10101
|
||||||
|
# define MON_THOUSANDS_SEP 10102
|
||||||
|
# define MON_GROUPING 10103
|
||||||
|
# define POSITIVE_SIGN 10104
|
||||||
|
# define NEGATIVE_SIGN 10105
|
||||||
|
# define FRAC_DIGITS 10106
|
||||||
|
# define INT_FRAC_DIGITS 10107
|
||||||
|
# define P_CS_PRECEDES 10108
|
||||||
|
# define N_CS_PRECEDES 10109
|
||||||
|
# define P_SEP_BY_SPACE 10110
|
||||||
|
# define N_SEP_BY_SPACE 10111
|
||||||
|
# define P_SIGN_POSN 10112
|
||||||
|
# define N_SIGN_POSN 10113
|
||||||
/* nl_langinfo items of the LC_MESSAGES category */
|
/* nl_langinfo items of the LC_MESSAGES category */
|
||||||
# define YESEXPR 10053
|
# define YESEXPR 10053
|
||||||
# define NOEXPR 10054
|
# define NOEXPR 10054
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* Emulate link on platforms that lack it, namely native Windows platforms.
|
/* Emulate link on platforms that lack it, namely native Windows platforms.
|
||||||
|
|
||||||
Copyright (C) 2009-2014 Free Software Foundation, Inc.
|
Copyright (C) 2009-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* listen.c --- wrappers for Windows listen function
|
/* listen.c --- wrappers for Windows listen function
|
||||||
|
|
||||||
Copyright (C) 2008-2014 Free Software Foundation, Inc.
|
Copyright (C) 2008-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* Determine a canonical name for the current locale's character encoding.
|
/* Determine a canonical name for the current locale's character encoding.
|
||||||
|
|
||||||
Copyright (C) 2000-2006, 2008-2014 Free Software Foundation, Inc.
|
Copyright (C) 2000-2006, 2008-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
@ -34,6 +34,7 @@
|
||||||
|
|
||||||
#if defined _WIN32 || defined __WIN32__
|
#if defined _WIN32 || defined __WIN32__
|
||||||
# define WINDOWS_NATIVE
|
# define WINDOWS_NATIVE
|
||||||
|
# include <locale.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined __EMX__
|
#if defined __EMX__
|
||||||
|
@ -127,7 +128,7 @@ get_charset_aliases (void)
|
||||||
cp = charset_aliases;
|
cp = charset_aliases;
|
||||||
if (cp == NULL)
|
if (cp == NULL)
|
||||||
{
|
{
|
||||||
#if !(defined DARWIN7 || defined VMS || defined WINDOWS_NATIVE || defined __CYGWIN__)
|
#if !(defined DARWIN7 || defined VMS || defined WINDOWS_NATIVE || defined __CYGWIN__ || defined OS2)
|
||||||
const char *dir;
|
const char *dir;
|
||||||
const char *base = "charset.alias";
|
const char *base = "charset.alias";
|
||||||
char *file_name;
|
char *file_name;
|
||||||
|
@ -341,6 +342,36 @@ get_charset_aliases (void)
|
||||||
"CP54936" "\0" "GB18030" "\0"
|
"CP54936" "\0" "GB18030" "\0"
|
||||||
"CP65001" "\0" "UTF-8" "\0";
|
"CP65001" "\0" "UTF-8" "\0";
|
||||||
# endif
|
# endif
|
||||||
|
# if defined OS2
|
||||||
|
/* To avoid the troubles of installing a separate file in the same
|
||||||
|
directory as the DLL and of retrieving the DLL's directory at
|
||||||
|
runtime, simply inline the aliases here. */
|
||||||
|
|
||||||
|
/* The list of encodings is taken from "List of OS/2 Codepages"
|
||||||
|
by Alex Taylor:
|
||||||
|
<http://altsan.org/os2/toolkits/uls/index.html#codepages>.
|
||||||
|
See also "IBM Globalization - Code page identifiers":
|
||||||
|
<http://www-01.ibm.com/software/globalization/cp/cp_cpgid.html>. */
|
||||||
|
cp = "CP813" "\0" "ISO-8859-7" "\0"
|
||||||
|
"CP878" "\0" "KOI8-R" "\0"
|
||||||
|
"CP819" "\0" "ISO-8859-1" "\0"
|
||||||
|
"CP912" "\0" "ISO-8859-2" "\0"
|
||||||
|
"CP913" "\0" "ISO-8859-3" "\0"
|
||||||
|
"CP914" "\0" "ISO-8859-4" "\0"
|
||||||
|
"CP915" "\0" "ISO-8859-5" "\0"
|
||||||
|
"CP916" "\0" "ISO-8859-8" "\0"
|
||||||
|
"CP920" "\0" "ISO-8859-9" "\0"
|
||||||
|
"CP921" "\0" "ISO-8859-13" "\0"
|
||||||
|
"CP923" "\0" "ISO-8859-15" "\0"
|
||||||
|
"CP954" "\0" "EUC-JP" "\0"
|
||||||
|
"CP964" "\0" "EUC-TW" "\0"
|
||||||
|
"CP970" "\0" "EUC-KR" "\0"
|
||||||
|
"CP1089" "\0" "ISO-8859-6" "\0"
|
||||||
|
"CP1208" "\0" "UTF-8" "\0"
|
||||||
|
"CP1381" "\0" "GB2312" "\0"
|
||||||
|
"CP1386" "\0" "GBK" "\0"
|
||||||
|
"CP3372" "\0" "EUC-JP" "\0";
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
charset_aliases = cp;
|
charset_aliases = cp;
|
||||||
|
@ -461,14 +492,34 @@ locale_charset (void)
|
||||||
|
|
||||||
static char buf[2 + 10 + 1];
|
static char buf[2 + 10 + 1];
|
||||||
|
|
||||||
/* The Windows API has a function returning the locale's codepage as a
|
/* The Windows API has a function returning the locale's codepage as
|
||||||
number: GetACP().
|
a number, but the value doesn't change according to what the
|
||||||
When the output goes to a console window, it needs to be provided in
|
'setlocale' call specified. So we use it as a last resort, in
|
||||||
GetOEMCP() encoding if the console is using a raster font, or in
|
case the string returned by 'setlocale' doesn't specify the
|
||||||
GetConsoleOutputCP() encoding if it is using a TrueType font.
|
codepage. */
|
||||||
But in GUI programs and for output sent to files and pipes, GetACP()
|
char *current_locale = setlocale (LC_ALL, NULL);
|
||||||
encoding is the best bet. */
|
char *pdot;
|
||||||
sprintf (buf, "CP%u", GetACP ());
|
|
||||||
|
/* If they set different locales for different categories,
|
||||||
|
'setlocale' will return a semi-colon separated list of locale
|
||||||
|
values. To make sure we use the correct one, we choose LC_CTYPE. */
|
||||||
|
if (strchr (current_locale, ';'))
|
||||||
|
current_locale = setlocale (LC_CTYPE, NULL);
|
||||||
|
|
||||||
|
pdot = strrchr (current_locale, '.');
|
||||||
|
if (pdot)
|
||||||
|
sprintf (buf, "CP%s", pdot + 1);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* The Windows API has a function returning the locale's codepage as a
|
||||||
|
number: GetACP().
|
||||||
|
When the output goes to a console window, it needs to be provided in
|
||||||
|
GetOEMCP() encoding if the console is using a raster font, or in
|
||||||
|
GetConsoleOutputCP() encoding if it is using a TrueType font.
|
||||||
|
But in GUI programs and for output sent to files and pipes, GetACP()
|
||||||
|
encoding is the best bet. */
|
||||||
|
sprintf (buf, "CP%u", GetACP ());
|
||||||
|
}
|
||||||
codeset = buf;
|
codeset = buf;
|
||||||
|
|
||||||
#elif defined OS2
|
#elif defined OS2
|
||||||
|
@ -478,6 +529,8 @@ locale_charset (void)
|
||||||
ULONG cp[3];
|
ULONG cp[3];
|
||||||
ULONG cplen;
|
ULONG cplen;
|
||||||
|
|
||||||
|
codeset = NULL;
|
||||||
|
|
||||||
/* Allow user to override the codeset, as set in the operating system,
|
/* Allow user to override the codeset, as set in the operating system,
|
||||||
with standard language environment variables. */
|
with standard language environment variables. */
|
||||||
locale = getenv ("LC_ALL");
|
locale = getenv ("LC_ALL");
|
||||||
|
@ -509,10 +562,12 @@ locale_charset (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Resolve through the charset.alias file. */
|
/* For the POSIX locale, don't use the system's codepage. */
|
||||||
codeset = locale;
|
if (strcmp (locale, "C") == 0 || strcmp (locale, "POSIX") == 0)
|
||||||
|
codeset = "";
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if (codeset == NULL)
|
||||||
{
|
{
|
||||||
/* OS/2 has a function returning the locale's codepage as a number. */
|
/* OS/2 has a function returning the locale's codepage as a number. */
|
||||||
if (DosQueryCp (sizeof (cp), cp, &cplen))
|
if (DosQueryCp (sizeof (cp), cp, &cplen))
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Determine a canonical name for the current locale's character encoding.
|
/* Determine a canonical name for the current locale's character encoding.
|
||||||
Copyright (C) 2000-2003, 2009-2014 Free Software Foundation, Inc.
|
Copyright (C) 2000-2003, 2009-2016 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU CHARSET Library.
|
This file is part of the GNU CHARSET Library.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* A POSIX <locale.h>.
|
/* A POSIX <locale.h>.
|
||||||
Copyright (C) 2007-2014 Free Software Foundation, Inc.
|
Copyright (C) 2007-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Query locale dependent information for formatting numbers.
|
/* Query locale dependent information for formatting numbers.
|
||||||
Copyright (C) 2012-2014 Free Software Foundation, Inc.
|
Copyright (C) 2012-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Logarithm.
|
/* Logarithm.
|
||||||
Copyright (C) 2012-2014 Free Software Foundation, Inc.
|
Copyright (C) 2012-2016 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
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
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue