diff -Nru datamash-1.0.7/aclocal.m4 datamash-1.1.1/aclocal.m4 --- datamash-1.0.7/aclocal.m4 2015-06-22 00:26:13.000000000 +0000 +++ datamash-1.1.1/aclocal.m4 2017-01-19 19:34:01.000000000 +0000 @@ -56,6 +56,66 @@ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) +# Copyright (C) 2011-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_AR([ACT-IF-FAIL]) +# ------------------------- +# Try to determine the archiver interface, and trigger the ar-lib wrapper +# if it is needed. If the detection of archiver interface fails, run +# ACT-IF-FAIL (default is to abort configure with a proper error message). +AC_DEFUN([AM_PROG_AR], +[AC_BEFORE([$0], [LT_INIT])dnl +AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([ar-lib])dnl +AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) +: ${AR=ar} + +AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], + [AC_LANG_PUSH([C]) + am_cv_ar_interface=ar + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], + [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([am_ar_try]) + if test "$ac_status" -eq 0; then + am_cv_ar_interface=ar + else + am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([am_ar_try]) + if test "$ac_status" -eq 0; then + am_cv_ar_interface=lib + else + am_cv_ar_interface=unknown + fi + fi + rm -f conftest.lib libconftest.a + ]) + AC_LANG_POP([C])]) + +case $am_cv_ar_interface in +ar) + ;; +lib) + # Microsoft lib, so override with the ar-lib wrapper script. + # FIXME: It is wrong to rewrite AR. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__AR in this case, + # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something + # similar. + AR="$am_aux_dir/ar-lib $AR" + ;; +unknown) + m4_default([$1], + [AC_MSG_ERROR([could not determine $AR interface])]) + ;; +esac +AC_SUBST([AR])dnl +]) + # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. @@ -1184,6 +1244,7 @@ m4_include([m4/frexp.m4]) m4_include([m4/frexpl.m4]) m4_include([m4/getopt.m4]) +m4_include([m4/getprogname.m4]) m4_include([m4/gettext.m4]) m4_include([m4/gl-openssl.m4]) m4_include([m4/glibc21.m4]) @@ -1200,6 +1261,8 @@ m4_include([m4/inttypes-pri.m4]) m4_include([m4/inttypes.m4]) m4_include([m4/isblank.m4]) +m4_include([m4/isfinite.m4]) +m4_include([m4/isinf.m4]) m4_include([m4/isnand.m4]) m4_include([m4/isnanf.m4]) m4_include([m4/isnanl.m4]) @@ -1210,6 +1273,7 @@ m4_include([m4/lib-link.m4]) m4_include([m4/lib-prefix.m4]) m4_include([m4/libunistring-base.m4]) +m4_include([m4/limits-h.m4]) m4_include([m4/localcharset.m4]) m4_include([m4/locale-fr.m4]) m4_include([m4/locale-ja.m4]) @@ -1232,6 +1296,8 @@ m4_include([m4/memchr.m4]) m4_include([m4/minmax.m4]) m4_include([m4/mmap-anon.m4]) +m4_include([m4/modf.m4]) +m4_include([m4/modfl.m4]) m4_include([m4/msvc-inval.m4]) m4_include([m4/msvc-nothrow.m4]) m4_include([m4/multiarch.m4]) @@ -1263,6 +1329,7 @@ m4_include([m4/stdio_h.m4]) m4_include([m4/stdlib_h.m4]) m4_include([m4/stdnoreturn.m4]) +m4_include([m4/stpcpy.m4]) m4_include([m4/strerror.m4]) m4_include([m4/string_h.m4]) m4_include([m4/strndup.m4]) @@ -1272,6 +1339,8 @@ m4_include([m4/strtoumax.m4]) m4_include([m4/sys_socket_h.m4]) m4_include([m4/sys_types_h.m4]) +m4_include([m4/trunc.m4]) +m4_include([m4/truncl.m4]) m4_include([m4/unistd_h.m4]) m4_include([m4/unlocked-io.m4]) m4_include([m4/version-etc.m4]) diff -Nru datamash-1.0.7/AUTHORS datamash-1.1.1/AUTHORS --- datamash-1.0.7/AUTHORS 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/AUTHORS 2017-01-17 17:50:20.000000000 +0000 @@ -1,6 +1,6 @@ Authors of GNU datamash. - Copyright (C) 2013-2015 Assaf Gordon + Copyright (C) 2013-2017 Assaf Gordon Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright diff -Nru datamash-1.0.7/build-aux/announce-gen datamash-1.1.1/build-aux/announce-gen --- datamash-1.0.7/build-aux/announce-gen 2015-06-17 23:45:27.000000000 +0000 +++ datamash-1.1.1/build-aux/announce-gen 2017-01-10 20:00:58.000000000 +0000 @@ -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' if 0; # Generate a release announcement message. -my $VERSION = '2013-07-09 06:39'; # UTC +my $VERSION = '2016-01-12 23:09'; # UTC # The definition above must lie within the first 8 lines in order # for the Emacs time-stamp write hook (at end) to update it. # If you change this file with Emacs, please let the write hook # do its job. Otherwise, update this string manually. -# Copyright (C) 2002-2015 Free Software Foundation, Inc. +# Copyright (C) 2002-2017 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -552,6 +552,6 @@ ## eval: (add-hook 'write-file-hooks 'time-stamp) ## time-stamp-start: "my $VERSION = '" ## time-stamp-format: "%:y-%02m-%02d %02H:%02M" -## time-stamp-time-zone: "UTC" +## time-stamp-time-zone: "UTC0" ## time-stamp-end: "'; # UTC" ## End: diff -Nru datamash-1.0.7/build-aux/ar-lib datamash-1.1.1/build-aux/ar-lib --- datamash-1.0.7/build-aux/ar-lib 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/build-aux/ar-lib 2017-01-19 19:34:08.000000000 +0000 @@ -0,0 +1,270 @@ +#! /bin/sh +# Wrapper for Microsoft lib.exe + +me=ar-lib +scriptversion=2012-03-01.08; # UTC + +# Copyright (C) 2010-2013 Free Software Foundation, Inc. +# Written by Peter Rosin . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + + +# func_error message +func_error () +{ + echo "$me: $1" 1>&2 + exit 1 +} + +file_conv= + +# func_file_conv build_file +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv in + mingw) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_at_file at_file operation archive +# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE +# for each of them. +# When interpreting the content of the @FILE, do NOT use func_file_conv, +# since the user would need to supply preconverted file names to +# binutils ar, at least for MinGW. +func_at_file () +{ + operation=$2 + archive=$3 + at_file_contents=`cat "$1"` + eval set x "$at_file_contents" + shift + + for member + do + $AR -NOLOGO $operation:"$member" "$archive" || exit $? + done +} + +case $1 in + '') + func_error "no command. Try '$0 --help' for more information." + ;; + -h | --h*) + cat <. @@ -50,7 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2015 Free Software Foundation, Inc. +Copyright 1992-2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -186,9 +186,12 @@ *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. + # to ELF recently (or will in the future) and ABI. case "${UNAME_MACHINE_ARCH}" in - arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ @@ -221,7 +224,7 @@ release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: @@ -237,6 +240,10 @@ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} + exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; @@ -249,6 +256,9 @@ *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; + *:Sortix:*:*) + echo ${UNAME_MACHINE}-unknown-sortix + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -265,42 +275,42 @@ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; + UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; + UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; + UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; + UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; + UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; + UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; + UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; + UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; + UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 @@ -373,16 +383,16 @@ exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build - SUN_ARCH="i386" + SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then - SUN_ARCH="x86_64" + SUN_ARCH=x86_64 fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` @@ -407,7 +417,7 @@ exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} @@ -632,13 +642,13 @@ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi @@ -677,11 +687,11 @@ exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ ${HP_ARCH} = "hppa2.0w" ] + if [ ${HP_ARCH} = hppa2.0w ] then eval $set_cc_for_build @@ -694,12 +704,12 @@ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then - HP_ARCH="hppa2.0w" + HP_ARCH=hppa2.0w else - HP_ARCH="hppa64" + HP_ARCH=hppa64 fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} @@ -804,14 +814,14 @@ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) @@ -893,7 +903,7 @@ exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix @@ -916,7 +926,7 @@ EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) @@ -962,6 +972,9 @@ ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; + k1om:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; @@ -987,6 +1000,9 @@ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; + mips64el:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; @@ -1019,6 +1035,9 @@ ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; @@ -1038,7 +1057,7 @@ echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} @@ -1117,7 +1136,7 @@ # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that + # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; @@ -1266,6 +1285,9 @@ SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux${UNAME_RELEASE} + exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; @@ -1279,9 +1301,9 @@ UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in @@ -1303,7 +1325,7 @@ exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then + if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi @@ -1334,7 +1356,7 @@ # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - if test "$cputype" = "386"; then + if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" @@ -1376,7 +1398,7 @@ echo i386-pc-xenix exit ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos @@ -1387,23 +1409,25 @@ x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; esac cat >&2 < in order to provide the needed -information to handle your system. +If $0 has already been updated, send the following data and any +information you think might be pertinent to config-patches@gnu.org to +provide the necessary information to handle your system. config.guess timestamp = $timestamp diff -Nru datamash-1.0.7/build-aux/config.rpath datamash-1.1.1/build-aux/config.rpath --- datamash-1.0.7/build-aux/config.rpath 2015-06-22 00:25:56.000000000 +0000 +++ datamash-1.1.1/build-aux/config.rpath 2017-01-19 19:33:38.000000000 +0000 @@ -2,7 +2,7 @@ # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # -# Copyright 1996-2015 Free Software Foundation, Inc. +# Copyright 1996-2017 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # diff -Nru datamash-1.0.7/build-aux/config.sub datamash-1.1.1/build-aux/config.sub --- datamash-1.0.7/build-aux/config.sub 2015-06-17 23:45:09.000000000 +0000 +++ datamash-1.1.1/build-aux/config.sub 2017-01-10 19:44:08.000000000 +0000 @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2015 Free Software Foundation, Inc. +# Copyright 1992-2017 Free Software Foundation, Inc. -timestamp='2015-03-08' +timestamp='2017-01-01' # 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 @@ -33,7 +33,7 @@ # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -53,8 +53,7 @@ me=`echo "$0" | sed -e 's,.*/,,'` usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. @@ -68,7 +67,7 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2015 Free Software Foundation, Inc. +Copyright 1992-2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -118,7 +117,7 @@ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ - kopensolaris*-gnu* | \ + kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` @@ -255,6 +254,7 @@ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ + | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ @@ -301,11 +301,12 @@ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pru \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ @@ -376,6 +377,7 @@ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ + | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ @@ -427,13 +429,15 @@ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pru-* \ | pyramid-* \ + | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ @@ -518,7 +522,7 @@ basic_machine=i386-pc os=-aros ;; - asmjs) + asmjs) basic_machine=asmjs-unknown ;; aux) @@ -641,6 +645,14 @@ basic_machine=m68k-bull os=-sysv3 ;; + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" + ;; + e500v[12]-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + os=$os"spe" + ;; ebmon29k) basic_machine=a29k-amd os=-ebmon @@ -1020,7 +1032,7 @@ ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - ppcle | powerpclittle | ppc-le | powerpc-little) + ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) @@ -1030,7 +1042,7 @@ ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) + ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) @@ -1376,18 +1388,18 @@ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* | -cloudabi* \ + | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* \ + | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ + | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ @@ -1396,7 +1408,8 @@ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1528,6 +1541,8 @@ ;; -nacl*) ;; + -ios) + ;; -none) ;; *) @@ -1623,6 +1638,9 @@ sparc-* | *-sun) os=-sunos4.1.1 ;; + pru-*) + os=-elf + ;; *-be) os=-beos ;; diff -Nru datamash-1.0.7/build-aux/create_corrupted_file_system.sh datamash-1.1.1/build-aux/create_corrupted_file_system.sh --- datamash-1.0.7/build-aux/create_corrupted_file_system.sh 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/build-aux/create_corrupted_file_system.sh 2017-01-17 17:50:20.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (C) 2014-2015 Assaf Gordon +# Copyright (C) 2014-2017 Assaf Gordon # # datamash I/O error testing module # diff -Nru datamash-1.0.7/build-aux/create_small_file_system.sh datamash-1.1.1/build-aux/create_small_file_system.sh --- datamash-1.0.7/build-aux/create_small_file_system.sh 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/build-aux/create_small_file_system.sh 2017-01-17 17:50:20.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (C) 2014-2015 Assaf Gordon +# Copyright (C) 2014-2017 Assaf Gordon # # datamash I/O error testing module # diff -Nru datamash-1.0.7/build-aux/depcomp datamash-1.1.1/build-aux/depcomp --- datamash-1.0.7/build-aux/depcomp 2015-06-17 23:45:09.000000000 +0000 +++ datamash-1.1.1/build-aux/depcomp 2017-01-10 19:44:08.000000000 +0000 @@ -1,9 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2013-05-30.07; # UTC +scriptversion=2016-01-11.22; # UTC -# Copyright (C) 1999-2015 Free Software Foundation, Inc. +# Copyright (C) 1999-2017 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -751,6 +751,6 @@ # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -Nru datamash-1.0.7/build-aux/do-release-commit-and-tag datamash-1.1.1/build-aux/do-release-commit-and-tag --- datamash-1.0.7/build-aux/do-release-commit-and-tag 2015-06-17 23:45:27.000000000 +0000 +++ datamash-1.1.1/build-aux/do-release-commit-and-tag 2017-01-10 20:00:58.000000000 +0000 @@ -3,11 +3,11 @@ # controlled .prev-version file, automate the procedure by which we record # the date, release-type and version string in the NEWS file. That commit # will serve to identify the release, so apply a signed tag to it as well. -VERSION=2012-08-01.09 # UTC +VERSION=2016-12-31.14 # UTC # Note: this is a bash script (could be zsh or dash) -# Copyright (C) 2009-2015 Free Software Foundation, Inc. +# Copyright (C) 2009-2017 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -94,7 +94,7 @@ opt=$(echo "$1" | sed -e 's/=.*//') val=$(echo "$1" | sed -e 's/[^=]*=//') shift - set dummy "$opt" "$val" ${1+"$@"}; shift + set dummy "$opt" "$val" "$@"; shift ;; esac @@ -143,7 +143,7 @@ # Ensure the current branch name is correct: curr_br=$(git rev-parse --symbolic-full-name HEAD) -test "$curr_br" = refs/heads/$branch || die not on branch $branch +test "$curr_br" = "refs/heads/$branch" || die not on branch $branch # Extract package name from Makefile. Makefile=$builddir/Makefile @@ -174,6 +174,6 @@ # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "VERSION=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: " # UTC" # End: diff -Nru datamash-1.0.7/build-aux/gen-coverage-report.sh datamash-1.1.1/build-aux/gen-coverage-report.sh --- datamash-1.0.7/build-aux/gen-coverage-report.sh 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/build-aux/gen-coverage-report.sh 2017-01-17 17:50:20.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/sh -## Copyright (C) 2014-2015 Assaf Gordon +## Copyright (C) 2014-2017 Assaf Gordon ## ## This file is part of GNU Datamash. ## diff -Nru datamash-1.0.7/build-aux/gendocs.sh datamash-1.1.1/build-aux/gendocs.sh --- datamash-1.0.7/build-aux/gendocs.sh 2015-06-17 23:45:27.000000000 +0000 +++ datamash-1.1.1/build-aux/gendocs.sh 2017-01-10 20:00:58.000000000 +0000 @@ -2,9 +2,9 @@ # gendocs.sh -- generate a GNU manual in many formats. This script is # mentioned in maintain.texi. See the help message below for usage details. -scriptversion=2015-05-05.16 +scriptversion=2016-12-31.18 -# Copyright 2003-2015 Free Software Foundation, Inc. +# Copyright 2003-2017 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -52,9 +52,27 @@ unset CDPATH 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 -Copyright 2015 Free Software Foundation, Inc. +Copyright 2017 Free Software Foundation, Inc. There is NO warranty. You may redistribute this software under the terms of the GNU General Public License. For more information about these matters, see the files named COPYING." @@ -74,7 +92,7 @@ -I DIR append DIR to the Texinfo search path. --common ARG pass ARG in all invocations. --html ARG pass ARG to makeinfo or texi2html for HTML targets, - instead of --css-ref=/software/gnulib/manual.css. + instead of '$htmlarg'. --info ARG pass ARG to makeinfo for Info, instead of --no-split. --no-ascii skip generating the plain text output. --no-html skip generating the html output. @@ -137,24 +155,6 @@ 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 directories. -htmlarg=--css-ref=/software/gnulib/manual.css -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" - while test $# -gt 0; do case $1 in -s) shift; srcfile=$1;; diff -Nru datamash-1.0.7/build-aux/gitlog-to-changelog datamash-1.1.1/build-aux/gitlog-to-changelog --- datamash-1.0.7/build-aux/gitlog-to-changelog 2015-06-17 23:45:27.000000000 +0000 +++ datamash-1.1.1/build-aux/gitlog-to-changelog 2017-01-10 20:00:58.000000000 +0000 @@ -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' if 0; # Convert git log output to ChangeLog format. -my $VERSION = '2015-05-08 06:05'; # UTC +my $VERSION = '2016-03-22 21:49'; # UTC # The definition above must lie within the first 8 lines in order # for the Emacs time-stamp write hook (at end) to update it. # If you change this file with Emacs, please let the write hook # do its job. Otherwise, update this string manually. -# Copyright (C) 2008-2015 Free Software Foundation, Inc. +# Copyright (C) 2008-2017 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -74,6 +74,7 @@ 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; see 'man git-log' for the list of format metacharacters; the default is '%s%n%b%n' @@ -228,6 +229,7 @@ my $append_dot = 0; my $cluster = 1; my $ignore_matching; + my $ignore_line; my $strip_tab = 0; my $strip_cherry_pick = 0; my $srcdir; @@ -242,6 +244,7 @@ 'append-dot' => \$append_dot, 'cluster!' => \$cluster, 'ignore-matching=s' => \$ignore_matching, + 'ignore-line=s' => \$ignore_line, 'strip-tab' => \$strip_tab, 'strip-cherry-pick' => \$strip_cherry_pick, 'srcdir=s' => \$srcdir, @@ -267,6 +270,7 @@ my $prev_multi_paragraph; my $prev_date_line = ''; my @prev_coauthors = (); + my @skipshas = (); while (1) { defined (my $in = ) @@ -287,6 +291,19 @@ $sha =~ /^[0-9a-fA-F]{40}$/ 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. my $code = $amend_code->{$sha}; if (defined $code) @@ -314,7 +331,7 @@ $rest =~ s/^\s*\(cherry picked from commit [\da-f]+\)\n//m; } - my @line = split /\s*\n/, $rest; + my @line = split /[ \t]*\n/, $rest; my $author_line = shift @line; defined $author_line or die "$ME:$.: unexpected EOF\n"; @@ -345,10 +362,46 @@ while ($line[$#line] =~ /^\s*$/) { pop @line; } } + # Handle Emacs gitmerge.el "skipped" commits. + # 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 ); + } + } + } + # Ignore commits that match the --ignore-matching pattern, if specified. - if (! (defined $ignore_matching - && @line && $line[0] =~ /$ignore_matching/)) + if (defined $ignore_matching && @line && $line[0] =~ /$ignore_matching/) { + $skipflag = 1; + } + elsif ($skipflag) + { + ## Perhaps only warn if a pattern matches more than once? + warn "$ME: warning: skipping $sha due to $skipflag\n"; + } + + if (! $skipflag) + { + if (defined $ignore_line && @line) + { + @line = grep ! /$ignore_line/, @line; + while ($line[$#line] =~ /^\s*$/) { pop @line; } + } + # Record whether there are two or more paragraphs. my $multi_paragraph = grep /^\s*$/, @line; @@ -441,6 +494,6 @@ # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "my $VERSION = '" # time-stamp-format: "%:y-%02m-%02d %02H:%02M" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "'; # UTC" # End: diff -Nru datamash-1.0.7/build-aux/git-version-gen datamash-1.1.1/build-aux/git-version-gen --- datamash-1.0.7/build-aux/git-version-gen 2015-06-17 23:45:27.000000000 +0000 +++ datamash-1.1.1/build-aux/git-version-gen 2017-01-10 20:00:58.000000000 +0000 @@ -1,8 +1,8 @@ #!/bin/sh # Print a version string. -scriptversion=2014-12-02.19; # UTC +scriptversion=2017-01-09.19; # UTC -# Copyright (C) 2007-2015 Free Software Foundation, Inc. +# Copyright (C) 2007-2017 Free Software Foundation, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -101,8 +101,8 @@ case $1 in --help) echo "$usage"; exit 0;; --version) echo "$version"; exit 0;; - --prefix) shift; prefix="$1";; - --fallback) shift; fallback="$1";; + --prefix) shift; prefix=${1?};; + --fallback) shift; fallback=${1?};; -*) echo "$0: Unknown option '$1'." >&2 echo "$0: Try '--help' for more information." >&2 @@ -200,7 +200,7 @@ # string we're using came from git. I.e., skip the test if it's "UNKNOWN" # or if it came from .tarball-version. if test "x$v_from_git" != x; then - # Don't declare a version "dirty" merely because a time stamp has changed. + # Don't declare a version "dirty" merely because a timestamp has changed. git update-index --refresh > /dev/null 2>&1 dirty=`exec 2>/dev/null;git diff-index --name-only HEAD` || dirty= @@ -221,6 +221,6 @@ # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -Nru datamash-1.0.7/build-aux/gnupload datamash-1.1.1/build-aux/gnupload --- datamash-1.0.7/build-aux/gnupload 2015-06-17 23:45:27.000000000 +0000 +++ datamash-1.1.1/build-aux/gnupload 2017-01-10 20:00:58.000000000 +0000 @@ -1,9 +1,9 @@ #!/bin/sh # Sign files and upload them. -scriptversion=2013-03-19.17; # UTC +scriptversion=2016-01-11.22; # UTC -# Copyright (C) 2004-2015 Free Software Foundation, Inc. +# Copyright (C) 2004-2017 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -435,6 +435,6 @@ # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -Nru datamash-1.0.7/build-aux/gnu-web-doc-update datamash-1.1.1/build-aux/gnu-web-doc-update --- datamash-1.0.7/build-aux/gnu-web-doc-update 2015-06-17 23:45:27.000000000 +0000 +++ datamash-1.1.1/build-aux/gnu-web-doc-update 2017-01-10 20:00:58.000000000 +0000 @@ -2,9 +2,9 @@ # Run this after each non-alpha release, to update the web documentation at # http://www.gnu.org/software/$pkg/manual/ -VERSION=2012-12-16.14; # UTC +VERSION=2016-01-12.23; # UTC -# Copyright (C) 2009-2015 Free Software Foundation, Inc. +# Copyright (C) 2009-2017 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -40,6 +40,7 @@ Options: -C, --builddir=DIR location of (configured) Makefile (default: .) -n, --dry-run don't actually commit anything + -m, --mirror remove out of date files from document server --help print this help, then exit --version print version number, then exit @@ -107,6 +108,7 @@ builddir=. dryrun= +rm_stale='echo' while test $# != 0 do # Handle --option=value by splitting apart and putting back on argv. @@ -115,7 +117,7 @@ opt=$(echo "$1" | sed -e 's/=.*//') val=$(echo "$1" | sed -e 's/[^=]*=//') shift - set dummy "$opt" "$val" ${1+"$@"}; shift + set dummy "$opt" "$val" "$@"; shift ;; esac @@ -123,6 +125,7 @@ --help|--version) ${1#--};; -C|--builddir) shift; builddir=$1; shift ;; -n|--dry-run) dryrun=echo; shift;; + -m|--mirror) rm_stale=''; shift;; --*) die "unrecognized option: $1";; *) break;; esac @@ -159,6 +162,7 @@ ./bootstrap srcdir=$(pwd) cd "$builddir" +builddir=$(pwd) ./config.status --recheck ./config.status make @@ -175,13 +179,25 @@ cd $tmp/$pkg/manual # Add all the files. This is simpler than trying to add only the - # new ones because of new directories: it would require iterating on - # adding the outer directories, and then their contents. - # - # find guarantees that we add outer directories first. - find . -name CVS -prune -o -print \ + # new ones because of new directories + # First add non empty dirs individually + find . -name CVS -prune -o -type d \! -empty -print \ + | $XARGS -n1 --no-run-if-empty -- $dryrun $CVS add -ko + # Now add all files + find . -name CVS -prune -o -type f -print \ | $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 ) @@ -189,6 +205,6 @@ # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "VERSION=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -Nru datamash-1.0.7/build-aux/install-sh datamash-1.1.1/build-aux/install-sh --- datamash-1.0.7/build-aux/install-sh 2015-06-17 23:45:09.000000000 +0000 +++ datamash-1.1.1/build-aux/install-sh 2017-01-10 19:44:08.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2013-12-25.23; # UTC +scriptversion=2016-01-11.22; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -496,6 +496,6 @@ # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -Nru datamash-1.0.7/build-aux/make_bin_dist.sh datamash-1.1.1/build-aux/make_bin_dist.sh --- datamash-1.0.7/build-aux/make_bin_dist.sh 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/build-aux/make_bin_dist.sh 2017-01-17 17:50:20.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/sh -## Copyright (C) 2014-2015 Assaf Gordon +## Copyright (C) 2014-2017 Assaf Gordon ## ## This file is part of GNU Datamash. ## diff -Nru datamash-1.0.7/build-aux/mdate-sh datamash-1.1.1/build-aux/mdate-sh --- datamash-1.0.7/build-aux/mdate-sh 2015-06-17 23:45:09.000000000 +0000 +++ datamash-1.1.1/build-aux/mdate-sh 2017-01-10 19:44:08.000000000 +0000 @@ -1,9 +1,9 @@ #!/bin/sh # Get modification time of a file or directory and pretty-print it. -scriptversion=2010-08-21.06; # UTC +scriptversion=2016-01-11.22; # UTC -# Copyright (C) 1995-2015 Free Software Foundation, Inc. +# Copyright (C) 1995-2017 Free Software Foundation, Inc. # written by Ulrich Drepper , June 1995 # # This program is free software; you can redistribute it and/or modify @@ -219,6 +219,6 @@ # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -Nru datamash-1.0.7/build-aux/pmccabe2html datamash-1.1.1/build-aux/pmccabe2html --- datamash-1.0.7/build-aux/pmccabe2html 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/build-aux/pmccabe2html 2017-01-10 20:00:58.000000000 +0000 @@ -0,0 +1,911 @@ +# pmccabe2html - AWK script to convert pmccabe output to html -*- awk -*- + +# Copyright (C) 2007-2017 Free Software Foundation, Inc. + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Written by Jose E. Marchesi . +# Adapted for gnulib by Simon Josefsson . +# Added support for C++ by Giuseppe Scrivano . + +# Typical Invocation is from a Makefile.am: +# +# CYCLO_SOURCES = ${top_srcdir}/src/*.[ch] +# +# cyclo-$(PACKAGE).html: $(CYCLO_SOURCES) +# $(PMCCABE) $(CYCLO_SOURCES) \ +# | sort -nr \ +# | $(AWK) -f ${top_srcdir}/build-aux/pmccabe2html \ +# -v lang=html -v name="$(PACKAGE_NAME)" \ +# -v vcurl="http://git.savannah.gnu.org/gitweb/?p=$(PACKAGE).git;a=blob;f=%FILENAME%;hb=HEAD" \ +# -v url="http://www.gnu.org/software/$(PACKAGE)/" \ +# -v css=${top_srcdir}/build-aux/pmccabe.css \ +# -v cut_dir=${top_srcdir}/ \ +# > $@-tmp +# mv $@-tmp $@ +# +# The variables available are: +# lang output language, either 'html' or 'wiki' +# name project name +# url link to project's home page +# vcurl URL to version controlled source code browser, +# a %FILENAME% in the string is replaced with the relative +# source filename +# css CSS stylesheet filename, included verbatim in HTML output +# css_url link to CSS stylesheet, an URL + +# Prologue & configuration +BEGIN { + # Portable lookup of present time. + "date +%s" | getline epoch_time + "date" | getline chronos_time + + section_global_stats_p = 1 + section_function_cyclo_p = 1 + + # "html" or "wiki" + package_name = name + output_lang = lang + + # General Options + cyclo_simple_max = 10 + cyclo_moderate_max = 20 + cyclo_high_max = 50 + source_file_link_tmpl = vcurl + + # HTML options + if (url != "") + { + html_prolog = "Back to " package_name " Homepage

" + } + html_epilog = "
\ +Copyright (c) 2007, 2008 Free Software Foundation, Inc." + html_doctype = "" + html_comment = "" + html_title = "Cyclomatic Complexity report for " package_name + + # Wiki options + wiki_prolog = "{{Note|This page has been automatically generated}}" + wiki_epilog = "" + + # Internal variables + nfuncs = 0; +} + +# Functions + +function build_stats() +{ + # Maximum modified cyclo + for (fcn in mcyclo) + { + num_of_functions++ + if (mcyclo[fcn] > max_mcyclo) + { + max_mcyclo = mcyclo[fcn] + } + + if (mcyclo[fcn] > cyclo_high_max) + { + num_of_untestable_functions++ + } + else if (mcyclo[fcn] > cyclo_moderate_max) + { + num_of_high_functions++ + } + else if (mcyclo[fcn] > cyclo_simple_max) + { + num_of_moderate_functions++ + } + else + { + num_of_simple_functions++ + } + } +} + +function html_fnc_table_complete (caption) +{ + html_fnc_table(caption, 1, 1, 0, 1, 1, 0, 1) +} + +function html_fnc_table_abbrev (caption) +{ + html_fnc_table(caption, 1, 1, 0, 0, 1, 0, 0) +} + + +function html_fnc_table (caption, + fname_p, + mcyclo_p, + cyclo_p, + num_statements_p, + num_lines_p, + first_line_p, + file_p) +{ + print "" + if (caption != "") + { + print "" + } + html_fnc_header(fname_p, + mcyclo_p, + cyclo_p, + num_statements_p, + num_lines_p, + first_line_p, + file_p) + for (nfnc = 1; nfnc <= nfuncs; nfnc++) + { + html_fnc(nfnc, + fname_p, + mcyclo_p, + cyclo_p, + num_statements_p, + num_lines_p, + first_line_p, + file_p) + } + print "
" caption "
" +} + +function html_header () +{ + print html_doctype + print "" + print html_comment + print "" + print "" html_title "" + print "" + print "" + print "" + print "" + print "" + print "" + print "" + print "" + + + if (css_url != "") + { + print "" + } + if (css != "") + { + print "" + close(css) + } + print "" + print "" +} + +function html_footer () +{ + print "" + print "" +} + +function html_fnc_header (fname_p, + mcyclo_p, + cyclo_p, + num_statements_p, + num_lines_p, + first_line_p, + file_p) +{ + print "" + if (fname_p) + { + # Function name + print "" + print "" + print "" + + print "" + print "Function Name" + print "" + } + if (mcyclo_p) + { + # Modified cyclo + print "" + print "Modified Cyclo" + print "" + } + if (cyclo_p) + { + # Cyclo + print "" + print "Cyclomatic" + print "
" + print "Complexity" + print "" + } + if (num_statements_p) + { + print "" + print "Number of" + print "
" + print "Statements" + print "" + } + if (num_lines_p) + { + print "" + print "Number of" + print "
" + print "Lines" + print "" + } + if (first_line_p) + { + print "" + print "First Line" + print "" + } + if (file_p) + { + print "" + print "Source File" + print "" + + } + print "" +} + +function html_fnc (nfun, + fname_p, + mcyclo_p, + cyclo_p, + num_statements_p, + num_lines_p, + first_line_p, + file_p) +{ + fname = fnames[nfun] + + # Function name + trclass = "function_entry_simple" + if (mcyclo[nfun] > cyclo_high_max) + { + trclass="function_entry_untestable" + } + else if (mcyclo[nfun] > cyclo_moderate_max) + { + trclass="function_entry_high" + } + else if (mcyclo[nfun] > cyclo_simple_max) + { + trclass="function_entry_moderate" + } + + print "" + if (fname_p) + { + print "" + if (file_p && mcyclo[nfun] > cyclo_simple_max) + { + print "\ +" + } + else + { + print " " + } + print "" + + print "" + print fname + print "" + } + if (mcyclo_p) + { + # Modified cyclo + print "" + print mcyclo[nfun] + print "" + } + if (cyclo_p) + { + # Cyclo + print "" + print cyclo[nfun] + print "" + } + if (num_statements_p) + { + # Number of statements + print "" + print num_statements[nfun] + print "" + } + if (num_lines_p) + { + # Number of lines + print "" + print num_lines[nfun] + print "" + } + if (first_line_p) + { + # First line + print "" + print first_line[nfun] + print "" + } + if (file_p) + { + href = "" + if (source_file_link_tmpl != "") + { + # Get href target + href = source_file_link_tmpl + sub(/%FILENAME%/, file[nfun], href) + } + + # Source file + print "" + if (href != "") + { + print "" file[nfun] "" + } + else + { + print file[nfun] + } + + print "" + + + print "" + + if (mcyclo[nfun] > cyclo_simple_max) + { + print "" + + num_columns = 1; + if (fname_p) { num_columns++ } + if (mcyclo_p) { num_columns++ } + if (cyclo_p) { num_columns++ } + if (num_statements_p) { num_columns++ } + if (num_lines_p) { num_columns++ } + if (first_line_p) { num_columns++ } + if (file_p) { num_columns++ } + + print "" + print "
" + print "
"
+
+            while ((getline codeline < (fname nfun "_fn.txt")) > 0)
+            {
+                gsub(/&/, "\\&", codeline)	# Must come first.
+                gsub(//, "\\>", codeline)
+
+                print codeline
+            }
+            close(fname nfun "_fn.txt")
+            system("rm " "'" fname "'" nfun "_fn.txt")
+            print "
" + print "
" + print "" + print "" + } + + } +} + +function html_global_stats () +{ + print "
Summary
" + + print "" + # Total number of functions + print "" + print "" + print "" + print "" + # Number of simple functions + print "" + print "" + print "" + print "" + # Number of moderate functions + print "" + print "" + print "" + print "" + # Number of high functions + print "" + print "" + print "" + print "" + # Number of untestable functions + print "" + print "" + print "" + print "" + print "
" + print "Total number of functions" + print "" + print num_of_functions + print "
" + print "Number of low risk functions" + print "" + print num_of_simple_functions + print "
" + print "Number of moderate risk functions" + print "" + print num_of_moderate_functions + print "
" + print "Number of high risk functions" + print "" + print num_of_high_functions + print "
" + print "Number of untestable functions" + print "" + print num_of_untestable_functions + print "
" + print "
" +} + +function html_function_cyclo () +{ + print "
Details for all functions
" + + print "" + print "" + print "" + print "" + print "" + print "" + # Simple + print "" + print "" + print "" + print "" + print "" + # Moderate + print "" + print "" + print "" + print "" + print "" + # High + print "" + print "" + print "" + print "" + print "" + # Untestable + print "" + print "" + print "" + print "" + print "" + print "
" + print " " + print "" + print "Cyclomatic Complexity" + print "" + print "Risk Evaluation" + print "
" + print " " + print "" + print "0 - " cyclo_simple_max + print "" + print "Simple module, without much risk" + print "
" + print " " + print "" + print cyclo_simple_max + 1 " - " cyclo_moderate_max + print "" + print "More complex module, moderate risk" + print "
" + print " " + print "" + print cyclo_moderate_max + 1 " - " cyclo_high_max + print "" + print "Complex module, high risk" + print "
" + print " " + print "" + print "greater than " cyclo_high_max + print "" + print "Untestable module, very high risk" + print "
" + print "
" + html_fnc_table_complete("") +} + +function wiki_global_stats () +{ + print "{| class=\"cyclo_summary_table\"" + # Total number of functions + print "|-" + print "| class=\"cyclo_summary_header_entry\" | Total number of functions" + print "| class=\"cyclo_summary_number_entry\" |" num_of_functions + # Number of simple functions + print "|-" + print "| class=\"cyclo_summary_header_entry\" | Number of low risk functions" + print "| class=\"cyclo_summary_number_entry\" |" num_of_simple_functions + # Number of moderate functions + print "|-" + print "| class=\"cyclo_summary_header_entry\" | Number of moderate risk functions" + print "| class=\"cyclo_summary_number_entry\" |" num_of_moderate_functions + # Number of high functions + print "|-" + print "| class=\"cyclo_summary_header_entry\" | Number of high risk functions" + print "| class=\"cyclo_summary_number_entry\" |" num_of_high_functions + # Number of untestable functions + print "|-" + print "| class=\"cyclo_summary_header_entry\" | Number of untestable functions" + print "| class=\"cyclo_summary_number_entry\" |" num_of_untestable_functions + print "|}" +} + +function wiki_function_cyclo () +{ + print "==Details for all functions==" + + print "Used ranges:" + + print "{| class =\"cyclo_ranges_table\"" + print "|-" + print "| class=\"cyclo_ranges_header_entry\" | " + print "| class=\"cyclo_ranges_header_entry\" | Cyclomatic Complexity" + print "| class=\"cyclo_ranges_header_entry\" | Risk Evaluation" + # Simple + print "|-" + print "| class=\"cyclo_ranges_entry_simple\" | " + print "| class=\"cyclo_ranges_entry\" | 0 - " cyclo_simple_max + print "| class=\"cyclo_ranges_entry\" | Simple module, without much risk" + # Moderate + print "|-" + print "| class=\"cyclo_ranges_entry_moderate\" | " + print "| class=\"cyclo_ranges_entry\" |" cyclo_simple_max + 1 " - " cyclo_moderate_max + print "| class=\"cyclo_ranges_entry\" | More complex module, moderate risk" + # High + print "|-" + print "| class=\"cyclo_ranges_entry_high\" | " + print "| class=\"cyclo_ranges_entry\" |" cyclo_moderate_max + 1 " - " cyclo_high_max + print "| class=\"cyclo_ranges_entry\" | Complex module, high risk" + # Untestable + print "|-" + print "| class=\"cyclo_ranges_entry_untestable\" | " + print "| class=\"cyclo_ranges_entry\" | greater than " cyclo_high_max + print "| class=\"cyclo_ranges_entry\" | Untestable module, very high risk" + print "|}" + + print "" + print "" + wiki_fnc_table_complete("") +} + +function wiki_fnc_table_complete (caption) +{ + wiki_fnc_table(caption, 1, 1, 0, 1, 1, 0, 1) +} + +function wiki_fnc_table_abbrev (caption) +{ + wiki_fnc_table(caption, 1, 0, 0, 0, 0, 0, 0) +} + +function wiki_fnc_table (caption, + fname_p, + mcyclo_p, + cyclo_p, + num_statements_p, + num_lines_p, + first_line_p, + file_p) +{ + print "{| width=\"90%\" class=\"cyclo_function_table\" cellpadding=\"0\" cellspacing=\"0\">" + if (caption != "") + { + print "|+" caption + } + wiki_fnc_header(fname_p, + mcyclo_p, + cyclo_p, + num_statements_p, + num_lines_p, + first_line_p, + file_p) + for (nfnc = 1; nfnc <= nfuncs; nfnc++) + { + wiki_fnc(nfnc, + fname_p, + mcyclo_p, + cyclo_p, + num_statements_p, + num_lines_p, + first_line_p, + file_p) + } + print "|}" +} + +function wiki_fnc_header (fname_p, + mcyclo_p, + cyclo_p, + num_statements_p, + num_lines_p, + first_line_p, + file_p) +{ + if (fname_p) + { + # Function name + print "! class=\"cyclo_function_table_header_entry\" | Function Name" + } + if (mcyclo_p) + { + # Modified cyclo + print "! class=\"cyclo_function_table_header_entry\" | Modified Cyclo" + } + if (cyclo_p) + { + # Cyclo + print "! class=\"cyclo_function_table_header_entry\" | Cyclomatic Complexity" + } + if (num_statements_p) + { + print "! class=\"cyclo_function_table_header_entry\" | Number of Statements" + } + if (num_lines_p) + { + print "! class=\"cyclo_function_table_header_entry\" | Number of Lines" + } + if (first_line_p) + { + print "! class=\"cyclo_function_table_header_entry\" | First Line" + } + if (file_p) + { + print "! class=\"cyclo_function_table_header_entry\" | Source File" + } +} + +function wiki_fnc (nfnc, + fname_p, + mcyclo_p, + cyclo_p, + num_statements_p, + num_lines_p, + first_line_p, + file_p) +{ + fname = fnames[nfnc] + + # Function name + trclass = "cyclo_function_entry_simple" + if (mcyclo[nfnc] > cyclo_high_max) + { + trclass="cyclo_function_entry_untestable" + } + else if (mcyclo[nfnc] > cyclo_moderate_max) + { + trclass="cyclo_function_entry_high" + } + else if (mcyclo[nfnc] > cyclo_simple_max) + { + trclass="cyclo_function_entry_moderate" + } + + print "|- class=\"" trclass "\"" + if (fname_p) + { + print "| class=\"cyclo_function_entry_name\" |" fname + } + if (mcyclo_p) + { + # Modified cyclo + print "| class=\"cyclo_function_entry_cyclo\" |" mcyclo[nfnc] + } + if (cyclo_p) + { + # Cyclo + print "| class=\"cyclo_function_entry_cyclo\" |" cyclo[nfnc] + } + if (num_statements_p) + { + # Number of statements + print "| class=\"cyclo_function_entry_number\" |" num_statements[nfnc] + } + if (num_lines_p) + { + # Number of lines + print "| class=\"cyclo_function_entry_number\" |" num_lines[nfnc] + } + if (first_line_p) + { + # First line + print "| class=\"cyclo_function_entry_number\" |" first_line[nfnc] + } + if (file_p) + { + href = "" + if (source_file_link_tmpl != "") + { + # Get href target + href = source_file_link_tmpl + sub(/%FILENAME%/, file[nfnc], href) + } + + # Source file + print "| class=\"cyclo_function_entry_filename\" |" \ + ((href != "") ? "[" href " " file[nfnc] "]" : "[" file[nfnc] "]") + } +} + +# Scan data from a line +{ + function_name = $7 + + nfuncs++; + fnames[nfuncs] = function_name + mcyclo[nfuncs] = $1 + cyclo[nfuncs] = $2 + num_statements[nfuncs] = $3 + first_line[nfuncs] = $4 + num_lines[nfuncs] = $5 + + # Build the filename from the file_spec ($6) + begin_util_path = index($6, cut_dir) + tmpfilename = substr($6, begin_util_path + length(cut_dir)) + sub(/\([0-9]+\):/, "", tmpfilename) + file[nfuncs] = tmpfilename + + if (mcyclo[nfuncs] > cyclo_simple_max) + { + # Extract function contents to a fn_txt file + filepath = $6 + + sub(/\([0-9]+\):/, "", filepath) + num_line = 0 + + while ((getline codeline < filepath) > 0) + { + num_line++; + if ((num_line >= first_line[nfuncs]) && + (num_line < first_line[nfuncs] + num_lines[nfuncs])) + { + print codeline > (function_name nfuncs "_fn.txt") + } + } + close (function_name nfuncs "_fn.txt") + close(filepath) + } + + # Initial values for statistics variables + num_of_functions = 0 + max_mcyclo = 0 + max_function_length = 0 + num_of_simple_functions = 0 + num_of_moderate_functions = 0 + num_of_high_functions = 0 + num_of_untestable_functions = 0 +} + +# Epilogue +END { + # Print header (only for html) + if (output_lang == "html") + { + html_header() + } + + # Print prolog + if ((output_lang == "html") && + (html_prolog != "")) + { + print html_prolog + } + if ((output_lang == "wiki") && + (wiki_prolog != "")) + { + print wiki_prolog + } + + if (output_lang == "html") + { + print "
" package_name " Cyclomatic Complexity Report
" + print "

Report generated at: " chronos_time "

" + } + if (output_lang == "wiki") + { + print "==" package_name " Cyclomatic Complexity Report==" + print "Report generated at: '''" chronos_time "'''" + } + + if (section_global_stats_p) + { + build_stats() + + if (output_lang == "html") + { + html_global_stats() + } + if (output_lang == "wiki") + { + wiki_global_stats() + } + } + if (section_function_cyclo_p) + { + if (output_lang == "html") + { + html_function_cyclo() + } + if (output_lang == "wiki") + { + wiki_function_cyclo() + } + } + + # Print epilog + if ((output_lang == "html") && + (html_epilog != "")) + { + print html_epilog + } + if ((output_lang == "wiki") && + (wiki_epilog != "")) + { + print wiki_epilog + } + + # Print footer (html only) + if (output_lang == "html") + { + html_footer() + } +} + +# End of pmccabe2html diff -Nru datamash-1.0.7/build-aux/pmccabe.css datamash-1.1.1/build-aux/pmccabe.css --- datamash-1.0.7/build-aux/pmccabe.css 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/build-aux/pmccabe.css 2015-12-07 22:06:30.000000000 +0000 @@ -0,0 +1,159 @@ +body { + font-family: Helvetica, sans-serif; +} + +.page_title { + font: 18pt Georgia, serif; + color: darkred; +} + +.section_title { + font: 14pt Georgia, serif; + color: darkred; +} + +.report_timestamp { + color: darkred; + font-weight: bold; +} + +.function_src { + text-align: left; + background: white; +} + +.resume_table { +} + +.resume_header_entry { + color: black; +} + +.resume_number_entry { + color: darkred; + font-weight: bold; + text-align: right; +} + +.ranges_table { + border-spacing: 0px; + border-bottom: solid 2px black; + border-top: solid 2px black; + border-left: solid 2px black; + border-right: solid 2px black; +} + +.ranges_header_entry { + padding: 5px; + border-bottom: solid 1px black; + font-size: 1em; + font-weight: bold; + color: darkred; + text-align: left; +} + +.ranges_entry { +} + +.ranges_entry_simple { + background: #87ff75; +} + +.ranges_entry_moderate { + background: #fffc60; +} + +.ranges_entry_high { + background: #ff5a5d; +} + +.ranges_entry_untestable { + background: #993300 +} + + +.function_table { + border-spacing: 0px; + border-bottom: solid 2px black; + border-top: solid 2px black; + border-left: solid 2px black; + border-right: solid 2px black; +} + +.function_table_caption { + font-size: 1.1em; + font-weight: bold; + color: black; + padding: 5px; +} + +.function_table_header { +} + + +.function_table_header_entry { + padding: 5px; + border-bottom: solid 1px black; + font-size: 1em; + font-weight: bold; + color: darkred; + text-align: left; +} + +.function_entry { +} + + +.function_entry_simple { + background: #87ff75; +} + +.function_entry_moderate { + background: #fffc60; +} + +.function_entry_high { + background: #ff5a5d; +} + +.function_entry_untestable { + background: #993300 +} + + +.function_entry_name { + font-size: 1em; + text-align: left; + font-weight: bold; + text-valign: top; + + border-top: solid 1px black; + padding: 3px; +} + +.function_entry_cyclo { + font-size: 1em; + text-align: right; + text-valign: top; + + border-top: solid 1px black; + padding: 3px; +} + +.function_entry_number { + font-size: 1em; + text-align: right; + text-valign: top; + + border-top: solid 1px black; + padding: 3px; +} + +.function_entry_filename { + font-size: 1em; + text-align: left; + text-valign: top; + + border-top: solid 1px black; + padding: 3px; +} diff -Nru datamash-1.0.7/build-aux/prefix-gnulib-mk datamash-1.1.1/build-aux/prefix-gnulib-mk --- datamash-1.0.7/build-aux/prefix-gnulib-mk 2015-06-17 23:45:27.000000000 +0000 +++ datamash-1.1.1/build-aux/prefix-gnulib-mk 2017-01-10 20:00:58.000000000 +0000 @@ -1,4 +1,4 @@ -eval '(exit $?0)' && eval 'exec perl -wS "$0" ${1+"$@"}' +eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"' & eval 'exec perl -wS "$0" $argv:q' if 0; @@ -91,7 +91,7 @@ # Some variables are initialized by gnulib.mk, and we don't want # that. Change '=' to '+='. - if ($lhs_and_assign_op =~ /^GPERF =$/) + if ($lhs_and_assign_op =~ /^(GPERF|V_GPERF.*) =$/) { # Do not change the RHS, which specifies the GPERF program. } @@ -155,16 +155,6 @@ # Unfortunately, as a result we sometimes have lib/lib. s{($prefix){2}}{$1}g; - # lib_libcoreutils_a_SOURCES += \ - # imaxtostr.c \ - # inttostr.c \ - # offtostr.c \ - # uinttostr.c \ - # umaxtostr.c - # The above are not handled since they're on continued lines, so - # deal with them manually: - s{^(\s*)((?:[ui]max|u?int|off)tostr\.c(:? \\)?)$}{$1$prefix$2}gm; - # $(srcdir)/ is actually $(top_srcdir)/$prefix/. # The trailing slash is required to avoid matching this rule: # test '$(srcdir)' = . || rm -f $(top_builddir)/GNUmakefile @@ -243,6 +233,6 @@ ## eval: (add-hook 'write-file-hooks 'time-stamp) ## time-stamp-start: "my $VERSION = '" ## time-stamp-format: "%:y-%02m-%02d %02H:%02M" -## time-stamp-time-zone: "UTC" +## time-stamp-time-zone: "UTC0" ## time-stamp-end: "'; # UTC" ## End: diff -Nru datamash-1.0.7/build-aux/rebuild-coverage.sh datamash-1.1.1/build-aux/rebuild-coverage.sh --- datamash-1.0.7/build-aux/rebuild-coverage.sh 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/build-aux/rebuild-coverage.sh 2017-01-17 17:50:20.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/sh -## Copyright (C) 2014-2015 Assaf Gordon +## Copyright (C) 2014-2017 Assaf Gordon ## ## This file is part of Compute. ## diff -Nru datamash-1.0.7/build-aux/snippet/arg-nonnull.h datamash-1.1.1/build-aux/snippet/arg-nonnull.h --- datamash-1.0.7/build-aux/snippet/arg-nonnull.h 2015-06-17 23:45:27.000000000 +0000 +++ datamash-1.1.1/build-aux/snippet/arg-nonnull.h 2017-01-10 20:00:58.000000000 +0000 @@ -1,5 +1,5 @@ /* A C macro for declaring that specific arguments must not be NULL. - Copyright (C) 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published diff -Nru datamash-1.0.7/build-aux/snippet/c++defs.h datamash-1.1.1/build-aux/snippet/c++defs.h --- datamash-1.0.7/build-aux/snippet/c++defs.h 2015-06-17 23:45:27.000000000 +0000 +++ datamash-1.1.1/build-aux/snippet/c++defs.h 2017-01-10 20:00:58.000000000 +0000 @@ -1,5 +1,5 @@ /* C++ compatible function declaration macros. - Copyright (C) 2010-2015 Free Software Foundation, Inc. + Copyright (C) 2010-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published @@ -17,6 +17,15 @@ #ifndef _GL_CXXDEFS_H #define _GL_CXXDEFS_H +/* Begin/end the GNULIB_NAMESPACE namespace. */ +#if defined __cplusplus && defined GNULIB_NAMESPACE +# define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE { +# define _GL_END_NAMESPACE } +#else +# define _GL_BEGIN_NAMESPACE +# define _GL_END_NAMESPACE +#endif + /* The three most frequent use cases of these macros are: * For providing a substitute for a function that is missing on some @@ -111,14 +120,25 @@ that redirects to rpl_func, if GNULIB_NAMESPACE is defined. Example: _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...)); - */ + + Wrapping rpl_func in an object with an inline conversion operator + avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is + actually used in the program. */ #define _GL_CXXALIAS_RPL(func,rettype,parameters) \ _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters) #if defined __cplusplus && defined GNULIB_NAMESPACE # define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \ namespace GNULIB_NAMESPACE \ { \ - rettype (*const func) parameters = ::rpl_func; \ + static const struct _gl_ ## func ## _wrapper \ + { \ + typedef rettype (*type) parameters; \ + \ + inline operator type () const \ + { \ + return ::rpl_func; \ + } \ + } func = {}; \ } \ _GL_EXTERN_C int _gl_cxxalias_dummy #else @@ -135,8 +155,15 @@ # define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \ namespace GNULIB_NAMESPACE \ { \ - rettype (*const func) parameters = \ - reinterpret_cast(::rpl_func); \ + static const struct _gl_ ## func ## _wrapper \ + { \ + typedef rettype (*type) parameters; \ + \ + inline operator type () const \ + { \ + return reinterpret_cast(::rpl_func); \ + } \ + } func = {}; \ } \ _GL_EXTERN_C int _gl_cxxalias_dummy #else @@ -150,19 +177,24 @@ is defined. Example: _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...)); - */ + + Wrapping func in an object with an inline conversion operator + avoids a reference to func unless GNULIB_NAMESPACE::func is + actually used in the program. */ #if defined __cplusplus && defined GNULIB_NAMESPACE - /* If we were to write - rettype (*const func) parameters = ::func; - like above in _GL_CXXALIAS_RPL_1, the compiler could optimize calls - better (remove an indirection through a 'static' pointer variable), - but then the _GL_CXXALIASWARN macro below would cause a warning not only - for uses of ::func but also for uses of GNULIB_NAMESPACE::func. */ -# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ - namespace GNULIB_NAMESPACE \ - { \ - static rettype (*func) parameters = ::func; \ - } \ +# define _GL_CXXALIAS_SYS(func,rettype,parameters) \ + namespace GNULIB_NAMESPACE \ + { \ + static const struct _gl_ ## func ## _wrapper \ + { \ + typedef rettype (*type) parameters; \ + \ + inline operator type () const \ + { \ + return ::func; \ + } \ + } func = {}; \ + } \ _GL_EXTERN_C int _gl_cxxalias_dummy #else # define _GL_CXXALIAS_SYS(func,rettype,parameters) \ @@ -178,8 +210,15 @@ # define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \ namespace GNULIB_NAMESPACE \ { \ - static rettype (*func) parameters = \ - reinterpret_cast(::func); \ + static const struct _gl_ ## func ## _wrapper \ + { \ + typedef rettype (*type) parameters; \ + \ + inline operator type () const \ + { \ + return reinterpret_cast(::func); \ + } \ + } func = {}; \ } \ _GL_EXTERN_C int _gl_cxxalias_dummy #else @@ -202,9 +241,15 @@ # define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \ namespace GNULIB_NAMESPACE \ { \ - static rettype (*func) parameters = \ - reinterpret_cast( \ - (rettype2(*)parameters2)(::func)); \ + static const struct _gl_ ## func ## _wrapper \ + { \ + typedef rettype (*type) parameters; \ + \ + inline operator type () const \ + { \ + return reinterpret_cast((rettype2 (*) parameters2)(::func)); \ + } \ + } func = {}; \ } \ _GL_EXTERN_C int _gl_cxxalias_dummy #else diff -Nru datamash-1.0.7/build-aux/snippet/unused-parameter.h datamash-1.1.1/build-aux/snippet/unused-parameter.h --- datamash-1.0.7/build-aux/snippet/unused-parameter.h 2015-06-17 23:45:27.000000000 +0000 +++ datamash-1.1.1/build-aux/snippet/unused-parameter.h 2017-01-10 20:00:58.000000000 +0000 @@ -1,5 +1,5 @@ /* A C macro for declaring that specific function parameters are not used. - Copyright (C) 2008-2015 Free Software Foundation, Inc. + Copyright (C) 2008-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published diff -Nru datamash-1.0.7/build-aux/snippet/warn-on-use.h datamash-1.1.1/build-aux/snippet/warn-on-use.h --- datamash-1.0.7/build-aux/snippet/warn-on-use.h 2015-06-17 23:45:27.000000000 +0000 +++ datamash-1.1.1/build-aux/snippet/warn-on-use.h 2017-01-10 20:00:58.000000000 +0000 @@ -1,5 +1,5 @@ /* A C macro for emitting warnings if a function is used. - Copyright (C) 2010-2015 Free Software Foundation, Inc. + Copyright (C) 2010-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published diff -Nru datamash-1.0.7/build-aux/tag-new-version.sh datamash-1.1.1/build-aux/tag-new-version.sh --- datamash-1.0.7/build-aux/tag-new-version.sh 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/build-aux/tag-new-version.sh 2017-01-17 17:50:20.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/sh -## Copyright (C) 2014-2015 Assaf Gordon +## Copyright (C) 2014-2017 Assaf Gordon ## ## This file is part of GNU Datamash. ## diff -Nru datamash-1.0.7/build-aux/texinfo.tex datamash-1.1.1/build-aux/texinfo.tex --- datamash-1.0.7/build-aux/texinfo.tex 2015-06-17 23:45:09.000000000 +0000 +++ datamash-1.1.1/build-aux/texinfo.tex 2017-01-19 15:31:35.000000000 +0000 @@ -3,11 +3,11 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2015-05-26.15} +\def\texinfoversion{2017-01-14.15} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, -% 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 +% 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 % Free Software Foundation, Inc. % % This texinfo.tex file is free software: you can redistribute it and/or @@ -67,6 +67,10 @@ \everyjob{\message{[Texinfo version \texinfoversion]}% \catcode`+=\active \catcode`\_=\active} +% LaTeX's \typeout. This ensures that the messages it is used for +% are identical in format to the corresponding ones from latex/pdflatex. +\def\typeout{\immediate\write17}% + \chardef\other=12 % We never want plain's \outer definition of \+ in Texinfo. @@ -158,22 +162,13 @@ \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi -% Since the category of space is not known, we have to be careful. -\chardef\spacecat = 10 -\def\spaceisspace{\catcode`\ =\spacecat} - -% sometimes characters are active, so we need control sequences. -\chardef\ampChar = `\& -\chardef\colonChar = `\: -\chardef\commaChar = `\, +% Give the space character the catcode for a space. +\def\spaceisspace{\catcode`\ =10\relax} + +% Likewise for ^^M, the end of line character. +\def\endlineisspace{\catcode13=10\relax} + \chardef\dashChar = `\- -\chardef\dotChar = `\. -\chardef\exclamChar= `\! -\chardef\hashChar = `\# -\chardef\lquoteChar= `\` -\chardef\questChar = `\? -\chardef\rquoteChar= `\' -\chardef\semiChar = `\; \chardef\slashChar = `\/ \chardef\underChar = `\_ @@ -196,17 +191,6 @@ wide-spread wrap-around } -% Margin to add to right of even pages, to left of odd pages. -\newdimen\bindingoffset -\newdimen\normaloffset -\newdimen\pagewidth \newdimen\pageheight - -% For a final copy, take out the rectangles -% that mark overfull boxes (in case you have decided -% that the text looks ok even though it passes the margin). -% -\def\finalout{\overfullrule=0pt } - % Sometimes it is convenient to have everything in the transcript file % and nothing on the terminal. We don't just call \tracingall here, % since that produces some useless output on the terminal. We also make @@ -251,6 +235,15 @@ \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount \removelastskip\penalty-200\bigskip\fi\fi} +% Output routine +% + +% For a final copy, take out the rectangles +% that mark overfull boxes (in case you have decided +% that the text looks ok even though it passes the margin). +% +\def\finalout{\overfullrule=0pt } + % Do @cropmarks to get crop marks. % \newif\ifcropmarks @@ -273,10 +266,18 @@ % % Another complication is to let the user choose whether \thischapter % (\thissection) refers to the chapter (section) in effect at the top -% of a page, or that at the bottom of a page. The solution is -% described on page 260 of The TeXbook. It involves outputting two -% marks for the sectioning macros, one before the section break, and -% one after. I won't pretend I can describe this better than DEK... +% of a page, or that at the bottom of a page. + +% \domark is called twice inside \chapmacro, to add one +% mark before the section break, and one after. +% In the second call \prevchapterdefs is the same as \lastchapterdefs, +% and \prevsectiondefs is the same as \lastsectiondefs. +% Then if the page is not broken at the mark, some of the previous +% section appears on the page, and we can get the name of this section +% from \firstmark for @everyheadingmarks top. +% @everyheadingmarks bottom uses \botmark. +% +% See page 260 of The TeXbook. \def\domark{% \toks0=\expandafter{\lastchapterdefs}% \toks2=\expandafter{\lastsectiondefs}% @@ -284,11 +285,15 @@ \toks6=\expandafter{\prevsectiondefs}% \toks8=\expandafter{\lastcolordefs}% \mark{% - \the\toks0 \the\toks2 % 0: top marks (\last...) - \noexpand\or \the\toks4 \the\toks6 % 1: bottom marks (default, \prev...) + \the\toks0 \the\toks2 % 0: marks for @everyheadingmarks top + \noexpand\or \the\toks4 \the\toks6 % 1: for @everyheadingmarks bottom \noexpand\else \the\toks8 % 2: color marks }% } + +% \gettopheadingmarks, \getbottomheadingmarks, +% \getcolormarks - extract needed part of mark. +% % \topmark doesn't work for the very first chapter (after the title % page or the contents), so we use \firstmark there -- this gets us % the mark with the chapter defs, unless the user sneaks in, e.g., @@ -304,36 +309,67 @@ % Avoid "undefined control sequence" errors. \def\lastchapterdefs{} \def\lastsectiondefs{} +\def\lastsection{} \def\prevchapterdefs{} \def\prevsectiondefs{} \def\lastcolordefs{} +% Margin to add to right of even pages, to left of odd pages. +\newdimen\bindingoffset +\newdimen\normaloffset +\newdimen\txipagewidth \newdimen\txipageheight + % Main output routine. +% \chardef\PAGE = 255 \output = {\onepageout{\pagecontents\PAGE}} \newbox\headlinebox \newbox\footlinebox -% \onepageout takes a vbox as an argument. Note that \pagecontents -% does insertions, but you have to call it yourself. +% \onepageout takes a vbox as an argument. +% \shipout a vbox for a single page, adding an optional header, footer, +% cropmarks, and footnote. This also causes index entries for this page +% to be written to the auxiliary files. +% \def\onepageout#1{% \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi % \ifodd\pageno \advance\hoffset by \bindingoffset \else \advance\hoffset by -\bindingoffset\fi % + % Common context changes for both heading and footing. % Do this outside of the \shipout so @code etc. will be expanded in % the headline as they should be, not taken literally (outputting ''code). - \def\commmonheadfootline{\let\hsize=\pagewidth \texinfochars} + \def\commmonheadfootline{\let\hsize=\txipagewidth \texinfochars} % - \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi - \global\setbox\headlinebox = \vbox{\commmonheadfootline \makeheadline}% + % Retrieve the information for the headings from the marks in the page, + % and call Plain TeX's \makeheadline and \makefootline, which use the + % values in \headline and \footline. + % + % This is used to check if we are on the first page of a chapter. + \ifcase1\topmark\fi + \let\prevchaptername\thischaptername + \ifcase0\firstmark\fi + \let\curchaptername\thischaptername % + \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi + % + \ifx\curchaptername\prevchaptername + \let\thischapterheading\thischapter + \else + % \thischapterheading is the same as \thischapter except it is blank + % for the first page of a chapter. This is to prevent the chapter name + % being shown twice. + \def\thischapterheading{}% + \fi + % + \global\setbox\headlinebox = \vbox{\commmonheadfootline \makeheadline}% \global\setbox\footlinebox = \vbox{\commmonheadfootline \makefootline}% % {% + % Set context for writing to auxiliary files like index files. % Have to do this stuff outside the \shipout because we want it to % take effect in \write's, yet the group defined by the \vbox ends % before the \shipout runs. @@ -342,10 +378,10 @@ \normalturnoffactive % \ in index entries must not stay \, e.g., if % the page break happens to be in the middle of an example. % We don't want .vr (or whatever) entries like this: - % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}} + % \entry{{\indexbackslash }acronym}{32}{\code {\acronym}} % "\acronym" won't work when it's read back in; % it needs to be - % {\code {{\tt \backslashcurfont }acronym} + % {\code {{\backslashcurfont }acronym} \shipout\vbox{% % Do this early so pdf references go to the beginning of the page. \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi @@ -403,7 +439,8 @@ \newinsert\margin \dimen\margin=\maxdimen -\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} +% Main part of page, including any footnotes +\def\pagebody#1{\vbox to\txipageheight{\boxmaxdepth=\maxdepth #1}} {\catcode`\@ =11 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi % marginal hacks, juha@viisa.uucp (Juha Takala) @@ -425,9 +462,13 @@ \def\nsbot{\vbox {\hrule height\cornerlong depth\cornerthick width\cornerthick}} + +% Argument parsing + % Parse an argument, then pass it to #1. The argument is the rest of % the input line (except we remove a trailing comment). #1 should be a % macro which expects an ordinary undelimited TeX argument. +% For example, \def\foo{\parsearg\fooxxx}. % \def\parsearg{\parseargusing{}} \def\parseargusing#1#2{% @@ -446,9 +487,11 @@ }% } -% First remove any @comment, then any @c comment. +% First remove any @comment, then any @c comment. Also remove a @texinfoc +% comment (see \scanmacro for details). Pass the result on to \argcheckspaces. \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} -\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} +\def\argremovec#1\c#2\ArgTerm{\argremovetexinfoc #1\texinfoc\ArgTerm} +\def\argremovetexinfoc#1\texinfoc#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} % Each occurrence of `\^^M' or `\^^M' is replaced by a single space. % @@ -483,14 +526,13 @@ % \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}} + +% \parseargdef - define a command taking an argument on the line +% % \parseargdef\foo{...} % is roughly equivalent to % \def\foo{\parsearg\Xfoo} % \def\Xfoo#1{...} -% -% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my -% favourite TeX trick. --kasal, 16nov03 - \def\parseargdef#1{% \expandafter \doparseargdef \csname\string#1\endcsname #1% } @@ -680,21 +722,26 @@ \endgraf % Not \par, as it may have been set to \lisppar. \global\dimen1 = \prevdepth \egroup % End the \vtop. + \addgroupbox + \prevdepth = \dimen1 + \checkinserts +} + +\def\addgroupbox{ % \dimen0 is the vertical size of the group's box. \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox % \dimen2 is how much space is left on the page (more or less). - \dimen2 = \pageheight \advance\dimen2 by -\pagetotal + \dimen2 = \txipageheight \advance\dimen2 by -\pagetotal % if the group doesn't fit on the current page, and it's a big big % group, force a page break. \ifdim \dimen0 > \dimen2 - \ifdim \pagetotal < \vfilllimit\pageheight + \ifdim \pagetotal < \vfilllimit\txipageheight \page \fi \fi \box\groupbox - \prevdepth = \dimen1 - \checkinserts } + % % TeX puts in an \escapechar (i.e., `@') at the beginning of the help % message, so this ends up printing `@group can only ...'. @@ -818,36 +865,6 @@ \temp } -% @| inserts a changebar to the left of the current line. It should -% surround any changed text. This approach does *not* work if the -% change spans more than two lines of output. To handle that, we would -% have adopt a much more difficult approach (putting marks into the main -% vertical list for the beginning and end of each change). This command -% is not documented, not supported, and doesn't work. -% -\def\|{% - % \vadjust can only be used in horizontal mode. - \leavevmode - % - % Append this vertical mode material after the current line in the output. - \vadjust{% - % We want to insert a rule with the height and depth of the current - % leading; that is exactly what \strutbox is supposed to record. - \vskip-\baselineskip - % - % \vadjust-items are inserted at the left edge of the type. So - % the \llap here moves out into the left-hand margin. - \llap{% - % - % For a thicker or thinner bar, change the `1pt'. - \vrule height\baselineskip width1pt - % - % This is the space between the bar and the text. - \hskip 12pt - }% - }% -} - % @include FILE -- \input text of FILE. % \def\include{\parseargusing\filenamecatcodes\includezzz} @@ -936,13 +953,14 @@ % @comment ...line which is ignored... % @c is the same as @comment % @ignore ... @end ignore is another way to write a comment -% -\def\comment{\begingroup \catcode`\^^M=\other% + + +\def\c{\begingroup \catcode`\^^M=\active% \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% -\commentxxx} -{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} +\cxxx} +{\catcode`\^^M=\active \gdef\cxxx#1^^M{\endgroup}} % -\let\c=\comment +\let\comment\c % @paragraphindent NCHARS % We'll use ems for NCHARS, close enough. @@ -1028,45 +1046,8 @@ % @refill is a no-op. \let\refill=\relax -% If working on a large document in chapters, it is convenient to -% be able to disable indexing, cross-referencing, and contents, for test runs. -% This is done with @novalidate (before @setfilename). -% -\newif\iflinks \linkstrue % by default we want the aux files. -\let\novalidate = \linksfalse - -% @setfilename is done at the beginning of every texinfo file. -% So open here the files we need to have open while reading the input. -% This makes it possible to make a .fmt file for texinfo. -\def\setfilename{% - \fixbackslash % Turn off hack to swallow `\input texinfo'. - \iflinks - \tryauxfile - % Open the new aux file. TeX will close it automatically at exit. - \immediate\openout\auxfile=\jobname.aux - \fi % \openindices needs to do some work in any case. - \openindices - \let\setfilename=\comment % Ignore extra @setfilename cmds. - % - % If texinfo.cnf is present on the system, read it. - % Useful for site-wide @afourpaper, etc. - \openin 1 texinfo.cnf - \ifeof 1 \else \input texinfo.cnf \fi - \closein 1 - % - \comment % Ignore the actual filename. -} - -% Called from \setfilename. -% -\def\openindices{% - \newindex{cp}% - \newcodeindex{fn}% - \newcodeindex{vr}% - \newcodeindex{tp}% - \newcodeindex{ky}% - \newcodeindex{pg}% -} +% @setfilename INFO-FILENAME - ignored +\let\setfilename=\comment % @bye. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} @@ -1084,10 +1065,91 @@ \newtoks\toksC \newtoks\toksD \newbox\boxA +\newbox\boxB \newcount\countA \newif\ifpdf \newif\ifpdfmakepagedest +% +% For LuaTeX +% + +\newif\iftxiuseunicodedestname +\txiuseunicodedestnamefalse % For pdfTeX etc. + +\ifx\luatexversion\thisisundefined +\else + % Use Unicode destination names + \txiuseunicodedestnametrue + % Escape PDF strings with converting UTF-16 from UTF-8 + \begingroup + \catcode`\%=12 + \directlua{ + function UTF16oct(str) + tex.sprint(string.char(0x5c) .. '376' .. string.char(0x5c) .. '377') + for c in string.utfvalues(str) do + if c < 0x10000 then + tex.sprint( + string.format(string.char(0x5c) .. string.char(0x25) .. '03o' .. + string.char(0x5c) .. string.char(0x25) .. '03o', + (c / 256), (c % 256))) + else + c = c - 0x10000 + local c_hi = c / 1024 + 0xd800 + local c_lo = c % 1024 + 0xdc00 + tex.sprint( + string.format(string.char(0x5c) .. string.char(0x25) .. '03o' .. + string.char(0x5c) .. string.char(0x25) .. '03o' .. + string.char(0x5c) .. string.char(0x25) .. '03o' .. + string.char(0x5c) .. string.char(0x25) .. '03o', + (c_hi / 256), (c_hi % 256), + (c_lo / 256), (c_lo % 256))) + end + end + end + } + \endgroup + \def\pdfescapestrutfsixteen#1{\directlua{UTF16oct('\luaescapestring{#1}')}} + % Escape PDF strings without converting + \begingroup + \directlua{ + function PDFescstr(str) + for c in string.bytes(str) do + if c <= 0x20 or c >= 0x80 or c == 0x28 or c == 0x29 or c == 0x5c then + tex.sprint( + string.format(string.char(0x5c) .. string.char(0x25) .. '03o', + c)) + else + tex.sprint(string.char(c)) + end + end + end + } + \endgroup + \def\pdfescapestring#1{\directlua{PDFescstr('\luaescapestring{#1}')}} + \ifnum\luatexversion>84 + % For LuaTeX >= 0.85 + \def\pdfdest{\pdfextension dest} + \let\pdfoutput\outputmode + \def\pdfliteral{\pdfextension literal} + \def\pdfcatalog{\pdfextension catalog} + \def\pdftexversion{\numexpr\pdffeedback version\relax} + \let\pdfximage\saveimageresource + \let\pdfrefximage\useimageresource + \let\pdflastximage\lastsavedimageresourceindex + \def\pdfendlink{\pdfextension endlink\relax} + \def\pdfoutline{\pdfextension outline} + \def\pdfstartlink{\pdfextension startlink} + \def\pdffontattr{\pdfextension fontattr} + \def\pdfobj{\pdfextension obj} + \def\pdflastobj{\numexpr\pdffeedback lastobj\relax} + \let\pdfpagewidth\pagewidth + \let\pdfpageheight\pageheight + \edef\pdfhorigin{\pdfvariable horigin} + \edef\pdfvorigin{\pdfvariable vorigin} + \fi +\fi + % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 % can be set). So we test for \relax and 0 as well as being undefined. \ifx\pdfoutput\thisisundefined @@ -1118,12 +1180,21 @@ \ifx\pdfescapestring\thisisundefined % No primitive available; should we give a warning or log? % Many times it won't matter. + \xdef#1{#1}% \else % The expandable \pdfescapestring primitive escapes parentheses, % backslashes, and other special chars. \xdef#1{\pdfescapestring{#1}}% \fi } +\def\txiescapepdfutfsixteen#1{% + \ifx\pdfescapestrutfsixteen\thisisundefined + % No UTF-16 converting macro available. + \txiescapepdf{#1}% + \else + \xdef#1{\pdfescapestrutfsixteen{#1}}% + \fi +} \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images with PDF output, and none of those formats could be found. (.eps cannot @@ -1141,8 +1212,8 @@ \def\rgbDarkRed{0.50 0.09 0.12} \def\rgbBlack{0 0 0} % - % k sets the color for filling (usual text, etc.); - % K sets the color for stroking (thin rules, e.g., normal _'s). + % rg sets the color for filling (usual text, etc.); + % RG sets the color for stroking (thin rules, e.g., normal _'s). \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}} % % Set color, and create a mark which defines \thiscolor accordingly, @@ -1233,17 +1304,77 @@ \pdfrefximage \pdflastximage \fi} % - \def\pdfmkdest#1{{% + \def\setpdfdestname#1{{% % We have to set dummies so commands such as @code, and characters % such as \, aren't expanded when present in a section title. \indexnofonts - \turnoffactive \makevalueexpandable + \turnoffactive + \iftxiuseunicodedestname + \ifx \declaredencoding \latone + % Pass through Latin-1 characters. + % LuaTeX with byte wise I/O converts Latin-1 characters to Unicode. + \else + \ifx \declaredencoding \utfeight + % Pass through Unicode characters. + \else + % Use ASCII approximations in destination names. + \passthroughcharsfalse + \fi + \fi + \else + % Use ASCII approximations in destination names. + \passthroughcharsfalse + \fi \def\pdfdestname{#1}% \txiescapepdf\pdfdestname - \safewhatsit{\pdfdest name{\pdfdestname} xyz}% }} % + \def\setpdfoutlinetext#1{{% + \indexnofonts + \makevalueexpandable + \turnoffactive + \ifx \declaredencoding \latone + % The PDF format can use an extended form of Latin-1 in bookmark + % strings. See Appendix D of the PDF Reference, Sixth Edition, for + % the "PDFDocEncoding". + \passthroughcharstrue + % Pass through Latin-1 characters. + % LuaTeX: Convert to Unicode + % pdfTeX: Use Latin-1 as PDFDocEncoding + \def\pdfoutlinetext{#1}% + \else + \ifx \declaredencoding \utfeight + \ifx\luatexversion\thisisundefined + % For pdfTeX with UTF-8. + % TODO: the PDF format can use UTF-16 in bookmark strings, + % but the code for this isn't done yet. + % Use ASCII approximations. + \passthroughcharsfalse + \def\pdfoutlinetext{#1}% + \else + % For LuaTeX with UTF-8. + % Pass through Unicode characters for title texts. + \passthroughcharstrue + \def\pdfoutlinetext{#1}% + \fi + \else + % For non-Latin-1 or non-UTF-8 encodings. + % Use ASCII approximations. + \passthroughcharsfalse + \def\pdfoutlinetext{#1}% + \fi + \fi + % LuaTeX: Convert to UTF-16 + % pdfTeX: Use Latin-1 as PDFDocEncoding + \txiescapepdfutfsixteen\pdfoutlinetext + }} + % + \def\pdfmkdest#1{% + \setpdfdestname{#1}% + \safewhatsit{\pdfdest name{\pdfdestname} xyz}% + } + % % used to mark target names; must be expandable. \def\pdfmkpgn#1{#1} % @@ -1271,18 +1402,13 @@ % page number. We could generate a destination for the section % text in the case where a section has no node, but it doesn't % seem worth the trouble, since most documents are normally structured. - \edef\pdfoutlinedest{#3}% - \ifx\pdfoutlinedest\empty - \def\pdfoutlinedest{#4}% - \else - \txiescapepdf\pdfoutlinedest + \setpdfoutlinetext{#1} + \setpdfdestname{#3} + \ifx\pdfdestname\empty + \def\pdfdestname{#4}% \fi % - % Also escape PDF chars in the display string. - \edef\pdfoutlinetext{#1}% - \txiescapepdf\pdfoutlinetext - % - \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}% + \pdfoutline goto name{\pdfmkpgn{\pdfdestname}}#2{\pdfoutlinetext}% } % \def\pdfmakeoutlines{% @@ -1424,54 +1550,310 @@ \def\makelink{\addtokens{\toksB}% {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} \def\pdflink#1{% - \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} + \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} + \setcolor{\linkcolor}#1\endlink} + \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} +\else + % non-pdf mode + \let\pdfmkdest = \gobble + \let\pdfurl = \gobble + \let\endlink = \relax + \let\setcolor = \gobble + \let\pdfsetcolor = \gobble + \let\pdfmakeoutlines = \relax +\fi % \ifx\pdfoutput + +% +% For XeTeX +% +\ifx\XeTeXrevision\thisisundefined +\else + % + % XeTeX version check + % + \ifnum\strcmp{\the\XeTeXversion\XeTeXrevision}{0.99996}>-1 + % TeX Live 2016 contains XeTeX 0.99996 and xdvipdfmx 20160307. + % It can use the `dvipdfmx:config' special (from TeX Live SVN r40941). + % For avoiding PDF destination name replacement, we use this special + % instead of xdvipdfmx's command line option `-C 0x0010'. + \special{dvipdfmx:config C 0x0010} + % XeTeX 0.99995+ comes with xdvipdfmx 20160307+. + % It can handle Unicode destination names for PDF. + \txiuseunicodedestnametrue + \else + % XeTeX < 0.99996 (TeX Live < 2016) cannot use the + % `dvipdfmx:config' special. + % So for avoiding PDF destination name replacement, + % xdvipdfmx's command line option `-C 0x0010' is necessary. + % + % XeTeX < 0.99995 can not handle Unicode destination names for PDF + % because xdvipdfmx 20150315 has a UTF-16 conversion issue. + % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753). + \txiuseunicodedestnamefalse + \fi + % + % Color support + % + \def\rgbDarkRed{0.50 0.09 0.12} + \def\rgbBlack{0 0 0} + % + \def\pdfsetcolor#1{\special{pdf:scolor [#1]}} + % + % Set color, and create a mark which defines \thiscolor accordingly, + % so that \makeheadline knows which color to restore. + \def\setcolor#1{% + \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}% + \domark + \pdfsetcolor{#1}% + } + % + \def\maincolor{\rgbBlack} + \pdfsetcolor{\maincolor} + \edef\thiscolor{\maincolor} + \def\lastcolordefs{} + % + \def\makefootline{% + \baselineskip24pt + \line{\pdfsetcolor{\maincolor}\the\footline}% + } + % + \def\makeheadline{% + \vbox to 0pt{% + \vskip-22.5pt + \line{% + \vbox to8.5pt{}% + % Extract \thiscolor definition from the marks. + \getcolormarks + % Typeset the headline with \maincolor, then restore the color. + \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% + }% + \vss + }% + \nointerlineskip + } + % + % PDF outline support + % + % Emulate pdfTeX primitive + \def\pdfdest name#1 xyz{% + \special{pdf:dest (#1) [@thispage /XYZ @xpos @ypos null]}% + } + % + \def\setpdfdestname#1{{% + % We have to set dummies so commands such as @code, and characters + % such as \, aren't expanded when present in a section title. + \indexnofonts + \makevalueexpandable + \turnoffactive + \iftxiuseunicodedestname + % Pass through Unicode characters. + \else + % Use ASCII approximations in destination names. + \passthroughcharsfalse + \fi + \def\pdfdestname{#1}% + \txiescapepdf\pdfdestname + }} + % + \def\setpdfoutlinetext#1{{% + \turnoffactive + % Always use Unicode characters in title texts. + \def\pdfoutlinetext{#1}% + % For XeTeX, xdvipdfmx converts to UTF-16. + % So we do not convert. + \txiescapepdf\pdfoutlinetext + }} + % + \def\pdfmkdest#1{% + \setpdfdestname{#1}% + \safewhatsit{\pdfdest name{\pdfdestname} xyz}% + } + % + % by default, use black for everything. + \def\urlcolor{\rgbBlack} + \def\linkcolor{\rgbBlack} + \def\endlink{\setcolor{\maincolor}\pdfendlink} + % + \def\dopdfoutline#1#2#3#4{% + \setpdfoutlinetext{#1} + \setpdfdestname{#3} + \ifx\pdfdestname\empty + \def\pdfdestname{#4}% + \fi + % + \special{pdf:out [-] #2 << /Title (\pdfoutlinetext) /A + << /S /GoTo /D (\pdfdestname) >> >> }% + } + % + \def\pdfmakeoutlines{% + \begingroup + % + % For XeTeX, counts of subentries are not necessary. + % Therefore, we read toc only once. + % + % We use node names as destinations. + \def\partentry##1##2##3##4{}% ignore parts in the outlines + \def\numchapentry##1##2##3##4{% + \dopdfoutline{##1}{1}{##3}{##4}}% + \def\numsecentry##1##2##3##4{% + \dopdfoutline{##1}{2}{##3}{##4}}% + \def\numsubsecentry##1##2##3##4{% + \dopdfoutline{##1}{3}{##3}{##4}}% + \def\numsubsubsecentry##1##2##3##4{% + \dopdfoutline{##1}{4}{##3}{##4}}% + % + \let\appentry\numchapentry% + \let\appsecentry\numsecentry% + \let\appsubsecentry\numsubsecentry% + \let\appsubsubsecentry\numsubsubsecentry% + \let\unnchapentry\numchapentry% + \let\unnsecentry\numsecentry% + \let\unnsubsecentry\numsubsecentry% + \let\unnsubsubsecentry\numsubsubsecentry% + % + % For XeTeX, xdvipdfmx converts strings to UTF-16. + % Therefore, the encoding and the language may not be considered. + % + \indexnofonts + \setupdatafile + % We can have normal brace characters in the PDF outlines, unlike + % Texinfo index files. So set that up. + \def\{{\lbracecharliteral}% + \def\}{\rbracecharliteral}% + \catcode`\\=\active \otherbackslash + \input \tocreadfilename + \endgroup + } + {\catcode`[=1 \catcode`]=2 + \catcode`{=\other \catcode`}=\other + \gdef\lbracecharliteral[{]% + \gdef\rbracecharliteral[}]% + ] + + \special{pdf:docview << /PageMode /UseOutlines >> } + % ``\special{pdf:tounicode ...}'' is not necessary + % because xdvipdfmx converts strings from UTF-8 to UTF-16 without it. + % However, due to a UTF-16 conversion issue of xdvipdfmx 20150315, + % ``\special{pdf:dest ...}'' cannot handle non-ASCII strings. + % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753). +% + \def\skipspaces#1{\def\PP{#1}\def\D{|}% + \ifx\PP\D\let\nextsp\relax + \else\let\nextsp\skipspaces + \addtokens{\filename}{\PP}% + \advance\filenamelength by 1 + \fi + \nextsp} + \def\getfilename#1{% + \filenamelength=0 + % If we don't expand the argument now, \skipspaces will get + % snagged on things like "@value{foo}". + \edef\temp{#1}% + \expandafter\skipspaces\temp|\relax + } + % make a live url in pdf output. + \def\pdfurl#1{% + \begingroup + % it seems we really need yet another set of dummies; have not + % tried to figure out what each command should do in the context + % of @url. for now, just make @/ a no-op, that's the only one + % people have actually reported a problem with. + % + \normalturnoffactive + \def\@{@}% + \let\/=\empty + \makevalueexpandable + % do we want to go so far as to use \indexnofonts instead of just + % special-casing \var here? + \def\var##1{##1}% + % + \leavevmode\setcolor{\urlcolor}% + \special{pdf:bann << /Border [0 0 0] + /Subtype /Link /A << /S /URI /URI (#1) >> >>}% + \endgroup} + \def\endlink{\setcolor{\maincolor}\special{pdf:eann}} + \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} + \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} + \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} + \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} + \def\maketoks{% + \expandafter\poptoks\the\toksA|ENDTOKS|\relax + \ifx\first0\adn0 + \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 + \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 + \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 + \else + \ifnum0=\countA\else\makelink\fi + \ifx\first.\let\next=\done\else + \let\next=\maketoks + \addtokens{\toksB}{\the\toksD} + \ifx\first,\addtokens{\toksB}{\space}\fi + \fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \next} + \def\makelink{\addtokens{\toksB}% + {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} + \def\pdflink#1{% + \special{pdf:bann << /Border [0 0 0] + /Type /Annot /Subtype /Link /A << /S /GoTo /D (#1) >> >>}% \setcolor{\linkcolor}#1\endlink} \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} -\else - % non-pdf mode - \let\pdfmkdest = \gobble - \let\pdfurl = \gobble - \let\endlink = \relax - \let\setcolor = \gobble - \let\pdfsetcolor = \gobble - \let\pdfmakeoutlines = \relax -\fi % \ifx\pdfoutput - - -\message{fonts,} - -% Change the current font style to #1, remembering it in \curfontstyle. -% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in -% italics, not bold italics. -% -\def\setfontstyle#1{% - \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. - \csname ten#1\endcsname % change the current font -} - -% Select #1 fonts with the current style. % -\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname} - -\def\rm{\fam=0 \setfontstyle{rm}} -\def\it{\fam=\itfam \setfontstyle{it}} -\def\sl{\fam=\slfam \setfontstyle{sl}} -\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} -\def\tt{\fam=\ttfam \setfontstyle{tt}} - -% Unfortunately, we have to override this for titles and the like, since -% in those cases "rm" is bold. Sigh. -\def\rmisbold{\rm\def\curfontstyle{bf}} - -% Texinfo sort of supports the sans serif font style, which plain TeX does not. -% So we set up a \sf. -\newfam\sffam -\def\sf{\fam=\sffam \setfontstyle{sf}} -\let\li = \sf % Sometimes we call it \li, not \sf. + % + % @image support + % + % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). + \def\doxeteximage#1#2#3{% + \def\xeteximagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% + \def\xeteximageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% + % + % XeTeX (and the PDF format) supports .pdf, .png, .jpg (among + % others). Let's try in that order, PDF first since if + % someone has a scalable image, presumably better to use that than a + % bitmap. + \let\xeteximgext=\empty + \begingroup + \openin 1 #1.pdf \ifeof 1 + \openin 1 #1.PDF \ifeof 1 + \openin 1 #1.png \ifeof 1 + \openin 1 #1.jpg \ifeof 1 + \openin 1 #1.jpeg \ifeof 1 + \openin 1 #1.JPG \ifeof 1 + \errmessage{Could not find image file #1 for XeTeX}% + \else \gdef\xeteximgext{JPG}% + \fi + \else \gdef\xeteximgext{jpeg}% + \fi + \else \gdef\xeteximgext{jpg}% + \fi + \else \gdef\xeteximgext{png}% + \fi + \else \gdef\xeteximgext{PDF}% + \fi + \else \gdef\xeteximgext{pdf}% + \fi + \closein 1 + \endgroup + % + \def\xetexpdfext{pdf}% + \ifx\xeteximgext\xetexpdfext + \XeTeXpdffile "#1".\xeteximgext "" + \else + \def\xetexpdfext{PDF}% + \ifx\xeteximgext\xetexpdfext + \XeTeXpdffile "#1".\xeteximgext "" + \else + \XeTeXpicfile "#1".\xeteximgext "" + \fi + \fi + \ifdim \wd0 >0pt width \xeteximagewidth \fi + \ifdim \wd2 >0pt height \xeteximageheight \fi \relax + } +\fi -% We don't need math for this font style. -\def\ttsl{\setfontstyle{ttsl}} +% +\message{fonts,} % Set the baselineskip to #1, and the lineskip and strut size % correspondingly. There is no deep meaning behind these magic numbers @@ -1820,8 +2202,10 @@ % A few fonts for @defun names and args. \setfont\defbf\bfshape{10}{\magstep1}{OT1} \setfont\deftt\ttshape{10}{\magstep1}{OT1TT} +\setfont\defsl\slshape{10}{\magstep1}{OT1TT} \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} -\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} +\def\df{\let\ttfont=\deftt \let\bffont = \defbf +\let\ttslfont=\defttsl \let\slfont=\defsl \bf} % Fonts for indices, footnotes, small examples (9pt). \def\smallnominalsize{9pt} @@ -1882,6 +2266,7 @@ % Section fonts (14.4pt). \def\secnominalsize{14pt} \setfont\secrm\rmbshape{12}{\magstep1}{OT1} +\setfont\secrmnotbold\rmshape{12}{\magstep1}{OT1} \setfont\secit\itbshape{10}{\magstep2}{OT1IT} \setfont\secsl\slbshape{10}{\magstep2}{OT1} \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT} @@ -1907,7 +2292,7 @@ \font\ssecsy=cmsy10 scaled 1315 \def\ssececsize{1200} -% Reduced fonts for @acro in text (10pt). +% Reduced fonts for @acronym in text (10pt). \def\reducednominalsize{10pt} \setfont\reducedrm\rmshape{10}{1000}{OT1} \setfont\reducedtt\ttshape{10}{1000}{OT1TT} @@ -1951,8 +2336,10 @@ % A few fonts for @defun names and args. \setfont\defbf\bfshape{10}{\magstephalf}{OT1} \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} +\setfont\defsl\slshape{10}{\magstephalf}{OT1TT} \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} -\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} +\def\df{\let\ttfont=\deftt \let\bffont = \defbf +\let\slfont=\defsl \let\ttslfont=\defttsl \bf} % Fonts for indices, footnotes, small examples (9pt). \def\smallnominalsize{9pt} @@ -2038,7 +2425,7 @@ \font\ssecsy=cmsy10 \def\ssececsize{1000} -% Reduced fonts for @acro in text (9pt). +% Reduced fonts for @acronym in text (9pt). \def\reducednominalsize{9pt} \setfont\reducedrm\rmshape{9}{1000}{OT1} \setfont\reducedtt\ttshape{9}{1000}{OT1TT} @@ -2058,6 +2445,12 @@ \rm } % end of 10pt text font size definitions, \definetextfontsizex +% Fonts for short table of contents. +\setfont\shortcontrm\rmshape{12}{1000}{OT1} +\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 +\setfont\shortcontsl\slshape{12}{1000}{OT1} +\setfont\shortconttt\ttshape{12}{1000}{OT1TT} + % We provide the user-level command % @fonttextsize 10 @@ -2084,20 +2477,47 @@ \endgroup } +% +% Change the current font style to #1, remembering it in \curfontstyle. +% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in +% italics, not bold italics. +% +\def\setfontstyle#1{% + \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. + \csname #1font\endcsname % change the current font +} + +\def\rm{\fam=0 \setfontstyle{rm}} +\def\it{\fam=\itfam \setfontstyle{it}} +\def\sl{\fam=\slfam \setfontstyle{sl}} +\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} +\def\tt{\fam=\ttfam \setfontstyle{tt}} + +% Texinfo sort of supports the sans serif font style, which plain TeX does not. +% So we set up a \sf. +\newfam\sffam +\def\sf{\fam=\sffam \setfontstyle{sf}} + +% We don't need math for this font style. +\def\ttsl{\setfontstyle{ttsl}} + + % In order for the font changes to affect most math symbols and letters, % we have to define the \textfont of the standard families. We don't % bother to reset \scriptfont and \scriptscriptfont; awaiting user need. % \def\resetmathfonts{% - \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy - \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf - \textfont\ttfam=\tentt \textfont\sffam=\tensf + \textfont0=\rmfont \textfont1=\ifont \textfont2=\syfont + \textfont\itfam=\itfont \textfont\slfam=\slfont \textfont\bffam=\bffont + \textfont\ttfam=\ttfont \textfont\sffam=\sffont } -% The font-changing commands redefine the meanings of \tenSTYLE, instead -% of just \STYLE. We do this because \STYLE needs to also set the -% current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire -% \tenSTYLE to set the current font. +% + +% The font-changing commands (all called \...fonts) redefine the meanings +% of \STYLEfont, instead of just \STYLE. We do this because \STYLE needs +% to also set the current \fam for math mode. Our \STYLE (e.g., \rm) +% commands hardwire \STYLEfont to set the current font. % % Each font-changing command also sets the names \lsize (one size lower) % and \lllsize (three sizes lower). These relative commands are used @@ -2105,78 +2525,63 @@ % % This all needs generalizing, badly. % -\def\textfonts{% - \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl - \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc - \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy - \let\tenttsl=\textttsl - \def\curfontsize{text}% - \def\lsize{reduced}\def\lllsize{smaller}% - \resetmathfonts \setleading{\textleading}} -\def\titlefonts{% - \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl - \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc - \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy - \let\tenttsl=\titlettsl - \def\curfontsize{title}% - \def\lsize{chap}\def\lllsize{subsec}% - \resetmathfonts \setleading{27pt}} -\def\titlefont#1{{\titlefonts\rmisbold #1}} -\def\chapfonts{% - \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl - \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc - \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy - \let\tenttsl=\chapttsl - \def\curfontsize{chap}% - \def\lsize{sec}\def\lllsize{text}% - \resetmathfonts \setleading{19pt}} -\def\secfonts{% - \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl - \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc - \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy - \let\tenttsl=\secttsl - \def\curfontsize{sec}% - \def\lsize{subsec}\def\lllsize{reduced}% - \resetmathfonts \setleading{17pt}} -\def\subsecfonts{% - \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl - \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc - \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy - \let\tenttsl=\ssecttsl - \def\curfontsize{ssec}% - \def\lsize{text}\def\lllsize{small}% - \resetmathfonts \setleading{15pt}} -\let\subsubsecfonts = \subsecfonts -\def\reducedfonts{% - \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl - \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc - \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy - \let\tenttsl=\reducedttsl - \def\curfontsize{reduced}% - \def\lsize{small}\def\lllsize{smaller}% - \resetmathfonts \setleading{10.5pt}} -\def\smallfonts{% - \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl - \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc - \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy - \let\tenttsl=\smallttsl - \def\curfontsize{small}% - \def\lsize{smaller}\def\lllsize{smaller}% - \resetmathfonts \setleading{10.5pt}} -\def\smallerfonts{% - \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl - \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc - \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy - \let\tenttsl=\smallerttsl - \def\curfontsize{smaller}% - \def\lsize{smaller}\def\lllsize{smaller}% - \resetmathfonts \setleading{9.5pt}} -% Fonts for short table of contents. -\setfont\shortcontrm\rmshape{12}{1000}{OT1} -\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 -\setfont\shortcontsl\slshape{12}{1000}{OT1} -\setfont\shortconttt\ttshape{12}{1000}{OT1TT} +\def\assignfonts#1{% + \expandafter\let\expandafter\rmfont\csname #1rm\endcsname + \expandafter\let\expandafter\itfont\csname #1it\endcsname + \expandafter\let\expandafter\slfont\csname #1sl\endcsname + \expandafter\let\expandafter\bffont\csname #1bf\endcsname + \expandafter\let\expandafter\ttfont\csname #1tt\endcsname + \expandafter\let\expandafter\smallcaps\csname #1sc\endcsname + \expandafter\let\expandafter\sffont \csname #1sf\endcsname + \expandafter\let\expandafter\ifont \csname #1i\endcsname + \expandafter\let\expandafter\syfont \csname #1sy\endcsname + \expandafter\let\expandafter\ttslfont\csname #1ttsl\endcsname +} + +\newif\ifrmisbold + +% Select smaller font size with the current style. Used to change font size +% in, e.g., the LaTeX logo and acronyms. If we are using bold fonts for +% normal roman text, also use bold fonts for roman text in the smaller size. +\def\switchtolllsize{% + \expandafter\assignfonts\expandafter{\lllsize}% + \ifrmisbold + \let\rmfont\bffont + \fi + \csname\curfontstyle\endcsname +}% + +\def\switchtolsize{% + \expandafter\assignfonts\expandafter{\lsize}% + \ifrmisbold + \let\rmfont\bffont + \fi + \csname\curfontstyle\endcsname +}% + +\def\definefontsetatsize#1#2#3#4#5{% +\expandafter\def\csname #1fonts\endcsname{% + \def\curfontsize{#1}% + \def\lsize{#2}\def\lllsize{#3}% + \csname rmisbold#5\endcsname + \assignfonts{#1}% + \resetmathfonts + \setleading{#4}% +}} + +\definefontsetatsize{text} {reduced}{smaller}{\textleading}{false} +\definefontsetatsize{title} {chap} {subsec} {27pt} {true} +\definefontsetatsize{chap} {sec} {text} {19pt} {true} +\definefontsetatsize{sec} {subsec} {reduced}{17pt} {true} +\definefontsetatsize{ssec} {text} {small} {15pt} {true} +\definefontsetatsize{reduced}{small} {smaller}{10.5pt}{false} +\definefontsetatsize{small} {smaller}{smaller}{10.5pt}{false} +\definefontsetatsize{smaller}{smaller}{smaller}{9.5pt} {false} + +\def\titlefont#1{{\titlefonts\rm #1}} +\let\subsecfonts = \ssecfonts +\let\subsubsecfonts = \ssecfonts % Define these just so they can be easily changed for other fonts. \def\angleleft{$\langle$} @@ -2423,8 +2828,8 @@ % \catcode`@=11 \def\plainfrenchspacing{% - \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m - \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m + \sfcode`\.=\@m \sfcode`\?=\@m \sfcode`\!=\@m + \sfcode`\:=\@m \sfcode`\;=\@m \sfcode`\,=\@m \def\endofsentencespacefactor{1000}% for @. and friends } \def\plainnonfrenchspacing{% @@ -2592,6 +2997,7 @@ \setbox0 = \hbox{\ignorespaces #2}% look for second arg \ifdim\wd0 > 0pt \ifpdf + % For pdfTeX and LuaTeX \ifurefurlonlylink % PDF plus option to not display url, show just arg \unhbox0 @@ -2601,7 +3007,19 @@ \unhbox0\ (\urefcode{#1})% \fi \else - \unhbox0\ (\urefcode{#1})% DVI, always show arg and url + \ifx\XeTeXrevision\thisisundefined + \unhbox0\ (\urefcode{#1})% DVI, always show arg and url + \else + % For XeTeX + \ifurefurlonlylink + % PDF plus option to not display url, show just arg + \unhbox0 + \else + % PDF, normally display both arg and url for consistency, + % visibility, if the pdf is eventually used to print, etc. + \unhbox0\ (\urefcode{#1})% + \fi + \fi \fi \else \urefcode{#1}% only url given, so show it @@ -2612,9 +3030,9 @@ % Allow line breaks around only a few characters (only). \def\urefcatcodes{% - \catcode\ampChar=\active \catcode\dotChar=\active - \catcode\hashChar=\active \catcode\questChar=\active - \catcode\slashChar=\active + \catcode`\&=\active \catcode`\.=\active + \catcode`\#=\active \catcode`\?=\active + \catcode`\/=\active } { \urefcatcodes @@ -2702,7 +3120,18 @@ \endlink \endgroup} \else - \let\email=\uref + \ifx\XeTeXrevision\thisisundefined + \let\email=\uref + \else + \def\email#1{\doemail#1,,\finish} + \def\doemail#1,#2,#3\finish{\begingroup + \unsepspaces + \pdfurl{mailto:#1}% + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi + \endlink + \endgroup} + \fi \fi % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), @@ -2771,18 +3200,13 @@ % \def\dmn#1{\thinspace #1} -% @l was never documented to mean ``switch to the Lisp font'', -% and it is not used as such in any manual I can find. We need it for -% Polish suppressed-l. --karl, 22sep96. -%\def\l#1{{\li #1}\null} - % @acronym for "FBI", "NATO", and the like. % We print this one point size smaller, since it's intended for % all-uppercase. % \def\acronym#1{\doacronym #1,,\finish} \def\doacronym#1,#2,#3\finish{% - {\selectfonts\lsize #1}% + {\switchtolsize #1}% \def\temp{#2}% \ifx\temp\empty \else \space ({\unsepspaces \ignorespaces \temp \unskip})% @@ -2828,23 +3252,24 @@ \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} % \def\math{% - \tex - \mathunderscore - \let\\ = \mathbackslash - \mathactive - % make the texinfo accent commands work in math mode - \let\"=\ddot - \let\'=\acute - \let\==\bar - \let\^=\hat - \let\`=\grave - \let\u=\breve - \let\v=\check - \let\~=\tilde - \let\dotaccent=\dot - % have to provide another name for sup operator - \let\mathopsup=\sup - $\finishmath + \ifmmode\else % only go into math if not in math mode already + \tex + \mathunderscore + \let\\ = \mathbackslash + \mathactive + % make the texinfo accent commands work in math mode + \let\"=\ddot + \let\'=\acute + \let\==\bar + \let\^=\hat + \let\`=\grave + \let\u=\breve + \let\v=\check + \let\~=\tilde + \let\dotaccent=\dot + % have to provide another name for sup operator + \let\mathopsup=\sup + $\expandafter\finishmath\fi } \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. @@ -2874,13 +3299,10 @@ % fix it (significant additions to font machinery) until someone notices. % \def\sub{\ifmmode \expandafter\sb \else \expandafter\finishsub\fi} -\def\finishsub#1{$\sb{\hbox{\selectfonts\lllsize #1}}$}% +\def\finishsub#1{$\sb{\hbox{\switchtolllsize #1}}$}% % \def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi} -\def\finishsup#1{$\ptexsp{\hbox{\selectfonts\lllsize #1}}$}% - -% ctrl is no longer a Texinfo command, but leave this definition for fun. -\def\ctrl #1{{\tt \rawbackslash \hat}#1} +\def\finishsup#1{$\ptexsp{\hbox{\switchtolllsize #1}}$}% % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}. % Ignore unless FMTNAME == tex; then it is like @iftex and @tex, @@ -2944,23 +3366,10 @@ \let\atchar=\@ % @{ @} @lbracechar{} @rbracechar{} all generate brace characters. -% Unless we're in typewriter, use \ecfont because the CM text fonts do -% not have braces, and we don't want to switch into math. -\def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}} -\def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}} -\let\{=\mylbrace \let\lbracechar=\{ -\let\}=\myrbrace \let\rbracechar=\} -\begingroup - % Definitions to produce \{ and \} commands for indices, - % and @{ and @} for the aux/toc files. - \catcode`\{ = \other \catcode`\} = \other - \catcode`\[ = 1 \catcode`\] = 2 - \catcode`\! = 0 \catcode`\\ = \other - !gdef!lbracecmd[\{]% - !gdef!rbracecmd[\}]% - !gdef!lbraceatcmd[@{]% - !gdef!rbraceatcmd[@}]% -!endgroup +\def\lbracechar{{\ifmonospace\char123\else\ensuremath\lbrace\fi}} +\def\rbracechar{{\ifmonospace\char125\else\ensuremath\rbrace\fi}} +\let\{=\lbracechar +\let\}=\rbracechar % @comma{} to avoid , parsing problems. \let\comma = , @@ -2978,8 +3387,8 @@ % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. \def\questiondown{?`} \def\exclamdown{!`} -\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}} -\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}} +\def\ordf{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{a}}} +\def\ordm{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{o}}} % Dotless i and dotless j, used for accents. \def\imacro{i} @@ -3008,12 +3417,12 @@ {\setbox0=\hbox{T}% \vbox to \ht0{\hbox{% \ifx\textnominalsize\xwordpt - % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX. + % for 10pt running text, lllsize (8pt) is too small for the A in LaTeX. % Revert to plain's \scriptsize, which is 7pt. \count255=\the\fam $\fam\count255 \scriptstyle A$% \else % For 11pt, we can use our lllsize. - \selectfonts\lllsize A% + \switchtolllsize A% \fi }% \vss @@ -3079,7 +3488,7 @@ % \newbox\errorbox % -{\tentt \global\dimen0 = 3em}% Width of the box. +{\ttfont \global\dimen0 = 3em}% Width of the box. \dimen2 = .55pt % Thickness of rules % The text. (`r' is open on the right, `e' somewhat less so on the left.) \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt} @@ -3195,8 +3604,15 @@ \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E} \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e} % -% Use the ec* fonts (cm-super in outline format) for non-CM glyphs. -\def\ecfont{% +% Use the European Computer Modern fonts (cm-super in outline format) +% for non-CM glyphs. That is ec* for regular text and tc* for the text +% companion symbols (LaTeX TS1 encoding). Both are part of the ec +% package and follow the same conventions. +% +\def\ecfont{\etcfont{e}} +\def\tcfont{\etcfont{t}} +% +\def\etcfont#1{% % We can't distinguish serif/sans and italic/slanted, but this % is used for crude hacks anyway (like adding French and German % quotes to documents typeset with CM, where we lose kerning), so @@ -3205,14 +3621,14 @@ \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}% \ifmonospace % typewriter: - \font\thisecfont = ectt\ecsize \space at \nominalsize + \font\thisecfont = #1ctt\ecsize \space at \nominalsize \else \ifx\curfontstyle\bfstylename % bold: - \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize + \font\thisecfont = #1cb\ifusingit{i}{x}\ecsize \space at \nominalsize \else % regular: - \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize + \font\thisecfont = #1c\ifusingit{ti}{rm}\ecsize \space at \nominalsize \fi \fi \thisecfont @@ -3223,7 +3639,7 @@ % Adapted from the plain.tex definition of \copyright. % \def\registeredsymbol{% - $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}% + $^{{\ooalign{\hfil\raise.07ex\hbox{\switchtolllsize R}% \hfil\crcr\Orb}}% }$% } @@ -3256,13 +3672,16 @@ \newif\ifseenauthor \newif\iffinishedtitlepage -% Do an implicit @contents or @shortcontents after @end titlepage if the -% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage. -% -\newif\ifsetcontentsaftertitlepage - \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue -\newif\ifsetshortcontentsaftertitlepage - \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue +% @setcontentsaftertitlepage used to do an implicit @contents or +% @shortcontents after @end titlepage, but it is now obsolete. +\def\setcontentsaftertitlepage{% + \errmessage{@setcontentsaftertitlepage has been removed as a Texinfo + command; move your @contents command if you want the contents + after the title page.}}% +\def\setshortcontentsaftertitlepage{% + \errmessage{@setshortcontentsaftertitlepage has been removed as a Texinfo + command; move your @shortcontents and @contents commands if you + want the contents after the title page.}}% \parseargdef\shorttitlepage{% \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}% @@ -3304,20 +3723,6 @@ % Need this before the \...aftertitlepage checks so that if they are % in effect the toc pages will come out with page numbers. \HEADINGSon - % - % If they want short, they certainly want long too. - \ifsetshortcontentsaftertitlepage - \shortcontents - \contents - \global\let\shortcontents = \relax - \global\let\contents = \relax - \fi - % - \ifsetcontentsaftertitlepage - \contents - \global\let\contents = \relax - \global\let\shortcontents = \relax - \fi } \def\finishtitlepage{% @@ -3328,12 +3733,11 @@ % Settings used for typesetting titles: no hyphenation, no indentation, % don't worry much about spacing, ragged right. This should be used -% inside a \vbox, and fonts need to be set appropriately first. Because -% it is always used for titles, nothing else, we call \rmisbold. \par -% should be specified before the end of the \vbox, since a vbox is a group. +% inside a \vbox, and fonts need to be set appropriately first. \par should +% be specified before the end of the \vbox, since a vbox is a group. % \def\raggedtitlesettings{% - \rmisbold + \rm \hyphenpenalty=10000 \parindent=0pt \tolerance=5000 @@ -3342,7 +3746,7 @@ % Macros to be used within @titlepage: -\let\subtitlerm=\tenrm +\let\subtitlerm=\rmfont \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} \parseargdef\title{% @@ -3368,7 +3772,7 @@ \else \checkenv\titlepage \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi - {\secfonts\rmisbold \leftline{#1}}% + {\secfonts\rm \leftline{#1}}% \fi } @@ -3382,7 +3786,7 @@ \newtoks\evenfootline % footline on even pages \newtoks\oddfootline % footline on odd pages -% Now make TeX use those variables +% Now make \makeheadline and \makefootline in Plain TeX use those variables \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline \else \the\evenheadline \fi}} \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline @@ -3421,7 +3825,7 @@ % % Leave some space for the footline. Hopefully ok to assume % @evenfooting will not be used by itself. - \global\advance\pageheight by -12pt + \global\advance\txipageheight by -12pt \global\advance\vsize by -12pt } @@ -3438,13 +3842,17 @@ % @everyheadingmarks % @everyfootingmarks +% These define \getoddheadingmarks, \getevenheadingmarks, +% \getoddfootingmarks, and \getevenfootingmarks, each to one of +% \gettopheadingmarks, \getbottomheadingmarks. +% \def\evenheadingmarks{\headingmarks{even}{heading}} \def\oddheadingmarks{\headingmarks{odd}{heading}} \def\evenfootingmarks{\headingmarks{even}{footing}} \def\oddfootingmarks{\headingmarks{odd}{footing}} -\def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1} +\parseargdef\everyheadingmarks{\headingmarks{even}{heading}{#1} \headingmarks{odd}{heading}{#1} } -\def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1} +\parseargdef\everyfootingmarks{\headingmarks{even}{footing}{#1} \headingmarks{odd}{footing}{#1} } % #1 = even/odd, #2 = heading/footing, #3 = top/bottom. \def\headingmarks#1#2#3 {% @@ -3465,7 +3873,7 @@ % By default, they are off at the start of a document, % and turned `on' after @end titlepage. -\def\headings #1 {\csname HEADINGS#1\endcsname} +\parseargdef\headings{\csname HEADINGS#1\endcsname} \def\headingsoff{% non-global headings elimination \evenheadline={\hfil}\evenfootline={\hfil}% @@ -3485,7 +3893,7 @@ \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} -\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapterheading\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \let\contentsalignmacro = \chappager @@ -3496,8 +3904,8 @@ \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} -\global\evenheadline={\line{\thischapter\hfil\folio}} -\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\evenheadline={\line{\thischapterheading\hfil\folio}} +\global\oddheadline={\line{\thischapterheading\hfil\folio}} \global\let\contentsalignmacro = \chappager } \def\HEADINGSon{\HEADINGSdouble} @@ -3508,7 +3916,7 @@ \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} -\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapterheading\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } @@ -3516,8 +3924,8 @@ \def\HEADINGSsinglex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} -\global\evenheadline={\line{\thischapter\hfil\folio}} -\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\evenheadline={\line{\thischapterheading\hfil\folio}} +\global\oddheadline={\line{\thischapterheading\hfil\folio}} \global\let\contentsalignmacro = \chappager } @@ -3727,7 +4135,12 @@ \noindent \hbox to 0pt{\hss \itemcontents \kern\itemmargin}% % - \vadjust{\penalty 1200}}% not good to break after first line of item. + \ifinner\else + \vadjust{\penalty 1200}% not good to break after first line of item. + \fi + % We can be in inner vertical mode in a footnote, although an + % @itemize looks awful there. + }% \flushcr } @@ -4274,6 +4687,31 @@ \fi } +% Like \expandablevalue, but completely expandable (the \message in the +% definition above operates at the execution level of TeX). Used when +% writing to auxiliary files, due to the expansion that \write does. +% If flag is undefined, pass through an unexpanded @value command: maybe it +% will be set by the time it is read back in. +% +% NB flag names containing - or _ may not work here. +\def\dummyvalue#1{% + \expandafter\ifx\csname SET#1\endcsname\relax + \noexpand\value{#1}% + \else + \csname SET#1\endcsname + \fi +} + +% Used for @value's in index entries to form the sort key: expand the @value +% if possible, otherwise sort late. +\def\indexnofontsvalue#1{% + \expandafter\ifx\csname SET#1\endcsname\relax + ZZZZZZZ + \else + \csname SET#1\endcsname + \fi +} + % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined % with @set. % @@ -4349,19 +4787,16 @@ % except not \outer, so it can be used within macros and \if's. \edef\newwrite{\makecsname{ptexnewwrite}} -% \newindex {foo} defines an index named foo. -% It automatically defines \fooindex such that -% \fooindex ...rest of line... puts an entry in the index foo. -% It also defines \fooindfile to be the number of the output channel for -% the file that accumulates this index. The file's extension is foo. +% \newindex {foo} defines an index named IX. +% It automatically defines \IXindex such that +% \IXindex ...rest of line... puts an entry in the index IX. +% It also defines \IXindfile to be the number of the output channel for +% the file that accumulates this index. The file's extension is IX. % The name of an index should be no more than 2 characters long % for the sake of vms. % \def\newindex#1{% - \iflinks - \expandafter\newwrite \csname#1indfile\endcsname - \openout \csname#1indfile\endcsname \jobname.#1 % Open the file - \fi + \expandafter\chardef\csname#1indfile\endcsname=0 \expandafter\xdef\csname#1index\endcsname{% % Define @#1index \noexpand\doindex{#1}} } @@ -4375,14 +4810,19 @@ \def\defcodeindex{\parsearg\newcodeindex} % \def\newcodeindex#1{% - \iflinks - \expandafter\newwrite \csname#1indfile\endcsname - \openout \csname#1indfile\endcsname \jobname.#1 - \fi + \expandafter\chardef\csname#1indfile\endcsname=0 \expandafter\xdef\csname#1index\endcsname{% \noexpand\docodeindex{#1}}% } +% The default indices: +\newindex{cp}% concepts, +\newcodeindex{fn}% functions, +\newcodeindex{vr}% variables, +\newcodeindex{tp}% types, +\newcodeindex{ky}% keys +\newcodeindex{pg}% and programs. + % @synindex foo bar makes index foo feed into index bar. % Do this instead of @defindex foo if you don't want it as a separate index. @@ -4396,14 +4836,7 @@ % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo), % #3 the target index (bar). \def\dosynindex#1#2#3{% - % Only do \closeout if we haven't already done it, else we'll end up - % closing the target index. - \expandafter \ifx\csname donesynindex#2\endcsname \relax - % The \closeout helps reduce unnecessary open files; the limit on the - % Acorn RISC OS is a mere 16 files. - \expandafter\closeout\csname#2indfile\endcsname - \expandafter\let\csname donesynindex#2\endcsname = 1 - \fi + \requireopenindexfile{#3}% % redefine \fooindfile: \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname \expandafter\let\csname#2indfile\endcsname=\temp @@ -4411,106 +4844,72 @@ \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% } -% Define \doindex, the driver for all \fooindex macros. +% Define \doindex, the driver for all index macros. % Argument #1 is generated by the calling \fooindex macro, -% and it is "foo", the name of the index. - -% \doindex just uses \parsearg; it calls \doind for the actual work. -% This is because \doind is more useful to call from other macros. - -% There is also \dosubind {index}{topic}{subtopic} -% which makes an entry in a two-level index such as the operation index. +% and it is the two-letter name of the index. -\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} -\def\singleindexer #1{\doind{\indexname}{#1}} +\def\doindex#1{\edef\indexname{#1}\parsearg\doindexxxx} +\def\doindexxxx #1{\doind{\indexname}{#1}} % like the previous two, but they put @code around the argument. -\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} -\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} +\def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx} +\def\docodeindexxxx #1{\doind{\indexname}{\code{#1}}} -% Take care of Texinfo commands that can appear in an index entry. -% Since there are some commands we want to expand, and others we don't, -% we have to laboriously prevent expansion for those that we don't. + +% Used when writing an index entry out to an index file to prevent +% expansion of Texinfo commands that can appear in an index entry. % \def\indexdummies{% \escapechar = `\\ % use backslash in output files. - \def\@{@}% change to @@ when we switch to @ as escape char in index files. - \def\ {\realbackslash\space }% - % - % Need these unexpandable (because we define \tt as a dummy) - % definitions when @{ or @} appear in index entry text. Also, more - % complicated, when \tex is in effect and \{ is a \delimiter again. - % We can't use \lbracecmd and \rbracecmd because texindex assumes - % braces and backslashes are used only as delimiters. Perhaps we - % should use @lbracechar and @rbracechar? - \def\{{{\tt\char123}}% - \def\}{{\tt\char125}}% - % - % I don't entirely understand this, but when an index entry is - % generated from a macro call, the \endinput which \scanmacro inserts - % causes processing to be prematurely terminated. This is, - % apparently, because \indexsorttmp is fully expanded, and \endinput - % is an expandable command. The redefinition below makes \endinput - % disappear altogether for that purpose -- although logging shows that - % processing continues to some further point. On the other hand, it - % seems \endinput does not hurt in the printed index arg, since that - % is still getting written without apparent harm. - % - % Sample source (mac-idx3.tex, reported by Graham Percival to - % help-texinfo, 22may06): - % @macro funindex {WORD} - % @findex xyz - % @end macro - % ... - % @funindex commtest - % This is not enough to reproduce the bug, but it gives the flavor. + \definedummyletter\@% + \definedummyletter\ % % - % Sample whatsit resulting: - % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}} - % - % So: - \let\endinput = \empty + % For texindex which always views { and } as separators. + \def\{{\lbracechar{}}% + \def\}{\rbracechar{}}% % % Do the redefinitions. - \commondummies + \definedummies } -% For the aux and toc files, @ is the escape character. So we want to -% redefine everything using @ as the escape character (instead of -% \realbackslash, still used for index files). When everything uses @, -% this will be simpler. +% Used for the aux and toc files, where @ is the escape character. % \def\atdummies{% - \def\@{@@}% - \def\ {@ }% - \let\{ = \lbraceatcmd - \let\} = \rbraceatcmd + \definedummyletter\@% + \definedummyletter\ % + \definedummyletter\{% + \definedummyletter\}% % % Do the redefinitions. - \commondummies + \definedummies \otherbackslash } -% Called from \indexdummies and \atdummies. -% -\def\commondummies{% - % \definedummyword defines \#1 as \string\#1\space, thus effectively - % preventing its expansion. This is used only for control words, - % not control letters, because the \space would be incorrect for - % control characters, but is needed to separate the control word - % from whatever follows. - % - % For control letters, we have \definedummyletter, which omits the - % space. - % - % These can be used both for control words that take an argument and - % those that do not. If it is followed by {arg} in the input, then - % that will dutifully get written to the index (or wherever). - % - \def\definedummyword ##1{\def##1{\string##1\space}}% - \def\definedummyletter##1{\def##1{\string##1}}% - \let\definedummyaccent\definedummyletter - % +% \definedummyword defines \#1 as \string\#1\space, thus effectively +% preventing its expansion. This is used only for control words, +% not control letters, because the \space would be incorrect for +% control characters, but is needed to separate the control word +% from whatever follows. +% +% These can be used both for control words that take an argument and +% those that do not. If it is followed by {arg} in the input, then +% that will dutifully get written to the index (or wherever). +% +% For control letters, we have \definedummyletter, which omits the +% space. +% +\def\definedummyword #1{\def#1{\string#1\space}}% +\def\definedummyletter#1{\def#1{\string#1}}% +\let\definedummyaccent\definedummyletter + +% Called from \indexdummies and \atdummies, to effectively prevent +% the expansion of commands. +% +\def\definedummies{% + % + \let\commondummyword\definedummyword + \let\commondummyletter\definedummyletter + \let\commondummyaccent\definedummyaccent \commondummiesnofonts % \definedummyletter\_% @@ -4551,6 +4950,7 @@ \definedummyword\TeX % % Assorted special characters. + \definedummyword\atchar \definedummyword\arrow \definedummyword\bullet \definedummyword\comma @@ -4590,98 +4990,130 @@ % % We want to disable all macros so that they are not expanded by \write. \macrolist + \let\value\dummyvalue % \normalturnoffactive - % - % Handle some cases of @value -- where it does not contain any - % (non-fully-expandable) commands. - \makevalueexpandable } -% \commondummiesnofonts: common to \commondummies and \indexnofonts. +% \commondummiesnofonts: common to \definedummies and \indexnofonts. +% Define \commondummyletter, \commondummyaccent and \commondummyword before +% using. Used for accents, font commands, and various control letters. % \def\commondummiesnofonts{% % Control letters and accents. - \definedummyletter\!% - \definedummyaccent\"% - \definedummyaccent\'% - \definedummyletter\*% - \definedummyaccent\,% - \definedummyletter\.% - \definedummyletter\/% - \definedummyletter\:% - \definedummyaccent\=% - \definedummyletter\?% - \definedummyaccent\^% - \definedummyaccent\`% - \definedummyaccent\~% - \definedummyword\u - \definedummyword\v - \definedummyword\H - \definedummyword\dotaccent - \definedummyword\ogonek - \definedummyword\ringaccent - \definedummyword\tieaccent - \definedummyword\ubaraccent - \definedummyword\udotaccent - \definedummyword\dotless + \commondummyletter\!% + \commondummyaccent\"% + \commondummyaccent\'% + \commondummyletter\*% + \commondummyaccent\,% + \commondummyletter\.% + \commondummyletter\/% + \commondummyletter\:% + \commondummyaccent\=% + \commondummyletter\?% + \commondummyaccent\^% + \commondummyaccent\`% + \commondummyaccent\~% + \commondummyword\u + \commondummyword\v + \commondummyword\H + \commondummyword\dotaccent + \commondummyword\ogonek + \commondummyword\ringaccent + \commondummyword\tieaccent + \commondummyword\ubaraccent + \commondummyword\udotaccent + \commondummyword\dotless % % Texinfo font commands. - \definedummyword\b - \definedummyword\i - \definedummyword\r - \definedummyword\sansserif - \definedummyword\sc - \definedummyword\slanted - \definedummyword\t + \commondummyword\b + \commondummyword\i + \commondummyword\r + \commondummyword\sansserif + \commondummyword\sc + \commondummyword\slanted + \commondummyword\t % % Commands that take arguments. - \definedummyword\abbr - \definedummyword\acronym - \definedummyword\anchor - \definedummyword\cite - \definedummyword\code - \definedummyword\command - \definedummyword\dfn - \definedummyword\dmn - \definedummyword\email - \definedummyword\emph - \definedummyword\env - \definedummyword\file - \definedummyword\image - \definedummyword\indicateurl - \definedummyword\inforef - \definedummyword\kbd - \definedummyword\key - \definedummyword\math - \definedummyword\option - \definedummyword\pxref - \definedummyword\ref - \definedummyword\samp - \definedummyword\strong - \definedummyword\tie - \definedummyword\U - \definedummyword\uref - \definedummyword\url - \definedummyword\var - \definedummyword\verb - \definedummyword\w - \definedummyword\xref - % - % Consider: - % @macro mkind{arg1,arg2} - % @cindex \arg2\ - % @end macro - % @mkind{foo, bar} - % The space after the comma will end up in the temporary definition - % that we make for arg2 (see \parsemargdef ff.). We want all this to be - % expanded for the sake of the index, so we end up just seeing "bar". - \let\xeatspaces = \eatspaces + \commondummyword\abbr + \commondummyword\acronym + \commondummyword\anchor + \commondummyword\cite + \commondummyword\code + \commondummyword\command + \commondummyword\dfn + \commondummyword\dmn + \commondummyword\email + \commondummyword\emph + \commondummyword\env + \commondummyword\file + \commondummyword\image + \commondummyword\indicateurl + \commondummyword\inforef + \commondummyword\kbd + \commondummyword\key + \commondummyword\math + \commondummyword\option + \commondummyword\pxref + \commondummyword\ref + \commondummyword\samp + \commondummyword\strong + \commondummyword\tie + \commondummyword\U + \commondummyword\uref + \commondummyword\url + \commondummyword\var + \commondummyword\verb + \commondummyword\w + \commondummyword\xref } % For testing: output @{ and @} in index sort strings as \{ and \}. \newif\ifusebracesinindexes +\let\indexlbrace\relax +\let\indexrbrace\relax + +{\catcode`\@=0 +\catcode`\\=13 + @gdef@backslashdisappear{@def\{}} +} + +{ +\catcode`\<=13 +\catcode`\-=13 +\catcode`\`=13 + \gdef\indexnonalnumdisappear{% + \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax\else + % @set txiindexlquoteignore makes us ignore left quotes in the sort term. + % (Introduced for FSFS 2nd ed.) + \let`=\empty + \fi + % + \expandafter\ifx\csname SETtxiindexbackslashignore\endcsname\relax\else + \backslashdisappear + \fi + % + \expandafter\ifx\csname SETtxiindexhyphenignore\endcsname\relax\else + \def-{}% + \fi + \expandafter\ifx\csname SETtxiindexlessthanignore\endcsname\relax\else + \def<{}% + \fi + \expandafter\ifx\csname SETtxiindexatsignignore\endcsname\relax\else + \def\@{}% + \fi + } + + \gdef\indexnonalnumreappear{% + \useindexbackslash + \let-\normaldash + \let<\normalless + \def\@{@}% + } +} + + % \indexnofonts is used when outputting the strings to sort the index % by, and when constructing control sequence names. It eliminates all % control sequences and just writes whatever the best ASCII sort string @@ -4689,12 +5121,11 @@ % \def\indexnofonts{% % Accent commands should become @asis. - \def\definedummyaccent##1{\let##1\asis}% + \def\commondummyaccent##1{\let##1\asis}% % We can just ignore other control letters. - \def\definedummyletter##1{\let##1\empty}% + \def\commondummyletter##1{\let##1\empty}% % All control words become @asis by default; overrides below. - \let\definedummyword\definedummyaccent - % + \let\commondummyword\commondummyaccent \commondummiesnofonts % % Don't no-op \tt, since it isn't a user-level command @@ -4707,19 +5138,10 @@ \def\_{\normalunderscore}% \def\-{}% @- shouldn't affect sorting % - % Unfortunately, texindex is not prepared to handle braces in the - % content at all. So for index sorting, we map @{ and @} to strings - % starting with |, since that ASCII character is between ASCII { and }. - \ifusebracesinindexes - \def\lbracechar{\lbracecmd}% - \def\rbracechar{\rbracecmd}% - \else - \def\lbracechar{|a}% - \def\rbracechar{|b}% - \fi - \let\{=\lbracechar - \let\}=\rbracechar - % + \uccode`\1=`\{ \uppercase{\def\{{1}}% + \uccode`\1=`\} \uppercase{\def\}{1}}% + \let\lbracechar\{% + \let\rbracechar\}% % % Non-English letters. \def\AA{AA}% @@ -4728,7 +5150,7 @@ \def\L{L}% \def\OE{OE}% \def\O{O}% - \def\TH{ZZZ}% + \def\TH{TH}% \def\aa{aa}% \def\ae{ae}% \def\dh{dzz}% @@ -4740,45 +5162,45 @@ \def\o{o}% \def\questiondown{?}% \def\ss{ss}% - \def\th{zzz}% + \def\th{th}% % \def\LaTeX{LaTeX}% \def\TeX{TeX}% % - % Assorted special characters. - % (The following {} will end up in the sort string, but that's ok.) - \def\arrow{->}% - \def\bullet{bullet}% - \def\comma{,}% - \def\copyright{copyright}% - \def\dots{...}% - \def\enddots{...}% - \def\equiv{==}% - \def\error{error}% - \def\euro{euro}% - \def\expansion{==>}% - \def\geq{>=}% - \def\guillemetleft{<<}% - \def\guillemetright{>>}% - \def\guilsinglleft{<}% - \def\guilsinglright{>}% - \def\leq{<=}% - \def\minus{-}% - \def\point{.}% - \def\pounds{pounds}% - \def\print{-|}% - \def\quotedblbase{"}% - \def\quotedblleft{"}% - \def\quotedblright{"}% - \def\quoteleft{`}% - \def\quoteright{'}% - \def\quotesinglbase{,}% - \def\registeredsymbol{R}% - \def\result{=>}% - \def\textdegree{o}% - % - \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax - \else \indexlquoteignore \fi + % Assorted special characters. \defglyph gives the control sequence a + % definition that removes the {} that follows its use. + \defglyph\atchar{@}% + \defglyph\arrow{->}% + \defglyph\bullet{bullet}% + \defglyph\comma{,}% + \defglyph\copyright{copyright}% + \defglyph\dots{...}% + \defglyph\enddots{...}% + \defglyph\equiv{==}% + \defglyph\error{error}% + \defglyph\euro{euro}% + \defglyph\expansion{==>}% + \defglyph\geq{>=}% + \defglyph\guillemetleft{<<}% + \defglyph\guillemetright{>>}% + \defglyph\guilsinglleft{<}% + \defglyph\guilsinglright{>}% + \defglyph\leq{<=}% + \defglyph\lbracechar{\{}% + \defglyph\minus{-}% + \defglyph\point{.}% + \defglyph\pounds{pounds}% + \defglyph\print{-|}% + \defglyph\quotedblbase{"}% + \defglyph\quotedblleft{"}% + \defglyph\quotedblright{"}% + \defglyph\quoteleft{`}% + \defglyph\quoteright{'}% + \defglyph\quotesinglbase{,}% + \defglyph\rbracechar{\}}% + \defglyph\registeredsymbol{R}% + \defglyph\result{=>}% + \defglyph\textdegree{o}% % % We need to get rid of all macros, leaving only the arguments (if present). % Of course this is not nearly correct, but it is the best we can do for now. @@ -4791,21 +5213,24 @@ % goes to end-of-line is not handled. % \macrolist + \let\value\indexnofontsvalue } +\def\defglyph#1#2{\def#1##1{#2}} % see above + + -% Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us -% ignore left quotes in the sort term. -{\catcode`\`=\active - \gdef\indexlquoteignore{\let`=\empty}} -\let\indexbackslash=0 %overridden during \printindex. \let\SETmarginindex=\relax % put index entries in margin (undocumented)? % Most index entries go through here, but \dosubind is the general case. % #1 is the index name, #2 is the entry text. \def\doind#1#2{\dosubind{#1}{#2}{}} -% Workhorse for all \fooindexes. +% There is also \dosubind {index}{topic}{subtopic} +% which makes an entry in a two-level index such as the operation index. +% TODO: Two-level index? Operation index? + +% Workhorse for all indexes. % #1 is name of index, #2 is stuff to put there, #3 is subentry -- % empty if called from \doind, as we usually are (the main exception % is with most defuns, which call us directly). @@ -4813,6 +5238,7 @@ \def\dosubind#1#2#3{% \iflinks {% + \requireopenindexfile{#1}% % Store the main index entry text (including the third arg). \toks0 = {#2}% % If third arg is present, precede it with a space. @@ -4828,7 +5254,50 @@ \fi } -% Write the entry in \toks0 to the index file: +% Check if an index file has been opened, and if not, open it. +\def\requireopenindexfile#1{% +\ifnum\csname #1indfile\endcsname=0 + \expandafter\newwrite \csname#1indfile\endcsname + \edef\suffix{#1}% + % A .fls suffix would conflict with the file extension for the output + % of -recorder, so use .f1s instead. + \ifx\suffix\indexisfl\def\suffix{f1}\fi + % Open the file + \immediate\openout\csname#1indfile\endcsname \jobname.\suffix + % Using \immediate above here prevents an object entering into the current + % box, which could confound checks such as those in \safewhatsit for + % preceding skips. + \typeout{Writing index file \jobname.\suffix}% +\fi} +\def\indexisfl{fl} + +% Output \ as {\indexbackslash}, because \ is an escape character in +% the index files. +\let\indexbackslash=\relax +{\catcode`\@=0 \catcode`\\=\active + @gdef@useindexbackslash{@def\{{@indexbackslash}}} +} + +% Definition for writing index entry text. +\def\sortas#1{\ignorespaces}% + +% Definition for writing index entry sort key. Should occur at the at +% the beginning of the index entry, like +% @cindex @sortas{september} \september +% The \ignorespaces takes care of following space, but there's no way +% to remove space before it. +{ +\catcode`\-=13 +\gdef\indexwritesortas{% + \begingroup + \indexnonalnumreappear + \indexwritesortasxxx} +\gdef\indexwritesortasxxx#1{% + \xdef\indexsortkey{#1}\endgroup} +} + + +% Write the entry in \toks0 to the index file. % \def\dosubindwrite{% % Put the index entry in the margin if desired. @@ -4838,14 +5307,26 @@ % % Remember, we are within a group. \indexdummies % Must do this here, since \bf, etc expand at this stage - \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now - % so it will be output as is; and it will print as backslash. + \useindexbackslash % \indexbackslash isn't defined now so it will be output + % as is; and it will print as backslash. + % The braces around \indexbrace are recognized by texindex. % - % Process the index entry with all font commands turned off, to - % get the string to sort by. + % Get the string to sort by, by processing the index entry with all + % font commands turned off. {\indexnofonts - \edef\temp{\the\toks0}% need full expansion - \xdef\indexsorttmp{\temp}% + \def\lbracechar{{\indexlbrace}}% + \def\rbracechar{{\indexrbrace}}% + \let\{=\lbracechar + \let\}=\rbracechar + \indexnonalnumdisappear + \xdef\indexsortkey{}% + \let\sortas=\indexwritesortas + \edef\temp{\the\toks0}% + \setbox\dummybox = \hbox{\temp}% Make sure to execute any \sortas + \ifx\indexsortkey\empty + \xdef\indexsortkey{\temp}% + \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi + \fi }% % % Set up the complete index entry, with both the sort key and @@ -4855,10 +5336,11 @@ % sorted result. \edef\temp{% \write\writeto{% - \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}% + \string\entry{\indexsortkey}{\noexpand\folio}{\the\toks0}}% }% \temp } +\newbox\dummybox % used above % Take care of unwanted page breaks/skips around a whatsit: % @@ -4983,52 +5465,107 @@ % \initial {@} % as its first line, TeX doesn't complain about mismatched braces % (because it thinks @} is a control sequence). - \catcode`\@ = 11 - \openin 1 \jobname.#1s + \catcode`\@ = 12 + % See comment in \requireopenindexfile. + \def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi + \openin 1 \jobname.\indexname s \ifeof 1 % \enddoublecolumns gets confused if there is no text in the index, % and it loses the chapter title and the aux file entries for the % index. The easiest way to prevent this problem is to make sure % there is some text. \putwordIndexNonexistent + \typeout{No file \jobname.\indexname s.}% \else + \catcode`\\ = 0 % % If the index file exists but is empty, then \openin leaves \ifeof % false. We have to make TeX try to read something from the file, so % it can discover if there is anything in it. - \read 1 to \temp + \read 1 to \thisline \ifeof 1 \putwordIndexIsEmpty \else % Index files are almost Texinfo source, but we use \ as the escape % character. It would be better to use @, but that's too big a change % to make right now. - \def\indexbackslash{\backslashcurfont}% - \catcode`\\ = 0 - \escapechar = `\\ + \def\indexbackslash{\ttbackslash}% + \let\indexlbrace\{ % Likewise, set these sequences for braces + \let\indexrbrace\} % used in the sort key. \begindoublecolumns - \input \jobname.#1s + \let\entrywidowpenalty=\indexwidowpenalty + % + % Read input from the index file line by line. + \loopdo + \ifeof1 + \let\firsttoken\relax + \else + \read 1 to \nextline + \edef\act{\gdef\noexpand\firsttoken{\getfirsttoken\nextline}}% + \act + \fi + \thisline + % + \ifeof1\else + \let\thisline\nextline + \repeat + %% \enddoublecolumns \fi \fi \closein 1 \endgroup} +\def\getfirsttoken#1{\expandafter\getfirsttokenx#1\endfirsttoken} +\long\def\getfirsttokenx#1#2\endfirsttoken{\noexpand#1} + +\def\loopdo#1\repeat{\def\body{#1}\loopdoxxx} +\def\loopdoxxx{\let\next=\relax\body\let\next=\loopdoxxx\fi\next} + % These macros are used by the sorted index file itself. % Change them to control the appearance of the index. -\def\initial#1{{% - % Some minor font changes for the special characters. - \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt - % +{\catcode`\/=13 \catcode`\-=13 \catcode`\^=13 \catcode`\~=13 \catcode`\_=13 +\catcode`\|=13 \catcode`\<=13 \catcode`\>=13 \catcode`\+=13 \catcode`\"=13 +\catcode`\$=3 +\gdef\initialglyphs{% + % Some changes for non-alphabetic characters. Using the glyphs from the + % math fonts looks more consistent than the typewriter font used elsewhere + % for these characters. + \def\indexbackslash{\math{\backslash}}% + \let\\=\indexbackslash + % + % Can't get bold backslash so don't use bold forward slash + \catcode`\/=13 + \def/{{\secrmnotbold \normalslash}}% + \def-{{\normaldash\normaldash}}% en dash `--' + \def^{{\chapbf \normalcaret}}% + \def~{{\chapbf \normaltilde}}% + \def\_{% + \leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }% + \def|{$\vert$}% + \def<{$\less$}% + \def>{$\gtr$}% + \def+{$\normalplus$}% +}} + +\def\initial{% + \bgroup + \initialglyphs + \initialx +} + +\def\initialx#1{% % Remove any glue we may have, we'll be inserting our own. \removelastskip % % We like breaks before the index initials, so insert a bonus. + % The glue before the bonus allows a little bit of space at the + % bottom of a column to reduce an increase in inter-line spacing. \nobreak - \vskip 0pt plus 3\baselineskip - \penalty 0 - \vskip 0pt plus -3\baselineskip + \vskip 0pt plus 5\baselineskip + \penalty -300 + \vskip 0pt plus -5\baselineskip % % Typeset the initial. Making this add up to a whole number of % baselineskips increases the chance of the dots lining up from column @@ -5036,63 +5573,45 @@ % we need before each entry, but it's better. % % No shrink because it confuses \balancecolumns. - \vskip 1.67\baselineskip plus .5\baselineskip - \leftline{\secbf #1}% + \vskip 1.67\baselineskip plus 1\baselineskip + \leftline{\secfonts \kern-0.05em \secbf #1}% + % \secfonts is inside the argument of \leftline so that the change of + % \baselineskip will not affect any glue inserted before the vbox that + % \leftline creates. % Do our best not to break after the initial. \nobreak \vskip .33\baselineskip plus .1\baselineskip -}} + \egroup % \initialglyphs +} + +\newdimen\entryrightmargin +\entryrightmargin=0pt % \entry typesets a paragraph consisting of the text (#1), dot leaders, and % then page number (#2) flushed to the right margin. It is used for index % and table of contents entries. The paragraph is indented by \leftskip. % -% A straightforward implementation would start like this: -% \def\entry#1#2{... -% But this freezes the catcodes in the argument, and can cause problems to -% @code, which sets - active. This problem was fixed by a kludge--- -% ``-'' was active throughout whole index, but this isn't really right. -% The right solution is to prevent \entry from swallowing the whole text. -% --kasal, 21nov03 \def\entry{% \begingroup % + % For pdfTeX and XeTeX. + % The redefinition of \domark stops marks being added in \pdflink to + % preserve coloured links across page boundaries. Otherwise the marks + % would get in the way of \lastbox in \insertindexentrybox. + \let\domark\relax + % % Start a new paragraph if necessary, so our assignments below can't % affect previous text. \par % - % Do not fill out the last line with white space. - \parfillskip = 0in - % % No extra space above this paragraph. \parskip = 0in % - % Do not prefer a separate line ending with a hyphen to fewer lines. - \finalhyphendemerits = 0 - % - % \hangindent is only relevant when the entry text and page number - % don't both fit on one line. In that case, bob suggests starting the - % dots pretty far over on the line. Unfortunately, a large - % indentation looks wrong when the entry text itself is broken across - % lines. So we use a small indentation and put up with long leaders. - % - % \hangafter is reset to 1 (which is the value we want) at the start - % of each paragraph, so we need not do anything with that. - \hangindent = 2em - % - % When the entry text needs to be broken, just fill out the first line - % with blank space. - \rightskip = 0pt plus1fil - % - % A bit of stretch before each entry for the benefit of balancing - % columns. - \vskip 0pt plus1pt - % % When reading the text of entry, convert explicit line breaks % from @* into spaces. The user might give these in long section % titles, for instance. \def\*{\unskip\space\ignorespaces}% - \def\entrybreak{\hfil\break}% + \def\entrybreak{\hfil\break}% An undocumented command % % Swallow the left brace of the text (first parameter): \afterassignment\doentry @@ -5100,45 +5619,166 @@ } \def\entrybreak{\unskip\space\ignorespaces}% \def\doentry{% + % Save the text of the entry + \global\setbox\boxA=\hbox\bgroup \bgroup % Instead of the swallowed brace. \noindent \aftergroup\finishentry % And now comes the text of the entry. + % Not absorbing as a macro argument reduces the chance of problems + % with catcodes occurring. } -\def\finishentry#1{% +{\catcode`\@=11 +\gdef\finishentry#1{% + \egroup % end box A + \dimen@ = \wd\boxA % Length of text of entry + \global\setbox\boxA=\hbox\bgroup\unhbox\boxA % #1 is the page number. % - % The following is kludged to not output a line of dots in the index if - % there are no page numbers. The next person who breaks this will be - % cursed by a Unix daemon. - \setbox\boxA = \hbox{#1}% - \ifdim\wd\boxA = 0pt - \ % + % Get the width of the page numbers, and only use + % leaders if they are present. + \global\setbox\boxB = \hbox{#1}% + \ifdim\wd\boxB = 0pt + \null\nobreak\hfill\ % \else % - % If we must, put the page number on a line of its own, and fill out - % this line with blank space. (The \hfil is overwhelmed with the - % fill leaders glue in \indexdotfill if the page number does fit.) - \hfil\penalty50 \null\nobreak\indexdotfill % Have leaders before the page number. % - % The `\ ' here is removed by the implicit \unskip that TeX does as - % part of (the primitive) \par. Without it, a spurious underfull - % \hbox ensues. \ifpdf - \pdfgettoks#1.% - \ \the\toksA + \pdfgettoks#1.% + \hskip\skip\thinshrinkable\the\toksA \else - \ #1% + \ifx\XeTeXrevision\thisisundefined + \hskip\skip\thinshrinkable #1% + \else + \pdfgettoks#1.% + \hskip\skip\thinshrinkable\the\toksA + \fi \fi \fi - \par + \egroup % end \boxA + \ifdim\wd\boxB = 0pt + \global\setbox\entryindexbox=\vbox{\unhbox\boxA}% + \else + \global\setbox\entryindexbox=\vbox\bgroup + % We want the text of the entries to be aligned to the left, and the + % page numbers to be aligned to the right. + % + \parindent = 0pt + \advance\leftskip by 0pt plus 1fil + \advance\leftskip by 0pt plus -1fill + \rightskip = 0pt plus -1fil + \advance\rightskip by 0pt plus 1fill + % Cause last line, which could consist of page numbers on their own + % if the list of page numbers is long, to be aligned to the right. + \parfillskip=0pt plus -1fill + % + \advance\rightskip by \entryrightmargin + % Determine how far we can stretch into the margin. + % This allows, e.g., "Appendix H GNU Free Documentation License" to + % fit on one line in @letterpaper format. + \ifdim\entryrightmargin>2.1em + \dimen@i=2.1em + \else + \dimen@i=0em + \fi + \advance \parfillskip by 0pt minus 1\dimen@i + % + \dimen@ii = \hsize + \advance\dimen@ii by -1\leftskip + \advance\dimen@ii by -1\entryrightmargin + \advance\dimen@ii by 1\dimen@i + \ifdim\wd\boxA > \dimen@ii % If the entry doesn't fit in one line + \ifdim\dimen@ > 0.8\dimen@ii % due to long index text + \dimen@ = 0.7\dimen@ % Try to split the text roughly evenly + \dimen@ii = \hsize + \ifnum\dimen@>\dimen@ii + % If the entry is too long, use the whole line + \dimen@ = \dimen@ii + \fi + \advance\leftskip by 0pt plus 1fill % ragged right + \advance \dimen@ by 1\rightskip + \parshape = 2 0pt \dimen@ 0em \dimen@ii + % Ideally we'd add a finite glue at the end of the first line only, + % instead of using \parshape with explicit line lengths, but TeX + % doesn't seem to provide a way to do such a thing. + % + \leftskip = 1em + \parindent = -1em + \fi\fi + \indent % start paragraph + \unhbox\boxA + % + % Do not prefer a separate line ending with a hyphen to fewer lines. + \finalhyphendemerits = 0 + % + % Word spacing - no stretch + \spaceskip=\fontdimen2\font minus \fontdimen4\font + % + \linepenalty=1000 % Discourage line breaks. + \hyphenpenalty=5000 % Discourage hyphenation. + % + \par % format the paragraph + \egroup % The \vbox + \fi \endgroup + % delay text of entry until after penalty + \bgroup\aftergroup\insertindexentrybox + \entrywidowpenalty +}} + +\newskip\thinshrinkable +\skip\thinshrinkable=.15em minus .15em + +\newbox\entryindexbox +\def\insertindexentrybox{% + \ourunvbox\entryindexbox +} + +% Use \lastbox to take apart vbox box by box, and add each sub-box +% to the current vertical list. +\def\ourunvbox#1{% +\bgroup % for local binding of \delayedbox + % Remove the last box from box #1 + \global\setbox#1=\vbox{% + \unvbox#1% + \unskip % remove any glue + \unpenalty + \global\setbox\interbox=\lastbox + }% + \setbox\delayedbox=\box\interbox + \ifdim\ht#1=0pt\else + \ourunvbox#1 % Repeat on what's left of the box + \nobreak + \fi + \box\delayedbox +\egroup +} +\newbox\delayedbox +\newbox\interbox + +% Default is no penalty +\let\entrywidowpenalty\egroup + +% Used from \printindex. \firsttoken should be the first token +% after the \entry. If it's not another \entry, we are at the last +% line of a group of index entries, so insert a penalty to discourage +% widowed index entries. +\long\def\indexwidowpenalty{% + \def\isentry{\entry}% + \ifx\firsttoken\isentry + \else + \penalty 9000 + \fi + \egroup % now comes the box added with \aftergroup } % Like plain.tex's \dotfill, except uses up at least 1 em. +% The filll stretch here overpowers both the fil and fill stretch to push +% the page number to the right. \def\indexdotfill{\cleaders - \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill} + \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1filll} + \def\primary #1{\line{#1\hfil}} @@ -5152,7 +5792,11 @@ \ifpdf \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. \else - #2 + \ifx\XeTeXrevision\thisisundefined + #2 + \else + \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. + \fi \fi \par }} @@ -5160,12 +5804,37 @@ % Define two-column mode, which we use to typeset indexes. % Adapted from the TeXbook, page 416, which is to say, % the manmac.tex format used to print the TeXbook itself. -\catcode`\@=11 +\catcode`\@=11 % private names \newbox\partialpage \newdimen\doublecolumnhsize +% Use inside an output routine to save \topmark and \firstmark +\def\savemarks{% + \global\savedtopmark=\expandafter{\topmark }% + \global\savedfirstmark=\expandafter{\firstmark }% +} +\newtoks\savedtopmark +\newtoks\savedfirstmark + +% Set \topmark and \firstmark for next time \output runs. +% Can't be run from withinside \output (because any material +% added while an output routine is active, including +% penalties, is saved for after it finishes). The page so far +% should be empty, otherwise what's on it will be thrown away. +\def\restoremarks{% + \mark{\the\savedtopmark}% + \bgroup\output = {% + \setbox\dummybox=\box\PAGE + }abc\eject\egroup + % "abc" because output routine doesn't fire for a completely empty page. + \mark{\the\savedfirstmark}% +} + \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns + % If not much space left on page, start a new page. + \ifdim\pagetotal>0.8\vsize\vfill\eject\fi + % % Grab any single-column material above us. \output = {% % @@ -5185,8 +5854,15 @@ \unvbox\PAGE \kern-\topskip \kern\baselineskip }% + \savemarks }% \eject % run that output routine to set \partialpage + \restoremarks + % + % We recover the two marks that the last output routine saved in order + % to propagate the information in marks added around a chapter heading, + % which could be otherwise be lost by the time the final page is output. + % % % Use the double-column output routine for subsequent pages. \output = {\doublecolumnout}% @@ -5215,12 +5891,16 @@ % Double the \vsize as well. (We don't need a separate register here, % since nobody clobbers \vsize.) \vsize = 2\vsize + % + % For the benefit of balancing columns + \advance\baselineskip by 0pt plus 0.5pt } % The double-column output routine for all double-column pages except -% the last. +% the last, which is done by \balancecolumns. % \def\doublecolumnout{% + % \splittopskip=\topskip \splitmaxdepth=\maxdepth % Get the available space for the double columns -- the normal % (undoubled) page height minus any material left over from the @@ -5243,10 +5923,11 @@ % \hsize = \doublecolumnhsize \wd0=\hsize \wd2=\hsize - \hbox to\pagewidth{\box0\hfil\box2}% + \hbox to\txipagewidth{\box0\hfil\box2}% } -% -% All done with double columns. + + +% Finished with with double columns. \def\enddoublecolumns{% % The following penalty ensures that the page builder is exercised % _before_ we change the output routine. This is necessary in the @@ -5269,7 +5950,7 @@ % goal. When TeX sees \eject from below which follows the final % section, it invokes the new output routine that we've set after % \balancecolumns below; \onepageout will try to fit the two columns - % and the final section into the vbox of \pageheight (see + % and the final section into the vbox of \txipageheight (see % \pagebody), causing an overfull box. % % Note that glue won't work here, because glue does not exercise the @@ -5277,21 +5958,21 @@ \penalty0 % \output = {% - % Split the last of the double-column material. Leave it on the - % current page, no automatic page break. + % Split the last of the double-column material. + \savemarks \balancecolumns % - % If we end up splitting too much material for the current page, - % though, there will be another page break right after this \output - % invocation ends. Having called \balancecolumns once, we do not + % Having called \balancecolumns once, we do not % want to call it again. Therefore, reset \output to its normal - % definition right away. (We hope \balancecolumns will never be - % called on to balance too much material, but if it is, this makes - % the output somewhat more palatable.) + % definition right away. \global\output = {\onepageout{\pagecontents\PAGE}}% }% \eject \endgroup % started in \begindoublecolumns + \restoremarks + % Leave the double-column material on the current page, no automatic + % page break. + \box\balancedcolumns % % \pagegoal was set to the doubled \vsize above, since we restarted % the current page. We're now back to normal single-column @@ -5299,31 +5980,59 @@ % \endgroup where \vsize got restored). \pagegoal = \vsize } +\newbox\balancedcolumns +\setbox\balancedcolumns=\vbox{shouldnt see this}% % -% Called at the end of the double column material. +% Only called for the last of the double column material. \doublecolumnout +% does the others. \def\balancecolumns{% \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. \dimen@ = \ht0 \advance\dimen@ by \topskip \advance\dimen@ by-\baselineskip - \divide\dimen@ by 2 % target to split to - %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% - \splittopskip = \topskip - % Loop until we get a decent breakpoint. - {% - \vbadness = 10000 - \loop - \global\setbox3 = \copy0 - \global\setbox1 = \vsplit3 to \dimen@ - \ifdim\ht3>\dimen@ - \global\advance\dimen@ by 1pt - \repeat - }% - %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% - \setbox0=\vbox to\dimen@{\unvbox1}% - \setbox2=\vbox to\dimen@{\unvbox3}% + \ifdim\dimen@<5\baselineskip + % Don't split a short final column in two. + \setbox2=\vbox{}% + \else + \divide\dimen@ by 2 % target to split to + \dimen@ii = \dimen@ + \splittopskip = \topskip + % Loop until left column is at least as high as the right column. + {% + \vbadness = 10000 + \loop + \global\setbox3 = \copy0 + \global\setbox1 = \vsplit3 to \dimen@ + \ifdim\ht1<\ht3 + \global\advance\dimen@ by 1pt + \repeat + }% + % Now the left column is in box 1, and the right column in box 3. + % Check whether the left column has come out higher than the page itself. + % (Note that we have doubled \vsize for the double columns, so + % the actual height of the page is 0.5\vsize). + \ifdim2\ht1>\vsize + % Just split the last of the double column material roughly in half. + \setbox2=\box0 + \setbox0 = \vsplit2 to \dimen@ii + \setbox0=\vbox to \dimen@ii {\unvbox0\vfill}% + \setbox2=\vbox to \dimen@ii {\unvbox2\vfill}% + \else + % Compare the heights of the two columns. + \ifdim4\ht1>5\ht3 + % Column heights are too different, so don't make their bottoms + % flush with each other. + \setbox2=\vbox to \ht1 {\unvbox3\vfill}% + \setbox0=\vbox to \ht1 {\unvbox1\vfill}% + \else + % Make column bottoms flush with each other. + \setbox2=\vbox to\ht1{\unvbox3\unskip}% + \setbox0=\vbox to\ht1{\unvbox1\unskip}% + \fi + \fi + \fi % - \pagesofar + \global\setbox\balancedcolumns=\vbox{\pagesofar}% } \catcode`\@ = \other @@ -5338,10 +6047,14 @@ \null \vskip.3\vsize % move it down on the page a bit \begingroup - \noindent \titlefonts\rmisbold #1\par % the text + \noindent \titlefonts\rm #1\par % the text \let\lastnode=\empty % no node to associate with \writetocentry{part}{#1}{}% but put it in the toc \headingsoff % no headline or footline on the part page + % This outputs a mark at the end of the page that clears \thischapter + % and \thissection, as is done in \startcontents. + \let\pchapsepmacro\relax + \chapmacro{}{Yomitfromtoc}{}% \chapoddpage \endgroup } @@ -5586,9 +6299,6 @@ % @centerchap is like @unnumbered, but the heading is centered. \outer\parseargdef\centerchap{% - % Well, we could do the following in a group, but that would break - % an assumption that \chapmacro is called at the outermost level. - % Thus we are safer this way: --kasal, 24feb04 \let\centerparametersmaybe = \centerparameters \unnmhead0{#1}% \let\centerparametersmaybe = \relax @@ -5712,7 +6422,11 @@ % Define plain chapter starts, and page on/off switching for it. \def\chapbreak{\dobreak \chapheadingskip {-4000}} + +% Start a new page \def\chappager{\par\vfill\supereject} + +% \chapoddpage - start on an odd page for a new chapter % Because \domark is called before \chapoddpage, the filler page will % get the headings for the next chapter, which is wrong. But we don't % care -- we just disable all headings on the filler page. @@ -5727,7 +6441,7 @@ \fi } -\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} +\parseargdef\setchapternewpage{\csname CHAPPAG#1\endcsname} \def\CHAPPAGoff{% \global\let\contentsalignmacro = \chappager @@ -5748,7 +6462,7 @@ \CHAPPAGon -% Chapter opening. +% \chapmacro - Chapter opening. % % #1 is the text, #2 is the section type (Ynumbered, Ynothing, % Yappendix, Yomitfromtoc), #3 the chapter number. @@ -5760,7 +6474,13 @@ \def\Yomitfromtockeyword{Yomitfromtoc} % \def\chapmacro#1#2#3{% - \checkenv{}% chapters, etc., should not start inside an environment. + \expandafter\ifx\thisenv\titlepage\else + \checkenv{}% chapters, etc., should not start inside an environment. + \fi + % FIXME: \chapmacro is currently called from inside \titlepage when + % \setcontentsaftertitlepage to print the "Table of Contents" heading, but + % this should probably be done by \sectionheading with an option to print + % in chapter size. % % Insert the first mark before the heading break (see notes for \domark). \let\prevchapterdefs=\lastchapterdefs @@ -5813,7 +6533,7 @@ \domark % {% - \chapfonts \rmisbold + \chapfonts \rm \let\footnote=\errfootnoteheading % give better error message % % Have to define \lastsection before calling \donoderef, because the @@ -5867,30 +6587,6 @@ } -% I don't think this chapter style is supported any more, so I'm not -% updating it with the new noderef stuff. We'll see. --karl, 11aug03. -% -\def\setchapterstyle #1 {\csname CHAPF#1\endcsname} -% -\def\unnchfopen #1{% - \chapoddpage - \vbox{\chapfonts \raggedtitlesettings #1\par}% - \nobreak\bigskip\nobreak -} -\def\chfopen #1#2{\chapoddpage {\chapfonts -\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% -\par\penalty 5000 % -} -\def\centerchfopen #1{% - \chapoddpage - \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}% - \nobreak\bigskip \nobreak -} -\def\CHAPFopen{% - \global\let\chapmacro=\chfopen - \global\let\centerchapmacro=\centerchfopen} - - % Section titles. These macros combine the section number parts and % call the generic \sectionheading to do the printing. % @@ -5929,7 +6625,7 @@ \let\footnote=\errfootnoteheading % % Switch to the right set of fonts. - \csname #2fonts\endcsname \rmisbold + \csname #2fonts\endcsname \rm % % Insert first mark before the heading break (see notes for \domark). \let\prevsectiondefs=\lastsectiondefs @@ -6093,7 +6789,14 @@ % 1 and 2 (the page numbers aren't printed), and so are the first % two pages of the document. Thus, we'd have two destinations named % `1', and two named `2'. - \ifpdf \global\pdfmakepagedesttrue \fi + \ifpdf + \global\pdfmakepagedesttrue + \else + \ifx\XeTeXrevision\thisisundefined + \else + \global\pdfmakepagedesttrue + \fi + \fi } @@ -6142,7 +6845,7 @@ \savepageno = \pageno \begingroup % Set up to handle contents files properly. \raggedbottom % Worry more about breakpoints than the bottom. - \advance\hsize by -\contentsrightmargin % Don't use the full line length. + \entryrightmargin=\contentsrightmargin % Don't use the full line length. % % Roman numerals for page numbers. \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi @@ -6247,7 +6950,7 @@ % Chapters, in the main contents. \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} -% + % Chapters, in the short toc. % See comments in \dochapentry re vbox and related settings. \def\shortchapentry#1#2#3#4{% @@ -6262,7 +6965,7 @@ \setbox0 = \hbox{\putwordAppendix{} M}% \hbox to \wd0{\putwordAppendix{} #1\hss}} % -\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}} +\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\hskip.7em#1}{#4}} % Unnumbered chapters. \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} @@ -6295,6 +6998,8 @@ \def\dochapentry#1#2{% \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip \begingroup + % Move the page numbers slightly to the right + \advance\entryrightmargin by -0.05em \chapentryfonts \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup @@ -6351,7 +7056,6 @@ \catcode `\>=\other \catcode `\`=\other \catcode `\'=\other - \escapechar=`\\ % % ' is active in math mode (mathcode"8000). So reset it, and all our % other math active characters (just in case), to plain's definitions. @@ -6414,6 +7118,24 @@ \endgraf \ifdim\lastskip<\envskipamount \removelastskip + \ifnum\lastpenalty<10000 + % Penalize breaking before the environment, because preceding text + % often leads into it. + \penalty100 + \fi + \vskip\envskipamount + \fi + \fi +}} + +\def\afterenvbreak{{% + % =10000 instead of <10000 because of a special case in \itemzzz and + % \sectionheading, q.v. + \ifnum \lastpenalty=10000 \else + \advance\envskipamount by \parskip + \endgraf + \ifdim\lastskip<\envskipamount + \removelastskip % it's not a good place to break if the last penalty was \nobreak % or better ... \ifnum\lastpenalty<10000 \penalty-50 \fi @@ -6422,8 +7144,6 @@ \fi }} -\let\afterenvbreak = \aboveenvbreak - % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will % also clear it, so that its embedded environments do the narrowing again. \let\nonarrowing=\relax @@ -6467,7 +7187,7 @@ % collide with the section heading. \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi % - \vbox\bgroup + \setbox\groupbox=\vbox\bgroup \baselineskip=0pt\parskip=0pt\lineskip=0pt \carttop \hbox\bgroup @@ -6491,6 +7211,7 @@ \egroup \cartbot \egroup + \addgroupbox \checkinserts } @@ -6873,7 +7594,7 @@ % typesetting commands (@smallbook, font changes, etc.) have to be done % beforehand -- and a) we want @copying to be done first in the source % file; b) letting users define the frontmatter in as flexible order as -% possible is very desirable. +% possible is desirable. % \def\copying{\checkenv{}\begingroup\scanargctxt\docopying} \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}} @@ -6968,7 +7689,7 @@ \temp } -% \domakedefun \deffn \deffnx \deffnheader +% \domakedefun \deffn \deffnx \deffnheader { (defn. of \deffnheader) } % % Define \deffn and \deffnx, without parameters. % \deffnheader has to be defined explicitly. @@ -7177,7 +7898,7 @@ \fi % no return type #3% output function name }% - {\rm\enskip}% hskip 0.5 em of \tenrm + {\rm\enskip}% hskip 0.5 em of \rmfont % \boldbrax % arguments will be output next, if any. @@ -7306,34 +8027,41 @@ } \fi -\def\scanmacro#1{\begingroup +% alias because \c means cedilla in @tex or @math +\let\texinfoc=\c + +\newcount\savedcatcodeone +\newcount\savedcatcodetwo + +% Used at the time of macro expansion. +% Argument is macro body with arguments substituted +\def\scanmacro#1{% \newlinechar`\^^M - \let\xeatspaces\eatspaces + \def\xeatspaces{\eatspaces}% % - % Undo catcode changes of \startcontents and \doprintindex - % When called from @insertcopying or (short)caption, we need active - % backslash to get it printed correctly. Previously, we had - % \catcode`\\=\other instead. We'll see whether a problem appears - % with macro expansion. --kasal, 19aug04 - \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ + % Temporarily undo catcode changes of \printindex. Set catcode of @ to + % 0 so that @-commands in macro expansions aren't printed literally when + % formatting an index file, where \ is used as the escape character. + \savedcatcodeone=\catcode`\@ + \savedcatcodetwo=\catcode`\\ + \catcode`\@=0 + \catcode`\\=\active % - % ... and for \example: - \spaceisspace + % Process the macro body under the current catcode regime. + \scantokens{#1@texinfoc}% % - % The \empty here causes a following catcode 5 newline to be eaten as - % part of reading whitespace after a control sequence. It does not - % eat a catcode 13 newline. There's no good way to handle the two - % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX - % would then have different behavior). See the Macro Details node in - % the manual for the workaround we recommend for macros and - % line-oriented commands. - % - \scantokens{#1\empty}% -\endgroup} + \catcode`\@=\savedcatcodeone + \catcode`\\=\savedcatcodetwo + % + % The \texinfoc is to remove the \newlinechar added by \scantokens, and + % can be noticed by \parsearg. + % We avoid surrounding the call to \scantokens with \bgroup and \egroup + % to allow macros to open or close groups themselves. +} +% Used for copying and captions \def\scanexp#1{% - \edef\temp{\noexpand\scanmacro{#1}}% - \temp + \expandafter\scanmacro\expandafter{#1}% } \newcount\paramno % Count of parameters @@ -7341,7 +8069,7 @@ \newif\ifrecursive % Is it recursive? % List of all defined macros in the form -% \definedummyword\macro1\definedummyword\macro2... +% \commondummyword\macro1\commondummyword\macro2... % Currently is also contains all @aliases; the list can be split % if there is a need. \def\macrolist{} @@ -7349,7 +8077,7 @@ % Add the macro to \macrolist \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname} \def\addtomacrolistxxx#1{% - \toks0 = \expandafter{\macrolist\definedummyword#1}% + \toks0 = \expandafter{\macrolist\commondummyword#1}% \xdef\macrolist{\the\toks0}% } @@ -7399,47 +8127,45 @@ \catcode`\+=\other \catcode`\<=\other \catcode`\>=\other - \catcode`\@=\other \catcode`\^=\other \catcode`\_=\other \catcode`\|=\other \catcode`\~=\other - \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi + \passthroughcharstrue } \def\scanargctxt{% used for copying and captions, not macros. \scanctxt + \catcode`\@=\other \catcode`\\=\other \catcode`\^^M=\other } \def\macrobodyctxt{% used for @macro definitions \scanctxt + \catcode`\ =\other + \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other \catcode`\^^M=\other \usembodybackslash } -\def\macroargctxt{% used when scanning invocations +% Used when scanning braced macro arguments. Note, however, that catcode +% changes here are ineffectual if the macro invocation was nested inside +% an argument to another Texinfo command. +\def\macroargctxt{% \scanctxt - \catcode`\\=0 + \catcode`\ =\active + \catcode`\^^M=\other + \catcode`\\=\active +} + +\def\macrolineargctxt{% used for whole-line arguments without braces + \scanctxt + \catcode`\{=\other + \catcode`\}=\other } -% why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes" -% for the single characters \ { }. Thus, we end up with the "commands" -% that would be written @\ @{ @} in a Texinfo document. -% -% We already have @{ and @}. For @\, we define it here, and only for -% this purpose, to produce a typewriter backslash (so, the @\ that we -% define for @math can't be used with @macro calls): -% -\def\\{\normalbackslash}% -% -% We would like to do this for \, too, since that is what makeinfo does. -% But it is not possible, because Texinfo already has a command @, for a -% cedilla accent. Documents must use @comma{} instead. -% -% \anythingelse will almost certainly be an error of some kind. % \mbodybackslash is the definition of \ in @macro bodies. % It maps \foo\ => \csname macarg.foo\endcsname => #N @@ -7492,7 +8218,7 @@ % Remove the macro name from \macrolist: \begingroup \expandafter\let\csname#1\endcsname \relax - \let\definedummyword\unmacrodo + \let\commondummyword\unmacrodo \xdef\macrolist{\macrolist}% \endgroup \else @@ -7507,60 +8233,40 @@ \ifx #1\relax % remove this \else - \noexpand\definedummyword \noexpand#1% + \noexpand\commondummyword \noexpand#1% \fi } -% This makes use of the obscure feature that if the last token of a -% is #, then the preceding argument is delimited by -% an opening brace, and that opening brace is not consumed. +% \getargs -- Parse the arguments to a @macro line. Set \macname to +% the name of the macro, and \argl to the braced argument list. \def\getargs#1{\getargsxxx#1{}} \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} \def\getmacname#1 #2\relax{\macname={#1}} \def\getmacargs#1{\def\argl{#1}} +% This made use of the feature that if the last token of a +% is #, then the preceding argument is delimited by +% an opening brace, and that opening brace is not consumed. -% For macro processing make @ a letter so that we can make Texinfo private macro names. -\edef\texiatcatcode{\the\catcode`\@} -\catcode `@=11\relax - -% Parse the optional {params} list. Set up \paramno and \paramlist -% so \defmacro knows what to do. Define \macarg.BLAH for each BLAH -% in the params list to some hook where the argument is to be expanded. If -% there are less than 10 arguments that hook is to be replaced by ##N where N +% Parse the optional {params} list to @macro or @rmacro. +% Set \paramno to the number of arguments, +% and \paramlist to a parameter text for the macro (e.g. #1,#2,#3 for a +% three-param macro.) Define \macarg.BLAH for each BLAH in the params +% list to some hook where the argument is to be expanded. If there are +% less than 10 arguments that hook is to be replaced by ##N where N % is the position in that list, that is to say the macro arguments are to be % defined `a la TeX in the macro body. % % That gets used by \mbodybackslash (above). % -% We need to get `macro parameter char #' into several definitions. -% The technique used is stolen from LaTeX: let \hash be something -% unexpandable, insert that wherever you need a #, and then redefine -% it to # just before using the token list produced. -% -% The same technique is used to protect \eatspaces till just before -% the macro is used. -% -% If there are 10 or more arguments, a different technique is used, where the -% hook remains in the body, and when macro is to be expanded the body is -% processed again to replace the arguments. -% -% In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the -% argument N value and then \edef the body (nothing else will expand because of -% the catcode regime underwhich the body was input). +% If there are 10 or more arguments, a different technique is used: see +% \parsemmanyargdef. % -% If you compile with TeX (not eTeX), and you have macros with 10 or more -% arguments, no macro can have more than 256 arguments (else error). \def\parsemargdef#1;{% \paramno=0\def\paramlist{}% \let\hash\relax + % \hash is redefined to `#' later to get it into definitions \let\xeatspaces\relax \parsemargdefxxx#1,;,% - % In case that there are 10 or more arguments we parse again the arguments - % list to set new definitions for the \macarg.BLAH macros corresponding to - % each BLAH argument. It was anyhow needed to parse already once this list - % in order to count the arguments, and as macros with at most 9 arguments - % are by far more frequent than macro with 10 or more arguments, defining - % twice the \macarg.BLAH macros does not cost too much processing power. \ifnum\paramno<10\relax\else \paramno0\relax \parsemmanyargdef@@#1,;,% 10 or more arguments @@ -7575,6 +8281,43 @@ \edef\paramlist{\paramlist\hash\the\paramno,}% \fi\next} +% \parsemacbody, \parsermacbody +% +% Read recursive and nonrecursive macro bodies. (They're different since +% rec and nonrec macros end differently.) +% +% We are in \macrobodyctxt, and the \xdef causes backslashshes in the macro +% body to be transformed. +% Set \macrobody to the body of the macro, and call \defmacro. +% +{\catcode`\ =\other\long\gdef\parsemacbody#1@end macro{% +\xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}% +{\catcode`\ =\other\long\gdef\parsermacbody#1@end rmacro{% +\xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}% + +% Make @ a letter, so that we can make private-to-Texinfo macro names. +\edef\texiatcatcode{\the\catcode`\@} +\catcode `@=11\relax + +%%%%%%%%%%%%%% Code for > 10 arguments only %%%%%%%%%%%%%%%%%% + +% If there are 10 or more arguments, a different technique is used, where the +% hook remains in the body, and when macro is to be expanded the body is +% processed again to replace the arguments. +% +% In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the +% argument N value and then \edef the body (nothing else will expand because of +% the catcode regime under which the body was input). +% +% If you compile with TeX (not eTeX), and you have macros with 10 or more +% arguments, no macro can have more than 256 arguments (else error). +% +% In case that there are 10 or more arguments we parse again the arguments +% list to set new definitions for the \macarg.BLAH macros corresponding to +% each BLAH argument. It was anyhow needed to parse already once this list +% in order to count the arguments, and as macros with at most 9 arguments +% are by far more frequent than macro with 10 or more arguments, defining +% twice the \macarg.BLAH macros does not cost too much processing power. \def\parsemmanyargdef@@#1,{% \if#1;\let\next=\relax \else @@ -7590,16 +8333,6 @@ \advance\paramno by 1\relax \fi\next} -% These two commands read recursive and nonrecursive macro bodies. -% (They're different since rec and nonrec macros end differently.) -% - -\catcode `\@\texiatcatcode -\long\def\parsemacbody#1@end macro% -{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% -\long\def\parsermacbody#1@end rmacro% -{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% -\catcode `\@=11\relax \let\endargs@\relax \let\nil@\relax @@ -7607,7 +8340,7 @@ \long\def\nillm@{\nil@}% % This macro is expanded during the Texinfo macro expansion, not during its -% definition. It gets all the arguments values and assigns them to macros +% definition. It gets all the arguments' values and assigns them to macros % macarg.ARGNAME % % #1 is the macro name @@ -7628,8 +8361,6 @@ \getargvals@@ \fi } - -% \def\getargvals@@{% \ifx\paramlist\nilm@ % Some sanity check needed here that \argvaluelist is also empty. @@ -7673,7 +8404,8 @@ } % Replace arguments by their values in the macro body, and place the result -% in macro \@tempa +% in macro \@tempa. +% \def\macvalstoargs@{% % To do this we use the property that token registers that are \the'ed % within an \edef expand only once. So we are going to place all argument @@ -7697,8 +8429,9 @@ \expandafter\def\expandafter\@tempa\expandafter{\@tempc}% } +% Define the named-macro outside of this group and then close this group. +% \def\macargexpandinbody@{% - %% Define the named-macro outside of this group and then close this group. \expandafter \endgroup \macargdeflist@ @@ -7735,14 +8468,8 @@ \next } -% Save the token stack pointer into macro #1 -\def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}} -% Restore the token stack pointer from number in macro #1 -\def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax} -% newtoks that can be used non \outer . -\def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi} - -% Tailing missing arguments are set to empty +% Trailing missing arguments are set to empty. +% \def\setemptyargvalues@{% \ifx\paramlist\nilm@ \let\next\macargexpandinbody@ @@ -7772,99 +8499,191 @@ \long\def#2{#4}% } -% This defines a Texinfo @macro. There are eight cases: recursive and -% nonrecursive macros of zero, one, up to nine, and many arguments. -% Much magic with \expandafter here. + +%%%%%%%%%%%%%% End of code for > 10 arguments %%%%%%%%%%%%%%%%%% + + +% This defines a Texinfo @macro or @rmacro, called by \parsemacbody. +% \macrobody has the body of the macro in it, with placeholders for +% its parameters, looking like "\xeatspaces{\hash 1}". +% \paramno is the number of parameters +% \paramlist is a TeX parameter text, e.g. "#1,#2,#3," +% There are four cases: macros of zero, one, up to nine, and many arguments. % \xdef is used so that macro definitions will survive the file -% they're defined in; @include reads the file inside a group. +% they're defined in: @include reads the file inside a group. % \def\defmacro{% \let\hash=##% convert placeholders to macro parameter chars - \ifrecursive - \ifcase\paramno - % 0 - \expandafter\xdef\csname\the\macname\endcsname{% - \noexpand\scanmacro{\temp}}% - \or % 1 - \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup\noexpand\macroargctxt - \noexpand\braceorline - \expandafter\noexpand\csname\the\macname xxx\endcsname}% - \expandafter\xdef\csname\the\macname xxx\endcsname##1{% - \egroup\noexpand\scanmacro{\temp}}% - \else - \ifnum\paramno<10\relax % at most 9 - \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup\noexpand\macroargctxt - \noexpand\csname\the\macname xx\endcsname}% - \expandafter\xdef\csname\the\macname xx\endcsname##1{% - \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% - \expandafter\expandafter - \expandafter\xdef - \expandafter\expandafter - \csname\the\macname xxx\endcsname - \paramlist{\egroup\noexpand\scanmacro{\temp}}% - \else % 10 or more - \expandafter\xdef\csname\the\macname\endcsname{% - \noexpand\getargvals@{\the\macname}{\argl}% - }% - \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp - \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble - \fi - \fi - \else - \ifcase\paramno - % 0 + \ifnum\paramno=1 + \def\xeatspaces##1{##1}% + % This removes the pair of braces around the argument. We don't + % use \eatspaces, because this can cause ends of lines to be lost + % when the argument to \eatspaces is read, leading to line-based + % commands like "@itemize" not being read correctly. + \else + \let\xeatspaces\relax % suppress expansion + \fi + \ifcase\paramno + % 0 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup + \noexpand\spaceisspace + \noexpand\endlineisspace + \noexpand\expandafter % skip any whitespace after the macro name. + \expandafter\noexpand\csname\the\macname @@@\endcsname}% + \expandafter\xdef\csname\the\macname @@@\endcsname{% + \egroup + \noexpand\scanmacro{\macrobody}}% + \or % 1 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup + \noexpand\braceorline + \expandafter\noexpand\csname\the\macname @@@\endcsname}% + \expandafter\xdef\csname\the\macname @@@\endcsname##1{% + \egroup + \noexpand\scanmacro{\macrobody}% + }% + \else % at most 9 + \ifnum\paramno<10\relax + % @MACNAME sets the context for reading the macro argument + % @MACNAME@@ gets the argument, processes backslashes and appends a + % comma. + % @MACNAME@@@ removes braces surrounding the argument list. + % @MACNAME@@@@ scans the macro body with arguments substituted. \expandafter\xdef\csname\the\macname\endcsname{% - \noexpand\norecurse{\the\macname}% - \noexpand\scanmacro{\temp}\egroup}% - \or % 1 + \bgroup + \noexpand\expandafter % This \expandafter skip any spaces after the + \noexpand\macroargctxt % macro before we change the catcode of space. + \noexpand\expandafter + \expandafter\noexpand\csname\the\macname @@\endcsname}% + \expandafter\xdef\csname\the\macname @@\endcsname##1{% + \noexpand\passargtomacro + \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}% + \expandafter\xdef\csname\the\macname @@@\endcsname##1{% + \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname @@@@\endcsname\paramlist{% + \egroup\noexpand\scanmacro{\macrobody}}% + \else % 10 or more: \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup\noexpand\macroargctxt - \noexpand\braceorline - \expandafter\noexpand\csname\the\macname xxx\endcsname}% - \expandafter\xdef\csname\the\macname xxx\endcsname##1{% - \egroup - \noexpand\norecurse{\the\macname}% - \noexpand\scanmacro{\temp}\egroup}% - \else % at most 9 - \ifnum\paramno<10\relax - \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup\noexpand\macroargctxt - \expandafter\noexpand\csname\the\macname xx\endcsname}% - \expandafter\xdef\csname\the\macname xx\endcsname##1{% - \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% - \expandafter\expandafter - \expandafter\xdef - \expandafter\expandafter - \csname\the\macname xxx\endcsname - \paramlist{% - \egroup - \noexpand\norecurse{\the\macname}% - \noexpand\scanmacro{\temp}\egroup}% - \else % 10 or more: - \expandafter\xdef\csname\the\macname\endcsname{% - \noexpand\getargvals@{\the\macname}{\argl}% - }% - \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp - \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse - \fi + \noexpand\getargvals@{\the\macname}{\argl}% + }% + \global\expandafter\let\csname mac.\the\macname .body\endcsname\macrobody + \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble \fi \fi} -\catcode `\@\texiatcatcode\relax +\catcode `\@\texiatcatcode\relax % end private-to-Texinfo catcodes \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} -% \braceorline decides whether the next nonwhitespace character is a -% {. If so it reads up to the closing }, if not, it reads the whole -% line. Whatever was read is then fed to the next control sequence -% as an argument (by \parsebrace or \parsearg). + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +{\catcode`\@=0 \catcode`\\=13 % We need to manipulate \ so use @ as escape +@catcode`@_=11 % private names +@catcode`@!=11 % used as argument separator + +% \passargtomacro#1#2 - +% Call #1 with a list of tokens #2, with any doubled backslashes in #2 +% compressed to one. +% +% This implementation works by expansion, and not execution (so we cannot use +% \def or similar). This reduces the risk of this failing in contexts where +% complete expansion is done with no execution (for example, in writing out to +% an auxiliary file for an index entry). +% +% State is kept in the input stream: the argument passed to +% @look_ahead, @gobble_and_check_finish and @add_segment is +% +% THE_MACRO ARG_RESULT ! {PENDING_BS} NEXT_TOKEN (... rest of input) +% +% where: +% THE_MACRO - name of the macro we want to call +% ARG_RESULT - argument list we build to pass to that macro +% PENDING_BS - either a backslash or nothing +% NEXT_TOKEN - used to look ahead in the input stream to see what's coming next + +@gdef@passargtomacro#1#2{% + @add_segment #1!{}@relax#2\@_finish\% +} +@gdef@_finish{@_finishx} @global@let@_finishx@relax + +% #1 - THE_MACRO ARG_RESULT +% #2 - PENDING_BS +% #3 - NEXT_TOKEN +% #4 used to look ahead +% +% If the next token is not a backslash, process the rest of the argument; +% otherwise, remove the next token. +@gdef@look_ahead#1!#2#3#4{% + @ifx#4\% + @expandafter@gobble_and_check_finish + @else + @expandafter@add_segment + @fi#1!{#2}#4#4% +} + +% #1 - THE_MACRO ARG_RESULT +% #2 - PENDING_BS +% #3 - NEXT_TOKEN +% #4 should be a backslash, which is gobbled. +% #5 looks ahead +% +% Double backslash found. Add a single backslash, and look ahead. +@gdef@gobble_and_check_finish#1!#2#3#4#5{% + @add_segment#1\!{}#5#5% +} + +@gdef@is_fi{@fi} + +% #1 - THE_MACRO ARG_RESULT +% #2 - PENDING_BS +% #3 - NEXT_TOKEN +% #4 is input stream until next backslash +% +% Input stream is either at the start of the argument, or just after a +% backslash sequence, either a lone backslash, or a doubled backslash. +% NEXT_TOKEN contains the first token in the input stream: if it is \finish, +% finish; otherwise, append to ARG_RESULT the segment of the argument up until +% the next backslash. PENDING_BACKSLASH contains a backslash to represent +% a backslash just before the start of the input stream that has not been +% added to ARG_RESULT. +@gdef@add_segment#1!#2#3#4\{% +@ifx#3@_finish + @call_the_macro#1!% +@else + % append the pending backslash to the result, followed by the next segment + @expandafter@is_fi@look_ahead#1#2#4!{\}@fi + % this @fi is discarded by @look_ahead. + % we can't get rid of it with \expandafter because we don't know how + % long #4 is. +} + +% #1 - THE_MACRO +% #2 - ARG_RESULT +% #3 discards the res of the conditional in @add_segment, and @is_fi ends the +% conditional. +@gdef@call_the_macro#1#2!#3@fi{@is_fi #1{#2}} + +} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% \braceorline MAC is used for a one-argument macro MAC. It checks +% whether the next non-whitespace character is a {. It sets the context +% for reading the argument (slightly different in the two cases). Then, +% to read the argument, in the whole-line case, it then calls the regular +% \parsearg MAC; in the lbrace case, it calls \passargtomacro MAC. % \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} \def\braceorlinexxx{% - \ifx\nchar\bgroup\else - \expandafter\parsearg + \ifx\nchar\bgroup + \macroargctxt + \expandafter\passargtomacro + \else + \macrolineargctxt\expandafter\parsearg \fi \macnamexxx} @@ -7946,7 +8765,10 @@ \pdfmkdest{#1}% \iflinks {% + \requireauxfile \atdummies % preserve commands, but don't expand them + % match definition in \xrdef, \refx, \xrefX. + \def\value##1{##1}% \edef\writexrdef##1##2{% \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef ##1}{##2}}% these are parameters of \writexrdef @@ -7985,9 +8807,12 @@ % node name, #4 the name of the Info file, #5 the name of the printed % manual. All but the node name can be omitted. % -\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} -\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} -\def\ref#1{\xrefX[#1,,,,,,,]} +\def\pxref{\putwordsee{} \xrefXX} +\def\xref{\putwordSee{} \xrefXX} +\def\ref{\xrefXX} + +\def\xrefXX#1{\def\xrefXXarg{#1}\futurelet\tokenafterxref\xrefXXX} +\def\xrefXXX{\expandafter\xrefX\expandafter[\xrefXXarg,,,,,,,]} % \newbox\toprefbox \newbox\printedrefnamebox @@ -8034,9 +8859,10 @@ % % Make link in pdf output. \ifpdf + % For pdfTeX and LuaTeX {\indexnofonts - \turnoffactive \makevalueexpandable + \turnoffactive % This expands tokens, so do it after making catcode changes, so _ % etc. don't get their TeX definitions. This ignores all spaces in % #4, including (wrongly) those in the middle of the filename. @@ -8044,35 +8870,74 @@ % % This (wrongly) does not take account of leading or trailing % spaces in #1, which should be ignored. - \edef\pdfxrefdest{#1}% - \ifx\pdfxrefdest\empty - \def\pdfxrefdest{Top}% no empty targets - \else - \txiescapepdf\pdfxrefdest % escape PDF special chars + \setpdfdestname{#1}% + % + \ifx\pdfdestname\empty + \def\pdfdestname{Top}% no empty targets \fi % \leavevmode \startlink attr{/Border [0 0 0]}% \ifnum\filenamelength>0 - goto file{\the\filename.pdf} name{\pdfxrefdest}% + goto file{\the\filename.pdf} name{\pdfdestname}% \else - goto name{\pdfmkpgn{\pdfxrefdest}}% + goto name{\pdfmkpgn{\pdfdestname}}% \fi }% \setcolor{\linkcolor}% + \else + \ifx\XeTeXrevision\thisisundefined + \else + % For XeTeX + {\indexnofonts + \makevalueexpandable + \turnoffactive + % This expands tokens, so do it after making catcode changes, so _ + % etc. don't get their TeX definitions. This ignores all spaces in + % #4, including (wrongly) those in the middle of the filename. + \getfilename{#4}% + % + % This (wrongly) does not take account of leading or trailing + % spaces in #1, which should be ignored. + \setpdfdestname{#1}% + % + \ifx\pdfdestname\empty + \def\pdfdestname{Top}% no empty targets + \fi + % + \leavevmode + \ifnum\filenamelength>0 + % With default settings, + % XeTeX (xdvipdfmx) replaces link destination names with integers. + % In this case, the replaced destination names of + % remote PDFs are no longer known. In order to avoid a replacement, + % you can use xdvipdfmx's command line option `-C 0x0010'. + % If you use XeTeX 0.99996+ (TeX Live 2016+), + % this command line option is no longer necessary + % because we can use the `dvipdfmx:config' special. + \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A + << /S /GoToR /F (\the\filename.pdf) /D (\pdfdestname) >> >>}% + \else + \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A + << /S /GoTo /D (\pdfdestname) >> >>}% + \fi + }% + \setcolor{\linkcolor}% + \fi \fi - % - % Float references are printed completely differently: "Figure 1.2" - % instead of "[somenode], p.3". We distinguish them by the - % LABEL-title being set to a magic string. {% % Have to otherify everything special to allow the \csname to % include an _ in the xref name, etc. \indexnofonts \turnoffactive + \def\value##1{##1}% \expandafter\global\expandafter\let\expandafter\Xthisreftitle \csname XR#1-title\endcsname }% + % + % Float references are printed completely differently: "Figure 1.2" + % instead of "[somenode], p.3". \iffloat distinguishes them by + % \Xthisreftitle being set to a magic string. \iffloat\Xthisreftitle % If the user specified the print name (third arg) to the ref, % print it instead of our usual "Figure 1.2". @@ -8131,6 +8996,15 @@ % % output the `page 3'. \turnoffactive \putwordpage\tie\refx{#1-pg}{}% + % Add a , if xref followed by a space + \if\space\noexpand\tokenafterxref ,% + \else\ifx\ \tokenafterxref ,% @TAB + \else\ifx\*\tokenafterxref ,% @* + \else\ifx\ \tokenafterxref ,% @SPACE + \else\ifx\ + \tokenafterxref ,% @NL + \else\ifx\tie\tokenafterxref ,% @tie + \fi\fi\fi\fi\fi\fi \fi\fi \fi \endlink @@ -8197,13 +9071,14 @@ \fi\fi\fi } -% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. -% If its value is nonempty, SUFFIX is output afterward. -% +% \refx{NAME}{SUFFIX} - reference a cross-reference string named NAME. SUFFIX +% is output afterwards if non-empty. \def\refx#1#2{% + \requireauxfile {% \indexnofonts \otherbackslash + \def\value##1{##1}% \expandafter\global\expandafter\let\expandafter\thisrefX \csname XR#1\endcsname }% @@ -8228,16 +9103,18 @@ #2% Output the suffix in any case. } -% This is the macro invoked by entries in the aux file. Usually it's -% just a \def (we prepend XR to the control sequence name to avoid -% collisions). But if this is a float type, we have more work to do. +% This is the macro invoked by entries in the aux file. Define a control +% sequence for a cross-reference target (we prepend XR to the control sequence +% name to avoid collisions). The value is the page number. If this is a float +% type, we have more work to do. % \def\xrdef#1#2{% - {% The node name might contain 8-bit characters, which in our current - % implementation are changed to commands like @'e. Don't let these - % mess up the control sequence name. + {% Expand the node or anchor name to remove control sequences. + % \turnoffactive stops 8-bit characters being changed to commands + % like @'e. \refx does the same to retrieve the value in the definition. \indexnofonts \turnoffactive + \def\value##1{##1}% \xdef\safexrefname{#1}% }% % @@ -8264,6 +9141,23 @@ \fi } +% If working on a large document in chapters, it is convenient to +% be able to disable indexing, cross-referencing, and contents, for test runs. +% This is done with @novalidate at the beginning of the file. +% +\newif\iflinks \linkstrue % by default we want the aux files. +\let\novalidate = \linksfalse + +% Used when writing to the aux file, or when using data from it. +\def\requireauxfile{% + \iflinks + \tryauxfile + % Open the new aux file. TeX will close it automatically at exit. + \immediate\openout\auxfile=\jobname.aux + \fi + \global\let\requireauxfile=\relax % Only do this once. +} + % Read the last existing aux file, if any. No error if none exists. % \def\tryauxfile{% @@ -8342,9 +9236,6 @@ % now. --karl, 15jan04. \catcode`\\=\other % - % Make the characters 128-255 be printing characters. - {\setnonasciicharscatcodenonglobal\other}% - % % @ is our escape character in .aux files, and we need braces. \catcode`\{=1 \catcode`\}=2 @@ -8408,7 +9299,7 @@ % We want to typeset this text as a normal paragraph, even if the % footnote reference occurs in (for example) a display environment. % So reset some parameters. - \hsize=\pagewidth + \hsize=\txipagewidth \interlinepenalty\interfootnotelinepenalty \splittopskip\ht\strutbox % top baseline for broken footnotes \splitmaxdepth\dp\strutbox @@ -8557,6 +9448,7 @@ \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup \catcode`\^^M = 5 % in case we're inside an example \normalturnoffactive % allow _ et al. in names + \def\xprocessmacroarg{\eatspaces}% in case we are being used via a macro % If the image is by itself, center it. \ifvmode \imagevmodetrue @@ -8586,12 +9478,21 @@ % % Output the image. \ifpdf + % For pdfTeX and LuaTeX <= 0.80 \dopdfimage{#1}{#2}{#3}% \else - % \epsfbox itself resets \epsf?size at each figure. - \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi - \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi - \epsfbox{#1.eps}% + \ifx\XeTeXrevision\thisisundefined + % For epsf.tex + % \epsfbox itself resets \epsf?size at each figure. + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi + \setbox0 = \hbox{\ignorespaces #3}% + \ifdim\wd0 > 0pt \epsfysize=#3\relax \fi + \epsfbox{#1.eps}% + \else + % For XeTeX + \doxeteximage{#1}{#2}{#3}% + \fi \fi % \ifimagevmode @@ -8713,7 +9614,7 @@ % \ifx\thiscaption\empty \else \ifx\floatident\empty \else - \appendtomacro\captionline{: }% had ident, so need a colon between + \appendtomacro\captionline{: }% had ident, so need a colon between \fi % % caption text. @@ -8737,32 +9638,20 @@ % \floatlabel-lof. Besides \floatident, we include the short % caption if specified, else the full caption if specified, else nothing. {% + \requireauxfile \atdummies % - % since we read the caption text in the macro world, where ^^M - % is turned into a normal character, we have to scan it back, so - % we don't write the literal three characters "^^M" into the aux file. - \scanexp{% - \xdef\noexpand\gtemp{% - \ifx\thisshortcaption\empty - \thiscaption - \else - \thisshortcaption - \fi - }% - }% + \ifx\thisshortcaption\empty + \def\gtemp{\thiscaption}% + \else + \def\gtemp{\thisshortcaption}% + \fi \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident - \ifx\gtemp\empty \else : \gtemp \fi}}% + \ifx\gtemp\empty \else : \gtemp \fi}}% }% \fi \egroup % end of \vtop % - % place the captured inserts - % - % BEWARE: when the floats start floating, we have to issue warning - % whenever an insert appears inside a float which could possibly - % float. --kasal, 26may04 - % \checkinserts } @@ -8937,6 +9826,70 @@ \global\righthyphenmin = #3\relax } +% XeTeX and LuaTeX can handle Unicode natively. +% Their default I/O uses UTF-8 sequences instead of a byte-wise operation. +% Other TeX engines' I/O (pdfTeX, etc.) is byte-wise. +% +\newif\iftxinativeunicodecapable +\newif\iftxiusebytewiseio + +\ifx\XeTeXrevision\thisisundefined + \ifx\luatexversion\thisisundefined + \txinativeunicodecapablefalse + \txiusebytewiseiotrue + \else + \txinativeunicodecapabletrue + \txiusebytewiseiofalse + \fi +\else + \txinativeunicodecapabletrue + \txiusebytewiseiofalse +\fi + +% Set I/O by bytes instead of UTF-8 sequence for XeTeX and LuaTex +% for non-UTF-8 (byte-wise) encodings. +% +\def\setbytewiseio{% + \ifx\XeTeXrevision\thisisundefined + \else + \XeTeXdefaultencoding "bytes" % For subsequent files to be read + \XeTeXinputencoding "bytes" % For document root file + % Unfortunately, there seems to be no corresponding XeTeX command for + % output encoding. This is a problem for auxiliary index and TOC files. + % The only solution would be perhaps to write out @U{...} sequences in + % place of non-ASCII characters. + \fi + + \ifx\luatexversion\thisisundefined + \else + \directlua{ + local utf8_char, byte, gsub = unicode.utf8.char, string.byte, string.gsub + local function convert_char (char) + return utf8_char(byte(char)) + end + + local function convert_line (line) + return gsub(line, ".", convert_char) + end + + callback.register("process_input_buffer", convert_line) + + local function convert_line_out (line) + local line_out = "" + for c in string.utfvalues(line) do + line_out = line_out .. string.char(c) + end + return line_out + end + + callback.register("process_output_buffer", convert_line_out) + } + \fi + + \txiusebytewiseiotrue +} + + % Helpers for encodings. % Set the catcode of characters 128 through 255 to the specified number. % @@ -8959,7 +9912,9 @@ % @documentencoding sets the definition of non-ASCII characters % according to the specified encoding. % -\parseargdef\documentencoding{% +\def\documentencoding{\parseargusing\filenamecatcodes\documentencodingzzz} +\def\documentencodingzzz#1{% + % % Encoding being declared for the document. \def\declaredencoding{\csname #1.enc\endcsname}% % @@ -8975,22 +9930,38 @@ \asciichardefs % \else \ifx \declaredencoding \lattwo + \iftxinativeunicodecapable + \setbytewiseio + \fi \setnonasciicharscatcode\active \lattwochardefs % \else \ifx \declaredencoding \latone + \iftxinativeunicodecapable + \setbytewiseio + \fi \setnonasciicharscatcode\active \latonechardefs % \else \ifx \declaredencoding \latnine + \iftxinativeunicodecapable + \setbytewiseio + \fi \setnonasciicharscatcode\active \latninechardefs % \else \ifx \declaredencoding \utfeight - \setnonasciicharscatcode\active - % since we already invoked \utfeightchardefs at the top level - % (below), do not re-invoke it, then our check for duplicated - % definitions triggers. Making non-ascii chars active is enough. + \iftxinativeunicodecapable + % For native Unicode handling (XeTeX and LuaTeX) + \nativeunicodechardefs + \else + % For treating UTF-8 as byte sequences (TeX, eTeX and pdfTeX) + \setnonasciicharscatcode\active + % since we already invoked \utfeightchardefs at the top level + % (below), do not re-invoke it, otherwise our check for duplicated + % definitions gets triggered. Making non-ascii chars active is + % sufficient. + \fi % \else \message{Ignoring unknown document encoding: #1.}% @@ -9000,6 +9971,18 @@ \fi % latone \fi % lattwo \fi % ascii + % + \ifx\XeTeXrevision\thisisundefined + \else + \ifx \declaredencoding \utfeight + \else + \ifx \declaredencoding \ascii + \else + \message{Warning: XeTeX with non-UTF-8 encodings cannot handle % + non-ASCII characters in auxiliary files.}% + \fi + \fi + \fi } % emacs-page @@ -9016,109 +9999,119 @@ % macros containing the character definitions. \setnonasciicharscatcode\active % + +\def\gdefchar#1#2{% +\gdef#1{% + \ifpassthroughchars + \string#1% + \else + #2% + \fi +}} + % Latin1 (ISO-8859-1) character definitions. \def\latonechardefs{% - \gdef^^a0{\tie} - \gdef^^a1{\exclamdown} - \gdef^^a2{\missingcharmsg{CENT SIGN}} - \gdef^^a3{{\pounds}} - \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} - \gdef^^a5{\missingcharmsg{YEN SIGN}} - \gdef^^a6{\missingcharmsg{BROKEN BAR}} - \gdef^^a7{\S} - \gdef^^a8{\"{}} - \gdef^^a9{\copyright} - \gdef^^aa{\ordf} - \gdef^^ab{\guillemetleft} - \gdef^^ac{$\lnot$} - \gdef^^ad{\-} - \gdef^^ae{\registeredsymbol} - \gdef^^af{\={}} - % - \gdef^^b0{\textdegree} - \gdef^^b1{$\pm$} - \gdef^^b2{$^2$} - \gdef^^b3{$^3$} - \gdef^^b4{\'{}} - \gdef^^b5{$\mu$} - \gdef^^b6{\P} - \gdef^^b7{\ensuremath\cdot} - \gdef^^b8{\cedilla\ } - \gdef^^b9{$^1$} - \gdef^^ba{\ordm} - \gdef^^bb{\guillemetright} - \gdef^^bc{$1\over4$} - \gdef^^bd{$1\over2$} - \gdef^^be{$3\over4$} - \gdef^^bf{\questiondown} - % - \gdef^^c0{\`A} - \gdef^^c1{\'A} - \gdef^^c2{\^A} - \gdef^^c3{\~A} - \gdef^^c4{\"A} - \gdef^^c5{\ringaccent A} - \gdef^^c6{\AE} - \gdef^^c7{\cedilla C} - \gdef^^c8{\`E} - \gdef^^c9{\'E} - \gdef^^ca{\^E} - \gdef^^cb{\"E} - \gdef^^cc{\`I} - \gdef^^cd{\'I} - \gdef^^ce{\^I} - \gdef^^cf{\"I} - % - \gdef^^d0{\DH} - \gdef^^d1{\~N} - \gdef^^d2{\`O} - \gdef^^d3{\'O} - \gdef^^d4{\^O} - \gdef^^d5{\~O} - \gdef^^d6{\"O} - \gdef^^d7{$\times$} - \gdef^^d8{\O} - \gdef^^d9{\`U} - \gdef^^da{\'U} - \gdef^^db{\^U} - \gdef^^dc{\"U} - \gdef^^dd{\'Y} - \gdef^^de{\TH} - \gdef^^df{\ss} - % - \gdef^^e0{\`a} - \gdef^^e1{\'a} - \gdef^^e2{\^a} - \gdef^^e3{\~a} - \gdef^^e4{\"a} - \gdef^^e5{\ringaccent a} - \gdef^^e6{\ae} - \gdef^^e7{\cedilla c} - \gdef^^e8{\`e} - \gdef^^e9{\'e} - \gdef^^ea{\^e} - \gdef^^eb{\"e} - \gdef^^ec{\`{\dotless i}} - \gdef^^ed{\'{\dotless i}} - \gdef^^ee{\^{\dotless i}} - \gdef^^ef{\"{\dotless i}} - % - \gdef^^f0{\dh} - \gdef^^f1{\~n} - \gdef^^f2{\`o} - \gdef^^f3{\'o} - \gdef^^f4{\^o} - \gdef^^f5{\~o} - \gdef^^f6{\"o} - \gdef^^f7{$\div$} - \gdef^^f8{\o} - \gdef^^f9{\`u} - \gdef^^fa{\'u} - \gdef^^fb{\^u} - \gdef^^fc{\"u} - \gdef^^fd{\'y} - \gdef^^fe{\th} - \gdef^^ff{\"y} + \gdefchar^^a0{\tie} + \gdefchar^^a1{\exclamdown} + \gdefchar^^a2{{\tcfont \char162}} % cent + \gdefchar^^a3{\pounds{}} + \gdefchar^^a4{{\tcfont \char164}} % currency + \gdefchar^^a5{{\tcfont \char165}} % yen + \gdefchar^^a6{{\tcfont \char166}} % broken bar + \gdefchar^^a7{\S} + \gdefchar^^a8{\"{}} + \gdefchar^^a9{\copyright{}} + \gdefchar^^aa{\ordf} + \gdefchar^^ab{\guillemetleft{}} + \gdefchar^^ac{\ensuremath\lnot} + \gdefchar^^ad{\-} + \gdefchar^^ae{\registeredsymbol{}} + \gdefchar^^af{\={}} + % + \gdefchar^^b0{\textdegree} + \gdefchar^^b1{$\pm$} + \gdefchar^^b2{$^2$} + \gdefchar^^b3{$^3$} + \gdefchar^^b4{\'{}} + \gdefchar^^b5{$\mu$} + \gdefchar^^b6{\P} + \gdefchar^^b7{\ensuremath\cdot} + \gdefchar^^b8{\cedilla\ } + \gdefchar^^b9{$^1$} + \gdefchar^^ba{\ordm} + \gdefchar^^bb{\guillemetright{}} + \gdefchar^^bc{$1\over4$} + \gdefchar^^bd{$1\over2$} + \gdefchar^^be{$3\over4$} + \gdefchar^^bf{\questiondown} + % + \gdefchar^^c0{\`A} + \gdefchar^^c1{\'A} + \gdefchar^^c2{\^A} + \gdefchar^^c3{\~A} + \gdefchar^^c4{\"A} + \gdefchar^^c5{\ringaccent A} + \gdefchar^^c6{\AE} + \gdefchar^^c7{\cedilla C} + \gdefchar^^c8{\`E} + \gdefchar^^c9{\'E} + \gdefchar^^ca{\^E} + \gdefchar^^cb{\"E} + \gdefchar^^cc{\`I} + \gdefchar^^cd{\'I} + \gdefchar^^ce{\^I} + \gdefchar^^cf{\"I} + % + \gdefchar^^d0{\DH} + \gdefchar^^d1{\~N} + \gdefchar^^d2{\`O} + \gdefchar^^d3{\'O} + \gdefchar^^d4{\^O} + \gdefchar^^d5{\~O} + \gdefchar^^d6{\"O} + \gdefchar^^d7{$\times$} + \gdefchar^^d8{\O} + \gdefchar^^d9{\`U} + \gdefchar^^da{\'U} + \gdefchar^^db{\^U} + \gdefchar^^dc{\"U} + \gdefchar^^dd{\'Y} + \gdefchar^^de{\TH} + \gdefchar^^df{\ss} + % + \gdefchar^^e0{\`a} + \gdefchar^^e1{\'a} + \gdefchar^^e2{\^a} + \gdefchar^^e3{\~a} + \gdefchar^^e4{\"a} + \gdefchar^^e5{\ringaccent a} + \gdefchar^^e6{\ae} + \gdefchar^^e7{\cedilla c} + \gdefchar^^e8{\`e} + \gdefchar^^e9{\'e} + \gdefchar^^ea{\^e} + \gdefchar^^eb{\"e} + \gdefchar^^ec{\`{\dotless i}} + \gdefchar^^ed{\'{\dotless i}} + \gdefchar^^ee{\^{\dotless i}} + \gdefchar^^ef{\"{\dotless i}} + % + \gdefchar^^f0{\dh} + \gdefchar^^f1{\~n} + \gdefchar^^f2{\`o} + \gdefchar^^f3{\'o} + \gdefchar^^f4{\^o} + \gdefchar^^f5{\~o} + \gdefchar^^f6{\"o} + \gdefchar^^f7{$\div$} + \gdefchar^^f8{\o} + \gdefchar^^f9{\`u} + \gdefchar^^fa{\'u} + \gdefchar^^fb{\^u} + \gdefchar^^fc{\"u} + \gdefchar^^fd{\'y} + \gdefchar^^fe{\th} + \gdefchar^^ff{\"y} } % Latin9 (ISO-8859-15) encoding character definitions. @@ -9126,119 +10119,119 @@ % Encoding is almost identical to Latin1. \latonechardefs % - \gdef^^a4{\euro} - \gdef^^a6{\v S} - \gdef^^a8{\v s} - \gdef^^b4{\v Z} - \gdef^^b8{\v z} - \gdef^^bc{\OE} - \gdef^^bd{\oe} - \gdef^^be{\"Y} + \gdefchar^^a4{\euro{}} + \gdefchar^^a6{\v S} + \gdefchar^^a8{\v s} + \gdefchar^^b4{\v Z} + \gdefchar^^b8{\v z} + \gdefchar^^bc{\OE} + \gdefchar^^bd{\oe} + \gdefchar^^be{\"Y} } % Latin2 (ISO-8859-2) character definitions. \def\lattwochardefs{% - \gdef^^a0{\tie} - \gdef^^a1{\ogonek{A}} - \gdef^^a2{\u{}} - \gdef^^a3{\L} - \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} - \gdef^^a5{\v L} - \gdef^^a6{\'S} - \gdef^^a7{\S} - \gdef^^a8{\"{}} - \gdef^^a9{\v S} - \gdef^^aa{\cedilla S} - \gdef^^ab{\v T} - \gdef^^ac{\'Z} - \gdef^^ad{\-} - \gdef^^ae{\v Z} - \gdef^^af{\dotaccent Z} - % - \gdef^^b0{\textdegree} - \gdef^^b1{\ogonek{a}} - \gdef^^b2{\ogonek{ }} - \gdef^^b3{\l} - \gdef^^b4{\'{}} - \gdef^^b5{\v l} - \gdef^^b6{\'s} - \gdef^^b7{\v{}} - \gdef^^b8{\cedilla\ } - \gdef^^b9{\v s} - \gdef^^ba{\cedilla s} - \gdef^^bb{\v t} - \gdef^^bc{\'z} - \gdef^^bd{\H{}} - \gdef^^be{\v z} - \gdef^^bf{\dotaccent z} - % - \gdef^^c0{\'R} - \gdef^^c1{\'A} - \gdef^^c2{\^A} - \gdef^^c3{\u A} - \gdef^^c4{\"A} - \gdef^^c5{\'L} - \gdef^^c6{\'C} - \gdef^^c7{\cedilla C} - \gdef^^c8{\v C} - \gdef^^c9{\'E} - \gdef^^ca{\ogonek{E}} - \gdef^^cb{\"E} - \gdef^^cc{\v E} - \gdef^^cd{\'I} - \gdef^^ce{\^I} - \gdef^^cf{\v D} - % - \gdef^^d0{\DH} - \gdef^^d1{\'N} - \gdef^^d2{\v N} - \gdef^^d3{\'O} - \gdef^^d4{\^O} - \gdef^^d5{\H O} - \gdef^^d6{\"O} - \gdef^^d7{$\times$} - \gdef^^d8{\v R} - \gdef^^d9{\ringaccent U} - \gdef^^da{\'U} - \gdef^^db{\H U} - \gdef^^dc{\"U} - \gdef^^dd{\'Y} - \gdef^^de{\cedilla T} - \gdef^^df{\ss} - % - \gdef^^e0{\'r} - \gdef^^e1{\'a} - \gdef^^e2{\^a} - \gdef^^e3{\u a} - \gdef^^e4{\"a} - \gdef^^e5{\'l} - \gdef^^e6{\'c} - \gdef^^e7{\cedilla c} - \gdef^^e8{\v c} - \gdef^^e9{\'e} - \gdef^^ea{\ogonek{e}} - \gdef^^eb{\"e} - \gdef^^ec{\v e} - \gdef^^ed{\'{\dotless{i}}} - \gdef^^ee{\^{\dotless{i}}} - \gdef^^ef{\v d} - % - \gdef^^f0{\dh} - \gdef^^f1{\'n} - \gdef^^f2{\v n} - \gdef^^f3{\'o} - \gdef^^f4{\^o} - \gdef^^f5{\H o} - \gdef^^f6{\"o} - \gdef^^f7{$\div$} - \gdef^^f8{\v r} - \gdef^^f9{\ringaccent u} - \gdef^^fa{\'u} - \gdef^^fb{\H u} - \gdef^^fc{\"u} - \gdef^^fd{\'y} - \gdef^^fe{\cedilla t} - \gdef^^ff{\dotaccent{}} + \gdefchar^^a0{\tie} + \gdefchar^^a1{\ogonek{A}} + \gdefchar^^a2{\u{}} + \gdefchar^^a3{\L} + \gdefchar^^a4{\missingcharmsg{CURRENCY SIGN}} + \gdefchar^^a5{\v L} + \gdefchar^^a6{\'S} + \gdefchar^^a7{\S} + \gdefchar^^a8{\"{}} + \gdefchar^^a9{\v S} + \gdefchar^^aa{\cedilla S} + \gdefchar^^ab{\v T} + \gdefchar^^ac{\'Z} + \gdefchar^^ad{\-} + \gdefchar^^ae{\v Z} + \gdefchar^^af{\dotaccent Z} + % + \gdefchar^^b0{\textdegree{}} + \gdefchar^^b1{\ogonek{a}} + \gdefchar^^b2{\ogonek{ }} + \gdefchar^^b3{\l} + \gdefchar^^b4{\'{}} + \gdefchar^^b5{\v l} + \gdefchar^^b6{\'s} + \gdefchar^^b7{\v{}} + \gdefchar^^b8{\cedilla\ } + \gdefchar^^b9{\v s} + \gdefchar^^ba{\cedilla s} + \gdefchar^^bb{\v t} + \gdefchar^^bc{\'z} + \gdefchar^^bd{\H{}} + \gdefchar^^be{\v z} + \gdefchar^^bf{\dotaccent z} + % + \gdefchar^^c0{\'R} + \gdefchar^^c1{\'A} + \gdefchar^^c2{\^A} + \gdefchar^^c3{\u A} + \gdefchar^^c4{\"A} + \gdefchar^^c5{\'L} + \gdefchar^^c6{\'C} + \gdefchar^^c7{\cedilla C} + \gdefchar^^c8{\v C} + \gdefchar^^c9{\'E} + \gdefchar^^ca{\ogonek{E}} + \gdefchar^^cb{\"E} + \gdefchar^^cc{\v E} + \gdefchar^^cd{\'I} + \gdefchar^^ce{\^I} + \gdefchar^^cf{\v D} + % + \gdefchar^^d0{\DH} + \gdefchar^^d1{\'N} + \gdefchar^^d2{\v N} + \gdefchar^^d3{\'O} + \gdefchar^^d4{\^O} + \gdefchar^^d5{\H O} + \gdefchar^^d6{\"O} + \gdefchar^^d7{$\times$} + \gdefchar^^d8{\v R} + \gdefchar^^d9{\ringaccent U} + \gdefchar^^da{\'U} + \gdefchar^^db{\H U} + \gdefchar^^dc{\"U} + \gdefchar^^dd{\'Y} + \gdefchar^^de{\cedilla T} + \gdefchar^^df{\ss} + % + \gdefchar^^e0{\'r} + \gdefchar^^e1{\'a} + \gdefchar^^e2{\^a} + \gdefchar^^e3{\u a} + \gdefchar^^e4{\"a} + \gdefchar^^e5{\'l} + \gdefchar^^e6{\'c} + \gdefchar^^e7{\cedilla c} + \gdefchar^^e8{\v c} + \gdefchar^^e9{\'e} + \gdefchar^^ea{\ogonek{e}} + \gdefchar^^eb{\"e} + \gdefchar^^ec{\v e} + \gdefchar^^ed{\'{\dotless{i}}} + \gdefchar^^ee{\^{\dotless{i}}} + \gdefchar^^ef{\v d} + % + \gdefchar^^f0{\dh} + \gdefchar^^f1{\'n} + \gdefchar^^f2{\v n} + \gdefchar^^f3{\'o} + \gdefchar^^f4{\^o} + \gdefchar^^f5{\H o} + \gdefchar^^f6{\"o} + \gdefchar^^f7{$\div$} + \gdefchar^^f8{\v r} + \gdefchar^^f9{\ringaccent u} + \gdefchar^^fa{\'u} + \gdefchar^^fb{\H u} + \gdefchar^^fc{\"u} + \gdefchar^^fd{\'y} + \gdefchar^^fe{\cedilla t} + \gdefchar^^ff{\dotaccent{}} } % UTF-8 character definitions. @@ -9268,35 +10261,56 @@ \fi } +% Give non-ASCII bytes the active definitions for processing UTF-8 sequences \begingroup \catcode`\~13 + \catcode`\$12 \catcode`\"12 + % Loop from \countUTFx to \countUTFy, performing \UTFviiiTmp + % substituting ~ and $ with a character token of that value. \def\UTFviiiLoop{% \global\catcode\countUTFx\active \uccode`\~\countUTFx + \uccode`\$\countUTFx \uppercase\expandafter{\UTFviiiTmp}% \advance\countUTFx by 1 \ifnum\countUTFx < \countUTFy \expandafter\UTFviiiLoop \fi} + % For bytes other than the first in a UTF-8 sequence. Not expected to + % be expanded except when writing to auxiliary files. + \countUTFx = "80 + \countUTFy = "C2 + \def\UTFviiiTmp{% + \gdef~{% + \ifpassthroughchars $\fi}}% + \UTFviiiLoop + \countUTFx = "C2 \countUTFy = "E0 \def\UTFviiiTmp{% - \xdef~{\noexpand\UTFviiiTwoOctets\string~}} + \gdef~{% + \ifpassthroughchars $% + \else\expandafter\UTFviiiTwoOctets\expandafter$\fi}}% \UTFviiiLoop \countUTFx = "E0 \countUTFy = "F0 \def\UTFviiiTmp{% - \xdef~{\noexpand\UTFviiiThreeOctets\string~}} + \gdef~{% + \ifpassthroughchars $% + \else\expandafter\UTFviiiThreeOctets\expandafter$\fi}}% \UTFviiiLoop \countUTFx = "F0 \countUTFy = "F4 \def\UTFviiiTmp{% - \xdef~{\noexpand\UTFviiiFourOctets\string~}} + \gdef~{% + \ifpassthroughchars $% + \else\expandafter\UTFviiiFourOctets\expandafter$\fi + }}% \UTFviiiLoop \endgroup @@ -9305,13 +10319,36 @@ % @U{xxxx} to produce U+xxxx, if we support it. \def\U#1{% \expandafter\ifx\csname uni:#1\endcsname \relax - \errhelp = \EMsimple - \errmessage{Unicode character U+#1 not supported, sorry}% + \iftxinativeunicodecapable + % All Unicode characters can be used if native Unicode handling is + % active. However, if the font does not have the glyph, + % letters are missing. + \begingroup + \uccode`\.="#1\relax + \uppercase{.} + \endgroup + \else + \errhelp = \EMsimple + \errmessage{Unicode character U+#1 not supported, sorry}% + \fi \else \csname uni:#1\endcsname \fi } +% These macros are used here to construct the name of a control +% sequence to be defined. +\def\UTFviiiTwoOctetsName#1#2{% + \csname u8:#1\string #2\endcsname}% +\def\UTFviiiThreeOctetsName#1#2#3{% + \csname u8:#1\string #2\string #3\endcsname}% +\def\UTFviiiFourOctetsName#1#2#3#4{% + \csname u8:#1\string #2\string #3\string #4\endcsname}% + +% For UTF-8 byte sequences (TeX, e-TeX and pdfTeX), +% provide a definition macro to replace a Unicode character; +% this gets used by the @U command +% \begingroup \catcode`\"=12 \catcode`\<=12 @@ -9320,64 +10357,91 @@ \catcode`\;=12 \catcode`\!=12 \catcode`\~=13 - \gdef\DeclareUnicodeCharacter#1#2{% + \gdef\DeclareUnicodeCharacterUTFviii#1#2{% \countUTFz = "#1\relax - %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}% \begingroup \parseXMLCharref - \def\UTFviiiTwoOctets##1##2{% - \csname u8:##1\string ##2\endcsname}% - \def\UTFviiiThreeOctets##1##2##3{% - \csname u8:##1\string ##2\string ##3\endcsname}% - \def\UTFviiiFourOctets##1##2##3##4{% - \csname u8:##1\string ##2\string ##3\string ##4\endcsname}% - \expandafter\expandafter\expandafter\expandafter - \expandafter\expandafter\expandafter - \gdef\UTFviiiTmp{#2}% + + % Give \u8:... its definition. The sequence of seven \expandafter's + % expands after the \gdef three times, e.g. + % + % 1. \UTFviiTwoOctetsName B1 B2 + % 2. \csname u8:B1 \string B2 \endcsname + % 3. \u8: B1 B2 (a single control sequence token) + % + \expandafter\expandafter + \expandafter\expandafter + \expandafter\expandafter + \expandafter\gdef \UTFviiiTmp{#2}% % \expandafter\ifx\csname uni:#1\endcsname \relax \else - \errmessage{Internal error, already defined: #1}% + \message{Internal error, already defined: #1}% \fi % % define an additional control sequence for this code point. \expandafter\globallet\csname uni:#1\endcsname \UTFviiiTmp \endgroup} - + % + % Given the value in \countUTFz as a Unicode code point, set \UTFviiiTmp + % to the corresponding UTF-8 sequence. \gdef\parseXMLCharref{% \ifnum\countUTFz < "A0\relax \errhelp = \EMsimple \errmessage{Cannot define Unicode char value < 00A0}% \else\ifnum\countUTFz < "800\relax \parseUTFviiiA,% - \parseUTFviiiB C\UTFviiiTwoOctets.,% + \parseUTFviiiB C\UTFviiiTwoOctetsName.,% \else\ifnum\countUTFz < "10000\relax \parseUTFviiiA;% \parseUTFviiiA,% - \parseUTFviiiB E\UTFviiiThreeOctets.{,;}% + \parseUTFviiiB E\UTFviiiThreeOctetsName.{,;}% \else \parseUTFviiiA;% \parseUTFviiiA,% \parseUTFviiiA!% - \parseUTFviiiB F\UTFviiiFourOctets.{!,;}% + \parseUTFviiiB F\UTFviiiFourOctetsName.{!,;}% \fi\fi\fi } + % Extract a byte from the end of the UTF-8 representation of \countUTFx. + % It must be a non-initial byte in the sequence. + % Change \uccode of #1 for it to be used in \parseUTFviiiB as one + % of the bytes. \gdef\parseUTFviiiA#1{% \countUTFx = \countUTFz \divide\countUTFz by 64 - \countUTFy = \countUTFz + \countUTFy = \countUTFz % Save to be the future value of \countUTFz. \multiply\countUTFz by 64 + + % \countUTFz is now \countUTFx with the last 5 bits cleared. Subtract + % in order to get the last five bits. \advance\countUTFx by -\countUTFz + + % Convert this to the byte in the UTF-8 sequence. \advance\countUTFx by 128 \uccode `#1\countUTFx \countUTFz = \countUTFy} + % Used to put a UTF-8 byte sequence into \UTFviiiTmp + % #1 is the increment for \countUTFz to yield a the first byte of the UTF-8 + % sequence. + % #2 is one of the \UTFviii*OctetsName macros. + % #3 is always a full stop (.) + % #4 is a template for the other bytes in the sequence. The values for these + % bytes is substituted in here with \uppercase using the \uccode's. \gdef\parseUTFviiiB#1#2#3#4{% \advance\countUTFz by "#10\relax \uccode `#3\countUTFz \uppercase{\gdef\UTFviiiTmp{#2#3#4}}} \endgroup +% For native Unicode handling (XeTeX and LuaTeX), +% provide a definition macro that sets a catcode to `other' non-globally +% +\def\DeclareUnicodeCharacterNativeOther#1#2{% + \catcode"#1=\other +} + % https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_M % U+0000..U+007F = https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block) % U+0080..U+00FF = https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block) @@ -9392,502 +10456,748 @@ % We won't be doing that here in this simple file. But we can try to at % least make most of the characters not bomb out. % -\def\utfeightchardefs{% - \DeclareUnicodeCharacter{00A0}{\tie} - \DeclareUnicodeCharacter{00A1}{\exclamdown} - \DeclareUnicodeCharacter{00A3}{\pounds} - \DeclareUnicodeCharacter{00A7}{\S} - \DeclareUnicodeCharacter{00A8}{\"{ }} - \DeclareUnicodeCharacter{00A9}{\copyright} - \DeclareUnicodeCharacter{00AA}{\ordf} - \DeclareUnicodeCharacter{00AB}{\guillemetleft} - \DeclareUnicodeCharacter{00AC}{\ensuremath\lnot} - \DeclareUnicodeCharacter{00AD}{\-} - \DeclareUnicodeCharacter{00AE}{\registeredsymbol} - \DeclareUnicodeCharacter{00AF}{\={ }} - - \DeclareUnicodeCharacter{00B0}{\ringaccent{ }} - \DeclareUnicodeCharacter{00B1}{\ensuremath\pm} - \DeclareUnicodeCharacter{00B2}{$^2$} - \DeclareUnicodeCharacter{00B3}{$^3$} - \DeclareUnicodeCharacter{00B4}{\'{ }} - \DeclareUnicodeCharacter{00B5}{$\mu$} - \DeclareUnicodeCharacter{00B6}{\P} - \DeclareUnicodeCharacter{00B7}{\ensuremath\cdot} - \DeclareUnicodeCharacter{00B8}{\cedilla{ }} - \DeclareUnicodeCharacter{00B9}{$^1$} - \DeclareUnicodeCharacter{00BA}{\ordm} - \DeclareUnicodeCharacter{00BB}{\guillemetright} - \DeclareUnicodeCharacter{00BC}{$1\over4$} - \DeclareUnicodeCharacter{00BD}{$1\over2$} - \DeclareUnicodeCharacter{00BE}{$3\over4$} - \DeclareUnicodeCharacter{00BF}{\questiondown} - - \DeclareUnicodeCharacter{00C0}{\`A} - \DeclareUnicodeCharacter{00C1}{\'A} - \DeclareUnicodeCharacter{00C2}{\^A} - \DeclareUnicodeCharacter{00C3}{\~A} - \DeclareUnicodeCharacter{00C4}{\"A} - \DeclareUnicodeCharacter{00C5}{\AA} - \DeclareUnicodeCharacter{00C6}{\AE} - \DeclareUnicodeCharacter{00C7}{\cedilla{C}} - \DeclareUnicodeCharacter{00C8}{\`E} - \DeclareUnicodeCharacter{00C9}{\'E} - \DeclareUnicodeCharacter{00CA}{\^E} - \DeclareUnicodeCharacter{00CB}{\"E} - \DeclareUnicodeCharacter{00CC}{\`I} - \DeclareUnicodeCharacter{00CD}{\'I} - \DeclareUnicodeCharacter{00CE}{\^I} - \DeclareUnicodeCharacter{00CF}{\"I} - - \DeclareUnicodeCharacter{00D0}{\DH} - \DeclareUnicodeCharacter{00D1}{\~N} - \DeclareUnicodeCharacter{00D2}{\`O} - \DeclareUnicodeCharacter{00D3}{\'O} - \DeclareUnicodeCharacter{00D4}{\^O} - \DeclareUnicodeCharacter{00D5}{\~O} - \DeclareUnicodeCharacter{00D6}{\"O} - \DeclareUnicodeCharacter{00D7}{\ensuremath\times} - \DeclareUnicodeCharacter{00D8}{\O} - \DeclareUnicodeCharacter{00D9}{\`U} - \DeclareUnicodeCharacter{00DA}{\'U} - \DeclareUnicodeCharacter{00DB}{\^U} - \DeclareUnicodeCharacter{00DC}{\"U} - \DeclareUnicodeCharacter{00DD}{\'Y} - \DeclareUnicodeCharacter{00DE}{\TH} - \DeclareUnicodeCharacter{00DF}{\ss} - - \DeclareUnicodeCharacter{00E0}{\`a} - \DeclareUnicodeCharacter{00E1}{\'a} - \DeclareUnicodeCharacter{00E2}{\^a} - \DeclareUnicodeCharacter{00E3}{\~a} - \DeclareUnicodeCharacter{00E4}{\"a} - \DeclareUnicodeCharacter{00E5}{\aa} - \DeclareUnicodeCharacter{00E6}{\ae} - \DeclareUnicodeCharacter{00E7}{\cedilla{c}} - \DeclareUnicodeCharacter{00E8}{\`e} - \DeclareUnicodeCharacter{00E9}{\'e} - \DeclareUnicodeCharacter{00EA}{\^e} - \DeclareUnicodeCharacter{00EB}{\"e} - \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}} - \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}} - \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}} - \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}} - - \DeclareUnicodeCharacter{00F0}{\dh} - \DeclareUnicodeCharacter{00F1}{\~n} - \DeclareUnicodeCharacter{00F2}{\`o} - \DeclareUnicodeCharacter{00F3}{\'o} - \DeclareUnicodeCharacter{00F4}{\^o} - \DeclareUnicodeCharacter{00F5}{\~o} - \DeclareUnicodeCharacter{00F6}{\"o} - \DeclareUnicodeCharacter{00F7}{\ensuremath\div} - \DeclareUnicodeCharacter{00F8}{\o} - \DeclareUnicodeCharacter{00F9}{\`u} - \DeclareUnicodeCharacter{00FA}{\'u} - \DeclareUnicodeCharacter{00FB}{\^u} - \DeclareUnicodeCharacter{00FC}{\"u} - \DeclareUnicodeCharacter{00FD}{\'y} - \DeclareUnicodeCharacter{00FE}{\th} - \DeclareUnicodeCharacter{00FF}{\"y} - - \DeclareUnicodeCharacter{0100}{\=A} - \DeclareUnicodeCharacter{0101}{\=a} - \DeclareUnicodeCharacter{0102}{\u{A}} - \DeclareUnicodeCharacter{0103}{\u{a}} - \DeclareUnicodeCharacter{0104}{\ogonek{A}} - \DeclareUnicodeCharacter{0105}{\ogonek{a}} - \DeclareUnicodeCharacter{0106}{\'C} - \DeclareUnicodeCharacter{0107}{\'c} - \DeclareUnicodeCharacter{0108}{\^C} - \DeclareUnicodeCharacter{0109}{\^c} - \DeclareUnicodeCharacter{010A}{\dotaccent{C}} - \DeclareUnicodeCharacter{010B}{\dotaccent{c}} - \DeclareUnicodeCharacter{010C}{\v{C}} - \DeclareUnicodeCharacter{010D}{\v{c}} - \DeclareUnicodeCharacter{010E}{\v{D}} - \DeclareUnicodeCharacter{010F}{d'} - - \DeclareUnicodeCharacter{0110}{\DH} - \DeclareUnicodeCharacter{0111}{\dh} - \DeclareUnicodeCharacter{0112}{\=E} - \DeclareUnicodeCharacter{0113}{\=e} - \DeclareUnicodeCharacter{0114}{\u{E}} - \DeclareUnicodeCharacter{0115}{\u{e}} - \DeclareUnicodeCharacter{0116}{\dotaccent{E}} - \DeclareUnicodeCharacter{0117}{\dotaccent{e}} - \DeclareUnicodeCharacter{0118}{\ogonek{E}} - \DeclareUnicodeCharacter{0119}{\ogonek{e}} - \DeclareUnicodeCharacter{011A}{\v{E}} - \DeclareUnicodeCharacter{011B}{\v{e}} - \DeclareUnicodeCharacter{011C}{\^G} - \DeclareUnicodeCharacter{011D}{\^g} - \DeclareUnicodeCharacter{011E}{\u{G}} - \DeclareUnicodeCharacter{011F}{\u{g}} - - \DeclareUnicodeCharacter{0120}{\dotaccent{G}} - \DeclareUnicodeCharacter{0121}{\dotaccent{g}} - \DeclareUnicodeCharacter{0122}{\cedilla{G}} - \DeclareUnicodeCharacter{0123}{\cedilla{g}} - \DeclareUnicodeCharacter{0124}{\^H} - \DeclareUnicodeCharacter{0125}{\^h} - \DeclareUnicodeCharacter{0126}{\missingcharmsg{H WITH STROKE}} - \DeclareUnicodeCharacter{0127}{\missingcharmsg{h WITH STROKE}} - \DeclareUnicodeCharacter{0128}{\~I} - \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}} - \DeclareUnicodeCharacter{012A}{\=I} - \DeclareUnicodeCharacter{012B}{\={\dotless{i}}} - \DeclareUnicodeCharacter{012C}{\u{I}} - \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}} - \DeclareUnicodeCharacter{012E}{\ogonek{I}} - \DeclareUnicodeCharacter{012F}{\ogonek{i}} - - \DeclareUnicodeCharacter{0130}{\dotaccent{I}} - \DeclareUnicodeCharacter{0131}{\dotless{i}} - \DeclareUnicodeCharacter{0132}{IJ} - \DeclareUnicodeCharacter{0133}{ij} - \DeclareUnicodeCharacter{0134}{\^J} - \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}} - \DeclareUnicodeCharacter{0136}{\cedilla{K}} - \DeclareUnicodeCharacter{0137}{\cedilla{k}} - \DeclareUnicodeCharacter{0138}{\ensuremath\kappa} - \DeclareUnicodeCharacter{0139}{\'L} - \DeclareUnicodeCharacter{013A}{\'l} - \DeclareUnicodeCharacter{013B}{\cedilla{L}} - \DeclareUnicodeCharacter{013C}{\cedilla{l}} +\def\unicodechardefs{% + \DeclareUnicodeCharacter{00A0}{\tie}% + \DeclareUnicodeCharacter{00A1}{\exclamdown}% + \DeclareUnicodeCharacter{00A2}{{\tcfont \char162}}% 0242=cent + \DeclareUnicodeCharacter{00A3}{\pounds{}}% + \DeclareUnicodeCharacter{00A4}{{\tcfont \char164}}% 0244=currency + \DeclareUnicodeCharacter{00A5}{{\tcfont \char165}}% 0245=yen + \DeclareUnicodeCharacter{00A6}{{\tcfont \char166}}% 0246=brokenbar + \DeclareUnicodeCharacter{00A7}{\S}% + \DeclareUnicodeCharacter{00A8}{\"{ }}% + \DeclareUnicodeCharacter{00A9}{\copyright{}}% + \DeclareUnicodeCharacter{00AA}{\ordf}% + \DeclareUnicodeCharacter{00AB}{\guillemetleft{}}% + \DeclareUnicodeCharacter{00AC}{\ensuremath\lnot}% + \DeclareUnicodeCharacter{00AD}{\-}% + \DeclareUnicodeCharacter{00AE}{\registeredsymbol{}}% + \DeclareUnicodeCharacter{00AF}{\={ }}% + % + \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}% + \DeclareUnicodeCharacter{00B1}{\ensuremath\pm}% + \DeclareUnicodeCharacter{00B2}{$^2$}% + \DeclareUnicodeCharacter{00B3}{$^3$}% + \DeclareUnicodeCharacter{00B4}{\'{ }}% + \DeclareUnicodeCharacter{00B5}{$\mu$}% + \DeclareUnicodeCharacter{00B6}{\P}% + \DeclareUnicodeCharacter{00B7}{\ensuremath\cdot}% + \DeclareUnicodeCharacter{00B8}{\cedilla{ }}% + \DeclareUnicodeCharacter{00B9}{$^1$}% + \DeclareUnicodeCharacter{00BA}{\ordm}% + \DeclareUnicodeCharacter{00BB}{\guillemetright{}}% + \DeclareUnicodeCharacter{00BC}{$1\over4$}% + \DeclareUnicodeCharacter{00BD}{$1\over2$}% + \DeclareUnicodeCharacter{00BE}{$3\over4$}% + \DeclareUnicodeCharacter{00BF}{\questiondown}% + % + \DeclareUnicodeCharacter{00C0}{\`A}% + \DeclareUnicodeCharacter{00C1}{\'A}% + \DeclareUnicodeCharacter{00C2}{\^A}% + \DeclareUnicodeCharacter{00C3}{\~A}% + \DeclareUnicodeCharacter{00C4}{\"A}% + \DeclareUnicodeCharacter{00C5}{\AA}% + \DeclareUnicodeCharacter{00C6}{\AE}% + \DeclareUnicodeCharacter{00C7}{\cedilla{C}}% + \DeclareUnicodeCharacter{00C8}{\`E}% + \DeclareUnicodeCharacter{00C9}{\'E}% + \DeclareUnicodeCharacter{00CA}{\^E}% + \DeclareUnicodeCharacter{00CB}{\"E}% + \DeclareUnicodeCharacter{00CC}{\`I}% + \DeclareUnicodeCharacter{00CD}{\'I}% + \DeclareUnicodeCharacter{00CE}{\^I}% + \DeclareUnicodeCharacter{00CF}{\"I}% + % + \DeclareUnicodeCharacter{00D0}{\DH}% + \DeclareUnicodeCharacter{00D1}{\~N}% + \DeclareUnicodeCharacter{00D2}{\`O}% + \DeclareUnicodeCharacter{00D3}{\'O}% + \DeclareUnicodeCharacter{00D4}{\^O}% + \DeclareUnicodeCharacter{00D5}{\~O}% + \DeclareUnicodeCharacter{00D6}{\"O}% + \DeclareUnicodeCharacter{00D7}{\ensuremath\times}% + \DeclareUnicodeCharacter{00D8}{\O}% + \DeclareUnicodeCharacter{00D9}{\`U}% + \DeclareUnicodeCharacter{00DA}{\'U}% + \DeclareUnicodeCharacter{00DB}{\^U}% + \DeclareUnicodeCharacter{00DC}{\"U}% + \DeclareUnicodeCharacter{00DD}{\'Y}% + \DeclareUnicodeCharacter{00DE}{\TH}% + \DeclareUnicodeCharacter{00DF}{\ss}% + % + \DeclareUnicodeCharacter{00E0}{\`a}% + \DeclareUnicodeCharacter{00E1}{\'a}% + \DeclareUnicodeCharacter{00E2}{\^a}% + \DeclareUnicodeCharacter{00E3}{\~a}% + \DeclareUnicodeCharacter{00E4}{\"a}% + \DeclareUnicodeCharacter{00E5}{\aa}% + \DeclareUnicodeCharacter{00E6}{\ae}% + \DeclareUnicodeCharacter{00E7}{\cedilla{c}}% + \DeclareUnicodeCharacter{00E8}{\`e}% + \DeclareUnicodeCharacter{00E9}{\'e}% + \DeclareUnicodeCharacter{00EA}{\^e}% + \DeclareUnicodeCharacter{00EB}{\"e}% + \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}% + \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}% + \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}% + \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}% + % + \DeclareUnicodeCharacter{00F0}{\dh}% + \DeclareUnicodeCharacter{00F1}{\~n}% + \DeclareUnicodeCharacter{00F2}{\`o}% + \DeclareUnicodeCharacter{00F3}{\'o}% + \DeclareUnicodeCharacter{00F4}{\^o}% + \DeclareUnicodeCharacter{00F5}{\~o}% + \DeclareUnicodeCharacter{00F6}{\"o}% + \DeclareUnicodeCharacter{00F7}{\ensuremath\div}% + \DeclareUnicodeCharacter{00F8}{\o}% + \DeclareUnicodeCharacter{00F9}{\`u}% + \DeclareUnicodeCharacter{00FA}{\'u}% + \DeclareUnicodeCharacter{00FB}{\^u}% + \DeclareUnicodeCharacter{00FC}{\"u}% + \DeclareUnicodeCharacter{00FD}{\'y}% + \DeclareUnicodeCharacter{00FE}{\th}% + \DeclareUnicodeCharacter{00FF}{\"y}% + % + \DeclareUnicodeCharacter{0100}{\=A}% + \DeclareUnicodeCharacter{0101}{\=a}% + \DeclareUnicodeCharacter{0102}{\u{A}}% + \DeclareUnicodeCharacter{0103}{\u{a}}% + \DeclareUnicodeCharacter{0104}{\ogonek{A}}% + \DeclareUnicodeCharacter{0105}{\ogonek{a}}% + \DeclareUnicodeCharacter{0106}{\'C}% + \DeclareUnicodeCharacter{0107}{\'c}% + \DeclareUnicodeCharacter{0108}{\^C}% + \DeclareUnicodeCharacter{0109}{\^c}% + \DeclareUnicodeCharacter{010A}{\dotaccent{C}}% + \DeclareUnicodeCharacter{010B}{\dotaccent{c}}% + \DeclareUnicodeCharacter{010C}{\v{C}}% + \DeclareUnicodeCharacter{010D}{\v{c}}% + \DeclareUnicodeCharacter{010E}{\v{D}}% + \DeclareUnicodeCharacter{010F}{d'}% + % + \DeclareUnicodeCharacter{0110}{\DH}% + \DeclareUnicodeCharacter{0111}{\dh}% + \DeclareUnicodeCharacter{0112}{\=E}% + \DeclareUnicodeCharacter{0113}{\=e}% + \DeclareUnicodeCharacter{0114}{\u{E}}% + \DeclareUnicodeCharacter{0115}{\u{e}}% + \DeclareUnicodeCharacter{0116}{\dotaccent{E}}% + \DeclareUnicodeCharacter{0117}{\dotaccent{e}}% + \DeclareUnicodeCharacter{0118}{\ogonek{E}}% + \DeclareUnicodeCharacter{0119}{\ogonek{e}}% + \DeclareUnicodeCharacter{011A}{\v{E}}% + \DeclareUnicodeCharacter{011B}{\v{e}}% + \DeclareUnicodeCharacter{011C}{\^G}% + \DeclareUnicodeCharacter{011D}{\^g}% + \DeclareUnicodeCharacter{011E}{\u{G}}% + \DeclareUnicodeCharacter{011F}{\u{g}}% + % + \DeclareUnicodeCharacter{0120}{\dotaccent{G}}% + \DeclareUnicodeCharacter{0121}{\dotaccent{g}}% + \DeclareUnicodeCharacter{0122}{\cedilla{G}}% + \DeclareUnicodeCharacter{0123}{\cedilla{g}}% + \DeclareUnicodeCharacter{0124}{\^H}% + \DeclareUnicodeCharacter{0125}{\^h}% + \DeclareUnicodeCharacter{0126}{\missingcharmsg{H WITH STROKE}}% + \DeclareUnicodeCharacter{0127}{\missingcharmsg{h WITH STROKE}}% + \DeclareUnicodeCharacter{0128}{\~I}% + \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}% + \DeclareUnicodeCharacter{012A}{\=I}% + \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}% + \DeclareUnicodeCharacter{012C}{\u{I}}% + \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}% + \DeclareUnicodeCharacter{012E}{\ogonek{I}}% + \DeclareUnicodeCharacter{012F}{\ogonek{i}}% + % + \DeclareUnicodeCharacter{0130}{\dotaccent{I}}% + \DeclareUnicodeCharacter{0131}{\dotless{i}}% + \DeclareUnicodeCharacter{0132}{IJ}% + \DeclareUnicodeCharacter{0133}{ij}% + \DeclareUnicodeCharacter{0134}{\^J}% + \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}% + \DeclareUnicodeCharacter{0136}{\cedilla{K}}% + \DeclareUnicodeCharacter{0137}{\cedilla{k}}% + \DeclareUnicodeCharacter{0138}{\ensuremath\kappa}% + \DeclareUnicodeCharacter{0139}{\'L}% + \DeclareUnicodeCharacter{013A}{\'l}% + \DeclareUnicodeCharacter{013B}{\cedilla{L}}% + \DeclareUnicodeCharacter{013C}{\cedilla{l}}% \DeclareUnicodeCharacter{013D}{L'}% should kern \DeclareUnicodeCharacter{013E}{l'}% should kern - \DeclareUnicodeCharacter{013F}{L\U{00B7}} + \DeclareUnicodeCharacter{013F}{L\U{00B7}}% + % + \DeclareUnicodeCharacter{0140}{l\U{00B7}}% + \DeclareUnicodeCharacter{0141}{\L}% + \DeclareUnicodeCharacter{0142}{\l}% + \DeclareUnicodeCharacter{0143}{\'N}% + \DeclareUnicodeCharacter{0144}{\'n}% + \DeclareUnicodeCharacter{0145}{\cedilla{N}}% + \DeclareUnicodeCharacter{0146}{\cedilla{n}}% + \DeclareUnicodeCharacter{0147}{\v{N}}% + \DeclareUnicodeCharacter{0148}{\v{n}}% + \DeclareUnicodeCharacter{0149}{'n}% + \DeclareUnicodeCharacter{014A}{\missingcharmsg{ENG}}% + \DeclareUnicodeCharacter{014B}{\missingcharmsg{eng}}% + \DeclareUnicodeCharacter{014C}{\=O}% + \DeclareUnicodeCharacter{014D}{\=o}% + \DeclareUnicodeCharacter{014E}{\u{O}}% + \DeclareUnicodeCharacter{014F}{\u{o}}% + % + \DeclareUnicodeCharacter{0150}{\H{O}}% + \DeclareUnicodeCharacter{0151}{\H{o}}% + \DeclareUnicodeCharacter{0152}{\OE}% + \DeclareUnicodeCharacter{0153}{\oe}% + \DeclareUnicodeCharacter{0154}{\'R}% + \DeclareUnicodeCharacter{0155}{\'r}% + \DeclareUnicodeCharacter{0156}{\cedilla{R}}% + \DeclareUnicodeCharacter{0157}{\cedilla{r}}% + \DeclareUnicodeCharacter{0158}{\v{R}}% + \DeclareUnicodeCharacter{0159}{\v{r}}% + \DeclareUnicodeCharacter{015A}{\'S}% + \DeclareUnicodeCharacter{015B}{\'s}% + \DeclareUnicodeCharacter{015C}{\^S}% + \DeclareUnicodeCharacter{015D}{\^s}% + \DeclareUnicodeCharacter{015E}{\cedilla{S}}% + \DeclareUnicodeCharacter{015F}{\cedilla{s}}% + % + \DeclareUnicodeCharacter{0160}{\v{S}}% + \DeclareUnicodeCharacter{0161}{\v{s}}% + \DeclareUnicodeCharacter{0162}{\cedilla{T}}% + \DeclareUnicodeCharacter{0163}{\cedilla{t}}% + \DeclareUnicodeCharacter{0164}{\v{T}}% + \DeclareUnicodeCharacter{0165}{\v{t}}% + \DeclareUnicodeCharacter{0166}{\missingcharmsg{H WITH STROKE}}% + \DeclareUnicodeCharacter{0167}{\missingcharmsg{h WITH STROKE}}% + \DeclareUnicodeCharacter{0168}{\~U}% + \DeclareUnicodeCharacter{0169}{\~u}% + \DeclareUnicodeCharacter{016A}{\=U}% + \DeclareUnicodeCharacter{016B}{\=u}% + \DeclareUnicodeCharacter{016C}{\u{U}}% + \DeclareUnicodeCharacter{016D}{\u{u}}% + \DeclareUnicodeCharacter{016E}{\ringaccent{U}}% + \DeclareUnicodeCharacter{016F}{\ringaccent{u}}% + % + \DeclareUnicodeCharacter{0170}{\H{U}}% + \DeclareUnicodeCharacter{0171}{\H{u}}% + \DeclareUnicodeCharacter{0172}{\ogonek{U}}% + \DeclareUnicodeCharacter{0173}{\ogonek{u}}% + \DeclareUnicodeCharacter{0174}{\^W}% + \DeclareUnicodeCharacter{0175}{\^w}% + \DeclareUnicodeCharacter{0176}{\^Y}% + \DeclareUnicodeCharacter{0177}{\^y}% + \DeclareUnicodeCharacter{0178}{\"Y}% + \DeclareUnicodeCharacter{0179}{\'Z}% + \DeclareUnicodeCharacter{017A}{\'z}% + \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}% + \DeclareUnicodeCharacter{017C}{\dotaccent{z}}% + \DeclareUnicodeCharacter{017D}{\v{Z}}% + \DeclareUnicodeCharacter{017E}{\v{z}}% + \DeclareUnicodeCharacter{017F}{\missingcharmsg{LONG S}}% + % + \DeclareUnicodeCharacter{01C4}{D\v{Z}}% + \DeclareUnicodeCharacter{01C5}{D\v{z}}% + \DeclareUnicodeCharacter{01C6}{d\v{z}}% + \DeclareUnicodeCharacter{01C7}{LJ}% + \DeclareUnicodeCharacter{01C8}{Lj}% + \DeclareUnicodeCharacter{01C9}{lj}% + \DeclareUnicodeCharacter{01CA}{NJ}% + \DeclareUnicodeCharacter{01CB}{Nj}% + \DeclareUnicodeCharacter{01CC}{nj}% + \DeclareUnicodeCharacter{01CD}{\v{A}}% + \DeclareUnicodeCharacter{01CE}{\v{a}}% + \DeclareUnicodeCharacter{01CF}{\v{I}}% + % + \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}% + \DeclareUnicodeCharacter{01D1}{\v{O}}% + \DeclareUnicodeCharacter{01D2}{\v{o}}% + \DeclareUnicodeCharacter{01D3}{\v{U}}% + \DeclareUnicodeCharacter{01D4}{\v{u}}% + % + \DeclareUnicodeCharacter{01E2}{\={\AE}}% + \DeclareUnicodeCharacter{01E3}{\={\ae}}% + \DeclareUnicodeCharacter{01E6}{\v{G}}% + \DeclareUnicodeCharacter{01E7}{\v{g}}% + \DeclareUnicodeCharacter{01E8}{\v{K}}% + \DeclareUnicodeCharacter{01E9}{\v{k}}% + % + \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}% + \DeclareUnicodeCharacter{01F1}{DZ}% + \DeclareUnicodeCharacter{01F2}{Dz}% + \DeclareUnicodeCharacter{01F3}{dz}% + \DeclareUnicodeCharacter{01F4}{\'G}% + \DeclareUnicodeCharacter{01F5}{\'g}% + \DeclareUnicodeCharacter{01F8}{\`N}% + \DeclareUnicodeCharacter{01F9}{\`n}% + \DeclareUnicodeCharacter{01FC}{\'{\AE}}% + \DeclareUnicodeCharacter{01FD}{\'{\ae}}% + \DeclareUnicodeCharacter{01FE}{\'{\O}}% + \DeclareUnicodeCharacter{01FF}{\'{\o}}% + % + \DeclareUnicodeCharacter{021E}{\v{H}}% + \DeclareUnicodeCharacter{021F}{\v{h}}% + % + \DeclareUnicodeCharacter{0226}{\dotaccent{A}}% + \DeclareUnicodeCharacter{0227}{\dotaccent{a}}% + \DeclareUnicodeCharacter{0228}{\cedilla{E}}% + \DeclareUnicodeCharacter{0229}{\cedilla{e}}% + \DeclareUnicodeCharacter{022E}{\dotaccent{O}}% + \DeclareUnicodeCharacter{022F}{\dotaccent{o}}% + % + \DeclareUnicodeCharacter{0232}{\=Y}% + \DeclareUnicodeCharacter{0233}{\=y}% + \DeclareUnicodeCharacter{0237}{\dotless{j}}% + % + \DeclareUnicodeCharacter{02DB}{\ogonek{ }}% + % + % Greek letters upper case + \DeclareUnicodeCharacter{0391}{{\it A}}% + \DeclareUnicodeCharacter{0392}{{\it B}}% + \DeclareUnicodeCharacter{0393}{\ensuremath{\mit\Gamma}}% + \DeclareUnicodeCharacter{0394}{\ensuremath{\mit\Delta}}% + \DeclareUnicodeCharacter{0395}{{\it E}}% + \DeclareUnicodeCharacter{0396}{{\it Z}}% + \DeclareUnicodeCharacter{0397}{{\it H}}% + \DeclareUnicodeCharacter{0398}{\ensuremath{\mit\Theta}}% + \DeclareUnicodeCharacter{0399}{{\it I}}% + \DeclareUnicodeCharacter{039A}{{\it K}}% + \DeclareUnicodeCharacter{039B}{\ensuremath{\mit\Lambda}}% + \DeclareUnicodeCharacter{039C}{{\it M}}% + \DeclareUnicodeCharacter{039D}{{\it N}}% + \DeclareUnicodeCharacter{039E}{\ensuremath{\mit\Xi}}% + \DeclareUnicodeCharacter{039F}{{\it O}}% + \DeclareUnicodeCharacter{03A0}{\ensuremath{\mit\Pi}}% + \DeclareUnicodeCharacter{03A1}{{\it P}}% + %\DeclareUnicodeCharacter{03A2}{} % none - corresponds to final sigma + \DeclareUnicodeCharacter{03A3}{\ensuremath{\mit\Sigma}}% + \DeclareUnicodeCharacter{03A4}{{\it T}}% + \DeclareUnicodeCharacter{03A5}{\ensuremath{\mit\Upsilon}}% + \DeclareUnicodeCharacter{03A6}{\ensuremath{\mit\Phi}}% + \DeclareUnicodeCharacter{03A7}{{\it X}}% + \DeclareUnicodeCharacter{03A8}{\ensuremath{\mit\Psi}}% + \DeclareUnicodeCharacter{03A9}{\ensuremath{\mit\Omega}}% + % + % Vowels with accents + \DeclareUnicodeCharacter{0390}{\ensuremath{\ddot{\acute\iota}}}% + \DeclareUnicodeCharacter{03AC}{\ensuremath{\acute\alpha}}% + \DeclareUnicodeCharacter{03AD}{\ensuremath{\acute\epsilon}}% + \DeclareUnicodeCharacter{03AE}{\ensuremath{\acute\eta}}% + \DeclareUnicodeCharacter{03AF}{\ensuremath{\acute\iota}}% + \DeclareUnicodeCharacter{03B0}{\ensuremath{\acute{\ddot\upsilon}}}% + % + % Standalone accent + \DeclareUnicodeCharacter{0384}{\ensuremath{\acute{\ }}}% + % + % Greek letters lower case + \DeclareUnicodeCharacter{03B1}{\ensuremath\alpha}% + \DeclareUnicodeCharacter{03B2}{\ensuremath\beta}% + \DeclareUnicodeCharacter{03B3}{\ensuremath\gamma}% + \DeclareUnicodeCharacter{03B4}{\ensuremath\delta}% + \DeclareUnicodeCharacter{03B5}{\ensuremath\epsilon}% + \DeclareUnicodeCharacter{03B6}{\ensuremath\zeta}% + \DeclareUnicodeCharacter{03B7}{\ensuremath\eta}% + \DeclareUnicodeCharacter{03B8}{\ensuremath\theta}% + \DeclareUnicodeCharacter{03B9}{\ensuremath\iota}% + \DeclareUnicodeCharacter{03BA}{\ensuremath\kappa}% + \DeclareUnicodeCharacter{03BB}{\ensuremath\lambda}% + \DeclareUnicodeCharacter{03BC}{\ensuremath\mu}% + \DeclareUnicodeCharacter{03BD}{\ensuremath\nu}% + \DeclareUnicodeCharacter{03BE}{\ensuremath\xi}% + \DeclareUnicodeCharacter{03BF}{{\it o}}% omicron + \DeclareUnicodeCharacter{03C0}{\ensuremath\pi}% + \DeclareUnicodeCharacter{03C1}{\ensuremath\rho}% + \DeclareUnicodeCharacter{03C2}{\ensuremath\varsigma}% + \DeclareUnicodeCharacter{03C3}{\ensuremath\sigma}% + \DeclareUnicodeCharacter{03C4}{\ensuremath\tau}% + \DeclareUnicodeCharacter{03C5}{\ensuremath\upsilon}% + \DeclareUnicodeCharacter{03C6}{\ensuremath\phi}% + \DeclareUnicodeCharacter{03C7}{\ensuremath\chi}% + \DeclareUnicodeCharacter{03C8}{\ensuremath\psi}% + \DeclareUnicodeCharacter{03C9}{\ensuremath\omega}% + % + % More Greek vowels with accents + \DeclareUnicodeCharacter{03CA}{\ensuremath{\ddot\iota}}% + \DeclareUnicodeCharacter{03CB}{\ensuremath{\ddot\upsilon}}% + \DeclareUnicodeCharacter{03CC}{\ensuremath{\acute o}}% + \DeclareUnicodeCharacter{03CD}{\ensuremath{\acute\upsilon}}% + \DeclareUnicodeCharacter{03CE}{\ensuremath{\acute\omega}}% + % + % Variant Greek letters + \DeclareUnicodeCharacter{03D1}{\ensuremath\vartheta}% + \DeclareUnicodeCharacter{03D6}{\ensuremath\varpi}% + \DeclareUnicodeCharacter{03F1}{\ensuremath\varrho}% + % + \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}% + \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}% + \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}% + \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}% + \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}% + \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}% + \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}% + \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}% + \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}% + \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}% + \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}% + \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}% + % + \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}% + \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}% + % + \DeclareUnicodeCharacter{1E20}{\=G}% + \DeclareUnicodeCharacter{1E21}{\=g}% + \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}% + \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}% + \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}% + \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}% + \DeclareUnicodeCharacter{1E26}{\"H}% + \DeclareUnicodeCharacter{1E27}{\"h}% + % + \DeclareUnicodeCharacter{1E30}{\'K}% + \DeclareUnicodeCharacter{1E31}{\'k}% + \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}% + \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}% + \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}% + \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}% + \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}% + \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}% + \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}% + \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}% + \DeclareUnicodeCharacter{1E3E}{\'M}% + \DeclareUnicodeCharacter{1E3F}{\'m}% + % + \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}% + \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}% + \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}% + \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}% + \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}% + \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}% + \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}% + \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}% + \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}% + \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}% + % + \DeclareUnicodeCharacter{1E54}{\'P}% + \DeclareUnicodeCharacter{1E55}{\'p}% + \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}% + \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}% + \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}% + \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}% + \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}% + \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}% + \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}% + \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}% + % + \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}% + \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}% + \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}% + \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}% + \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}% + \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}% + \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}% + \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}% + \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}% + \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}% + % + \DeclareUnicodeCharacter{1E7C}{\~V}% + \DeclareUnicodeCharacter{1E7D}{\~v}% + \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}% + \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}% + % + \DeclareUnicodeCharacter{1E80}{\`W}% + \DeclareUnicodeCharacter{1E81}{\`w}% + \DeclareUnicodeCharacter{1E82}{\'W}% + \DeclareUnicodeCharacter{1E83}{\'w}% + \DeclareUnicodeCharacter{1E84}{\"W}% + \DeclareUnicodeCharacter{1E85}{\"w}% + \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}% + \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}% + \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}% + \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}% + \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}% + \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}% + \DeclareUnicodeCharacter{1E8C}{\"X}% + \DeclareUnicodeCharacter{1E8D}{\"x}% + \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}% + \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}% + % + \DeclareUnicodeCharacter{1E90}{\^Z}% + \DeclareUnicodeCharacter{1E91}{\^z}% + \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}% + \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}% + \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}% + \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}% + \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}% + \DeclareUnicodeCharacter{1E97}{\"t}% + \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}% + \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}% + % + \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}% + \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}% + % + \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}% + \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}% + \DeclareUnicodeCharacter{1EBC}{\~E}% + \DeclareUnicodeCharacter{1EBD}{\~e}% + % + \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}% + \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}% + \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}% + \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}% + % + \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}% + \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}% + % + \DeclareUnicodeCharacter{1EF2}{\`Y}% + \DeclareUnicodeCharacter{1EF3}{\`y}% + \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}% + % + \DeclareUnicodeCharacter{1EF8}{\~Y}% + \DeclareUnicodeCharacter{1EF9}{\~y}% + % + % Punctuation + \DeclareUnicodeCharacter{2013}{--}% + \DeclareUnicodeCharacter{2014}{---}% + \DeclareUnicodeCharacter{2018}{\quoteleft{}}% + \DeclareUnicodeCharacter{2019}{\quoteright{}}% + \DeclareUnicodeCharacter{201A}{\quotesinglbase{}}% + \DeclareUnicodeCharacter{201C}{\quotedblleft{}}% + \DeclareUnicodeCharacter{201D}{\quotedblright{}}% + \DeclareUnicodeCharacter{201E}{\quotedblbase{}}% + \DeclareUnicodeCharacter{2020}{\ensuremath\dagger}% + \DeclareUnicodeCharacter{2021}{\ensuremath\ddagger}% + \DeclareUnicodeCharacter{2022}{\bullet{}}% + \DeclareUnicodeCharacter{202F}{\thinspace}% + \DeclareUnicodeCharacter{2026}{\dots{}}% + \DeclareUnicodeCharacter{2039}{\guilsinglleft{}}% + \DeclareUnicodeCharacter{203A}{\guilsinglright{}}% + % + \DeclareUnicodeCharacter{20AC}{\euro{}}% + % + \DeclareUnicodeCharacter{2192}{\expansion{}}% + \DeclareUnicodeCharacter{21D2}{\result{}}% + % + % Mathematical symbols + \DeclareUnicodeCharacter{2200}{\ensuremath\forall}% + \DeclareUnicodeCharacter{2203}{\ensuremath\exists}% + \DeclareUnicodeCharacter{2208}{\ensuremath\in}% + \DeclareUnicodeCharacter{2212}{\minus{}}% + \DeclareUnicodeCharacter{2217}{\ast}% + \DeclareUnicodeCharacter{221E}{\ensuremath\infty}% + \DeclareUnicodeCharacter{2225}{\ensuremath\parallel}% + \DeclareUnicodeCharacter{2227}{\ensuremath\wedge}% + \DeclareUnicodeCharacter{2229}{\ensuremath\cap}% + \DeclareUnicodeCharacter{2261}{\equiv{}}% + \DeclareUnicodeCharacter{2264}{\ensuremath\leq}% + \DeclareUnicodeCharacter{2265}{\ensuremath\geq}% + \DeclareUnicodeCharacter{2282}{\ensuremath\subset}% + \DeclareUnicodeCharacter{2287}{\ensuremath\supseteq}% + % + \DeclareUnicodeCharacter{2016}{\ensuremath\Vert}% + \DeclareUnicodeCharacter{2032}{\ensuremath\prime}% + \DeclareUnicodeCharacter{210F}{\ensuremath\hbar}% + \DeclareUnicodeCharacter{2111}{\ensuremath\Im}% + \DeclareUnicodeCharacter{2113}{\ensuremath\ell}% + \DeclareUnicodeCharacter{2118}{\ensuremath\wp}% + \DeclareUnicodeCharacter{211C}{\ensuremath\Re}% + \DeclareUnicodeCharacter{2127}{\ensuremath\mho}% + \DeclareUnicodeCharacter{2135}{\ensuremath\aleph}% + \DeclareUnicodeCharacter{2190}{\ensuremath\leftarrow}% + \DeclareUnicodeCharacter{2191}{\ensuremath\uparrow}% + \DeclareUnicodeCharacter{2193}{\ensuremath\downarrow}% + \DeclareUnicodeCharacter{2194}{\ensuremath\leftrightarrow}% + \DeclareUnicodeCharacter{2195}{\ensuremath\updownarrow}% + \DeclareUnicodeCharacter{2196}{\ensuremath\nwarrow}% + \DeclareUnicodeCharacter{2197}{\ensuremath\nearrow}% + \DeclareUnicodeCharacter{2198}{\ensuremath\searrow}% + \DeclareUnicodeCharacter{2199}{\ensuremath\swarrow}% + \DeclareUnicodeCharacter{21A6}{\ensuremath\mapsto}% + \DeclareUnicodeCharacter{21A9}{\ensuremath\hookleftarrow}% + \DeclareUnicodeCharacter{21AA}{\ensuremath\hookrightarrow}% + \DeclareUnicodeCharacter{21BC}{\ensuremath\leftharpoonup}% + \DeclareUnicodeCharacter{21BD}{\ensuremath\leftharpoondown}% + \DeclareUnicodeCharacter{21BE}{\ensuremath\upharpoonright}% + \DeclareUnicodeCharacter{21C0}{\ensuremath\rightharpoonup}% + \DeclareUnicodeCharacter{21C1}{\ensuremath\rightharpoondown}% + \DeclareUnicodeCharacter{21CC}{\ensuremath\rightleftharpoons}% + \DeclareUnicodeCharacter{21D0}{\ensuremath\Leftarrow}% + \DeclareUnicodeCharacter{21D1}{\ensuremath\Uparrow}% + \DeclareUnicodeCharacter{21D3}{\ensuremath\Downarrow}% + \DeclareUnicodeCharacter{21D4}{\ensuremath\Leftrightarrow}% + \DeclareUnicodeCharacter{21D5}{\ensuremath\Updownarrow}% + \DeclareUnicodeCharacter{21DD}{\ensuremath\leadsto}% + \DeclareUnicodeCharacter{2201}{\ensuremath\complement}% + \DeclareUnicodeCharacter{2202}{\ensuremath\partial}% + \DeclareUnicodeCharacter{2205}{\ensuremath\emptyset}% + \DeclareUnicodeCharacter{2207}{\ensuremath\nabla}% + \DeclareUnicodeCharacter{2209}{\ensuremath\notin}% + \DeclareUnicodeCharacter{220B}{\ensuremath\owns}% + \DeclareUnicodeCharacter{220F}{\ensuremath\prod}% + \DeclareUnicodeCharacter{2210}{\ensuremath\coprod}% + \DeclareUnicodeCharacter{2211}{\ensuremath\sum}% + \DeclareUnicodeCharacter{2213}{\ensuremath\mp}% + \DeclareUnicodeCharacter{2218}{\ensuremath\circ}% + \DeclareUnicodeCharacter{221A}{\ensuremath\surd}% + \DeclareUnicodeCharacter{221D}{\ensuremath\propto}% + \DeclareUnicodeCharacter{2220}{\ensuremath\angle}% + \DeclareUnicodeCharacter{2223}{\ensuremath\mid}% + \DeclareUnicodeCharacter{2228}{\ensuremath\vee}% + \DeclareUnicodeCharacter{222A}{\ensuremath\cup}% + \DeclareUnicodeCharacter{222B}{\ensuremath\smallint}% + \DeclareUnicodeCharacter{222E}{\ensuremath\oint}% + \DeclareUnicodeCharacter{223C}{\ensuremath\sim}% + \DeclareUnicodeCharacter{2240}{\ensuremath\wr}% + \DeclareUnicodeCharacter{2243}{\ensuremath\simeq}% + \DeclareUnicodeCharacter{2245}{\ensuremath\cong}% + \DeclareUnicodeCharacter{2248}{\ensuremath\approx}% + \DeclareUnicodeCharacter{224D}{\ensuremath\asymp}% + \DeclareUnicodeCharacter{2250}{\ensuremath\doteq}% + \DeclareUnicodeCharacter{2260}{\ensuremath\neq}% + \DeclareUnicodeCharacter{226A}{\ensuremath\ll}% + \DeclareUnicodeCharacter{226B}{\ensuremath\gg}% + \DeclareUnicodeCharacter{227A}{\ensuremath\prec}% + \DeclareUnicodeCharacter{227B}{\ensuremath\succ}% + \DeclareUnicodeCharacter{2283}{\ensuremath\supset}% + \DeclareUnicodeCharacter{2286}{\ensuremath\subseteq}% + \DeclareUnicodeCharacter{228E}{\ensuremath\uplus}% + \DeclareUnicodeCharacter{228F}{\ensuremath\sqsubset}% + \DeclareUnicodeCharacter{2290}{\ensuremath\sqsupset}% + \DeclareUnicodeCharacter{2291}{\ensuremath\sqsubseteq}% + \DeclareUnicodeCharacter{2292}{\ensuremath\sqsupseteq}% + \DeclareUnicodeCharacter{2293}{\ensuremath\sqcap}% + \DeclareUnicodeCharacter{2294}{\ensuremath\sqcup}% + \DeclareUnicodeCharacter{2295}{\ensuremath\oplus}% + \DeclareUnicodeCharacter{2296}{\ensuremath\ominus}% + \DeclareUnicodeCharacter{2297}{\ensuremath\otimes}% + \DeclareUnicodeCharacter{2298}{\ensuremath\oslash}% + \DeclareUnicodeCharacter{2299}{\ensuremath\odot}% + \DeclareUnicodeCharacter{22A2}{\ensuremath\vdash}% + \DeclareUnicodeCharacter{22A3}{\ensuremath\dashv}% + \DeclareUnicodeCharacter{22A4}{\ensuremath\ptextop}% + \DeclareUnicodeCharacter{22A5}{\ensuremath\bot}% + \DeclareUnicodeCharacter{22A8}{\ensuremath\models}% + \DeclareUnicodeCharacter{22B4}{\ensuremath\unlhd}% + \DeclareUnicodeCharacter{22B5}{\ensuremath\unrhd}% + \DeclareUnicodeCharacter{22C0}{\ensuremath\bigwedge}% + \DeclareUnicodeCharacter{22C1}{\ensuremath\bigvee}% + \DeclareUnicodeCharacter{22C2}{\ensuremath\bigcap}% + \DeclareUnicodeCharacter{22C3}{\ensuremath\bigcup}% + \DeclareUnicodeCharacter{22C4}{\ensuremath\diamond}% + \DeclareUnicodeCharacter{22C5}{\ensuremath\cdot}% + \DeclareUnicodeCharacter{22C6}{\ensuremath\star}% + \DeclareUnicodeCharacter{22C8}{\ensuremath\bowtie}% + \DeclareUnicodeCharacter{2308}{\ensuremath\lceil}% + \DeclareUnicodeCharacter{2309}{\ensuremath\rceil}% + \DeclareUnicodeCharacter{230A}{\ensuremath\lfloor}% + \DeclareUnicodeCharacter{230B}{\ensuremath\rfloor}% + \DeclareUnicodeCharacter{2322}{\ensuremath\frown}% + \DeclareUnicodeCharacter{2323}{\ensuremath\smile}% + % + \DeclareUnicodeCharacter{25A1}{\ensuremath\Box}% + \DeclareUnicodeCharacter{25B3}{\ensuremath\triangle}% + \DeclareUnicodeCharacter{25B7}{\ensuremath\triangleright}% + \DeclareUnicodeCharacter{25BD}{\ensuremath\bigtriangledown}% + \DeclareUnicodeCharacter{25C1}{\ensuremath\triangleleft}% + \DeclareUnicodeCharacter{25C7}{\ensuremath\Diamond}% + \DeclareUnicodeCharacter{2660}{\ensuremath\spadesuit}% + \DeclareUnicodeCharacter{2661}{\ensuremath\heartsuit}% + \DeclareUnicodeCharacter{2662}{\ensuremath\diamondsuit}% + \DeclareUnicodeCharacter{2663}{\ensuremath\clubsuit}% + \DeclareUnicodeCharacter{266D}{\ensuremath\flat}% + \DeclareUnicodeCharacter{266E}{\ensuremath\natural}% + \DeclareUnicodeCharacter{266F}{\ensuremath\sharp}% + \DeclareUnicodeCharacter{26AA}{\ensuremath\bigcirc}% + \DeclareUnicodeCharacter{27B9}{\ensuremath\rangle}% + \DeclareUnicodeCharacter{27C2}{\ensuremath\perp}% + \DeclareUnicodeCharacter{27E8}{\ensuremath\langle}% + \DeclareUnicodeCharacter{27F5}{\ensuremath\longleftarrow}% + \DeclareUnicodeCharacter{27F6}{\ensuremath\longrightarrow}% + \DeclareUnicodeCharacter{27F7}{\ensuremath\longleftrightarrow}% + \DeclareUnicodeCharacter{27FC}{\ensuremath\longmapsto}% + \DeclareUnicodeCharacter{29F5}{\ensuremath\setminus}% + \DeclareUnicodeCharacter{2A00}{\ensuremath\bigodot}% + \DeclareUnicodeCharacter{2A01}{\ensuremath\bigoplus}% + \DeclareUnicodeCharacter{2A02}{\ensuremath\bigotimes}% + \DeclareUnicodeCharacter{2A04}{\ensuremath\biguplus}% + \DeclareUnicodeCharacter{2A06}{\ensuremath\bigsqcup}% + \DeclareUnicodeCharacter{2A1D}{\ensuremath\Join}% + \DeclareUnicodeCharacter{2A3F}{\ensuremath\amalg}% + \DeclareUnicodeCharacter{2AAF}{\ensuremath\preceq}% + \DeclareUnicodeCharacter{2AB0}{\ensuremath\succeq}% + % + \global\mathchardef\checkmark="1370% actually the square root sign + \DeclareUnicodeCharacter{2713}{\ensuremath\checkmark}% +}% end of \unicodechardefs - \DeclareUnicodeCharacter{0140}{l\U{00B7}} - \DeclareUnicodeCharacter{0141}{\L} - \DeclareUnicodeCharacter{0142}{\l} - \DeclareUnicodeCharacter{0143}{\'N} - \DeclareUnicodeCharacter{0144}{\'n} - \DeclareUnicodeCharacter{0145}{\cedilla{N}} - \DeclareUnicodeCharacter{0146}{\cedilla{n}} - \DeclareUnicodeCharacter{0147}{\v{N}} - \DeclareUnicodeCharacter{0148}{\v{n}} - \DeclareUnicodeCharacter{0149}{'n} - \DeclareUnicodeCharacter{014A}{\missingcharmsg{ENG}} - \DeclareUnicodeCharacter{014B}{\missingcharmsg{eng}} - \DeclareUnicodeCharacter{014C}{\=O} - \DeclareUnicodeCharacter{014D}{\=o} - \DeclareUnicodeCharacter{014E}{\u{O}} - \DeclareUnicodeCharacter{014F}{\u{o}} - - \DeclareUnicodeCharacter{0150}{\H{O}} - \DeclareUnicodeCharacter{0151}{\H{o}} - \DeclareUnicodeCharacter{0152}{\OE} - \DeclareUnicodeCharacter{0153}{\oe} - \DeclareUnicodeCharacter{0154}{\'R} - \DeclareUnicodeCharacter{0155}{\'r} - \DeclareUnicodeCharacter{0156}{\cedilla{R}} - \DeclareUnicodeCharacter{0157}{\cedilla{r}} - \DeclareUnicodeCharacter{0158}{\v{R}} - \DeclareUnicodeCharacter{0159}{\v{r}} - \DeclareUnicodeCharacter{015A}{\'S} - \DeclareUnicodeCharacter{015B}{\'s} - \DeclareUnicodeCharacter{015C}{\^S} - \DeclareUnicodeCharacter{015D}{\^s} - \DeclareUnicodeCharacter{015E}{\cedilla{S}} - \DeclareUnicodeCharacter{015F}{\cedilla{s}} - - \DeclareUnicodeCharacter{0160}{\v{S}} - \DeclareUnicodeCharacter{0161}{\v{s}} - \DeclareUnicodeCharacter{0162}{\cedilla{T}} - \DeclareUnicodeCharacter{0163}{\cedilla{t}} - \DeclareUnicodeCharacter{0164}{\v{T}} - \DeclareUnicodeCharacter{0165}{\v{t}} - \DeclareUnicodeCharacter{0166}{\missingcharmsg{H WITH STROKE}} - \DeclareUnicodeCharacter{0167}{\missingcharmsg{h WITH STROKE}} - \DeclareUnicodeCharacter{0168}{\~U} - \DeclareUnicodeCharacter{0169}{\~u} - \DeclareUnicodeCharacter{016A}{\=U} - \DeclareUnicodeCharacter{016B}{\=u} - \DeclareUnicodeCharacter{016C}{\u{U}} - \DeclareUnicodeCharacter{016D}{\u{u}} - \DeclareUnicodeCharacter{016E}{\ringaccent{U}} - \DeclareUnicodeCharacter{016F}{\ringaccent{u}} - - \DeclareUnicodeCharacter{0170}{\H{U}} - \DeclareUnicodeCharacter{0171}{\H{u}} - \DeclareUnicodeCharacter{0172}{\ogonek{U}} - \DeclareUnicodeCharacter{0173}{\ogonek{u}} - \DeclareUnicodeCharacter{0174}{\^W} - \DeclareUnicodeCharacter{0175}{\^w} - \DeclareUnicodeCharacter{0176}{\^Y} - \DeclareUnicodeCharacter{0177}{\^y} - \DeclareUnicodeCharacter{0178}{\"Y} - \DeclareUnicodeCharacter{0179}{\'Z} - \DeclareUnicodeCharacter{017A}{\'z} - \DeclareUnicodeCharacter{017B}{\dotaccent{Z}} - \DeclareUnicodeCharacter{017C}{\dotaccent{z}} - \DeclareUnicodeCharacter{017D}{\v{Z}} - \DeclareUnicodeCharacter{017E}{\v{z}} - \DeclareUnicodeCharacter{017F}{\missingcharmsg{LONG S}} - - \DeclareUnicodeCharacter{01C4}{D\v{Z}} - \DeclareUnicodeCharacter{01C5}{D\v{z}} - \DeclareUnicodeCharacter{01C6}{d\v{z}} - \DeclareUnicodeCharacter{01C7}{LJ} - \DeclareUnicodeCharacter{01C8}{Lj} - \DeclareUnicodeCharacter{01C9}{lj} - \DeclareUnicodeCharacter{01CA}{NJ} - \DeclareUnicodeCharacter{01CB}{Nj} - \DeclareUnicodeCharacter{01CC}{nj} - \DeclareUnicodeCharacter{01CD}{\v{A}} - \DeclareUnicodeCharacter{01CE}{\v{a}} - \DeclareUnicodeCharacter{01CF}{\v{I}} - - \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}} - \DeclareUnicodeCharacter{01D1}{\v{O}} - \DeclareUnicodeCharacter{01D2}{\v{o}} - \DeclareUnicodeCharacter{01D3}{\v{U}} - \DeclareUnicodeCharacter{01D4}{\v{u}} - - \DeclareUnicodeCharacter{01E2}{\={\AE}} - \DeclareUnicodeCharacter{01E3}{\={\ae}} - \DeclareUnicodeCharacter{01E6}{\v{G}} - \DeclareUnicodeCharacter{01E7}{\v{g}} - \DeclareUnicodeCharacter{01E8}{\v{K}} - \DeclareUnicodeCharacter{01E9}{\v{k}} - - \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}} - \DeclareUnicodeCharacter{01F1}{DZ} - \DeclareUnicodeCharacter{01F2}{Dz} - \DeclareUnicodeCharacter{01F3}{dz} - \DeclareUnicodeCharacter{01F4}{\'G} - \DeclareUnicodeCharacter{01F5}{\'g} - \DeclareUnicodeCharacter{01F8}{\`N} - \DeclareUnicodeCharacter{01F9}{\`n} - \DeclareUnicodeCharacter{01FC}{\'{\AE}} - \DeclareUnicodeCharacter{01FD}{\'{\ae}} - \DeclareUnicodeCharacter{01FE}{\'{\O}} - \DeclareUnicodeCharacter{01FF}{\'{\o}} - - \DeclareUnicodeCharacter{021E}{\v{H}} - \DeclareUnicodeCharacter{021F}{\v{h}} - - \DeclareUnicodeCharacter{0226}{\dotaccent{A}} - \DeclareUnicodeCharacter{0227}{\dotaccent{a}} - \DeclareUnicodeCharacter{0228}{\cedilla{E}} - \DeclareUnicodeCharacter{0229}{\cedilla{e}} - \DeclareUnicodeCharacter{022E}{\dotaccent{O}} - \DeclareUnicodeCharacter{022F}{\dotaccent{o}} - - \DeclareUnicodeCharacter{0232}{\=Y} - \DeclareUnicodeCharacter{0233}{\=y} - \DeclareUnicodeCharacter{0237}{\dotless{j}} - - \DeclareUnicodeCharacter{02DB}{\ogonek{ }} - - \DeclareUnicodeCharacter{1E02}{\dotaccent{B}} - \DeclareUnicodeCharacter{1E03}{\dotaccent{b}} - \DeclareUnicodeCharacter{1E04}{\udotaccent{B}} - \DeclareUnicodeCharacter{1E05}{\udotaccent{b}} - \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}} - \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}} - \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}} - \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}} - \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}} - \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}} - \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}} - \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}} - - \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}} - \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}} - - \DeclareUnicodeCharacter{1E20}{\=G} - \DeclareUnicodeCharacter{1E21}{\=g} - \DeclareUnicodeCharacter{1E22}{\dotaccent{H}} - \DeclareUnicodeCharacter{1E23}{\dotaccent{h}} - \DeclareUnicodeCharacter{1E24}{\udotaccent{H}} - \DeclareUnicodeCharacter{1E25}{\udotaccent{h}} - \DeclareUnicodeCharacter{1E26}{\"H} - \DeclareUnicodeCharacter{1E27}{\"h} - - \DeclareUnicodeCharacter{1E30}{\'K} - \DeclareUnicodeCharacter{1E31}{\'k} - \DeclareUnicodeCharacter{1E32}{\udotaccent{K}} - \DeclareUnicodeCharacter{1E33}{\udotaccent{k}} - \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}} - \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}} - \DeclareUnicodeCharacter{1E36}{\udotaccent{L}} - \DeclareUnicodeCharacter{1E37}{\udotaccent{l}} - \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}} - \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}} - \DeclareUnicodeCharacter{1E3E}{\'M} - \DeclareUnicodeCharacter{1E3F}{\'m} - - \DeclareUnicodeCharacter{1E40}{\dotaccent{M}} - \DeclareUnicodeCharacter{1E41}{\dotaccent{m}} - \DeclareUnicodeCharacter{1E42}{\udotaccent{M}} - \DeclareUnicodeCharacter{1E43}{\udotaccent{m}} - \DeclareUnicodeCharacter{1E44}{\dotaccent{N}} - \DeclareUnicodeCharacter{1E45}{\dotaccent{n}} - \DeclareUnicodeCharacter{1E46}{\udotaccent{N}} - \DeclareUnicodeCharacter{1E47}{\udotaccent{n}} - \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}} - \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}} - - \DeclareUnicodeCharacter{1E54}{\'P} - \DeclareUnicodeCharacter{1E55}{\'p} - \DeclareUnicodeCharacter{1E56}{\dotaccent{P}} - \DeclareUnicodeCharacter{1E57}{\dotaccent{p}} - \DeclareUnicodeCharacter{1E58}{\dotaccent{R}} - \DeclareUnicodeCharacter{1E59}{\dotaccent{r}} - \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}} - \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}} - \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}} - \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}} - - \DeclareUnicodeCharacter{1E60}{\dotaccent{S}} - \DeclareUnicodeCharacter{1E61}{\dotaccent{s}} - \DeclareUnicodeCharacter{1E62}{\udotaccent{S}} - \DeclareUnicodeCharacter{1E63}{\udotaccent{s}} - \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}} - \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}} - \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}} - \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}} - \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}} - \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}} - - \DeclareUnicodeCharacter{1E7C}{\~V} - \DeclareUnicodeCharacter{1E7D}{\~v} - \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}} - \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}} - - \DeclareUnicodeCharacter{1E80}{\`W} - \DeclareUnicodeCharacter{1E81}{\`w} - \DeclareUnicodeCharacter{1E82}{\'W} - \DeclareUnicodeCharacter{1E83}{\'w} - \DeclareUnicodeCharacter{1E84}{\"W} - \DeclareUnicodeCharacter{1E85}{\"w} - \DeclareUnicodeCharacter{1E86}{\dotaccent{W}} - \DeclareUnicodeCharacter{1E87}{\dotaccent{w}} - \DeclareUnicodeCharacter{1E88}{\udotaccent{W}} - \DeclareUnicodeCharacter{1E89}{\udotaccent{w}} - \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}} - \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}} - \DeclareUnicodeCharacter{1E8C}{\"X} - \DeclareUnicodeCharacter{1E8D}{\"x} - \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}} - \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}} - - \DeclareUnicodeCharacter{1E90}{\^Z} - \DeclareUnicodeCharacter{1E91}{\^z} - \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}} - \DeclareUnicodeCharacter{1E93}{\udotaccent{z}} - \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}} - \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}} - \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}} - \DeclareUnicodeCharacter{1E97}{\"t} - \DeclareUnicodeCharacter{1E98}{\ringaccent{w}} - \DeclareUnicodeCharacter{1E99}{\ringaccent{y}} - - \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}} - \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}} - - \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}} - \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}} - \DeclareUnicodeCharacter{1EBC}{\~E} - \DeclareUnicodeCharacter{1EBD}{\~e} - - \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}} - \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}} - \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}} - \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}} - - \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}} - \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}} - - \DeclareUnicodeCharacter{1EF2}{\`Y} - \DeclareUnicodeCharacter{1EF3}{\`y} - \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}} - - \DeclareUnicodeCharacter{1EF8}{\~Y} - \DeclareUnicodeCharacter{1EF9}{\~y} - - \DeclareUnicodeCharacter{2013}{--} - \DeclareUnicodeCharacter{2014}{---} - \DeclareUnicodeCharacter{2018}{\quoteleft} - \DeclareUnicodeCharacter{2019}{\quoteright} - \DeclareUnicodeCharacter{201A}{\quotesinglbase} - \DeclareUnicodeCharacter{201C}{\quotedblleft} - \DeclareUnicodeCharacter{201D}{\quotedblright} - \DeclareUnicodeCharacter{201E}{\quotedblbase} - \DeclareUnicodeCharacter{2020}{\ensuremath\dagger} - \DeclareUnicodeCharacter{2021}{\ensuremath\ddagger} - \DeclareUnicodeCharacter{2022}{\bullet} - \DeclareUnicodeCharacter{2026}{\dots} - \DeclareUnicodeCharacter{2039}{\guilsinglleft} - \DeclareUnicodeCharacter{203A}{\guilsinglright} - \DeclareUnicodeCharacter{20AC}{\euro} - - \DeclareUnicodeCharacter{2192}{\expansion} - \DeclareUnicodeCharacter{21D2}{\result} - - \DeclareUnicodeCharacter{2212}{\minus} - \DeclareUnicodeCharacter{2217}{\point} - \DeclareUnicodeCharacter{2225}{\ensuremath\parallel} - \DeclareUnicodeCharacter{2261}{\equiv} -}% end of \utfeightchardefs +% UTF-8 byte sequence (pdfTeX) definitions (replacing and @U command) +% It makes the setting that replace UTF-8 byte sequence. +\def\utfeightchardefs{% + \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterUTFviii + \unicodechardefs +} -% US-ASCII character definitions. -\def\asciichardefs{% nothing need be done - \relax +% Whether the active definitions of non-ASCII characters expand to +% non-active tokens with the same character code. This is used to +% write characters literally, instead of using active definitions for +% printing the correct glyphs. +\newif\ifpassthroughchars +\passthroughcharsfalse + +% For native Unicode handling (XeTeX and LuaTeX), +% provide a definition macro to replace/pass-through a Unicode character +% +\def\DeclareUnicodeCharacterNative#1#2{% + \catcode"#1=\active + \def\dodeclareunicodecharacternative##1##2##3{% + \begingroup + \uccode`\~="##2\relax + \uppercase{\gdef~}{% + \ifpassthroughchars + ##1% + \else + ##3% + \fi + } + \endgroup + } + \begingroup + \uccode`\.="#1\relax + \uppercase{\def\UTFNativeTmp{.}}% + \expandafter\dodeclareunicodecharacternative\UTFNativeTmp{#1}{#2}% + \endgroup } -% Latin1 (ISO-8859-1) character definitions. -\def\nonasciistringdefs{% - \setnonasciicharscatcode\active - \def\defstringchar##1{\def##1{\string##1}}% - % - \defstringchar^^80\defstringchar^^81\defstringchar^^82\defstringchar^^83% - \defstringchar^^84\defstringchar^^85\defstringchar^^86\defstringchar^^87% - \defstringchar^^88\defstringchar^^89\defstringchar^^8a\defstringchar^^8b% - \defstringchar^^8c\defstringchar^^8d\defstringchar^^8e\defstringchar^^8f% - % - \defstringchar^^90\defstringchar^^91\defstringchar^^92\defstringchar^^93% - \defstringchar^^94\defstringchar^^95\defstringchar^^96\defstringchar^^97% - \defstringchar^^98\defstringchar^^99\defstringchar^^9a\defstringchar^^9b% - \defstringchar^^9c\defstringchar^^9d\defstringchar^^9e\defstringchar^^9f% - % - \defstringchar^^a0\defstringchar^^a1\defstringchar^^a2\defstringchar^^a3% - \defstringchar^^a4\defstringchar^^a5\defstringchar^^a6\defstringchar^^a7% - \defstringchar^^a8\defstringchar^^a9\defstringchar^^aa\defstringchar^^ab% - \defstringchar^^ac\defstringchar^^ad\defstringchar^^ae\defstringchar^^af% - % - \defstringchar^^b0\defstringchar^^b1\defstringchar^^b2\defstringchar^^b3% - \defstringchar^^b4\defstringchar^^b5\defstringchar^^b6\defstringchar^^b7% - \defstringchar^^b8\defstringchar^^b9\defstringchar^^ba\defstringchar^^bb% - \defstringchar^^bc\defstringchar^^bd\defstringchar^^be\defstringchar^^bf% - % - \defstringchar^^c0\defstringchar^^c1\defstringchar^^c2\defstringchar^^c3% - \defstringchar^^c4\defstringchar^^c5\defstringchar^^c6\defstringchar^^c7% - \defstringchar^^c8\defstringchar^^c9\defstringchar^^ca\defstringchar^^cb% - \defstringchar^^cc\defstringchar^^cd\defstringchar^^ce\defstringchar^^cf% - % - \defstringchar^^d0\defstringchar^^d1\defstringchar^^d2\defstringchar^^d3% - \defstringchar^^d4\defstringchar^^d5\defstringchar^^d6\defstringchar^^d7% - \defstringchar^^d8\defstringchar^^d9\defstringchar^^da\defstringchar^^db% - \defstringchar^^dc\defstringchar^^dd\defstringchar^^de\defstringchar^^df% - % - \defstringchar^^e0\defstringchar^^e1\defstringchar^^e2\defstringchar^^e3% - \defstringchar^^e4\defstringchar^^e5\defstringchar^^e6\defstringchar^^e7% - \defstringchar^^e8\defstringchar^^e9\defstringchar^^ea\defstringchar^^eb% - \defstringchar^^ec\defstringchar^^ed\defstringchar^^ee\defstringchar^^ef% - % - \defstringchar^^f0\defstringchar^^f1\defstringchar^^f2\defstringchar^^f3% - \defstringchar^^f4\defstringchar^^f5\defstringchar^^f6\defstringchar^^f7% - \defstringchar^^f8\defstringchar^^f9\defstringchar^^fa\defstringchar^^fb% - \defstringchar^^fc\defstringchar^^fd\defstringchar^^fe\defstringchar^^ff% +% Native Unicode handling (XeTeX and LuaTeX) character replacing definition. +% It activates the setting that replaces Unicode characters. +\def\nativeunicodechardefs{% + \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNative + \unicodechardefs +} + +% For native Unicode handling (XeTeX and LuaTeX), +% make the character token expand +% to the sequences given in \unicodechardefs for printing. +\def\DeclareUnicodeCharacterNativeAtU#1#2{% + \def\UTFAtUTmp{#2} + \expandafter\globallet\csname uni:#1\endcsname \UTFAtUTmp +} + +% @U command definitions for native Unicode handling (XeTeX and LuaTeX). +\def\nativeunicodechardefsatu{% + \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNativeAtU + \unicodechardefs } +% US-ASCII character definitions. +\def\asciichardefs{% nothing need be done + \relax +} -% define all the unicode characters we know about, for the sake of @U. -\utfeightchardefs +% define all Unicode characters we know about, for the sake of @U. +\iftxinativeunicodecapable + \nativeunicodechardefsatu +\else + \utfeightchardefs +\fi % Make non-ASCII characters printable again for compatibility with @@ -9945,12 +11255,12 @@ \advance\vsize by \topskip \outervsize = \vsize \advance\outervsize by 2\topandbottommargin - \pageheight = \vsize + \txipageheight = \vsize % \hsize = #2\relax \outerhsize = \hsize \advance\outerhsize by 0.5in - \pagewidth = \hsize + \txipagewidth = \hsize % \normaloffset = #4\relax \bindingoffset = #5\relax @@ -9962,6 +11272,13 @@ % whatever layout pdftex was dumped with. \pdfhorigin = 1 true in \pdfvorigin = 1 true in + \else + \ifx\XeTeXrevision\thisisundefined + \else + \pdfpageheight #7\relax + \pdfpagewidth #8\relax + % XeTeX does not have \pdfhorigin and \pdfvorigin. + \fi \fi % \setleading{\textleading} @@ -10149,26 +11466,25 @@ % this is not a problem. \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} -% Turn off all special characters except @ -% (and those which the user can use as if they were ordinary). +% Set catcodes for Texinfo file + +% Active characters for printing the wanted glyph. % Most of these we simply print from the \tt font, but for some, we can % use math or other variants that look better in normal text. - +% \catcode`\"=\active \def\activedoublequote{{\tt\char34}} \let"=\activedoublequote \catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde -\chardef\hat=`\^ -\catcode`\^=\active \def\activehat{{\tt \hat}} \let^ = \activehat +\chardef\hatchar=`\^ +\catcode`\^=\active \def\activehat{{\tt \hatchar}} \let^ = \activehat \catcode`\_=\active \def_{\ifusingtt\normalunderscore\_} -\let\realunder=_ -% Subroutine for the previous macro. \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } +\let\realunder=_ -\catcode`\|=\active -\def|{{\tt\char124}} +\catcode`\|=\active \def|{{\tt\char124}} \chardef \less=`\< \catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless @@ -10176,6 +11492,8 @@ \catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr \catcode`\+=\active \def+{{\tt \char 43}} \catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix +\catcode`\-=\active \let-=\normaldash + % used for headline/footline in the output routine, in case the page % breaks in the middle of an @tex block. @@ -10190,12 +11508,6 @@ % in principle, all other definitions in \tex have to be undone too. } -% If a .fmt file is being used, characters that might appear in a file -% name cannot be active until we have parsed the command line. -% So turn them off again, and have \everyjob (or @setfilename) turn them on. -% \otherifyactive is called near the end of this file. -\def\otherifyactive{\catcode`+=\other \catcode`\_=\other} - % Used sometimes to turn off (effectively) the active characters even after % parsing them. \def\turnoffactive{% @@ -10214,23 +11526,22 @@ % \doublebackslash is two of them (for the pdf outlines). {\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}} -% In texinfo, backslash is an active character; it prints the backslash +% In Texinfo, backslash is an active character; it prints the backslash % in fixed width font. \catcode`\\=\active % @ for escape char from now on. -% The story here is that in math mode, the \char of \backslashcurfont -% ends up printing the roman \ from the math symbol font (because \char -% in math mode uses the \mathcode, and plain.tex sets -% \mathcode`\\="026E). It seems better for @backslashchar{} to always -% print a typewriter backslash, hence we use an explicit \mathchar, +% Print a typewriter backslash. For math mode, we can't simply use +% \backslashcurfont: the story here is that in math mode, the \char +% of \backslashcurfont ends up printing the roman \ from the math symbol +% font (because \char in math mode uses the \mathcode, and plain.tex +% sets \mathcode`\\="026E). Hence we use an explicit \mathchar, % which is the decimal equivalent of "715c (class 7, e.g., use \fam; % ignored family value; char position "5C). We can't use " for the % usual hex value because it has already been made active. -@def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}} -@let@backslashchar = @normalbackslash % @backslashchar{} is for user documents. -% On startup, @fixbackslash assigns: -% @let \ = @normalbackslash +@def@ttbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}} +@let@backslashchar = @ttbackslash % @backslashchar{} is for user documents. + % \rawbackslash defines an active \ to do \backslashcurfont. % \otherbackslash defines an active \ to be a literal `\' character with % catcode other. We switch back and forth between these. @@ -10238,52 +11549,89 @@ @gdef@otherbackslash{@let\=@realbackslash} % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of -% the literal character `\'. Also revert - to its normal character, in -% case the active - from code has slipped in. +% the literal character `\'. % {@catcode`- = @active @gdef@normalturnoffactive{% - @nonasciistringdefs + @passthroughcharstrue @let-=@normaldash @let"=@normaldoublequote @let$=@normaldollar %$ font-lock fix @let+=@normalplus @let<=@normalless @let>=@normalgreater - @let\=@normalbackslash @let^=@normalcaret @let_=@normalunderscore @let|=@normalverticalbar @let~=@normaltilde + @let\=@ttbackslash @markupsetuplqdefault @markupsetuprqdefault @unsepspaces } } -% Make _ and + \other characters, temporarily. -% This is canceled by @fixbackslash. -@otherifyactive +% If a .fmt file is being used, characters that might appear in a file +% name cannot be active until we have parsed the command line. +% So turn them off again, and have @fixbackslash turn them back on. +@catcode`+=@other @catcode`@_=@other +% \enablebackslashhack - allow file to begin `\input texinfo' +% % If a .fmt file is being used, we don't want the `\input texinfo' to show up. % That is what \eatinput is for; after that, the `\' should revert to printing % a backslash. -% -@gdef@eatinput input texinfo{@fixbackslash} -@global@let\ = @eatinput +% If the file did not have a `\input texinfo', then it is turned off after +% the first line; otherwise the first `\' in the file would cause an error. +% This is used on the very last line of this file, texinfo.tex. +% We also use @c to call @fixbackslash, in case ends of lines are hidden. +{ +@catcode`@^=7 +@catcode`@^^M=13@gdef@enablebackslashhack{% + @global@let\ = @eatinput% + @catcode`@^^M=13% + @def@c{@fixbackslash@c}% + % Definition for the newline at the end of this file. + @def ^^M{@let^^M@secondlinenl}% + % Definition for a newline in the main Texinfo file. + @gdef @secondlinenl{@fixbackslash}% +}} + +{@catcode`@^=7 @catcode`@^^M=13% +@gdef@eatinput input texinfo#1^^M{@fixbackslash}} + +% Emergency active definition of newline, in case an active newline token +% appears by mistake. +{@catcode`@^=7 @catcode13=13% +@gdef@enableemergencynewline{% + @gdef^^M{% + @par% + %@par% +}}} + -% On the other hand, perhaps the file did not have a `\input texinfo'. Then -% the first `\' in the file would cause an error. This macro tries to fix -% that, assuming it is called before the first `\' could plausibly occur. -% Also turn back on active characters that might appear in the input -% file name, in case not using a pre-dumped format. -% @gdef@fixbackslash{% - @ifx\@eatinput @let\ = @normalbackslash @fi + @ifx\@eatinput @let\ = @ttbackslash @fi + @catcode13=5 % regular end of line + @enableemergencynewline + @let@c=@texinfoc + % Also turn back on active characters that might appear in the input + % file name, in case not using a pre-dumped format. @catcode`+=@active @catcode`@_=@active + % + % If texinfo.cnf is present on the system, read it. + % Useful for site-wide @afourpaper, etc. This macro, @fixbackslash, gets + % called at the beginning of every Texinfo file. Not opening texinfo.cnf + % directly in this file, texinfo.tex, makes it possible to make a format + % file for Texinfo. + % + @openin 1 texinfo.cnf + @ifeof 1 @else @input texinfo.cnf @fi + @closein 1 } + % Say @foo, not \foo, in error messages. @escapechar = `@@ @@ -10320,6 +11668,4 @@ @c vim:sw=2: -@ignore - arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115 -@end ignore +@enablebackslashhack diff -Nru datamash-1.0.7/build-aux/update-copyright datamash-1.1.1/build-aux/update-copyright --- datamash-1.0.7/build-aux/update-copyright 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/build-aux/update-copyright 2017-01-10 20:38:30.000000000 +0000 @@ -0,0 +1,274 @@ +eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" "$@"' + & eval 'exec perl -wS -0777 -pi "$0" $argv:q' + if 0; +# Update an FSF copyright year list to include the current year. + +my $VERSION = '2016-01-12.23:13'; # UTC + +# Copyright (C) 2009-2017 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Written by Jim Meyering and Joel E. Denny + +# The arguments to this script should be names of files that contain +# copyright statements to be updated. The copyright holder's name +# defaults to "Free Software Foundation, Inc." but may be changed to +# any other name by using the "UPDATE_COPYRIGHT_HOLDER" environment +# variable. +# +# For example, you might wish to use the update-copyright target rule +# in maint.mk from gnulib's maintainer-makefile module. +# +# Iff a copyright statement is recognized in a file and the final +# year is not the current year, then the statement is updated for the +# new year and it is reformatted to: +# +# 1. Fit within 72 columns. +# 2. Convert 2-digit years to 4-digit years by prepending "19". +# 3. Expand copyright year intervals. (See "Environment variables" +# below.) +# +# A warning is printed for every file for which no copyright +# statement is recognized. +# +# Each file's copyright statement must be formatted correctly in +# order to be recognized. For example, each of these is fine: +# +# Copyright @copyright{} 1990-2005, 2007-2009 Free Software +# Foundation, Inc. +# +# # Copyright (C) 1990-2005, 2007-2009 Free Software +# # Foundation, Inc. +# +# /* +# * Copyright © 90,2005,2007-2009 +# * Free Software Foundation, Inc. +# */ +# +# However, the following format is not recognized because the line +# prefix changes after the first line: +# +# ## Copyright (C) 1990-2005, 2007-2009 Free Software +# # Foundation, Inc. +# +# However, any correctly formatted copyright statement following +# a non-matching copyright statements would be recognized. +# +# The exact conditions that a file's copyright statement must meet +# to be recognized are: +# +# 1. It is the first copyright statement that meets all of the +# following conditions. Subsequent copyright statements are +# ignored. +# 2. Its format is "Copyright (C)", then a list of copyright years, +# and then the name of the copyright holder. +# 3. The "(C)" takes one of the following forms or is omitted +# entirely: +# +# A. (C) +# B. (c) +# C. @copyright{} +# D. © +# +# 4. The "Copyright" appears at the beginning of a line, except that it +# may be prefixed by any sequence (e.g., a comment) of no more than +# 5 characters -- including white space. +# 5. Iff such a prefix is present, the same prefix appears at the +# beginning of each remaining line within the FSF copyright +# statement. There is one exception in order to support C-style +# comments: if the first line's prefix contains nothing but +# whitespace surrounding a "/*", then the prefix for all subsequent +# lines is the same as the first line's prefix except with each of +# "/" and possibly "*" replaced by a " ". The replacement of "*" +# by " " is consistent throughout all subsequent lines. +# 6. Blank lines, even if preceded by the prefix, do not appear +# within the FSF copyright statement. +# 7. Each copyright year is 2 or 4 digits, and years are separated by +# commas or dashes. Whitespace may appear after commas. +# +# Environment variables: +# +# 1. If UPDATE_COPYRIGHT_FORCE=1, a recognized FSF copyright statement +# is reformatted even if it does not need updating for the new +# year. If unset or set to 0, only updated FSF copyright +# statements are reformatted. +# 2. If UPDATE_COPYRIGHT_USE_INTERVALS=1, every series of consecutive +# copyright years (such as 90, 1991, 1992-2007, 2008) in a +# reformatted FSF copyright statement is collapsed to a single +# interval (such as 1990-2008). If unset or set to 0, all existing +# copyright year intervals in a reformatted FSF copyright statement +# are expanded instead. +# If UPDATE_COPYRIGHT_USE_INTERVALS=2, convert a sequence with gaps +# to the minimal containing range. For example, convert +# 2000, 2004-2007, 2009 to 2000-2009. +# 3. For testing purposes, you can set the assumed current year in +# UPDATE_COPYRIGHT_YEAR. +# 4. The default maximum line length for a copyright line is 72. +# Set UPDATE_COPYRIGHT_MAX_LINE_LENGTH to use a different length. +# 5. Set UPDATE_COPYRIGHT_HOLDER if the copyright holder is other +# than "Free Software Foundation, Inc.". + +use strict; +use warnings; + +my $copyright_re = 'Copyright'; +my $circle_c_re = '(?:\([cC]\)|@copyright\{}|\\\\\(co|©)'; +my $holder = $ENV{UPDATE_COPYRIGHT_HOLDER}; +$holder ||= 'Free Software Foundation, Inc.'; +my $prefix_max = 5; +my $margin = $ENV{UPDATE_COPYRIGHT_MAX_LINE_LENGTH}; +!$margin || $margin !~ m/^\d+$/ + and $margin = 72; + +my $tab_width = 8; + +my $this_year = $ENV{UPDATE_COPYRIGHT_YEAR}; +if (!$this_year || $this_year !~ m/^\d{4}$/) + { + my ($sec, $min, $hour, $mday, $month, $year) = localtime (time ()); + $this_year = $year + 1900; + } + +# Unless the file consistently uses "\r\n" as the EOL, use "\n" instead. +my $eol = /(?:^|[^\r])\n/ ? "\n" : "\r\n"; + +my $leading; +my $prefix; +my $ws_re; +my $stmt_re; +while (/(^|\n)(.{0,$prefix_max})$copyright_re/g) + { + $leading = "$1$2"; + $prefix = $2; + if ($prefix =~ /^(\s*\/)\*(\s*)$/) + { + $prefix =~ s,/, ,; + my $prefix_ws = $prefix; + $prefix_ws =~ s/\*/ /; # Only whitespace. + if (/\G(?:[^*\n]|\*[^\/\n])*\*?\n$prefix_ws/) + { + $prefix = $prefix_ws; + } + } + $ws_re = '[ \t\r\f]'; # \s without \n + $ws_re = + "(?:$ws_re*(?:$ws_re|\\n" . quotemeta($prefix) . ")$ws_re*)"; + my $holder_re = $holder; + $holder_re =~ s/\s/$ws_re/g; + my $stmt_remainder_re = + "(?:$ws_re$circle_c_re)?" + . "$ws_re(?:(?:\\d\\d)?\\d\\d(?:,$ws_re?|-))*" + . "((?:\\d\\d)?\\d\\d)$ws_re$holder_re"; + if (/\G$stmt_remainder_re/) + { + $stmt_re = + quotemeta($leading) . "($copyright_re$stmt_remainder_re)"; + last; + } + } +if (defined $stmt_re) + { + /$stmt_re/ or die; # Should never die. + my $stmt = $1; + my $final_year_orig = $2; + + # Handle two-digit year numbers like "98" and "99". + my $final_year = $final_year_orig; + $final_year <= 99 + and $final_year += 1900; + + if ($final_year != $this_year) + { + # Update the year. + $stmt =~ s/\b$final_year_orig\b/$final_year, $this_year/; + } + if ($final_year != $this_year || $ENV{'UPDATE_COPYRIGHT_FORCE'}) + { + # Normalize all whitespace including newline-prefix sequences. + $stmt =~ s/$ws_re/ /g; + + # Put spaces after commas. + $stmt =~ s/, ?/, /g; + + # Convert 2-digit to 4-digit years. + $stmt =~ s/(\b\d\d\b)/19$1/g; + + # Make the use of intervals consistent. + if (!$ENV{UPDATE_COPYRIGHT_USE_INTERVALS}) + { + $stmt =~ s/(\d{4})-(\d{4})/join(', ', $1..$2)/eg; + } + else + { + $stmt =~ + s/ + (\d{4}) + (?: + (,\ |-) + ((??{ + if ($2 eq '-') { '\d{4}'; } + elsif (!$3) { $1 + 1; } + else { $3 + 1; } + })) + )+ + /$1-$3/gx; + + # When it's 2, emit a single range encompassing all year numbers. + $ENV{UPDATE_COPYRIGHT_USE_INTERVALS} == 2 + and $stmt =~ s/\b(\d{4})\b.*\b(\d{4})\b/$1-$2/; + } + + # Format within margin. + my $stmt_wrapped; + my $text_margin = $margin - length($prefix); + if ($prefix =~ /^(\t+)/) + { + $text_margin -= length($1) * ($tab_width - 1); + } + while (length $stmt) + { + if (($stmt =~ s/^(.{1,$text_margin})(?: |$)//) + || ($stmt =~ s/^([\S]+)(?: |$)//)) + { + my $line = $1; + $stmt_wrapped .= $stmt_wrapped ? "$eol$prefix" : $leading; + $stmt_wrapped .= $line; + } + else + { + # Should be unreachable, but we don't want an infinite + # loop if it can be reached. + die; + } + } + + # Replace the old copyright statement. + s/$stmt_re/$stmt_wrapped/; + } + } +else + { + print STDERR "$ARGV: warning: copyright statement not found\n"; + } + +# Local variables: +# mode: perl +# indent-tabs-mode: nil +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "my $VERSION = '" +# time-stamp-format: "%:y-%02m-%02d.%02H:%02M" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "'; # UTC" +# End: diff -Nru datamash-1.0.7/build-aux/useless-if-before-free datamash-1.1.1/build-aux/useless-if-before-free --- datamash-1.0.7/build-aux/useless-if-before-free 2015-06-17 23:45:27.000000000 +0000 +++ datamash-1.1.1/build-aux/useless-if-before-free 2017-01-10 20:00:58.000000000 +0000 @@ -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' if 0; # Detect instances of "if (p) free (p);". # Likewise "if (p != 0)", "if (0 != p)", or with NULL; and with braces. -my $VERSION = '2012-01-06 07:23'; # UTC +my $VERSION = '2016-08-01 17:47'; # UTC # The definition above must lie within the first 8 lines in order # for the Emacs time-stamp write hook (at end) to update it. # If you change this file with Emacs, please let the write hook # do its job. Otherwise, update this string manually. -# Copyright (C) 2008-2015 Free Software Foundation, Inc. +# Copyright (C) 2008-2017 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -129,6 +129,9 @@ $err = EXIT_ERROR, next; while (defined (my $line = )) { + # Skip non-matching lines early to save time + $line =~ /\bif\b/ + or next; while ($line =~ /\b(if\s*\(\s*([^)]+?)(?:\s*!=\s*([^)]+?))?\s*\) # 1 2 3 @@ -202,6 +205,6 @@ ## eval: (add-hook 'write-file-hooks 'time-stamp) ## time-stamp-start: "my $VERSION = '" ## time-stamp-format: "%:y-%02m-%02d %02H:%02M" -## time-stamp-time-zone: "UTC" +## time-stamp-time-zone: "UTC0" ## time-stamp-end: "'; # UTC" ## End: diff -Nru datamash-1.0.7/build-aux/vc-list-files datamash-1.1.1/build-aux/vc-list-files --- datamash-1.0.7/build-aux/vc-list-files 2015-06-17 23:45:27.000000000 +0000 +++ datamash-1.1.1/build-aux/vc-list-files 2017-01-10 20:00:58.000000000 +0000 @@ -2,9 +2,9 @@ # List version-controlled file names. # Print a version string. -scriptversion=2011-05-16.22; # UTC +scriptversion=2016-01-11.22; # UTC -# Copyright (C) 2006-2015 Free Software Foundation, Inc. +# Copyright (C) 2006-2017 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -108,6 +108,6 @@ # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff -Nru datamash-1.0.7/cfg.mk datamash-1.1.1/cfg.mk --- datamash-1.0.7/cfg.mk 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/cfg.mk 2017-01-17 17:50:20.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2014-2015 Assaf Gordon +# Copyright (C) 2014-2017 Assaf Gordon # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without @@ -10,7 +10,8 @@ # # Syntax-Check rules (sc_XXX) copied from GNU Coreutils' cfg.mk file: -# Copyright (C) 2003-2014 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, +# 2012, 2013, 2014, 2017 Free Software Foundation, Inc. # # Syntax-checks to skip: @@ -25,6 +26,11 @@ # updated by 'update-NEWS-hash' rule. old_NEWS_hash = d41d8cd98f00b204e9800998ecf8427e +update-copyright-env = \ + env \ + UPDATE_COPYRIGHT_HOLDER='Assaf Gordon' \ + UPDATE_COPYRIGHT_USE_INTERVALS=2 + # Helper rules to compile with Debian-Hardening flags @@ -71,7 +77,7 @@ static-analysis-make: static-analysis-have-prog $(MAKE) clean - scan-build make + scan-build make CFLAGS="-g -O0 -std=c99" static-analysis: static-analysis-configure static-analysis-make diff -Nru datamash-1.0.7/ChangeLog datamash-1.1.1/ChangeLog --- datamash-1.0.7/ChangeLog 2015-06-22 00:27:46.000000000 +0000 +++ datamash-1.1.1/ChangeLog 2017-01-19 20:05:43.000000000 +0000 @@ -1,3 +1,524 @@ +2017-01-19 Assaf Gordon + + maint: update bootstrap script to latest + * bootstrap: Copy latest version from gnulib/build-aux/bootstrap. + + maint: update NEWS + + gnulib: update to latest + +2017-01-10 Assaf Gordon + + build: fix out-of-tree builds without dep-tracking + Create src,lib,doc,tests subdirectories at the end of + 'configure', preventing build problems when building out of tree + with --disable-dependency-tracking. + Inspired by sed's https://bugs.gnu.org/25371 . + + * configure.ac: Call AS_MKDIR_P() to create subdirectories. + +2017-01-10 Assaf Gordon + + maint: update copyright year to 2017 + Automatic update with 'make update-copyright'. + + maint: add gnulib's 'update-copyright' module + * bootstrap.conf: Add 'update-copyright'. + * cfg.mk: Define 'update-copyright-env' with relevant values for + 'make update-copyright' + + maint: update gnulib to latest + * m4/.gitignore: Ignore few more m4 files. + +2016-09-22 Assaf Gordon + + doc: fix man page escapes + Suggested by Dave Love in + http://lists.gnu.org/archive/html/bug-datamash/2016-02/msg00002.html + +2016-09-22 Assaf Gordon + + datamash: bugfix: trailing delimiter should count as an empty field + In version 1.1.0 and earlier, trailing delimiter at the end of the line + did not count as an empty field: + + $ printf "a:b:\n" | datamash -t: check + 1 line, 2 fields + + After bugfix: + + $ printf "a:b:\n" | datamash -t: check + 1 line, 3 fields + + Related to bug report by Sanjeev Kumar Sharma in + http://lists.gnu.org/archive/html/bug-datamash/2016-09/msg00000.html + +2016-09-22 Assaf Gordon + + datamash: 'transpose' bugfix (missing values in last line) + Missing values in the last line would cause fields to be silently dropped: + + $ printf "1\t2\na\n" | datamash --no-strict transpose + 1 a + + After bugfix: + + $ printf "1\t2\na\n" | datamash --no-strict transpose + 1 a + 2 N/A + +2016-01-16 Assaf Gordon + + maint: update date in NEWS + * NEWS: update release version, metion version bump. + + doc: add 'field delimiters' section to manual + * doc/datamash.texi: add new 'field delimiters' section. + +2016-01-02 Assaf Gordon + + maint: update gnulib to latest version + * gnulib: update to latest version with copyright year adjusted + * tests/init.sh, + bootstrap: sync with latest gnulib. + + maint: update all copyright year number ranges + +2015-12-31 Assaf Gordon + + maint: rename pmccabe makefile target name + * Makefile.am: rename 'CYCLO_SOURCES' to 'cyclo_sources', to avoid + confusing autoreconf about missing library 'CYCLO'. + + doc: add rounding,binning sections to manual + + doc: add 'crosstab' section to manual + + doc: add 'check' usage example + + doc: add 'groupby on /etc/passwd' usage example section + + doc: merge reverse+transpose nodes + + doc: added 'Usage Examples' chapter + + doc: reword 'overview' section + + doc: add custom CSS to the texinfo HTML output + * doc/datamash-texinfo.css: new custom styles + * doc/local.mk: use new CSS file in 'make html' + * Makefile.am: use new CSS file in 'make web-manual' + + doc: update manual with new operations + +2015-12-25 Benno Schulenberg + + datamash: improve an error message + + datamash: gettextize an option description as a whole + + datamash: remove redundant header, and refer correctly to the man page + + datamash: improve the punctuation and grammar of the usage text + +2015-12-19 Assaf Gordon + + doc: update NEWS for upcoming version + + maint: update gnulib submodule to latest version + +2015-12-17 Assaf Gordon + + datamash: new operation: strbin (binning strings to numeric value) + hashes a text string into a number, returns values from 0 to #bins + (default 10). Can be used to bin many free-text input values into a + finite (small) set of bins. Identical strings will be hashed to same + numeric values. + + Examples: + assign a bin (0 to 9) to a list of strings (bin number added + as last field): + + seq 100 | xargs printf "user-%d\n" \ + | datamash --full strbin 1 + + identical input values will be assigned identical bin number: + + ( seq 100 ; seq 20 ) | xargs printf "user-%d\n" \ + | datamash --full strbin 1 + + Splitting input values into 10 output files, while keeping + identical keys in the same file: + + ( seq 100 ; seq 20 ) | xargs printf "user-%d\n" \ + | datamash --full strbin 1 \ + | awk '{print $0 > $NF ".txt"}' + + * bootstrap.conf: add gnulib's hash-pjw-bare module + * src/op-defs.{c,h}: add new op constant + * src/field-ops.{c,h}: implement new operation + * src/op-parser.c: strbin can take a parameter (# bins) + * src/datamash.c: update usage() + * man/datamash.x: update man page + * contrib/bash-completion/datamash: add new op + * tests/datamash-error-msgs.pl, + tests/datanash-strbin: test new operation + * Makefile.am: add new tests + +2015-12-17 Assaf Gordon + + maint: use gnulib's pmccabe2html module + Generate report with: + make cyclo-datamash.html + + * bootstrap.conf: add the pmccabe2html module + * Makefile.am: add new target + * .gitignore: ignore generated html file + +2015-11-12 Assaf Gordon + + maint: remove superfluous 'with' from doc's "invariant section" + pointed by Debian/Ubuntu package maintainer (alejandro@debian.org). + + * doc/datamash.texi: remove 'with' from 'invariant section' of GFDL + to comply with official wording. + +2015-07-13 Assaf Gordon + + build: prefer %PRIuMAX to %zu in printf + %zu doesn't play well with mingw cross-compilers. + + * src/column-headers.c, src/op-parser.c: include , + use %PRIuMAX instead of '%zu' in printf . + +2015-07-13 Assaf Gordon + + build: add gnulib's stpcpy module (for mingw) + * bootstrap.conf: add stpcpy. + +2015-07-13 Assaf Gordon + + datamash: fail on invalid cov/pearson input + Unequal number of items can occur if ignoring N/A values. + + * src/field-ops.c: fail if the two fields have different number of + items. + * tests/datamash-pair-tests.pl: tests such inputs. + +2015-07-13 Assaf Gordon + + datamash: fail on incorrect usage + * src/op-parser.c: fail when primary operations are given fields + ranges or pairs (e.g. 'groupby 1:2'). fail when crosstab is + given more than one operation. + * tests/datamash-{crosstab,error-msgs,parser}.pl: add new tests. + + doc: improve man page (new ops, examples) + * man/datamash.x: mention new operations, + use 'field' instead of 'column', + add more examples, improve formatting. + + datamash: improve usage() + * src/datamash.c: improve usage(), mention new operations, + use 'field' instead of 'column'. + +2015-07-13 Assaf Gordon + + new operations: round,floor,ceil,trunc,frac + typical usage: + + $ (echo X ; seq -1 0.5 1 ) \ + | datamash -H --full round 1 floor 1 ceil 1 trunc 1 frac 1 + X round(X) floor(X) ceil(X) trunc(X) frac(X) + -1.0 -1 -1 -1 -1 0 + -0.5 -1 -1 0 0 -0.5 + 0.0 0 0 0 0 0 + 0.5 1 0 1 0 0.5 + 1.0 1 1 1 1 0 + + * bootstrap.conf: add gnulib's floorl,ceill,roundl,modfl modules. + * src/op-defs.{c,h}: add new operations constants. + * src/field-ops.c: handle new operations. + * tests/datamash-tests-2.pl: add tests. + * contrib/bash-completion/datamash: add new operations. + +2015-07-13 Assaf Gordon + + utils: add functions for long-double zero handling + * src/utils.c: is_zero(), is_signed_zero() - retruns true/false. + pos_zero(): negates a negative zero, nop otherwise. + +2015-07-13 Assaf Gordon + + new operation: bin (binning into buckets) + typical usage (bin into buckets of size 5): + + $ seq 0 10 | ./datamash bin:5 1 + 0 + 0 + 0 + 0 + 0 + 5 + 5 + 5 + 5 + 5 + 10 + + * src/op-defs.{c,h}: add new operation constant and name. + * src/op-parser.c: special handling for operation with an optional + parameter. + * src/field-ops.h: add optional parameter to struct fieldop. + * src/field-ops.c: implement binning operation. + * tests/*.pl: add tests + +2015-07-13 Assaf Gordon + + datamash: reword error messages + * src/op-parser.c: use 'field' instead 'column', standarize error + messages. + * tests/*.pl: adapt tests to new wording. + +2015-07-13 Assaf Gordon + + build: fix long-double precision under NetBSD + Under NetBSD (and others?) default precision is set to 'double' + even for 'long double' variables. This results in incorrect + results for 'roundl' and crahes for 'expl' (when using + gnulib's implementations. + Force 'long double' precision. See gnulib's 'lib/fpucw.h' file + for many more details. + + * bootstrap.conf: add fpucw module. + * src/datamash.c: force 'long double' precision. + +2015-07-13 Assaf Gordon + + tests: add rmdup expensive tests + * src/datamash.c: add undocumented option to reduce initial size of + rmdup structures (forcing more frequent reallocations). + * tests/datamash-valgrind.sh: use new option, validate results. + + tests: add pcov with header + * tests/datamash-pair-tests.pl: tests pcov (taking two fields) with + output headers (print 1 field, 1 header). + +2015-07-13 Assaf Gordon + + refactor: create new scanner module + Use proper tokenizing instead of relying on argc/argv 'tokens' with + ad-hoc string manipulation. In the future, this will allow accepting the + script as on string (like sed's -e). + + * bootstrap.conf: add gnulib's c-type module + * src/op-scanner.{c,h}: new scanner module, improved tokenizing. + * src/op-parser.c: use new scanner, support _STANDALONE_ mode for + quicker testing (without autotools,gnulib). + * src/op-defs.c: prefer name 'groupby' to 'grouping' when reporting errors. + * src/system.h: support_STANDALONE_ mode for + quicker testing (without autotools,gnulib). + * tests/datamash-{tests,parser,crosstab}.pl: adapt error message text + to new parser (no change in functionality). + * Makefile.am: include new scanner. + * po/POTFILES.in: include new scanner. + +2015-06-25 Assaf Gordon + + build: move 'assert.h' to 'system.h' + * src/op-defs.c: move 'assert.h' from here... + * src/system.h: to here. + avoids 'syntax-check' warings about including 'assert.h' without using + it (it is used indirectly with 'internal_error()' macro). + + build: conditionally include minmax.h + Don't include "lib/minmax.h" if MAX is already defined. + Seems redundant (per the comment in minmax.h), but tcc 0.9.26 still fails. + + maint: force -std=c99 with static analysis + * cfg.mk: force -std=c99 when using clang's scan-build program, as it + does not to do so automatically, and compliation fails. + + maint: improve configure messages + * configure.ac: simplify printing of examples directory; + print bash-completion directory. + +2015-06-25 Assaf Gordon + + datamash: improve,install bash-completion script + By default, script installed to program's datadir, e.g. + /usr/local/datamash/share/bash-completion.d/datamash + and the user can manually source it from ~/.bashrc. + + Optionally, can be installed to another location, e.g. + ./configure --with-bash-completion-dir=/etc/bash_completion.d + to be automatically loaded. + + * contrib/bash-completion/datamash: fix script, improve suggestions, + do not use '_init_completion' (not available in bash-comp<1.9) + * configure.ac: add option --with-bash-completion-dir + * Makefile.am: install script. + +2015-06-25 Assaf Gordon + + datamash: new operation: Pearson Correlation + usage (calculate pearson (population) correlation coefficient on fields 1,2): + datamash ppearson 1:2 < 1.txt + + * src/op-defs.{c,h}: new op enums. + * src/op-parser.c: handle new op. + * src/utils.{c,h}: implement pearson correlation function. + * src/field-ops.c: handle new op. + * tests/datamash-pair-tests.pl: add tests + +2015-06-25 Assaf Gordon + + datamash: new operation: covariance + usage (calculate population-covariance on fields 1,2): + datamash pcov 1:2 < 1.txt + + * src/op-defs.{c,h}: new op enums. + * src/op-parser.c: handle new operation, with special parsing for column + pairs (e.g. '1:2'). + * src/field-ops.{c,h}: implement new operation, and add master/slave + field-op options (as covariance is implemented as two linked field + ops, one for each column). + * src/datamash.c: skip 'slave' field-ops when printing. + * tests/datamash-parser.pl: test column-pairs parsing + * tests/datamash-pair-tests.pl: test column-pair operations. + * tests/datamash-valgrind.sh: test covariance operation. + * Makefile.am: include new tests. + +2015-06-25 Assaf Gordon + + datamash: utils: add covariance implementation + * src/utils.{c,h}: covariance_value() - new function. + +2015-06-25 Assaf Gordon + + datamash: improve parser, allow field range + allows: datamash sum 1-5,7-9 + + * src/op-parser.c: improve field parsing + * tests/datamash-parser.pl: add new tests + +2015-06-25 Assaf Gordon + + datamash: new feature: check + reports back number of lines,fields - or exit with failure if the input + lines do have have same number of fields. + + usage: + $ seq 10 | paste - - | datamash check + 5 lines, 2 fields + + $ seq 9 | paste - - | datamash check + line 4 (2 fields): + 7 8 + line 5 (1 fields): + 9 + ./datamash: check failed: line 5 has 1 fields (previous line had 2) + + * src/datamash.c: tabular_check_file() - new function. + * src/op-defs.{h,c}: new mode enum. + * src/op-parser.c: handle new mode. + * tests/datamash-check-tabular.pl: add tests. + * Makefile.am: add new test file. + +2015-06-25 Assaf Gordon + + maint: git-ignore more files + +2015-06-25 Assaf Gordon + + datamash: new feature: crosstab + usage: + datamash crosstab 1,2 sum 3 + + * src/crosstab.{c,h} - implementation + * src/datamash.c - handle new crosstab processing mode. + * src/op-defs.{c,h} - additional crossab constants. + * src/op-parser.c - special handling for crosstab mode. + * tests/datamash-crosstab.pl - new tests. + * Makefile.am - add new files. + +2015-06-25 Assaf Gordon + + maint: add GL_ATTRIBUTE_PURE where needed + + maint: fix NEWS syntax-check + * NEWS: add missing empty line. + +2015-06-25 Assaf Gordon + + maint: add coverage hints + 1. Add LCOV_EXCL_BR_LINE to skip few switch cases where the default case + should never be reached. + 2. Add LCOV_EXCL_LINE. + + LCOV_EXCL_BR_LINE requires geninfo from lcov>=1.11 . + +2015-06-25 Assaf Gordon + + maint: remove unused strcnt module + + datamash: improve parser module, add tests + * src/datamash.c: remove redundant left-over code. + * src/op-parser.c: improve token processing + * src/op-defs.c: rename 'grp' alias to 'gb' (=groupby) + * tests/datamash-parser.pl: new tests + * Makefile.am: add new tests. + + maint: fix syntax-check errors + + datamash: move config vars to text-options + * src/datamash.c,src/field-ops.c: move several configuration + parameters from here ... + * src/text-options.{c,h}: ... to here. + + maint: fix empty variable init + * src/field-ops.c: CLANG complained about '{0}'. replace with memset(). + + refactor: move field-operation list. + * src/field-ops.{c,h}: refactored to handle just one struct at a time. + private functions removed from the header file. + * src/op-parser.{c,h}: the list of field-ops is handled here. + * src/datamash.c: adapted as needed. + +2015-06-25 Assaf Gordon + + refactor: create parsing module + 1. Better handling of processing modes (e.g. group-by/transpose/reverse/rmdup) + vs operations (e.g sum/count/min/max/mean). + 2. Support new syntax: + datamash groupby 1,2 sum 3 + equivalent to: + datamash -g 1,2 sum 3 + + * src/op-defs.{c,h} - list of processing modes and operations. + * src/op-parser.{c,h} - parsing module. returns structure with parsed + information (mode, grouping fields, operations, etc.). + * src/op-fields.{c,h} - adapt to new parsing, remove old pasring functions. + * src/datamash.c - adapt to new parsing module. + * tests/*.pl - minor changes to error messages. + +2015-06-25 Assaf Gordon + + refactor: extract group-processing to a function + * src/datamash.c: + process_group(): new function to print/summarize each group. + + refactor: fields-ops printing + * src/field.ops{h,c}: + field_op_summarize_empty(), field_op_summarize(): + store results in 'op->out_buf', don't directly print to stdout. + summarize_field_ops(), field_op_print_empty_value(): + print buffer to stdout. + + refactor: print empty values (for testing) + * src/datamash.c: move empty value printing code from here ... + * src/field-ops.{h,c}: ... to new function field_op_print_empty_value(). + 2015-06-21 Assaf Gordon maint: add NEWS about 1.0.7 features @@ -38,6 +559,7 @@ On some systems (Centos7, Fedora21), Perl's Digest::MD5 is not installed by default (despite being official a core module). If so, skip the MD5 tests instead of failing. + * tests/datamash-md5.pl: separate tests file for MD5. * tests/datamash-tests{,-2}.pl: don't use Digest::MD5 by default. * Makefile.am: add the new test file @@ -49,6 +571,7 @@ 'nan' or 'NaN'. printf(Infinity) can be 'inf', 'Inf', 'Infinity'. Instead of guessing it, add undocumented option to print the value on the current system. + * src/datamash.c: add undocumented options to print the values of inf/nan/progname. * tests/datamash-{tests,tests-2,stats}.pl: use the undocumented @@ -79,6 +602,7 @@ datamash: new option '--narm': ignore NA/NaN values Suggested by Brandon Invergo: http://lists.gnu.org/archive/html/bug-datamash/2014-11/msg00002.html + * src/utils.{h,c}: is_na() new function * src/field-ops.{c,h}: field_op_collect(): detect and skip NA/NaN values. @@ -95,26 +619,34 @@ in file names of tests. Also remove two unrelated file names (left-overs from 'coreutils') +2014-10-05 A. Gordon + datamash: keep correct lines with '--full' Discussed in https://github.com/agordon/datamash/issues/3 , and also existed in (very) old revisions of 'calc'. + When using a selection operation (first/last/min/max/etc) which selects one line out of the group, and combining with --full, this ensures the correct line is selected (not just the correct fields intemixed with the values of the first line). + * src/datamash.c: keep the correct line * src/field-ops.{c,h}: for selection operation, determine whether to keep the line or not. * src/datamash-tests.pl: adapt one test of 'lst' to new behavior. * src/datamash-tests-2.pl: tests new --full behavour +2014-10-05 A. Gordon + maint: add 'static-analysis' make target Example: make static-analysis or: make static-analysis-configure make static-analysis-make + Uses clang's scan-build static analysis tool to analyze the code. + Use the two-step method to change code and re-analyze without re-runnning './configure' again. @@ -156,9 +688,12 @@ Examples: datamash -H sum price < input.txt (If 'input.txt' has a column named 'price'). + datamash -H -g id sum 2 < FILE (assuming FILE has column named 'id') + Suggested by Shaun Jackman (sjackman@gmail.com). + * bootstrap.conf: use gnulib's xstrndup module. * src/field-ops.{h,c}: if column parameter is not a valid number, keep parameter as string, and defer finding the number to later. @@ -174,6 +709,8 @@ add new tests for this feature. * man/datamash.x: add named-columns examples. +2014-08-12 Assaf Gordon + maint: improve 'syntax-check' 2014-08-08 A. Gordon @@ -238,11 +775,14 @@ * src/text-lines.c: line_record_parse_fields(): revise code in case of single-character delimiter. +2014-08-08 A. Gordon + datamash: new operations: rmdup, noop rmdup: remove lines based on duplicated keys. Similar to: awk '!a[$1]++' noop: no-operation (optionally with --full: print file as-is). Used for testing and profiling. + * bootstrap.conf: use gnulib's hash module. * src/field-ops.{c,h}: add new operations * src/utils.{h,c}: @@ -254,6 +794,8 @@ * tests/datamash-valgrind.sh: test 'rmdup' operation with large input. * man/datamash.x: mention new operation, add example. +2014-08-08 A. Gordon + maint: improve syntax-check * src/field-ops.c: replace tabs with spaces. @@ -294,6 +836,7 @@ Field-splitting by delimiter is performed once, automatically, when a line is read. Pointers to each field are stored in 'line_record_t'. + * src/text-lines.{c,h}: implement 'line_record_t' functionality. * src/datamash.c: replace 'linebuffer' with 'line_record_t' . * src/column-headers.{c,h}: use new functionality. @@ -322,10 +865,12 @@ datamash: new line operations: md5/sha*, base64 Line-Operations work on each line on the file (no grouping by key). + Example: md5 on the first column on a file: datamash md5 1 < FILE Is similar to: perl -MDigest::MD5=md5_hex -lane 'print md5_hex($F[0])' < FILE + * bootstrap.conf: add gnulib's md5/sha*/base64 modules * src/field-ops.{c,h}: implement new operations * src/datamash.c: @@ -373,18 +918,25 @@ When building with cross-compiling AND running (non-native) binary locally with qemu/binfmt, the argv[0] (binary name) is changed by qemu. argv[0] is used for error reporting. + Example with most systems, argv[0] is exactly the same as the user entered: $ datamash --foobar datamash: invalid option --foobar + $ /custom/path/datamash --foobar /custom/path/datamash: invalid option --foobar + But under qemu/binfmt, argv[0] becomes the full path: + $ datamash --foobar /home/gordon/projects/datamash/datamash: invalid option --foobar + The tests were modified to detect the actual path reported by the program, or fall back to 'datamash' (as it was before). +2014-07-26 A. Gordon + maint: improve build-aux check scripts * renamed remote-make-check.sh => check-remote-make.sh * renamed remote-make-check-all.sh => check-remote-make-all.sh @@ -394,14 +946,19 @@ 3) building from git with './bootstrap' 4) command-line options to set parameters to env/configure/make +2014-07-26 A. Gordon + maint: improve debian-hardening build method * configure.ac: move option from './configure' to .. * cfg.mk: make rules. + Instead of: ./configure --enable-debian-hardenning Now use: make deb-hard +2014-07-26 A. Gordon + man page: improve hyphen vs minus characters * man/datamash.x: escape minus characters where needed, to distinguish between hyphens and minus/dash. @@ -514,10 +1071,13 @@ * man/help2man: Modify the EXAMPLES pattern detection to accept a single example. +2014-07-14 A. Gordon + build: don't hard-code Perl path in scripts * man/help2man - Use "/usr/bin/env perl" instead of "/usr/bin/perl". * tests/datamash-stats.pl - ditto * tests/datamash-tests.pl - ditto + Hard-coded Perl fails Hydra/NixOS builds (http://hydra.nixos.org/build/12516876), and is also generally bad form. @@ -660,11 +1220,16 @@ build: improve comment in configure.ac +2014-04-07 A. Gordon + build: Use compiler warnings from gl_WARN_ADD Those were wrongly dropped when changed to non-recursive makefile. + The new flags are used only with the 'compute' sources, but not with the gnulib sources. +2014-04-07 A. Gordon + compute: detect invalid suffix in numeric input. fields-ops: remove 'keep_lines' feature. diff -Nru datamash-1.0.7/config.in datamash-1.1.1/config.in --- datamash-1.0.7/config.in 2015-06-22 00:26:19.000000000 +0000 +++ datamash-1.1.1/config.in 2017-01-19 19:34:06.000000000 +0000 @@ -26,6 +26,9 @@ /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA +/* Define to 1 if the C locale may have encoding errors. */ +#undef C_LOCALE_MAYBE_EILSEQ + /* Define as the bit index in the word where to find bit 0 of the exponent of 'double'. */ #undef DBL_EXPBIT0_BIT @@ -94,6 +97,12 @@ /* Define to 1 when the gnulib module calloc-posix should be tested. */ #undef GNULIB_TEST_CALLOC_POSIX +/* Define to 1 when the gnulib module ceil should be tested. */ +#undef GNULIB_TEST_CEIL + +/* Define to 1 when the gnulib module ceill should be tested. */ +#undef GNULIB_TEST_CEILL + /* Define to 1 when the gnulib module expl should be tested. */ #undef GNULIB_TEST_EXPL @@ -103,14 +112,20 @@ /* Define to 1 when the gnulib module floor should be tested. */ #undef GNULIB_TEST_FLOOR +/* Define to 1 when the gnulib module floorl should be tested. */ +#undef GNULIB_TEST_FLOORL + /* Define to 1 when the gnulib module frexp should be tested. */ #undef GNULIB_TEST_FREXP /* Define to 1 when the gnulib module frexpl should be tested. */ #undef GNULIB_TEST_FREXPL -/* Define to 1 when the gnulib module getopt-gnu should be tested. */ -#undef GNULIB_TEST_GETOPT_GNU +/* Define to 1 when the gnulib module isfinite should be tested. */ +#undef GNULIB_TEST_ISFINITE + +/* Define to 1 when the gnulib module isinf should be tested. */ +#undef GNULIB_TEST_ISINF /* Define to 1 when the gnulib module isnanl should be tested. */ #undef GNULIB_TEST_ISNANL @@ -145,6 +160,12 @@ /* Define to 1 when the gnulib module memchr should be tested. */ #undef GNULIB_TEST_MEMCHR +/* Define to 1 when the gnulib module modf should be tested. */ +#undef GNULIB_TEST_MODF + +/* Define to 1 when the gnulib module modfl should be tested. */ +#undef GNULIB_TEST_MODFL + /* Define to 1 when the gnulib module random should be tested. */ #undef GNULIB_TEST_RANDOM @@ -166,6 +187,9 @@ /* Define to 1 when the gnulib module sqrtl should be tested. */ #undef GNULIB_TEST_SQRTL +/* Define to 1 when the gnulib module stpcpy should be tested. */ +#undef GNULIB_TEST_STPCPY + /* Define to 1 when the gnulib module strerror should be tested. */ #undef GNULIB_TEST_STRERROR @@ -181,6 +205,12 @@ /* Define to 1 when the gnulib module strtoull should be tested. */ #undef GNULIB_TEST_STRTOULL +/* Define to 1 when the gnulib module trunc should be tested. */ +#undef GNULIB_TEST_TRUNC + +/* Define to 1 when the gnulib module truncl should be tested. */ +#undef GNULIB_TEST_TRUNCL + /* Define to 1 when the gnulib module wcwidth should be tested. */ #undef GNULIB_TEST_WCWIDTH @@ -309,6 +339,14 @@ */ #undef HAVE_DECL_GETENV +/* Define to 1 if you have the declaration of `isfinite', and to 0 if you + don't. */ +#undef HAVE_DECL_ISFINITE + +/* Define to 1 if you have the declaration of `isinf', and to 0 if you don't. + */ +#undef HAVE_DECL_ISINF + /* Define to 1 if you have the declaration of `iswblank', and to 0 if you don't. */ #undef HAVE_DECL_ISWBLANK @@ -373,10 +411,22 @@ don't. */ #undef HAVE_DECL_TOWLOWER +/* Define to 1 if you have the declaration of `trunc', and to 0 if you don't. + */ +#undef HAVE_DECL_TRUNC + +/* Define to 1 if you have the declaration of `truncl', and to 0 if you don't. + */ +#undef HAVE_DECL_TRUNCL + /* Define to 1 if you have the declaration of `wcwidth', and to 0 if you don't. */ #undef HAVE_DECL_WCWIDTH +/* Define to 1 if you have the declaration of `__argv', and to 0 if you don't. + */ +#undef HAVE_DECL___ARGV + /* Define to 1 if you have the declaration of `__fpending', and to 0 if you don't. */ #undef HAVE_DECL___FPENDING @@ -393,12 +443,18 @@ /* Define if the frexpl() function is available. */ #undef HAVE_FREXPL +/* Define to 1 if you have the `getexecname' function. */ +#undef HAVE_GETEXECNAME + /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H /* Define to 1 if you have the `getopt_long_only' function. */ #undef HAVE_GETOPT_LONG_ONLY +/* Define to 1 if you have the `getprogname' function. */ +#undef HAVE_GETPROGNAME + /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT @@ -440,6 +496,9 @@ /* Define if the ldexpl() function is available. */ #undef HAVE_LDEXPL +/* Define to 1 if you have the header file. */ +#undef HAVE_LIMITS_H + /* Define to 1 if the system has the type 'long long int'. */ #undef HAVE_LONG_LONG_INT @@ -914,6 +973,9 @@ /* Define to 1 if pwrite is declared even after undefining macros. */ #undef HAVE_RAW_DECL_PWRITE +/* Define to 1 if qsort_r is declared even after undefining macros. */ +#undef HAVE_RAW_DECL_QSORT_R + /* Define to 1 if random is declared even after undefining macros. */ #undef HAVE_RAW_DECL_RANDOM @@ -1266,6 +1328,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H +/* Define to 1 if you have the `stpcpy' function. */ +#undef HAVE_STPCPY + /* Define to 1 if you have the `strerror_r' function. */ #undef HAVE_STRERROR_R @@ -1323,6 +1388,9 @@ /* Define to 1 if the system has the type 'unsigned long long int'. */ #undef HAVE_UNSIGNED_LONG_LONG_INT +/* Define if you have a global __progname variable */ +#undef HAVE_VAR___PROGNAME + /* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H @@ -1399,6 +1467,12 @@ /* Define if the mbrtowc function returns a wrong return value. */ #undef MBRTOWC_RETVAL_BUG +/* Use GNU style printf and scanf. */ +#ifndef __USE_MINGW_ANSI_STDIO +# undef __USE_MINGW_ANSI_STDIO +#endif + + /* Define to 1 if assertions should be disabled. */ #undef NDEBUG @@ -1432,9 +1506,6 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* the number of pending output bytes on stream 'fp' */ -#undef PENDING_OUTPUT_N_BYTES - /* Define if exists and defines unusable PRI* macros. */ #undef PRI_MACROS_BROKEN @@ -1477,7 +1548,7 @@ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif -/* Enable general extensions on OS X. */ +/* Enable general extensions on macOS. */ #ifndef _DARWIN_C_SOURCE # undef _DARWIN_C_SOURCE #endif @@ -1485,14 +1556,38 @@ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif -/* Use GNU style printf and scanf. */ -#ifndef __USE_MINGW_ANSI_STDIO -# undef __USE_MINGW_ANSI_STDIO -#endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif +/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ +#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ +#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ +# undef __STDC_WANT_IEC_60559_BFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ +#ifndef __STDC_WANT_IEC_60559_DFP_EXT__ +# undef __STDC_WANT_IEC_60559_DFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ +#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ +# undef __STDC_WANT_IEC_60559_FUNCS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ +#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ +# undef __STDC_WANT_IEC_60559_TYPES_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ +#ifndef __STDC_WANT_LIB_EXT2__ +# undef __STDC_WANT_LIB_EXT2__ +#endif +/* Enable extensions specified by ISO/IEC 24747:2009. */ +#ifndef __STDC_WANT_MATH_SPEC_FUNCS__ +# undef __STDC_WANT_MATH_SPEC_FUNCS__ +#endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE @@ -1571,6 +1666,12 @@ used. */ #undef __GETOPT_PREFIX +/* Define to 1 if the system predates C++11. */ +#undef __STDC_CONSTANT_MACROS + +/* Define to 1 if the system predates C++11. */ +#undef __STDC_LIMIT_MACROS + /* Please see the Gnulib manual for how to use these macros. Suppress extern inline with HP-UX cc, as it appears to be broken; see @@ -1617,6 +1718,7 @@ ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \ : (199901L <= __STDC_VERSION__ \ && !defined __HP_cc \ + && !defined __PGI \ && !(defined __SUNPRO_C && __STDC__))) \ && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) # define _GL_INLINE inline diff -Nru datamash-1.0.7/configure datamash-1.1.1/configure --- datamash-1.0.7/configure 2015-06-22 00:26:17.000000000 +0000 +++ datamash-1.1.1/configure 2017-01-19 19:34:05.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for GNU datamash 1.0.7. +# Generated by GNU Autoconf 2.69 for GNU datamash 1.1.1. # # Report bugs to . # @@ -580,8 +580,8 @@ # Identity of this package. PACKAGE_NAME='GNU datamash' PACKAGE_TARNAME='datamash' -PACKAGE_VERSION='1.0.7' -PACKAGE_STRING='GNU datamash 1.0.7' +PACKAGE_VERSION='1.1.1' +PACKAGE_STRING='GNU datamash 1.1.1' PACKAGE_BUGREPORT='assafgordon@gmail.com' PACKAGE_URL='http://www.gnu.org/software/datamash' @@ -622,6 +622,8 @@ # include #endif" +gl_ceil_required=plain +gl_ceill_required=plain with_openssl_default='no' LIB_CRYPTO= gl_roundl_required=plain @@ -631,8 +633,14 @@ gl_getopt_required=POSIX gl_getopt_required=POSIX ac_func_list= +gl_modf_required=plain +gl_trunc_required=plain +gl_modfl_required=plain +gl_truncl_required=plain gl_round_required=plain gl_roundl_required=plain +gl_trunc_required=plain +gl_truncl_required=plain gt_needs= ac_config_libobj_dir=lib ac_subst_vars='gltests_LTLIBOBJS @@ -662,6 +670,9 @@ PERL BUILD_FROM_GIT_FALSE BUILD_FROM_GIT_TRUE +ENABLE_BASH_COMPLETION_FALSE +ENABLE_BASH_COMPLETION_TRUE +BASH_COMPLETION_DIR WERROR_CFLAGS WARN_CFLAGS LIBDATAMASH_LTLIBDEPS @@ -810,7 +821,12 @@ STDALIGN_H SQRTL_LIBM SQRT_LIBM +PMCCABE HAVE_MSVC_INVALID_PARAMETER_HANDLER +TRUNCL_LIBM +MODFL_LIBM +TRUNC_LIBM +MODF_LIBM LOCALE_FR UNDEFINE_STRTOK_R REPLACE_STRTOK_R @@ -1019,6 +1035,8 @@ GNULIB_ISWCTYPE GNULIB_WCTYPE GNULIB_ISWBLANK +ISINF_LIBM +ISFINITE_LIBM NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H NEXT_INTTYPES_H UINT64_MAX_EQ_ULONG_MAX @@ -1040,6 +1058,9 @@ GL_GENERATE_STDINT_H_FALSE GL_GENERATE_STDINT_H_TRUE STDINT_H +HAVE_SYS_INTTYPES_H +HAVE_SYS_BITYPES_H +HAVE_C99_STDINT_H WINT_T_SUFFIX WCHAR_T_SUFFIX SIG_ATOMIC_T_SUFFIX @@ -1054,8 +1075,6 @@ BITSIZEOF_SIZE_T BITSIZEOF_PTRDIFF_T APPLE_UNIVERSAL_BUILD -HAVE_SYS_BITYPES_H -HAVE_SYS_INTTYPES_H HAVE_STDINT_H NEXT_AS_FIRST_DIRECTIVE_STDINT_H NEXT_STDINT_H @@ -1064,6 +1083,12 @@ HAVE_WCHAR_H HAVE_UNSIGNED_LONG_LONG_INT HAVE_LONG_LONG_INT +GNULIB_OVERRIDES_WINT_T +GL_GENERATE_LIMITS_H_FALSE +GL_GENERATE_LIMITS_H_TRUE +LIMITS_H +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H +NEXT_LIMITS_H NEXT_AS_FIRST_DIRECTIVE_ICONV_H NEXT_ICONV_H GL_GENERATE_ICONV_H_FALSE @@ -1123,6 +1148,7 @@ HAVE_DECL_GETUSERSHELL HAVE_DECL_GETPAGESIZE HAVE_DECL_GETLOGIN_R +HAVE_DECL_GETLOGIN HAVE_DECL_GETDOMAINNAME HAVE_DECL_FDATASYNC HAVE_DECL_FCHDIR @@ -1208,6 +1234,7 @@ GNULIB_CHDIR FREXPL_LIBM FREXP_LIBM +FLOORL_LIBM FLOOR_LIBM REPLACE_ITOLD GL_GENERATE_FLOAT_H_FALSE @@ -1223,11 +1250,43 @@ ROUNDL_LIBM ROUND_LIBM ISNANL_LIBM +EXP_LIBM +POW_LIBM +EOVERFLOW_VALUE +EOVERFLOW_HIDDEN +ENOLINK_VALUE +ENOLINK_HIDDEN +EMULTIHOP_VALUE +EMULTIHOP_HIDDEN +GL_GENERATE_ERRNO_H_FALSE +GL_GENERATE_ERRNO_H_TRUE +ERRNO_H +NEXT_AS_FIRST_DIRECTIVE_ERRNO_H +NEXT_ERRNO_H +NEXT_AS_FIRST_DIRECTIVE_CTYPE_H +NEXT_CTYPE_H +PRAGMA_COLUMNS +PRAGMA_SYSTEM_HEADER +INCLUDE_NEXT_AS_FIRST_DIRECTIVE +INCLUDE_NEXT +HAVE_ISBLANK +GNULIB_ISBLANK +LIB_CRYPTO +pkglibexecdir +runstatedir +lispdir +CEILL_LIBM HAVE_SAME_LONG_DOUBLE_AS_DOUBLE +CEIL_LIBM REPLACE_TRUNCL REPLACE_TRUNCF REPLACE_TRUNC +REPLACE_TANHF +REPLACE_TANF REPLACE_SQRTL +REPLACE_SQRTF +REPLACE_SINHF +REPLACE_SINF REPLACE_SIGNBIT_USING_GCC REPLACE_SIGNBIT REPLACE_ROUNDL @@ -1282,11 +1341,18 @@ REPLACE_EXP2 REPLACE_EXPM1F REPLACE_EXPM1 +REPLACE_EXPF +REPLACE_COSHF +REPLACE_COSF REPLACE_CEILL REPLACE_CEILF REPLACE_CEIL REPLACE_CBRTL REPLACE_CBRTF +REPLACE_ATAN2F +REPLACE_ATANF +REPLACE_ASINF +REPLACE_ACOSF HAVE_DECL_TRUNCL HAVE_DECL_TRUNCF HAVE_DECL_TRUNC @@ -1478,31 +1544,6 @@ GNULIB_ASINF GNULIB_ACOSL GNULIB_ACOSF -EXP_LIBM -POW_LIBM -EOVERFLOW_VALUE -EOVERFLOW_HIDDEN -ENOLINK_VALUE -ENOLINK_HIDDEN -EMULTIHOP_VALUE -EMULTIHOP_HIDDEN -GL_GENERATE_ERRNO_H_FALSE -GL_GENERATE_ERRNO_H_TRUE -ERRNO_H -NEXT_AS_FIRST_DIRECTIVE_ERRNO_H -NEXT_ERRNO_H -NEXT_AS_FIRST_DIRECTIVE_CTYPE_H -NEXT_CTYPE_H -PRAGMA_COLUMNS -PRAGMA_SYSTEM_HEADER -INCLUDE_NEXT_AS_FIRST_DIRECTIVE -INCLUDE_NEXT -HAVE_ISBLANK -GNULIB_ISBLANK -LIB_CRYPTO -pkglibexecdir -runstatedir -lispdir REPLACE_WCTOMB REPLACE_UNSETENV REPLACE_STRTOD @@ -1534,6 +1575,7 @@ HAVE_RANDOM_R HAVE_RANDOM_H HAVE_RANDOM +HAVE_QSORT_R HAVE_PTSNAME_R HAVE_PTSNAME HAVE_POSIX_OPENPT @@ -1597,6 +1639,7 @@ build RANLIB ARFLAGS +ac_ct_AR AR EGREP GREP @@ -1697,6 +1740,7 @@ with_packager_version with_packager_bug_reports enable_werror +with_bash_completion_dir enable_nls with_libintl_prefix ' @@ -2249,7 +2293,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures GNU datamash 1.0.7 to adapt to many kinds of systems. +\`configure' configures GNU datamash 1.1.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -2319,7 +2363,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of GNU datamash 1.0.7:";; + short | recursive ) echo "Configuration of GNU datamash 1.1.1:";; esac cat <<\_ACEOF @@ -2352,6 +2396,10 @@ --with-packager-version Packager-specific version information --with-packager-bug-reports Packager info for bug reports (URL/e-mail/...) + --with-bash-completion-dir=PATH + Install the bash auto-completion script in this + directory. For example, /etc/bash_completion.d + [default=datarootdir] --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib --without-libintl-prefix don't search for libintl in includedir and libdir @@ -2433,7 +2481,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -GNU datamash configure 1.0.7 +GNU datamash configure 1.1.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2853,6 +2901,52 @@ } # ac_fn_c_check_func +# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES +# --------------------------------------------- +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. +ac_fn_c_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +$as_echo_n "checking whether $as_decl_name is declared... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_decl + # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes @@ -3036,52 +3130,6 @@ } # ac_fn_c_compute_int -# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES -# --------------------------------------------- -# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR -# accordingly. -ac_fn_c_check_decl () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - as_decl_name=`echo $2|sed 's/ *(.*//'` - as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 -$as_echo_n "checking whether $as_decl_name is declared... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -#ifndef $as_decl_name -#ifdef __cplusplus - (void) $as_decl_use; -#else - (void) $as_decl_name; -#endif -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_decl - # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- # Tries to find if the field MEMBER exists in type AGGR, after including @@ -3142,7 +3190,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by GNU datamash $as_me 1.0.7, which was +It was created by GNU datamash $as_me 1.1.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3425,7 +3473,10 @@ as_fn_append ac_header_list " stdio_ext.h" gl_getopt_required=GNU as_fn_append ac_header_list " getopt.h" +as_fn_append ac_func_list " getprogname" +as_fn_append ac_func_list " getexecname" as_fn_append ac_header_list " iconv.h" +as_fn_append ac_header_list " limits.h" as_fn_append ac_header_list " wchar.h" as_fn_append ac_header_list " stdint.h" as_fn_append ac_header_list " inttypes.h" @@ -4034,7 +4085,7 @@ # Define the identity of the package. PACKAGE='datamash' - VERSION='1.0.7' + VERSION='1.1.1' cat >>confdefs.h <<_ACEOF @@ -5740,309 +5791,71 @@ EGREP="$ac_cv_path_EGREP" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +int +main () +{ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Minix Amsterdam compiler" >&5 -$as_echo_n "checking for Minix Amsterdam compiler... " >&6; } -if ${gl_cv_c_amsterdam_compiler+:} false; then : - $as_echo_n "(cached) " >&6 + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -#ifdef __ACK__ -Amsterdam -#endif +#include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "Amsterdam" >/dev/null 2>&1; then : - gl_cv_c_amsterdam_compiler=yes + $EGREP "memchr" >/dev/null 2>&1; then : + else - gl_cv_c_amsterdam_compiler=no + ac_cv_header_stdc=no fi rm -f conftest* - fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_amsterdam_compiler" >&5 -$as_echo "$gl_cv_c_amsterdam_compiler" >&6; } - if test -z "$AR"; then - if test $gl_cv_c_amsterdam_compiler = yes; then - AR='cc -c.a' - if test -z "$ARFLAGS"; then - ARFLAGS='-o' - fi - else - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -set dummy ${ac_tool_prefix}ar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AR="${ac_tool_prefix}ar" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + ac_cv_header_stdc=no fi - +rm -f conftest* fi -if test -z "$ac_cv_prog_AR"; then - ac_ct_AR=$AR - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_AR="ar" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_AR" = x; then - AR="ar" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -else - AR="$ac_cv_prog_AR" -fi - - if test -z "$ARFLAGS"; then - ARFLAGS='cru' - fi - fi - else - if test -z "$ARFLAGS"; then - ARFLAGS='cru' - fi - fi - - - if test -z "$RANLIB"; then - if test $gl_cv_c_amsterdam_compiler = yes; then - RANLIB=':' - else - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi - - fi - fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -6168,10 +5981,22 @@ $as_echo "#define _GNU_SOURCE 1" >>confdefs.h - $as_echo "#define __USE_MINGW_ANSI_STDIO 1" >>confdefs.h - $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + $as_echo "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h + + $as_echo "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h + + $as_echo "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h + + $as_echo "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h + + $as_echo "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h + + $as_echo "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h + + $as_echo "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h + $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 @@ -6229,1149 +6054,1887 @@ -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Minix Amsterdam compiler" >&5 +$as_echo_n "checking for Minix Amsterdam compiler... " >&6; } +if ${gl_cv_c_amsterdam_compiler+:} false; then : $as_echo_n "(cached) " >&6 else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __ACK__ +Amsterdam +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Amsterdam" >/dev/null 2>&1; then : + gl_cv_c_amsterdam_compiler=yes +else + gl_cv_c_amsterdam_compiler=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac +rm -f conftest* -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_amsterdam_compiler" >&5 +$as_echo "$gl_cv_c_amsterdam_compiler" >&6; } + + if test $gl_cv_c_amsterdam_compiler = yes; then + if test -z "$AR"; then + AR='cc -c.a' + fi + if test -z "$ARFLAGS"; then + ARFLAGS='-o' + fi + else + if test -n "$ac_tool_prefix"; then + for ac_prog in ar lib "link -lib" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + + test -n "$AR" && break + done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar lib "link -lib" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + test -n "$ac_ct_AR" && break +done + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi +: ${AR=ar} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 +$as_echo_n "checking the archiver ($AR) interface... " >&6; } +if ${am_cv_ar_interface+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu - # IEEE behaviour is the default on all CPUs except Alpha and SH - # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4 - # and the GCC 4.1.2 manual). - case "$host_cpu" in - alpha*) - # On Alpha systems, a compiler option provides the behaviour. - # See the ieee(3) manual page, also available at - # - if test -n "$GCC"; then - # GCC has the option -mieee. - # For full IEEE compliance (rarely needed), use option -mieee-with-inexact. - CPPFLAGS="$CPPFLAGS -mieee" + am_cv_ar_interface=ar + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int some_variable = 0; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 + (eval $am_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + am_cv_ar_interface=ar else - # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact. - # For full IEEE compliance (rarely needed), use option -ieee_with_inexact. - CPPFLAGS="$CPPFLAGS -ieee" - fi - ;; - sh*) - if test -n "$GCC"; then - # GCC has the option -mieee. - CPPFLAGS="$CPPFLAGS -mieee" + am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 + (eval $am_ar_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + am_cv_ar_interface=lib + else + am_cv_ar_interface=unknown + fi fi - ;; - esac + rm -f conftest.lib libconftest.a +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 +$as_echo "$am_cv_ar_interface" >&6; } +case $am_cv_ar_interface in +ar) + ;; +lib) + # Microsoft lib, so override with the ar-lib wrapper script. + # FIXME: It is wrong to rewrite AR. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__AR in this case, + # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something + # similar. + AR="$am_aux_dir/ar-lib $AR" + ;; +unknown) + as_fn_error $? "could not determine $AR interface" "$LINENO" 5 + ;; +esac - # Code from module absolute-header: - # Code from module alloca-opt: - # Code from module announce-gen: - # Code from module assert: - # Code from module assure: - # Code from module base64: - # Code from module bitrotate: - # Code from module c-ctype: - # Code from module c-strcase: - # Code from module c-strcaseeq: - # Code from module calloc-gnu: - # Code from module calloc-posix: - # Code from module close-stream: - # Code from module closeout: - # Code from module configmake: - # Code from module crypto/md5: - # Code from module crypto/sha1: - # Code from module crypto/sha256: - # Code from module crypto/sha512: - # Code from module ctype: - # Code from module dirname: - # Code from module dirname-lgpl: - # Code from module do-release-commit-and-tag: - # Code from module dosname: - # Code from module double-slash-root: - # Code from module errno: - # Code from module error: - # Code from module exitfail: - # Code from module exp: - # Code from module expl: - # Code from module extensions: - - # Code from module extern-inline: - # Code from module fabs: - # Code from module fabsl: - # Code from module fdl: - # Code from module float: - # Code from module floor: - # Code from module fpending: - # Code from module fpieee: - - # Code from module fpucw: - # Code from module frexp: - # Code from module frexpl: - # Code from module gendocs: - # Code from module getopt-gnu: - # Code from module getopt-posix: - # Code from module gettext: - # Code from module gettext-h: - # Code from module git-version-gen: - # Code from module gitlog-to-changelog: - # Code from module gnu-web-doc-update: - # Code from module gnumakefile: - # Code from module gnupload: - # Code from module gperf: - # Code from module hard-locale: - # Code from module hash: - # Code from module hash-pjw: - # Code from module havelib: - # Code from module iconv: - # Code from module iconv-h: - # Code from module iconv_open: - # Code from module ignore-value: - # Code from module include_next: - # Code from module inline: - # Code from module intprops: - # Code from module inttostr: - # Code from module inttypes: - # Code from module inttypes-incomplete: - # Code from module isblank: - # Code from module isnand-nolibm: - # Code from module isnanf-nolibm: - # Code from module isnanl: - # Code from module isnanl-nolibm: - # Code from module iswblank: - # Code from module ldexp: - # Code from module ldexpl: - # Code from module linebuffer: - # Code from module localcharset: - # Code from module locale: - # Code from module localeconv: - # Code from module maintainer-makefile: - # Code from module malloc-posix: - # Code from module malloca: - # Code from module math: - # Code from module mbchar: - # Code from module mbiter: - # Code from module mbrtowc: - # Code from module mbsinit: - # Code from module mbslen: - # Code from module mbsrtowcs: - # Code from module mbsstr: - # Code from module mbuiter: - # Code from module memchr: - # Code from module minmax: - # Code from module msvc-inval: - # Code from module msvc-nothrow: - # Code from module multiarch: - # Code from module nocrash: - # Code from module non-recursive-gnulib-prefix-hack: - # Code from module progname: - # Code from module propername: - # Code from module quotearg: - # Code from module quotearg-simple: - # Code from module random: - # Code from module random_r: - # Code from module readme-release: - # Code from module realloc-gnu: - # Code from module realloc-posix: - # Code from module round: - # Code from module roundl: - # Code from module signbit: - # Code from module size_max: - # Code from module snippet/_Noreturn: - # Code from module snippet/arg-nonnull: - # Code from module snippet/c++defs: - # Code from module snippet/unused-parameter: - # Code from module snippet/warn-on-use: - # Code from module sqrt: - # Code from module sqrtl: - # Code from module ssize_t: - # Code from module stdalign: - # Code from module stdarg: + fi + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - # Code from module stdbool: - # Code from module stddef: - # Code from module stdint: - # Code from module stdio: - # Code from module stdlib: - # Code from module stdnoreturn: - # Code from module streq: - # Code from module strerror: - # Code from module strerror-override: - # Code from module striconv: - # Code from module string: - # Code from module strndup: - # Code from module strnlen: - # Code from module strnlen1: - # Code from module strsep: - # Code from module strtoull: - # Code from module strtoumax: - # Code from module sys_types: - # Code from module trim: - # Code from module u64: - # Code from module unistd: - # Code from module unistr/base: - # Code from module unistr/u8-mbtoucr: - # Code from module unistr/u8-uctomb: - # Code from module unitypes: - # Code from module uniwidth/base: - # Code from module uniwidth/width: - # Code from module unlocked-io: - # Code from module useless-if-before-free: - # Code from module vc-list-files: - # Code from module verify: - # Code from module version-etc: - # Code from module warnings: - # Code from module wchar: - # Code from module wctype-h: - # Code from module wcwidth: - # Code from module xalloc: - # Code from module xalloc-die: - # Code from module xalloc-oversized: - # Code from module xstriconv: - # Code from module xstrndup: - # Code from module xstrtol: - # Code from module xstrtoumax: +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "x$ac_ct_AR" = x; then + AR="ar" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + if test -z "$ARFLAGS"; then + ARFLAGS='cr' + fi - LIBC_FATAL_STDERR_=1 - export LIBC_FATAL_STDERR_ -ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : + if test -z "$RANLIB"; then + if test $gl_cv_c_amsterdam_compiler = yes; then + RANLIB=':' + else + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF fi - -# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works -# for constant arguments. Useless! -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 -$as_echo_n "checking for working alloca.h... " >&6; } -if ${ac_cv_working_alloca_h+:} false; then : +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -char *p = (char *) alloca (2 * sizeof (int)); - if (p) return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_working_alloca_h=yes -else - ac_cv_working_alloca_h=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 -$as_echo "$ac_cv_working_alloca_h" >&6; } -if test $ac_cv_working_alloca_h = yes; then - -$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 -$as_echo_n "checking for alloca... " >&6; } -if ${ac_cv_func_alloca_works+:} false; then : - $as_echo_n "(cached) " >&6 + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __GNUC__ -# define alloca __builtin_alloca -#else -# ifdef _MSC_VER -# include -# define alloca _alloca -# else -# ifdef HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -void *alloca (size_t); -# endif -# endif -# endif -# endif -#endif +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -int -main () -{ -char *p = (char *) alloca (1); - if (p) return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_func_alloca_works=yes -else - ac_cv_func_alloca_works=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 -$as_echo "$ac_cv_func_alloca_works" >&6; } - -if test $ac_cv_func_alloca_works = yes; then - -$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h - +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } else - # The SVR3 libPW and SVR4 libucb both contain incompatible functions -# that cause trouble. Some versions do not even contain alloca or -# contain a buggy version. If you still want to use their alloca, -# use ar to extract alloca.o from them instead of compiling alloca.c. - - - + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi -ALLOCA=\${LIBOBJDIR}alloca.$ac_objext + fi + fi -$as_echo "#define C_ALLOCA 1" >>confdefs.h +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 -$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } -if ${ac_cv_os_cray+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if defined CRAY && ! defined CRAY2 -webecray -#else -wenotbecray -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "webecray" >/dev/null 2>&1; then : - ac_cv_os_cray=yes -else - ac_cv_os_cray=no -fi -rm -f conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 -$as_echo "$ac_cv_os_cray" >&6; } -if test $ac_cv_os_cray = yes; then - for ac_func in _getb67 GETB67 getb67; do - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define CRAY_STACKSEG_END $ac_func -_ACEOF + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 - break fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - done -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 -$as_echo_n "checking stack direction for C alloca... " >&6; } -if ${ac_cv_c_stack_direction+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then : - ac_cv_c_stack_direction=0 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -find_stack_direction (int *addr, int depth) -{ - int dir, dummy = 0; - if (! addr) - addr = &dummy; - *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; - dir = depth ? find_stack_direction (addr, depth - 1) : 0; - return dir + dummy; -} - -int -main (int argc, char **argv) -{ - return find_stack_direction (0, argc + !argv + 20) < 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_c_stack_direction=1 + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build else - ac_cv_c_stack_direction=-1 -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 -$as_echo "$ac_cv_c_stack_direction" >&6; } -cat >>confdefs.h <<_ACEOF -#define STACK_DIRECTION $ac_cv_c_stack_direction -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 -$as_echo_n "checking for C/C++ restrict keyword... " >&6; } -if ${ac_cv_c_restrict+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_c_restrict=no - # The order here caters to the fact that C++ does not require restrict. - for ac_kw in __restrict __restrict__ _Restrict restrict; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -typedef int *int_ptr; - int foo (int_ptr $ac_kw ip) { return ip[0]; } - int bar (int [$ac_kw]); /* Catch GCC bug 14050. */ - int bar (int ip[$ac_kw]) { return ip[0]; } -int -main () -{ -int s[1]; - int *$ac_kw t = s; - t[0] = 0; - return foo (t) + bar (t); - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_restrict=$ac_kw -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_restrict" != no && break - done - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 -$as_echo "$ac_cv_c_restrict" >&6; } - - case $ac_cv_c_restrict in - restrict) ;; - no) $as_echo "#define restrict /**/" >>confdefs.h - ;; - *) cat >>confdefs.h <<_ACEOF -#define restrict $ac_cv_c_restrict -_ACEOF - ;; - esac - - - GNULIB__EXIT=0; - GNULIB_ATOLL=0; - GNULIB_CALLOC_POSIX=0; - GNULIB_CANONICALIZE_FILE_NAME=0; - GNULIB_GETLOADAVG=0; - GNULIB_GETSUBOPT=0; - GNULIB_GRANTPT=0; - GNULIB_MALLOC_POSIX=0; - GNULIB_MBTOWC=0; - GNULIB_MKDTEMP=0; - GNULIB_MKOSTEMP=0; - GNULIB_MKOSTEMPS=0; - GNULIB_MKSTEMP=0; - GNULIB_MKSTEMPS=0; - GNULIB_POSIX_OPENPT=0; - GNULIB_PTSNAME=0; - GNULIB_PTSNAME_R=0; - GNULIB_PUTENV=0; - GNULIB_QSORT_R=0; - GNULIB_RANDOM=0; - GNULIB_RANDOM_R=0; - GNULIB_REALLOC_POSIX=0; - GNULIB_REALPATH=0; - GNULIB_RPMATCH=0; - GNULIB_SECURE_GETENV=0; - GNULIB_SETENV=0; - GNULIB_STRTOD=0; - GNULIB_STRTOLL=0; - GNULIB_STRTOULL=0; - GNULIB_SYSTEM_POSIX=0; - GNULIB_UNLOCKPT=0; - GNULIB_UNSETENV=0; - GNULIB_WCTOMB=0; - HAVE__EXIT=1; - HAVE_ATOLL=1; - HAVE_CANONICALIZE_FILE_NAME=1; - HAVE_DECL_GETLOADAVG=1; - HAVE_GETSUBOPT=1; - HAVE_GRANTPT=1; - HAVE_MKDTEMP=1; - HAVE_MKOSTEMP=1; - HAVE_MKOSTEMPS=1; - HAVE_MKSTEMP=1; - HAVE_MKSTEMPS=1; - HAVE_POSIX_OPENPT=1; - HAVE_PTSNAME=1; - HAVE_PTSNAME_R=1; - HAVE_RANDOM=1; - HAVE_RANDOM_H=1; - HAVE_RANDOM_R=1; - HAVE_REALPATH=1; - HAVE_RPMATCH=1; - HAVE_SECURE_GETENV=1; - HAVE_SETENV=1; - HAVE_DECL_SETENV=1; - HAVE_STRTOD=1; - HAVE_STRTOLL=1; - HAVE_STRTOULL=1; - HAVE_STRUCT_RANDOM_DATA=1; - HAVE_SYS_LOADAVG_H=0; - HAVE_UNLOCKPT=1; - HAVE_DECL_UNSETENV=1; - REPLACE_CALLOC=0; - REPLACE_CANONICALIZE_FILE_NAME=0; - REPLACE_MALLOC=0; - REPLACE_MBTOWC=0; - REPLACE_MKSTEMP=0; - REPLACE_PTSNAME=0; - REPLACE_PTSNAME_R=0; - REPLACE_PUTENV=0; - REPLACE_QSORT_R=0; - REPLACE_RANDOM_R=0; - REPLACE_REALLOC=0; - REPLACE_REALPATH=0; - REPLACE_SETENV=0; - REPLACE_STRTOD=0; - REPLACE_UNSETENV=0; - REPLACE_WCTOMB=0; - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether malloc, realloc, calloc are POSIX compliant" >&5 -$as_echo_n "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; } -if ${gl_cv_func_malloc_posix+:} false; then : - $as_echo_n "(cached) " >&6 -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main () -{ -#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ - choke me - #endif + # IEEE behaviour is the default on all CPUs except Alpha and SH + # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4 + # and the GCC 4.1.2 manual). + case "$host_cpu" in + alpha*) + # On Alpha systems, a compiler option provides the behaviour. + # See the ieee(3) manual page, also available at + # + if test -n "$GCC"; then + # GCC has the option -mieee. + # For full IEEE compliance (rarely needed), use option -mieee-with-inexact. + CPPFLAGS="$CPPFLAGS -mieee" + else + # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact. + # For full IEEE compliance (rarely needed), use option -ieee_with_inexact. + CPPFLAGS="$CPPFLAGS -ieee" + fi + ;; + sh*) + if test -n "$GCC"; then + # GCC has the option -mieee. + CPPFLAGS="$CPPFLAGS -mieee" + fi + ;; + esac - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_func_malloc_posix=yes -else - gl_cv_func_malloc_posix=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_malloc_posix" >&5 -$as_echo "$gl_cv_func_malloc_posix" >&6; } + # Pre-early section. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 -$as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if ${ac_cv_c_bigendian+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_c_bigendian=unknown - # See if we're dealing with a universal compiler. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __APPLE_CC__ - not a universal capable compiler - #endif - typedef int dummy; -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - # Check for potential -arch flags. It is not universal unless - # there are at least two -arch flags with different values. - ac_arch= - ac_prev= - for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do - if test -n "$ac_prev"; then - case $ac_word in - i?86 | x86_64 | ppc | ppc64) - if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then - ac_arch=$ac_word - else - ac_cv_c_bigendian=universal - break - fi - ;; - esac - ac_prev= - elif test "x$ac_word" = "x-arch"; then - ac_prev=arch - fi - done -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test $ac_cv_c_bigendian = unknown; then - # See if sys/param.h defines the BYTE_ORDER macro. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - #include -int -main () -{ -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ - && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ - && LITTLE_ENDIAN) - bogus endian macros - #endif + # Code from module absolute-header: + # Code from module alloca-opt: + # Code from module announce-gen: + # Code from module assert: + # Code from module assure: + # Code from module base64: + # Code from module bitrotate: + # Code from module c-ctype: + # Code from module c-strcase: + # Code from module c-strcaseeq: + # Code from module calloc-gnu: + # Code from module calloc-posix: + # Code from module ceil: + # Code from module ceill: + # Code from module close-stream: + # Code from module closeout: + # Code from module configmake: + # Code from module crypto/md5: + # Code from module crypto/sha1: + # Code from module crypto/sha256: + # Code from module crypto/sha512: + # Code from module ctype: + # Code from module dirname: + # Code from module dirname-lgpl: + # Code from module do-release-commit-and-tag: + # Code from module dosname: + # Code from module double-slash-root: + # Code from module errno: + # Code from module error: + # Code from module exitfail: + # Code from module exp: + # Code from module expl: + # Code from module extensions: + # Code from module extern-inline: + # Code from module fabs: + # Code from module fabsl: + # Code from module fdl: + # Code from module float: + # Code from module floor: + # Code from module floorl: + # Code from module fpending: + # Code from module fpieee: - ; - return 0; -} + # Code from module fpucw: + # Code from module frexp: + # Code from module frexpl: + # Code from module gendocs: + # Code from module getopt-gnu: + # Code from module getopt-posix: + # Code from module getprogname: + # Code from module gettext: + # Code from module gettext-h: + # Code from module git-version-gen: + # Code from module gitlog-to-changelog: + # Code from module gnu-web-doc-update: + # Code from module gnumakefile: + # Code from module gnupload: + # Code from module gperf: + # Code from module hard-locale: + # Code from module hash: + # Code from module hash-pjw: + # Code from module hash-pjw-bare: + # Code from module havelib: + # Code from module iconv: + # Code from module iconv-h: + # Code from module iconv_open: + # Code from module ignore-value: + # Code from module include_next: + # Code from module inline: + # Code from module intprops: + # Code from module inttostr: + # Code from module inttypes: + # Code from module inttypes-incomplete: + # Code from module isblank: + # Code from module isfinite: + # Code from module isinf: + # Code from module isnand-nolibm: + # Code from module isnanf-nolibm: + # Code from module isnanl: + # Code from module isnanl-nolibm: + # Code from module iswblank: + # Code from module ldexp: + # Code from module ldexpl: + # Code from module limits-h: + # Code from module linebuffer: + # Code from module localcharset: + # Code from module locale: + # Code from module localeconv: + # Code from module maintainer-makefile: + # Code from module malloc-posix: + # Code from module malloca: + # Code from module math: + # Code from module mbchar: + # Code from module mbiter: + # Code from module mbrtowc: + # Code from module mbsinit: + # Code from module mbslen: + # Code from module mbsrtowcs: + # Code from module mbsstr: + # Code from module mbuiter: + # Code from module memchr: + # Code from module minmax: + # Code from module modf: + # Code from module modfl: + # Code from module msvc-inval: + # Code from module msvc-nothrow: + # Code from module multiarch: + # Code from module nocrash: + # Code from module non-recursive-gnulib-prefix-hack: + # Code from module pmccabe2html: + # Code from module progname: + # Code from module propername: + # Code from module quotearg: + # Code from module quotearg-simple: + # Code from module random: + # Code from module random_r: + # Code from module readme-release: + # Code from module realloc-gnu: + # Code from module realloc-posix: + # Code from module round: + # Code from module roundl: + # Code from module signbit: + # Code from module size_max: + # Code from module snippet/_Noreturn: + # Code from module snippet/arg-nonnull: + # Code from module snippet/c++defs: + # Code from module snippet/unused-parameter: + # Code from module snippet/warn-on-use: + # Code from module sqrt: + # Code from module sqrtl: + # Code from module ssize_t: + # Code from module stdalign: + # Code from module stdarg: + + + + # Code from module stdbool: + # Code from module stddef: + # Code from module stdint: + # Code from module stdio: + # Code from module stdlib: + # Code from module stdnoreturn: + # Code from module stpcpy: + # Code from module streq: + # Code from module strerror: + # Code from module strerror-override: + # Code from module striconv: + # Code from module string: + # Code from module strndup: + # Code from module strnlen: + # Code from module strnlen1: + # Code from module strsep: + # Code from module strtoull: + # Code from module strtoumax: + # Code from module sys_types: + # Code from module trim: + # Code from module trunc: + # Code from module truncl: + # Code from module u64: + # Code from module unistd: + # Code from module unistr/base: + # Code from module unistr/u8-mbtoucr: + # Code from module unistr/u8-uctomb: + # Code from module unitypes: + # Code from module uniwidth/base: + # Code from module uniwidth/width: + # Code from module unlocked-io: + # Code from module update-copyright: + # Code from module useless-if-before-free: + # Code from module vc-list-files: + # Code from module verify: + # Code from module version-etc: + # Code from module warnings: + # Code from module wchar: + # Code from module wctype-h: + # Code from module wcwidth: + # Code from module xalloc: + # Code from module xalloc-die: + # Code from module xalloc-oversized: + # Code from module xstriconv: + # Code from module xstrndup: + # Code from module xstrtol: + # Code from module xstrtoumax: + + + + + + + LIBC_FATAL_STDERR_=1 + export LIBC_FATAL_STDERR_ + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - # It does; now see whether it defined to BIG_ENDIAN or not. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - #include +fi + +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 +$as_echo_n "checking for working alloca.h... " >&6; } +if ${ac_cv_working_alloca_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include int main () { -#if BYTE_ORDER != BIG_ENDIAN - not big endian - #endif - +char *p = (char *) alloca (2 * sizeof (int)); + if (p) return 0; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_bigendian=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_working_alloca_h=yes else - ac_cv_c_bigendian=no + ac_cv_working_alloca_h=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 +$as_echo "$ac_cv_working_alloca_h" >&6; } +if test $ac_cv_working_alloca_h = yes; then -int -main () -{ -#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) - bogus endian macros - #endif +$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - # It does; now see whether it defined to _BIG_ENDIAN or not. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 +$as_echo_n "checking for alloca... " >&6; } +if ${ac_cv_func_alloca_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +#ifdef __GNUC__ +# define alloca __builtin_alloca +#else +# ifdef _MSC_VER +# include +# define alloca _alloca +# else +# ifdef HAVE_ALLOCA_H +# include +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +void *alloca (size_t); +# endif +# endif +# endif +# endif +#endif int main () { -#ifndef _BIG_ENDIAN - not big endian - #endif - +char *p = (char *) alloca (1); + if (p) return 0; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_bigendian=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_func_alloca_works=yes else - ac_cv_c_bigendian=no + ac_cv_func_alloca_works=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # Compile a test program. - if test "$cross_compiling" = yes; then : - # Try to guess by grepping values from an object file. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -short int ascii_mm[] = - { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - short int ascii_ii[] = - { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; - int use_ascii (int i) { - return ascii_mm[i] + ascii_ii[i]; - } - short int ebcdic_ii[] = - { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - short int ebcdic_mm[] = - { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; - int use_ebcdic (int i) { - return ebcdic_mm[i] + ebcdic_ii[i]; - } - extern int foo; +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 +$as_echo "$ac_cv_func_alloca_works" >&6; } -int -main () -{ -return use_ascii (foo) == use_ebcdic (foo); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then - ac_cv_c_bigendian=yes - fi - if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi - fi -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ +if test $ac_cv_func_alloca_works = yes; then - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; +$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_c_bigendian=no else - ac_cv_c_bigendian=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 -$as_echo "$ac_cv_c_bigendian" >&6; } - case $ac_cv_c_bigendian in #( - yes) - $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h -;; #( - no) - ;; #( - universal) + # The SVR3 libPW and SVR4 libucb both contain incompatible functions +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. -$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h - ;; #( - *) - as_fn_error $? "unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; - esac - GNULIB_ISBLANK=0; - HAVE_ISBLANK=1; +ALLOCA=\${LIBOBJDIR}alloca.$ac_objext +$as_echo "#define C_ALLOCA 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5 -$as_echo_n "checking whether the preprocessor supports include_next... " >&6; } -if ${gl_cv_have_include_next+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 +$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } +if ${ac_cv_os_cray+:} false; then : $as_echo_n "(cached) " >&6 else - rm -rf conftestd1a conftestd1b conftestd2 - mkdir conftestd1a conftestd1b conftestd2 - cat < conftestd1a/conftest.h -#define DEFINED_IN_CONFTESTD1 -#include_next -#ifdef DEFINED_IN_CONFTESTD2 -int foo; -#else -#error "include_next doesn't work" -#endif -EOF - cat < conftestd1b/conftest.h -#define DEFINED_IN_CONFTESTD1 -#include -#include_next -#ifdef DEFINED_IN_CONFTESTD2 -int foo; + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined CRAY && ! defined CRAY2 +webecray #else -#error "include_next doesn't work" -#endif -EOF - cat < conftestd2/conftest.h -#ifndef DEFINED_IN_CONFTESTD1 -#error "include_next test doesn't work" +wenotbecray #endif -#define DEFINED_IN_CONFTESTD2 -EOF - gl_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_have_include_next=yes -else - CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include + _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_have_include_next=buggy +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "webecray" >/dev/null 2>&1; then : + ac_cv_os_cray=yes else - gl_cv_have_include_next=no + ac_cv_os_cray=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest* fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CPPFLAGS="$gl_save_CPPFLAGS" - rm -rf conftestd1a conftestd1b conftestd2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 +$as_echo "$ac_cv_os_cray" >&6; } +if test $ac_cv_os_cray = yes; then + for ac_func in _getb67 GETB67 getb67; do + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5 -$as_echo "$gl_cv_have_include_next" >&6; } - PRAGMA_SYSTEM_HEADER= - if test $gl_cv_have_include_next = yes; then - INCLUDE_NEXT=include_next - INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next - if test -n "$GCC"; then - PRAGMA_SYSTEM_HEADER='#pragma GCC system_header' - fi - else - if test $gl_cv_have_include_next = buggy; then - INCLUDE_NEXT=include - INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next - else - INCLUDE_NEXT=include - INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include - fi - fi +cat >>confdefs.h <<_ACEOF +#define CRAY_STACKSEG_END $ac_func +_ACEOF + break +fi + done +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether system header files limit the line length" >&5 -$as_echo_n "checking whether system header files limit the line length... " >&6; } -if ${gl_cv_pragma_columns+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 +$as_echo_n "checking stack direction for C alloca... " >&6; } +if ${ac_cv_c_stack_direction+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "$cross_compiling" = yes; then : + ac_cv_c_stack_direction=0 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +$ac_includes_default +int +find_stack_direction (int *addr, int depth) +{ + int dir, dummy = 0; + if (! addr) + addr = &dummy; + *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1; + dir = depth ? find_stack_direction (addr, depth - 1) : 0; + return dir + dummy; +} -#ifdef __TANDEM -choke me -#endif - +int +main (int argc, char **argv) +{ + return find_stack_direction (0, argc + !argv + 20) < 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "choke me" >/dev/null 2>&1; then : - gl_cv_pragma_columns=yes +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_stack_direction=1 else - gl_cv_pragma_columns=no + ac_cv_c_stack_direction=-1 fi -rm -f conftest* - - +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pragma_columns" >&5 -$as_echo "$gl_cv_pragma_columns" >&6; } - if test $gl_cv_pragma_columns = yes; then - PRAGMA_COLUMNS="#pragma COLUMNS 10000" - else - PRAGMA_COLUMNS= - fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 +$as_echo "$ac_cv_c_stack_direction" >&6; } +cat >>confdefs.h <<_ACEOF +#define STACK_DIRECTION $ac_cv_c_stack_direction +_ACEOF +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5 -$as_echo_n "checking whether // is distinct from /... " >&6; } -if ${gl_cv_double_slash_root+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5 +$as_echo_n "checking for C/C++ restrict keyword... " >&6; } +if ${ac_cv_c_restrict+:} false; then : $as_echo_n "(cached) " >&6 else - if test x"$cross_compiling" = xyes ; then - # When cross-compiling, there is no way to tell whether // is special - # short of a list of hosts. However, the only known hosts to date - # that have a distinct // are Apollo DomainOS (too old to port to), - # Cygwin, and z/OS. If anyone knows of another system for which // has - # special semantics and is distinct from /, please report it to - # . - case $host in - *-cygwin | i370-ibm-openedition) - gl_cv_double_slash_root=yes ;; - *) - # Be optimistic and assume that / and // are the same when we - # don't know. - gl_cv_double_slash_root='unknown, assuming no' ;; - esac - else - set x `ls -di / // 2>/dev/null` - if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then - gl_cv_double_slash_root=no - else - gl_cv_double_slash_root=yes - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5 -$as_echo "$gl_cv_double_slash_root" >&6; } - if test "$gl_cv_double_slash_root" = yes; then - -$as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h + ac_cv_c_restrict=no + # The order here caters to the fact that C++ does not require restrict. + for ac_kw in __restrict __restrict__ _Restrict restrict; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +typedef int *int_ptr; + int foo (int_ptr $ac_kw ip) { return ip[0]; } + int bar (int [$ac_kw]); /* Catch GCC bug 14050. */ + int bar (int ip[$ac_kw]) { return ip[0]; } - fi +int +main () +{ +int s[1]; + int *$ac_kw t = s; + t[0] = 0; + return foo (t) + bar (t); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_restrict=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_restrict" != no && break + done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 +$as_echo "$ac_cv_c_restrict" >&6; } + case $ac_cv_c_restrict in + restrict) ;; + no) $as_echo "#define restrict /**/" >>confdefs.h + ;; + *) cat >>confdefs.h <<_ACEOF +#define restrict $ac_cv_c_restrict +_ACEOF + ;; + esac + GNULIB__EXIT=0; + GNULIB_ATOLL=0; + GNULIB_CALLOC_POSIX=0; + GNULIB_CANONICALIZE_FILE_NAME=0; + GNULIB_GETLOADAVG=0; + GNULIB_GETSUBOPT=0; + GNULIB_GRANTPT=0; + GNULIB_MALLOC_POSIX=0; + GNULIB_MBTOWC=0; + GNULIB_MKDTEMP=0; + GNULIB_MKOSTEMP=0; + GNULIB_MKOSTEMPS=0; + GNULIB_MKSTEMP=0; + GNULIB_MKSTEMPS=0; + GNULIB_POSIX_OPENPT=0; + GNULIB_PTSNAME=0; + GNULIB_PTSNAME_R=0; + GNULIB_PUTENV=0; + GNULIB_QSORT_R=0; + GNULIB_RANDOM=0; + GNULIB_RANDOM_R=0; + GNULIB_REALLOC_POSIX=0; + GNULIB_REALPATH=0; + GNULIB_RPMATCH=0; + GNULIB_SECURE_GETENV=0; + GNULIB_SETENV=0; + GNULIB_STRTOD=0; + GNULIB_STRTOLL=0; + GNULIB_STRTOULL=0; + GNULIB_SYSTEM_POSIX=0; + GNULIB_UNLOCKPT=0; + GNULIB_UNSETENV=0; + GNULIB_WCTOMB=0; + HAVE__EXIT=1; + HAVE_ATOLL=1; + HAVE_CANONICALIZE_FILE_NAME=1; + HAVE_DECL_GETLOADAVG=1; + HAVE_GETSUBOPT=1; + HAVE_GRANTPT=1; + HAVE_MKDTEMP=1; + HAVE_MKOSTEMP=1; + HAVE_MKOSTEMPS=1; + HAVE_MKSTEMP=1; + HAVE_MKSTEMPS=1; + HAVE_POSIX_OPENPT=1; + HAVE_PTSNAME=1; + HAVE_PTSNAME_R=1; + HAVE_QSORT_R=1; + HAVE_RANDOM=1; + HAVE_RANDOM_H=1; + HAVE_RANDOM_R=1; + HAVE_REALPATH=1; + HAVE_RPMATCH=1; + HAVE_SECURE_GETENV=1; + HAVE_SETENV=1; + HAVE_DECL_SETENV=1; + HAVE_STRTOD=1; + HAVE_STRTOLL=1; + HAVE_STRTOULL=1; + HAVE_STRUCT_RANDOM_DATA=1; + HAVE_SYS_LOADAVG_H=0; + HAVE_UNLOCKPT=1; + HAVE_DECL_UNSETENV=1; + REPLACE_CALLOC=0; + REPLACE_CANONICALIZE_FILE_NAME=0; + REPLACE_MALLOC=0; + REPLACE_MBTOWC=0; + REPLACE_MKSTEMP=0; + REPLACE_PTSNAME=0; + REPLACE_PTSNAME_R=0; + REPLACE_PUTENV=0; + REPLACE_QSORT_R=0; + REPLACE_RANDOM_R=0; + REPLACE_REALLOC=0; + REPLACE_REALPATH=0; + REPLACE_SETENV=0; + REPLACE_STRTOD=0; + REPLACE_UNSETENV=0; + REPLACE_WCTOMB=0; - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for complete errno.h" >&5 -$as_echo_n "checking for complete errno.h... " >&6; } -if ${gl_cv_header_errno_h_complete+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether malloc, realloc, calloc are POSIX compliant" >&5 +$as_echo_n "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; } +if ${gl_cv_func_malloc_posix+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#if !defined ETXTBSY -booboo -#endif -#if !defined ENOMSG -booboo -#endif -#if !defined EIDRM -booboo -#endif -#if !defined ENOLINK -booboo -#endif -#if !defined EPROTO -booboo -#endif -#if !defined EMULTIHOP -booboo -#endif -#if !defined EBADMSG -booboo -#endif -#if !defined EOVERFLOW -booboo -#endif -#if !defined ENOTSUP -booboo -#endif -#if !defined ENETRESET -booboo -#endif -#if !defined ECONNABORTED -booboo -#endif -#if !defined ESTALE -booboo -#endif -#if !defined EDQUOT -booboo -#endif -#if !defined ECANCELED -booboo -#endif -#if !defined EOWNERDEAD -booboo -#endif -#if !defined ENOTRECOVERABLE -booboo -#endif -#if !defined EILSEQ -booboo -#endif +int +main () +{ +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ + choke me + #endif + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "booboo" >/dev/null 2>&1; then : - gl_cv_header_errno_h_complete=no +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_func_malloc_posix=yes else - gl_cv_header_errno_h_complete=yes + gl_cv_func_malloc_posix=no fi -rm -f conftest* - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_complete" >&5 -$as_echo "$gl_cv_header_errno_h_complete" >&6; } - if test $gl_cv_header_errno_h_complete = yes; then - ERRNO_H='' - else - - - - - - - - - if test $gl_cv_have_include_next = yes; then - gl_cv_next_errno_h='<'errno.h'>' - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 -$as_echo_n "checking absolute name of ... " >&6; } -if ${gl_cv_next_errno_h+:} false; then : - $as_echo_n "(cached) " >&6 -else - - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_malloc_posix" >&5 +$as_echo "$gl_cv_func_malloc_posix" >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' + GNULIB_ACOSF=0; + GNULIB_ACOSL=0; + GNULIB_ASINF=0; + GNULIB_ASINL=0; + GNULIB_ATANF=0; + GNULIB_ATANL=0; + GNULIB_ATAN2F=0; + GNULIB_CBRT=0; + GNULIB_CBRTF=0; + GNULIB_CBRTL=0; + GNULIB_CEIL=0; + GNULIB_CEILF=0; + GNULIB_CEILL=0; + GNULIB_COPYSIGN=0; + GNULIB_COPYSIGNF=0; + GNULIB_COPYSIGNL=0; + GNULIB_COSF=0; + GNULIB_COSL=0; + GNULIB_COSHF=0; + GNULIB_EXPF=0; + GNULIB_EXPL=0; + GNULIB_EXP2=0; + GNULIB_EXP2F=0; + GNULIB_EXP2L=0; + GNULIB_EXPM1=0; + GNULIB_EXPM1F=0; + GNULIB_EXPM1L=0; + GNULIB_FABSF=0; + GNULIB_FABSL=0; + GNULIB_FLOOR=0; + GNULIB_FLOORF=0; + GNULIB_FLOORL=0; + GNULIB_FMA=0; + GNULIB_FMAF=0; + GNULIB_FMAL=0; + GNULIB_FMOD=0; + GNULIB_FMODF=0; + GNULIB_FMODL=0; + GNULIB_FREXPF=0; + GNULIB_FREXP=0; + GNULIB_FREXPL=0; + GNULIB_HYPOT=0; + GNULIB_HYPOTF=0; + GNULIB_HYPOTL=0; + GNULIB_ILOGB=0; + GNULIB_ILOGBF=0; + GNULIB_ILOGBL=0; + GNULIB_ISFINITE=0; + GNULIB_ISINF=0; + GNULIB_ISNAN=0; + GNULIB_ISNANF=0; + GNULIB_ISNAND=0; + GNULIB_ISNANL=0; + GNULIB_LDEXPF=0; + GNULIB_LDEXPL=0; + GNULIB_LOG=0; + GNULIB_LOGF=0; + GNULIB_LOGL=0; + GNULIB_LOG10=0; + GNULIB_LOG10F=0; + GNULIB_LOG10L=0; + GNULIB_LOG1P=0; + GNULIB_LOG1PF=0; + GNULIB_LOG1PL=0; + GNULIB_LOG2=0; + GNULIB_LOG2F=0; + GNULIB_LOG2L=0; + GNULIB_LOGB=0; + GNULIB_LOGBF=0; + GNULIB_LOGBL=0; + GNULIB_MODF=0; + GNULIB_MODFF=0; + GNULIB_MODFL=0; + GNULIB_POWF=0; + GNULIB_REMAINDER=0; + GNULIB_REMAINDERF=0; + GNULIB_REMAINDERL=0; + GNULIB_RINT=0; + GNULIB_RINTF=0; + GNULIB_RINTL=0; + GNULIB_ROUND=0; + GNULIB_ROUNDF=0; + GNULIB_ROUNDL=0; + GNULIB_SIGNBIT=0; + GNULIB_SINF=0; + GNULIB_SINL=0; + GNULIB_SINHF=0; + GNULIB_SQRTF=0; + GNULIB_SQRTL=0; + GNULIB_TANF=0; + GNULIB_TANL=0; + GNULIB_TANHF=0; + GNULIB_TRUNC=0; + GNULIB_TRUNCF=0; + GNULIB_TRUNCL=0; + HAVE_ACOSF=1; + HAVE_ACOSL=1; + HAVE_ASINF=1; + HAVE_ASINL=1; + HAVE_ATANF=1; + HAVE_ATANL=1; + HAVE_ATAN2F=1; + HAVE_CBRT=1; + HAVE_CBRTF=1; + HAVE_CBRTL=1; + HAVE_COPYSIGN=1; + HAVE_COPYSIGNL=1; + HAVE_COSF=1; + HAVE_COSL=1; + HAVE_COSHF=1; + HAVE_EXPF=1; + HAVE_EXPL=1; + HAVE_EXPM1=1; + HAVE_EXPM1F=1; + HAVE_FABSF=1; + HAVE_FABSL=1; + HAVE_FMA=1; + HAVE_FMAF=1; + HAVE_FMAL=1; + HAVE_FMODF=1; + HAVE_FMODL=1; + HAVE_FREXPF=1; + HAVE_HYPOTF=1; + HAVE_HYPOTL=1; + HAVE_ILOGB=1; + HAVE_ILOGBF=1; + HAVE_ILOGBL=1; + HAVE_ISNANF=1; + HAVE_ISNAND=1; + HAVE_ISNANL=1; + HAVE_LDEXPF=1; + HAVE_LOGF=1; + HAVE_LOGL=1; + HAVE_LOG10F=1; + HAVE_LOG10L=1; + HAVE_LOG1P=1; + HAVE_LOG1PF=1; + HAVE_LOG1PL=1; + HAVE_LOGBF=1; + HAVE_LOGBL=1; + HAVE_MODFF=1; + HAVE_MODFL=1; + HAVE_POWF=1; + HAVE_REMAINDER=1; + HAVE_REMAINDERF=1; + HAVE_RINT=1; + HAVE_RINTL=1; + HAVE_SINF=1; + HAVE_SINL=1; + HAVE_SINHF=1; + HAVE_SQRTF=1; + HAVE_SQRTL=1; + HAVE_TANF=1; + HAVE_TANL=1; + HAVE_TANHF=1; + HAVE_DECL_ACOSL=1; + HAVE_DECL_ASINL=1; + HAVE_DECL_ATANL=1; + HAVE_DECL_CBRTF=1; + HAVE_DECL_CBRTL=1; + HAVE_DECL_CEILF=1; + HAVE_DECL_CEILL=1; + HAVE_DECL_COPYSIGNF=1; + HAVE_DECL_COSL=1; + HAVE_DECL_EXPL=1; + HAVE_DECL_EXP2=1; + HAVE_DECL_EXP2F=1; + HAVE_DECL_EXP2L=1; + HAVE_DECL_EXPM1L=1; + HAVE_DECL_FLOORF=1; + HAVE_DECL_FLOORL=1; + HAVE_DECL_FREXPL=1; + HAVE_DECL_LDEXPL=1; + HAVE_DECL_LOGL=1; + HAVE_DECL_LOG10L=1; + HAVE_DECL_LOG2=1; + HAVE_DECL_LOG2F=1; + HAVE_DECL_LOG2L=1; + HAVE_DECL_LOGB=1; + HAVE_DECL_REMAINDER=1; + HAVE_DECL_REMAINDERL=1; + HAVE_DECL_RINTF=1; + HAVE_DECL_ROUND=1; + HAVE_DECL_ROUNDF=1; + HAVE_DECL_ROUNDL=1; + HAVE_DECL_SINL=1; + HAVE_DECL_SQRTL=1; + HAVE_DECL_TANL=1; + HAVE_DECL_TRUNC=1; + HAVE_DECL_TRUNCF=1; + HAVE_DECL_TRUNCL=1; + REPLACE_ACOSF=0; + REPLACE_ASINF=0; + REPLACE_ATANF=0; + REPLACE_ATAN2F=0; + REPLACE_CBRTF=0; + REPLACE_CBRTL=0; + REPLACE_CEIL=0; + REPLACE_CEILF=0; + REPLACE_CEILL=0; + REPLACE_COSF=0; + REPLACE_COSHF=0; + REPLACE_EXPF=0; + REPLACE_EXPM1=0; + REPLACE_EXPM1F=0; + REPLACE_EXP2=0; + REPLACE_EXP2L=0; + REPLACE_FABSL=0; + REPLACE_FLOOR=0; + REPLACE_FLOORF=0; + REPLACE_FLOORL=0; + REPLACE_FMA=0; + REPLACE_FMAF=0; + REPLACE_FMAL=0; + REPLACE_FMOD=0; + REPLACE_FMODF=0; + REPLACE_FMODL=0; + REPLACE_FREXPF=0; + REPLACE_FREXP=0; + REPLACE_FREXPL=0; + REPLACE_HUGE_VAL=0; + REPLACE_HYPOT=0; + REPLACE_HYPOTF=0; + REPLACE_HYPOTL=0; + REPLACE_ILOGB=0; + REPLACE_ILOGBF=0; + REPLACE_ISFINITE=0; + REPLACE_ISINF=0; + REPLACE_ISNAN=0; + REPLACE_LDEXPL=0; + REPLACE_LOG=0; + REPLACE_LOGF=0; + REPLACE_LOGL=0; + REPLACE_LOG10=0; + REPLACE_LOG10F=0; + REPLACE_LOG10L=0; + REPLACE_LOG1P=0; + REPLACE_LOG1PF=0; + REPLACE_LOG1PL=0; + REPLACE_LOG2=0; + REPLACE_LOG2F=0; + REPLACE_LOG2L=0; + REPLACE_LOGB=0; + REPLACE_LOGBF=0; + REPLACE_LOGBL=0; + REPLACE_MODF=0; + REPLACE_MODFF=0; + REPLACE_MODFL=0; + REPLACE_NAN=0; + REPLACE_REMAINDER=0; + REPLACE_REMAINDERF=0; + REPLACE_REMAINDERL=0; + REPLACE_ROUND=0; + REPLACE_ROUNDF=0; + REPLACE_ROUNDL=0; + REPLACE_SIGNBIT=0; + REPLACE_SIGNBIT_USING_GCC=0; + REPLACE_SINF=0; + REPLACE_SINHF=0; + REPLACE_SQRTF=0; + REPLACE_SQRTL=0; + REPLACE_TANF=0; + REPLACE_TANHF=0; + REPLACE_TRUNC=0; + REPLACE_TRUNCF=0; + REPLACE_TRUNCL=0; + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long double and double are the same" >&5 +$as_echo_n "checking whether long double and double are the same... " >&6; } +if ${gl_cv_long_double_equals_double+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +typedef int check[sizeof (long double) == sizeof (double) + && LDBL_MANT_DIG == DBL_MANT_DIG + && LDBL_MAX_EXP == DBL_MAX_EXP + && LDBL_MIN_EXP == DBL_MIN_EXP + ? 1 : -1]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_long_double_equals_double=yes +else + gl_cv_long_double_equals_double=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_long_double_equals_double" >&5 +$as_echo "$gl_cv_long_double_equals_double" >&6; } + if test $gl_cv_long_double_equals_double = yes; then + +$as_echo "#define HAVE_SAME_LONG_DOUBLE_AS_DOUBLE 1" >>confdefs.h + + HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1 + else + HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0 + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if ${ac_cv_c_bigendian+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes +else + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + + + GNULIB_ISBLANK=0; + HAVE_ISBLANK=1; + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5 +$as_echo_n "checking whether the preprocessor supports include_next... " >&6; } +if ${gl_cv_have_include_next+:} false; then : + $as_echo_n "(cached) " >&6 +else + rm -rf conftestd1a conftestd1b conftestd2 + mkdir conftestd1a conftestd1b conftestd2 + cat < conftestd1a/conftest.h +#define DEFINED_IN_CONFTESTD1 +#include_next +#ifdef DEFINED_IN_CONFTESTD2 +int foo; +#else +#error "include_next doesn't work" +#endif +EOF + cat < conftestd1b/conftest.h +#define DEFINED_IN_CONFTESTD1 +#include +#include_next +#ifdef DEFINED_IN_CONFTESTD2 +int foo; +#else +#error "include_next doesn't work" +#endif +EOF + cat < conftestd2/conftest.h +#ifndef DEFINED_IN_CONFTESTD1 +#error "include_next test doesn't work" +#endif +#define DEFINED_IN_CONFTESTD2 +EOF + gl_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_have_include_next=yes +else + CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_have_include_next=buggy +else + gl_cv_have_include_next=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CPPFLAGS="$gl_save_CPPFLAGS" + rm -rf conftestd1a conftestd1b conftestd2 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5 +$as_echo "$gl_cv_have_include_next" >&6; } + PRAGMA_SYSTEM_HEADER= + if test $gl_cv_have_include_next = yes; then + INCLUDE_NEXT=include_next + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next + if test -n "$GCC"; then + PRAGMA_SYSTEM_HEADER='#pragma GCC system_header' + fi + else + if test $gl_cv_have_include_next = buggy; then + INCLUDE_NEXT=include + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include_next + else + INCLUDE_NEXT=include + INCLUDE_NEXT_AS_FIRST_DIRECTIVE=include + fi + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether system header files limit the line length" >&5 +$as_echo_n "checking whether system header files limit the line length... " >&6; } +if ${gl_cv_pragma_columns+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __TANDEM +choke me +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "choke me" >/dev/null 2>&1; then : + gl_cv_pragma_columns=yes +else + gl_cv_pragma_columns=no +fi +rm -f conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pragma_columns" >&5 +$as_echo "$gl_cv_pragma_columns" >&6; } + if test $gl_cv_pragma_columns = yes; then + PRAGMA_COLUMNS="#pragma COLUMNS 10000" + else + PRAGMA_COLUMNS= + fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5 +$as_echo_n "checking whether // is distinct from /... " >&6; } +if ${gl_cv_double_slash_root+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test x"$cross_compiling" = xyes ; then + # When cross-compiling, there is no way to tell whether // is special + # short of a list of hosts. However, the only known hosts to date + # that have a distinct // are Apollo DomainOS (too old to port to), + # Cygwin, and z/OS. If anyone knows of another system for which // has + # special semantics and is distinct from /, please report it to + # . + case $host in + *-cygwin | i370-ibm-openedition) + gl_cv_double_slash_root=yes ;; + *) + # Be optimistic and assume that / and // are the same when we + # don't know. + gl_cv_double_slash_root='unknown, assuming no' ;; + esac + else + set x `ls -di / // 2>/dev/null` + if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then + gl_cv_double_slash_root=no + else + gl_cv_double_slash_root=yes + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5 +$as_echo "$gl_cv_double_slash_root" >&6; } + if test "$gl_cv_double_slash_root" = yes; then + +$as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h + + fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for complete errno.h" >&5 +$as_echo_n "checking for complete errno.h... " >&6; } +if ${gl_cv_header_errno_h_complete+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if !defined ETXTBSY +booboo +#endif +#if !defined ENOMSG +booboo +#endif +#if !defined EIDRM +booboo +#endif +#if !defined ENOLINK +booboo +#endif +#if !defined EPROTO +booboo +#endif +#if !defined EMULTIHOP +booboo +#endif +#if !defined EBADMSG +booboo +#endif +#if !defined EOVERFLOW +booboo +#endif +#if !defined ENOTSUP +booboo +#endif +#if !defined ENETRESET +booboo +#endif +#if !defined ECONNABORTED +booboo +#endif +#if !defined ESTALE +booboo +#endif +#if !defined EDQUOT +booboo +#endif +#if !defined ECANCELED +booboo +#endif +#if !defined EOWNERDEAD +booboo +#endif +#if !defined ENOTRECOVERABLE +booboo +#endif +#if !defined EILSEQ +booboo +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "booboo" >/dev/null 2>&1; then : + gl_cv_header_errno_h_complete=no +else + gl_cv_header_errno_h_complete=yes +fi +rm -f conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_complete" >&5 +$as_echo "$gl_cv_header_errno_h_complete" >&6; } + if test $gl_cv_header_errno_h_complete = yes; then + ERRNO_H='' + else + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_errno_h='<'errno.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if ${gl_cv_next_errno_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' ;; esac gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' @@ -7423,79 +7986,8 @@ if test -n "$ERRNO_H"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EMULTIHOP value" >&5 -$as_echo_n "checking for EMULTIHOP value... " >&6; } -if ${gl_cv_header_errno_h_EMULTIHOP+:} false; then : - $as_echo_n "(cached) " >&6 -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#ifdef EMULTIHOP -yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : - gl_cv_header_errno_h_EMULTIHOP=yes -else - gl_cv_header_errno_h_EMULTIHOP=no -fi -rm -f conftest* - - if test $gl_cv_header_errno_h_EMULTIHOP = no; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#define _XOPEN_SOURCE_EXTENDED 1 -#include -#ifdef EMULTIHOP -yes -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then : - gl_cv_header_errno_h_EMULTIHOP=hidden -fi -rm -f conftest* - - if test $gl_cv_header_errno_h_EMULTIHOP = hidden; then - if ac_fn_c_compute_int "$LINENO" "EMULTIHOP" "gl_cv_header_errno_h_EMULTIHOP" " -#define _XOPEN_SOURCE_EXTENDED 1 -#include -/* The following two lines are a workaround against an autoconf-2.52 bug. */ -#include -#include -"; then : - -fi - - fi - fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EMULTIHOP" >&5 -$as_echo "$gl_cv_header_errno_h_EMULTIHOP" >&6; } - case $gl_cv_header_errno_h_EMULTIHOP in - yes | no) - EMULTIHOP_HIDDEN=0; EMULTIHOP_VALUE= - ;; - *) - EMULTIHOP_HIDDEN=1; EMULTIHOP_VALUE="$gl_cv_header_errno_h_EMULTIHOP" - ;; - esac - - - fi - - - if test -n "$ERRNO_H"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ENOLINK value" >&5 -$as_echo_n "checking for ENOLINK value... " >&6; } -if ${gl_cv_header_errno_h_ENOLINK+:} false; then : +$as_echo_n "checking for EMULTIHOP value... " >&6; } +if ${gl_cv_header_errno_h_EMULTIHOP+:} false; then : $as_echo_n "(cached) " >&6 else @@ -7503,38 +7995,38 @@ /* end confdefs.h. */ #include -#ifdef ENOLINK +#ifdef EMULTIHOP yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then : - gl_cv_header_errno_h_ENOLINK=yes + gl_cv_header_errno_h_EMULTIHOP=yes else - gl_cv_header_errno_h_ENOLINK=no + gl_cv_header_errno_h_EMULTIHOP=no fi rm -f conftest* - if test $gl_cv_header_errno_h_ENOLINK = no; then + if test $gl_cv_header_errno_h_EMULTIHOP = no; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include -#ifdef ENOLINK +#ifdef EMULTIHOP yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then : - gl_cv_header_errno_h_ENOLINK=hidden + gl_cv_header_errno_h_EMULTIHOP=hidden fi rm -f conftest* - if test $gl_cv_header_errno_h_ENOLINK = hidden; then - if ac_fn_c_compute_int "$LINENO" "ENOLINK" "gl_cv_header_errno_h_ENOLINK" " + if test $gl_cv_header_errno_h_EMULTIHOP = hidden; then + if ac_fn_c_compute_int "$LINENO" "EMULTIHOP" "gl_cv_header_errno_h_EMULTIHOP" " #define _XOPEN_SOURCE_EXTENDED 1 #include /* The following two lines are a workaround against an autoconf-2.52 bug. */ @@ -7548,14 +8040,14 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_ENOLINK" >&5 -$as_echo "$gl_cv_header_errno_h_ENOLINK" >&6; } - case $gl_cv_header_errno_h_ENOLINK in +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EMULTIHOP" >&5 +$as_echo "$gl_cv_header_errno_h_EMULTIHOP" >&6; } + case $gl_cv_header_errno_h_EMULTIHOP in yes | no) - ENOLINK_HIDDEN=0; ENOLINK_VALUE= + EMULTIHOP_HIDDEN=0; EMULTIHOP_VALUE= ;; *) - ENOLINK_HIDDEN=1; ENOLINK_VALUE="$gl_cv_header_errno_h_ENOLINK" + EMULTIHOP_HIDDEN=1; EMULTIHOP_VALUE="$gl_cv_header_errno_h_EMULTIHOP" ;; esac @@ -7564,9 +8056,9 @@ if test -n "$ERRNO_H"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EOVERFLOW value" >&5 -$as_echo_n "checking for EOVERFLOW value... " >&6; } -if ${gl_cv_header_errno_h_EOVERFLOW+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ENOLINK value" >&5 +$as_echo_n "checking for ENOLINK value... " >&6; } +if ${gl_cv_header_errno_h_ENOLINK+:} false; then : $as_echo_n "(cached) " >&6 else @@ -7574,38 +8066,38 @@ /* end confdefs.h. */ #include -#ifdef EOVERFLOW +#ifdef ENOLINK yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then : - gl_cv_header_errno_h_EOVERFLOW=yes + gl_cv_header_errno_h_ENOLINK=yes else - gl_cv_header_errno_h_EOVERFLOW=no + gl_cv_header_errno_h_ENOLINK=no fi rm -f conftest* - if test $gl_cv_header_errno_h_EOVERFLOW = no; then + if test $gl_cv_header_errno_h_ENOLINK = no; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include -#ifdef EOVERFLOW +#ifdef ENOLINK yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then : - gl_cv_header_errno_h_EOVERFLOW=hidden + gl_cv_header_errno_h_ENOLINK=hidden fi rm -f conftest* - if test $gl_cv_header_errno_h_EOVERFLOW = hidden; then - if ac_fn_c_compute_int "$LINENO" "EOVERFLOW" "gl_cv_header_errno_h_EOVERFLOW" " + if test $gl_cv_header_errno_h_ENOLINK = hidden; then + if ac_fn_c_compute_int "$LINENO" "ENOLINK" "gl_cv_header_errno_h_ENOLINK" " #define _XOPEN_SOURCE_EXTENDED 1 #include /* The following two lines are a workaround against an autoconf-2.52 bug. */ @@ -7619,14 +8111,14 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EOVERFLOW" >&5 -$as_echo "$gl_cv_header_errno_h_EOVERFLOW" >&6; } - case $gl_cv_header_errno_h_EOVERFLOW in +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_ENOLINK" >&5 +$as_echo "$gl_cv_header_errno_h_ENOLINK" >&6; } + case $gl_cv_header_errno_h_ENOLINK in yes | no) - EOVERFLOW_HIDDEN=0; EOVERFLOW_VALUE= + ENOLINK_HIDDEN=0; ENOLINK_VALUE= ;; *) - EOVERFLOW_HIDDEN=1; EOVERFLOW_VALUE="$gl_cv_header_errno_h_EOVERFLOW" + ENOLINK_HIDDEN=1; ENOLINK_VALUE="$gl_cv_header_errno_h_ENOLINK" ;; esac @@ -7634,497 +8126,270 @@ fi -ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" -if test "x$ac_cv_have_decl_strerror_r" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRERROR_R $ac_have_decl -_ACEOF - -for ac_func in strerror_r -do : - ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r" -if test "x$ac_cv_func_strerror_r" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STRERROR_R 1 -_ACEOF - -fi -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5 -$as_echo_n "checking whether strerror_r returns char *... " >&6; } -if ${ac_cv_func_strerror_r_char_p+:} false; then : - $as_echo_n "(cached) " >&6 -else - - ac_cv_func_strerror_r_char_p=no - if test $ac_cv_have_decl_strerror_r = yes; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ - - char buf[100]; - char x = *strerror_r (0, buf, sizeof buf); - char *p = strerror_r (0, buf, sizeof buf); - return !p || x; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_func_strerror_r_char_p=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - else - # strerror_r is not declared. Choose between - # systems that have relatively inaccessible declarations for the - # function. BeOS and DEC UNIX 4.0 fall in this category, but the - # former has a strerror_r that returns char*, while the latter - # has a strerror_r that returns `int'. - # This test should segfault on the DEC system. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default - extern char *strerror_r (); -int -main () -{ -char buf[100]; - char x = *strerror_r (0, buf, sizeof buf); - return ! isalpha (x); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_strerror_r_char_p=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5 -$as_echo "$ac_cv_func_strerror_r_char_p" >&6; } -if test $ac_cv_func_strerror_r_char_p = yes; then - -$as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h - -fi - - - XGETTEXT_EXTRA_OPTIONS= - - - - - - - POW_LIBM= - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pow can be used without linking with libm" >&5 -$as_echo_n "checking whether pow can be used without linking with libm... " >&6; } -if ${gl_cv_func_pow_no_libm+:} false; then : - $as_echo_n "(cached) " >&6 -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - - double (*funcptr) (double, double) = pow; - int i_ret; - float f_ret; - double d_ret; - long double l_ret; -int -main () -{ -double y = funcptr (1.6180339887, 1.6180339887) + pow (1.6180339887, 1.6180339887); - - return y < 0.3 || y > 1.7; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - gl_cv_func_pow_no_libm=yes -else - gl_cv_func_pow_no_libm=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_pow_no_libm" >&5 -$as_echo "$gl_cv_func_pow_no_libm" >&6; } - if test $gl_cv_func_pow_no_libm = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pow can be used with libm" >&5 -$as_echo_n "checking whether pow can be used with libm... " >&6; } -if ${gl_cv_func_pow_in_libm+:} false; then : - $as_echo_n "(cached) " >&6 -else - - save_LIBS="$LIBS" - LIBS="$LIBS -lm" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - - double (*funcptr) (double, double) = pow; - int i_ret; - float f_ret; - double d_ret; - long double l_ret; -int -main () -{ -double y = funcptr (1.6180339887, 1.6180339887) + pow (1.6180339887, 1.6180339887); - - return y < 0.3 || y > 1.7; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - gl_cv_func_pow_in_libm=yes -else - gl_cv_func_pow_in_libm=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$save_LIBS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_pow_in_libm" >&5 -$as_echo "$gl_cv_func_pow_in_libm" >&6; } - if test $gl_cv_func_pow_in_libm = yes; then - POW_LIBM=-lm - fi - fi - - - - - - - - GNULIB_ACOSF=0; - GNULIB_ACOSL=0; - GNULIB_ASINF=0; - GNULIB_ASINL=0; - GNULIB_ATANF=0; - GNULIB_ATANL=0; - GNULIB_ATAN2F=0; - GNULIB_CBRT=0; - GNULIB_CBRTF=0; - GNULIB_CBRTL=0; - GNULIB_CEIL=0; - GNULIB_CEILF=0; - GNULIB_CEILL=0; - GNULIB_COPYSIGN=0; - GNULIB_COPYSIGNF=0; - GNULIB_COPYSIGNL=0; - GNULIB_COSF=0; - GNULIB_COSL=0; - GNULIB_COSHF=0; - GNULIB_EXPF=0; - GNULIB_EXPL=0; - GNULIB_EXP2=0; - GNULIB_EXP2F=0; - GNULIB_EXP2L=0; - GNULIB_EXPM1=0; - GNULIB_EXPM1F=0; - GNULIB_EXPM1L=0; - GNULIB_FABSF=0; - GNULIB_FABSL=0; - GNULIB_FLOOR=0; - GNULIB_FLOORF=0; - GNULIB_FLOORL=0; - GNULIB_FMA=0; - GNULIB_FMAF=0; - GNULIB_FMAL=0; - GNULIB_FMOD=0; - GNULIB_FMODF=0; - GNULIB_FMODL=0; - GNULIB_FREXPF=0; - GNULIB_FREXP=0; - GNULIB_FREXPL=0; - GNULIB_HYPOT=0; - GNULIB_HYPOTF=0; - GNULIB_HYPOTL=0; - GNULIB_ILOGB=0; - GNULIB_ILOGBF=0; - GNULIB_ILOGBL=0; - GNULIB_ISFINITE=0; - GNULIB_ISINF=0; - GNULIB_ISNAN=0; - GNULIB_ISNANF=0; - GNULIB_ISNAND=0; - GNULIB_ISNANL=0; - GNULIB_LDEXPF=0; - GNULIB_LDEXPL=0; - GNULIB_LOG=0; - GNULIB_LOGF=0; - GNULIB_LOGL=0; - GNULIB_LOG10=0; - GNULIB_LOG10F=0; - GNULIB_LOG10L=0; - GNULIB_LOG1P=0; - GNULIB_LOG1PF=0; - GNULIB_LOG1PL=0; - GNULIB_LOG2=0; - GNULIB_LOG2F=0; - GNULIB_LOG2L=0; - GNULIB_LOGB=0; - GNULIB_LOGBF=0; - GNULIB_LOGBL=0; - GNULIB_MODF=0; - GNULIB_MODFF=0; - GNULIB_MODFL=0; - GNULIB_POWF=0; - GNULIB_REMAINDER=0; - GNULIB_REMAINDERF=0; - GNULIB_REMAINDERL=0; - GNULIB_RINT=0; - GNULIB_RINTF=0; - GNULIB_RINTL=0; - GNULIB_ROUND=0; - GNULIB_ROUNDF=0; - GNULIB_ROUNDL=0; - GNULIB_SIGNBIT=0; - GNULIB_SINF=0; - GNULIB_SINL=0; - GNULIB_SINHF=0; - GNULIB_SQRTF=0; - GNULIB_SQRTL=0; - GNULIB_TANF=0; - GNULIB_TANL=0; - GNULIB_TANHF=0; - GNULIB_TRUNC=0; - GNULIB_TRUNCF=0; - GNULIB_TRUNCL=0; - HAVE_ACOSF=1; - HAVE_ACOSL=1; - HAVE_ASINF=1; - HAVE_ASINL=1; - HAVE_ATANF=1; - HAVE_ATANL=1; - HAVE_ATAN2F=1; - HAVE_CBRT=1; - HAVE_CBRTF=1; - HAVE_CBRTL=1; - HAVE_COPYSIGN=1; - HAVE_COPYSIGNL=1; - HAVE_COSF=1; - HAVE_COSL=1; - HAVE_COSHF=1; - HAVE_EXPF=1; - HAVE_EXPL=1; - HAVE_EXPM1=1; - HAVE_EXPM1F=1; - HAVE_FABSF=1; - HAVE_FABSL=1; - HAVE_FMA=1; - HAVE_FMAF=1; - HAVE_FMAL=1; - HAVE_FMODF=1; - HAVE_FMODL=1; - HAVE_FREXPF=1; - HAVE_HYPOTF=1; - HAVE_HYPOTL=1; - HAVE_ILOGB=1; - HAVE_ILOGBF=1; - HAVE_ILOGBL=1; - HAVE_ISNANF=1; - HAVE_ISNAND=1; - HAVE_ISNANL=1; - HAVE_LDEXPF=1; - HAVE_LOGF=1; - HAVE_LOGL=1; - HAVE_LOG10F=1; - HAVE_LOG10L=1; - HAVE_LOG1P=1; - HAVE_LOG1PF=1; - HAVE_LOG1PL=1; - HAVE_LOGBF=1; - HAVE_LOGBL=1; - HAVE_MODFF=1; - HAVE_MODFL=1; - HAVE_POWF=1; - HAVE_REMAINDER=1; - HAVE_REMAINDERF=1; - HAVE_RINT=1; - HAVE_RINTL=1; - HAVE_SINF=1; - HAVE_SINL=1; - HAVE_SINHF=1; - HAVE_SQRTF=1; - HAVE_SQRTL=1; - HAVE_TANF=1; - HAVE_TANL=1; - HAVE_TANHF=1; - HAVE_DECL_ACOSL=1; - HAVE_DECL_ASINL=1; - HAVE_DECL_ATANL=1; - HAVE_DECL_CBRTF=1; - HAVE_DECL_CBRTL=1; - HAVE_DECL_CEILF=1; - HAVE_DECL_CEILL=1; - HAVE_DECL_COPYSIGNF=1; - HAVE_DECL_COSL=1; - HAVE_DECL_EXPL=1; - HAVE_DECL_EXP2=1; - HAVE_DECL_EXP2F=1; - HAVE_DECL_EXP2L=1; - HAVE_DECL_EXPM1L=1; - HAVE_DECL_FLOORF=1; - HAVE_DECL_FLOORL=1; - HAVE_DECL_FREXPL=1; - HAVE_DECL_LDEXPL=1; - HAVE_DECL_LOGL=1; - HAVE_DECL_LOG10L=1; - HAVE_DECL_LOG2=1; - HAVE_DECL_LOG2F=1; - HAVE_DECL_LOG2L=1; - HAVE_DECL_LOGB=1; - HAVE_DECL_REMAINDER=1; - HAVE_DECL_REMAINDERL=1; - HAVE_DECL_RINTF=1; - HAVE_DECL_ROUND=1; - HAVE_DECL_ROUNDF=1; - HAVE_DECL_ROUNDL=1; - HAVE_DECL_SINL=1; - HAVE_DECL_SQRTL=1; - HAVE_DECL_TANL=1; - HAVE_DECL_TRUNC=1; - HAVE_DECL_TRUNCF=1; - HAVE_DECL_TRUNCL=1; - REPLACE_CBRTF=0; - REPLACE_CBRTL=0; - REPLACE_CEIL=0; - REPLACE_CEILF=0; - REPLACE_CEILL=0; - REPLACE_EXPM1=0; - REPLACE_EXPM1F=0; - REPLACE_EXP2=0; - REPLACE_EXP2L=0; - REPLACE_FABSL=0; - REPLACE_FLOOR=0; - REPLACE_FLOORF=0; - REPLACE_FLOORL=0; - REPLACE_FMA=0; - REPLACE_FMAF=0; - REPLACE_FMAL=0; - REPLACE_FMOD=0; - REPLACE_FMODF=0; - REPLACE_FMODL=0; - REPLACE_FREXPF=0; - REPLACE_FREXP=0; - REPLACE_FREXPL=0; - REPLACE_HUGE_VAL=0; - REPLACE_HYPOT=0; - REPLACE_HYPOTF=0; - REPLACE_HYPOTL=0; - REPLACE_ILOGB=0; - REPLACE_ILOGBF=0; - REPLACE_ISFINITE=0; - REPLACE_ISINF=0; - REPLACE_ISNAN=0; - REPLACE_LDEXPL=0; - REPLACE_LOG=0; - REPLACE_LOGF=0; - REPLACE_LOGL=0; - REPLACE_LOG10=0; - REPLACE_LOG10F=0; - REPLACE_LOG10L=0; - REPLACE_LOG1P=0; - REPLACE_LOG1PF=0; - REPLACE_LOG1PL=0; - REPLACE_LOG2=0; - REPLACE_LOG2F=0; - REPLACE_LOG2L=0; - REPLACE_LOGB=0; - REPLACE_LOGBF=0; - REPLACE_LOGBL=0; - REPLACE_MODF=0; - REPLACE_MODFF=0; - REPLACE_MODFL=0; - REPLACE_NAN=0; - REPLACE_REMAINDER=0; - REPLACE_REMAINDERF=0; - REPLACE_REMAINDERL=0; - REPLACE_ROUND=0; - REPLACE_ROUNDF=0; - REPLACE_ROUNDL=0; - REPLACE_SIGNBIT=0; - REPLACE_SIGNBIT_USING_GCC=0; - REPLACE_SQRTL=0; - REPLACE_TRUNC=0; - REPLACE_TRUNCF=0; - REPLACE_TRUNCL=0; + if test -n "$ERRNO_H"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EOVERFLOW value" >&5 +$as_echo_n "checking for EOVERFLOW value... " >&6; } +if ${gl_cv_header_errno_h_EOVERFLOW+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long double and double are the same" >&5 -$as_echo_n "checking whether long double and double are the same... " >&6; } -if ${gl_cv_long_double_equals_double+:} false; then : +#include +#ifdef EOVERFLOW +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then : + gl_cv_header_errno_h_EOVERFLOW=yes +else + gl_cv_header_errno_h_EOVERFLOW=no +fi +rm -f conftest* + + if test $gl_cv_header_errno_h_EOVERFLOW = no; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#define _XOPEN_SOURCE_EXTENDED 1 +#include +#ifdef EOVERFLOW +yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then : + gl_cv_header_errno_h_EOVERFLOW=hidden +fi +rm -f conftest* + + if test $gl_cv_header_errno_h_EOVERFLOW = hidden; then + if ac_fn_c_compute_int "$LINENO" "EOVERFLOW" "gl_cv_header_errno_h_EOVERFLOW" " +#define _XOPEN_SOURCE_EXTENDED 1 +#include +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include +"; then : + +fi + + fi + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EOVERFLOW" >&5 +$as_echo "$gl_cv_header_errno_h_EOVERFLOW" >&6; } + case $gl_cv_header_errno_h_EOVERFLOW in + yes | no) + EOVERFLOW_HIDDEN=0; EOVERFLOW_VALUE= + ;; + *) + EOVERFLOW_HIDDEN=1; EOVERFLOW_VALUE="$gl_cv_header_errno_h_EOVERFLOW" + ;; + esac + + + fi + + +ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" +if test "x$ac_cv_have_decl_strerror_r" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRERROR_R $ac_have_decl +_ACEOF + +for ac_func in strerror_r +do : + ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r" +if test "x$ac_cv_func_strerror_r" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRERROR_R 1 +_ACEOF + +fi +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5 +$as_echo_n "checking whether strerror_r returns char *... " >&6; } +if ${ac_cv_func_strerror_r_char_p+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + ac_cv_func_strerror_r_char_p=no + if test $ac_cv_have_decl_strerror_r = yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +$ac_includes_default int main () { -typedef int check[sizeof (long double) == sizeof (double) - && LDBL_MANT_DIG == DBL_MANT_DIG - && LDBL_MAX_EXP == DBL_MAX_EXP - && LDBL_MIN_EXP == DBL_MIN_EXP - ? 1 : -1]; + + char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + char *p = strerror_r (0, buf, sizeof buf); + return !p || x; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_long_double_equals_double=yes -else - gl_cv_long_double_equals_double=no + ac_cv_func_strerror_r_char_p=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + else + # strerror_r is not declared. Choose between + # systems that have relatively inaccessible declarations for the + # function. BeOS and DEC UNIX 4.0 fall in this category, but the + # former has a strerror_r that returns char*, while the latter + # has a strerror_r that returns `int'. + # This test should segfault on the DEC system. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + extern char *strerror_r (); +int +main () +{ +char buf[100]; + char x = *strerror_r (0, buf, sizeof buf); + return ! isalpha (x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_strerror_r_char_p=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_long_double_equals_double" >&5 -$as_echo "$gl_cv_long_double_equals_double" >&6; } - if test $gl_cv_long_double_equals_double = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5 +$as_echo "$ac_cv_func_strerror_r_char_p" >&6; } +if test $ac_cv_func_strerror_r_char_p = yes; then + +$as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h + +fi + + + XGETTEXT_EXTRA_OPTIONS= + + + + + + + POW_LIBM= + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pow can be used without linking with libm" >&5 +$as_echo_n "checking whether pow can be used without linking with libm... " >&6; } +if ${gl_cv_func_pow_no_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + + double (*funcptr) (double, double) = pow; + int i_ret; + float f_ret; + double d_ret; + long double l_ret; +int +main () +{ +double y = funcptr (1.6180339887, 1.6180339887) + pow (1.6180339887, 1.6180339887); + + return y < 0.3 || y > 1.7; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_pow_no_libm=yes +else + gl_cv_func_pow_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_pow_no_libm" >&5 +$as_echo "$gl_cv_func_pow_no_libm" >&6; } + if test $gl_cv_func_pow_no_libm = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pow can be used with libm" >&5 +$as_echo_n "checking whether pow can be used with libm... " >&6; } +if ${gl_cv_func_pow_in_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + save_LIBS="$LIBS" + LIBS="$LIBS -lm" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + + double (*funcptr) (double, double) = pow; + int i_ret; + float f_ret; + double d_ret; + long double l_ret; +int +main () +{ +double y = funcptr (1.6180339887, 1.6180339887) + pow (1.6180339887, 1.6180339887); + + return y < 0.3 || y > 1.7; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_pow_in_libm=yes +else + gl_cv_func_pow_in_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_pow_in_libm" >&5 +$as_echo "$gl_cv_func_pow_in_libm" >&6; } + if test $gl_cv_func_pow_in_libm = yes; then + POW_LIBM=-lm + fi + fi + + -$as_echo "#define HAVE_SAME_LONG_DOUBLE_AS_DOUBLE 1" >>confdefs.h - HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1 - else - HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0 - fi @@ -8344,30 +8609,295 @@ return result; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_isnanl_works=yes -else - gl_cv_func_isnanl_works=no +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_isnanl_works=yes +else + gl_cv_func_isnanl_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_works" >&5 +$as_echo "$gl_cv_func_isnanl_works" >&6; } + + LIBS="$save_LIBS" + case "$gl_cv_func_isnanl_works" in + *yes) gl_func_isnanl=yes ;; + *) gl_func_isnanl=no; ISNANL_LIBM= ;; + esac + else + gl_func_isnanl=no + fi + if test $gl_func_isnanl != yes; then + HAVE_ISNANL=0 + fi + + + + + + + + + + save_LIBS=$LIBS + ROUND_LIBM=missing + for libm in "" "-lm"; do + LIBS="$save_LIBS $libm" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + extern + #ifdef __cplusplus + "C" + #endif + double round (double); + + double x; +int +main () +{ +x = round (x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ROUND_LIBM=$libm +break +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done + LIBS=$save_LIBS + + if test "$ROUND_LIBM" != missing; then + HAVE_ROUND=1 + ac_fn_c_check_decl "$LINENO" "round" "ac_cv_have_decl_round" "#include +" +if test "x$ac_cv_have_decl_round" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ROUND $ac_have_decl +_ACEOF +if test $ac_have_decl = 1; then : + +else + HAVE_DECL_ROUND=0 +fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether round works" >&5 +$as_echo_n "checking whether round works... " >&6; } +if ${gl_cv_func_round_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + + save_LIBS="$LIBS" + LIBS="$LIBS $ROUND_LIBM" + if test "$cross_compiling" = yes; then : + case "$host_os" in + netbsd* | aix*) gl_cv_func_round_works="guessing no";; + *) gl_cv_func_round_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +extern +#ifdef __cplusplus +"C" +#endif +double round (double); +#ifdef _MSC_VER +# pragma fenv_access (off) +#endif +int main() +{ + /* 2^DBL_MANT_DIG. */ + static const double TWO_MANT_DIG = + /* Assume DBL_MANT_DIG <= 5 * 31. + Use the identity + n = floor(n/5) + floor((n+1)/5) + ... + floor((n+4)/5). */ + (double) (1U << (DBL_MANT_DIG / 5)) + * (double) (1U << ((DBL_MANT_DIG + 1) / 5)) + * (double) (1U << ((DBL_MANT_DIG + 2) / 5)) + * (double) (1U << ((DBL_MANT_DIG + 3) / 5)) + * (double) (1U << ((DBL_MANT_DIG + 4) / 5)); + volatile double x = 0.5 - 0.5 / TWO_MANT_DIG; + exit (x < 0.5 && round (x) != 0.0); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_round_works=yes +else + gl_cv_func_round_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + LIBS="$save_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_round_works" >&5 +$as_echo "$gl_cv_func_round_works" >&6; } + case "$gl_cv_func_round_works" in + *no) REPLACE_ROUND=1 ;; + esac + + + else + HAVE_ROUND=0 + HAVE_DECL_ROUND=0 + fi + if test $HAVE_ROUND = 0 || test $REPLACE_ROUND = 1; then + + + saved_as_echo_n="$as_echo_n" + as_echo_n=':' + if ${gl_cv_func_floor_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_cv_func_floor_libm=? + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + double x; +int +main () +{ +x = floor(x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_floor_libm= +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$gl_cv_func_floor_libm" = "?"; then + save_LIBS="$LIBS" + LIBS="$LIBS -lm" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + double x; +int +main () +{ +x = floor(x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_floor_libm="-lm" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" + fi + +fi + + as_echo_n="$saved_as_echo_n" + + FLOOR_LIBM="$gl_cv_func_floor_libm" + + + + saved_as_echo_n="$as_echo_n" + as_echo_n=':' + if ${gl_cv_func_ceil_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_cv_func_ceil_libm=? + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + double x; +int +main () +{ +x = ceil(x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_ceil_libm= +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$gl_cv_func_ceil_libm" = "?"; then + save_LIBS="$LIBS" + LIBS="$LIBS -lm" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + double x; +int +main () +{ +x = ceil(x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_ceil_libm="-lm" fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" + fi + fi + as_echo_n="$saved_as_echo_n" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_works" >&5 -$as_echo "$gl_cv_func_isnanl_works" >&6; } + CEIL_LIBM="$gl_cv_func_ceil_libm" - LIBS="$save_LIBS" - case "$gl_cv_func_isnanl_works" in - *yes) gl_func_isnanl=yes ;; - *) gl_func_isnanl=no; ISNANL_LIBM= ;; + ROUND_LIBM= + case " $ROUND_LIBM " in + *" $FLOOR_LIBM "*) ;; + *) ROUND_LIBM="$ROUND_LIBM $FLOOR_LIBM" ;; + esac + case " $ROUND_LIBM " in + *" $CEIL_LIBM "*) ;; + *) ROUND_LIBM="$ROUND_LIBM $CEIL_LIBM" ;; esac - else - gl_func_isnanl=no - fi - if test $gl_func_isnanl != yes; then - HAVE_ISNANL=0 fi @@ -8378,8 +8908,9 @@ + save_LIBS=$LIBS - ROUND_LIBM=missing + ROUNDL_LIBM=missing for libm in "" "-lm"; do LIBS="$save_LIBS $libm" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8393,19 +8924,19 @@ #ifdef __cplusplus "C" #endif - double round (double); + long double roundl (long double); double x; int main () { -x = round (x); +x = roundl (x); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ROUND_LIBM=$libm + ROUNDL_LIBM=$libm break fi rm -f core conftest.err conftest.$ac_objext \ @@ -8413,125 +8944,92 @@ done LIBS=$save_LIBS - if test "$ROUND_LIBM" != missing; then - HAVE_ROUND=1 - ac_fn_c_check_decl "$LINENO" "round" "ac_cv_have_decl_round" "#include + if test "$ROUNDL_LIBM" != missing; then + HAVE_ROUNDL=1 + ac_fn_c_check_decl "$LINENO" "roundl" "ac_cv_have_decl_roundl" "#include " -if test "x$ac_cv_have_decl_round" = xyes; then : +if test "x$ac_cv_have_decl_roundl" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_ROUND $ac_have_decl +#define HAVE_DECL_ROUNDL $ac_have_decl _ACEOF if test $ac_have_decl = 1; then : else - HAVE_DECL_ROUND=0 + HAVE_DECL_ROUNDL=0 fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether round works" >&5 -$as_echo_n "checking whether round works... " >&6; } -if ${gl_cv_func_round_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - - save_LIBS="$LIBS" - LIBS="$LIBS $ROUND_LIBM" - if test "$cross_compiling" = yes; then : - case "$host_os" in - netbsd* | aix*) gl_cv_func_round_works="guessing no";; - *) gl_cv_func_round_works="guessing yes";; - esac + else + HAVE_ROUNDL=0 + HAVE_DECL_ROUNDL=0 + fi + if test $HAVE_ROUNDL = 0 || test $REPLACE_ROUNDL = 1; then + if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then + ROUNDL_LIBM="$ROUND_LIBM" + else + ac_fn_c_check_decl "$LINENO" "ceill" "ac_cv_have_decl_ceill" "#include +" +if test "x$ac_cv_have_decl_ceill" = xyes; then : + ac_have_decl=1 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + ac_have_decl=0 +fi -#include -#include -extern -#ifdef __cplusplus -"C" -#endif -double round (double); -#ifdef _MSC_VER -# pragma fenv_access (off) -#endif -int main() -{ - /* 2^DBL_MANT_DIG. */ - static const double TWO_MANT_DIG = - /* Assume DBL_MANT_DIG <= 5 * 31. - Use the identity - n = floor(n/5) + floor((n+1)/5) + ... + floor((n+4)/5). */ - (double) (1U << (DBL_MANT_DIG / 5)) - * (double) (1U << ((DBL_MANT_DIG + 1) / 5)) - * (double) (1U << ((DBL_MANT_DIG + 2) / 5)) - * (double) (1U << ((DBL_MANT_DIG + 3) / 5)) - * (double) (1U << ((DBL_MANT_DIG + 4) / 5)); - volatile double x = 0.5 - 0.5 / TWO_MANT_DIG; - exit (x < 0.5 && round (x) != 0.0); -} +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CEILL $ac_have_decl _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_round_works=yes +ac_fn_c_check_decl "$LINENO" "floorl" "ac_cv_have_decl_floorl" "#include +" +if test "x$ac_cv_have_decl_floorl" = xyes; then : + ac_have_decl=1 else - gl_cv_func_round_works=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - LIBS="$save_LIBS" - + ac_have_decl=0 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_round_works" >&5 -$as_echo "$gl_cv_func_round_works" >&6; } - case "$gl_cv_func_round_works" in - *no) REPLACE_ROUND=1 ;; - esac +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FLOORL $ac_have_decl +_ACEOF - else - HAVE_ROUND=0 - HAVE_DECL_ROUND=0 - fi - if test $HAVE_ROUND = 0 || test $REPLACE_ROUND = 1; then + if test "$ac_cv_have_decl_floorl" = yes \ + && test "$ac_cv_have_decl_ceill" = yes; then saved_as_echo_n="$as_echo_n" as_echo_n=':' - if ${gl_cv_func_floor_libm+:} false; then : + if ${gl_cv_func_floorl_libm+:} false; then : $as_echo_n "(cached) " >&6 else - gl_cv_func_floor_libm=? + gl_cv_func_floorl_libm=? cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __NO_MATH_INLINES # define __NO_MATH_INLINES 1 /* for glibc */ #endif #include - double x; + long double (*funcptr) (long double) = floorl; + long double x; int main () { -x = floor(x); +x = funcptr (x) + floorl(x); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - gl_cv_func_floor_libm= + gl_cv_func_floorl_libm= fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - if test "$gl_cv_func_floor_libm" = "?"; then + if test "$gl_cv_func_floorl_libm" = "?"; then save_LIBS="$LIBS" LIBS="$LIBS -lm" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8540,17 +9038,18 @@ # define __NO_MATH_INLINES 1 /* for glibc */ #endif #include - double x; + long double (*funcptr) (long double) = floorl; + long double x; int main () { -x = floor(x); +x = funcptr (x) + floorl(x); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - gl_cv_func_floor_libm="-lm" + gl_cv_func_floorl_libm="-lm" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -8561,38 +9060,39 @@ as_echo_n="$saved_as_echo_n" - FLOOR_LIBM="$gl_cv_func_floor_libm" + FLOORL_LIBM="$gl_cv_func_floorl_libm" saved_as_echo_n="$as_echo_n" as_echo_n=':' - if ${gl_cv_func_ceil_libm+:} false; then : + if ${gl_cv_func_ceill_libm+:} false; then : $as_echo_n "(cached) " >&6 else - gl_cv_func_ceil_libm=? + gl_cv_func_ceill_libm=? cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __NO_MATH_INLINES # define __NO_MATH_INLINES 1 /* for glibc */ #endif #include - double x; + long double (*funcptr) (long double) = ceill; + long double x; int main () { -x = ceil(x); +x = funcptr(x) + ceill(x); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - gl_cv_func_ceil_libm= + gl_cv_func_ceill_libm= fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - if test "$gl_cv_func_ceil_libm" = "?"; then + if test "$gl_cv_func_ceill_libm" = "?"; then save_LIBS="$LIBS" LIBS="$LIBS -lm" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8601,366 +9101,522 @@ # define __NO_MATH_INLINES 1 /* for glibc */ #endif #include - double x; + long double (*funcptr) (long double) = ceill; + long double x; +int +main () +{ +x = funcptr(x) + ceill(x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_ceill_libm="-lm" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" + fi + +fi + + as_echo_n="$saved_as_echo_n" + + CEILL_LIBM="$gl_cv_func_ceill_libm" + + if test "$FLOORL_LIBM" != '?' && test "$CEILL_LIBM" != '?'; then + +$as_echo "#define HAVE_FLOORL_AND_CEILL 1" >>confdefs.h + + ROUNDL_LIBM= + case " $ROUNDL_LIBM " in + *" $FLOORL_LIBM "*) ;; + *) ROUNDL_LIBM="$ROUNDL_LIBM $FLOORL_LIBM" ;; + esac + case " $ROUNDL_LIBM " in + *" $CEILL_LIBM "*) ;; + *) ROUNDL_LIBM="$ROUNDL_LIBM $CEILL_LIBM" ;; + esac + else + ROUNDL_LIBM= + fi + else + ROUNDL_LIBM= + fi + fi + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexp() can be used without linking with libm" >&5 +$as_echo_n "checking whether ldexp() can be used without linking with libm... " >&6; } +if ${gl_cv_func_ldexp_no_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + double (*funcptr) (double, int) = ldexp; + double x; int main () { -x = ceil(x); +return ldexp (x, -1) > 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - gl_cv_func_ceil_libm="-lm" + gl_cv_func_ldexp_no_libm=yes +else + gl_cv_func_ldexp_no_libm=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LIBS="$save_LIBS" - fi fi - - as_echo_n="$saved_as_echo_n" - - CEIL_LIBM="$gl_cv_func_ceil_libm" - - ROUND_LIBM= - case " $ROUND_LIBM " in - *" $FLOOR_LIBM "*) ;; - *) ROUND_LIBM="$ROUND_LIBM $FLOOR_LIBM" ;; - esac - case " $ROUND_LIBM " in - *" $CEIL_LIBM "*) ;; - *) ROUND_LIBM="$ROUND_LIBM $CEIL_LIBM" ;; - esac - fi - - - - - - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexp_no_libm" >&5 +$as_echo "$gl_cv_func_ldexp_no_libm" >&6; } + LDEXP_LIBM= + if test $gl_cv_func_ldexp_no_libm = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexp() can be used with libm" >&5 +$as_echo_n "checking whether ldexp() can be used with libm... " >&6; } +if ${gl_cv_func_ldexp_in_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else - save_LIBS=$LIBS - ROUNDL_LIBM=missing - for libm in "" "-lm"; do - LIBS="$save_LIBS $libm" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + save_LIBS="$LIBS" + LIBS="$LIBS -lm" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - - #ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - extern - #ifdef __cplusplus - "C" - #endif - long double roundl (long double); - - double x; +#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + double (*funcptr) (double, int) = ldexp; + double x; int main () { -x = roundl (x); +return ldexp (x, -1) > 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ROUNDL_LIBM=$libm -break + gl_cv_func_ldexp_in_libm=yes +else + gl_cv_func_ldexp_in_libm=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - done - LIBS=$save_LIBS + LIBS="$save_LIBS" - if test "$ROUNDL_LIBM" != missing; then - HAVE_ROUNDL=1 - ac_fn_c_check_decl "$LINENO" "roundl" "ac_cv_have_decl_roundl" "#include -" -if test "x$ac_cv_have_decl_roundl" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexp_in_libm" >&5 +$as_echo "$gl_cv_func_ldexp_in_libm" >&6; } + if test $gl_cv_func_ldexp_in_libm = yes; then + LDEXP_LIBM=-lm + fi + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_ROUNDL $ac_have_decl -_ACEOF -if test $ac_have_decl = 1; then : -else - HAVE_DECL_ROUNDL=0 -fi - else - HAVE_ROUNDL=0 - HAVE_DECL_ROUNDL=0 - fi - if test $HAVE_ROUNDL = 0 || test $REPLACE_ROUNDL = 1; then - if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then - ROUNDL_LIBM="$ROUND_LIBM" - else - ac_fn_c_check_decl "$LINENO" "ceill" "ac_cv_have_decl_ceill" "#include -" -if test "x$ac_cv_have_decl_ceill" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CEILL $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "floorl" "ac_cv_have_decl_floorl" "#include + + ac_fn_c_check_decl "$LINENO" "ldexpl" "ac_cv_have_decl_ldexpl" "#include " -if test "x$ac_cv_have_decl_floorl" = xyes; then : - ac_have_decl=1 +if test "x$ac_cv_have_decl_ldexpl" = xyes; then : + else - ac_have_decl=0 + HAVE_DECL_LDEXPL=0 fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FLOORL $ac_have_decl -_ACEOF - - if test "$ac_cv_have_decl_floorl" = yes \ - && test "$ac_cv_have_decl_ceill" = yes; then + LDEXPL_LIBM= + if test $HAVE_DECL_LDEXPL = 1; then - saved_as_echo_n="$as_echo_n" - as_echo_n=':' - if ${gl_cv_func_floorl_libm+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexpl() can be used without linking with libm" >&5 +$as_echo_n "checking whether ldexpl() can be used without linking with libm... " >&6; } +if ${gl_cv_func_ldexpl_no_libm+:} false; then : $as_echo_n "(cached) " >&6 else - gl_cv_func_floorl_libm=? - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - long double (*funcptr) (long double) = floorl; - long double x; +#include + long double x; int main () { -x = funcptr (x) + floorl(x); +return ldexpl (x, -1) > 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - gl_cv_func_floorl_libm= + gl_cv_func_ldexpl_no_libm=yes +else + gl_cv_func_ldexpl_no_libm=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - if test "$gl_cv_func_floorl_libm" = "?"; then - save_LIBS="$LIBS" - LIBS="$LIBS -lm" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexpl_no_libm" >&5 +$as_echo "$gl_cv_func_ldexpl_no_libm" >&6; } + + if test $gl_cv_func_ldexpl_no_libm = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexpl() can be used with libm" >&5 +$as_echo_n "checking whether ldexpl() can be used with libm... " >&6; } +if ${gl_cv_func_ldexpl_in_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + save_LIBS="$LIBS" + LIBS="$LIBS -lm" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - long double (*funcptr) (long double) = floorl; - long double x; +#include + long double x; int main () { -x = funcptr (x) + floorl(x); +return ldexpl (x, -1) > 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - gl_cv_func_floorl_libm="-lm" + gl_cv_func_ldexpl_in_libm=yes +else + gl_cv_func_ldexpl_in_libm=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexpl_in_libm" >&5 +$as_echo "$gl_cv_func_ldexpl_in_libm" >&6; } + if test $gl_cv_func_ldexpl_in_libm = yes; then + LDEXPL_LIBM=-lm + fi + fi + if test $gl_cv_func_ldexpl_no_libm = yes \ + || test $gl_cv_func_ldexpl_in_libm = yes; then + save_LIBS="$LIBS" + LIBS="$LIBS $LDEXPL_LIBM" + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexpl works" >&5 +$as_echo_n "checking whether ldexpl works... " >&6; } +if ${gl_cv_func_ldexpl_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + aix | aix[3-6]*) gl_cv_func_ldexpl_works="guessing no";; + *) gl_cv_func_ldexpl_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +extern +#ifdef __cplusplus +"C" +#endif +long double ldexpl (long double, int); +int main() +{ + int result = 0; + { + volatile long double x = 1.0; + volatile long double y = ldexpl (x, -1); + if (y != 0.5L) + result |= 1; + } + { + volatile long double x = 1.73205L; + volatile long double y = ldexpl (x, 0); + if (y != x) + result |= 2; + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_ldexpl_works=yes +else + gl_cv_func_ldexpl_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexpl_works" >&5 +$as_echo "$gl_cv_func_ldexpl_works" >&6; } + LIBS="$save_LIBS" + case "$gl_cv_func_ldexpl_works" in + *yes) gl_func_ldexpl=yes ;; + *) gl_func_ldexpl=no; REPLACE_LDEXPL=1 ;; + esac + else + gl_func_ldexpl=no + fi + if test $gl_func_ldexpl = yes; then + +$as_echo "#define HAVE_LDEXPL 1" >>confdefs.h + + fi + fi + if test $HAVE_DECL_LDEXPL = 0 || test $gl_func_ldexpl = no; then + if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then + + LDEXPL_LIBM="$LDEXP_LIBM" + else + LDEXPL_LIBM="$ISNANL_LIBM" fi + fi + + + + + + + + + for ac_header in $ac_header_list +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF fi - as_echo_n="$saved_as_echo_n" +done - FLOORL_LIBM="$gl_cv_func_floorl_libm" - saved_as_echo_n="$as_echo_n" - as_echo_n=':' - if ${gl_cv_func_ceill_libm+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used without linking with libm" >&5 +$as_echo_n "checking whether frexp() can be used without linking with libm... " >&6; } +if ${gl_cv_func_frexp_no_libm+:} false; then : $as_echo_n "(cached) " >&6 else - gl_cv_func_ceill_libm=? - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - long double (*funcptr) (long double) = ceill; - long double x; -int -main () -{ -x = funcptr(x) + ceill(x); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - gl_cv_func_ceill_libm= -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test "$gl_cv_func_ceill_libm" = "?"; then - save_LIBS="$LIBS" - LIBS="$LIBS -lm" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - long double (*funcptr) (long double) = ceill; - long double x; +#include + double x; int main () { -x = funcptr(x) + ceill(x); +int e; return frexp (x, &e) > 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - gl_cv_func_ceill_libm="-lm" + gl_cv_func_frexp_no_libm=yes +else + gl_cv_func_frexp_no_libm=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - LIBS="$save_LIBS" - fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_no_libm" >&5 +$as_echo "$gl_cv_func_frexp_no_libm" >&6; } - as_echo_n="$saved_as_echo_n" - - CEILL_LIBM="$gl_cv_func_ceill_libm" - - if test "$FLOORL_LIBM" != '?' && test "$CEILL_LIBM" != '?'; then +ac_fn_c_check_decl "$LINENO" "alarm" "ac_cv_have_decl_alarm" "$ac_includes_default" +if test "x$ac_cv_have_decl_alarm" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi -$as_echo "#define HAVE_FLOORL_AND_CEILL 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ALARM $ac_have_decl +_ACEOF - ROUNDL_LIBM= - case " $ROUNDL_LIBM " in - *" $FLOORL_LIBM "*) ;; - *) ROUNDL_LIBM="$ROUNDL_LIBM $FLOORL_LIBM" ;; - esac - case " $ROUNDL_LIBM " in - *" $CEILL_LIBM "*) ;; - *) ROUNDL_LIBM="$ROUNDL_LIBM $CEILL_LIBM" ;; - esac - else - ROUNDL_LIBM= - fi - else - ROUNDL_LIBM= - fi - fi - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexp() can be used without linking with libm" >&5 -$as_echo_n "checking whether ldexp() can be used without linking with libm... " >&6; } -if ${gl_cv_func_ldexp_no_libm+:} false; then : + FREXP_LIBM= + if test $gl_cv_func_frexp_no_libm = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used with libm" >&5 +$as_echo_n "checking whether frexp() can be used with libm... " >&6; } +if ${gl_cv_func_frexp_in_libm+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + save_LIBS="$LIBS" + LIBS="$LIBS -lm" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - double (*funcptr) (double, int) = ldexp; - double x; +#include + double x; int main () { -return ldexp (x, -1) > 0; +int e; return frexp (x, &e) > 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - gl_cv_func_ldexp_no_libm=yes + gl_cv_func_frexp_in_libm=yes else - gl_cv_func_ldexp_no_libm=no + gl_cv_func_frexp_in_libm=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexp_no_libm" >&5 -$as_echo "$gl_cv_func_ldexp_no_libm" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_in_libm" >&5 +$as_echo "$gl_cv_func_frexp_in_libm" >&6; } + if test $gl_cv_func_frexp_in_libm = yes; then + FREXP_LIBM=-lm + fi + fi + if test $gl_cv_func_frexp_no_libm = yes \ + || test $gl_cv_func_frexp_in_libm = yes; then + save_LIBS="$LIBS" + LIBS="$LIBS $FREXP_LIBM" - LDEXP_LIBM= - if test $gl_cv_func_ldexp_no_libm = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexp() can be used with libm" >&5 -$as_echo_n "checking whether ldexp() can be used with libm... " >&6; } -if ${gl_cv_func_ldexp_in_libm+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp works" >&5 +$as_echo_n "checking whether frexp works... " >&6; } +if ${gl_cv_func_frexp_works+:} false; then : $as_echo_n "(cached) " >&6 else - save_LIBS="$LIBS" - LIBS="$LIBS -lm" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test "$cross_compiling" = yes; then : + case "$host_os" in + netbsd* | irix* | mingw*) gl_cv_func_frexp_works="guessing no";; + *) gl_cv_func_frexp_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifndef __NO_MATH_INLINES - # define __NO_MATH_INLINES 1 /* for glibc */ - #endif - #include - double (*funcptr) (double, int) = ldexp; - double x; -int -main () + +#include +#include +#include +#if HAVE_DECL_ALARM +# include +# include +#endif +/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. + ICC 10.0 has a bug when optimizing the expression -zero. + The expression -DBL_MIN * DBL_MIN does not work when cross-compiling + to PowerPC on Mac OS X 10.5. */ +#if defined __hpux || defined __sgi || defined __ICC +static double +compute_minus_zero (void) { -return ldexp (x, -1) > 0; - ; - return 0; + return -DBL_MIN * DBL_MIN; +} +# define minus_zero compute_minus_zero () +#else +double minus_zero = -0.0; +#endif +int main() +{ + int result = 0; + int i; + volatile double x; + double zero = 0.0; +#if HAVE_DECL_ALARM + /* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite + number. Let the test fail in this case. */ + signal (SIGALRM, SIG_DFL); + alarm (5); +#endif + /* Test on denormalized numbers. */ + for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5) + ; + if (x > 0.0) + { + int exp; + double y = frexp (x, &exp); + /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022. + On NetBSD: y = 0.75. Correct: y = 0.5. */ + if (y != 0.5) + result |= 1; + } + /* Test on infinite numbers. */ + x = 1.0 / zero; + { + int exp; + double y = frexp (x, &exp); + if (y != x) + result |= 2; + } + /* Test on negative zero. */ + x = minus_zero; + { + int exp; + double y = frexp (x, &exp); + if (memcmp (&y, &x, sizeof x)) + result |= 4; + } + return result; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - gl_cv_func_ldexp_in_libm=yes +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_frexp_works=yes else - gl_cv_func_ldexp_in_libm=no + gl_cv_func_frexp_works=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$save_LIBS" +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexp_in_libm" >&5 -$as_echo "$gl_cv_func_ldexp_in_libm" >&6; } - if test $gl_cv_func_ldexp_in_libm = yes; then - LDEXP_LIBM=-lm - fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_works" >&5 +$as_echo "$gl_cv_func_frexp_works" >&6; } + + LIBS="$save_LIBS" + case "$gl_cv_func_frexp_works" in + *yes) gl_func_frexp=yes ;; + *) gl_func_frexp=no; REPLACE_FREXP=1; FREXP_LIBM= ;; + esac + else + gl_func_frexp=no + fi + if test $gl_func_frexp = yes; then + +$as_echo "#define HAVE_FREXP 1" >>confdefs.h + fi @@ -8970,21 +9626,21 @@ - ac_fn_c_check_decl "$LINENO" "ldexpl" "ac_cv_have_decl_ldexpl" "#include + ac_fn_c_check_decl "$LINENO" "frexpl" "ac_cv_have_decl_frexpl" "#include " -if test "x$ac_cv_have_decl_ldexpl" = xyes; then : +if test "x$ac_cv_have_decl_frexpl" = xyes; then : else - HAVE_DECL_LDEXPL=0 + HAVE_DECL_FREXPL=0 fi - LDEXPL_LIBM= - if test $HAVE_DECL_LDEXPL = 1; then + FREXPL_LIBM= + if test $HAVE_DECL_FREXPL = 1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexpl() can be used without linking with libm" >&5 -$as_echo_n "checking whether ldexpl() can be used without linking with libm... " >&6; } -if ${gl_cv_func_ldexpl_no_libm+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used without linking with libm" >&5 +$as_echo_n "checking whether frexpl() can be used without linking with libm... " >&6; } +if ${gl_cv_func_frexpl_no_libm+:} false; then : $as_echo_n "(cached) " >&6 else @@ -8995,27 +9651,27 @@ int main () { -return ldexpl (x, -1) > 0; +int e; return frexpl (x, &e) > 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - gl_cv_func_ldexpl_no_libm=yes + gl_cv_func_frexpl_no_libm=yes else - gl_cv_func_ldexpl_no_libm=no + gl_cv_func_frexpl_no_libm=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexpl_no_libm" >&5 -$as_echo "$gl_cv_func_ldexpl_no_libm" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_no_libm" >&5 +$as_echo "$gl_cv_func_frexpl_no_libm" >&6; } - if test $gl_cv_func_ldexpl_no_libm = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexpl() can be used with libm" >&5 -$as_echo_n "checking whether ldexpl() can be used with libm... " >&6; } -if ${gl_cv_func_ldexpl_in_libm+:} false; then : + if test $gl_cv_func_frexpl_no_libm = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used with libm" >&5 +$as_echo_n "checking whether frexpl() can be used with libm... " >&6; } +if ${gl_cv_func_frexpl_in_libm+:} false; then : $as_echo_n "(cached) " >&6 else @@ -9028,175 +9684,181 @@ int main () { -return ldexpl (x, -1) > 0; +int e; return frexpl (x, &e) > 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - gl_cv_func_ldexpl_in_libm=yes + gl_cv_func_frexpl_in_libm=yes else - gl_cv_func_ldexpl_in_libm=no + gl_cv_func_frexpl_in_libm=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$save_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexpl_in_libm" >&5 -$as_echo "$gl_cv_func_ldexpl_in_libm" >&6; } - if test $gl_cv_func_ldexpl_in_libm = yes; then - LDEXPL_LIBM=-lm +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_in_libm" >&5 +$as_echo "$gl_cv_func_frexpl_in_libm" >&6; } + if test $gl_cv_func_frexpl_in_libm = yes; then + FREXPL_LIBM=-lm fi fi - if test $gl_cv_func_ldexpl_no_libm = yes \ - || test $gl_cv_func_ldexpl_in_libm = yes; then + if test $gl_cv_func_frexpl_no_libm = yes \ + || test $gl_cv_func_frexpl_in_libm = yes; then save_LIBS="$LIBS" - LIBS="$LIBS $LDEXPL_LIBM" + LIBS="$LIBS $FREXPL_LIBM" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexpl works" >&5 -$as_echo_n "checking whether ldexpl works... " >&6; } -if ${gl_cv_func_ldexpl_works+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl works" >&5 +$as_echo_n "checking whether frexpl works... " >&6; } +if ${gl_cv_func_frexpl_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : case "$host_os" in - aix | aix[3-6]*) gl_cv_func_ldexpl_works="guessing no";; - *) gl_cv_func_ldexpl_works="guessing yes";; + aix | aix[3-6]* | beos* | darwin* | irix* | mingw* | pw*) + gl_cv_func_frexpl_works="guessing no";; + *) gl_cv_func_frexpl_works="guessing yes";; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include #include +/* Override the values of , like done in float.in.h. */ +#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__) +# undef LDBL_MIN_EXP +# define LDBL_MIN_EXP (-16381) +#endif +#if defined __i386__ && defined __FreeBSD__ +# undef LDBL_MIN_EXP +# define LDBL_MIN_EXP (-16381) +#endif +#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__ +# undef LDBL_MIN_EXP +# define LDBL_MIN_EXP DBL_MIN_EXP +#endif +#if defined __sgi && (LDBL_MANT_DIG >= 106) +# if defined __GNUC__ +# undef LDBL_MIN_EXP +# define LDBL_MIN_EXP DBL_MIN_EXP +# endif +#endif extern #ifdef __cplusplus "C" #endif -long double ldexpl (long double, int); +long double frexpl (long double, int *); int main() { int result = 0; + volatile long double x; + /* Test on finite numbers that fails on AIX 5.1. */ + x = 16.0L; { - volatile long double x = 1.0; - volatile long double y = ldexpl (x, -1); - if (y != 0.5L) + int exp = -9999; + frexpl (x, &exp); + if (exp != 5) result |= 1; } + /* Test on finite numbers that fails on Mac OS X 10.4, because its frexpl + function returns an invalid (incorrectly normalized) value: it returns + y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 } + but the correct result is + 0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 } */ + x = 1.01L; { - volatile long double x = 1.73205L; - volatile long double y = ldexpl (x, 0); - if (y != x) + int exp = -9999; + long double y = frexpl (x, &exp); + if (!(exp == 1 && y == 0.505L)) result |= 2; } - return result; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_ldexpl_works=yes -else - gl_cv_func_ldexpl_works=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexpl_works" >&5 -$as_echo "$gl_cv_func_ldexpl_works" >&6; } - - LIBS="$save_LIBS" - case "$gl_cv_func_ldexpl_works" in - *yes) gl_func_ldexpl=yes ;; - *) gl_func_ldexpl=no; REPLACE_LDEXPL=1 ;; - esac - else - gl_func_ldexpl=no - fi - if test $gl_func_ldexpl = yes; then - -$as_echo "#define HAVE_LDEXPL 1" >>confdefs.h - - fi - fi - if test $HAVE_DECL_LDEXPL = 0 || test $gl_func_ldexpl = no; then - if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then - - LDEXPL_LIBM="$LDEXP_LIBM" - else - LDEXPL_LIBM="$ISNANL_LIBM" - fi - fi - - - - - - - - - for ac_header in $ac_header_list -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used without linking with libm" >&5 -$as_echo_n "checking whether frexp() can be used without linking with libm... " >&6; } -if ${gl_cv_func_frexp_no_libm+:} false; then : - $as_echo_n "(cached) " >&6 -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - double x; -int -main () -{ -int e; return frexp (x, &e) > 0; - ; - return 0; + /* Test on large finite numbers. This fails on BeOS at i = 16322, while + LDBL_MAX_EXP = 16384. + In the loop end test, we test x against Infinity, rather than comparing + i with LDBL_MAX_EXP, because BeOS has a wrong LDBL_MAX_EXP. */ + { + int i; + for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L) + { + int exp = -9999; + frexpl (x, &exp); + if (exp != i) + { + result |= 4; + break; + } + } + } + /* Test on denormalized numbers. */ + { + int i; + for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L) + ; + if (x > 0.0L) + { + int exp; + long double y = frexpl (x, &exp); + /* On machines with IEEE854 arithmetic: x = 1.68105e-4932, + exp = -16382, y = 0.5. On Mac OS X 10.5: exp = -16384, y = 0.5. */ + if (exp != LDBL_MIN_EXP - 1) + result |= 8; + } + } + /* Test on infinite numbers. */ + x = 1.0L / 0.0L; + { + int exp; + long double y = frexpl (x, &exp); + if (y != x) + result |= 16; + } + return result; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - gl_cv_func_frexp_no_libm=yes +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_frexpl_works=yes else - gl_cv_func_frexp_no_libm=no + gl_cv_func_frexpl_works=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_no_libm" >&5 -$as_echo "$gl_cv_func_frexp_no_libm" >&6; } -ac_fn_c_check_decl "$LINENO" "alarm" "ac_cv_have_decl_alarm" "$ac_includes_default" -if test "x$ac_cv_have_decl_alarm" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_works" >&5 +$as_echo "$gl_cv_func_frexpl_works" >&6; } + + LIBS="$save_LIBS" + case "$gl_cv_func_frexpl_works" in + *yes) gl_func_frexpl=yes ;; + *) gl_func_frexpl=no; REPLACE_FREXPL=1 ;; + esac + else + gl_func_frexpl=no + fi + if test $gl_func_frexpl = yes; then + +$as_echo "#define HAVE_FREXPL 1" >>confdefs.h + + fi + fi + if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then + if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then + + FREXPL_LIBM="$FREXP_LIBM" + else + FREXPL_LIBM= + fi + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_ALARM $ac_have_decl -_ACEOF GNULIB_CHDIR=0; @@ -9282,6 +9944,7 @@ HAVE_DECL_FCHDIR=1; HAVE_DECL_FDATASYNC=1; HAVE_DECL_GETDOMAINNAME=1; + HAVE_DECL_GETLOGIN=1; HAVE_DECL_GETLOGIN_R=1; HAVE_DECL_GETPAGESIZE=1; HAVE_DECL_GETUSERSHELL=1; @@ -9743,11 +10406,12 @@ #else /* Avoid a crash on POSIX systems. */ #include +#include /* A POSIX signal handler. */ static void exception_handler (int sig) { - exit (1); + _exit (1); } static void nocrash_init (void) @@ -9959,6 +10623,25 @@ _ACEOF + + + for ac_func in $ac_func_list +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + + + if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else @@ -10975,72 +11658,287 @@ $am_cv_proto_iconv" >&5 $as_echo " $am_cv_proto_iconv" >&6; } + else + am_cv_proto_iconv_arg1="" + fi cat >>confdefs.h <<_ACEOF #define ICONV_CONST $am_cv_proto_iconv_arg1 _ACEOF - if test -n "$am_cv_proto_iconv_arg1"; then - ICONV_CONST="const" - fi + if test -n "$am_cv_proto_iconv_arg1"; then + ICONV_CONST="const" + fi + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + +ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" +if test "x$ac_cv_type_off_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define off_t long int +_ACEOF + +fi + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_limits_h='<'limits.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if ${gl_cv_next_limits_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_limits_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'limits.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_limits_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_limits_h + gl_cv_next_limits_h='"'$gl_header'"' + else + gl_cv_next_limits_h='<'limits.h'>' + fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_limits_h" >&5 +$as_echo "$gl_cv_next_limits_h" >&6; } + fi + NEXT_LIMITS_H=$gl_cv_next_limits_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'limits.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_limits_h + fi + NEXT_AS_FIRST_DIRECTIVE_LIMITS_H=$gl_next_as_first_directive + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether limits.h has ULLONG_WIDTH etc." >&5 +$as_echo_n "checking whether limits.h has ULLONG_WIDTH etc.... " >&6; } +if ${gl_cv_header_limits_width+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ + #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 + #endif + #include + int ullw = ULLONG_WIDTH; +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_limits_width=yes +else + gl_cv_header_limits_width=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_limits_width" >&5 +$as_echo "$gl_cv_header_limits_width" >&6; } + if test "$gl_cv_header_limits_width" = yes; then + LIMITS_H= + else + LIMITS_H=limits.h fi + if test -n "$LIMITS_H"; then + GL_GENERATE_LIMITS_H_TRUE= + GL_GENERATE_LIMITS_H_FALSE='#' +else + GL_GENERATE_LIMITS_H_TRUE='#' + GL_GENERATE_LIMITS_H_FALSE= +fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5 +$as_echo_n "checking for wint_t... " >&6; } +if ${gt_cv_c_wint_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include +#include + wint_t foo = (wchar_t)'\0'; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gt_cv_c_wint_t=yes +else + gt_cv_c_wint_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5 +$as_echo "$gt_cv_c_wint_t" >&6; } + if test $gt_cv_c_wint_t = yes; then + +$as_echo "#define HAVE_WINT_T 1" >>confdefs.h -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 -$as_echo_n "checking for inline... " >&6; } -if ${ac_cv_c_inline+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wint_t is too small" >&5 +$as_echo_n "checking whether wint_t is too small... " >&6; } +if ${gl_cv_type_wint_t_too_small+:} false; then : $as_echo_n "(cached) " >&6 else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } + +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +# include +# include #endif +#include + int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1]; + +int +main () +{ + ; + return 0; +} _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_inline=$ac_kw + gl_cv_type_wint_t_too_small=no +else + gl_cv_type_wint_t_too_small=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_inline" != no && break -done - fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 -$as_echo "$ac_cv_c_inline" >&6; } - -case $ac_cv_c_inline in - inline | yes) ;; - *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; - esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val -#endif -_ACEOF - ;; -esac - -ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" -if test "x$ac_cv_type_off_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define off_t long int -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wint_t_too_small" >&5 +$as_echo "$gl_cv_type_wint_t_too_small" >&6; } + if test $gl_cv_type_wint_t_too_small = yes; then + GNULIB_OVERRIDES_WINT_T=1 + else + GNULIB_OVERRIDES_WINT_T=0 + fi + else + GNULIB_OVERRIDES_WINT_T=0 + fi -fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5 @@ -11208,6 +12106,9 @@ + + + if test $ac_cv_type_long_long_int = yes; then HAVE_LONG_LONG_INT=1 else @@ -11341,6 +12242,8 @@ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 #include /* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in . */ #if !(defined WCHAR_MIN && defined WCHAR_MAX) @@ -11431,6 +12334,15 @@ intmax_t i = INTMAX_MAX; uintmax_t j = UINTMAX_MAX; +/* Check that SIZE_MAX has the correct type, if possible. */ +#if 201112 <= __STDC_VERSION__ +int k = _Generic (SIZE_MAX, size_t: 0); +#elif (2 <= __GNUC__ || defined __IBM__TYPEOF__ \ + || (0x5110 <= __SUNPRO_C && !__STDC__)) +extern size_t k; +extern __typeof__ (SIZE_MAX) k; +#endif + #include /* for CHAR_BIT */ #define TYPE_MINIMUM(t) \ ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t))) @@ -11509,6 +12421,8 @@ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 #include @@ -11594,8 +12508,111 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5 $as_echo "$gl_cv_header_working_stdint_h" >&6; } fi + + HAVE_C99_STDINT_H=0 + HAVE_SYS_BITYPES_H=0 + HAVE_SYS_INTTYPES_H=0 + STDINT_H=stdint.h if test "$gl_cv_header_working_stdint_h" = yes; then - STDINT_H= + HAVE_C99_STDINT_H=1 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h predates C++11" >&5 +$as_echo_n "checking whether stdint.h predates C++11... " >&6; } +if ${gl_cv_header_stdint_predates_cxx11_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + gl_cv_header_stdint_predates_cxx11_h=yes + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include + + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + +intmax_t im = INTMAX_MAX; +int32_t i32 = INT32_C (0x7fffffff); + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_stdint_predates_cxx11_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_predates_cxx11_h" >&5 +$as_echo "$gl_cv_header_stdint_predates_cxx11_h" >&6; } + + if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then + +$as_echo "#define __STDC_CONSTANT_MACROS 1" >>confdefs.h + + +$as_echo "#define __STDC_LIMIT_MACROS 1" >>confdefs.h + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h has UINTMAX_WIDTH etc." >&5 +$as_echo_n "checking whether stdint.h has UINTMAX_WIDTH etc.... " >&6; } +if ${gl_cv_header_stdint_width+:} false; then : + $as_echo_n "(cached) " >&6 +else + gl_cv_header_stdint_width=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 + #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ + #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 + #endif + #include + + /* BSD/OS 4.0.1 has a bug: , and must be + included before . */ + #include + #include + #if HAVE_WCHAR_H + # include + # include + # include + #endif + + int iw = UINTMAX_WIDTH; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_stdint_width=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_width" >&5 +$as_echo "$gl_cv_header_stdint_width" >&6; } + if test "$gl_cv_header_stdint_width" = yes; then + STDINT_H= + fi else for ac_header in sys/inttypes.h sys/bitypes.h do : @@ -11612,19 +12629,12 @@ if test $ac_cv_header_sys_inttypes_h = yes; then HAVE_SYS_INTTYPES_H=1 - else - HAVE_SYS_INTTYPES_H=0 fi - if test $ac_cv_header_sys_bitypes_h = yes; then HAVE_SYS_BITYPES_H=1 - else - HAVE_SYS_BITYPES_H=0 fi - - if test $APPLE_UNIVERSAL_BUILD = 0; then @@ -11918,13 +12928,26 @@ - if test $BITSIZEOF_WINT_T -lt 32; then + if test $GNULIB_OVERRIDES_WINT_T = 1; then BITSIZEOF_WINT_T=32 fi - STDINT_H=stdint.h fi + LIMITS_H=limits.h + if test -n "$LIMITS_H"; then + GL_GENERATE_LIMITS_H_TRUE= + GL_GENERATE_LIMITS_H_FALSE='#' +else + GL_GENERATE_LIMITS_H_TRUE='#' + GL_GENERATE_LIMITS_H_FALSE= +fi + + + + + + if test -n "$STDINT_H"; then GL_GENERATE_STDINT_H_TRUE= GL_GENERATE_STDINT_H_FALSE='#' @@ -12143,21 +13166,6 @@ - for ac_func in $ac_func_list -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5 $as_echo_n "checking where to find the exponent in a 'double'... " >&6; } if ${gl_cv_cc_double_expbit0+:} false; then : @@ -12374,36 +13382,144 @@ } _ACEOF if ac_fn_c_try_run "$LINENO"; then : - ac_cv_c_bigendian=no + ac_cv_c_bigendian=no +else + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +: + case $ac_cv_c_bigendian in #( + yes) + gl_cv_cc_double_expbit0="word 0 bit 20";; #( + no) + gl_cv_cc_double_expbit0="word 1 bit 20" ;; #( + universal) + +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + gl_cv_cc_double_expbit0="unknown" ;; + esac + + +fi +rm -f conftest* + + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#include +#define NWORDS \ + ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { double value; unsigned int word[NWORDS]; } memory_double; +static unsigned int ored_words[NWORDS]; +static unsigned int anded_words[NWORDS]; +static void add_to_ored_words (double x) +{ + memory_double m; + size_t i; + /* Clear it first, in case sizeof (double) < sizeof (memory_double). */ + memset (&m, 0, sizeof (memory_double)); + m.value = x; + for (i = 0; i < NWORDS; i++) + { + ored_words[i] |= m.word[i]; + anded_words[i] &= m.word[i]; + } +} +int main () +{ + size_t j; + FILE *fp = fopen ("conftest.out", "w"); + if (fp == NULL) + return 1; + for (j = 0; j < NWORDS; j++) + anded_words[j] = ~ (unsigned int) 0; + add_to_ored_words (0.25); + add_to_ored_words (0.5); + add_to_ored_words (1.0); + add_to_ored_words (2.0); + add_to_ored_words (4.0); + /* Remove bits that are common (e.g. if representation of the first mantissa + bit is explicit). */ + for (j = 0; j < NWORDS; j++) + ored_words[j] &= ~anded_words[j]; + /* Now find the nonzero word. */ + for (j = 0; j < NWORDS; j++) + if (ored_words[j] != 0) + break; + if (j < NWORDS) + { + size_t i; + for (i = j + 1; i < NWORDS; i++) + if (ored_words[i] != 0) + { + fprintf (fp, "unknown"); + return (fclose (fp) != 0); + } + for (i = 0; ; i++) + if ((ored_words[j] >> i) & 1) + { + fprintf (fp, "word %d bit %d", (int) j, (int) i); + return (fclose (fp) != 0); + } + } + fprintf (fp, "unknown"); + return (fclose (fp) != 0); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_cc_double_expbit0=`cat conftest.out` else - ac_cv_c_bigendian=yes + gl_cv_cc_double_expbit0="unknown" fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi - fi + rm -f conftest.out + fi -: - case $ac_cv_c_bigendian in #( - yes) - gl_cv_cc_double_expbit0="word 0 bit 20";; #( - no) - gl_cv_cc_double_expbit0="word 1 bit 20" ;; #( - universal) +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5 +$as_echo "$gl_cv_cc_double_expbit0" >&6; } + case "$gl_cv_cc_double_expbit0" in + word*bit*) + word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'` -$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define DBL_EXPBIT0_WORD $word +_ACEOF - ;; #( - *) - gl_cv_cc_double_expbit0="unknown" ;; - esac +cat >>confdefs.h <<_ACEOF +#define DBL_EXPBIT0_BIT $bit +_ACEOF -fi -rm -f conftest* + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'float'" >&5 +$as_echo_n "checking where to find the exponent in a 'float'... " >&6; } +if ${gl_cv_cc_float_expbit0+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + gl_cv_cc_float_expbit0="word 0 bit 23" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -12413,16 +13529,17 @@ #include #include #define NWORDS \ - ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) -typedef union { double value; unsigned int word[NWORDS]; } memory_double; + ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { float value; unsigned int word[NWORDS]; } memory_float; static unsigned int ored_words[NWORDS]; static unsigned int anded_words[NWORDS]; -static void add_to_ored_words (double x) +static void add_to_ored_words (float x) { - memory_double m; + memory_float m; size_t i; - /* Clear it first, in case sizeof (double) < sizeof (memory_double). */ - memset (&m, 0, sizeof (memory_double)); + /* Clear it first, in case + sizeof (float) < sizeof (memory_float). */ + memset (&m, 0, sizeof (memory_float)); m.value = x; for (i = 0; i < NWORDS; i++) { @@ -12438,11 +13555,11 @@ return 1; for (j = 0; j < NWORDS; j++) anded_words[j] = ~ (unsigned int) 0; - add_to_ored_words (0.25); - add_to_ored_words (0.5); - add_to_ored_words (1.0); - add_to_ored_words (2.0); - add_to_ored_words (4.0); + add_to_ored_words (0.25f); + add_to_ored_words (0.5f); + add_to_ored_words (1.0f); + add_to_ored_words (2.0f); + add_to_ored_words (4.0f); /* Remove bits that are common (e.g. if representation of the first mantissa bit is explicit). */ for (j = 0; j < NWORDS; j++) @@ -12473,162 +13590,366 @@ _ACEOF if ac_fn_c_try_run "$LINENO"; then : - gl_cv_cc_double_expbit0=`cat conftest.out` + gl_cv_cc_float_expbit0=`cat conftest.out` +else + gl_cv_cc_float_expbit0="unknown" +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + rm -f conftest.out + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_expbit0" >&5 +$as_echo "$gl_cv_cc_float_expbit0" >&6; } + case "$gl_cv_cc_float_expbit0" in + word*bit*) + word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` + bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'` + +cat >>confdefs.h <<_ACEOF +#define FLT_EXPBIT0_WORD $word +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define FLT_EXPBIT0_BIT $bit +_ACEOF + + ;; + esac + + + GNULIB_ISWBLANK=0; + GNULIB_WCTYPE=0; + GNULIB_ISWCTYPE=0; + GNULIB_WCTRANS=0; + GNULIB_TOWCTRANS=0; + HAVE_ISWBLANK=1; + HAVE_WCTYPE_T=1; + HAVE_WCTRANS_T=1; + REPLACE_ISWBLANK=0; + + + + + + + + + + + if test $ac_cv_func_iswcntrl = yes; then + HAVE_ISWCNTRL=1 + else + HAVE_ISWCNTRL=0 + fi + + + + if test $gt_cv_c_wint_t = yes; then + HAVE_WINT_T=1 + else + HAVE_WINT_T=0 + fi + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_wctype_h='<'wctype.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if ${gl_cv_next_wctype_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_wctype_h = yes; then + + + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'wctype.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_wctype_h + gl_cv_next_wctype_h='"'$gl_header'"' + else + gl_cv_next_wctype_h='<'wctype.h'>' + fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5 +$as_echo "$gl_cv_next_wctype_h" >&6; } + fi + NEXT_WCTYPE_H=$gl_cv_next_wctype_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'wctype.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_wctype_h + fi + NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_wctype_h = yes; then + if test $ac_cv_func_iswcntrl = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5 +$as_echo_n "checking whether iswcntrl works... " >&6; } +if ${gl_cv_func_iswcntrl_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #if __GNU_LIBRARY__ == 1 + Linux libc5 i18n is broken. + #endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_func_iswcntrl_works="guessing yes" +else + gl_cv_func_iswcntrl_works="guessing no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + /* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #include + int main () { return iswprint ('x') == 0; } + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_iswcntrl_works=yes else - gl_cv_cc_double_expbit0="unknown" + gl_cv_func_iswcntrl_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi - rm -f conftest.out fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5 -$as_echo "$gl_cv_cc_double_expbit0" >&6; } - case "$gl_cv_cc_double_expbit0" in - word*bit*) - word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` - bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'` +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5 +$as_echo "$gl_cv_func_iswcntrl_works" >&6; } + fi + HAVE_WCTYPE_H=1 + else + HAVE_WCTYPE_H=0 + fi -cat >>confdefs.h <<_ACEOF -#define DBL_EXPBIT0_WORD $word + + case "$gl_cv_func_iswcntrl_works" in + *yes) REPLACE_ISWCNTRL=0 ;; + *) REPLACE_ISWCNTRL=1 ;; + esac + + + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then + : + fi + + if test $REPLACE_ISWCNTRL = 1; then + REPLACE_TOWLOWER=1 + else + for ac_func in towlower +do : + ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower" +if test "x$ac_cv_func_towlower" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_TOWLOWER 1 _ACEOF +fi +done + + if test $ac_cv_func_towlower = yes; then + REPLACE_TOWLOWER=0 + else + ac_fn_c_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #if HAVE_WCTYPE_H + # include + #endif + +" +if test "x$ac_cv_have_decl_towlower" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi cat >>confdefs.h <<_ACEOF -#define DBL_EXPBIT0_BIT $bit +#define HAVE_DECL_TOWLOWER $ac_have_decl _ACEOF - ;; - esac + if test $ac_cv_have_decl_towlower = yes; then + REPLACE_TOWLOWER=1 + else + REPLACE_TOWLOWER=0 + fi + fi + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'float'" >&5 -$as_echo_n "checking where to find the exponent in a 'float'... " >&6; } -if ${gl_cv_cc_float_expbit0+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then + : + fi - if test "$cross_compiling" = yes; then : - gl_cv_cc_float_expbit0="word 0 bit 23" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5 +$as_echo_n "checking for wctype_t... " >&6; } +if ${gl_cv_type_wctype_t+:} false; then : + $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #if HAVE_WCTYPE_H + # include + #endif + wctype_t a; -#include -#include -#include -#include -#define NWORDS \ - ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) -typedef union { float value; unsigned int word[NWORDS]; } memory_float; -static unsigned int ored_words[NWORDS]; -static unsigned int anded_words[NWORDS]; -static void add_to_ored_words (float x) -{ - memory_float m; - size_t i; - /* Clear it first, in case - sizeof (float) < sizeof (memory_float). */ - memset (&m, 0, sizeof (memory_float)); - m.value = x; - for (i = 0; i < NWORDS; i++) - { - ored_words[i] |= m.word[i]; - anded_words[i] &= m.word[i]; - } -} -int main () +int +main () { - size_t j; - FILE *fp = fopen ("conftest.out", "w"); - if (fp == NULL) - return 1; - for (j = 0; j < NWORDS; j++) - anded_words[j] = ~ (unsigned int) 0; - add_to_ored_words (0.25f); - add_to_ored_words (0.5f); - add_to_ored_words (1.0f); - add_to_ored_words (2.0f); - add_to_ored_words (4.0f); - /* Remove bits that are common (e.g. if representation of the first mantissa - bit is explicit). */ - for (j = 0; j < NWORDS; j++) - ored_words[j] &= ~anded_words[j]; - /* Now find the nonzero word. */ - for (j = 0; j < NWORDS; j++) - if (ored_words[j] != 0) - break; - if (j < NWORDS) - { - size_t i; - for (i = j + 1; i < NWORDS; i++) - if (ored_words[i] != 0) - { - fprintf (fp, "unknown"); - return (fclose (fp) != 0); - } - for (i = 0; ; i++) - if ((ored_words[j] >> i) & 1) - { - fprintf (fp, "word %d bit %d", (int) j, (int) i); - return (fclose (fp) != 0); - } - } - fprintf (fp, "unknown"); - return (fclose (fp) != 0); -} + ; + return 0; +} _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - gl_cv_cc_float_expbit0=`cat conftest.out` +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_type_wctype_t=yes else - gl_cv_cc_float_expbit0="unknown" -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + gl_cv_type_wctype_t=no fi - - rm -f conftest.out +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_expbit0" >&5 -$as_echo "$gl_cv_cc_float_expbit0" >&6; } - case "$gl_cv_cc_float_expbit0" in - word*bit*) - word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'` - bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'` +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5 +$as_echo "$gl_cv_type_wctype_t" >&6; } + if test $gl_cv_type_wctype_t = no; then + HAVE_WCTYPE_T=0 + fi -cat >>confdefs.h <<_ACEOF -#define FLT_EXPBIT0_WORD $word -_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5 +$as_echo_n "checking for wctrans_t... " >&6; } +if ${gl_cv_type_wctrans_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Tru64 with Desktop Toolkit C has a bug: must be + included before . + BSD/OS 4.0.1 has a bug: , and + must be included before . */ + #include + #include + #include + #include + #include + wctrans_t a; +int +main () +{ -cat >>confdefs.h <<_ACEOF -#define FLT_EXPBIT0_BIT $bit + ; + return 0; +} _ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_type_wctrans_t=yes +else + gl_cv_type_wctrans_t=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ;; - esac - - - GNULIB_ISWBLANK=0; - GNULIB_WCTYPE=0; - GNULIB_ISWCTYPE=0; - GNULIB_WCTRANS=0; - GNULIB_TOWCTRANS=0; - HAVE_ISWBLANK=1; - HAVE_WCTYPE_T=1; - HAVE_WCTRANS_T=1; - REPLACE_ISWBLANK=0; - - +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5 +$as_echo "$gl_cv_type_wctrans_t" >&6; } + if test $gl_cv_type_wctrans_t = no; then + HAVE_WCTRANS_T=0 + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5 -$as_echo_n "checking for wint_t... " >&6; } -if ${gt_cv_c_wint_t+:} false; then : + for gl_func in wctype iswctype wctrans towctrans ; do + as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } +if eval \${$as_gl_Symbol+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12636,325 +13957,304 @@ /* Tru64 with Desktop Toolkit C has a bug: must be included before . - BSD/OS 4.0.1 has a bug: , and must be included - before . */ -#include -#include -#include -#include - wint_t foo = (wchar_t)'\0'; + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +# include +# include +# include +#endif +#include + int main () { - +#undef $gl_func + (void) $gl_func; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - gt_cv_c_wint_t=yes + eval "$as_gl_Symbol=yes" else - gt_cv_c_wint_t=no + eval "$as_gl_Symbol=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5 -$as_echo "$gt_cv_c_wint_t" >&6; } - if test $gt_cv_c_wint_t = yes; then - -$as_echo "#define HAVE_WINT_T 1" >>confdefs.h - - fi - - - - - - - - - if test $ac_cv_func_iswcntrl = yes; then - HAVE_ISWCNTRL=1 - else - HAVE_ISWCNTRL=0 - fi - - - - if test $gt_cv_c_wint_t = yes; then - HAVE_WINT_T=1 - else - HAVE_WINT_T=0 - fi - - - - - +eval ac_res=\$$as_gl_Symbol + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF + eval ac_cv_have_decl_$gl_func=yes +fi + done - if test $gl_cv_have_include_next = yes; then - gl_cv_next_wctype_h='<'wctype.h'>' - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 -$as_echo_n "checking absolute name of ... " >&6; } -if ${gl_cv_next_wctype_h+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5 +$as_echo_n "checking for nl_langinfo and CODESET... " >&6; } +if ${am_cv_langinfo_codeset+:} false; then : $as_echo_n "(cached) " >&6 else - - if test $ac_cv_header_wctype_h = yes; then - - - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +#include +int +main () +{ +char* cs = nl_langinfo(CODESET); return !cs; + ; + return 0; +} _ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac +if ac_fn_c_try_link "$LINENO"; then : + am_cv_langinfo_codeset=yes +else + am_cv_langinfo_codeset=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' - gl_header_literal_regex=`echo 'wctype.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5 +$as_echo "$am_cv_langinfo_codeset" >&6; } + if test $am_cv_langinfo_codeset = yes; then - gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"` +$as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h - gl_header=$gl_cv_absolute_wctype_h - gl_cv_next_wctype_h='"'$gl_header'"' - else - gl_cv_next_wctype_h='<'wctype.h'>' - fi + fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5 -$as_echo "$gl_cv_next_wctype_h" >&6; } - fi - NEXT_WCTYPE_H=$gl_cv_next_wctype_h - if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then - # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' - gl_next_as_first_directive='<'wctype.h'>' - else - # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' - gl_next_as_first_directive=$gl_cv_next_wctype_h - fi - NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive - if test $ac_cv_header_wctype_h = yes; then - if test $ac_cv_func_iswcntrl = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5 -$as_echo_n "checking whether iswcntrl works... " >&6; } -if ${gl_cv_func_iswcntrl_works+:} false; then : + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fcntl.h" >&5 +$as_echo_n "checking for working fcntl.h... " >&6; } +if ${gl_cv_header_working_fcntl_h+:} false; then : $as_echo_n "(cached) " >&6 else - - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes; then : + gl_cv_header_working_fcntl_h=cross-compiling +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include - #if __GNU_LIBRARY__ == 1 - Linux libc5 i18n is broken. - #endif +#include + #include + #if HAVE_UNISTD_H + # include + #else /* on Windows with MSVC */ + # include + # include + # defined sleep(n) _sleep ((n) * 1000) + #endif + #include + #ifndef O_NOATIME + #define O_NOATIME 0 + #endif + #ifndef O_NOFOLLOW + #define O_NOFOLLOW 0 + #endif + static int const constants[] = + { + O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND, + O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY + }; + int main () { + int result = !constants; + #if HAVE_SYMLINK + { + static char const sym[] = "conftest.sym"; + if (symlink ("/dev/null", sym) != 0) + result |= 2; + else + { + int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0); + if (fd >= 0) + { + close (fd); + result |= 4; + } + } + if (unlink (sym) != 0 || symlink (".", sym) != 0) + result |= 2; + else + { + int fd = open (sym, O_RDONLY | O_NOFOLLOW); + if (fd >= 0) + { + close (fd); + result |= 4; + } + } + unlink (sym); + } + #endif + { + static char const file[] = "confdefs.h"; + int fd = open (file, O_RDONLY | O_NOATIME); + if (fd < 0) + result |= 8; + else + { + struct stat st0; + if (fstat (fd, &st0) != 0) + result |= 16; + else + { + char c; + sleep (1); + if (read (fd, &c, 1) != 1) + result |= 24; + else + { + if (close (fd) != 0) + result |= 32; + else + { + struct stat st1; + if (stat (file, &st1) != 0) + result |= 40; + else + if (st0.st_atime != st1.st_atime) + result |= 64; + } + } + } + } + } + return result; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_func_iswcntrl_works="guessing yes" -else - gl_cv_func_iswcntrl_works="guessing no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - /* Tru64 with Desktop Toolkit C has a bug: must be - included before . - BSD/OS 4.0.1 has a bug: , and - must be included before . */ - #include - #include - #include - #include - #include - int main () { return iswprint ('x') == 0; } - -_ACEOF if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_iswcntrl_works=yes + gl_cv_header_working_fcntl_h=yes else - gl_cv_func_iswcntrl_works=no + case $? in #( + 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #( + 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #( + 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #( + *) gl_cv_header_working_fcntl_h='no';; + esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi - fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5 -$as_echo "$gl_cv_func_iswcntrl_works" >&6; } - fi - HAVE_WCTYPE_H=1 - else - HAVE_WCTYPE_H=0 - fi - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_fcntl_h" >&5 +$as_echo "$gl_cv_header_working_fcntl_h" >&6; } - case "$gl_cv_func_iswcntrl_works" in - *yes) REPLACE_ISWCNTRL=0 ;; - *) REPLACE_ISWCNTRL=1 ;; + case $gl_cv_header_working_fcntl_h in #( + *O_NOATIME* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; esac +cat >>confdefs.h <<_ACEOF +#define HAVE_WORKING_O_NOATIME $ac_val +_ACEOF - if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then - : - fi - if test $REPLACE_ISWCNTRL = 1; then - REPLACE_TOWLOWER=1 - else - for ac_func in towlower -do : - ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower" -if test "x$ac_cv_func_towlower" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_TOWLOWER 1 -_ACEOF + case $gl_cv_header_working_fcntl_h in #( + *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac -fi -done +cat >>confdefs.h <<_ACEOF +#define HAVE_WORKING_O_NOFOLLOW $ac_val +_ACEOF - if test $ac_cv_func_towlower = yes; then - REPLACE_TOWLOWER=0 - else - ac_fn_c_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "/* Tru64 with Desktop Toolkit C has a bug: must be - included before . - BSD/OS 4.0.1 has a bug: , and - must be included before . */ - #include - #include - #include - #include - #if HAVE_WCTYPE_H - # include - #endif -" -if test "x$ac_cv_have_decl_towlower" = xyes; then : +ac_fn_c_check_decl "$LINENO" "getc_unlocked" "ac_cv_have_decl_getc_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_getc_unlocked" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_TOWLOWER $ac_have_decl +#define HAVE_DECL_GETC_UNLOCKED $ac_have_decl _ACEOF - if test $ac_cv_have_decl_towlower = yes; then - REPLACE_TOWLOWER=1 - else - REPLACE_TOWLOWER=0 - fi - fi - fi - - - if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then - : - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5 -$as_echo_n "checking for wctype_t... " >&6; } -if ${gl_cv_type_wctype_t+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C Library >= 2.1 or uClibc" >&5 +$as_echo_n "checking whether we are using the GNU C Library >= 2.1 or uClibc... " >&6; } +if ${ac_cv_gnu_library_2_1+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Tru64 with Desktop Toolkit C has a bug: must be - included before . - BSD/OS 4.0.1 has a bug: , and - must be included before . */ - #include - #include - #include - #include - #if HAVE_WCTYPE_H - # include - #endif - wctype_t a; -int -main () -{ +#include +#ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) + Lucky GNU user + #endif +#endif +#ifdef __UCLIBC__ + Lucky user +#endif - ; - return 0; -} _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_type_wctype_t=yes +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Lucky" >/dev/null 2>&1; then : + ac_cv_gnu_library_2_1=yes else - gl_cv_type_wctype_t=no + ac_cv_gnu_library_2_1=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest* + + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5 -$as_echo "$gl_cv_type_wctype_t" >&6; } - if test $gl_cv_type_wctype_t = no; then - HAVE_WCTYPE_T=0 - fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gnu_library_2_1" >&5 +$as_echo "$ac_cv_gnu_library_2_1" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5 -$as_echo_n "checking for wctrans_t... " >&6; } -if ${gl_cv_type_wctrans_t+:} false; then : + GLIBC21="$ac_cv_gnu_library_2_1" + + + + GNULIB_LOCALECONV=0; + GNULIB_SETLOCALE=0; + GNULIB_DUPLOCALE=0; + HAVE_DUPLOCALE=1; + REPLACE_LOCALECONV=0; + REPLACE_SETLOCALE=0; + REPLACE_DUPLOCALE=0; + REPLACE_STRUCT_LCONV=0; + + + REPLACE_NULL=0; + HAVE_MAX_ALIGN_T=1; + HAVE_WCHAR_T=1; + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5 +$as_echo_n "checking for wchar_t... " >&6; } +if ${gt_cv_c_wchar_t+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Tru64 with Desktop Toolkit C has a bug: must be - included before . - BSD/OS 4.0.1 has a bug: , and - must be included before . */ - #include - #include - #include - #include - #include - wctrans_t a; - +#include + wchar_t foo = (wchar_t)'\0'; int main () { @@ -12964,766 +14264,915 @@ } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_type_wctrans_t=yes + gt_cv_c_wchar_t=yes else - gl_cv_type_wctrans_t=no + gt_cv_c_wchar_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5 -$as_echo "$gl_cv_type_wctrans_t" >&6; } - if test $gl_cv_type_wctrans_t = no; then - HAVE_WCTRANS_T=0 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5 +$as_echo "$gt_cv_c_wchar_t" >&6; } + if test $gt_cv_c_wchar_t = yes; then + +$as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h + fi - for gl_func in wctype iswctype wctrans towctrans ; do - as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 -$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } -if eval \${$as_gl_Symbol+:} false; then : + + + STDDEF_H= + ac_fn_c_check_type "$LINENO" "max_align_t" "ac_cv_type_max_align_t" "#include + +" +if test "x$ac_cv_type_max_align_t" = xyes; then : + +else + HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h +fi + + if test $gt_cv_c_wchar_t = no; then + HAVE_WCHAR_T=0 + STDDEF_H=stddef.h + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5 +$as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; } +if ${gl_cv_decl_null_works+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -/* Tru64 with Desktop Toolkit C has a bug: must be included before - . - BSD/OS 4.0.1 has a bug: , and must be - included before . */ -#if !(defined __GLIBC__ && !defined __UCLIBC__) -# include -# include -# include -# include -#endif -#include +#include + int test[2 * (sizeof NULL == sizeof (void *)) -1]; int main () { -#undef $gl_func - (void) $gl_func; + ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_gl_Symbol=yes" + gl_cv_decl_null_works=yes else - eval "$as_gl_Symbol=no" + gl_cv_decl_null_works=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -eval ac_res=\$$as_gl_Symbol - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5 +$as_echo "$gl_cv_decl_null_works" >&6; } + if test $gl_cv_decl_null_works = no; then + REPLACE_NULL=1 + STDDEF_H=stddef.h + fi - eval ac_cv_have_decl_$gl_func=yes + if test -n "$STDDEF_H"; then + GL_GENERATE_STDDEF_H_TRUE= + GL_GENERATE_STDDEF_H_FALSE='#' +else + GL_GENERATE_STDDEF_H_TRUE='#' + GL_GENERATE_STDDEF_H_FALSE= fi - done + if test -n "$STDDEF_H"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5 -$as_echo_n "checking for nl_langinfo and CODESET... " >&6; } -if ${am_cv_langinfo_codeset+:} false; then : + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_stddef_h='<'stddef.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if ${gl_cv_next_stddef_h+:} false; then : $as_echo_n "(cached) " >&6 else + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -int -main () -{ -char* cs = nl_langinfo(CODESET); return !cs; - ; - return 0; -} +#include _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - am_cv_langinfo_codeset=yes -else - am_cv_langinfo_codeset=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5 -$as_echo "$am_cv_langinfo_codeset" >&6; } - if test $am_cv_langinfo_codeset = yes; then + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'stddef.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' -$as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h + gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` - fi + gl_header=$gl_cv_absolute_stddef_h + gl_cv_next_stddef_h='"'$gl_header'"' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5 +$as_echo "$gl_cv_next_stddef_h" >&6; } + fi + NEXT_STDDEF_H=$gl_cv_next_stddef_h + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'stddef.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_stddef_h + fi + NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fcntl.h" >&5 -$as_echo_n "checking for working fcntl.h... " >&6; } -if ${gl_cv_header_working_fcntl_h+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then : - gl_cv_header_working_fcntl_h=cross-compiling -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - #include - #if HAVE_UNISTD_H - # include - #else /* on Windows with MSVC */ - # include - # include - # defined sleep(n) _sleep ((n) * 1000) - #endif - #include - #ifndef O_NOATIME - #define O_NOATIME 0 - #endif - #ifndef O_NOFOLLOW - #define O_NOFOLLOW 0 - #endif - static int const constants[] = - { - O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND, - O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY - }; - -int -main () -{ + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac - int result = !constants; - #if HAVE_SYMLINK - { - static char const sym[] = "conftest.sym"; - if (symlink ("/dev/null", sym) != 0) - result |= 2; - else - { - int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0); - if (fd >= 0) - { - close (fd); - result |= 4; - } - } - if (unlink (sym) != 0 || symlink (".", sym) != 0) - result |= 2; - else - { - int fd = open (sym, O_RDONLY | O_NOFOLLOW); - if (fd >= 0) - { - close (fd); - result |= 4; - } - } - unlink (sym); - } - #endif - { - static char const file[] = "confdefs.h"; - int fd = open (file, O_RDONLY | O_NOATIME); - if (fd < 0) - result |= 8; - else - { - struct stat st0; - if (fstat (fd, &st0) != 0) - result |= 16; - else - { - char c; - sleep (1); - if (read (fd, &c, 1) != 1) - result |= 24; - else - { - if (close (fd) != 0) - result |= 32; - else - { - struct stat st1; - if (stat (file, &st1) != 0) - result |= 40; - else - if (st0.st_atime != st1.st_atime) - result |= 64; - } - } - } - } - } - return result; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - gl_cv_header_working_fcntl_h=yes + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi else - case $? in #( - 4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #( - 64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #( - 68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #( - *) gl_cv_header_working_fcntl_h='no';; - esac -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cv_path_SED=$SED fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_fcntl_h" >&5 -$as_echo "$gl_cv_header_working_fcntl_h" >&6; } - - case $gl_cv_header_working_fcntl_h in #( - *O_NOATIME* | no | cross-compiling) ac_val=0;; #( - *) ac_val=1;; - esac - -cat >>confdefs.h <<_ACEOF -#define HAVE_WORKING_O_NOATIME $ac_val -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed - case $gl_cv_header_working_fcntl_h in #( - *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #( - *) ac_val=1;; - esac -cat >>confdefs.h <<_ACEOF -#define HAVE_WORKING_O_NOFOLLOW $ac_val + for ac_header in stdlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDLIB_H 1 _ACEOF - -ac_fn_c_check_decl "$LINENO" "getc_unlocked" "ac_cv_have_decl_getc_unlocked" "$ac_includes_default" -if test "x$ac_cv_have_decl_getc_unlocked" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETC_UNLOCKED $ac_have_decl -_ACEOF - +done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C Library >= 2.1 or uClibc" >&5 -$as_echo_n "checking whether we are using the GNU C Library >= 2.1 or uClibc... " >&6; } -if ${ac_cv_gnu_library_2_1+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 +$as_echo_n "checking for GNU libc compatible malloc... " >&6; } +if ${ac_cv_func_malloc_0_nonnull+:} false; then : $as_echo_n "(cached) " >&6 else + if test "$cross_compiling" = yes; then : + case "$host_os" in + # Guess yes on platforms where we know the result. + *-gnu* | freebsd* | netbsd* | openbsd* \ + | hpux* | solaris* | cygwin* | mingw*) + ac_cv_func_malloc_0_nonnull=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_malloc_0_nonnull=no ;; + esac + +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#if defined STDC_HEADERS || defined HAVE_STDLIB_H + # include + #else + char *malloc (); + #endif -#include -#ifdef __GNU_LIBRARY__ - #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) - Lucky GNU user - #endif -#endif -#ifdef __UCLIBC__ - Lucky user -#endif +int +main () +{ +char *p = malloc (0); + int result = !p; + free (p); + return result; + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "Lucky" >/dev/null 2>&1; then : - ac_cv_gnu_library_2_1=yes +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_malloc_0_nonnull=yes else - ac_cv_gnu_library_2_1=no + ac_cv_func_malloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f conftest* - fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gnu_library_2_1" >&5 -$as_echo "$ac_cv_gnu_library_2_1" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 +$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } + if test $ac_cv_func_malloc_0_nonnull = yes; then : + gl_cv_func_malloc_0_nonnull=1 +else + gl_cv_func_malloc_0_nonnull=0 +fi - GLIBC21="$ac_cv_gnu_library_2_1" +cat >>confdefs.h <<_ACEOF +#define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull +_ACEOF - GNULIB_LOCALECONV=0; - GNULIB_SETLOCALE=0; - GNULIB_DUPLOCALE=0; - HAVE_DUPLOCALE=1; - REPLACE_LOCALECONV=0; - REPLACE_SETLOCALE=0; - REPLACE_DUPLOCALE=0; - REPLACE_STRUCT_LCONV=0; - REPLACE_NULL=0; - HAVE_MAX_ALIGN_T=1; - HAVE_WCHAR_T=1; - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5 -$as_echo_n "checking for wchar_t... " >&6; } -if ${gt_cv_c_wchar_t+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5 +$as_echo_n "checking for mbstate_t... " >&6; } +if ${ac_cv_type_mbstate_t+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +$ac_includes_default +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ #include - wchar_t foo = (wchar_t)'\0'; +#include +#include +#include int main () { - +mbstate_t x; return sizeof x; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - gt_cv_c_wchar_t=yes + ac_cv_type_mbstate_t=yes else - gt_cv_c_wchar_t=no + ac_cv_type_mbstate_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5 -$as_echo "$gt_cv_c_wchar_t" >&6; } - if test $gt_cv_c_wchar_t = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5 +$as_echo "$ac_cv_type_mbstate_t" >&6; } + if test $ac_cv_type_mbstate_t = yes; then -$as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h +$as_echo "#define HAVE_MBSTATE_T 1" >>confdefs.h + + else + +$as_echo "#define mbstate_t int" >>confdefs.h + + fi + + + GNULIB_BTOWC=0; + GNULIB_WCTOB=0; + GNULIB_MBSINIT=0; + GNULIB_MBRTOWC=0; + GNULIB_MBRLEN=0; + GNULIB_MBSRTOWCS=0; + GNULIB_MBSNRTOWCS=0; + GNULIB_WCRTOMB=0; + GNULIB_WCSRTOMBS=0; + GNULIB_WCSNRTOMBS=0; + GNULIB_WCWIDTH=0; + GNULIB_WMEMCHR=0; + GNULIB_WMEMCMP=0; + GNULIB_WMEMCPY=0; + GNULIB_WMEMMOVE=0; + GNULIB_WMEMSET=0; + GNULIB_WCSLEN=0; + GNULIB_WCSNLEN=0; + GNULIB_WCSCPY=0; + GNULIB_WCPCPY=0; + GNULIB_WCSNCPY=0; + GNULIB_WCPNCPY=0; + GNULIB_WCSCAT=0; + GNULIB_WCSNCAT=0; + GNULIB_WCSCMP=0; + GNULIB_WCSNCMP=0; + GNULIB_WCSCASECMP=0; + GNULIB_WCSNCASECMP=0; + GNULIB_WCSCOLL=0; + GNULIB_WCSXFRM=0; + GNULIB_WCSDUP=0; + GNULIB_WCSCHR=0; + GNULIB_WCSRCHR=0; + GNULIB_WCSCSPN=0; + GNULIB_WCSSPN=0; + GNULIB_WCSPBRK=0; + GNULIB_WCSSTR=0; + GNULIB_WCSTOK=0; + GNULIB_WCSWIDTH=0; + HAVE_BTOWC=1; + HAVE_MBSINIT=1; + HAVE_MBRTOWC=1; + HAVE_MBRLEN=1; + HAVE_MBSRTOWCS=1; + HAVE_MBSNRTOWCS=1; + HAVE_WCRTOMB=1; + HAVE_WCSRTOMBS=1; + HAVE_WCSNRTOMBS=1; + HAVE_WMEMCHR=1; + HAVE_WMEMCMP=1; + HAVE_WMEMCPY=1; + HAVE_WMEMMOVE=1; + HAVE_WMEMSET=1; + HAVE_WCSLEN=1; + HAVE_WCSNLEN=1; + HAVE_WCSCPY=1; + HAVE_WCPCPY=1; + HAVE_WCSNCPY=1; + HAVE_WCPNCPY=1; + HAVE_WCSCAT=1; + HAVE_WCSNCAT=1; + HAVE_WCSCMP=1; + HAVE_WCSNCMP=1; + HAVE_WCSCASECMP=1; + HAVE_WCSNCASECMP=1; + HAVE_WCSCOLL=1; + HAVE_WCSXFRM=1; + HAVE_WCSDUP=1; + HAVE_WCSCHR=1; + HAVE_WCSRCHR=1; + HAVE_WCSCSPN=1; + HAVE_WCSSPN=1; + HAVE_WCSPBRK=1; + HAVE_WCSSTR=1; + HAVE_WCSTOK=1; + HAVE_WCSWIDTH=1; + HAVE_DECL_WCTOB=1; + HAVE_DECL_WCWIDTH=1; + REPLACE_MBSTATE_T=0; + REPLACE_BTOWC=0; + REPLACE_WCTOB=0; + REPLACE_MBSINIT=0; + REPLACE_MBRTOWC=0; + REPLACE_MBRLEN=0; + REPLACE_MBSRTOWCS=0; + REPLACE_MBSNRTOWCS=0; + REPLACE_WCRTOMB=0; + REPLACE_WCSRTOMBS=0; + REPLACE_WCSNRTOMBS=0; + REPLACE_WCWIDTH=0; + REPLACE_WCSWIDTH=0; - fi - STDDEF_H= - ac_fn_c_check_type "$LINENO" "max_align_t" "ac_cv_type_max_align_t" "#include -" -if test "x$ac_cv_type_max_align_t" = xyes; then : -else - HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h -fi - if test $gt_cv_c_wchar_t = no; then - HAVE_WCHAR_T=0 - STDDEF_H=stddef.h - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5 -$as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; } -if ${gl_cv_decl_null_works+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 +$as_echo_n "checking for a traditional japanese locale... " >&6; } +if ${gt_cv_locale_ja+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include - int test[2 * (sizeof NULL == sizeof (void *)) -1]; -int -main () +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { - - ; + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales + on Cygwin 1.5.x. */ + if (MB_CUR_MAX == 1) + return 1; + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; return 0; } -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_decl_null_works=yes -else - gl_cv_decl_null_works=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5 -$as_echo "$gl_cv_decl_null_works" >&6; } - if test $gl_cv_decl_null_works = no; then - REPLACE_NULL=1 - STDDEF_H=stddef.h - fi - if test -n "$STDDEF_H"; then - GL_GENERATE_STDDEF_H_TRUE= - GL_GENERATE_STDDEF_H_FALSE='#' -else - GL_GENERATE_STDDEF_H_TRUE='#' - GL_GENERATE_STDDEF_H_FALSE= -fi - - if test -n "$STDDEF_H"; then - - - - - - - - - if test $gl_cv_have_include_next = yes; then - gl_cv_next_stddef_h='<'stddef.h'>' - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 -$as_echo_n "checking absolute name of ... " >&6; } -if ${gl_cv_next_stddef_h+:} false; then : - $as_echo_n "(cached) " >&6 -else - - - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include _ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac - - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' - gl_header_literal_regex=`echo 'stddef.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' - - gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"` - - gl_header=$gl_cv_absolute_stddef_h - gl_cv_next_stddef_h='"'$gl_header'"' - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5 -$as_echo "$gl_cv_next_stddef_h" >&6; } - fi - NEXT_STDDEF_H=$gl_cv_next_stddef_h - - if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then - # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' - gl_next_as_first_directive='<'stddef.h'>' - else - # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' - gl_next_as_first_directive=$gl_cv_next_stddef_h - fi - NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive - - - - - fi - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - { ac_script=; unset ac_script;} - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_SED" || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Note that on native Windows, the Japanese locale is + # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we + # cannot use it here. + gt_cv_locale_ja=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the AIX locale name. + if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC-JP + else + # Test for the HP-UX, OSF/1, NetBSD locale name. + if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.eucJP + else + # Test for the IRIX, FreeBSD locale name. + if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja_JP.EUC + else + # Test for the Solaris 7 locale name. + if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_ja=ja + else + # Special test for NetBSD 1.6. + if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then + gt_cv_locale_ja=ja_JP.eucJP + else + # None found. + gt_cv_locale_ja=none + fi + fi + fi + fi + fi + fi + ;; + esac fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_SED_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 - fi -else - ac_cv_path_SED=$SED -fi + rm -fr conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 +$as_echo "$gt_cv_locale_ja" >&6; } + LOCALE_JA=$gt_cv_locale_ja - for ac_header in stdlib.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" -if test "x$ac_cv_header_stdlib_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STDLIB_H 1 -_ACEOF -fi -done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 -$as_echo_n "checking for GNU libc compatible malloc... " >&6; } -if ${ac_cv_func_malloc_0_nonnull+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 +$as_echo_n "checking for a transitional chinese locale... " >&6; } +if ${gt_cv_locale_zh_CN+:} false; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then : - case "$host_os" in - # Guess yes on platforms where we know the result. - *-gnu* | freebsd* | netbsd* | openbsd* \ - | hpux* | solaris* | cygwin* | mingw*) - ac_cv_func_malloc_0_nonnull=yes ;; - # If we don't know, assume the worst. - *) ac_cv_func_malloc_0_nonnull=no ;; - esac -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#if defined STDC_HEADERS || defined HAVE_STDLIB_H - # include - #else - char *malloc (); - #endif -int -main () +#include +#include +#include +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { -return ! malloc (0); - ; + const char *p; + /* Check whether the given locale name is recognized by the system. */ +#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +#else + if (setlocale (LC_ALL, "") == NULL) return 1; +#endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. + On MirBSD 10, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "UTF-8". */ +#if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 + || strcmp (cs, "UTF-8") == 0) + return 1; + } +#endif +#ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +#endif + /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. + This excludes the UTF-8 encoding (except on MirBSD). */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; + for (p = buf; *p != '\0'; p++) + if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) + return 1; + /* Check whether a typical GB18030 multibyte sequence is recognized as a + single wide character. This excludes the GB2312 and GBK encodings. */ + if (mblen ("\203\062\332\066", 5) != 4) + return 1; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_malloc_0_nonnull=yes -else - ac_cv_func_malloc_0_nonnull=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=Chinese_China.54936 + else + # None found. + gt_cv_locale_zh_CN=none + fi + ;; + solaris2.8) + # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are + # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. + # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. + gt_cv_locale_zh_CN=none + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the locale name without encoding suffix. + if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_zh_CN=zh_CN.GB18030 + else + # None found. + gt_cv_locale_zh_CN=none + fi + fi + ;; + esac + else + # If there was a link error, due to mblen(), the system is so old that + # it certainly doesn't have a chinese locale. + gt_cv_locale_zh_CN=none + fi + rm -fr conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 -$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } - if test $ac_cv_func_malloc_0_nonnull = yes; then : - gl_cv_func_malloc_0_nonnull=1 -else - gl_cv_func_malloc_0_nonnull=0 -fi - - -cat >>confdefs.h <<_ACEOF -#define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull -_ACEOF - - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 +$as_echo "$gt_cv_locale_zh_CN" >&6; } + LOCALE_ZH_CN=$gt_cv_locale_zh_CN - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5 -$as_echo_n "checking for mbstate_t... " >&6; } -if ${ac_cv_type_mbstate_t+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 +$as_echo_n "checking for a french Unicode locale... " >&6; } +if ${gt_cv_locale_fr_utf8+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default -/* Tru64 with Desktop Toolkit C has a bug: must be included before - . - BSD/OS 4.0.1 has a bug: , and must be - included before . */ -#include -#include + +#include #include -#include -int -main () -{ -mbstate_t x; return sizeof x; - ; +#if HAVE_LANGINFO_CODESET +# include +#endif +#include +#include +struct tm t; +char buf[16]; +int main () { + /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl + imitates locale dependent behaviour by looking at the environment + variables, and all locales use the UTF-8 encoding. */ +#if !(defined __BEOS__ || defined __HAIKU__) + /* Check whether the given locale name is recognized by the system. */ +# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ + /* On native Windows, setlocale(category, "") looks at the system settings, + not at the environment variables. Also, when an encoding suffix such + as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE + category of the locale to "C". */ + if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL + || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + return 1; +# else + if (setlocale (LC_ALL, "") == NULL) return 1; +# endif + /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". + On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) + is empty, and the behaviour of Tcl 8.4 in this locale is not useful. + On OpenBSD 4.0, when an unsupported locale is specified, setlocale() + succeeds but then nl_langinfo(CODESET) is "646". In this situation, + some unit tests fail. */ +# if HAVE_LANGINFO_CODESET + { + const char *cs = nl_langinfo (CODESET); + if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) + return 1; + } +# endif +# ifdef __CYGWIN__ + /* On Cygwin, avoid locale names without encoding suffix, because the + locale_charset() function relies on the encoding suffix. Note that + LC_ALL is set on the command line. */ + if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; +# endif + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is + two bytes long, with UTF-8 encoding. */ + t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; + if (strftime (buf, sizeof (buf), "%b", &t) < 4 + || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') + return 1; +#endif +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif return 0; } -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_type_mbstate_t=yes -else - ac_cv_type_mbstate_t=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5 -$as_echo "$ac_cv_type_mbstate_t" >&6; } - if test $ac_cv_type_mbstate_t = yes; then -$as_echo "#define HAVE_MBSTATE_T 1" >>confdefs.h - - else +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the hypothetical native Windows locale name. + if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=French_France.65001 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr_FR.UTF-8 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr_utf8=fr.UTF-8 + else + # None found. + gt_cv_locale_fr_utf8=none + fi + fi + fi + ;; + esac + fi + rm -fr conftest* -$as_echo "#define mbstate_t int" >>confdefs.h +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 +$as_echo "$gt_cv_locale_fr_utf8" >&6; } + LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 - fi - GNULIB_BTOWC=0; - GNULIB_WCTOB=0; - GNULIB_MBSINIT=0; - GNULIB_MBRTOWC=0; - GNULIB_MBRLEN=0; - GNULIB_MBSRTOWCS=0; - GNULIB_MBSNRTOWCS=0; - GNULIB_WCRTOMB=0; - GNULIB_WCSRTOMBS=0; - GNULIB_WCSNRTOMBS=0; - GNULIB_WCWIDTH=0; - GNULIB_WMEMCHR=0; - GNULIB_WMEMCMP=0; - GNULIB_WMEMCPY=0; - GNULIB_WMEMMOVE=0; - GNULIB_WMEMSET=0; - GNULIB_WCSLEN=0; - GNULIB_WCSNLEN=0; - GNULIB_WCSCPY=0; - GNULIB_WCPCPY=0; - GNULIB_WCSNCPY=0; - GNULIB_WCPNCPY=0; - GNULIB_WCSCAT=0; - GNULIB_WCSNCAT=0; - GNULIB_WCSCMP=0; - GNULIB_WCSNCMP=0; - GNULIB_WCSCASECMP=0; - GNULIB_WCSNCASECMP=0; - GNULIB_WCSCOLL=0; - GNULIB_WCSXFRM=0; - GNULIB_WCSDUP=0; - GNULIB_WCSCHR=0; - GNULIB_WCSRCHR=0; - GNULIB_WCSCSPN=0; - GNULIB_WCSSPN=0; - GNULIB_WCSPBRK=0; - GNULIB_WCSSTR=0; - GNULIB_WCSTOK=0; - GNULIB_WCSWIDTH=0; - HAVE_BTOWC=1; - HAVE_MBSINIT=1; - HAVE_MBRTOWC=1; - HAVE_MBRLEN=1; - HAVE_MBSRTOWCS=1; - HAVE_MBSNRTOWCS=1; - HAVE_WCRTOMB=1; - HAVE_WCSRTOMBS=1; - HAVE_WCSNRTOMBS=1; - HAVE_WMEMCHR=1; - HAVE_WMEMCMP=1; - HAVE_WMEMCPY=1; - HAVE_WMEMMOVE=1; - HAVE_WMEMSET=1; - HAVE_WCSLEN=1; - HAVE_WCSNLEN=1; - HAVE_WCSCPY=1; - HAVE_WCPCPY=1; - HAVE_WCSNCPY=1; - HAVE_WCPNCPY=1; - HAVE_WCSCAT=1; - HAVE_WCSNCAT=1; - HAVE_WCSCMP=1; - HAVE_WCSNCMP=1; - HAVE_WCSCASECMP=1; - HAVE_WCSNCASECMP=1; - HAVE_WCSCOLL=1; - HAVE_WCSXFRM=1; - HAVE_WCSDUP=1; - HAVE_WCSCHR=1; - HAVE_WCSRCHR=1; - HAVE_WCSCSPN=1; - HAVE_WCSSPN=1; - HAVE_WCSPBRK=1; - HAVE_WCSSTR=1; - HAVE_WCSTOK=1; - HAVE_WCSWIDTH=1; - HAVE_DECL_WCTOB=1; - HAVE_DECL_WCWIDTH=1; - REPLACE_MBSTATE_T=0; - REPLACE_BTOWC=0; - REPLACE_WCTOB=0; - REPLACE_MBSINIT=0; - REPLACE_MBRTOWC=0; - REPLACE_MBRLEN=0; - REPLACE_MBSRTOWCS=0; - REPLACE_MBSNRTOWCS=0; - REPLACE_WCRTOMB=0; - REPLACE_WCSRTOMBS=0; - REPLACE_WCSNRTOMBS=0; - REPLACE_WCWIDTH=0; - REPLACE_WCSWIDTH=0; + GNULIB_FFSL=0; + GNULIB_FFSLL=0; + GNULIB_MEMCHR=0; + GNULIB_MEMMEM=0; + GNULIB_MEMPCPY=0; + GNULIB_MEMRCHR=0; + GNULIB_RAWMEMCHR=0; + GNULIB_STPCPY=0; + GNULIB_STPNCPY=0; + GNULIB_STRCHRNUL=0; + GNULIB_STRDUP=0; + GNULIB_STRNCAT=0; + GNULIB_STRNDUP=0; + GNULIB_STRNLEN=0; + GNULIB_STRPBRK=0; + GNULIB_STRSEP=0; + GNULIB_STRSTR=0; + GNULIB_STRCASESTR=0; + GNULIB_STRTOK_R=0; + GNULIB_MBSLEN=0; + GNULIB_MBSNLEN=0; + GNULIB_MBSCHR=0; + GNULIB_MBSRCHR=0; + GNULIB_MBSSTR=0; + GNULIB_MBSCASECMP=0; + GNULIB_MBSNCASECMP=0; + GNULIB_MBSPCASECMP=0; + GNULIB_MBSCASESTR=0; + GNULIB_MBSCSPN=0; + GNULIB_MBSPBRK=0; + GNULIB_MBSSPN=0; + GNULIB_MBSSEP=0; + GNULIB_MBSTOK_R=0; + GNULIB_STRERROR=0; + GNULIB_STRERROR_R=0; + GNULIB_STRSIGNAL=0; + GNULIB_STRVERSCMP=0; + HAVE_MBSLEN=0; + HAVE_FFSL=1; + HAVE_FFSLL=1; + HAVE_MEMCHR=1; + HAVE_DECL_MEMMEM=1; + HAVE_MEMPCPY=1; + HAVE_DECL_MEMRCHR=1; + HAVE_RAWMEMCHR=1; + HAVE_STPCPY=1; + HAVE_STPNCPY=1; + HAVE_STRCHRNUL=1; + HAVE_DECL_STRDUP=1; + HAVE_DECL_STRNDUP=1; + HAVE_DECL_STRNLEN=1; + HAVE_STRPBRK=1; + HAVE_STRSEP=1; + HAVE_STRCASESTR=1; + HAVE_DECL_STRTOK_R=1; + HAVE_DECL_STRERROR_R=1; + HAVE_DECL_STRSIGNAL=1; + HAVE_STRVERSCMP=1; + REPLACE_MEMCHR=0; + REPLACE_MEMMEM=0; + REPLACE_STPNCPY=0; + REPLACE_STRDUP=0; + REPLACE_STRSTR=0; + REPLACE_STRCASESTR=0; + REPLACE_STRCHRNUL=0; + REPLACE_STRERROR=0; + REPLACE_STRERROR_R=0; + REPLACE_STRNCAT=0; + REPLACE_STRNDUP=0; + REPLACE_STRNLEN=0; + REPLACE_STRSIGNAL=0; + REPLACE_STRTOK_R=0; + UNDEFINE_STRTOK_R=0; @@ -13732,9 +15181,9 @@ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5 -$as_echo_n "checking for a traditional japanese locale... " >&6; } -if ${gt_cv_locale_ja+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 +$as_echo_n "checking for a traditional french locale... " >&6; } +if ${gt_cv_locale_fr+:} false; then : $as_echo_n "(cached) " >&6 else @@ -13750,9 +15199,7 @@ #include struct tm t; char buf[16]; -int main () -{ - const char *p; +int main () { /* Check whether the given locale name is recognized by the system. */ #if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ /* On native Windows, setlocale(category, "") looks at the system settings, @@ -13787,1237 +15234,1412 @@ LC_ALL is set on the command line. */ if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; #endif - /* Check whether MB_CUR_MAX is > 1. This excludes the dysfunctional locales - on Cygwin 1.5.x. */ - if (MB_CUR_MAX == 1) - return 1; - /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. - This excludes the UTF-8 encoding (except on MirBSD). */ + /* Check whether in the abbreviation of the second month, the second + character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only + one byte long. This excludes the UTF-8 encoding. */ t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; - if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; - for (p = buf; *p != '\0'; p++) - if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) - return 1; + if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; +#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ + /* Check whether the decimal separator is a comma. + On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point + are nl_langinfo(RADIXCHAR) are both ".". */ + if (localeconv () ->decimal_point[0] != ',') return 1; +#endif + return 0; +} + +_ACEOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + case "$host_os" in + # Handle native Windows specially, because there setlocale() interprets + # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", + # "fr" or "fra" as "French" or "French_France.1252", + # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", + # "ja" as "Japanese" or "Japanese_Japan.932", + # and similar. + mingw*) + # Test for the native Windows locale name. + if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=French_France.1252 + else + # None found. + gt_cv_locale_fr=none + fi + ;; + *) + # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because + # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the + # configure script would override the LC_ALL setting. Likewise for + # LC_CTYPE, which is also set at the beginning of the configure script. + # Test for the usual locale name. + if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR + else + # Test for the locale name with explicit encoding suffix. + if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO-8859-1 + else + # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. + if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.ISO8859-1 + else + # Test for the HP-UX locale name. + if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr_FR.iso88591 + else + # Test for the Solaris 7 locale name. + if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then + gt_cv_locale_fr=fr + else + # None found. + gt_cv_locale_fr=none + fi + fi + fi + fi + fi + ;; + esac + fi + rm -fr conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 +$as_echo "$gt_cv_locale_fr" >&6; } + LOCALE_FR=$gt_cv_locale_fr + + + + + + + + + + + # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it + # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is + # irrelevant for anonymous mappings. + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes; then : + gl_have_mmap=yes +else + gl_have_mmap=no +fi + + + # Try to allow MAP_ANONYMOUS. + gl_have_mmap_anonymous=no + if test $gl_have_mmap = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 +$as_echo_n "checking for MAP_ANONYMOUS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANONYMOUS + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "I cannot identify this map" >/dev/null 2>&1; then : + gl_have_mmap_anonymous=yes +fi +rm -f conftest* + + if test $gl_have_mmap_anonymous != yes; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef MAP_ANON + I cannot identify this map +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "I cannot identify this map" >/dev/null 2>&1; then : + +$as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h + + gl_have_mmap_anonymous=yes +fi +rm -f conftest* + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 +$as_echo "$gl_have_mmap_anonymous" >&6; } + if test $gl_have_mmap_anonymous = yes; then + +$as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h + + fi + fi + + + + + + + if test $HAVE_MEMCHR = 1; then + # Detect platform-specific bugs in some versions of glibc: + # memchr should not dereference anything with length 0 + # http://bugzilla.redhat.com/499689 + # memchr should not dereference overestimated length after a match + # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737 + # http://sourceware.org/bugzilla/show_bug.cgi?id=10162 + # Assume that memchr works on platforms that lack mprotect. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memchr works" >&5 +$as_echo_n "checking whether memchr works... " >&6; } +if ${gl_cv_func_memchr_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + gl_cv_func_memchr_works="guessing no" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if HAVE_SYS_MMAN_H +# include +# include +# include +# include +# ifndef MAP_FILE +# define MAP_FILE 0 +# endif +#endif + +int +main () +{ + + int result = 0; + char *fence = NULL; +#if HAVE_SYS_MMAN_H && HAVE_MPROTECT +# if HAVE_MAP_ANONYMOUS + const int flags = MAP_ANONYMOUS | MAP_PRIVATE; + const int fd = -1; +# else /* !HAVE_MAP_ANONYMOUS */ + const int flags = MAP_FILE | MAP_PRIVATE; + int fd = open ("/dev/zero", O_RDONLY, 0666); + if (fd >= 0) +# endif + { + int pagesize = getpagesize (); + char *two_pages = + (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE, + flags, fd, 0); + if (two_pages != (char *)(-1) + && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0) + fence = two_pages + pagesize; + } +#endif + if (fence) + { + if (memchr (fence, 0, 0)) + result |= 1; + strcpy (fence - 9, "12345678"); + if (memchr (fence - 9, 0, 79) != fence - 1) + result |= 2; + if (memchr (fence - 1, 0, 3) != fence - 1) + result |= 4; + } + return result; + + ; return 0; } - _ACEOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest$ac_exeext; then - case "$host_os" in - # Handle native Windows specially, because there setlocale() interprets - # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", - # "fr" or "fra" as "French" or "French_France.1252", - # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", - # "ja" as "Japanese" or "Japanese_Japan.932", - # and similar. - mingw*) - # Note that on native Windows, the Japanese locale is - # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we - # cannot use it here. - gt_cv_locale_ja=none - ;; - *) - # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because - # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the - # configure script would override the LC_ALL setting. Likewise for - # LC_CTYPE, which is also set at the beginning of the configure script. - # Test for the AIX locale name. - if (LC_ALL=ja_JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_ja=ja_JP - else - # Test for the locale name with explicit encoding suffix. - if (LC_ALL=ja_JP.EUC-JP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_ja=ja_JP.EUC-JP - else - # Test for the HP-UX, OSF/1, NetBSD locale name. - if (LC_ALL=ja_JP.eucJP LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_ja=ja_JP.eucJP - else - # Test for the IRIX, FreeBSD locale name. - if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_ja=ja_JP.EUC - else - # Test for the Solaris 7 locale name. - if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_ja=ja - else - # Special test for NetBSD 1.6. - if test -f /usr/share/locale/ja_JP.eucJP/LC_CTYPE; then - gt_cv_locale_ja=ja_JP.eucJP - else - # None found. - gt_cv_locale_ja=none - fi - fi - fi - fi - fi - fi - ;; - esac - fi - rm -fr conftest* +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_memchr_works=yes +else + gl_cv_func_memchr_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5 -$as_echo "$gt_cv_locale_ja" >&6; } - LOCALE_JA=$gt_cv_locale_ja +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memchr_works" >&5 +$as_echo "$gl_cv_func_memchr_works" >&6; } + if test "$gl_cv_func_memchr_works" != yes; then + REPLACE_MEMCHR=1 + fi + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5 -$as_echo_n "checking for a transitional chinese locale... " >&6; } -if ${gt_cv_locale_zh_CN+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether defines MIN and MAX" >&5 +$as_echo_n "checking whether defines MIN and MAX... " >&6; } +if ${gl_cv_minmax_in_limits_h+:} false; then : $as_echo_n "(cached) " >&6 else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - -#include -#include -#include -#if HAVE_LANGINFO_CODESET -# include -#endif -#include -#include -struct tm t; -char buf[16]; -int main () +#include + int x = MIN (42, 17); +int +main () { - const char *p; - /* Check whether the given locale name is recognized by the system. */ -#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ - /* On native Windows, setlocale(category, "") looks at the system settings, - not at the environment variables. Also, when an encoding suffix such - as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE - category of the locale to "C". */ - if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL - || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) - return 1; -#else - if (setlocale (LC_ALL, "") == NULL) return 1; -#endif - /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". - On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) - is empty, and the behaviour of Tcl 8.4 in this locale is not useful. - On OpenBSD 4.0, when an unsupported locale is specified, setlocale() - succeeds but then nl_langinfo(CODESET) is "646". In this situation, - some unit tests fail. - On MirBSD 10, when an unsupported locale is specified, setlocale() - succeeds but then nl_langinfo(CODESET) is "UTF-8". */ -#if HAVE_LANGINFO_CODESET - { - const char *cs = nl_langinfo (CODESET); - if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 - || strcmp (cs, "UTF-8") == 0) - return 1; - } -#endif -#ifdef __CYGWIN__ - /* On Cygwin, avoid locale names without encoding suffix, because the - locale_charset() function relies on the encoding suffix. Note that - LC_ALL is set on the command line. */ - if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; -#endif - /* Check whether in a month name, no byte in the range 0x80..0x9F occurs. - This excludes the UTF-8 encoding (except on MirBSD). */ - t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; - if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1; - for (p = buf; *p != '\0'; p++) - if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0) - return 1; - /* Check whether a typical GB18030 multibyte sequence is recognized as a - single wide character. This excludes the GB2312 and GBK encodings. */ - if (mblen ("\203\062\332\066", 5) != 4) - return 1; + + ; return 0; } +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_minmax_in_limits_h=yes +else + gl_cv_minmax_in_limits_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_limits_h" >&5 +$as_echo "$gl_cv_minmax_in_limits_h" >&6; } + if test $gl_cv_minmax_in_limits_h = yes; then + +$as_echo "#define HAVE_MINMAX_IN_LIMITS_H 1" >>confdefs.h + + fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether defines MIN and MAX" >&5 +$as_echo_n "checking whether defines MIN and MAX... " >&6; } +if ${gl_cv_minmax_in_sys_param_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + int x = MIN (42, 17); +int +main () +{ + ; + return 0; +} _ACEOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest$ac_exeext; then - case "$host_os" in - # Handle native Windows specially, because there setlocale() interprets - # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", - # "fr" or "fra" as "French" or "French_France.1252", - # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", - # "ja" as "Japanese" or "Japanese_Japan.932", - # and similar. - mingw*) - # Test for the hypothetical native Windows locale name. - if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_zh_CN=Chinese_China.54936 - else - # None found. - gt_cv_locale_zh_CN=none - fi - ;; - solaris2.8) - # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are - # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK. - # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core. - gt_cv_locale_zh_CN=none - ;; - *) - # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because - # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the - # configure script would override the LC_ALL setting. Likewise for - # LC_CTYPE, which is also set at the beginning of the configure script. - # Test for the locale name without encoding suffix. - if (LC_ALL=zh_CN LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_zh_CN=zh_CN - else - # Test for the locale name with explicit encoding suffix. - if (LC_ALL=zh_CN.GB18030 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_zh_CN=zh_CN.GB18030 - else - # None found. - gt_cv_locale_zh_CN=none - fi - fi - ;; - esac - else - # If there was a link error, due to mblen(), the system is so old that - # it certainly doesn't have a chinese locale. - gt_cv_locale_zh_CN=none - fi - rm -fr conftest* +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_minmax_in_sys_param_h=yes +else + gl_cv_minmax_in_sys_param_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_sys_param_h" >&5 +$as_echo "$gl_cv_minmax_in_sys_param_h" >&6; } + if test $gl_cv_minmax_in_sys_param_h = yes; then + +$as_echo "#define HAVE_MINMAX_IN_SYS_PARAM_H 1" >>confdefs.h + + fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5 -$as_echo "$gt_cv_locale_zh_CN" >&6; } - LOCALE_ZH_CN=$gt_cv_locale_zh_CN - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5 -$as_echo_n "checking for a french Unicode locale... " >&6; } -if ${gt_cv_locale_fr_utf8+:} false; then : - $as_echo_n "(cached) " >&6 + + + + ac_fn_c_check_decl "$LINENO" "trunc" "ac_cv_have_decl_trunc" "#include +" +if test "x$ac_cv_have_decl_trunc" = xyes; then : + ac_have_decl=1 else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_TRUNC $ac_have_decl +_ACEOF + if test "$ac_cv_have_decl_trunc" = yes; then + TRUNC_LIBM=? cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + double x; +int +main () +{ +x = trunc(x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + TRUNC_LIBM= +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$TRUNC_LIBM" = "?"; then + save_LIBS="$LIBS" + LIBS="$LIBS -lm" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + double x; +int +main () +{ +x = trunc(x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + TRUNC_LIBM="-lm" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" + fi + if test "$TRUNC_LIBM" = "?"; then + TRUNC_LIBM= + fi -#include -#include -#if HAVE_LANGINFO_CODESET -# include -#endif -#include -#include -struct tm t; -char buf[16]; -int main () { - /* On BeOS and Haiku, locales are not implemented in libc. Rather, libintl - imitates locale dependent behaviour by looking at the environment - variables, and all locales use the UTF-8 encoding. */ -#if !(defined __BEOS__ || defined __HAIKU__) - /* Check whether the given locale name is recognized by the system. */ -# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ - /* On native Windows, setlocale(category, "") looks at the system settings, - not at the environment variables. Also, when an encoding suffix such - as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE - category of the locale to "C". */ - if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL - || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) - return 1; -# else - if (setlocale (LC_ALL, "") == NULL) return 1; -# endif - /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". - On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) - is empty, and the behaviour of Tcl 8.4 in this locale is not useful. - On OpenBSD 4.0, when an unsupported locale is specified, setlocale() - succeeds but then nl_langinfo(CODESET) is "646". In this situation, - some unit tests fail. */ -# if HAVE_LANGINFO_CODESET - { - const char *cs = nl_langinfo (CODESET); - if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0) - return 1; - } -# endif -# ifdef __CYGWIN__ - /* On Cygwin, avoid locale names without encoding suffix, because the - locale_charset() function relies on the encoding suffix. Note that - LC_ALL is set on the command line. */ - if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; -# endif - /* Check whether in the abbreviation of the second month, the second - character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is - two bytes long, with UTF-8 encoding. */ - t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; - if (strftime (buf, sizeof (buf), "%b", &t) < 4 - || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v') - return 1; -#endif -#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ - /* Check whether the decimal separator is a comma. - On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point - are nl_langinfo(RADIXCHAR) are both ".". */ - if (localeconv () ->decimal_point[0] != ',') return 1; -#endif + else + HAVE_DECL_TRUNC=0 + fi + if test $HAVE_DECL_TRUNC = 0 || test $REPLACE_TRUNC = 1; then + TRUNC_LIBM= + fi + + + + + + + + + + ac_fn_c_check_decl "$LINENO" "truncl" "ac_cv_have_decl_truncl" "#include +" +if test "x$ac_cv_have_decl_truncl" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_TRUNCL $ac_have_decl +_ACEOF + + if test "$ac_cv_have_decl_truncl" = yes; then + TRUNCL_LIBM=? + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double x; +int +main () +{ +x = truncl(x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + TRUNCL_LIBM= +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$TRUNCL_LIBM" = "?"; then + save_LIBS="$LIBS" + LIBS="$LIBS -lm" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double x; +int +main () +{ +x = truncl(x); + ; return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + TRUNCL_LIBM="-lm" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" + fi + if test "$TRUNCL_LIBM" = "?"; then + TRUNCL_LIBM= + fi + save_LIBS="$LIBS" + LIBS="$LIBS $TRUNCL_LIBM" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether truncl works" >&5 +$as_echo_n "checking whether truncl works... " >&6; } +if ${gl_cv_func_truncl_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + case "$host_os" in + osf4*) gl_cv_func_truncl_works="guessing no";; + *) gl_cv_func_truncl_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +long double x; +int main() +{ + x = truncl (0.0L); + return 0; +} _ACEOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest$ac_exeext; then - case "$host_os" in - # Handle native Windows specially, because there setlocale() interprets - # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", - # "fr" or "fra" as "French" or "French_France.1252", - # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", - # "ja" as "Japanese" or "Japanese_Japan.932", - # and similar. - mingw*) - # Test for the hypothetical native Windows locale name. - if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr_utf8=French_France.65001 - else - # None found. - gt_cv_locale_fr_utf8=none - fi - ;; - *) - # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because - # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the - # configure script would override the LC_ALL setting. Likewise for - # LC_CTYPE, which is also set at the beginning of the configure script. - # Test for the usual locale name. - if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr_utf8=fr_FR - else - # Test for the locale name with explicit encoding suffix. - if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr_utf8=fr_FR.UTF-8 - else - # Test for the Solaris 7 locale name. - if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr_utf8=fr.UTF-8 - else - # None found. - gt_cv_locale_fr_utf8=none - fi - fi - fi - ;; - esac +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_truncl_works=yes +else + gl_cv_func_truncl_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_truncl_works" >&5 +$as_echo "$gl_cv_func_truncl_works" >&6; } + LIBS="$save_LIBS" + case "$gl_cv_func_truncl_works" in + *yes) ;; + *) REPLACE_TRUNCL=1 ;; + esac + + else + HAVE_DECL_TRUNCL=0 + fi + if test $HAVE_DECL_TRUNCL = 0 || test $REPLACE_TRUNCL = 1; then + if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then + + TRUNCL_LIBM="$TRUNC_LIBM" + else + TRUNCL_LIBM= fi - rm -fr conftest* + fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5 -$as_echo "$gt_cv_locale_fr_utf8" >&6; } - LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 - GNULIB_FFSL=0; - GNULIB_FFSLL=0; - GNULIB_MEMCHR=0; - GNULIB_MEMMEM=0; - GNULIB_MEMPCPY=0; - GNULIB_MEMRCHR=0; - GNULIB_RAWMEMCHR=0; - GNULIB_STPCPY=0; - GNULIB_STPNCPY=0; - GNULIB_STRCHRNUL=0; - GNULIB_STRDUP=0; - GNULIB_STRNCAT=0; - GNULIB_STRNDUP=0; - GNULIB_STRNLEN=0; - GNULIB_STRPBRK=0; - GNULIB_STRSEP=0; - GNULIB_STRSTR=0; - GNULIB_STRCASESTR=0; - GNULIB_STRTOK_R=0; - GNULIB_MBSLEN=0; - GNULIB_MBSNLEN=0; - GNULIB_MBSCHR=0; - GNULIB_MBSRCHR=0; - GNULIB_MBSSTR=0; - GNULIB_MBSCASECMP=0; - GNULIB_MBSNCASECMP=0; - GNULIB_MBSPCASECMP=0; - GNULIB_MBSCASESTR=0; - GNULIB_MBSCSPN=0; - GNULIB_MBSPBRK=0; - GNULIB_MBSSPN=0; - GNULIB_MBSSEP=0; - GNULIB_MBSTOK_R=0; - GNULIB_STRERROR=0; - GNULIB_STRERROR_R=0; - GNULIB_STRSIGNAL=0; - GNULIB_STRVERSCMP=0; - HAVE_MBSLEN=0; - HAVE_FFSL=1; - HAVE_FFSLL=1; - HAVE_MEMCHR=1; - HAVE_DECL_MEMMEM=1; - HAVE_MEMPCPY=1; - HAVE_DECL_MEMRCHR=1; - HAVE_RAWMEMCHR=1; - HAVE_STPCPY=1; - HAVE_STPNCPY=1; - HAVE_STRCHRNUL=1; - HAVE_DECL_STRDUP=1; - HAVE_DECL_STRNDUP=1; - HAVE_DECL_STRNLEN=1; - HAVE_STRPBRK=1; - HAVE_STRSEP=1; - HAVE_STRCASESTR=1; - HAVE_DECL_STRTOK_R=1; - HAVE_DECL_STRERROR_R=1; - HAVE_DECL_STRSIGNAL=1; - HAVE_STRVERSCMP=1; - REPLACE_MEMCHR=0; - REPLACE_MEMMEM=0; - REPLACE_STPNCPY=0; - REPLACE_STRDUP=0; - REPLACE_STRSTR=0; - REPLACE_STRCASESTR=0; - REPLACE_STRCHRNUL=0; - REPLACE_STRERROR=0; - REPLACE_STRERROR_R=0; - REPLACE_STRNCAT=0; - REPLACE_STRNDUP=0; - REPLACE_STRNLEN=0; - REPLACE_STRSIGNAL=0; - REPLACE_STRTOK_R=0; - UNDEFINE_STRTOK_R=0; + if test $ac_cv_func__set_invalid_parameter_handler = yes; then + HAVE_MSVC_INVALID_PARAMETER_HANDLER=1 + +$as_echo "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h + else + HAVE_MSVC_INVALID_PARAMETER_HANDLER=0 + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5 -$as_echo_n "checking for a traditional french locale... " >&6; } -if ${gt_cv_locale_fr+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 +$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } +if ${ac_cv_header_stdbool_h+:} false; then : $as_echo_n "(cached) " >&6 else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#if HAVE_LANGINFO_CODESET -# include -#endif -#include -#include -struct tm t; -char buf[16]; -int main () { - /* Check whether the given locale name is recognized by the system. */ -#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__ - /* On native Windows, setlocale(category, "") looks at the system settings, - not at the environment variables. Also, when an encoding suffix such - as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE - category of the locale to "C". */ - if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL - || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) - return 1; -#else - if (setlocale (LC_ALL, "") == NULL) return 1; -#endif - /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646". - On Mac OS X 10.3.5 (Darwin 7.5) in the fr_FR locale, nl_langinfo(CODESET) - is empty, and the behaviour of Tcl 8.4 in this locale is not useful. - On OpenBSD 4.0, when an unsupported locale is specified, setlocale() - succeeds but then nl_langinfo(CODESET) is "646". In this situation, - some unit tests fail. - On MirBSD 10, when an unsupported locale is specified, setlocale() - succeeds but then nl_langinfo(CODESET) is "UTF-8". */ -#if HAVE_LANGINFO_CODESET - { - const char *cs = nl_langinfo (CODESET); - if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0 - || strcmp (cs, "UTF-8") == 0) - return 1; - } -#endif -#ifdef __CYGWIN__ - /* On Cygwin, avoid locale names without encoding suffix, because the - locale_charset() function relies on the encoding suffix. Note that - LC_ALL is set on the command line. */ - if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1; -#endif - /* Check whether in the abbreviation of the second month, the second - character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only - one byte long. This excludes the UTF-8 encoding. */ - t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4; - if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1; -#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy. */ - /* Check whether the decimal separator is a comma. - On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point - are nl_langinfo(RADIXCHAR) are both ".". */ - if (localeconv () ->decimal_point[0] != ',') return 1; -#endif + #include + + #ifdef __cplusplus + typedef bool Bool; + #else + typedef _Bool Bool; + #ifndef bool + "error: bool is not defined" + #endif + #ifndef false + "error: false is not defined" + #endif + #if false + "error: false is not 0" + #endif + #ifndef true + "error: true is not defined" + #endif + #if true != 1 + "error: true is not 1" + #endif + #endif + + #ifndef __bool_true_false_are_defined + "error: __bool_true_false_are_defined is not defined" + #endif + + struct s { Bool s: 1; Bool t; bool u: 1; bool v; } s; + + char a[true == 1 ? 1 : -1]; + char b[false == 0 ? 1 : -1]; + char c[__bool_true_false_are_defined == 1 ? 1 : -1]; + char d[(bool) 0.5 == true ? 1 : -1]; + /* See body of main program for 'e'. */ + char f[(Bool) 0.0 == false ? 1 : -1]; + char g[true]; + char h[sizeof (Bool)]; + char i[sizeof s.t]; + enum { j = false, k = true, l = false * true, m = true * 256 }; + /* The following fails for + HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ + Bool n[m]; + char o[sizeof n == m * sizeof n[0] ? 1 : -1]; + char p[-1 - (Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + /* Catch a bug in an HP-UX C compiler. See + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html + */ + Bool q = true; + Bool *pq = &q; + bool *qq = &q; + +int +main () +{ + + bool e = &s; + *pq |= q; *pq |= ! q; + *qq |= q; *qq |= ! q; + /* Refer to every declared value, to avoid compiler optimizations. */ + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + + !m + !n + !o + !p + !q + !pq + !qq); + + ; return 0; } - _ACEOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest$ac_exeext; then - case "$host_os" in - # Handle native Windows specially, because there setlocale() interprets - # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", - # "fr" or "fra" as "French" or "French_France.1252", - # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", - # "ja" as "Japanese" or "Japanese_Japan.932", - # and similar. - mingw*) - # Test for the native Windows locale name. - if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr=French_France.1252 - else - # None found. - gt_cv_locale_fr=none - fi - ;; - *) - # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because - # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the - # configure script would override the LC_ALL setting. Likewise for - # LC_CTYPE, which is also set at the beginning of the configure script. - # Test for the usual locale name. - if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr=fr_FR - else - # Test for the locale name with explicit encoding suffix. - if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr=fr_FR.ISO-8859-1 - else - # Test for the AIX, OSF/1, FreeBSD, NetBSD, OpenBSD locale name. - if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr=fr_FR.ISO8859-1 - else - # Test for the HP-UX locale name. - if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr=fr_FR.iso88591 - else - # Test for the Solaris 7 locale name. - if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then - gt_cv_locale_fr=fr - else - # None found. - gt_cv_locale_fr=none - fi - fi - fi - fi - fi - ;; - esac - fi - rm -fr conftest* - +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdbool_h=yes +else + ac_cv_header_stdbool_h=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5 -$as_echo "$gt_cv_locale_fr" >&6; } - LOCALE_FR=$gt_cv_locale_fr +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 +$as_echo "$ac_cv_header_stdbool_h" >&6; } + ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" +if test "x$ac_cv_type__Bool" = xyes; then : +cat >>confdefs.h <<_ACEOF +#define HAVE__BOOL 1 +_ACEOF +fi + GNULIB_DPRINTF=0; + GNULIB_FCLOSE=0; + GNULIB_FDOPEN=0; + GNULIB_FFLUSH=0; + GNULIB_FGETC=0; + GNULIB_FGETS=0; + GNULIB_FOPEN=0; + GNULIB_FPRINTF=0; + GNULIB_FPRINTF_POSIX=0; + GNULIB_FPURGE=0; + GNULIB_FPUTC=0; + GNULIB_FPUTS=0; + GNULIB_FREAD=0; + GNULIB_FREOPEN=0; + GNULIB_FSCANF=0; + GNULIB_FSEEK=0; + GNULIB_FSEEKO=0; + GNULIB_FTELL=0; + GNULIB_FTELLO=0; + GNULIB_FWRITE=0; + GNULIB_GETC=0; + GNULIB_GETCHAR=0; + GNULIB_GETDELIM=0; + GNULIB_GETLINE=0; + GNULIB_OBSTACK_PRINTF=0; + GNULIB_OBSTACK_PRINTF_POSIX=0; + GNULIB_PCLOSE=0; + GNULIB_PERROR=0; + GNULIB_POPEN=0; + GNULIB_PRINTF=0; + GNULIB_PRINTF_POSIX=0; + GNULIB_PUTC=0; + GNULIB_PUTCHAR=0; + GNULIB_PUTS=0; + GNULIB_REMOVE=0; + GNULIB_RENAME=0; + GNULIB_RENAMEAT=0; + GNULIB_SCANF=0; + GNULIB_SNPRINTF=0; + GNULIB_SPRINTF_POSIX=0; + GNULIB_STDIO_H_NONBLOCKING=0; + GNULIB_STDIO_H_SIGPIPE=0; + GNULIB_TMPFILE=0; + GNULIB_VASPRINTF=0; + GNULIB_VFSCANF=0; + GNULIB_VSCANF=0; + GNULIB_VDPRINTF=0; + GNULIB_VFPRINTF=0; + GNULIB_VFPRINTF_POSIX=0; + GNULIB_VPRINTF=0; + GNULIB_VPRINTF_POSIX=0; + GNULIB_VSNPRINTF=0; + GNULIB_VSPRINTF_POSIX=0; + HAVE_DECL_FPURGE=1; + HAVE_DECL_FSEEKO=1; + HAVE_DECL_FTELLO=1; + HAVE_DECL_GETDELIM=1; + HAVE_DECL_GETLINE=1; + HAVE_DECL_OBSTACK_PRINTF=1; + HAVE_DECL_SNPRINTF=1; + HAVE_DECL_VSNPRINTF=1; + HAVE_DPRINTF=1; + HAVE_FSEEKO=1; + HAVE_FTELLO=1; + HAVE_PCLOSE=1; + HAVE_POPEN=1; + HAVE_RENAMEAT=1; + HAVE_VASPRINTF=1; + HAVE_VDPRINTF=1; + REPLACE_DPRINTF=0; + REPLACE_FCLOSE=0; + REPLACE_FDOPEN=0; + REPLACE_FFLUSH=0; + REPLACE_FOPEN=0; + REPLACE_FPRINTF=0; + REPLACE_FPURGE=0; + REPLACE_FREOPEN=0; + REPLACE_FSEEK=0; + REPLACE_FSEEKO=0; + REPLACE_FTELL=0; + REPLACE_FTELLO=0; + REPLACE_GETDELIM=0; + REPLACE_GETLINE=0; + REPLACE_OBSTACK_PRINTF=0; + REPLACE_PERROR=0; + REPLACE_POPEN=0; + REPLACE_PRINTF=0; + REPLACE_REMOVE=0; + REPLACE_RENAME=0; + REPLACE_RENAMEAT=0; + REPLACE_SNPRINTF=0; + REPLACE_SPRINTF=0; + REPLACE_STDIO_READ_FUNCS=0; + REPLACE_STDIO_WRITE_FUNCS=0; + REPLACE_TMPFILE=0; + REPLACE_VASPRINTF=0; + REPLACE_VDPRINTF=0; + REPLACE_VFPRINTF=0; + REPLACE_VPRINTF=0; + REPLACE_VSNPRINTF=0; + REPLACE_VSPRINTF=0; + REPLACE_STRERROR_0=0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror(0) succeeds" >&5 +$as_echo_n "checking whether strerror(0) succeeds... " >&6; } +if ${gl_cv_func_strerror_0_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_strerror_0_works="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_strerror_0_works="guessing no" ;; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include - # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it - # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is - # irrelevant for anonymous mappings. - ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" -if test "x$ac_cv_func_mmap" = xyes; then : - gl_have_mmap=yes +int +main () +{ +int result = 0; + char *str; + errno = 0; + str = strerror (0); + if (!*str) result |= 1; + if (errno) result |= 2; + if (strstr (str, "nknown") || strstr (str, "ndefined")) + result |= 4; + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_strerror_0_works=yes else - gl_have_mmap=no + gl_cv_func_strerror_0_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi - # Try to allow MAP_ANONYMOUS. - gl_have_mmap_anonymous=no - if test $gl_have_mmap = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5 -$as_echo_n "checking for MAP_ANONYMOUS... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_0_works" >&5 +$as_echo "$gl_cv_func_strerror_0_works" >&6; } + case "$gl_cv_func_strerror_0_works" in + *yes) ;; + *) + REPLACE_STRERROR_0=1 -#include -#ifdef MAP_ANONYMOUS - I cannot identify this map -#endif +$as_echo "#define REPLACE_STRERROR_0 1" >>confdefs.h -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "I cannot identify this map" >/dev/null 2>&1; then : - gl_have_mmap_anonymous=yes -fi -rm -f conftest* + ;; + esac - if test $gl_have_mmap_anonymous != yes; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#ifdef MAP_ANON - I cannot identify this map -#endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "I cannot identify this map" >/dev/null 2>&1; then : -$as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h - gl_have_mmap_anonymous=yes -fi -rm -f conftest* - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5 -$as_echo "$gl_have_mmap_anonymous" >&6; } - if test $gl_have_mmap_anonymous = yes; then -$as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h - fi - fi - if test $HAVE_MEMCHR = 1; then - # Detect platform-specific bugs in some versions of glibc: - # memchr should not dereference anything with length 0 - # http://bugzilla.redhat.com/499689 - # memchr should not dereference overestimated length after a match - # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737 - # http://sourceware.org/bugzilla/show_bug.cgi?id=10162 - # Assume that memchr works on platforms that lack mprotect. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memchr works" >&5 -$as_echo_n "checking whether memchr works... " >&6; } -if ${gl_cv_func_memchr_works+:} false; then : + if test $gl_cv_have_include_next = yes; then + gl_cv_next_string_h='<'string.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if ${gl_cv_next_string_h+:} false; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then : - gl_cv_func_memchr_works="guessing no" -else + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include -#if HAVE_SYS_MMAN_H -# include -# include -# include -# include -# ifndef MAP_FILE -# define MAP_FILE 0 -# endif -#endif +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'string.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' -int -main () -{ + gl_cv_absolute_string_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` - int result = 0; - char *fence = NULL; -#if HAVE_SYS_MMAN_H && HAVE_MPROTECT -# if HAVE_MAP_ANONYMOUS - const int flags = MAP_ANONYMOUS | MAP_PRIVATE; - const int fd = -1; -# else /* !HAVE_MAP_ANONYMOUS */ - const int flags = MAP_FILE | MAP_PRIVATE; - int fd = open ("/dev/zero", O_RDONLY, 0666); - if (fd >= 0) -# endif - { - int pagesize = getpagesize (); - char *two_pages = - (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE, - flags, fd, 0); - if (two_pages != (char *)(-1) - && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0) - fence = two_pages + pagesize; - } -#endif - if (fence) - { - if (memchr (fence, 0, 0)) - result |= 1; - strcpy (fence - 9, "12345678"); - if (memchr (fence - 9, 0, 79) != fence - 1) - result |= 2; - if (memchr (fence - 1, 0, 3) != fence - 1) - result |= 4; - } - return result; + gl_header=$gl_cv_absolute_string_h + gl_cv_next_string_h='"'$gl_header'"' - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_memchr_works=yes -else - gl_cv_func_memchr_works=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memchr_works" >&5 -$as_echo "$gl_cv_func_memchr_works" >&6; } - if test "$gl_cv_func_memchr_works" != yes; then - REPLACE_MEMCHR=1 - fi - fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5 +$as_echo "$gl_cv_next_string_h" >&6; } + fi + NEXT_STRING_H=$gl_cv_next_string_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'string.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_string_h + fi + NEXT_AS_FIRST_DIRECTIVE_STRING_H=$gl_next_as_first_directive - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether defines MIN and MAX" >&5 -$as_echo_n "checking whether defines MIN and MAX... " >&6; } -if ${gl_cv_minmax_in_limits_h+:} false; then : + + for gl_func in ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r strerror_r strsignal strverscmp; do + as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 +$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } +if eval \${$as_gl_Symbol+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include - int x = MIN (42, 17); +#include + int main () { - +#undef $gl_func + (void) $gl_func; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_minmax_in_limits_h=yes + eval "$as_gl_Symbol=yes" else - gl_cv_minmax_in_limits_h=no + eval "$as_gl_Symbol=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_limits_h" >&5 -$as_echo "$gl_cv_minmax_in_limits_h" >&6; } - if test $gl_cv_minmax_in_limits_h = yes; then +eval ac_res=\$$as_gl_Symbol + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 +_ACEOF -$as_echo "#define HAVE_MINMAX_IN_LIMITS_H 1" >>confdefs.h + eval ac_cv_have_decl_$gl_func=yes +fi + done - fi +ac_fn_c_check_decl "$LINENO" "strndup" "ac_cv_have_decl_strndup" "$ac_includes_default" +if test "x$ac_cv_have_decl_strndup" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRNDUP $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$ac_includes_default" +if test "x$ac_cv_have_decl_strnlen" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRNLEN $ac_have_decl +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether defines MIN and MAX" >&5 -$as_echo_n "checking whether defines MIN and MAX... " >&6; } -if ${gl_cv_minmax_in_sys_param_h+:} false; then : - $as_echo_n "(cached) " >&6 + + +ac_fn_c_check_decl "$LINENO" "strtoumax" "ac_cv_have_decl_strtoumax" "$ac_includes_default" +if test "x$ac_cv_have_decl_strtoumax" = xyes; then : + ac_have_decl=1 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - int x = MIN (42, 17); -int -main () -{ + ac_have_decl=0 +fi - ; - return 0; -} +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRTOUMAX $ac_have_decl _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_minmax_in_sys_param_h=yes + + + +ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" +if test "x$ac_cv_type_pid_t" = xyes; then : + else - gl_cv_minmax_in_sys_param_h=no + +cat >>confdefs.h <<_ACEOF +#define pid_t int +_ACEOF + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" +if test "x$ac_cv_type_mode_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define mode_t int +_ACEOF + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_sys_param_h" >&5 -$as_echo "$gl_cv_minmax_in_sys_param_h" >&6; } - if test $gl_cv_minmax_in_sys_param_h = yes; then -$as_echo "#define HAVE_MINMAX_IN_SYS_PARAM_H 1" >>confdefs.h - fi + WINDOWS_64_BIT_OFF_T=0 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 -$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } -if ${ac_cv_header_stdbool_h+:} false; then : + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_types_h='<'sys/types.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if ${gl_cv_next_sys_types_h+:} false; then : $as_echo_n "(cached) " >&6 else + + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'sys/types.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_sys_types_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_types_h + gl_cv_next_sys_types_h='"'$gl_header'"' + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_types_h" >&5 +$as_echo "$gl_cv_next_sys_types_h" >&6; } + fi + NEXT_SYS_TYPES_H=$gl_cv_next_sys_types_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'sys/types.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_types_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H=$gl_next_as_first_directive + + + - #include - #ifndef bool - "error: bool is not defined" - #endif - #ifndef false - "error: false is not defined" - #endif - #if false - "error: false is not 0" - #endif - #ifndef true - "error: true is not defined" - #endif - #if true != 1 - "error: true is not 1" - #endif - #ifndef __bool_true_false_are_defined - "error: __bool_true_false_are_defined is not defined" - #endif - struct s { _Bool s: 1; _Bool t; } s; - char a[true == 1 ? 1 : -1]; - char b[false == 0 ? 1 : -1]; - char c[__bool_true_false_are_defined == 1 ? 1 : -1]; - char d[(bool) 0.5 == true ? 1 : -1]; - /* See body of main program for 'e'. */ - char f[(_Bool) 0.0 == false ? 1 : -1]; - char g[true]; - char h[sizeof (_Bool)]; - char i[sizeof s.t]; - enum { j = false, k = true, l = false * true, m = true * 256 }; - /* The following fails for - HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ - _Bool n[m]; - char o[sizeof n == m * sizeof n[0] ? 1 : -1]; - char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; - /* Catch a bug in an HP-UX C compiler. See - http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html - http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html - */ - _Bool q = true; - _Bool *pq = &q; -int -main () -{ - bool e = &s; - *pq |= q; - *pq |= ! q; - /* Refer to every declared value, to avoid compiler optimizations. */ - return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l - + !m + !n + !o + !p + !q + !pq); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdbool_h=yes -else - ac_cv_header_stdbool_h=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 -$as_echo "$ac_cv_header_stdbool_h" >&6; } - ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" -if test "x$ac_cv_type__Bool" = xyes; then : -cat >>confdefs.h <<_ACEOF -#define HAVE__BOOL 1 -_ACEOF -fi - GNULIB_DPRINTF=0; - GNULIB_FCLOSE=0; - GNULIB_FDOPEN=0; - GNULIB_FFLUSH=0; - GNULIB_FGETC=0; - GNULIB_FGETS=0; - GNULIB_FOPEN=0; - GNULIB_FPRINTF=0; - GNULIB_FPRINTF_POSIX=0; - GNULIB_FPURGE=0; - GNULIB_FPUTC=0; - GNULIB_FPUTS=0; - GNULIB_FREAD=0; - GNULIB_FREOPEN=0; - GNULIB_FSCANF=0; - GNULIB_FSEEK=0; - GNULIB_FSEEKO=0; - GNULIB_FTELL=0; - GNULIB_FTELLO=0; - GNULIB_FWRITE=0; - GNULIB_GETC=0; - GNULIB_GETCHAR=0; - GNULIB_GETDELIM=0; - GNULIB_GETLINE=0; - GNULIB_OBSTACK_PRINTF=0; - GNULIB_OBSTACK_PRINTF_POSIX=0; - GNULIB_PCLOSE=0; - GNULIB_PERROR=0; - GNULIB_POPEN=0; - GNULIB_PRINTF=0; - GNULIB_PRINTF_POSIX=0; - GNULIB_PUTC=0; - GNULIB_PUTCHAR=0; - GNULIB_PUTS=0; - GNULIB_REMOVE=0; - GNULIB_RENAME=0; - GNULIB_RENAMEAT=0; - GNULIB_SCANF=0; - GNULIB_SNPRINTF=0; - GNULIB_SPRINTF_POSIX=0; - GNULIB_STDIO_H_NONBLOCKING=0; - GNULIB_STDIO_H_SIGPIPE=0; - GNULIB_TMPFILE=0; - GNULIB_VASPRINTF=0; - GNULIB_VFSCANF=0; - GNULIB_VSCANF=0; - GNULIB_VDPRINTF=0; - GNULIB_VFPRINTF=0; - GNULIB_VFPRINTF_POSIX=0; - GNULIB_VPRINTF=0; - GNULIB_VPRINTF_POSIX=0; - GNULIB_VSNPRINTF=0; - GNULIB_VSPRINTF_POSIX=0; - HAVE_DECL_FPURGE=1; - HAVE_DECL_FSEEKO=1; - HAVE_DECL_FTELLO=1; - HAVE_DECL_GETDELIM=1; - HAVE_DECL_GETLINE=1; - HAVE_DECL_OBSTACK_PRINTF=1; - HAVE_DECL_SNPRINTF=1; - HAVE_DECL_VSNPRINTF=1; - HAVE_DPRINTF=1; - HAVE_FSEEKO=1; - HAVE_FTELLO=1; - HAVE_PCLOSE=1; - HAVE_POPEN=1; - HAVE_RENAMEAT=1; - HAVE_VASPRINTF=1; - HAVE_VDPRINTF=1; - REPLACE_DPRINTF=0; - REPLACE_FCLOSE=0; - REPLACE_FDOPEN=0; - REPLACE_FFLUSH=0; - REPLACE_FOPEN=0; - REPLACE_FPRINTF=0; - REPLACE_FPURGE=0; - REPLACE_FREOPEN=0; - REPLACE_FSEEK=0; - REPLACE_FSEEKO=0; - REPLACE_FTELL=0; - REPLACE_FTELLO=0; - REPLACE_GETDELIM=0; - REPLACE_GETLINE=0; - REPLACE_OBSTACK_PRINTF=0; - REPLACE_PERROR=0; - REPLACE_POPEN=0; - REPLACE_PRINTF=0; - REPLACE_REMOVE=0; - REPLACE_RENAME=0; - REPLACE_RENAMEAT=0; - REPLACE_SNPRINTF=0; - REPLACE_SPRINTF=0; - REPLACE_STDIO_READ_FUNCS=0; - REPLACE_STDIO_WRITE_FUNCS=0; - REPLACE_TMPFILE=0; - REPLACE_VASPRINTF=0; - REPLACE_VDPRINTF=0; - REPLACE_VFPRINTF=0; - REPLACE_VPRINTF=0; - REPLACE_VSNPRINTF=0; - REPLACE_VSPRINTF=0; - REPLACE_STRERROR_0=0 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror(0) succeeds" >&5 -$as_echo_n "checking whether strerror(0) succeeds... " >&6; } -if ${gl_cv_func_strerror_0_works+:} false; then : - $as_echo_n "(cached) " >&6 +gl_libunistring_sed_extract_major='/^[0-9]/{s/^\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' +gl_libunistring_sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{s/^[0-9]*[.]\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' +gl_libunistring_sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p;q;} +i\ +0 +q +' + + + if test "$HAVE_LIBUNISTRING" = yes; then + LIBUNISTRING_VERSION_MAJOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_major"` + LIBUNISTRING_VERSION_MINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_minor"` + LIBUNISTRING_VERSION_SUBMINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_subminor"` + fi + +ac_fn_c_check_decl "$LINENO" "clearerr_unlocked" "ac_cv_have_decl_clearerr_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_clearerr_unlocked" = xyes; then : + ac_have_decl=1 else - if test "$cross_compiling" = yes; then : - case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) gl_cv_func_strerror_0_works="guessing yes" ;; - # If we don't know, assume the worst. - *) gl_cv_func_strerror_0_works="guessing no" ;; - esac + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CLEARERR_UNLOCKED $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "feof_unlocked" "ac_cv_have_decl_feof_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_feof_unlocked" = xyes; then : + ac_have_decl=1 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - #include + ac_have_decl=0 +fi -int -main () -{ -int result = 0; - char *str; - errno = 0; - str = strerror (0); - if (!*str) result |= 1; - if (errno) result |= 2; - if (strstr (str, "nknown") || strstr (str, "ndefined")) - result |= 4; - return result; - ; - return 0; -} +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FEOF_UNLOCKED $ac_have_decl _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_strerror_0_works=yes + +ac_fn_c_check_decl "$LINENO" "ferror_unlocked" "ac_cv_have_decl_ferror_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_ferror_unlocked" = xyes; then : + ac_have_decl=1 else - gl_cv_func_strerror_0_works=no + ac_have_decl=0 fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FERROR_UNLOCKED $ac_have_decl +_ACEOF + +ac_fn_c_check_decl "$LINENO" "fflush_unlocked" "ac_cv_have_decl_fflush_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fflush_unlocked" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FFLUSH_UNLOCKED $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "fgets_unlocked" "ac_cv_have_decl_fgets_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fgets_unlocked" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_0_works" >&5 -$as_echo "$gl_cv_func_strerror_0_works" >&6; } - case "$gl_cv_func_strerror_0_works" in - *yes) ;; - *) - REPLACE_STRERROR_0=1 -$as_echo "#define REPLACE_STRERROR_0 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FGETS_UNLOCKED $ac_have_decl +_ACEOF + +ac_fn_c_check_decl "$LINENO" "fputc_unlocked" "ac_cv_have_decl_fputc_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fputc_unlocked" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi - ;; - esac +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FPUTC_UNLOCKED $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "fputs_unlocked" "ac_cv_have_decl_fputs_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fputs_unlocked" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FPUTS_UNLOCKED $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "fread_unlocked" "ac_cv_have_decl_fread_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fread_unlocked" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FREAD_UNLOCKED $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "fwrite_unlocked" "ac_cv_have_decl_fwrite_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_fwrite_unlocked" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FWRITE_UNLOCKED $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "getchar_unlocked" "ac_cv_have_decl_getchar_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_getchar_unlocked" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETCHAR_UNLOCKED $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "putc_unlocked" "ac_cv_have_decl_putc_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_putc_unlocked" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PUTC_UNLOCKED $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "putchar_unlocked" "ac_cv_have_decl_putchar_unlocked" "$ac_includes_default" +if test "x$ac_cv_have_decl_putchar_unlocked" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PUTCHAR_UNLOCKED $ac_have_decl +_ACEOF - if test $gl_cv_have_include_next = yes; then - gl_cv_next_string_h='<'string.h'>' - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 -$as_echo_n "checking absolute name of ... " >&6; } -if ${gl_cv_next_string_h+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether uses 'inline' correctly" >&5 +$as_echo_n "checking whether uses 'inline' correctly... " >&6; } +if ${gl_cv_header_wchar_h_correct_inline+:} false; then : $as_echo_n "(cached) " >&6 else + gl_cv_header_wchar_h_correct_inline=yes + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + #define wcstod renamed_wcstod +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +extern int zero (void); +int main () { return zero(); } - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include _ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac + save_ac_compile="$ac_compile" + ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/` + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' - gl_header_literal_regex=`echo 'string.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' + #define wcstod renamed_wcstod +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#include +#include +#include +#include +int zero (void) { return 0; } - gl_cv_absolute_string_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"` +_ACEOF + ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/` + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&5 2>&1; then + : + else + gl_cv_header_wchar_h_correct_inline=no + fi + fi + fi + ac_compile="$save_ac_compile" + rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext - gl_header=$gl_cv_absolute_string_h - gl_cv_next_string_h='"'$gl_header'"' +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5 +$as_echo "$gl_cv_header_wchar_h_correct_inline" >&6; } + if test $gl_cv_header_wchar_h_correct_inline = no; then + as_fn_error $? " cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS). +This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in +C99 mode. You have four options: + - Add the flag -fgnu89-inline to CC and reconfigure, or + - Fix your include files, using parts of + , or + - Use a gcc version older than 4.3, or + - Don't use the flags -std=c99 or -std=gnu99. +Configuration aborted." "$LINENO" 5 + fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5 -$as_echo "$gl_cv_next_string_h" >&6; } - fi - NEXT_STRING_H=$gl_cv_next_string_h - if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then - # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' - gl_next_as_first_directive='<'string.h'>' - else - # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' - gl_next_as_first_directive=$gl_cv_next_string_h - fi - NEXT_AS_FIRST_DIRECTIVE_STRING_H=$gl_next_as_first_directive + if test $ac_cv_header_features_h = yes; then + HAVE_FEATURES_H=1 + else + HAVE_FEATURES_H=0 + fi - for gl_func in ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r strerror_r strsignal strverscmp; do - as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 -$as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } -if eval \${$as_gl_Symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -#undef $gl_func - (void) $gl_func; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_gl_Symbol=yes" + if false; then + GL_COND_LIBTOOL_TRUE= + GL_COND_LIBTOOL_FALSE='#' else - eval "$as_gl_Symbol=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + GL_COND_LIBTOOL_TRUE='#' + GL_COND_LIBTOOL_FALSE= fi -eval ac_res=\$$as_gl_Symbol - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - if eval test \"x\$"$as_gl_Symbol"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_RAW_DECL_$gl_func" | $as_tr_cpp` 1 -_ACEOF - eval ac_cv_have_decl_$gl_func=yes -fi - done + gl_cond_libtool=false + gl_libdeps= + gl_ltlibdeps= + gl_m4_base='m4' -ac_fn_c_check_decl "$LINENO" "strndup" "ac_cv_have_decl_strndup" "$ac_includes_default" -if test "x$ac_cv_have_decl_strndup" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRNDUP $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$ac_includes_default" -if test "x$ac_cv_have_decl_strnlen" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRNLEN $ac_have_decl -_ACEOF + gl_source_base='lib' -ac_fn_c_check_decl "$LINENO" "strtoumax" "ac_cv_have_decl_strtoumax" "$ac_includes_default" -if test "x$ac_cv_have_decl_strtoumax" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_STRTOUMAX $ac_have_decl -_ACEOF + if test $ac_cv_func_alloca_works = no; then + : + fi + # Define an additional variable used in the Makefile substitution. + if test $ac_cv_working_alloca_h = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5 +$as_echo_n "checking for alloca as a compiler built-in... " >&6; } +if ${gl_cv_rpl_alloca+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" -if test "x$ac_cv_type_pid_t" = xyes; then : +#if defined __GNUC__ || defined _AIX || defined _MSC_VER + Need own alloca +#endif +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Need own alloca" >/dev/null 2>&1; then : + gl_cv_rpl_alloca=yes else + gl_cv_rpl_alloca=no +fi +rm -f conftest* -cat >>confdefs.h <<_ACEOF -#define pid_t int -_ACEOF fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_rpl_alloca" >&5 +$as_echo "$gl_cv_rpl_alloca" >&6; } + if test $gl_cv_rpl_alloca = yes; then -ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" -if test "x$ac_cv_type_mode_t" = xyes; then : - -else +$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define mode_t int -_ACEOF + ALLOCA_H=alloca.h + else + ALLOCA_H= + fi + else + ALLOCA_H=alloca.h + fi + if test -n "$ALLOCA_H"; then + GL_GENERATE_ALLOCA_H_TRUE= + GL_GENERATE_ALLOCA_H_FALSE='#' +else + GL_GENERATE_ALLOCA_H_TRUE='#' + GL_GENERATE_ALLOCA_H_FALSE= fi - WINDOWS_64_BIT_OFF_T=0 - + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable assertions" >&5 +$as_echo_n "checking whether to enable assertions... " >&6; } + # Check whether --enable-assert was given. +if test "${enable_assert+set}" = set; then : + enableval=$enable_assert; if test "x$enableval" = xno; then : +$as_echo "#define NDEBUG 1" >>confdefs.h +elif test "x$enableval" != xyes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid argument supplied to --enable-assert" >&5 +$as_echo "$as_me: WARNING: invalid argument supplied to --enable-assert" >&2;} + enable_assert=yes +fi +else + enable_assert=yes +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_assert" >&5 +$as_echo "$enable_assert" >&6; } @@ -15027,521 +16649,372 @@ - if test $gl_cv_have_include_next = yes; then - gl_cv_next_sys_types_h='<'sys/types.h'>' - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 -$as_echo_n "checking absolute name of ... " >&6; } -if ${gl_cv_next_sys_types_h+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible calloc" >&5 +$as_echo_n "checking for GNU libc compatible calloc... " >&6; } +if ${ac_cv_func_calloc_0_nonnull+:} false; then : $as_echo_n "(cached) " >&6 else + if test "$cross_compiling" = yes; then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) ac_cv_func_calloc_0_nonnull="guessing yes" ;; + # If we don't know, assume the worst. + *) ac_cv_func_calloc_0_nonnull="guessing no" ;; + esac - - +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +$ac_includes_default +int +main () +{ +int result = 0; + char *p = calloc (0, 0); + if (!p) + result |= 1; + free (p); + p = calloc ((size_t) -1 / 8 + 1, 8); + if (p) + result |= 2; + free (p); + return result; + + ; + return 0; +} _ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_calloc_0_nonnull=yes +else + ac_cv_func_calloc_0_nonnull=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_calloc_0_nonnull" >&5 +$as_echo "$ac_cv_func_calloc_0_nonnull" >&6; } + case "$ac_cv_func_calloc_0_nonnull" in + *yes) + +$as_echo "#define HAVE_CALLOC_GNU 1" >>confdefs.h - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' ;; *) - gl_dirsep_regex='\/' + $as_echo "#define HAVE_CALLOC_GNU 0" >>confdefs.h + + REPLACE_CALLOC=1 + ;; esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' - gl_header_literal_regex=`echo 'sys/types.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' - gl_cv_absolute_sys_types_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"` - gl_header=$gl_cv_absolute_sys_types_h - gl_cv_next_sys_types_h='"'$gl_header'"' + if test $REPLACE_CALLOC = 1; then -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_types_h" >&5 -$as_echo "$gl_cv_next_sys_types_h" >&6; } - fi - NEXT_SYS_TYPES_H=$gl_cv_next_sys_types_h - if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then - # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' - gl_next_as_first_directive='<'sys/types.h'>' - else - # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' - gl_next_as_first_directive=$gl_cv_next_sys_types_h - fi - NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H=$gl_next_as_first_directive + gl_LIBOBJS="$gl_LIBOBJS calloc.$ac_objext" + fi +cat >>confdefs.h <<_ACEOF +#define GNULIB_CALLOC_GNU 1 +_ACEOF + if test $gl_cv_func_malloc_posix = yes; then +$as_echo "#define HAVE_CALLOC_POSIX 1" >>confdefs.h + else + REPLACE_CALLOC=1 + fi + if test $REPLACE_CALLOC = 1; then -gl_libunistring_sed_extract_major='/^[0-9]/{s/^\([0-9]*\).*/\1/p;q;} -i\ -0 -q -' -gl_libunistring_sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{s/^[0-9]*[.]\([0-9]*\).*/\1/p;q;} -i\ -0 -q -' -gl_libunistring_sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p;q;} -i\ -0 -q -' - if test "$HAVE_LIBUNISTRING" = yes; then - LIBUNISTRING_VERSION_MAJOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_major"` - LIBUNISTRING_VERSION_MINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_minor"` - LIBUNISTRING_VERSION_SUBMINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_subminor"` + + + + + + gl_LIBOBJS="$gl_LIBOBJS calloc.$ac_objext" + fi -ac_fn_c_check_decl "$LINENO" "clearerr_unlocked" "ac_cv_have_decl_clearerr_unlocked" "$ac_includes_default" -if test "x$ac_cv_have_decl_clearerr_unlocked" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CLEARERR_UNLOCKED $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "feof_unlocked" "ac_cv_have_decl_feof_unlocked" "$ac_includes_default" -if test "x$ac_cv_have_decl_feof_unlocked" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FEOF_UNLOCKED $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "ferror_unlocked" "ac_cv_have_decl_ferror_unlocked" "$ac_includes_default" -if test "x$ac_cv_have_decl_ferror_unlocked" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi + GNULIB_CALLOC_POSIX=1 -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FERROR_UNLOCKED $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "fflush_unlocked" "ac_cv_have_decl_fflush_unlocked" "$ac_includes_default" -if test "x$ac_cv_have_decl_fflush_unlocked" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FFLUSH_UNLOCKED $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "fgets_unlocked" "ac_cv_have_decl_fgets_unlocked" "$ac_includes_default" -if test "x$ac_cv_have_decl_fgets_unlocked" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FGETS_UNLOCKED $ac_have_decl -_ACEOF +$as_echo "#define GNULIB_TEST_CALLOC_POSIX 1" >>confdefs.h -ac_fn_c_check_decl "$LINENO" "fputc_unlocked" "ac_cv_have_decl_fputc_unlocked" "$ac_includes_default" -if test "x$ac_cv_have_decl_fputc_unlocked" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FPUTC_UNLOCKED $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "fputs_unlocked" "ac_cv_have_decl_fputs_unlocked" "$ac_includes_default" -if test "x$ac_cv_have_decl_fputs_unlocked" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FPUTS_UNLOCKED $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "fread_unlocked" "ac_cv_have_decl_fread_unlocked" "$ac_includes_default" -if test "x$ac_cv_have_decl_fread_unlocked" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FREAD_UNLOCKED $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "fwrite_unlocked" "ac_cv_have_decl_fwrite_unlocked" "$ac_includes_default" -if test "x$ac_cv_have_decl_fwrite_unlocked" = xyes; then : - ac_have_decl=1 + + saved_as_echo_n="$as_echo_n" + as_echo_n=':' + if ${gl_cv_func_ceil_libm+:} false; then : + $as_echo_n "(cached) " >&6 else - ac_have_decl=0 -fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_FWRITE_UNLOCKED $ac_have_decl + gl_cv_func_ceil_libm=? + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + double x; +int +main () +{ +x = ceil(x); + ; + return 0; +} _ACEOF - -ac_fn_c_check_decl "$LINENO" "getchar_unlocked" "ac_cv_have_decl_getchar_unlocked" "$ac_includes_default" -if test "x$ac_cv_have_decl_getchar_unlocked" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_ceil_libm= fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETCHAR_UNLOCKED $ac_have_decl +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$gl_cv_func_ceil_libm" = "?"; then + save_LIBS="$LIBS" + LIBS="$LIBS -lm" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + double x; +int +main () +{ +x = ceil(x); + ; + return 0; +} _ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_ceil_libm="-lm" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" + fi -ac_fn_c_check_decl "$LINENO" "putc_unlocked" "ac_cv_have_decl_putc_unlocked" "$ac_includes_default" -if test "x$ac_cv_have_decl_putc_unlocked" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PUTC_UNLOCKED $ac_have_decl -_ACEOF + as_echo_n="$saved_as_echo_n" -ac_fn_c_check_decl "$LINENO" "putchar_unlocked" "ac_cv_have_decl_putchar_unlocked" "$ac_includes_default" -if test "x$ac_cv_have_decl_putchar_unlocked" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi + CEIL_LIBM="$gl_cv_func_ceil_libm" -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PUTCHAR_UNLOCKED $ac_have_decl -_ACEOF + if test "$CEIL_LIBM" = "?"; then + CEIL_LIBM= + fi + if test $REPLACE_CEIL = 1; then + CEIL_LIBM= + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether uses 'inline' correctly" >&5 -$as_echo_n "checking whether uses 'inline' correctly... " >&6; } -if ${gl_cv_header_wchar_h_correct_inline+:} false; then : - $as_echo_n "(cached) " >&6 -else - gl_cv_header_wchar_h_correct_inline=yes - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - #define wcstod renamed_wcstod -/* Tru64 with Desktop Toolkit C has a bug: must be included before - . - BSD/OS 4.0.1 has a bug: , and must be - included before . */ -#include -#include -#include -#include -extern int zero (void); -int main () { return zero(); } + if test $REPLACE_CEIL = 1; then -_ACEOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - mv conftest.$ac_objext conftest1.$ac_objext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - #define wcstod renamed_wcstod -/* Tru64 with Desktop Toolkit C has a bug: must be included before - . - BSD/OS 4.0.1 has a bug: , and must be - included before . */ -#include -#include -#include -#include -int zero (void) { return 0; } -_ACEOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - mv conftest.$ac_objext conftest2.$ac_objext - if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&5 2>&1; then - : - else - gl_cv_header_wchar_h_correct_inline=no - fi - fi - fi - rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5 -$as_echo "$gl_cv_header_wchar_h_correct_inline" >&6; } - if test $gl_cv_header_wchar_h_correct_inline = no; then - as_fn_error $? " cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS). -This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in -C99 mode. You have four options: - - Add the flag -fgnu89-inline to CC and reconfigure, or - - Fix your include files, using parts of - , or - - Use a gcc version older than 4.3, or - - Don't use the flags -std=c99 or -std=gnu99. -Configuration aborted." "$LINENO" 5 - fi + gl_LIBOBJS="$gl_LIBOBJS ceil.$ac_objext" - if test $ac_cv_header_features_h = yes; then - HAVE_FEATURES_H=1 - else - HAVE_FEATURES_H=0 fi - if false; then - GL_COND_LIBTOOL_TRUE= - GL_COND_LIBTOOL_FALSE='#' -else - GL_COND_LIBTOOL_TRUE='#' - GL_COND_LIBTOOL_FALSE= -fi - - gl_cond_libtool=false - gl_libdeps= - gl_ltlibdeps= - gl_m4_base='m4' + GNULIB_CEIL=1 +$as_echo "#define GNULIB_TEST_CEIL 1" >>confdefs.h - gl_source_base='lib' - if test $ac_cv_func_alloca_works = no; then - : - fi - # Define an additional variable used in the Makefile substitution. - if test $ac_cv_working_alloca_h = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5 -$as_echo_n "checking for alloca as a compiler built-in... " >&6; } -if ${gl_cv_rpl_alloca+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if defined __GNUC__ || defined _AIX || defined _MSC_VER - Need own alloca -#endif -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "Need own alloca" >/dev/null 2>&1; then : - gl_cv_rpl_alloca=yes + ac_fn_c_check_decl "$LINENO" "ceill" "ac_cv_have_decl_ceill" "#include +" +if test "x$ac_cv_have_decl_ceill" = xyes; then : + ac_have_decl=1 else - gl_cv_rpl_alloca=no + ac_have_decl=0 fi -rm -f conftest* +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CEILL $ac_have_decl +_ACEOF -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_rpl_alloca" >&5 -$as_echo "$gl_cv_rpl_alloca" >&6; } - if test $gl_cv_rpl_alloca = yes; then - -$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h + if test "$ac_cv_have_decl_ceill" = yes; then - ALLOCA_H=alloca.h - else - ALLOCA_H= - fi - else - ALLOCA_H=alloca.h - fi - if test -n "$ALLOCA_H"; then - GL_GENERATE_ALLOCA_H_TRUE= - GL_GENERATE_ALLOCA_H_FALSE='#' + saved_as_echo_n="$as_echo_n" + as_echo_n=':' + if ${gl_cv_func_ceill_libm+:} false; then : + $as_echo_n "(cached) " >&6 else - GL_GENERATE_ALLOCA_H_TRUE='#' - GL_GENERATE_ALLOCA_H_FALSE= + + gl_cv_func_ceill_libm=? + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double (*funcptr) (long double) = ceill; + long double x; +int +main () +{ +x = funcptr(x) + ceill(x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_ceill_libm= +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$gl_cv_func_ceill_libm" = "?"; then + save_LIBS="$LIBS" + LIBS="$LIBS -lm" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double (*funcptr) (long double) = ceill; + long double x; +int +main () +{ +x = funcptr(x) + ceill(x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_ceill_libm="-lm" fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" + fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable assertions" >&5 -$as_echo_n "checking whether to enable assertions... " >&6; } - # Check whether --enable-assert was given. -if test "${enable_assert+set}" = set; then : - enableval=$enable_assert; if test "x$enableval" = xno; then : - -$as_echo "#define NDEBUG 1" >>confdefs.h - -elif test "x$enableval" != xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid argument supplied to --enable-assert" >&5 -$as_echo "$as_me: WARNING: invalid argument supplied to --enable-assert" >&2;} - enable_assert=yes -fi -else - enable_assert=yes fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_assert" >&5 -$as_echo "$enable_assert" >&6; } - - - - - - + as_echo_n="$saved_as_echo_n" + CEILL_LIBM="$gl_cv_func_ceill_libm" + if test "$CEILL_LIBM" = "?"; then + REPLACE_CEILL=1 + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible calloc" >&5 -$as_echo_n "checking for GNU libc compatible calloc... " >&6; } -if ${ac_cv_func_calloc_0_nonnull+:} false; then : + else + HAVE_DECL_CEILL=0 + fi + if test $REPLACE_CEILL = 0 ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ceill() breaks with small values" >&5 +$as_echo_n "checking whether ceill() breaks with small values... " >&6; } +if ${gl_cv_func_ceill_buggy+:} false; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then : - case "$host_os" in - # Guess yes on glibc systems. - *-gnu*) ac_cv_func_calloc_0_nonnull="guessing yes" ;; - # If we don't know, assume the worst. - *) ac_cv_func_calloc_0_nonnull="guessing no" ;; - esac + save_LIBS="$LIBS" + LIBS="$CEILL_LIBM" + if test "$cross_compiling" = yes; then : + case $host_os in + openbsd*) gl_cv_func_ceill_buggy="guessing yes";; + *) gl_cv_func_ceill_buggy="guessing no";; + esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default +#include +long double d = 0.3L; int main () { -int result = 0; - if (!calloc (0, 0)) - result |= 1; - if (calloc ((size_t) -1 / 8 + 1, 8)) - result |= 2; - return result; - +return (!(ceill (d) == 1)); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_calloc_0_nonnull=yes + gl_cv_func_ceill_buggy=no else - ac_cv_func_calloc_0_nonnull=no + gl_cv_func_ceill_buggy=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_calloc_0_nonnull" >&5 -$as_echo "$ac_cv_func_calloc_0_nonnull" >&6; } - case "$ac_cv_func_calloc_0_nonnull" in - *yes) - -$as_echo "#define HAVE_CALLOC_GNU 1" >>confdefs.h - - ;; - *) - $as_echo "#define HAVE_CALLOC_GNU 0" >>confdefs.h - - REPLACE_CALLOC=1 - - ;; - esac - - - if test $REPLACE_CALLOC = 1; then - - - - - - - - - gl_LIBOBJS="$gl_LIBOBJS calloc.$ac_objext" + LIBS="$save_LIBS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ceill_buggy" >&5 +$as_echo "$gl_cv_func_ceill_buggy" >&6; } + case "$gl_cv_func_ceill_buggy" in + *yes) + REPLACE_CEILL=1 ;; + esac fi + if test $HAVE_DECL_CEILL = 0 || test $REPLACE_CEILL = 1; then + if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then - -cat >>confdefs.h <<_ACEOF -#define GNULIB_CALLOC_GNU 1 -_ACEOF - - - - - - if test $gl_cv_func_malloc_posix = yes; then - -$as_echo "#define HAVE_CALLOC_POSIX 1" >>confdefs.h - - else - REPLACE_CALLOC=1 + CEILL_LIBM="$CEIL_LIBM" + else + CEILL_LIBM= + fi fi - if test $REPLACE_CALLOC = 1; then + if test $HAVE_DECL_CEILL = 0 || test $REPLACE_CEILL = 1; then @@ -15549,7 +17022,8 @@ - gl_LIBOBJS="$gl_LIBOBJS calloc.$ac_objext" + + gl_LIBOBJS="$gl_LIBOBJS ceill.$ac_objext" fi @@ -15557,13 +17031,13 @@ - GNULIB_CALLOC_POSIX=1 + GNULIB_CEILL=1 -$as_echo "#define GNULIB_TEST_CALLOC_POSIX 1" >>confdefs.h +$as_echo "#define GNULIB_TEST_CEILL 1" >>confdefs.h @@ -16863,118 +18337,235 @@ *) gl_absname_cpp="$ac_cpp" ;; esac - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' - gl_header_literal_regex=`echo 'float.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'float.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + + gl_cv_absolute_float_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_float_h + gl_cv_next_float_h='"'$gl_header'"' + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_float_h" >&5 +$as_echo "$gl_cv_next_float_h" >&6; } + fi + NEXT_FLOAT_H=$gl_cv_next_float_h + + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'float.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_float_h + fi + NEXT_AS_FIRST_DIRECTIVE_FLOAT_H=$gl_next_as_first_directive + + + + + fi + + if test -n "$FLOAT_H"; then + GL_GENERATE_FLOAT_H_TRUE= + GL_GENERATE_FLOAT_H_FALSE='#' +else + GL_GENERATE_FLOAT_H_TRUE='#' + GL_GENERATE_FLOAT_H_FALSE= +fi + + + + if test $REPLACE_FLOAT_LDBL = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS float.$ac_objext" + + fi + if test $REPLACE_ITOLD = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS itold.$ac_objext" + + fi + + + + + + saved_as_echo_n="$as_echo_n" + as_echo_n=':' + if ${gl_cv_func_floor_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_cv_func_floor_libm=? + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + double x; +int +main () +{ +x = floor(x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_floor_libm= +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$gl_cv_func_floor_libm" = "?"; then + save_LIBS="$LIBS" + LIBS="$LIBS -lm" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + double x; +int +main () +{ +x = floor(x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_floor_libm="-lm" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" + fi + +fi + + as_echo_n="$saved_as_echo_n" - gl_cv_absolute_float_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"` + FLOOR_LIBM="$gl_cv_func_floor_libm" - gl_header=$gl_cv_absolute_float_h - gl_cv_next_float_h='"'$gl_header'"' + if test "$FLOOR_LIBM" = "?"; then + FLOOR_LIBM= + fi + if test $REPLACE_FLOOR = 1; then + FLOOR_LIBM= + fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_float_h" >&5 -$as_echo "$gl_cv_next_float_h" >&6; } - fi - NEXT_FLOAT_H=$gl_cv_next_float_h - if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then - # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' - gl_next_as_first_directive='<'float.h'>' - else - # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' - gl_next_as_first_directive=$gl_cv_next_float_h - fi - NEXT_AS_FIRST_DIRECTIVE_FLOAT_H=$gl_next_as_first_directive + if test $REPLACE_FLOOR = 1; then - fi - if test -n "$FLOAT_H"; then - GL_GENERATE_FLOAT_H_TRUE= - GL_GENERATE_FLOAT_H_FALSE='#' -else - GL_GENERATE_FLOAT_H_TRUE='#' - GL_GENERATE_FLOAT_H_FALSE= -fi - if test $REPLACE_FLOAT_LDBL = 1; then + gl_LIBOBJS="$gl_LIBOBJS floor.$ac_objext" + fi + GNULIB_FLOOR=1 - gl_LIBOBJS="$gl_LIBOBJS float.$ac_objext" - fi - if test $REPLACE_ITOLD = 1; then +$as_echo "#define GNULIB_TEST_FLOOR 1" >>confdefs.h + - gl_LIBOBJS="$gl_LIBOBJS itold.$ac_objext" - fi + ac_fn_c_check_decl "$LINENO" "floorl" "ac_cv_have_decl_floorl" "#include +" +if test "x$ac_cv_have_decl_floorl" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FLOORL $ac_have_decl +_ACEOF + if test "$ac_cv_have_decl_floorl" = yes; then saved_as_echo_n="$as_echo_n" as_echo_n=':' - if ${gl_cv_func_floor_libm+:} false; then : + if ${gl_cv_func_floorl_libm+:} false; then : $as_echo_n "(cached) " >&6 else - gl_cv_func_floor_libm=? + gl_cv_func_floorl_libm=? cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __NO_MATH_INLINES # define __NO_MATH_INLINES 1 /* for glibc */ #endif #include - double x; + long double (*funcptr) (long double) = floorl; + long double x; int main () { -x = floor(x); +x = funcptr (x) + floorl(x); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - gl_cv_func_floor_libm= + gl_cv_func_floorl_libm= fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext - if test "$gl_cv_func_floor_libm" = "?"; then + if test "$gl_cv_func_floorl_libm" = "?"; then save_LIBS="$LIBS" LIBS="$LIBS -lm" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -16983,17 +18574,18 @@ # define __NO_MATH_INLINES 1 /* for glibc */ #endif #include - double x; + long double (*funcptr) (long double) = floorl; + long double x; int main () { -x = floor(x); +x = funcptr (x) + floorl(x); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - gl_cv_func_floor_libm="-lm" + gl_cv_func_floorl_libm="-lm" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -17004,18 +18596,25 @@ as_echo_n="$saved_as_echo_n" - FLOOR_LIBM="$gl_cv_func_floor_libm" + FLOORL_LIBM="$gl_cv_func_floorl_libm" - if test "$FLOOR_LIBM" = "?"; then - FLOOR_LIBM= + if test "$FLOORL_LIBM" = "?"; then + REPLACE_FLOORL=1 + fi + else + HAVE_DECL_FLOORL=0 fi + if test $HAVE_DECL_FLOORL = 0 || test $REPLACE_FLOORL = 1; then + if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then - if test $REPLACE_FLOOR = 1; then - FLOOR_LIBM= + FLOORL_LIBM="$FLOOR_LIBM" + else + FLOORL_LIBM= + fi fi - if test $REPLACE_FLOOR = 1; then + if test $HAVE_DECL_FLOORL = 0 || test $REPLACE_FLOORL = 1; then @@ -17024,7 +18623,7 @@ - gl_LIBOBJS="$gl_LIBOBJS floor.$ac_objext" + gl_LIBOBJS="$gl_LIBOBJS floorl.$ac_objext" fi @@ -17032,13 +18631,13 @@ - GNULIB_FLOOR=1 + GNULIB_FLOORL=1 -$as_echo "#define GNULIB_TEST_FLOOR 1" >>confdefs.h +$as_echo "#define GNULIB_TEST_FLOORL 1" >>confdefs.h @@ -17104,535 +18703,259 @@ gl_LIBOBJS="$gl_LIBOBJS fpending.$ac_objext" + fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to determine the number of pending output bytes on a stream" >&5 -$as_echo_n "checking how to determine the number of pending output bytes on a stream... " >&6; } -if ${ac_cv_sys_pending_output_n_bytes+:} false; then : - $as_echo_n "(cached) " >&6 -else - - for ac_expr in \ - \ - '# glibc2' \ - 'fp->_IO_write_ptr - fp->_IO_write_base' \ - \ - '# traditional Unix' \ - 'fp->_ptr - fp->_base' \ - \ - '# BSD' \ - 'fp->_p - fp->_bf._base' \ - \ - '# SCO, Unixware' \ - '(fp->__ptr ? fp->__ptr - fp->__base : 0)' \ - \ - '# QNX' \ - '(fp->_Mode & 0x2000 /*_MWRITE*/ ? fp->_Next - fp->_Buf : 0)' \ - \ - '# old glibc?' \ - 'fp->__bufp - fp->__buffer' \ - \ - '# old glibc iostream?' \ - 'fp->_pptr - fp->_pbase' \ - \ - '# emx+gcc' \ - 'fp->_ptr - fp->_buffer' \ - \ - '# Minix' \ - 'fp->_ptr - fp->_buf' \ - \ - '# Plan9' \ - 'fp->wp - fp->buf' \ - \ - '# VMS' \ - '(*fp)->_ptr - (*fp)->_base' \ - \ - '# e.g., DGUX R4.11; the info is not available' \ - 1 \ - ; do + if test $gl_func_frexp != yes; then - # Skip each embedded comment. - case "$ac_expr" in '#'*) continue;; esac - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -FILE *fp = stdin; (void) ($ac_expr); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - fp_done=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$fp_done" = yes && break - done - ac_cv_sys_pending_output_n_bytes=$ac_expr -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_pending_output_n_bytes" >&5 -$as_echo "$ac_cv_sys_pending_output_n_bytes" >&6; } -cat >>confdefs.h <<_ACEOF -#define PENDING_OUTPUT_N_BYTES $ac_cv_sys_pending_output_n_bytes -_ACEOF + gl_LIBOBJS="$gl_LIBOBJS frexp.$ac_objext" fi - FREXP_LIBM= - if test $gl_cv_func_frexp_no_libm = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used with libm" >&5 -$as_echo_n "checking whether frexp() can be used with libm... " >&6; } -if ${gl_cv_func_frexp_in_libm+:} false; then : - $as_echo_n "(cached) " >&6 -else - save_LIBS="$LIBS" - LIBS="$LIBS -lm" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - double x; -int -main () -{ -int e; return frexp (x, &e) > 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - gl_cv_func_frexp_in_libm=yes -else - gl_cv_func_frexp_in_libm=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$save_LIBS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_in_libm" >&5 -$as_echo "$gl_cv_func_frexp_in_libm" >&6; } - if test $gl_cv_func_frexp_in_libm = yes; then - FREXP_LIBM=-lm - fi - fi - if test $gl_cv_func_frexp_no_libm = yes \ - || test $gl_cv_func_frexp_in_libm = yes; then - save_LIBS="$LIBS" - LIBS="$LIBS $FREXP_LIBM" + GNULIB_FREXP=1 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp works" >&5 -$as_echo_n "checking whether frexp works... " >&6; } -if ${gl_cv_func_frexp_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - case "$host_os" in - netbsd* | irix* | mingw*) gl_cv_func_frexp_works="guessing no";; - *) gl_cv_func_frexp_works="guessing yes";; - esac -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +$as_echo "#define GNULIB_TEST_FREXP 1" >>confdefs.h -#include -#include -#include -#if HAVE_DECL_ALARM -# include -# include -#endif -/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0. - ICC 10.0 has a bug when optimizing the expression -zero. - The expression -DBL_MIN * DBL_MIN does not work when cross-compiling - to PowerPC on Mac OS X 10.5. */ -#if defined __hpux || defined __sgi || defined __ICC -static double -compute_minus_zero (void) -{ - return -DBL_MIN * DBL_MIN; -} -# define minus_zero compute_minus_zero () -#else -double minus_zero = -0.0; -#endif -int main() -{ - int result = 0; - int i; - volatile double x; - double zero = 0.0; -#if HAVE_DECL_ALARM - /* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite - number. Let the test fail in this case. */ - signal (SIGALRM, SIG_DFL); - alarm (5); -#endif - /* Test on denormalized numbers. */ - for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5) - ; - if (x > 0.0) - { - int exp; - double y = frexp (x, &exp); - /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022. - On NetBSD: y = 0.75. Correct: y = 0.5. */ - if (y != 0.5) - result |= 1; - } - /* Test on infinite numbers. */ - x = 1.0 / zero; - { - int exp; - double y = frexp (x, &exp); - if (y != x) - result |= 2; - } - /* Test on negative zero. */ - x = minus_zero; - { - int exp; - double y = frexp (x, &exp); - if (memcmp (&y, &x, sizeof x)) - result |= 4; - } - return result; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_frexp_works=yes -else - gl_cv_func_frexp_works=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_works" >&5 -$as_echo "$gl_cv_func_frexp_works" >&6; } - LIBS="$save_LIBS" - case "$gl_cv_func_frexp_works" in - *yes) gl_func_frexp=yes ;; - *) gl_func_frexp=no; REPLACE_FREXP=1; FREXP_LIBM= ;; - esac - else - gl_func_frexp=no - fi - if test $gl_func_frexp = yes; then + if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then + + -$as_echo "#define HAVE_FREXP 1" >>confdefs.h + + + + + + gl_LIBOBJS="$gl_LIBOBJS frexpl.$ac_objext" fi - if test $gl_func_frexp != yes; then + GNULIB_FREXPL=1 - gl_LIBOBJS="$gl_LIBOBJS frexp.$ac_objext" +$as_echo "#define GNULIB_TEST_FREXPL 1" >>confdefs.h - fi - GNULIB_FREXP=1 + if test $REPLACE_GETOPT = 1; then -$as_echo "#define GNULIB_TEST_FREXP 1" >>confdefs.h + gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext" - ac_fn_c_check_decl "$LINENO" "frexpl" "ac_cv_have_decl_frexpl" "#include -" -if test "x$ac_cv_have_decl_frexpl" = xyes; then : -else - HAVE_DECL_FREXPL=0 -fi - FREXPL_LIBM= - if test $HAVE_DECL_FREXPL = 1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used without linking with libm" >&5 -$as_echo_n "checking whether frexpl() can be used without linking with libm... " >&6; } -if ${gl_cv_func_frexpl_no_libm+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - long double x; -int -main () -{ -int e; return frexpl (x, &e) > 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - gl_cv_func_frexpl_no_libm=yes -else - gl_cv_func_frexpl_no_libm=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_no_libm" >&5 -$as_echo "$gl_cv_func_frexpl_no_libm" >&6; } - if test $gl_cv_func_frexpl_no_libm = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used with libm" >&5 -$as_echo_n "checking whether frexpl() can be used with libm... " >&6; } -if ${gl_cv_func_frexpl_in_libm+:} false; then : - $as_echo_n "(cached) " >&6 -else - save_LIBS="$LIBS" - LIBS="$LIBS -lm" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - long double x; -int -main () -{ -int e; return frexpl (x, &e) > 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - gl_cv_func_frexpl_in_libm=yes -else - gl_cv_func_frexpl_in_libm=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LIBS="$save_LIBS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_in_libm" >&5 -$as_echo "$gl_cv_func_frexpl_in_libm" >&6; } - if test $gl_cv_func_frexpl_in_libm = yes; then - FREXPL_LIBM=-lm - fi + GNULIB_GL_UNISTD_H_GETOPT=1 + fi + + + + + + + REPLACE_GETOPT=0 + if test -n "$gl_replace_getopt"; then + REPLACE_GETOPT=1 fi - if test $gl_cv_func_frexpl_no_libm = yes \ - || test $gl_cv_func_frexpl_in_libm = yes; then - save_LIBS="$LIBS" - LIBS="$LIBS $FREXPL_LIBM" + if test $REPLACE_GETOPT = 1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl works" >&5 -$as_echo_n "checking whether frexpl works... " >&6; } -if ${gl_cv_func_frexpl_works+:} false; then : - $as_echo_n "(cached) " >&6 -else + GETOPT_H=getopt.h - if test "$cross_compiling" = yes; then : +$as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h - case "$host_os" in - aix | aix[3-6]* | beos* | darwin* | irix* | mingw* | pw*) - gl_cv_func_frexpl_works="guessing no";; - *) gl_cv_func_frexpl_works="guessing yes";; - esac -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -/* Override the values of , like done in float.in.h. */ -#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__) -# undef LDBL_MIN_EXP -# define LDBL_MIN_EXP (-16381) -#endif -#if defined __i386__ && defined __FreeBSD__ -# undef LDBL_MIN_EXP -# define LDBL_MIN_EXP (-16381) -#endif -#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__ -# undef LDBL_MIN_EXP -# define LDBL_MIN_EXP DBL_MIN_EXP -#endif -#if defined __sgi && (LDBL_MANT_DIG >= 106) -# if defined __GNUC__ -# undef LDBL_MIN_EXP -# define LDBL_MIN_EXP DBL_MIN_EXP -# endif -#endif -extern -#ifdef __cplusplus -"C" -#endif -long double frexpl (long double, int *); -int main() -{ - int result = 0; - volatile long double x; - /* Test on finite numbers that fails on AIX 5.1. */ - x = 16.0L; - { - int exp = -9999; - frexpl (x, &exp); - if (exp != 5) - result |= 1; - } - /* Test on finite numbers that fails on Mac OS X 10.4, because its frexpl - function returns an invalid (incorrectly normalized) value: it returns - y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 } - but the correct result is - 0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 } */ - x = 1.01L; - { - int exp = -9999; - long double y = frexpl (x, &exp); - if (!(exp == 1 && y == 0.505L)) - result |= 2; - } - /* Test on large finite numbers. This fails on BeOS at i = 16322, while - LDBL_MAX_EXP = 16384. - In the loop end test, we test x against Infinity, rather than comparing - i with LDBL_MAX_EXP, because BeOS has a wrong LDBL_MAX_EXP. */ - { - int i; - for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L) - { - int exp = -9999; - frexpl (x, &exp); - if (exp != i) - { - result |= 4; - break; - } - } - } - /* Test on denormalized numbers. */ - { - int i; - for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L) - ; - if (x > 0.0L) - { - int exp; - long double y = frexpl (x, &exp); - /* On machines with IEEE854 arithmetic: x = 1.68105e-4932, - exp = -16382, y = 0.5. On Mac OS X 10.5: exp = -16384, y = 0.5. */ - if (exp != LDBL_MIN_EXP - 1) - result |= 8; - } - } - /* Test on infinite numbers. */ - x = 1.0L / 0.0L; - { - int exp; - long double y = frexpl (x, &exp); - if (y != x) - result |= 16; - } - return result; -} + fi + + if test $REPLACE_GETOPT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext" + + + + + GNULIB_GL_UNISTD_H_GETOPT=1 + fi + + + + + ac_found=0 + ac_fn_c_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include +" +if test "x$ac_cv_have_decl_program_invocation_name" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_frexpl_works=yes +if test $ac_have_decl = 1; then : + ac_found=1 +fi + + ac_fn_c_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include +" +if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes; then : + ac_have_decl=1 else - gl_cv_func_frexpl_works=no + ac_have_decl=0 fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl +_ACEOF +if test $ac_have_decl = 1; then : + ac_found=1 fi + ac_fn_c_check_decl "$LINENO" "__argv" "ac_cv_have_decl___argv" "#include +" +if test "x$ac_cv_have_decl___argv" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL___ARGV $ac_have_decl +_ACEOF +if test $ac_have_decl = 1; then : + ac_found=1 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_works" >&5 -$as_echo "$gl_cv_func_frexpl_works" >&6; } - LIBS="$save_LIBS" - case "$gl_cv_func_frexpl_works" in - *yes) gl_func_frexpl=yes ;; - *) gl_func_frexpl=no; REPLACE_FREXPL=1 ;; - esac - else - gl_func_frexpl=no - fi - if test $gl_func_frexpl = yes; then -$as_echo "#define HAVE_FREXPL 1" >>confdefs.h + # Incur the cost of this test only if none of the above worked. + if test $ac_found = 0; then + # On OpenBSD 5.1, using the global __progname variable appears to be + # the only way to implement getprogname. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __progname is defined in default libraries" >&5 +$as_echo_n "checking whether __progname is defined in default libraries... " >&6; } +if ${gl_cv_var___progname+:} false; then : + $as_echo_n "(cached) " >&6 +else - fi - fi - if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then - if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then + gl_cv_var___progname= + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern char *__progname; +int +main () +{ +return *__progname; - FREXPL_LIBM="$FREXP_LIBM" - else - FREXPL_LIBM= - fi - fi + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_var___progname=yes + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext - if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var___progname" >&5 +$as_echo "$gl_cv_var___progname" >&6; } + if test "$gl_cv_var___progname" = yes; then +$as_echo "#define HAVE_VAR___PROGNAME 1" >>confdefs.h + fi + fi + # Autoconf 2.61a.99 and earlier don't support linking a file only + # in VPATH builds. But since GNUmakefile is for maintainer use + # only, it does not matter if we skip the link with older autoconf. + # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH + # builds, so use a shell variable to bypass this. + GNUmakefile=GNUmakefile + ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile" + + : - gl_LIBOBJS="$gl_LIBOBJS frexpl.$ac_objext" - fi - GNULIB_FREXPL=1 + GNULIB_ICONV=1 -$as_echo "#define GNULIB_TEST_FREXPL 1" >>confdefs.h @@ -17641,263 +18964,482 @@ - if test $REPLACE_GETOPT = 1; then + if test $gl_cv_have_include_next = yes; then + gl_cv_next_iconv_h='<'iconv.h'>' + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 +$as_echo_n "checking absolute name of ... " >&6; } +if ${gl_cv_next_iconv_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test $ac_cv_header_iconv_h = yes; then - gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF + case "$host_os" in + aix*) gl_absname_cpp="$ac_cpp -C" ;; + *) gl_absname_cpp="$ac_cpp" ;; + esac + case "$host_os" in + mingw*) + gl_dirsep_regex='[/\\]' + ;; + *) + gl_dirsep_regex='\/' + ;; + esac + gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' + gl_header_literal_regex=`echo 'iconv.h' \ + | sed -e "$gl_make_literal_regex_sed"` + gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ + s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ + s|^/[^/]|//&| + p + q + }' + gl_cv_absolute_iconv_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + gl_header=$gl_cv_absolute_iconv_h + gl_cv_next_iconv_h='"'$gl_header'"' + else + gl_cv_next_iconv_h='<'iconv.h'>' + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_iconv_h" >&5 +$as_echo "$gl_cv_next_iconv_h" >&6; } + fi + NEXT_ICONV_H=$gl_cv_next_iconv_h + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'iconv.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_iconv_h + fi + NEXT_AS_FIRST_DIRECTIVE_ICONV_H=$gl_next_as_first_directive - gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext" - GNULIB_GL_UNISTD_H_GETOPT=1 - fi + if test "$am_cv_func_iconv" = yes; then -$as_echo "#define GNULIB_TEST_GETOPT_GNU 1" >>confdefs.h + ICONV_H='iconv.h' + if test -n "$ICONV_H"; then + GL_GENERATE_ICONV_H_TRUE= + GL_GENERATE_ICONV_H_FALSE='#' +else + GL_GENERATE_ICONV_H_TRUE='#' + GL_GENERATE_ICONV_H_FALSE= +fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + #include + #if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__) + gnu_iconv + #endif +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "gnu_iconv" >/dev/null 2>&1; then : + gl_func_iconv_gnu=yes +else + gl_func_iconv_gnu=no +fi +rm -f conftest* + if test $gl_func_iconv_gnu = no; then + iconv_flavor= + case "$host_os" in + aix*) iconv_flavor=ICONV_FLAVOR_AIX ;; + irix*) iconv_flavor=ICONV_FLAVOR_IRIX ;; + hpux*) iconv_flavor=ICONV_FLAVOR_HPUX ;; + osf*) iconv_flavor=ICONV_FLAVOR_OSF ;; + solaris*) iconv_flavor=ICONV_FLAVOR_SOLARIS ;; + esac + if test -n "$iconv_flavor"; then - REPLACE_GETOPT=0 - if test -n "$gl_replace_getopt"; then - REPLACE_GETOPT=1 - fi +cat >>confdefs.h <<_ACEOF +#define ICONV_FLAVOR $iconv_flavor +_ACEOF - if test $REPLACE_GETOPT = 1; then - GETOPT_H=getopt.h -$as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h + ICONV_H='iconv.h' + if test -n "$ICONV_H"; then + GL_GENERATE_ICONV_H_TRUE= + GL_GENERATE_ICONV_H_FALSE='#' +else + GL_GENERATE_ICONV_H_TRUE='#' + GL_GENERATE_ICONV_H_FALSE= +fi - fi + REPLACE_ICONV_OPEN=1 - if test $REPLACE_GETOPT = 1; then + fi + fi + fi + if test $REPLACE_ICONV_OPEN = 1; then - gl_LIBOBJS="$gl_LIBOBJS getopt.$ac_objext" + gl_LIBOBJS="$gl_LIBOBJS iconv_open.$ac_objext" + fi + if test $REPLACE_ICONV = 1; then - gl_LIBOBJS="$gl_LIBOBJS getopt1.$ac_objext" + gl_LIBOBJS="$gl_LIBOBJS iconv.$ac_objext" - GNULIB_GL_UNISTD_H_GETOPT=1 - fi - # Autoconf 2.61a.99 and earlier don't support linking a file only - # in VPATH builds. But since GNUmakefile is for maintainer use - # only, it does not matter if we skip the link with older autoconf. - # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH - # builds, so use a shell variable to bypass this. - GNUmakefile=GNUmakefile - ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile" - : + gl_LIBOBJS="$gl_LIBOBJS iconv_close.$ac_objext" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler generally respects inline" >&5 +$as_echo_n "checking whether the compiler generally respects inline... " >&6; } +if ${gl_cv_c_inline_effective+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test $ac_cv_c_inline = no; then + gl_cv_c_inline_effective=no + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main () +{ +#ifdef __NO_INLINE__ + #error "inline is not effective" + #endif + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_c_inline_effective=yes +else + gl_cv_c_inline_effective=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_inline_effective" >&5 +$as_echo "$gl_cv_c_inline_effective" >&6; } + if test $gl_cv_c_inline_effective = yes; then - GNULIB_ICONV=1 +$as_echo "#define HAVE_INLINE 1" >>confdefs.h + fi + : + : + : + : + : + PRIPTR_PREFIX= + if test -n "$STDINT_H"; then + PRIPTR_PREFIX='"l"' + else + for glpfx in '' l ll I64; do + case $glpfx in + '') gltype1='int';; + l) gltype1='long int';; + ll) gltype1='long long int';; + I64) gltype1='__int64';; + esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + extern intptr_t foo; + extern $gltype1 foo; +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + PRIPTR_PREFIX='"'$glpfx'"' +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test -n "$PRIPTR_PREFIX" && break + done + fi - if test $gl_cv_have_include_next = yes; then - gl_cv_next_iconv_h='<'iconv.h'>' - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of " >&5 -$as_echo_n "checking absolute name of ... " >&6; } -if ${gl_cv_next_iconv_h+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT32_MAX < INTMAX_MAX" >&5 +$as_echo_n "checking whether INT32_MAX < INTMAX_MAX... " >&6; } +if ${gl_cv_test_INT32_MAX_LT_INTMAX_MAX+:} false; then : $as_echo_n "(cached) " >&6 else - - if test $ac_cv_header_iconv_h = yes; then - - - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -_ACEOF - case "$host_os" in - aix*) gl_absname_cpp="$ac_cpp -C" ;; - *) gl_absname_cpp="$ac_cpp" ;; - esac - - case "$host_os" in - mingw*) - gl_dirsep_regex='[/\\]' - ;; - *) - gl_dirsep_regex='\/' - ;; - esac - gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g' - gl_header_literal_regex=`echo 'iconv.h' \ - | sed -e "$gl_make_literal_regex_sed"` - gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{ - s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/ - s|^/[^/]|//&| - p - q - }' +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 - gl_cv_absolute_iconv_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"` + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H - gl_header=$gl_cv_absolute_iconv_h - gl_cv_next_iconv_h='"'$gl_header'"' - else - gl_cv_next_iconv_h='<'iconv.h'>' - fi + #include + #if HAVE_STDINT_H + #include + #endif + #if defined INT32_MAX && defined INTMAX_MAX + #define CONDITION (INT32_MAX < INTMAX_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (int) < sizeof (long long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_test_INT32_MAX_LT_INTMAX_MAX=yes +else + gl_cv_test_INT32_MAX_LT_INTMAX_MAX=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_iconv_h" >&5 -$as_echo "$gl_cv_next_iconv_h" >&6; } - fi - NEXT_ICONV_H=$gl_cv_next_iconv_h - - if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then - # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' - gl_next_as_first_directive='<'iconv.h'>' - else - # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' - gl_next_as_first_directive=$gl_cv_next_iconv_h - fi - NEXT_AS_FIRST_DIRECTIVE_ICONV_H=$gl_next_as_first_directive - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&5 +$as_echo "$gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&6; } + if test $gl_cv_test_INT32_MAX_LT_INTMAX_MAX = yes; then + INT32_MAX_LT_INTMAX_MAX=1; + else + INT32_MAX_LT_INTMAX_MAX=0; + fi + if test $APPLE_UNIVERSAL_BUILD = 0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT64_MAX == LONG_MAX" >&5 +$as_echo_n "checking whether INT64_MAX == LONG_MAX... " >&6; } +if ${gl_cv_test_INT64_MAX_EQ_LONG_MAX+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H + #include + #if HAVE_STDINT_H + #include + #endif + #if defined INT64_MAX + #define CONDITION (INT64_MAX == LONG_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (long long int) == sizeof (long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_test_INT64_MAX_EQ_LONG_MAX=yes +else + gl_cv_test_INT64_MAX_EQ_LONG_MAX=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&5 +$as_echo "$gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&6; } + if test $gl_cv_test_INT64_MAX_EQ_LONG_MAX = yes; then + INT64_MAX_EQ_LONG_MAX=1; + else + INT64_MAX_EQ_LONG_MAX=0; + fi - if test "$am_cv_func_iconv" = yes; then + else + INT64_MAX_EQ_LONG_MAX=-1 + fi - ICONV_H='iconv.h' - if test -n "$ICONV_H"; then - GL_GENERATE_ICONV_H_TRUE= - GL_GENERATE_ICONV_H_FALSE='#' + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT32_MAX < UINTMAX_MAX" >&5 +$as_echo_n "checking whether UINT32_MAX < UINTMAX_MAX... " >&6; } +if ${gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX+:} false; then : + $as_echo_n "(cached) " >&6 else - GL_GENERATE_ICONV_H_TRUE='#' - GL_GENERATE_ICONV_H_FALSE= -fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + #include + #if HAVE_STDINT_H + #include + #endif - #include - #if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__) - gnu_iconv - #endif + #if defined UINT32_MAX && defined UINTMAX_MAX + #define CONDITION (UINT32_MAX < UINTMAX_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (unsigned int) < sizeof (unsigned long long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main () +{ + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "gnu_iconv" >/dev/null 2>&1; then : - gl_func_iconv_gnu=yes +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=yes else - gl_func_iconv_gnu=no + gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=no fi -rm -f conftest* - - if test $gl_func_iconv_gnu = no; then - iconv_flavor= - case "$host_os" in - aix*) iconv_flavor=ICONV_FLAVOR_AIX ;; - irix*) iconv_flavor=ICONV_FLAVOR_IRIX ;; - hpux*) iconv_flavor=ICONV_FLAVOR_HPUX ;; - osf*) iconv_flavor=ICONV_FLAVOR_OSF ;; - solaris*) iconv_flavor=ICONV_FLAVOR_SOLARIS ;; - esac - if test -n "$iconv_flavor"; then - -cat >>confdefs.h <<_ACEOF -#define ICONV_FLAVOR $iconv_flavor -_ACEOF - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&5 +$as_echo "$gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&6; } + if test $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX = yes; then + UINT32_MAX_LT_UINTMAX_MAX=1; + else + UINT32_MAX_LT_UINTMAX_MAX=0; + fi + if test $APPLE_UNIVERSAL_BUILD = 0; then - ICONV_H='iconv.h' - if test -n "$ICONV_H"; then - GL_GENERATE_ICONV_H_TRUE= - GL_GENERATE_ICONV_H_FALSE='#' + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT64_MAX == ULONG_MAX" >&5 +$as_echo_n "checking whether UINT64_MAX == ULONG_MAX... " >&6; } +if ${gl_cv_test_UINT64_MAX_EQ_ULONG_MAX+:} false; then : + $as_echo_n "(cached) " >&6 else - GL_GENERATE_ICONV_H_TRUE='#' - GL_GENERATE_ICONV_H_FALSE= -fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Work also in C++ mode. */ + #define __STDC_LIMIT_MACROS 1 + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H - REPLACE_ICONV_OPEN=1 + #include + #if HAVE_STDINT_H + #include + #endif - fi - fi + #if defined UINT64_MAX + #define CONDITION (UINT64_MAX == ULONG_MAX) + #elif HAVE_LONG_LONG_INT + #define CONDITION (sizeof (unsigned long long int) == sizeof (unsigned long int)) + #else + #define CONDITION 0 + #endif + int test[CONDITION ? 1 : -1]; +int +main () +{ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=yes +else + gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&5 +$as_echo "$gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&6; } + if test $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX = yes; then + UINT64_MAX_EQ_ULONG_MAX=1; + else + UINT64_MAX_EQ_ULONG_MAX=0; fi - if test $REPLACE_ICONV_OPEN = 1; then + else + UINT64_MAX_EQ_ULONG_MAX=-1 + fi @@ -17905,11 +19447,12 @@ - gl_LIBOBJS="$gl_LIBOBJS iconv_open.$ac_objext" + if test $ac_cv_func_isblank = no; then + HAVE_ISBLANK=0 fi - if test $REPLACE_ICONV = 1; then + if test $HAVE_ISBLANK = 0; then @@ -17917,350 +19460,460 @@ - gl_LIBOBJS="$gl_LIBOBJS iconv.$ac_objext" + gl_LIBOBJS="$gl_LIBOBJS isblank.$ac_objext" + fi + GNULIB_ISBLANK=1 - gl_LIBOBJS="$gl_LIBOBJS iconv_close.$ac_objext" - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler generally respects inline" >&5 -$as_echo_n "checking whether the compiler generally respects inline... " >&6; } -if ${gl_cv_c_inline_effective+:} false; then : - $as_echo_n "(cached) " >&6 + + + ac_fn_c_check_decl "$LINENO" "isfinite" "ac_cv_have_decl_isfinite" "#include +" +if test "x$ac_cv_have_decl_isfinite" = xyes; then : + ac_have_decl=1 else - if test $ac_cv_c_inline = no; then - gl_cv_c_inline_effective=no - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISFINITE $ac_have_decl +_ACEOF + + if test "$ac_cv_have_decl_isfinite" = yes; then + + save_LIBS=$LIBS + ISFINITE_LIBM=missing + for libm in "" "-lm"; do + LIBS="$save_LIBS $libm" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + + double x; int main () { -#ifdef __NO_INLINE__ - #error "inline is not effective" - #endif +x = isfinite (x) + isfinite ((float) x); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_c_inline_effective=yes -else - gl_cv_c_inline_effective=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - +if ac_fn_c_try_link "$LINENO"; then : + ISFINITE_LIBM=$libm +break fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_inline_effective" >&5 -$as_echo "$gl_cv_c_inline_effective" >&6; } - if test $gl_cv_c_inline_effective = yes; then - -$as_echo "#define HAVE_INLINE 1" >>confdefs.h - - fi - +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done + LIBS=$save_LIBS + if test "$ISFINITE_LIBM" != missing; then - : - : - : - : - : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isfinite(long double) works" >&5 +$as_echo_n "checking whether isfinite(long double) works... " >&6; } +if ${gl_cv_func_isfinitel_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + gl_cv_func_isfinitel_works="guessing yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#define NWORDS \ + ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { unsigned int word[NWORDS]; long double value; } + memory_long_double; +/* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the + runtime type conversion. */ +#ifdef __sgi +static long double NaNl () +{ + double zero = 0.0; + return zero / zero; +} +#else +# define NaNl() (0.0L / 0.0L) +#endif +int main () +{ + int result = 0; + { + memory_long_double m; + unsigned int i; + /* The isfinite macro should be immune against changes in the sign bit and + in the mantissa bits. The xor operation twiddles a bit that can only be + a sign bit or a mantissa bit (since the exponent never extends to + bit 31). */ + m.value = NaNl (); + m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1); + for (i = 0; i < NWORDS; i++) + m.word[i] |= 1; + if (isfinite (m.value)) + result |= 1; + } - PRIPTR_PREFIX= - if test -n "$STDINT_H"; then - PRIPTR_PREFIX='"l"' - else - for glpfx in '' l ll I64; do - case $glpfx in - '') gltype1='int';; - l) gltype1='long int';; - ll) gltype1='long long int';; - I64) gltype1='__int64';; - esac - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - extern intptr_t foo; - extern $gltype1 foo; -int -main () -{ +#if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE +/* Representation of an 80-bit 'long double' as an initializer for a sequence + of 'unsigned int' words. */ +# ifdef WORDS_BIGENDIAN +# define LDBL80_WORDS(exponent,manthi,mantlo) \ + { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ + ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ + (unsigned int) (mantlo) << 16 \ + } +# else +# define LDBL80_WORDS(exponent,manthi,mantlo) \ + { mantlo, manthi, exponent } +# endif + { /* Quiet NaN. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + if (isfinite (x.value)) + result |= 2; + } + { + /* Signalling NaN. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + if (isfinite (x.value)) + result |= 2; + } + /* isfinite should return something even for noncanonical values. */ + { /* Pseudo-NaN. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + if (isfinite (x.value) && !isfinite (x.value)) + result |= 4; + } + { /* Pseudo-Infinity. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + if (isfinite (x.value) && !isfinite (x.value)) + result |= 8; + } + { /* Pseudo-Zero. */ + static memory_long_double x = + { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + if (isfinite (x.value) && !isfinite (x.value)) + result |= 16; + } + { /* Unnormalized number. */ + static memory_long_double x = + { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + if (isfinite (x.value) && !isfinite (x.value)) + result |= 32; + } + { /* Pseudo-Denormal. */ + static memory_long_double x = + { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + if (isfinite (x.value) && !isfinite (x.value)) + result |= 64; + } +#endif - ; - return 0; + return result; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - PRIPTR_PREFIX='"'$glpfx'"' +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_isfinitel_works=yes +else + gl_cv_func_isfinitel_works=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test -n "$PRIPTR_PREFIX" && break - done +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isfinitel_works" >&5 +$as_echo "$gl_cv_func_isfinitel_works" >&6; } + + case "$gl_cv_func_isfinitel_works" in + *yes) ;; + *) ISFINITE_LIBM=missing;; + esac + fi + fi + if test "$ac_cv_have_decl_isfinite" != yes || + test "$ISFINITE_LIBM" = missing; then + REPLACE_ISFINITE=1 + ISFINITE_LIBM= fi + if test $REPLACE_ISFINITE = 1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT32_MAX < INTMAX_MAX" >&5 -$as_echo_n "checking whether INT32_MAX < INTMAX_MAX... " >&6; } -if ${gl_cv_test_INT32_MAX_LT_INTMAX_MAX+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Work also in C++ mode. */ - #define __STDC_LIMIT_MACROS 1 - /* Work if build is not clean. */ - #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H - #include - #if HAVE_STDINT_H - #include - #endif - #if defined INT32_MAX && defined INTMAX_MAX - #define CONDITION (INT32_MAX < INTMAX_MAX) - #elif HAVE_LONG_LONG_INT - #define CONDITION (sizeof (int) < sizeof (long long int)) - #else - #define CONDITION 0 - #endif - int test[CONDITION ? 1 : -1]; -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_test_INT32_MAX_LT_INTMAX_MAX=yes -else - gl_cv_test_INT32_MAX_LT_INTMAX_MAX=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&5 -$as_echo "$gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&6; } - if test $gl_cv_test_INT32_MAX_LT_INTMAX_MAX = yes; then - INT32_MAX_LT_INTMAX_MAX=1; - else - INT32_MAX_LT_INTMAX_MAX=0; + + + + gl_LIBOBJS="$gl_LIBOBJS isfinite.$ac_objext" + fi - if test $APPLE_UNIVERSAL_BUILD = 0; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT64_MAX == LONG_MAX" >&5 -$as_echo_n "checking whether INT64_MAX == LONG_MAX... " >&6; } -if ${gl_cv_test_INT64_MAX_EQ_LONG_MAX+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Work also in C++ mode. */ - #define __STDC_LIMIT_MACROS 1 - /* Work if build is not clean. */ - #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H - #include - #if HAVE_STDINT_H - #include - #endif + GNULIB_ISFINITE=1 - #if defined INT64_MAX - #define CONDITION (INT64_MAX == LONG_MAX) - #elif HAVE_LONG_LONG_INT - #define CONDITION (sizeof (long long int) == sizeof (long int)) - #else - #define CONDITION 0 - #endif - int test[CONDITION ? 1 : -1]; -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_test_INT64_MAX_EQ_LONG_MAX=yes + + + +$as_echo "#define GNULIB_TEST_ISFINITE 1" >>confdefs.h + + + + + + + ac_fn_c_check_decl "$LINENO" "isinf" "ac_cv_have_decl_isinf" "#include + #ifndef isinf + #error \"isinf must be a macro, not a function\" + #endif + +" +if test "x$ac_cv_have_decl_isinf" = xyes; then : + ac_have_decl=1 else - gl_cv_test_INT64_MAX_EQ_LONG_MAX=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_have_decl=0 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&5 -$as_echo "$gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&6; } - if test $gl_cv_test_INT64_MAX_EQ_LONG_MAX = yes; then - INT64_MAX_EQ_LONG_MAX=1; - else - INT64_MAX_EQ_LONG_MAX=0; - fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISINF $ac_have_decl +_ACEOF - else - INT64_MAX_EQ_LONG_MAX=-1 - fi + if test "$ac_cv_have_decl_isinf" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT32_MAX < UINTMAX_MAX" >&5 -$as_echo_n "checking whether UINT32_MAX < UINTMAX_MAX... " >&6; } -if ${gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + save_LIBS=$LIBS + ISINF_LIBM=missing + for libm in "" "-lm"; do + LIBS="$save_LIBS $libm" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Work also in C++ mode. */ - #define __STDC_LIMIT_MACROS 1 - /* Work if build is not clean. */ - #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H - - #include - #if HAVE_STDINT_H - #include - #endif + #ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include - #if defined UINT32_MAX && defined UINTMAX_MAX - #define CONDITION (UINT32_MAX < UINTMAX_MAX) - #elif HAVE_LONG_LONG_INT - #define CONDITION (sizeof (unsigned int) < sizeof (unsigned long long int)) - #else - #define CONDITION 0 - #endif - int test[CONDITION ? 1 : -1]; + double x; int main () { - +x = isinf (x) + isinf ((float) x); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=yes -else - gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if ac_fn_c_try_link "$LINENO"; then : + ISINF_LIBM=$libm +break fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&5 -$as_echo "$gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&6; } - if test $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX = yes; then - UINT32_MAX_LT_UINTMAX_MAX=1; - else - UINT32_MAX_LT_UINTMAX_MAX=0; - fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done + LIBS=$save_LIBS + if test "$ISINF_LIBM" != missing; then - if test $APPLE_UNIVERSAL_BUILD = 0; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT64_MAX == ULONG_MAX" >&5 -$as_echo_n "checking whether UINT64_MAX == ULONG_MAX... " >&6; } -if ${gl_cv_test_UINT64_MAX_EQ_ULONG_MAX+:} false; then : + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isinf(long double) works" >&5 +$as_echo_n "checking whether isinf(long double) works... " >&6; } +if ${gl_cv_func_isinfl_works+:} false; then : $as_echo_n "(cached) " >&6 else + + if test "$cross_compiling" = yes; then : + gl_cv_func_isinfl_works="guessing yes" +else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Work also in C++ mode. */ - #define __STDC_LIMIT_MACROS 1 - /* Work if build is not clean. */ - #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H +#include +#include +#include +#define NWORDS \ + ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { unsigned int word[NWORDS]; long double value; } + memory_long_double; +/* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the + runtime type conversion. */ +#ifdef __sgi +static long double NaNl () +{ + double zero = 0.0; + return zero / zero; +} +#else +# define NaNl() (0.0L / 0.0L) +#endif +int main () +{ + int result = 0; - #include - #if HAVE_STDINT_H - #include - #endif + if (isinf (LDBL_MAX)) + result |= 1; - #if defined UINT64_MAX - #define CONDITION (UINT64_MAX == ULONG_MAX) - #elif HAVE_LONG_LONG_INT - #define CONDITION (sizeof (unsigned long long int) == sizeof (unsigned long int)) - #else - #define CONDITION 0 - #endif - int test[CONDITION ? 1 : -1]; -int -main () -{ + { + memory_long_double m; + unsigned int i; + + /* The isinf macro should be immune against changes in the sign bit and + in the mantissa bits. The xor operation twiddles a bit that can only be + a sign bit or a mantissa bit (since the exponent never extends to + bit 31). */ + m.value = NaNl (); + m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1); + for (i = 0; i < NWORDS; i++) + m.word[i] |= 1; + if (isinf (m.value)) + result |= 2; + } + +#if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE +/* Representation of an 80-bit 'long double' as an initializer for a sequence + of 'unsigned int' words. */ +# ifdef WORDS_BIGENDIAN +# define LDBL80_WORDS(exponent,manthi,mantlo) \ + { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ + ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ + (unsigned int) (mantlo) << 16 \ + } +# else +# define LDBL80_WORDS(exponent,manthi,mantlo) \ + { mantlo, manthi, exponent } +# endif + { /* Quiet NaN. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + if (isinf (x.value)) + result |= 2; + } + { + /* Signalling NaN. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + if (isinf (x.value)) + result |= 2; + } + /* isinf should return something even for noncanonical values. */ + { /* Pseudo-NaN. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + if (isinf (x.value) && !isinf (x.value)) + result |= 4; + } + { /* Pseudo-Infinity. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + if (isinf (x.value) && !isinf (x.value)) + result |= 8; + } + { /* Pseudo-Zero. */ + static memory_long_double x = + { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + if (isinf (x.value) && !isinf (x.value)) + result |= 16; + } + { /* Unnormalized number. */ + static memory_long_double x = + { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + if (isinf (x.value) && !isinf (x.value)) + result |= 32; + } + { /* Pseudo-Denormal. */ + static memory_long_double x = + { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + if (isinf (x.value) && !isinf (x.value)) + result |= 64; + } +#endif - ; - return 0; + return result; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=yes +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_isinfl_works=yes else - gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=no + gl_cv_func_isinfl_works=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&5 -$as_echo "$gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&6; } - if test $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX = yes; then - UINT64_MAX_EQ_ULONG_MAX=1; - else - UINT64_MAX_EQ_ULONG_MAX=0; - fi - - - else - UINT64_MAX_EQ_ULONG_MAX=-1 - fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isinfl_works" >&5 +$as_echo "$gl_cv_func_isinfl_works" >&6; } + case "$gl_cv_func_isinfl_works" in + *yes) ;; + *) ISINF_LIBM=missing;; + esac + fi + fi + if test "$ac_cv_have_decl_isinf" != yes || + test "$ISINF_LIBM" = missing; then + REPLACE_ISINF=1 + ISINF_LIBM= + fi + if test $REPLACE_ISINF = 1; then - if test $ac_cv_func_isblank = no; then - HAVE_ISBLANK=0 - fi - if test $HAVE_ISBLANK = 0; then + gl_LIBOBJS="$gl_LIBOBJS isinf.$ac_objext" + fi - gl_LIBOBJS="$gl_LIBOBJS isblank.$ac_objext" - fi + GNULIB_ISINF=1 - GNULIB_ISBLANK=1 +$as_echo "#define GNULIB_TEST_ISINF 1" >>confdefs.h @@ -19620,6 +21273,7 @@ + LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\"" @@ -20197,7 +21851,7 @@ memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) if (mbsinit (&state)) - return 1; + return 2; } return 0; } @@ -20264,7 +21918,7 @@ memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, input + 3, 6, &state) != 4 && mbtowc (&wc, input + 3, 6) == 4) - return 1; + return 2; } return 0; } @@ -20451,7 +22105,7 @@ mbrtowc (&wc, NULL, 5, &state); /* Check that wc was not modified. */ if (wc != (wchar_t) 0xBADFACE) - return 1; + return 2; } return 0; } @@ -20651,7 +22305,7 @@ memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, "", 1, &state) != 0) - return 1; + return 2; } return 0; } @@ -20697,13 +22351,13 @@ int main (void) { - return mbrtowc (&wc, "", 0, &mbs) == (size_t) -2; + return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_mbrtowc_empty_input=no -else gl_cv_func_mbrtowc_empty_input=yes +else + gl_cv_func_mbrtowc_empty_input=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -20714,6 +22368,60 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_empty_input" >&5 $as_echo "$gl_cv_func_mbrtowc_empty_input" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C locale is free of encoding errors" >&5 +$as_echo_n "checking whether the C locale is free of encoding errors... " >&6; } +if ${gl_cv_C_locale_sans_EILSEQ+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_cv_C_locale_sans_EILSEQ="guessing no" + + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include + +int +main () +{ + + int i; + char *locale = setlocale (LC_ALL, "C"); + if (! locale) + return 2; + for (i = CHAR_MIN; i <= CHAR_MAX; i++) + { + char c = i; + wchar_t wc; + mbstate_t mbs = { 0, }; + size_t ss = mbrtowc (&wc, &c, 1, &mbs); + if (1 < ss) + return 3; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_C_locale_sans_EILSEQ=yes +else + gl_cv_C_locale_sans_EILSEQ=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_C_locale_sans_EILSEQ" >&5 +$as_echo "$gl_cv_C_locale_sans_EILSEQ" >&6; } + case "$gl_cv_func_mbrtowc_null_arg1" in *yes) ;; *) @@ -20754,6 +22462,14 @@ REPLACE_MBRTOWC=1 ;; esac + case $gl_cv_C_locale_sans_EILSEQ in + *yes) ;; + *) +$as_echo "#define C_LOCALE_MAYBE_EILSEQ 1" >>confdefs.h + + REPLACE_MBRTOWC=1 + ;; + esac fi fi @@ -20842,7 +22558,7 @@ memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) if (mbsinit (&state)) - return 1; + return 2; } return 0; } @@ -20909,7 +22625,7 @@ memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, input + 3, 6, &state) != 4 && mbtowc (&wc, input + 3, 6) == 4) - return 1; + return 2; } return 0; } @@ -21088,7 +22804,7 @@ memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) if (mbsinit (&state)) - return 1; + return 2; } return 0; } @@ -21155,7 +22871,7 @@ memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, input + 3, 6, &state) != 4 && mbtowc (&wc, input + 3, 6) == 4) - return 1; + return 2; } return 0; } @@ -21306,63 +23022,263 @@ const char input[] = "B\250\271\201\060\211\070er"; mbstate_t state; - memset (&state, '\0', sizeof (mbstate_t)); - if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) - if (!mbsinit (&state)) - { - const char *src = input + 2; - if (mbsrtowcs (NULL, &src, 10, &state) != 4) - result |= 8; - } - } - return result; + memset (&state, '\0', sizeof (mbstate_t)); + if (mbrtowc (NULL, input + 1, 1, &state) == (size_t)(-2)) + if (!mbsinit (&state)) + { + const char *src = input + 2; + if (mbsrtowcs (NULL, &src, 10, &state) != 4) + result |= 8; + } + } + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_mbsrtowcs_works=yes +else + gl_cv_func_mbsrtowcs_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbsrtowcs_works" >&5 +$as_echo "$gl_cv_func_mbsrtowcs_works" >&6; } + + case "$gl_cv_func_mbsrtowcs_works" in + *yes) ;; + *) REPLACE_MBSRTOWCS=1 ;; + esac + fi + fi + + if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs-state.$ac_objext" + + + : + + fi + + + + + + GNULIB_MBSRTOWCS=1 + + + + + +$as_echo "#define GNULIB_TEST_MBSRTOWCS 1" >>confdefs.h + + + + + + + + + GNULIB_MBSSTR=1 + + + + + +$as_echo "#define GNULIB_TEST_MBSSTR 1" >>confdefs.h + + + + + + : + + + if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS memchr.$ac_objext" + + + for ac_header in bp-sym.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "bp-sym.h" "ac_cv_header_bp_sym_h" "$ac_includes_default" +if test "x$ac_cv_header_bp_sym_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_BP_SYM_H 1 +_ACEOF + +fi + +done + + + fi + + + + + + GNULIB_MEMCHR=1 + + + + + +$as_echo "#define GNULIB_TEST_MEMCHR 1" >>confdefs.h + + + + + + + + + + + + + + + MODF_LIBM= + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether modf can be used without linking with libm" >&5 +$as_echo_n "checking whether modf can be used without linking with libm... " >&6; } +if ${gl_cv_func_modf_no_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + + double (*funcptr) (double, double *) = modf; + int i_ret; + float f_ret; + double d_ret; + long double l_ret; +int +main () +{ +double y = funcptr (1.6180339887, &d_ret) + modf (1.6180339887, &d_ret); + + return y < 0.3 || y > 1.7; + + ; + return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_mbsrtowcs_works=yes +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_modf_no_libm=yes else - gl_cv_func_mbsrtowcs_works=no + gl_cv_func_modf_no_libm=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_modf_no_libm" >&5 +$as_echo "$gl_cv_func_modf_no_libm" >&6; } + if test $gl_cv_func_modf_no_libm = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether modf can be used with libm" >&5 +$as_echo_n "checking whether modf can be used with libm... " >&6; } +if ${gl_cv_func_modf_in_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else - fi + save_LIBS="$LIBS" + LIBS="$LIBS -lm" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + + double (*funcptr) (double, double *) = modf; + int i_ret; + float f_ret; + double d_ret; + long double l_ret; +int +main () +{ +double y = funcptr (1.6180339887, &d_ret) + modf (1.6180339887, &d_ret); + return y < 0.3 || y > 1.7; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_modf_in_libm=yes +else + gl_cv_func_modf_in_libm=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbsrtowcs_works" >&5 -$as_echo "$gl_cv_func_mbsrtowcs_works" >&6; } +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" - case "$gl_cv_func_mbsrtowcs_works" in - *yes) ;; - *) REPLACE_MBSRTOWCS=1 ;; - esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_modf_in_libm" >&5 +$as_echo "$gl_cv_func_modf_in_libm" >&6; } + if test $gl_cv_func_modf_in_libm = yes; then + MODF_LIBM=-lm fi fi - if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then - + if test $REPLACE_MODF = 1; then - gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs.$ac_objext" - - + MODF_LIBM="$TRUNC_LIBM" + fi + if test $REPLACE_MODF = 1; then - gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs-state.$ac_objext" - : + gl_LIBOBJS="$gl_LIBOBJS modf.$ac_objext" fi @@ -21370,13 +23286,13 @@ - GNULIB_MBSRTOWCS=1 + GNULIB_MODF=1 -$as_echo "#define GNULIB_TEST_MBSRTOWCS 1" >>confdefs.h +$as_echo "#define GNULIB_TEST_MODF 1" >>confdefs.h @@ -21385,75 +23301,150 @@ - GNULIB_MBSSTR=1 -$as_echo "#define GNULIB_TEST_MBSSTR 1" >>confdefs.h + MODFL_LIBM= + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether modfl can be used without linking with libm" >&5 +$as_echo_n "checking whether modfl can be used without linking with libm... " >&6; } +if ${gl_cv_func_modfl_no_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double (*funcptr) (long double, long double *) = modfl; + int i_ret; + float f_ret; + double d_ret; + long double l_ret; +int +main () +{ +long double y = funcptr (1.618033988749894848L, &l_ret) + modfl (1.618033988749894848L, &l_ret); + return y < 0.3 || y > 1.7; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_modfl_no_libm=yes +else + gl_cv_func_modfl_no_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext - : +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_modfl_no_libm" >&5 +$as_echo "$gl_cv_func_modfl_no_libm" >&6; } + if test $gl_cv_func_modfl_no_libm = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether modfl can be used with libm" >&5 +$as_echo_n "checking whether modfl can be used with libm... " >&6; } +if ${gl_cv_func_modfl_in_libm+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LIBS="$LIBS" + LIBS="$LIBS -lm" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include - if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then + long double (*funcptr) (long double, long double *) = modfl; + int i_ret; + float f_ret; + double d_ret; + long double l_ret; +int +main () +{ +long double y = funcptr (1.618033988749894848L, &l_ret) + modfl (1.618033988749894848L, &l_ret); + return y < 0.3 || y > 1.7; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_func_modfl_in_libm=yes +else + gl_cv_func_modfl_in_libm=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_modfl_in_libm" >&5 +$as_echo "$gl_cv_func_modfl_in_libm" >&6; } + if test $gl_cv_func_modfl_in_libm = yes; then + MODFL_LIBM=-lm + fi + fi - gl_LIBOBJS="$gl_LIBOBJS memchr.$ac_objext" + if test $gl_cv_func_modfl_no_libm = yes \ + || test $gl_cv_func_modfl_in_libm = yes; then + : + else + HAVE_MODFL=0 + fi + if test $HAVE_MODFL = 0 || test $REPLACE_MODFL = 1; then + if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then - for ac_header in bp-sym.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "bp-sym.h" "ac_cv_header_bp_sym_h" "$ac_includes_default" -if test "x$ac_cv_header_bp_sym_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_BP_SYM_H 1 -_ACEOF + MODFL_LIBM="$MODF_LIBM" + else -fi + MODFL_LIBM="$TRUNCL_LIBM" + fi + fi -done + if test $HAVE_MODFL = 0 || test $REPLACE_MODFL = 1; then - fi - GNULIB_MEMCHR=1 + gl_LIBOBJS="$gl_LIBOBJS modfl.$ac_objext" + fi -$as_echo "#define GNULIB_TEST_MEMCHR 1" >>confdefs.h + GNULIB_MODFL=1 - if test $ac_cv_func__set_invalid_parameter_handler = yes; then - HAVE_MSVC_INVALID_PARAMETER_HANDLER=1 +$as_echo "#define GNULIB_TEST_MODFL 1" >>confdefs.h -$as_echo "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h - else - HAVE_MSVC_INVALID_PARAMETER_HANDLER=0 - fi if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then @@ -21469,8 +23460,6 @@ fi - - if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then @@ -21485,6 +23474,47 @@ fi + # Extract the first word of "pmccabe", so it can be a program name with args. +set dummy pmccabe; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PMCCABE+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PMCCABE in + [\\/]* | ?:[\\/]*) + ac_cv_path_PMCCABE="$PMCCABE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PMCCABE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_PMCCABE" && ac_cv_path_PMCCABE="false" + ;; +esac +fi +PMCCABE=$ac_cv_path_PMCCABE +if test -n "$PMCCABE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PMCCABE" >&5 +$as_echo "$PMCCABE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + ac_fn_c_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include " if test "x$ac_cv_have_decl_program_invocation_name" = xyes; then : @@ -21701,7 +23731,10 @@ int main () { -return ! realloc (0, 0); +char *p = realloc (0, 0); + int result = !p; + free (p); + return result; ; return 0; } @@ -23894,6 +25927,7 @@ + $as_echo "#define __USE_MINGW_ANSI_STDIO 1" >>confdefs.h @@ -24162,7 +26196,7 @@ - for gl_func in _Exit atoll canonicalize_file_name getloadavg getsubopt grantpt initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps posix_openpt ptsname ptsname_r random random_r realpath rpmatch secure_getenv setenv setstate setstate_r srandom srandom_r strtod strtoll strtoull unlockpt unsetenv; do + for gl_func in _Exit atoll canonicalize_file_name getloadavg getsubopt grantpt initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps posix_openpt ptsname ptsname_r qsort_r random random_r realpath rpmatch secure_getenv setenv setstate setstate_r srandom srandom_r strtod strtoll strtoull unlockpt unsetenv; do as_gl_Symbol=`$as_echo "gl_cv_have_raw_decl_$gl_func" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gl_func is declared without a macro" >&5 $as_echo_n "checking whether $gl_func is declared without a macro... " >&6; } @@ -24248,20 +26282,71 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdnoreturn_h" >&5 $as_echo "$gl_cv_header_working_stdnoreturn_h" >&6; } - if test $gl_cv_header_working_stdnoreturn_h = yes; then - STDNORETURN_H='' - else - STDNORETURN_H='stdnoreturn.h' - fi + if test $gl_cv_header_working_stdnoreturn_h = yes; then + STDNORETURN_H='' + else + STDNORETURN_H='stdnoreturn.h' + fi + + + if test -n "$STDNORETURN_H"; then + GL_GENERATE_STDNORETURN_H_TRUE= + GL_GENERATE_STDNORETURN_H_FALSE='#' +else + GL_GENERATE_STDNORETURN_H_TRUE='#' + GL_GENERATE_STDNORETURN_H_FALSE= +fi + + + + + + + + + for ac_func in stpcpy +do : + ac_fn_c_check_func "$LINENO" "stpcpy" "ac_cv_func_stpcpy" +if test "x$ac_cv_func_stpcpy" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STPCPY 1 +_ACEOF + +fi +done + + if test $ac_cv_func_stpcpy = no; then + HAVE_STPCPY=0 + fi + + if test $HAVE_STPCPY = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS stpcpy.$ac_objext" + + + : + + fi + + + + + + GNULIB_STPCPY=1 + + + + +$as_echo "#define GNULIB_TEST_STPCPY 1" >>confdefs.h - if test -n "$STDNORETURN_H"; then - GL_GENERATE_STDNORETURN_H_TRUE= - GL_GENERATE_STDNORETURN_H_FALSE='#' -else - GL_GENERATE_STDNORETURN_H_TRUE='#' - GL_GENERATE_STDNORETURN_H_FALSE= -fi @@ -24444,11 +26529,14 @@ #endif char *strndup (const char *, size_t); #endif + int result; char *s; s = strndup ("some longer string", 15); free (s); s = strndup ("shorter string", 13); - return s[13] != '\0'; + result = s[13] != '\0'; + free (s); + return result; ; return 0; } @@ -24750,6 +26838,262 @@ + ac_fn_c_check_decl "$LINENO" "trunc" "ac_cv_have_decl_trunc" "#include +" +if test "x$ac_cv_have_decl_trunc" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_TRUNC $ac_have_decl +_ACEOF + + if test "$ac_cv_have_decl_trunc" = yes; then + TRUNC_LIBM=? + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + double x; +int +main () +{ +x = trunc(x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + TRUNC_LIBM= +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$TRUNC_LIBM" = "?"; then + save_LIBS="$LIBS" + LIBS="$LIBS -lm" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + double x; +int +main () +{ +x = trunc(x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + TRUNC_LIBM="-lm" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" + fi + if test "$TRUNC_LIBM" = "?"; then + TRUNC_LIBM= + fi + + else + HAVE_DECL_TRUNC=0 + fi + if test $HAVE_DECL_TRUNC = 0 || test $REPLACE_TRUNC = 1; then + TRUNC_LIBM= + fi + + + if test $HAVE_DECL_TRUNC = 0 || test $REPLACE_TRUNC = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS trunc.$ac_objext" + + fi + + + + + + GNULIB_TRUNC=1 + + + + + +$as_echo "#define GNULIB_TEST_TRUNC 1" >>confdefs.h + + + + + + + + + + + ac_fn_c_check_decl "$LINENO" "truncl" "ac_cv_have_decl_truncl" "#include +" +if test "x$ac_cv_have_decl_truncl" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_TRUNCL $ac_have_decl +_ACEOF + + if test "$ac_cv_have_decl_truncl" = yes; then + TRUNCL_LIBM=? + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double x; +int +main () +{ +x = truncl(x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + TRUNCL_LIBM= +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$TRUNCL_LIBM" = "?"; then + save_LIBS="$LIBS" + LIBS="$LIBS -lm" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double x; +int +main () +{ +x = truncl(x); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + TRUNCL_LIBM="-lm" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$save_LIBS" + fi + if test "$TRUNCL_LIBM" = "?"; then + TRUNCL_LIBM= + fi + save_LIBS="$LIBS" + LIBS="$LIBS $TRUNCL_LIBM" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether truncl works" >&5 +$as_echo_n "checking whether truncl works... " >&6; } +if ${gl_cv_func_truncl_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + case "$host_os" in + osf4*) gl_cv_func_truncl_works="guessing no";; + *) gl_cv_func_truncl_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +long double x; +int main() +{ + x = truncl (0.0L); + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_truncl_works=yes +else + gl_cv_func_truncl_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_truncl_works" >&5 +$as_echo "$gl_cv_func_truncl_works" >&6; } + LIBS="$save_LIBS" + case "$gl_cv_func_truncl_works" in + *yes) ;; + *) REPLACE_TRUNCL=1 ;; + esac + + else + HAVE_DECL_TRUNCL=0 + fi + if test $HAVE_DECL_TRUNCL = 0 || test $REPLACE_TRUNCL = 1; then + if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then + + TRUNCL_LIBM="$TRUNC_LIBM" + else + TRUNCL_LIBM= + fi + fi + + + if test $HAVE_DECL_TRUNCL = 0 || test $REPLACE_TRUNCL = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS truncl.$ac_objext" + + fi + + + + + + GNULIB_TRUNCL=1 + + + + + +$as_echo "#define GNULIB_TEST_TRUNCL 1" >>confdefs.h + + + + + + + @@ -25055,7 +27399,7 @@ || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \ && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \ || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \ - && test $LIBUNISTRING_VERSION_SUBMINOR -lt 5 + && test $LIBUNISTRING_VERSION_SUBMINOR -lt 6 } } } @@ -25695,7 +28039,7 @@ if test $ac_cv_func_wcwidth = yes; then HAVE_WCWIDTH=1 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wcwidth works reasonably in UTF-8 locales" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wcwidth works reasonably in UTF-8 locales" >&5 $as_echo_n "checking whether wcwidth works reasonably in UTF-8 locales... " >&6; } if ${gl_cv_func_wcwidth_works+:} false; then : $as_echo_n "(cached) " >&6 @@ -25742,6 +28086,8 @@ result |= 2; if (wcwidth (0x200B) > 0) result |= 4; + if (wcwidth (0xFF1A) == 0) + result |= 8; } return result; } @@ -26473,6 +28819,32 @@ fi + +# Check whether --with-bash-completion-dir was given. +if test "${with_bash_completion_dir+set}" = set; then : + withval=$with_bash_completion_dir; +else + with_bash_completion_dir=yes +fi + + +if test "x$with_bash_completion_dir" = "xyes"; then + BASH_COMPLETION_DIR="$datarootdir/${PACKAGE}/bash-completion.d" +else + # either 'no', or a user-specified custom DIR - use it. + BASH_COMPLETION_DIR="$with_bash_completion_dir" +fi + + if test "x$with_bash_completion_dir" != "xno"; then + ENABLE_BASH_COMPLETION_TRUE= + ENABLE_BASH_COMPLETION_FALSE='#' +else + ENABLE_BASH_COMPLETION_TRUE='#' + ENABLE_BASH_COMPLETION_FALSE= +fi + + + ## ## Check if the system's sort support "-s" (stable) sort. ## 'sort' from GNU Coreutils, FreeBSD, OpenBSD, Busybox support it. @@ -26992,16 +29364,21 @@ /* end confdefs.h. */ #include -$gt_revision_test_code +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; +#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings) +#else +#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 +#endif +$gt_revision_test_code int main () { bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings +return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ; return 0; @@ -27754,20 +30131,25 @@ /* end confdefs.h. */ #include -$gt_revision_test_code +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); +#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) +#else +#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 +#endif +$gt_revision_test_code int main () { bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") +return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ; return 0; @@ -27786,20 +30168,25 @@ /* end confdefs.h. */ #include -$gt_revision_test_code +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); +#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) +#else +#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 +#endif +$gt_revision_test_code int main () { bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") +return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ; return 0; @@ -27930,6 +30317,15 @@ ac_config_files="$ac_config_files Makefile po/Makefile.in" + +# This is needed when building outside the source dir +# with --disable-dependency-tracking. +# Inspired by sed's https://bugs.gnu.org/25371 +as_dir=lib; as_fn_mkdir_p +as_dir=src; as_fn_mkdir_p +as_dir=doc; as_fn_mkdir_p +as_dir=tests; as_fn_mkdir_p + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -28092,6 +30488,14 @@ as_fn_error $? "conditional \"GL_GENERATE_ICONV_H\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then + as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then as_fn_error $? "conditional \"GL_GENERATE_STDINT_H\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -28123,7 +30527,7 @@ do eval "ac_val=\$$ac_var" case $ac_var:$ac_val in - (*_H:*.h) eval "$ac_var=lib/\$$ac_var";; + *_H:*.h) eval "$ac_var=lib/\$$ac_var";; esac done @@ -28192,6 +30596,10 @@ gltests_LTLIBOBJS=$gltests_ltlibobjs +if test -z "${ENABLE_BASH_COMPLETION_TRUE}" && test -z "${ENABLE_BASH_COMPLETION_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_BASH_COMPLETION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${BUILD_FROM_GIT_TRUE}" && test -z "${BUILD_FROM_GIT_FALSE}"; then as_fn_error $? "conditional \"BUILD_FROM_GIT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -28597,7 +31005,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by GNU datamash $as_me 1.0.7, which was +This file was extended by GNU datamash $as_me 1.1.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -28669,7 +31077,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -GNU datamash config.status 1.0.7 +GNU datamash config.status 1.1.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -29703,15 +32111,14 @@ $as_echo "" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: Default installation directories:" >&5 $as_echo " Default installation directories:" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: program: ${prefix}/bin/ " >&5 -$as_echo " program: ${prefix}/bin/ " >&6; } -if test "x$datarootdir" = 'x${prefix}/share' ; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: examples: ${prefix}/share/${PACKAGE}/examples" >&5 -$as_echo " examples: ${prefix}/share/${PACKAGE}/examples" >&6; } -else -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: examples: ${datarootdir}/${PACKAGE}/examples" >&5 -$as_echo " examples: ${datarootdir}/${PACKAGE}/examples" >&6; } -fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: program: ${prefix}/bin/ " >&5 +$as_echo " program: ${prefix}/bin/ " >&6; } +eval example_dir=${datarootdir}/${PACKAGE}/examples +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: examples: ${example_dir}" >&5 +$as_echo " examples: ${example_dir}" >&6; } +eval bash_comp_dir=$BASH_COMPLETION_DIR +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: bash-comp: ${bash_comp_dir}" >&5 +$as_echo " bash-comp: ${bash_comp_dir}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5 $as_echo "" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: To change installation path, re-run:" >&5 diff -Nru datamash-1.0.7/configure.ac datamash-1.1.1/configure.ac --- datamash-1.0.7/configure.ac 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/configure.ac 2017-01-19 19:23:07.000000000 +0000 @@ -1,4 +1,4 @@ -dnl Copyright (C) 2013-2015 Assaf Gordon +dnl Copyright (C) 2013-2017 Assaf Gordon dnl dnl This file is free software; as a special exception the author gives dnl unlimited permission to copy and/or distribute it, with or without @@ -91,6 +91,24 @@ [Define to 1 if strtold does not work properly (e.g. in cygwin)]) fi +AC_ARG_WITH([bash-completion-dir], + AS_HELP_STRING([--with-bash-completion-dir[=PATH]], + [Install the bash auto-completion script in this directory. + For example, /etc/bash_completion.d @<:@default=datarootdir@:>@]), + [], + [with_bash_completion_dir=yes]) + +if test "x$with_bash_completion_dir" = "xyes"; then + BASH_COMPLETION_DIR="$datarootdir/${PACKAGE}/bash-completion.d" +else + # either 'no', or a user-specified custom DIR - use it. + BASH_COMPLETION_DIR="$with_bash_completion_dir" +fi +AC_SUBST([BASH_COMPLETION_DIR]) +AM_CONDITIONAL([ENABLE_BASH_COMPLETION], + [test "x$with_bash_completion_dir" != "xno"]) + + ## ## Check if the system's sort support "-s" (stable) sort. ## 'sort' from GNU Coreutils, FreeBSD, OpenBSD, Busybox support it. @@ -122,6 +140,15 @@ po/Makefile.in ]) + +# This is needed when building outside the source dir +# with --disable-dependency-tracking. +# Inspired by sed's https://bugs.gnu.org/25371 +AS_MKDIR_P([lib]) +AS_MKDIR_P([src]) +AS_MKDIR_P([doc]) +AS_MKDIR_P([tests]) + AC_OUTPUT dnl @@ -136,18 +163,11 @@ AC_MSG_RESULT([ LDFLAGS: $LDFLAGS]) AC_MSG_RESULT([]) AC_MSG_RESULT([ Default installation directories:]) -AC_MSG_RESULT([ program: ${prefix}/bin/ ]) -dnl The default 'datarootdir' is unexpanded, still contains -dnl '${prefix}/share' (note the single quotes in the second parameter). -dnl If it is unexpanded, it means "./configure" will put the default value -dnl in the resulting 'Makefile'. -dnl If it is expanded, it means the user called "./configure" with a custom -dnl "--prefix" parameter. -if test "x$datarootdir" = 'x${prefix}/share' ; then -AC_MSG_RESULT([ examples: ${prefix}/share/${PACKAGE}/examples]) -else -AC_MSG_RESULT([ examples: ${datarootdir}/${PACKAGE}/examples]) -fi +AC_MSG_RESULT([ program: ${prefix}/bin/ ]) +eval example_dir=${datarootdir}/${PACKAGE}/examples +AC_MSG_RESULT([ examples: ${example_dir}]) +eval bash_comp_dir=$BASH_COMPLETION_DIR +AC_MSG_RESULT([ bash-comp: ${bash_comp_dir}]) AC_MSG_RESULT([]) AC_MSG_RESULT([ To change installation path, re-run:]) AC_MSG_RESULT([ ./configure --prefix NEW-PATH]) diff -Nru datamash-1.0.7/contrib/bash-completion/datamash datamash-1.1.1/contrib/bash-completion/datamash --- datamash-1.0.7/contrib/bash-completion/datamash 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/contrib/bash-completion/datamash 2017-01-17 17:50:20.000000000 +0000 @@ -1,6 +1,7 @@ +#!/bin/bash # datamash bash-completion # -## Copyright (C) 2014 Assaf Gordon +## Copyright (C) 2014-2017 Assaf Gordon ## ## This file is part of GNU Datamash. ## @@ -16,54 +17,94 @@ _datamash () { local cur prev words cword split=false - _init_completion -n := || return + _get_comp_words_by_ref cur prev words cword - datamash_modes="transpose reverse" + local modes="check crosstab groupby reverse rmdup transpose" + local modes_re=${modes// /|} - datamash_operations="sum min max absmin absmax - count first last rand - unique collapse countunique - mean median q1 q3 iqr mode antimode - pstdev sstdev pvar svar mad madraw - pskew sskew pkurt skurt dpo jarque" + #NOTE: do not change the spaces (or indentation or backslashes) + # or the regex will fail. + local groupby_ops="sum min max absmin absmax \ +count first last rand \ +unique collapse countunique \ +mean median q1 q3 iqr mode antimode \ +pstdev sstdev pvar svar mad madraw \ +pskew sskew pkurt skurt dpo jarque \ +pcov scov ppearson spearson strbin" + local groupby_ops_re=${groupby_ops// /|} + + local line_ops="base64 debase64 md5 sha1 sha256 sha512 \ +round floor ceil trunc frac bin" + local line_ops_re=${line_ops// /|} - datamash_short_options="-f -g -H -i -s -t -W -z" + local datamash_short_options="-f -g -H -i -s -t -W -z" - datamash_long_options="--full --group --header-in --header-out --headers + local datamash_long_options="--full --group --header-in --header-out --headers --ignore-case --sort --no-strict --filler --field-separator --whitespace --zero-terminated --help --version" + local all_ops_re="$modes_re|$groupby_ops_re|$line_ops_re" + # IF the previous word as an operator, the next parameter should # be a numeric value, so don't offer any completion. - [[ "$datamash_operations $datamash_modes" == *"$prev"* ]] && return 0 + if [[ "$prev" =~ $all_ops_re ]] ; then + return 0 + fi - # Check if any of the previous parameteters is an operator. - # If so, then suggest only other operators, not options. - local seen_operators=0 + # Based on current parameteres, check which mode we're in. + local suggest_modes=1 + local suggest_groupby_ops=1 + local suggest_line_ops=1 local i=$((cword-1)) + while [ "$i" -gt 0 ] ; do - local tmp_word=${words[$i]} - if [[ "$datamash_operations $datamash_modes" == *"$tmp_word"* ]]; then - seen_operators=1 - break - fi - i=$((i-1)) + local tmp_word=${words[$i]} + + if [[ "$tmp_word" =~ $modes_re ]] ; then + suggest_modes=0 + case "$tmp_word" in + crosstab|groupby) suggest_line_ops=0 + esac + fi + + if [[ "$tmp_word" =~ $groupby_ops_re ]]; then + suggest_modes=0 + suggest_line_ops=0 + fi + # if the user specified -g, we're in "groupby" mode + if [[ "$tmp_word" = "-g" ]] ; then + suggest_modes=0 + suggest_line_ops=0 + fi + + if [[ "$tmp_word" =~ $line_ops_re ]]; then + suggest_modes=0 + suggest_groupby_ops=0 + fi + + i=$((i-1)) done - if [ "$seen_operators" -eq 1 ] ; then - COMPREPLY=( $(compgen -W "$datamash_operations" -- "$cur") ) + + # Options trump everything (if the user typed '-') + if [[ "$cur" = "-"* ]] ; then + COMPREPLY=( $(compgen -W \ + "$datamash_short_options $datamash_long_options" -- "$cur") ) return 0 fi - # Suggest options or operators - case "$cur" in - -*) COMPREPLY=( $(compgen -W \ - "$datamash_short_options $datamash_long_options" -- "$cur") ) - ;; - *) COMPREPLY=( $(compgen -W \ - "$datamash_modes $datamash_operations" -- "$cur") ) - ;; - esac + # suggest other possibilities + local suggest="" + if [ "$suggest_modes" -eq 1 ] ; then + suggest="$modes" + fi + if [ "$suggest_groupby_ops" -eq 1 ] ; then + suggest="$suggest $groupby_ops" + fi + if [ "$suggest_line_ops" -eq 1 ] ; then + suggest="$suggest $line_ops" + fi + COMPREPLY=( $(compgen -W "$suggest" -- "$cur") ) return 0 } diff -Nru datamash-1.0.7/datamash.1 datamash-1.1.1/datamash.1 --- datamash-1.0.7/datamash.1 2015-06-22 00:27:23.000000000 +0000 +++ datamash-1.1.1/datamash.1 2017-01-19 20:05:39.000000000 +0000 @@ -1,26 +1,30 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.43.3. -.TH DATAMASH "1" "June 2015" "datamash 1.0.7" "User Commands" +.TH DATAMASH "1" "January 2017" "datamash 1.1.1" "User Commands" .SH NAME datamash - command-line calculations .SH SYNOPSIS .B datamash -[\fIOPTION\fR] \fIop \fR[\fIcol\fR] [\fIop col \fR...] +[\fIOPTION\fR] \fIop \fR[\fIfld\fR] [\fIop fld \fR...] .SH DESCRIPTION Performs numeric/string operations on input from stdin. .PP -\&'op' is the operation to perform; -For grouping,per\-line operations 'col' is the input field to use; -\&'col' can be a number (1=first field), or a column name when using -\fB\-H\fR or \fB\-\-header\-in\fR options. -.SS "File operations:" +\&'op' is the operation to perform. If a primary operation is used, +it must be listed first, optionally followed by other operations. +\&'fld' is the input field to use. 'fld' can be a number (1=first field), +or a field name when using the \fB\-H\fR or \fB\-\-header\-in\fR options. +Multiple fields can be listed with a comma (e.g. 1,6,8). A range of +fields can be listed with a dash (e.g. 2\-8). Use colons for operations +which require a pair of fields (e.g. 'pcov 2:6'). +.SS "Primary operations:" .IP -transpose, reverse +groupby, crosstab, transpose, reverse, check .SS "Line-Filtering operations:" .IP rmdup .SS "Per-Line operations:" .IP -base64, debase64, md5, sha1, sha256, sha512 +base64, debase64, md5, sha1, sha256, sha512, +bin, strbin, round, floor, ceil, trunc, frac .SS "Numeric Grouping operations:" .IP sum, min, max, absmin, absmax @@ -29,9 +33,9 @@ count, first, last, rand, unique, collapse, countunique .SS "Statistical Grouping operations:" .IP -mean, median, q1, q3, iqr, mode, antimode, pstdev, sstdev, pvar -svar, mad, madraw, pskew, sskew, pkurt, skurt, dpo, jarque -.SH OPTIONS +mean, median, q1, q3, iqr, mode, antimode, pstdev, sstdev, pvar, +svar, mad, madraw, pskew, sskew, pkurt, skurt, dpo, jarque, +scov, pcov, spearson, ppearson .SS "Grouping Options:" .TP \fB\-f\fR, \fB\-\-full\fR @@ -39,7 +43,8 @@ (default: print only the grouped keys) .TP \fB\-g\fR, \fB\-\-group\fR=\fIX[\fR,Y,Z] -group via fields X,[Y,Z] +group via fields X,[Y,Z]; +equivalent to primary operation 'groupby' .TP \fB\-\-header\-in\fR first input line is column headers @@ -84,122 +89,194 @@ .TP \fB\-\-version\fR output version information and exit +.SH OPTIONS .PP .SH AVAILABLE OPERATIONS .PP -.SS File operations: + +.SS "Primary Operations" +Primary operations affect the way the file is processed. If used, the +primary operation must be listed first. Some operations require field +numbers (groupby, crosstab) while others do not (reverse,check,transpose). +If primary operation is not listed the entire file is processed - +either line-by-line (for 'per-line' operations) or all lines as one group +(for grouping operations). See Examples section below. +.PP + .TP "\w'\fBcountunique\fR'u+1n" +.B groupby X,Y,... op fld ... +group the file by given fields. Equivalent to option '\-g'. +For each group perform operation \fBop\fR on field \fBfld\fR. + +.TP +.B crosstab X,Y [op fld ...] +cross-tabulate a file by two fields (cross-tabulation is also known +as pivot tables). If no operation is specified, counts how many incidents +exist of X,Y. + +.TP .B transpose transpose rows, columns of the input file + .TP .B reverse reverse field order in each line + +.TP +.B check +verify the input file has same number of fields in all lines. +number of lines and fields are printed to STDOUT. Exits with non-zero code +and prints the offending line if there's a mismatch in the number of fields. .PP -.SS Line-Filtering operations: + + +.SS "Line-Filtering operations" + .TP "\w'\fBcountunique\fR'u+1n" .B rmdup remove lines with duplicated key value .PP -.SS Per-Line operations: + +.SS "Per-Line operations" + .TP "\w'\fBcountunique\fR'u+1n" .B base64 Encode the field as base64 + .TP .B debase64 Decode the field as base64, exit with error if invalid base64 string + .TP .B md5/sha1/sha256/sha512 Calculate md5/sha1/sha256/sha512 hash of the field value + .TP -.B reverse -reverse field order in each line +.B bin[:BUCKET-SIZE] +bin numeric values into buckets of size \fBBUCKET-SIZE\fR (defaults to 100). + +.TP +.B strbin[:BUCKET-SIZE] +hashes the input and returns a numeric integer value between zero and +\fBBUCKET-SIZE\fB (defaults to 10). + +.TP +.B round/floor/ceil/trunc/frac +numeric rounding operations. round (round half away from zero), +floor (round up), ceil (ceiling, round down), trunc (truncate, round towards +zero), frac (fraction, return fraction part of a decimal-point value). .PP -.SS Numeric Grouping operations + + +.SS "Numeric Grouping operations" + .TP "\w'\fBcountunique\fR'u+1n" .B sum sum the of values + .TP .B min minimum value + .TP .B max maximum value + .TP .B absmin minimum of the absolute values + .TP .B absmax maximum of the absolute values .PP -.SS Textual/Numeric Grouping operations + +.SS "Textual/Numeric Grouping operations" + .TP "\w'\fBcountunique\fR'u+1n" .B count count number of elements in the group + .TP .B first the first value of the group + .TP .B last the last value of the group + .TP .B rand one random value from the group + .TP .B unique comma-separated sorted list of unique values + .TP .B collapse comma-separated list of all input values + .TP .B countunique number of unique/distinct values .PP -.SS Statistical Grouping operations + + +.SS "Statistical Grouping operations" +A \fBp/s\fR prefix indicates the varient: \fBp\fRopulation or \fBs\fRample. +Typically, the \fBs\fRample variant is equivalent with \fBGNU R\fR's +internal functions (e.g datamash's \fBsstdev\fR operation is equivalent +to R's \fBsd()\fR function). +.PP + .TP "\w'\fBcountunique\fR'u+1n" .B mean mean of the values + .TP .B median median value + .TP .B q1 1st quartile value + .TP .B q3 3rd quartile value + .TP .B iqr inter-quartile range + .TP .B mode mode value (most common value) + .TP .B antimode anti-mode value (least common value) + .TP -.B pstdev -population standard deviation -.TP -.B sstdev -sample standard deviation -.TP -.B pvar -population variance +.B pstdev/sstdev +population/sample standard deviation + .TP -.B svar -sample variance +.B pvar/svar +population/sample variance + .TP .B mad median absolute deviation, scaled by constant 1.4826 for normal distributions + .TP .B madraw median absolute deviation, unscaled + .TP -.B sskew -skewness of the (sample) group -.TP -.B pskew -skewness of the (population) group +.B pskew/sskew +skewness of the group values x reported by 'sskew' and 'pskew' operations: .nf x > 0 - positively skewed / skewed right @@ -210,25 +287,32 @@ \-0.5 > x > \-1 - moderately skewed left \-1 > x - highly skewed left .fi + .TP -.B skurt -excess Kurtosis of the (sample) group -.TP -.B pkurt -excess Kurtosis of the (population) group -.TP -.B jarque -p-value of the Jarque-Beta test for normality +.B pkurt/skurt +excess Kurtosis of the group + .TP -.B dpo -p-value of the D'Agostino-Pearson Omnibus test for normality; - for 'jarque' and 'dpo' operations: +.B jarque/dpo +p-value of the Jarque-Beta (\fBjarque\fR) and D'Agostino-Pearson Omnibus +(\fBdpo\fR) tests for normality: null hypothesis is normality; low p-Values indicate non-normal data; high p-Values indicate null-hypothesis cannot be rejected. + +.TP +.B pcov/scov [X:Y] +covariance of fields X and Y + +.TP +.B ppearson/spearson [X:Y] +Pearson product-moment correlation coefficient [Pearson's R] +of fields X and Y .SH EXAMPLES -Print the sum and the mean of values from column 1: +.SS "Basic usage" + +Print the sum and the mean of values from field 1: .PP .nf .RS @@ -246,12 +330,18 @@ A 5 B 9 B 11 + $ \fBdatamash\fR \-g 1 sum 2 < example.txt A 15 B 20 + +$ \fBdatamash\fR groupby 1 sum 2 < example.txt +A 15 +B 20 .RE .fi .PP + Unsorted input must be sorted (with '\-s'): .PP .nf @@ -263,6 +353,7 @@ C 1 A 5 B 11 + $ \fBdatamash\fR \-s \-g1 sum 2 < example.txt A 15 B 20 @@ -270,6 +361,7 @@ .RE .fi .PP + Which is equivalent to: .PP .nf @@ -277,6 +369,10 @@ $ cat example.txt | sort \-k1,1 | \fBdatamash\fR \-g 1 sum 2 .RE .fi + + + +.SS "Header lines" .PP Use \fB\-h\fR \fB(\-\-headers)\fR if the input file has a header line: .PP @@ -292,9 +388,13 @@ # Calculate the mean and standard devian for each major $ \fBdatamash\fR \-\-sort \-\-headers \-\-group 2 mean 3 pstdev 3 < scores_h.txt + (or use short form) + $ \fBdatamash\fR \-sH \-g2 mean 3 pstdev 3 < scores_h.txt - (or use named columns) + + (or use named fields) + $ \fBdatamash\fR \-sH \-g Major mean Score pstdev Score < scores_h.txt GroupBy(Major) mean(Score) pstdev(Score) Arts 68.9 10.1 @@ -306,7 +406,59 @@ .RE .fi .PP -Reverse field order in each line: + + +.SS "Multiple fields" + +Use comma or dash to specify multiple fields. The following are equivalent: +.nf +.RS +$ seq 9 | paste \- \- \- +1 2 3 +4 5 6 +7 8 9 + +$ seq 9 | paste \- \- \- | datamash sum 1 sum 2 sum 3 +12 15 18 + +$ seq 9 | paste \- \- \- | datamash sum 1,2,3 +12 15 18 + +$ seq 9 | paste \- \- \- | datamash sum 1-3 +12 15 18 +.RE +.fi +.PP + + +.SS "Rounding" +The following demonstrate the different rounding operations: +.nf +.RS +.RE +.\" NOTE: The weird spacing/alignment is due to extract backslash +.\" characters. Modify with caution. +$ ( echo X ; seq \-1.25 0.25 1.25 ) \\ + | datamash \-\-full \-H round 1 ceil 1 floor 1 trunc 1 frac 1 + + X round(X) ceil(X) floor(X) trunc(X) frac(X) +\-1.25 \-1 \-1 \-2 \-1 \-0.25 +\-1.00 \-1 \-1 \-1 \-1 0 +\-0.75 \-1 0 \-1 0 \-0.75 +\-0.50 \-1 0 \-1 0 \-0.5 +\-0.25 0 0 \-1 0 \-0.25 + 0.00 0 0 0 0 0 + 0.25 0 1 0 0 0.25 + 0.50 1 1 0 0 0.5 + 0.75 1 1 0 0 0.75 + 1.00 1 1 1 1 0 + 1.25 1 2 1 1 0.25 +.fi +.PP + + + +.SS "Reversing fields" .PP .nf .RS @@ -317,7 +469,10 @@ .RE .fi .PP -Transpose rows, columns: + + + +.SS "Transposing a file" .PP .nf .RS @@ -327,7 +482,11 @@ .RE .fi .PP -Remove lines with duplicate key value from column 1 + + + +.SS "Removing Duplicated lines" +Remove lines with duplicate key value from field 1 (Unlike \fBfirst\fR,\fBlast\fR operations, \fBrmdup\fR is much faster and does not require sorting the file with \-s): .PP @@ -342,9 +501,10 @@ 2 ee.txt 3 ff.txt -# Remove lines with duplicated Sample-ID (column 1): +# Remove lines with duplicated Sample-ID (field 1): $ \fBdatamash\fR rmdup 1 < INPUT - (or used named column) + +# or use named field: $ \fBdatamash\fR \-H rmdup SampleID < INPUT SampleID File 2 cc.txt @@ -353,6 +513,9 @@ .RE .fi .PP + + +.SS "Checksums" Calculate the sha1 hash value of each TXT file, after calculating the sha1 value of each file's content: .PP @@ -362,6 +525,139 @@ .RE .fi .PP + + +.SS "Check file structure" +Check the structure of the input file (ensure all lines +have the same number of fields): +.PP +.nf +.RS +$ seq 10 | paste \- \- | datamash check && echo ok || echo fail +5 lines, 2 fields +ok + +$ seq 13 | paste \- \- \- | datamash check && echo ok || echo fail +line 4 (3 fields): + 10 11 12 +line 5 (2 fields): + 13 +datamash: check failed: line 5 has 2 fields (previous line had 3) +fail +.RE +.fi +.PP + + + +.SS "Cross-Tabulation" +Cross-tabulation compares the relationship between two fields. +Given the following input file: +.nf +.RS +$ cat input.txt +a x 3 +a y 7 +b x 21 +a x 40 +.RE +.fi +.PP +Show cross-tabulation between the first field (a/b) and the second field +(x/y) - counting how many times each pair appears (note: sorting is required): +.PP +.nf +.RS +$ \fBdatamash\fR \-s crosstab 1,2 < input.txt + x y +a 2 1 +b 1 N/A +.RE +.fi +.PP +An optional grouping operation can be used instead of counting: +.PP +.nf +.RS +.PP +$ \fBdatamash\fR \-s crosstab 1,2 sum 3 < input.txt + x y +a 43 7 +b 21 N/A + +$ \fBdatamash\fR \-s crosstab 1,2 unique 3 < input.txt + x y +a 3,40 7 +b 21 N/A +.RE +.fi +.PP + + +.SS "Binning numeric values" +Bin input values into buckets of size 5: +.PP +.nf +.RS +$ ( echo X ; seq \-10 2.5 10 ) \\ + | \fBdatamash\fR \-H \-\-full bin:5 1 + X bin(X) +\-10.0 \-15 + \-7.5 \-10 + \-5.0 \-10 + \-2.5 \-5 + 0.0 0 + 2.5 0 + 5.0 5 + 7.5 5 + 10.0 10 +.RE +.fi +.PP + + +.SS "Binning string values" +Hash any input value into a numeric integer. +A typical usage would be to split an input file +into N chunks, ensuring that all values of a certain key will +be stored in the same chunk: +.PP +.nf +.RS +$ cat input.txt +PatientA 10 +PatientB 11 +PatientC 12 +PatientA 14 +PatientC 15 + +.RE + +Each patient ID is hashed into a bin between 0 and 9 +and printed in the last field: + +.RS + +$ \fBdatamash\fR \-\-full strbin 1 < input.txt +PatientA 10 5 +PatientB 11 6 +PatientC 12 7 +PatientA 14 5 +PatientC 15 7 + +.RE + +Splitting the input into chunks can be done with awk: + +.RS + +$ cat input.txt \\ + | \fBdatamash\fR \-\-full strbin 1 \\ + | awk '{print > $NF ".txt"}' + +.RE +.fi +.PP .SH "ADDITIONAL INFORMATION" See .UR http://www.gnu.org/software/datamash @@ -369,7 +665,7 @@ .SH AUTHOR Written by Assaf Gordon. .SH COPYRIGHT -Copyright \(co 2015 Assaf Gordon +Copyright \(co 2017 Assaf Gordon License GPLv3+: GNU GPL version 3 or later . .br This is free software: you are free to change and redistribute it. diff -Nru datamash-1.0.7/debian/changelog datamash-1.1.1/debian/changelog --- datamash-1.0.7/debian/changelog 2015-11-13 14:34:03.000000000 +0000 +++ datamash-1.1.1/debian/changelog 2017-03-15 14:44:02.000000000 +0000 @@ -1,3 +1,15 @@ +datamash (1.1.1-1) unstable; urgency=low + + * New upstream release + * Added a patch to fix manpage spelling + * d/control: + - Update Standards-Version field to the latest one + - Update Vcs-Git and Vcs-Browser to use secure connection + * Update copyright years in d/copyright + * Added DEB_BUILD_MAINT_OPTIONS variable to d/rules + + -- Alejandro Garrido Mota Wed, 15 Mar 2017 14:44:02 +0000 + datamash (1.0.7-1) unstable; urgency=low * New upstream relese diff -Nru datamash-1.0.7/debian/control datamash-1.1.1/debian/control --- datamash-1.0.7/debian/control 2015-11-13 14:34:03.000000000 +0000 +++ datamash-1.1.1/debian/control 2017-03-15 14:44:02.000000000 +0000 @@ -4,10 +4,10 @@ Maintainer: Alejandro Garrido Mota Build-Depends: debhelper (>= 9), autotools-dev -Standards-Version: 3.9.6 +Standards-Version: 3.9.8 Homepage: https://savannah.gnu.org/projects/datamash/ -Vcs-Git: git://anonscm.debian.org/collab-maint/datamash.git -Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/datamash.git +Vcs-Git: https://anonscm.debian.org/git/collab-maint/datamash.git +Vcs-Browser: https://anonscm.debian.org/gitweb/?p=collab-maint/datamash.git Package: datamash Architecture: any diff -Nru datamash-1.0.7/debian/copyright datamash-1.1.1/debian/copyright --- datamash-1.0.7/debian/copyright 2015-11-13 14:34:03.000000000 +0000 +++ datamash-1.1.1/debian/copyright 2017-03-15 14:44:02.000000000 +0000 @@ -3,7 +3,7 @@ Source: https://savannah.gnu.org/projects/datamash Files: * -Copyright: 2013,2014 Assaf Gordon +Copyright: 2013-2017 Assaf Gordon License: GPL-3+ Files: doc/datamash.* @@ -19,7 +19,7 @@ version 1.3 can be found in `/usr/share/common-licenses/GFDL-1.3'. Files: debian/* -Copyright: 2014 Alejandro Garrido Mota +Copyright: 2014-2017 Alejandro Garrido Mota License: GPL-3+ License: GPL-3+ diff -Nru datamash-1.0.7/debian/patches/fix-spelling-manpage.diff datamash-1.1.1/debian/patches/fix-spelling-manpage.diff --- datamash-1.0.7/debian/patches/fix-spelling-manpage.diff 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/debian/patches/fix-spelling-manpage.diff 2017-03-15 14:44:02.000000000 +0000 @@ -0,0 +1,15 @@ +From: Alejandro Garrido Mota +Date: Wed, 15 Mar 2017 14:44:02 +0000 +Subject: Fix manpage spelling + +--- a/datamash.1 ++++ b/datamash.1 +@@ -224,7 +224,7 @@ + + + .SS "Statistical Grouping operations" +-A \fBp/s\fR prefix indicates the varient: \fBp\fRopulation or \fBs\fRample. ++A \fBp/s\fR prefix indicates the variant: \fBp\fRopulation or \fBs\fRample. + Typically, the \fBs\fRample variant is equivalent with \fBGNU R\fR's + internal functions (e.g datamash's \fBsstdev\fR operation is equivalent + to R's \fBsd()\fR function). diff -Nru datamash-1.0.7/debian/patches/series datamash-1.1.1/debian/patches/series --- datamash-1.0.7/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/debian/patches/series 2017-03-15 14:44:02.000000000 +0000 @@ -0,0 +1 @@ +fix-spelling-manpage.diff diff -Nru datamash-1.0.7/debian/rules datamash-1.1.1/debian/rules --- datamash-1.0.7/debian/rules 2015-11-13 14:34:03.000000000 +0000 +++ datamash-1.1.1/debian/rules 2017-03-15 14:44:02.000000000 +0000 @@ -1,5 +1,6 @@ #!/usr/bin/make -f DPKG_EXPORT_BUILDFLAGS = 1 +DEB_BUILD_MAINT_OPTIONS = hardening=+all include /usr/share/dpkg/default.mk PACKAGE = $(shell dh_listpackages) diff -Nru datamash-1.0.7/doc/datamash.info datamash-1.1.1/doc/datamash.info --- datamash-1.0.7/doc/datamash.info 2015-06-22 00:27:35.000000000 +0000 +++ datamash-1.1.1/doc/datamash.info 2017-01-19 19:34:41.000000000 +0000 @@ -1,17 +1,17 @@ -This is datamash.info, produced by makeinfo version 5.2 from +This is datamash.info, produced by makeinfo version 6.3 from datamash.texi. -This manual is for GNU Datamash (version 1.0.7, 14 June 2015), which +This manual is for GNU Datamash (version 1.1.1, 17 January 2017), which provides command-line computations on input files. - Copyright (C) 2014-2015 Assaf Gordon. + Copyright (C) 2014-2017 Assaf Gordon. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software - Foundation; with no Invariant Sections, with no Front-Cover Texts, - and with no Back-Cover Texts. A copy of the license is included in - the section entitled "GNU Free Documentation License". + Foundation; with no Invariant Sections, no Front-Cover Texts, and + no Back-Cover Texts. A copy of the license is included in the + section entitled "GNU Free Documentation License". INFO-DIR-SECTION Basics START-INFO-DIR-ENTRY * Datamash: (datamash). datamash @@ -23,7 +23,7 @@ Datamash ******** -This manual is for GNU Datamash (version 1.0.7, 14 June 2015), which +This manual is for GNU Datamash (version 1.1.1, 17 January 2017), which provides command-line computations on input files. * Menu: @@ -32,10 +32,12 @@ * Invoking datamash:: How to run 'datamash'. * Available Operations:: Available operations in 'datamash'. * Statistical Operations:: Statistical operations in 'datamash'. +* Usage Examples:: Usage Examples. * Reporting bugs:: Sending bug reports and feature suggestions. * GNU Free Documentation License:: Copying and sharing this documentation. * Concept index:: Index of concepts. +  File: datamash.info, Node: Overview, Next: Invoking datamash, Prev: Top, Up: Top @@ -44,30 +46,30 @@ The 'datamash' program () performs calculation (e.g. _sum,_, _count_, _min_, _max_, _skewness_, _standard -deviation_) on input files. A simple example: sum up the values in the -first column of the input: +deviation_) on input files. + + Example: sum up the values in the first column of the input: $ seq 10 | datamash sum 1 55 'datamash' can group input data and perform operations on each group. -It can sort the file, and read header lines. An example: Finding the -average score in statistics course of college students, grouped by their -college major: +It can sort the file, and read header lines. + + Example: Given a file with three fields (name, subject, score), find +the average score in each subject: -The input file has three fields: Name,Major,Score: $ cat scores.txt - Name Major Score + Name Subject Score Bryan Arts 68 Isaiah Arts 80 Gabriel Health-Medicine 100 Tysza Business 92 Zackery Engineering 54 ... -Sorting the input file and group by the second column (Major), then -calculating the mean score (third column) and sample-standard-deviation: + $ datamash --sort --headers --group 2 mean 3 sstdev 3 < scores.txt - GroupBy(Major) mean(Score) sstdev(Score) + GroupBy(Subject) mean(Score) sstdev(Score) Arts 68.9474 10.4215 Business 87.3636 5.18214 Engineering 66.5385 19.8814 @@ -75,7 +77,7 @@ Life-Sciences 55.3333 20.606 Social-Sciences 60.2667 17.2273 - 'datamash' is designed for interactive exploration of textual data, + 'datamash' is designed for interactive exploration of textual data and for automating tasks in shell scripts. 'datamash' has a rich set of statistical functions to quickly assess @@ -106,23 +108,28 @@ 'datamash' supports the following operations: -File operations: - 'transpose', 'reverse' +Primary operations: + 'groupby', 'crosstab', 'transpose', 'reverse', 'check' + +Line-Filtering operations: + 'rmdup' Per-Line operations: - 'base64', 'debase64', 'md5', 'sha1', 'sha256', 'sha512' + 'base64', 'debase64', 'md5', 'sha1', 'sha256', 'sha512', 'bin', + 'strbin', 'round', 'floor', 'ceil', 'trunc', 'frac' -Numeric operations: +Group-by Numeric operations: 'sum', 'min', 'max', 'absmin', 'absmax' -Textual/Numeric operations: +Group-by Textual/Numeric operations: 'count', 'first', 'last', 'rand', 'unique', 'collapse', 'countunique' -Statistical operations: +Group-by Statistical operations: 'mean', 'median', 'q1', 'q3', 'iqr', 'mode', 'antimode', 'pstdev', 'sstdev', 'pvar', 'svar', 'mad', 'madraw', 'sskew', 'pskew', - 'skurt', 'pkurt', 'jarque', 'dpo' + 'skurt', 'pkurt', 'jarque', 'dpo', 'scov', 'pcov', 'spearson', + 'ppearson' Grouping options: @@ -217,12 +224,24 @@ 3 Available operations in 'datamash' ************************************ -File operations: +Primary operations: + 'groupby' + alternative syntax for '--group' + 'crosstab' + cross-tabulate two fields (also known as 'pivot-tables') 'transpose' transpose rows, columns of a text file 'reverse' reverse fields in each line of a text file + 'check' + verify tabular structure of input (ensure same number of + fields in all lines) + +Line-Filtering operation: + + 'rmdup' + remove lines with duplicated key value Per-Line operations: @@ -240,7 +259,7 @@ 'sha512' calculates sha512 hash of the field -Numeric operations: +Group-by Numeric operations: 'sum' sum the of values @@ -253,7 +272,7 @@ 'absmax' maximum of the absolute values -Textual/Numeric operations: +Group-By Textual/Numeric operations: 'count' count number of elements in the group @@ -270,7 +289,7 @@ 'countunique' number of unique/distinct values -Statistical operations: +Group-By Statistical operations: 'mean' mean of the values @@ -313,7 +332,7 @@ p-value of the D'Agostino-Pearson Omnibus test for normality.  -File: datamash.info, Node: Statistical Operations, Next: Reporting bugs, Prev: Available Operations, Up: Top +File: datamash.info, Node: Statistical Operations, Next: Usage Examples, Prev: Available Operations, Up: Top 4 Statistical Operations ************************ @@ -329,9 +348,639 @@ equivalent R functions.  -File: datamash.info, Node: Reporting bugs, Next: GNU Free Documentation License, Prev: Statistical Operations, Up: Top +File: datamash.info, Node: Usage Examples, Next: Reporting bugs, Prev: Statistical Operations, Up: Top -5 Reporting bugs +5 Usage Examples +**************** + +* Menu: + +* Summary Statistics:: count,min,max,mean,stdev,median,quartiles +* Header Lines and Column Names:: Using files with header lines +* Field Delimiters:: Tabs, Whitespace, other delimiteres +* Column Ranges:: Operating on multiple columns +* Reverse and Transpose:: swapping and transposing rows, columns +* Groupby on /etc/passwd:: Groupby, count, collapse +* Check:: Validate tabular structure +* Crosstab:: Cross-tabulation (pivot-tables) +* Rounding numbers:: round, ceil, floor, trunc, frac +* Binning numbers:: assigning numbers into fixed number of buckets +* Binning strings:: assigning strings into fixed number of buckets + + +File: datamash.info, Node: Summary Statistics, Next: Header Lines and Column Names, Up: Usage Examples + +5.1 Summary Statistics +====================== + +The following are examples of using 'datamash' to quickly calculate +summary statistics. The examples will use a file with three fields +(name, subject, score) representing grades of students: + + $ cat scores.txt + Shawn Arts 65 + Marques Arts 58 + Fernando Arts 78 + Paul Arts 63 + Walter Arts 75 + ... + + Counting how many students study each subject (_subject_ is the +second field in the input file, thus 'groupby 2'): + + $ datamash --sort groupby 2 count 2 < scores.txt + Arts 19 + Business 11 + Engineering 13 + Health-Medicine 13 + Life-Sciences 12 + Social-Sciences 15 + + Similary, find the minimum and maximum score in each subject: + + $ datamash --sort groupby 2 min 3 max 3 < scores.txt + Arts 46 88 + Business 79 94 + Engineering 39 99 + Health-Medicine 72 100 + Life-Sciences 14 91 + Social-Sciences 27 90 + + find the mean and (population) standard deviation in each subject: + + $ datamash --sort groupby 2 mean 3 pstdev 3 < scores.txt + Arts 68.947 10.143 + Business 87.363 4.940 + Engineering 66.538 19.101 + Health-Medicine 90.615 8.862 + Life-Sciences 55.333 19.728 + Social-Sciences 60.266 16.643 + + Find the median, first, third quariles and the inter-quartile range +in each subject: + + $ datamash --sort groupby 2 median 3 q1 3 q3 3 iqr 3 < scores.txt + Arts 71 61.5 75.5 14 + Business 87 83 92 9 + Engineering 56 51 83 32 + Health-Medicine 91 84 100 16 + Life-Sciences 58.5 44.25 67.75 23.5 + Social-Sciences 62 55 70.5 15.5 + + *Note Header Lines and Column Names:: for examples of dealing with +header lines. + + +File: datamash.info, Node: Header Lines and Column Names, Next: Field Delimiters, Prev: Summary Statistics, Up: Usage Examples + +5.2 Header Lines and Column Names +================================= + +Output Header Lines +------------------- + +If the input does _not_ have a header line, use '--header-out' to add a +header in the first line of the output, indicating which operation was +performed: + + $ datamash --sort --header-out groupby 2 min 3 max 3 < scores.txt + GroupBy(field-2) min(field-3) max(field-3) + Arts 46 88 + Business 79 94 + Engineering 39 99 + Health-Medicine 72 100 + Life-Sciences 14 91 + Social-Sciences 27 90 + +Skipping Input Header Lines +--------------------------- + +If the input has a header line (first line containing column names), use +'--header-in' to skip the line: + + $ cat scores_h.txt + Name Major Score + Shawn Arts 65 + Marques Arts 58 + Fernando Arts 78 + Paul Arts 63 + ... + + + $ datamash --sort --header-in groupby 2 mean 3 < scores_h.txt + Arts 68.947 + Business 87.363 + Engineering 66.538 + Health-Medicine 90.615 + Life-Sciences 55.333 + Social-Sciences 60.266 + + If the header line is not skipped, 'datamash' will show an error (due +to strict input validation): + + $ datamash groupby 2 mean 3 < scores_h.txt + datamash: invalid numeric value in line 1 field 3: 'Score' + +Using Header Lines +------------------ + +Column names in the input header lines can be printed in the output +header lines by using '--headers' (or '-H', both are equivalent to +'--header-in --header-out'): + + $ datamash --sort --headers groupby 2 mean 3 < scores_h.txt + GroupBy(Major) mean(Score) + Arts 68.947 + Business 87.363 + Engineering 66.538 + Health-Medicine 90.615 + Life-Sciences 55.333 + Social-Sciences 60.266 + + Or in short form ('-sH' instead of '--sort --headers'), equivalent to +the above command: + + $ datamash -sH groupby 2 mean 3 + +Column Names +------------ + +When the input file has a header line, column names can be used instead +of column numbers. In the example below, MAJOR is used instead of the +value 2, and SCORE is used instead of the value 3: + + $ datamash --sort --headers groupby Major mean Score < scores_h.txt + GroupBy(Major) mean(Score) + Arts 68.947 + Business 87.363 + Engineering 66.538 + Health-Medicine 90.615 + Life-Sciences 55.333 + Social-Sciences 60.266 + + 'datamash' will read the first line of the input, and deduce the +correct column number based on the given name. If the column name is +not found, an error will be printed: + + $ datamash --sort --headers groupby 2 mean Foo < scores_h.txt + datamash: column name 'Foo' not found in input file + + +File: datamash.info, Node: Field Delimiters, Next: Column Ranges, Prev: Header Lines and Column Names, Up: Usage Examples + +5.3 Field Delimiteres +===================== + +'datamash' uses tabs (ascii character 0x09) as default field delimiters. +Use '-W' to treat one or more consecutive whitespace characters as field +delimiters. Use '-t', '--field-separator' to set a custom field +delimiter. + + The following examples illustrate the various options. + + By default, fields are deparated by a single tab tab. Multiple tabs +denotes multiple fields (this is consistent with GNU coreutil's 'cut'): + + $ printf '1\t\t2\n' | datamash sum 3 + 2 + $ printf '1\t\t2\n' | cut -f3 + 2 + + Using '-W', one or more consecutive whitespace characters are treated +as a single field delimiter: + + $ printf '1 \t 2\n' | datamash -W sum 2 + 2 + $ printf '1 \t 2\n' | datamash -W sum 3 + datamash: invalid input: field 3 requested, line 1 has only 2 fields + + Using '-t', a custom field delimiter character can be specified. +Multiple consecutive delimiters are treated as multiple fields: + + $ printf '1,10,,100\n' | datamash -t, sum 4 + 100 + + +File: datamash.info, Node: Column Ranges, Next: Reverse and Transpose, Prev: Field Delimiters, Up: Usage Examples + +5.4 Column Ranges +================= + +'datamash' accepts column ranges such as 1,2,3 and 1-3. + + Simulating input with multiple columns: + + $ seq 100 | paste - - - - + 1 2 3 4 + 5 6 7 8 + 9 10 11 12 + 13 14 15 16 + 17 18 19 20 + ... + + The following are equivalent: + + $ seq 100 | paste - - - - | datamash sum 1 sum 2 sum 3 sum 4 + 1225 1250 1275 1300 + + $ seq 100 | paste - - - - | datamash sum 1,2,3,4 + 1225 1250 1275 1300 + + $ seq 100 | paste - - - - | datamash sum 1-4 + 1225 1250 1275 1300 + + $ seq 100 | paste - - - - | datamash sum 1-3,4 + 1225 1250 1275 1300 + + Ranges can be used with multiple operations: + + $ seq 100 | paste - - - - | datamash sum 1-4 mean 1-4 + 1225 1250 1275 1300 49 50 51 52 + + +File: datamash.info, Node: Reverse and Transpose, Next: Groupby on /etc/passwd, Prev: Column Ranges, Up: Usage Examples + +5.5 Reverse and Transpose +========================= + +Transpose +--------- + +Use 'transpose' to swap rows and columns in a file: + + $ cat input.txt + Sample Year Count + A 2014 1002 + B 2013 990 + C 2014 2030 + D 2014 599 + + $ datamash transpose < input.txt + Sample A B C D + Year 2014 2013 2014 2014 + Count 1002 990 2030 599 + + By default, 'transpose' verifies the input has the same number of +fields in each line, and fails with an error otherwise: + + $ cat input.txt + Sample Year Count + A 2014 1002 + B 2013 + C 2014 2030 + D 2014 599 + + + $ datamash transpose < input1.txt + datamash: transpose input error: line 3 has 2 fields (previous lines had 3); + see --help to disable strict mode + + Use '--no-strict' to allow missing values: + + $ datamash --no-strict transpose < input1.txt + Sample A B C D + Year 2014 2013 2014 2014 + Count 1002 N/A 2030 599 + + Use '--filler' to set the missing-field filler value: + + $ datamash --no-strict --filler XYZ transpose < input1.txt + Sample A B C D + Year 2014 2013 2014 2014 + Count 1002 XYZ 2030 599 + +Reverse +------- + +Use 'reverse' to reverse the fields order in a file: + + $ cat input.txt + Sample Year Count + A 2014 1002 + B 2013 990 + C 2014 2030 + D 2014 599 + + $ datamash reverse < input.txt + Count Year Sample + 1002 2014 A + 990 2013 B + 2030 2014 C + 599 2014 D + + By default, reverse verifies the input has the same number of fields +in each line, and fails with an error otherwise. Use '--no-strict' to +disable this behaviour (see section above for an example). + +Combining Reverse and Transpose +------------------------------- + +Reverse and Transpose can be combined to achieve various manipulations. +(reminder: tac (http://www.gnu.org/software/coreutils/tac) can be used +to reverse lines in a file): + + $ cat input.txt + A 1 xx + B 2 yy + C 3 zz + + + $ tac input.txt + C 3 zz + B 2 yy + A 1 xx + + + $ tac input.txt | datamash reverse + zz 3 C + yy 2 B + xx 1 A + + + $ cat input.txt | datamash reverse | datamash transpose + xx yy zz + 1 2 3 + A B C + + $ tac input.txt | datamash reverse | datamash transpose + zz yy xx + 3 2 1 + C B A + + +File: datamash.info, Node: Groupby on /etc/passwd, Next: Check, Prev: Reverse and Transpose, Up: Usage Examples + +5.6 Groupby on '/etc/passwd' +============================ + +'datamash' with the 'groupby' operation mode can be used to aggregate +information. + + Using this simuated '/etc/passwd' file as input: + + $ cat passwd + root:x:0:0:root:/root:/bin/bash + daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin + bin:x:2:2:bin:/bin:/usr/sbin/nologin + sys:x:3:3:sys:/dev:/usr/sbin/nologin + sync:x:4:65534:sync:/bin:/bin/sync + games:x:5:60:games:/usr/games:/usr/sbin/nologin + man:x:6:12:man:/var/cache/man:/usr/sbin/nologin + lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin + mail:x:8:8:mail:/var/mail:/usr/sbin/nologin + news:x:9:9:news:/var/spool/news:/usr/sbin/nologin + uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin + proxy:x:13:13:proxy:/bin:/usr/sbin/nologin + www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin + backup:x:34:34:backup:/var/backups:/usr/sbin/nologin + list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin + mysql:x:115:124:MySQL Server,,,:/var/lib/mysql:/bin/false + sshd:x:116:65534::/var/run/sshd:/usr/sbin/nologin + guest:x:118:125:Guest,,,:/tmp/guest-home.phc17z:/bin/bash + gordon:x:1004:1000:Assaf Gordon,,,,:/home/gordon:/bin/bash + charles:x:1005:1000:Charles,,,,:/home/charles:/bin/bash + alice:x:1006:1000:Alice,,,,:/home/alice:/bin/bash + bob:x:1007:1000:Bob,,,,:/home/bob:/bin/bash + postgres:x:119:126:PostgreSQL administrator,,,:/var/lib/postgresql:/bin/bash + rabbitmq:x:125:138:RabbitMQ messaging server,,,:/var/lib/rabbitmq:/bin/false + redis:x:126:140:redis server,,,:/var/lib/redis:/bin/false + postfix:x:127:141::/var/spool/postfix:/bin/false + + Parameter '-t' is used to indicate the field separator : (instead of +the default TAB). + + Aggregate ('groupby') login shells (column 7) and 'count' how many +users use each: + + $ datamash -t: --sort groupby 7 count 7 < passwd + /bin/bash:7 + /bin/false:4 + /bin/sync:1 + /usr/sbin/nologin:14 + + Aggregate ('groupby') login shells (column 7) and print +comma-separated list of users (column 1) for each shell ('collapse'): + + $ cat passwd | datamash -t: --sort groupby 7 collapse 1 + /bin/bash:root,guest,gordon,charles,alice,bob,postgres + /bin/false:mysql,rabbitmq,redis,postfix + /bin/sync:sync + /usr/sbin/nologin:daemon,bin,sys,games,man,lp,mail,news,uucp,proxy ,www-data,backup,list,sshd + + Aggregate unix-groups (column 4) and print comma-separated list of +users (column 1) for in each group: + + $ datamash -t: --sort groupby 4 collapse 1 < /etc/passwd + 0:root + 1:daemon + 10:uucp + 1000:gordon,charles,alice,bob + 12:man + 124:mysql + 125:guest + 126:postgres + 13:proxy + 138:rabbitmq + 140:redis + 141:postfix + 2:bin + 3:sys + 33:www-data + 34:backup + 38:list + 60:games + 65534:sync,sshd + 7:lp + 8:mail + 9:news + + +File: datamash.info, Node: Check, Next: Crosstab, Prev: Groupby on /etc/passwd, Up: Usage Examples + +5.7 Check - checking tabular structure +====================================== + +'datamash' 'check' validates the tabular structure of a file, ensuring +all lines have the same number of fields. 'check' is meant to be used +in scripting and automation pipelines, as it will terminate with +non-zero exit code if the file is not well structured, while also +printing detailed context information about the offending lines: + + $ cat good.txt + A 1 ww + B 2 xx + C 3 yy + D 4 zz + + + $ cat bad.txt + A 1 ww + B 2 xx + C 3 + D 4 zz + + + $ datamash check < good.txt && echo ok || echo fail + 4 lines, 3 fields + ok + + + $ datamash check < bad.txt && echo ok || echo fail + line 2 (3 fields): + B 2 xx + line 3 (2 fields): + C 3 + datamash: check failed: line 3 has 2 fields (previous line had 3) + fail + + In pipeline/automation context, it is often beneficial to validate +files as early as possible (immediately after file is created, as in +fail-fast methodology (https://en.wikipedia.org/wiki/Fail-fast)). A +typical usage in a shell script would be: + + #!/bin/sh + + die() + { + base=$(basename "$0") + echo "$base: error: $@" >&2 + exit 1 + } + + custom pipeline-or-program > output.txt \ + || die "program failed" + + datamash check < output.txt \ + || die "'output.txt' has invalid structure (missing fields)" + + If the generated 'output.txt' file has invalid structure (i.e. +missing fields), 'datamash' will print the 'stderr' enough details to +help in troubleshooting (line numbers and offending line's content). + + +File: datamash.info, Node: Crosstab, Next: Rounding numbers, Prev: Check, Up: Usage Examples + +5.8 Crosstab - Cross-Tabulation (pivot-tables) +============================================== + +Cross-tabulation compares the relationship between two fields. Given +the following input file: + + $ cat input.txt + a x 3 + a y 7 + b x 21 + a x 40 + + Show cross-tabulation between the first field (a/b) and the second +field (x/y) - counting how many times each pair appears (note: sorting +is required): + + $ datamash -s crosstab 1,2 < input.txt + x y + a 2 1 + b 1 N/A + + The default operation is 'count' - in the above example, A and X +appear twice in the input file, while B and Y never appear together. + + An optional grouping operation can be used instead of counting. + + For each pair, 'sum' the values in the third column: + + $ datamash -s crosstab 1,2 sum 3 < input.txt + x y + a 43 7 + b 21 N/A + + For each pair, list all 'unique' values in the third column: + + $ datamash -s crosstab 1,2 unique 3 < input.txt + x y + a 3,40 7 + b 21 N/A + + +File: datamash.info, Node: Rounding numbers, Next: Binning numbers, Prev: Crosstab, Up: Usage Examples + +5.9 Rounding numbers +==================== + +The following demonstrate the different rounding operations: + + $ ( echo X ; seq -1.25 0.25 1.25 ) \ + | datamash --full -H round 1 ceil 1 floor 1 trunc 1 frac 1 + + X round(X) ceil(X) floor(X) trunc(X) frac(X) + -1.25 -1 -1 -2 -1 -0.25 + -1.00 -1 -1 -1 -1 0 + -0.75 -1 0 -1 0 -0.75 + -0.50 -1 0 -1 0 -0.5 + -0.25 0 0 -1 0 -0.25 + 0.00 0 0 0 0 0 + 0.25 0 1 0 0 0.25 + 0.50 1 1 0 0 0.5 + 0.75 1 1 0 0 0.75 + 1.00 1 1 1 1 0 + 1.25 1 2 1 1 0.25 + + +File: datamash.info, Node: Binning numbers, Next: Binning strings, Prev: Rounding numbers, Up: Usage Examples + +5.10 Binning numbers +==================== + +Bin input values into buckets of size 5: + + $ ( echo X ; seq -10 2.5 10 ) \ + | datamash -H --full bin:5 1 + X bin(X) + -10.0 -15 + -7.5 -10 + -5.0 -10 + -2.5 -5 + 0.0 0 + 2.5 0 + 5.0 5 + 7.5 5 + 10.0 10 + + +File: datamash.info, Node: Binning strings, Prev: Binning numbers, Up: Usage Examples + +5.11 Binning strings +==================== + +Hash any string input value into a numeric integer. A typical usage +would be to split an input file into N chunks, ensuring that all values +of a certain key will be stored in the same chunk: + + $ cat input.txt + PatientA 10 + PatientB 11 + PatientC 12 + PatientA 14 + PatientC 15 + + Each patient ID is hashed into a bin between 0 and 9 and printed in +the last field: + + $ datamash --full strbin 1 < input.txt + PatientA 10 5 + PatientB 11 6 + PatientC 12 7 + PatientA 14 5 + PatientC 15 7 + + Splitting the input into chunks can be done with awk: + + $ cat input.txt | datamash --full strbin 1 \ + | awk '{print > $NF ".txt"}' + + +File: datamash.info, Node: Reporting bugs, Next: GNU Free Documentation License, Prev: Usage Examples, Up: Top + +6 Reporting bugs **************** To report bugs, suggest enhancements or otherwise discuss GNU Datamash, @@ -849,83 +1498,242 @@ [index] * Menu: -* --field-separator: Invoking datamash. (line 101) -* --filler: Invoking datamash. (line 94) -* --full: Invoking datamash. (line 40) -* --group: Invoking datamash. (line 45) -* --header-in: Invoking datamash. (line 52) -* --header-out: Invoking datamash. (line 56) -* --headers: Invoking datamash. (line 65) -* --help: Invoking datamash. (line 116) -* --ignore-case: Invoking datamash. (line 71) -* --narm: Invoking datamash. (line 104) -* --no-strict: Invoking datamash. (line 89) -* --sort: Invoking datamash. (line 77) -* --version: Invoking datamash. (line 120) -* --whitespace: Invoking datamash. (line 108) -* --zero-terminated: Invoking datamash. (line 113) -* -f: Invoking datamash. (line 40) -* -g: Invoking datamash. (line 45) -* -H: Invoking datamash. (line 65) -* -i: Invoking datamash. (line 71) -* -s: Invoking datamash. (line 77) -* -t: Invoking datamash. (line 101) -* -W: Invoking datamash. (line 108) -* -z: Invoking datamash. (line 113) +* --field-separator: Invoking datamash. (line 106) +* --field-separator <1>: Groupby on /etc/passwd. + (line 39) +* --filler: Invoking datamash. (line 99) +* --filler <1>: Reverse and Transpose. + (line 45) +* --full: Invoking datamash. (line 45) +* --group: Invoking datamash. (line 50) +* --header-in: Invoking datamash. (line 57) +* --header-in <1>: Header Lines and Column Names. + (line 25) +* --header-out: Invoking datamash. (line 61) +* --header-out <1>: Header Lines and Column Names. + (line 6) +* --headers: Invoking datamash. (line 70) +* --headers <1>: Header Lines and Column Names. + (line 54) +* --help: Invoking datamash. (line 121) +* --ignore-case: Invoking datamash. (line 76) +* --narm: Invoking datamash. (line 109) +* --no-strict: Invoking datamash. (line 94) +* --no-strict <1>: Reverse and Transpose. + (line 40) +* --sort: Invoking datamash. (line 82) +* --version: Invoking datamash. (line 125) +* --whitespace: Invoking datamash. (line 113) +* --zero-terminated: Invoking datamash. (line 118) +* -f: Invoking datamash. (line 45) +* -g: Invoking datamash. (line 50) +* -H: Invoking datamash. (line 70) +* -H <1>: Header Lines and Column Names. + (line 54) +* -i: Invoking datamash. (line 76) +* -s: Invoking datamash. (line 82) +* -t: Invoking datamash. (line 106) +* -t <1>: Groupby on /etc/passwd. + (line 39) +* -W: Invoking datamash. (line 113) +* -z: Invoking datamash. (line 118) +* /etc/passwd, examples: Groupby on /etc/passwd. + (line 6) +* bin: Binning numbers. (line 6) +* binning numbers: Binning numbers. (line 6) +* binning strings: Binning strings. (line 6) +* buckets, binning numbers: Binning numbers. (line 6) +* buckets, binning strings: Binning strings. (line 6) * bug reporting: Reporting bugs. (line 6) +* ceil: Rounding numbers. (line 6) +* check: Check. (line 6) +* check, in automation and shell scripts: Check. (line 39) +* checking tabular structure: Check. (line 6) * checklist for bug reports: Reporting bugs. (line 9) +* collapse: Groupby on /etc/passwd. + (line 51) +* column names: Header Lines and Column Names. + (line 75) +* column ranges: Column Ranges. (line 6) +* columns, reverse: Reverse and Transpose. + (line 55) +* count: Crosstab. (line 15) +* count <1>: Groupby on /etc/passwd. + (line 42) +* count, crosstab and: Crosstab. (line 15) +* cross tabulation: Crosstab. (line 6) +* crosstab: Crosstab. (line 6) +* crosstab and sum: Crosstab. (line 29) +* crosstab and unique: Crosstab. (line 36) +* delimiters, tabs: Field Delimiters. (line 6) +* delimiters, whitespace: Field Delimiters. (line 6) * example, grouping: Overview. (line 30) * example, sorting: Overview. (line 30) * example, statistics: Overview. (line 48) -* file operations: Available Operations. - (line 7) +* example, sum: Overview. (line 12) +* examples, /etc/passwd: Groupby on /etc/passwd. + (line 6) +* examples, header: Header Lines and Column Names. + (line 6) +* examples, header <1>: Header Lines and Column Names. + (line 25) +* examples, header-in: Header Lines and Column Names. + (line 25) +* examples, header-out: Header Lines and Column Names. + (line 6) +* examples, headers: Header Lines and Column Names. + (line 54) +* examples, max: Summary Statistics. (line 29) +* examples, mean: Summary Statistics. (line 39) +* examples, median: Summary Statistics. (line 49) +* examples, min: Summary Statistics. (line 29) +* examples, quartiles: Summary Statistics. (line 49) +* examples, standard deviation: Summary Statistics. (line 39) +* examples, summary statistics: Summary Statistics. (line 6) +* examples, usage: Usage Examples. (line 6) +* fail fast: Check. (line 39) +* field delimiters: Field Delimiters. (line 6) +* field names: Header Lines and Column Names. + (line 75) +* floor: Rounding numbers. (line 6) +* frac: Rounding numbers. (line 6) +* groupby: Groupby on /etc/passwd. + (line 6) +* groupby, and collapse: Groupby on /etc/passwd. + (line 51) +* groupby, and count: Groupby on /etc/passwd. + (line 42) * grouping: Overview. (line 30) -* grouping <1>: Invoking datamash. (line 45) +* grouping <1>: Invoking datamash. (line 50) +* header, examples: Header Lines and Column Names. + (line 6) +* header-in, examples: Header Lines and Column Names. + (line 25) +* header-out, examples: Header Lines and Column Names. + (line 5) +* headers, examples: Header Lines and Column Names. + (line 54) * help: Invoking datamash. (line 6) +* input validation, transpose: Reverse and Transpose. + (line 23) * invoking: Invoking datamash. (line 6) +* line filtering operation: Available Operations. + (line 21) +* login shell, examples: Groupby on /etc/passwd. + (line 42) +* max, examples: Summary Statistics. (line 29) +* mean, examples: Summary Statistics. (line 39) +* median, examples: Summary Statistics. (line 49) +* min, examples: Summary Statistics. (line 29) +* missing values, transpose: Reverse and Transpose. + (line 45) +* multiple columns: Column Ranges. (line 6) * numeric operations: Available Operations. - (line 30) -* operations, file: Available Operations. - (line 7) + (line 42) +* operations, line filtering: Available Operations. + (line 21) * operations, numeric: Available Operations. - (line 30) + (line 42) * operations, per-line: Available Operations. - (line 14) + (line 26) +* operations, primary: Available Operations. + (line 7) * operations, statistical: Available Operations. - (line 60) + (line 72) * operations, statistical <1>: Statistical Operations. (line 6) * operations, textual: Available Operations. - (line 43) + (line 55) * options: Invoking datamash. (line 6) * overview: Overview. (line 6) * patches, contributing: Reporting bugs. (line 26) * Per-Line operations: Available Operations. - (line 14) + (line 26) +* pivot tables: Crosstab. (line 6) +* primary operations: Available Operations. + (line 7) * problems: Reporting bugs. (line 6) +* quartiles, examples: Summary Statistics. (line 49) +* ranges, columns: Column Ranges. (line 6) * reporting bugs: Reporting bugs. (line 6) +* reverse columns: Reverse and Transpose. + (line 55) +* reverse, and transpose: Reverse and Transpose. + (line 78) +* reverse, strict: Reverse and Transpose. + (line 71) +* reversing lines: Reverse and Transpose. + (line 78) +* round: Rounding numbers. (line 6) +* rounding numbers: Rounding numbers. (line 6) +* shell scripts, check: Check. (line 39) * sorting: Overview. (line 30) -* sorting <1>: Invoking datamash. (line 77) +* sorting <1>: Invoking datamash. (line 82) +* standard devian, examples: Summary Statistics. (line 39) * Statistical operations: Available Operations. - (line 60) + (line 72) * statistical operations: Statistical Operations. (line 5) * statistics: Statistical Operations. (line 6) +* strbin: Binning strings. (line 6) +* strict mode: Reverse and Transpose. + (line 23) +* strict, reverse: Reverse and Transpose. + (line 71) +* strict, transpose: Reverse and Transpose. + (line 40) +* sum: Crosstab. (line 29) +* sum, crosstab and: Crosstab. (line 29) +* summary statistics example: Summary Statistics. (line 6) +* swap rows, columns: Reverse and Transpose. + (line 9) +* tab delimiters: Field Delimiters. (line 6) +* tac: Reverse and Transpose. + (line 78) * Textual operations: Available Operations. - (line 43) + (line 55) +* transpose: Reverse and Transpose. + (line 9) +* transpose, and reverse: Reverse and Transpose. + (line 78) +* transpose, filler value: Reverse and Transpose. + (line 45) +* transpose, input validation: Reverse and Transpose. + (line 23) +* transpose, missing values: Reverse and Transpose. + (line 45) +* transpose, strict: Reverse and Transpose. + (line 40) +* trunc: Rounding numbers. (line 6) +* unique: Crosstab. (line 36) +* unique, crosstab and: Crosstab. (line 36) * usage: Invoking datamash. (line 6) +* usage examples: Usage Examples. (line 6) +* whitespace delimiters: Field Delimiters. (line 6)  Tag Table: -Node: Top761 -Node: Overview1376 -Node: Invoking datamash3468 -Node: Available Operations7388 -Node: Statistical Operations9957 -Node: Reporting bugs10512 -Node: GNU Free Documentation License11803 -Node: Concept index36961 +Node: Top754 +Node: Overview1413 +Node: Invoking datamash3302 +Node: Available Operations7435 +Node: Statistical Operations10376 +Node: Usage Examples10931 +Node: Summary Statistics11832 +Node: Header Lines and Column Names13906 +Node: Field Delimiters16886 +Node: Column Ranges18050 +Node: Reverse and Transpose18999 +Node: Groupby on /etc/passwd21866 +Node: Check24884 +Node: Crosstab26662 +Node: Rounding numbers27839 +Node: Binning numbers28867 +Node: Binning strings29328 +Node: Reporting bugs30173 +Node: GNU Free Documentation License31456 +Node: Concept index56614  End Tag Table diff -Nru datamash-1.0.7/doc/datamash.texi datamash-1.1.1/doc/datamash.texi --- datamash-1.0.7/doc/datamash.texi 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/doc/datamash.texi 2017-01-17 17:50:20.000000000 +0000 @@ -15,13 +15,13 @@ This manual is for GNU Datamash (version @value{VERSION}, @value{UPDATED}), which provides command-line computations on input files. -Copyright @copyright{} 2014-2015 Assaf Gordon. +Copyright @copyright{} 2014-2017 Assaf Gordon. @quotation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no -Invariant Sections, with no Front-Cover Texts, and with no Back-Cover +Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''. @end quotation @@ -60,50 +60,56 @@ * Invoking datamash:: How to run @command{datamash}. * Available Operations:: Available operations in @command{datamash}. * Statistical Operations:: Statistical operations in @command{datamash}. +* Usage Examples:: Usage Examples. * Reporting bugs:: Sending bug reports and feature suggestions. * GNU Free Documentation License:: Copying and sharing this documentation. * Concept index:: Index of concepts. -@end menu +@end menu + @node Overview @chapter Overview + + @cindex overview The @command{datamash} program (@url{http://www.gnu.org/software/datamash}) performs calculation (e.g. @emph{sum,}, @emph{count}, @emph{min}, @emph{max}, @emph{skewness}, @emph{standard deviation}) on input files. -A simple example: sum up the values in the first column of the input: + +Example: sum up the values in the first column of the input: @example +@cindex example, sum $ seq 10 | datamash sum 1 55 @end example @command{datamash} can group input data and perform operations on each group. -It can sort the file, and read header lines. An example: Finding the average -score in statistics course of college students, grouped by their college major: +It can sort the file, and read header lines. + +Example: Given a file with three fields (name, subject, score), +find the average score in each subject: @example -@exdent The input file has three fields: Name,Major,Score: $ cat scores.txt -Name Major Score +Name Subject Score Bryan Arts 68 Isaiah Arts 80 Gabriel Health-Medicine 100 Tysza Business 92 Zackery Engineering 54 ... -@exdent Sorting the input file and group by the second column (Major), then -@exdent calculating the mean score (third column) and sample-standard-deviation: + @cindex sorting @cindex grouping @cindex example, sorting @cindex example, grouping $ datamash --sort --headers --group 2 mean 3 sstdev 3 < scores.txt -GroupBy(Major) mean(Score) sstdev(Score) +GroupBy(Subject) mean(Score) sstdev(Score) Arts 68.9474 10.4215 Business 87.3636 5.18214 Engineering 66.5385 19.8814 @@ -112,7 +118,8 @@ Social-Sciences 60.2667 17.2273 @end example -@command{datamash} is designed for interactive exploration of textual data, + +@command{datamash} is designed for interactive exploration of textual data and for automating tasks in shell scripts. @command{datamash} has a rich set of statistical functions to quickly assess @@ -153,25 +160,32 @@ @exdent @command{datamash} supports the following operations: @table @asis -@item File operations: -@code{transpose}, @code{reverse} +@item Primary operations: +@code{groupby}, @code{crosstab}, @code{transpose}, @code{reverse}, +@code{check} + +@item Line-Filtering operations: +@code{rmdup} @item Per-Line operations: @code{base64}, @code{debase64}, @code{md5}, @code{sha1}, -@code{sha256}, @code{sha512} +@code{sha256}, @code{sha512}, @code{bin}, @code{strbin}, +@code{round}, @code{floor}, @code{ceil}, @code{trunc}, +@code{frac} -@item Numeric operations: +@item Group-by Numeric operations: @code{sum}, @code{min}, @code{max}, @code{absmin}, @code{absmax} -@item Textual/Numeric operations: +@item Group-by Textual/Numeric operations: @code{count}, @code{first}, @code{last}, @code{rand}, @code{unique}, @code{collapse}, @code{countunique} -@item Statistical operations: +@item Group-by Statistical operations: @code{mean}, @code{median}, @code{q1}, @code{q3}, @code{iqr}, @code{mode}, @code{antimode}, @code{pstdev}, @code{sstdev}, @code{pvar}, @code{svar}, @code{mad}, @code{madraw}, @code{sskew}, @code{pskew}, @code{skurt}, -@code{pkurt}, @code{jarque}, @code{dpo} +@code{pkurt}, @code{jarque}, @code{dpo}, +@code{scov}, @code{pcov}, @code{spearson}, @code{ppearson} @end table @@ -300,15 +314,30 @@ @chapter Available operations in @command{datamash} @table @asis -@item File operations: -@cindex file operations -@cindex operations, file +@item Primary operations: +@cindex primary operations +@cindex operations, primary @table @option +@item groupby +alternative syntax for @option{--group} +@item crosstab +cross-tabulate two fields (also known as 'pivot-tables') @item transpose transpose rows, columns of a text file @item reverse reverse fields in each line of a text file +@item check +verify tabular structure of input (ensure same number of fields in all lines) +@end table + +@item Line-Filtering operation: +@cindex line filtering operation +@cindex operations, line filtering + +@table @option +@item rmdup +remove lines with duplicated key value @end table @item Per-Line operations: @@ -331,7 +360,7 @@ calculates sha512 hash of the field @end table -@item Numeric operations: +@item Group-by Numeric operations: @cindex numeric operations @cindex operations, numeric @@ -348,7 +377,7 @@ maximum of the absolute values @end table -@item Textual/Numeric operations: +@item Group-By Textual/Numeric operations: @cindex Textual operations @cindex operations, textual @@ -369,7 +398,7 @@ number of unique/distinct values @end table -@item Statistical operations: +@item Group-By Statistical operations: @cindex Statistical operations @cindex operations, statistical @@ -434,6 +463,816 @@ operators are compared to known results of the equivalent R functions. + +@node Usage Examples +@chapter Usage Examples +@cindex usage examples +@cindex examples, usage + +@menu +* Summary Statistics:: count,min,max,mean,stdev,median,quartiles +* Header Lines and Column Names:: Using files with header lines +* Field Delimiters:: Tabs, Whitespace, other delimiteres +* Column Ranges:: Operating on multiple columns +* Reverse and Transpose:: swapping and transposing rows, columns +* Groupby on @file{/etc/passwd}:: Groupby, count, collapse +* Check:: Validate tabular structure +* Crosstab:: Cross-tabulation (pivot-tables) +* Rounding numbers:: round, ceil, floor, trunc, frac +* Binning numbers:: assigning numbers into fixed number of buckets +* Binning strings:: assigning strings into fixed number of buckets +@end menu + + +@node Summary Statistics +@section Summary Statistics +@cindex summary statistics example +@cindex examples, summary statistics + +The following are examples of using @command{datamash} to quickly +calculate summary statistics. The examples will use a file with three +fields (name, subject, score) representing grades of students: + +@example +$ cat scores.txt +Shawn Arts 65 +Marques Arts 58 +Fernando Arts 78 +Paul Arts 63 +Walter Arts 75 +... +@end example + +Counting how many students study each subject (@emph{subject} is the +second field in the input file, thus @option{groupby 2}): + +@example +$ datamash --sort groupby 2 @option{count} 2 < scores.txt +Arts 19 +Business 11 +Engineering 13 +Health-Medicine 13 +Life-Sciences 12 +Social-Sciences 15 +@end example + +@cindex min, examples +@cindex max, examples +@cindex examples, min +@cindex examples, max +Similary, find the minimum and maximum score in each subject: + +@example +$ datamash --sort groupby 2 @option{min} 3 @option{max} 3 < scores.txt +Arts 46 88 +Business 79 94 +Engineering 39 99 +Health-Medicine 72 100 +Life-Sciences 14 91 +Social-Sciences 27 90 +@end example + +@cindex mean, examples +@cindex standard devian, examples +@cindex examples, mean +@cindex examples, standard deviation +find the mean and (population) standard deviation in each subject: + +@example +$ datamash --sort groupby 2 @option{mean} 3 @option{pstdev} 3 < scores.txt +Arts 68.947 10.143 +Business 87.363 4.940 +Engineering 66.538 19.101 +Health-Medicine 90.615 8.862 +Life-Sciences 55.333 19.728 +Social-Sciences 60.266 16.643 +@end example + + +@cindex median, examples +@cindex examples, median +@cindex quartiles, examples +@cindex examples, quartiles +Find the median, first, third quariles and the inter-quartile range in +each subject: + +@example +$ datamash --sort groupby 2 @option{median} 3 @option{q1} 3 @option{q3} @ +3 @option{iqr} 3 < scores.txt +Arts 71 61.5 75.5 14 +Business 87 83 92 9 +Engineering 56 51 83 32 +Health-Medicine 91 84 100 16 +Life-Sciences 58.5 44.25 67.75 23.5 +Social-Sciences 62 55 70.5 15.5 +@end example + + +@xref{Header Lines and Column Names} for examples of dealing with +header lines. + +@node Header Lines and Column Names +@section Header Lines and Column Names + +@opindex --header-out +@cindex examples, header +@cindex examples, header-out +@cindex header, examples +@cindex header-out, examples +@unnumberedsubsec Output Header Lines + +If the input does @emph{not} have a header line, use +@option{--header-out} to add a header in the first line of the output, +indicating which operation was performed: + +@example +$ datamash --sort @option{--header-out} groupby 2 @option{min} @ +3 @option{max} 3 < scores.txt +GroupBy(field-2) min(field-3) max(field-3) +Arts 46 88 +Business 79 94 +Engineering 39 99 +Health-Medicine 72 100 +Life-Sciences 14 91 +Social-Sciences 27 90 +@end example + + +@unnumberedsubsec Skipping Input Header Lines + +@opindex --header-in +@cindex examples, header +@cindex examples, header-in +@cindex header-in, examples + +If the input has a header line (first line containing column names), +use @option{--header-in} to skip the line: + +@example +$ cat scores_h.txt +Name Major Score +Shawn Arts 65 +Marques Arts 58 +Fernando Arts 78 +Paul Arts 63 +... + + +$ datamash --sort @option{--header-in} groupby 2 mean 3 < scores_h.txt +Arts 68.947 +Business 87.363 +Engineering 66.538 +Health-Medicine 90.615 +Life-Sciences 55.333 +Social-Sciences 60.266 +@end example + +If the header line is not skipped, @command{datamash} will show an error +(due to strict input validation): + +@example +$ datamash groupby 2 mean 3 < scores_h.txt +datamash: invalid numeric value in line 1 field 3: 'Score' +@end example + + +@unnumberedsubsec Using Header Lines + +@opindex --headers +@opindex -H +@cindex examples, headers +@cindex headers, examples + +Column names in the input header lines can be printed +in the output header lines by using @option{--headers} +(or @option{-H}, both are equivalent to @option{--header-in --header-out}): + +@example +$ datamash --sort @option{--headers} groupby 2 mean 3 < scores_h.txt +GroupBy(Major) mean(Score) +Arts 68.947 +Business 87.363 +Engineering 66.538 +Health-Medicine 90.615 +Life-Sciences 55.333 +Social-Sciences 60.266 +@end example + +Or in short form (@option{-sH} instead of @option{--sort --headers}), +equivalent to the above command: + +@example +$ datamash @option{-sH} groupby 2 mean 3 +@end example + + +@unnumberedsubsec Column Names +@cindex column names +@cindex field names + +When the input file has a header line, column names can be used +instead of column numbers. In the example below, @var{Major} +is used instead of the value 2, and @var{Score} is used +instead of the value 3: + +@example +$ datamash --sort --headers groupby Major mean Score < scores_h.txt +GroupBy(Major) mean(Score) +Arts 68.947 +Business 87.363 +Engineering 66.538 +Health-Medicine 90.615 +Life-Sciences 55.333 +Social-Sciences 60.266 +@end example + +@command{datamash} will read the first line of the input, and deduce +the correct column number based on the given name. If the column name +is not found, an error will be printed: + +@example +$ datamash --sort --headers groupby 2 mean @option{Foo} < scores_h.txt +datamash: column name 'Foo' not found in input file +@end example + + + +@node Field Delimiters +@section Field Delimiteres +@cindex field delimiters +@cindex whitespace delimiters +@cindex delimiters, whitespace +@cindex tab delimiters +@cindex delimiters, tabs + +@command{datamash} uses tabs (ascii character 0x09) as default field +delimiters. Use @option{-W} to treat one or more consecutive +whitespace characters as field delimiters. Use @option{-t}, +@option{--field-separator} to set a custom field delimiter. + +The following examples illustrate the various options. + +By default, fields are deparated by a single tab tab. Multiple tabs +denotes multiple fields (this is consistent with GNU coreutil's +@command{cut}): + +@example +$ printf '1\t\t2\n' | datamash sum 3 +2 +$ printf '1\t\t2\n' | cut -f3 +2 +@end example + +Using @option{-W}, one or more consecutive whitespace characters +are treated as a single field delimiter: + +@example +$ printf '1 \t 2\n' | datamash -W sum 2 +2 +$ printf '1 \t 2\n' | datamash -W sum 3 +datamash: invalid input: field 3 requested, line 1 has only 2 fields +@end example + +Using @option{-t}, a custom field delimiter character can be specified. +Multiple consecutive delimiters are treated as multiple fields: + +@example +$ printf '1,10,,100\n' | datamash -t, sum 4 +100 +@end example + + + +@node Column Ranges +@section Column Ranges +@cindex column ranges +@cindex ranges, columns +@cindex multiple columns + +@command{datamash} accepts column ranges such as @var{1,2,3} and @var{1-3}. + + +Simulating input with multiple columns: + +@example +$ seq 100 | paste - - - - +1 2 3 4 +5 6 7 8 +9 10 11 12 +13 14 15 16 +17 18 19 20 +... +@end example + +The following are equivalent: + +@example +$ seq 100 | paste - - - - | datamash sum @option{1 sum 2 sum 3 sum 4} +1225 1250 1275 1300 + +$ seq 100 | paste - - - - | datamash sum @option{1,2,3,4} +1225 1250 1275 1300 + +$ seq 100 | paste - - - - | datamash sum @option{1-4} +1225 1250 1275 1300 + +$ seq 100 | paste - - - - | datamash sum @option{1-3,4} +1225 1250 1275 1300 +@end example + +Ranges can be used with multiple operations: + +@example +$ seq 100 | paste - - - - | datamash @option{sum 1-4 mean 1-4} +1225 1250 1275 1300 49 50 51 52 +@end example + + + + +@node Reverse and Transpose +@section Reverse and Transpose + +@unnumberedsubsec Transpose +@cindex transpose +@cindex swap rows, columns + +Use @option{transpose} to swap rows and columns in a file: + +@example +$ cat input.txt +Sample Year Count +A 2014 1002 +B 2013 990 +C 2014 2030 +D 2014 599 + +$ datamash @option{transpose} < input.txt +Sample A B C D +Year 2014 2013 2014 2014 +Count 1002 990 2030 599 +@end example + + +@cindex strict mode +@cindex input validation, transpose +@cindex transpose, input validation +By default, @option{transpose} verifies the input has the same number +of fields in each line, and fails with an error otherwise: + +@example +$ cat input.txt +Sample Year Count +A 2014 1002 +B 2013 +C 2014 2030 +D 2014 599 + + +$ datamash @option{transpose} < input1.txt +datamash: transpose input error: line 3 has 2 fields (previous lines had 3); +see --help to disable strict mode +@end example + +Use @option{--no-strict} to allow missing values: + +@opindex --no-strict +@cindex strict, transpose +@cindex transpose, strict +@example +$ datamash @option{--no-strict} transpose < input1.txt +Sample A B C D +Year 2014 2013 2014 2014 +Count 1002 N/A 2030 599 +@end example + +@opindex --filler +@cindex missing values, transpose +@cindex transpose, missing values +@cindex transpose, filler value +Use @option{--filler} to set the missing-field filler value: + +@example +$ datamash --no-strict @option{--filler XYZ} transpose < input1.txt +Sample A B C D +Year 2014 2013 2014 2014 +Count 1002 XYZ 2030 599 +@end example + + + +@unnumberedsubsec Reverse +@cindex reverse columns +@cindex columns, reverse + +Use @option{reverse} to reverse the fields order in a file: + +@example +$ cat input.txt +Sample Year Count +A 2014 1002 +B 2013 990 +C 2014 2030 +D 2014 599 + +$ datamash @option{reverse} < input.txt +Count Year Sample +1002 2014 A +990 2013 B +2030 2014 C +599 2014 D +@end example + +@cindex reverse, strict +@cindex strict, reverse +By default, reverse verifies the input has the same number of fields +in each line, and fails with an error otherwise. Use +@option{--no-strict} to disable this behaviour (see section +above for an example). + + + +@unnumberedsubsec Combining Reverse and Transpose + +@cindex tac +@cindex reversing lines +@cindex reverse, and transpose +@cindex transpose, and reverse +Reverse and Transpose can be combined to achieve various manipulations. +(reminder: @url{http://www.gnu.org/software/coreutils/tac,tac} can be +used to reverse lines in a file): + +@example +$ cat input.txt +A 1 xx +B 2 yy +C 3 zz + + +$ tac input.txt +C 3 zz +B 2 yy +A 1 xx + + +$ tac input.txt | datamash reverse +zz 3 C +yy 2 B +xx 1 A + + +$ cat input.txt | datamash reverse | datamash transpose +xx yy zz +1 2 3 +A B C + +$ tac input.txt | datamash reverse | datamash transpose +zz yy xx +3 2 1 +C B A +@end example + + + +@node Groupby on @file{/etc/passwd} +@section Groupby on @file{/etc/passwd} +@cindex groupby +@cindex @file{/etc/passwd}, examples +@cindex examples, @file{/etc/passwd} + +@command{datamash} with the @option{groupby} operation mode +can be used to aggregate information. + +Using this simuated @file{/etc/passwd} file as input: + +@example +$ cat passwd +root:x:0:0:root:/root:/bin/bash +daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin +bin:x:2:2:bin:/bin:/usr/sbin/nologin +sys:x:3:3:sys:/dev:/usr/sbin/nologin +sync:x:4:65534:sync:/bin:/bin/sync +games:x:5:60:games:/usr/games:/usr/sbin/nologin +man:x:6:12:man:/var/cache/man:/usr/sbin/nologin +lp:x:7:7:lp:/var/spool/lpd:/usr/sbin/nologin +mail:x:8:8:mail:/var/mail:/usr/sbin/nologin +news:x:9:9:news:/var/spool/news:/usr/sbin/nologin +uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin +proxy:x:13:13:proxy:/bin:/usr/sbin/nologin +www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin +backup:x:34:34:backup:/var/backups:/usr/sbin/nologin +list:x:38:38:Mailing List Manager:/var/list:/usr/sbin/nologin +mysql:x:115:124:MySQL Server,,,:/var/lib/mysql:/bin/false +sshd:x:116:65534::/var/run/sshd:/usr/sbin/nologin +guest:x:118:125:Guest,,,:/tmp/guest-home.phc17z:/bin/bash +gordon:x:1004:1000:Assaf Gordon,,,,:/home/gordon:/bin/bash +charles:x:1005:1000:Charles,,,,:/home/charles:/bin/bash +alice:x:1006:1000:Alice,,,,:/home/alice:/bin/bash +bob:x:1007:1000:Bob,,,,:/home/bob:/bin/bash +postgres:x:119:126:PostgreSQL administrator,,,:/var/lib/postgresql:/bin/bash +rabbitmq:x:125:138:RabbitMQ messaging server,,,:/var/lib/rabbitmq:/bin/false +redis:x:126:140:redis server,,,:/var/lib/redis:/bin/false +postfix:x:127:141::/var/spool/postfix:/bin/false +@end example + +@opindex -t +@opindex --field-separator +Parameter @option{-t} is used to indicate the field separator @var{:} +(instead of the default @var{tab}). + +@cindex groupby, and count +@cindex count +@cindex login shell, examples +Aggregate (@option{groupby}) login shells (column 7) and +@option{count} how many users use each: + +@example +$ datamash -t: --sort groupby 7 count 7 < passwd +/bin/bash:7 +/bin/false:4 +/bin/sync:1 +/usr/sbin/nologin:14 +@end example + +@cindex groupby, and collapse +@cindex collapse +Aggregate (@option{groupby}) login shells (column 7) and print +comma-separated list of users (column 1) for each shell +(@option{collapse}): + +@example +$ cat passwd | datamash -t: --sort groupby 7 collapse 1 +/bin/bash:root,guest,gordon,charles,alice,bob,postgres +/bin/false:mysql,rabbitmq,redis,postfix +/bin/sync:sync +/usr/sbin/nologin:daemon,bin,sys,games,man,lp,mail,news,uucp,proxy@ +,www-data,backup,list,sshd +@end example + +Aggregate unix-groups (column 4) and print +comma-separated list of users (column 1) for in each group: + +@example +$ datamash -t: --sort groupby 4 collapse 1 < /etc/passwd +0:root +1:daemon +10:uucp +1000:gordon,charles,alice,bob +12:man +124:mysql +125:guest +126:postgres +13:proxy +138:rabbitmq +140:redis +141:postfix +2:bin +3:sys +33:www-data +34:backup +38:list +60:games +65534:sync,sshd +7:lp +8:mail +9:news +@end example + + + +@node Check +@section Check - checking tabular structure +@cindex check +@cindex checking tabular structure + +@command{datamash} @option{check} validates the tabular structure of a +file, ensuring all lines have the same number of +fields. @option{check} is meant to be used in scripting and automation +pipelines, as it will terminate with non-zero exit code if the file is +not well structured, while also printing detailed context information +about the offending lines: + +@example +$ cat good.txt +A 1 ww +B 2 xx +C 3 yy +D 4 zz + + +$ cat bad.txt +A 1 ww +B 2 xx +C 3 +D 4 zz + + +$ datamash check < good.txt && echo ok || echo fail +4 lines, 3 fields +ok + + +$ datamash check < bad.txt && echo ok || echo fail +line 2 (3 fields): + B 2 xx +line 3 (2 fields): + C 3 +datamash: check failed: line 3 has 2 fields (previous line had 3) +fail +@end example + +@cindex fail fast +@cindex shell scripts, check +@cindex check, in automation and shell scripts +In pipeline/automation context, it is often beneficial to validate +files as early as possible (immediately after file is created, as in +@url{https://en.wikipedia.org/wiki/Fail-fast, fail-fast methodology}). +A typical usage in a shell script would be: + +@example +@verbatim +#!/bin/sh + +die() +{ + base=$(basename "$0") + echo "$base: error: $@" >&2 + exit 1 +} + +custom pipeline-or-program > output.txt \ + || die "program failed" + +datamash check < output.txt \ + || die "'output.txt' has invalid structure (missing fields)" +@end verbatim +@end example + +If the generated @file{output.txt} file has invalid structure +(i.e. missing fields), @command{datamash} will print the @file{stderr} +enough details to help in troubleshooting (line numbers and offending +line's content). + +@node Crosstab +@section Crosstab - Cross-Tabulation (pivot-tables) +@cindex crosstab +@cindex pivot tables +@cindex cross tabulation + +Cross-tabulation compares the relationship between two fields. +Given the following input file: + +@example +$ cat input.txt +a x 3 +a y 7 +b x 21 +a x 40 +@end example + +@opindex count +@cindex count, crosstab and +Show cross-tabulation between the first field (a/b) and the second +field (x/y) - counting how many times each pair appears (note: sorting +is required): + +@example +$ datamash -s crosstab 1,2 < input.txt + x y +a 2 1 +b 1 N/A +@end example + +The default operation is @option{count} - in the above example, +@var{a} and @var{x} appear twice in the input file, while @var{b} and @var{y} +never appear together. + +An optional grouping operation can be used instead of counting. + +@opindex sum +@cindex sum, crosstab and +@cindex crosstab and sum +For each pair, @option{sum} the values in the third column: + +@example +$ datamash -s crosstab 1,2 sum 3 < input.txt + x y +a 43 7 +b 21 N/A +@end example + +@opindex unique +@cindex unique, crosstab and +@cindex crosstab and unique +For each pair, list all @option{unique} values in the third column: + +@example +$ datamash -s crosstab 1,2 unique 3 < input.txt + x y +a 3,40 7 +b 21 N/A +@end example + + +@node Rounding numbers +@section Rounding numbers + +@cindex rounding numbers +@opindex round +@opindex ceil +@opindex floor +@opindex trunc +@opindex frac + +The following demonstrate the different rounding operations: + +@example +$ ( echo X ; seq -1.25 0.25 1.25 ) \ + | datamash --full -H round 1 ceil 1 floor 1 trunc 1 frac 1 + + X round(X) ceil(X) floor(X) trunc(X) frac(X) +-1.25 -1 -1 -2 -1 -0.25 +-1.00 -1 -1 -1 -1 0 +-0.75 -1 0 -1 0 -0.75 +-0.50 -1 0 -1 0 -0.5 +-0.25 0 0 -1 0 -0.25 + 0.00 0 0 0 0 0 + 0.25 0 1 0 0 0.25 + 0.50 1 1 0 0 0.5 + 0.75 1 1 0 0 0.75 + 1.00 1 1 1 1 0 + 1.25 1 2 1 1 0.25 +@end example + + +@node Binning numbers +@section Binning numbers +@opindex bin +@cindex buckets, binning numbers +@cindex binning numbers + +Bin input values into buckets of size 5: + +@example +$ ( echo X ; seq -10 2.5 10 ) \ + | datamash -H --full bin:5 1 + X bin(X) +-10.0 -15 + -7.5 -10 + -5.0 -10 + -2.5 -5 + 0.0 0 + 2.5 0 + 5.0 5 + 7.5 5 + 10.0 10 +@end example + +@node Binning strings +@section Binning strings +@opindex strbin +@cindex buckets, binning strings +@cindex binning strings + +Hash any string input value into a numeric integer. +A typical usage would be to split an input file +into @var{N} chunks, ensuring that all values of a certain key will +be stored in the same chunk: + +@example +$ cat input.txt +PatientA 10 +PatientB 11 +PatientC 12 +PatientA 14 +PatientC 15 +@end example + +Each patient ID is hashed into a bin between 0 and 9 +and printed in the last field: + +@example +$ datamash --full strbin 1 < input.txt +PatientA 10 5 +PatientB 11 6 +PatientC 12 7 +PatientA 14 5 +PatientC 15 7 +@end example + +Splitting the input into chunks can be done with awk: + +@example +@verbatim +$ cat input.txt | datamash --full strbin 1 \ + | awk '{print > $NF ".txt"}' +@end verbatim +@end example + + + + + @node Reporting bugs @chapter Reporting bugs diff -Nru datamash-1.0.7/doc/datamash-texinfo.css datamash-1.1.1/doc/datamash-texinfo.css --- datamash-1.0.7/doc/datamash-texinfo.css 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/doc/datamash-texinfo.css 2017-01-17 17:50:20.000000000 +0000 @@ -0,0 +1,234 @@ +/* +CSS for TexInfo/HTML files. + +Copyright (C) 2015-2017 Assaf Gordon (assafgordon@gmail.com) + +License: + GNU All Permissive License + http://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html + + Copying and distribution of this file, with or without modification, + are permitted in any medium without royalty provided the copyright + notice and this notice are preserved. This file is offered as-is, + without any warranty. + + +The used tags/classes were collected from a Texinfo-generated HTML using: + + cd coreutils + makeinfo --html --no-split -o coreutils.html doc/coreutils.texi + cat coreutils.html | sed 's/.*;>;g' \ + | grep '^<' | grep 'class=' | sort -u \ + | perl -lane 'm/<(\w+) .*class="([-\w]+)"/ ; print $1, "\t", $2' \ + | sort -u + +*/ +body { + font-family: sans-serif; + font-size: 16px; + margin: 1em; + + overflow-x: hidden; /* Coupled with the div.header trick, + this will extend the header lines + access the entire page width without causing + a horizontal scroll bar to appear. */ +} + + +a { + text-decoration: none; + outline-style: none; + color: blue; +} +a:visited { + color: rgb(16,0,112); +} +a:hover { + text-decoration: underline; +} + + +/***************************************************** + Titles / Headers +******************************************************/ + +/* @settitle: + The title of the document at the top of the document/header */ +h1.settitle { + color: rgb(51,70,131); + text-shadow: rgb(153,153,153) 1px 1px 0px; +} + +/* The title at the beginning of the document, before the @menu */ +h1.top { + color: rgb(51,70,131); + text-shadow: rgb(153,153,153) 1px 1px 0px; +} + +/* @chapter */ +h2.chapter { +} + +h2.appendix { } +h2.unnumbered { } + +/* @section */ +h3.section { +} +/* @unnumberedsec */ +h3.unnumberedsec { +} +/* @heading (seems to be only used in fdl.texi) */ +h3.heading { +} + +/* @subsection */ +h4.subsection { +} + + +/************************************************** + Short Contents (if @shortcontents command is used) +***************************************************/ +h2.shortcontents-heading { } +div.shortcontents { } +div.shortcontents ul { } +div.shortcontents ul li { } + + +/************************************************** + Contents (if @contents command is used) +***************************************************/ +h2.contents-heading { } +div.contents { } +div.contents ul { } +div.contents ul li { } + + +/* The @menu table */ +table.menu { } +pre.menu-comment {} + + + +/************************************ + @example and @verbatim +************************************/ +div.example { + margin-left: 2em; + margin-right: 2em; +} +div.example pre.example { + /* Round Corners */ + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + border: 1px solid #c0c0c0; + + padding: 1ex; + background-color: #f3f3f3; +} + +/* Note: @verbatim is also rendered inside a 'div.example' */ +div.example pre.verbatim { + /* Round Corners */ + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + border: 1px solid #c0c0c0; + + padding: 1ex; + background-color: #f3f3f3; +} + + + +/************************************ + @smallexample +************************************/ +div.smallexample { +} +div.smallexample pre.smallexample { +} + +/*********************************** + @display +***********************************/ +div.display { +} +div.display pre.display { +} + + + +/************************************** + @footnote +**************************************/ +div.footnote { } +h4.footnotes-heading { } + +/************************************** +The header at the top of each page / section +(the next/previous/top/up links) +**************************************/ +div.header { + padding-top: 0.5ex; + padding-bottom: 0.5ex; + background-color: #ddddff; + + /* This will extend the background color of the header + bar to the entire width of the page (and beyond), + requires 'overflow-x: hidden' in the 'body'. */ + padding-left: 3000px; + margin-left: -3000px; + padding-right: 3000px; + margin-right: -3000px; +} + +/* Disable any additional margins */ +div.header p { + margin: 0; +} +div.header p a { + color: blue; +} + + +/************************************** + @table is rendered as
(defnition list), + @item is rendered as
(definition term), + text is rendered as
(definition description) +**************************************/ +dl { + margin: 0 1em; +} +dl dt { + margin: 1em 0; +} +dl dd { + margin-left: 2em; +} + +/******************************************************* + Text Styles +*******************************************************/ + +/* @var{} */ +var { + color: #CC0000; +} + +/* @samp{} */ +samp { + color: #6600CC; +} + +/* @env{} will result in

X

*/ +p code { + color: #532c14; +} + +/* @option{} */ +span.nocodebreak { + color: #5D4C46; +} diff -Nru datamash-1.0.7/doc/local.mk datamash-1.1.1/doc/local.mk --- datamash-1.0.7/doc/local.mk 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/doc/local.mk 2017-01-17 17:50:20.000000000 +0000 @@ -7,7 +7,7 @@ # Software Foundation, Inc. # Modifications for GNU Datamash are -# Copyright (C) 2014-2015 Assaf Gordon +# Copyright (C) 2014-2017 Assaf Gordon # 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 @@ -23,6 +23,15 @@ # along with this program. If not, see . info_TEXINFOS = doc/datamash.texi +EXTRA_DIST += doc/datamash-texinfo.css + +# For the 'make html' target - generate a single HTML file +# and embed the CSS statements in it. +AM_MAKEINFOHTMLFLAGS = --no-split \ + --css-include=$(top_srcdir)/doc/datamash-texinfo.css + +# Changes to the CSS should trigger a new HTML regeneration +$(top_builddir)/doc/datamash.html: $(top_srcdir)/doc/datamash-texinfo.css doc_datamash_TEXINFOS = \ doc/fdl.texi diff -Nru datamash-1.0.7/doc/stamp-vti datamash-1.1.1/doc/stamp-vti --- datamash-1.0.7/doc/stamp-vti 2015-06-22 00:27:14.000000000 +0000 +++ datamash-1.1.1/doc/stamp-vti 2017-01-19 19:34:40.000000000 +0000 @@ -1,4 +1,4 @@ -@set UPDATED 14 June 2015 -@set UPDATED-MONTH June 2015 -@set EDITION 1.0.7 -@set VERSION 1.0.7 +@set UPDATED 17 January 2017 +@set UPDATED-MONTH January 2017 +@set EDITION 1.1.1 +@set VERSION 1.1.1 diff -Nru datamash-1.0.7/doc/version.texi datamash-1.1.1/doc/version.texi --- datamash-1.0.7/doc/version.texi 2015-06-22 00:27:14.000000000 +0000 +++ datamash-1.1.1/doc/version.texi 2017-01-19 19:34:40.000000000 +0000 @@ -1,4 +1,4 @@ -@set UPDATED 14 June 2015 -@set UPDATED-MONTH June 2015 -@set EDITION 1.0.7 -@set VERSION 1.0.7 +@set UPDATED 17 January 2017 +@set UPDATED-MONTH January 2017 +@set EDITION 1.1.1 +@set VERSION 1.1.1 diff -Nru datamash-1.0.7/GNUmakefile datamash-1.1.1/GNUmakefile --- datamash-1.0.7/GNUmakefile 2015-06-17 23:45:27.000000000 +0000 +++ datamash-1.1.1/GNUmakefile 2017-01-10 20:00:58.000000000 +0000 @@ -5,7 +5,7 @@ # It is necessary if you want to build targets usually of interest # only to the maintainer. -# Copyright (C) 2001, 2003, 2006-2015 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2006-2017 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/init.cfg datamash-1.1.1/init.cfg --- datamash-1.0.7/init.cfg 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/init.cfg 2017-01-17 17:50:20.000000000 +0000 @@ -7,7 +7,7 @@ # Copyright (C) 2010-2014 Free Software Foundation, Inc. # Modifications for GNU Datamash are -# Copyright (C) 2014-2015 Assaf Gordon +# Copyright (C) 2014-2017 Assaf Gordon # 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 diff -Nru datamash-1.0.7/INSTALL datamash-1.1.1/INSTALL --- datamash-1.0.7/INSTALL 2015-06-17 23:45:09.000000000 +0000 +++ datamash-1.1.1/INSTALL 2017-01-10 19:44:08.000000000 +0000 @@ -1,7 +1,7 @@ Installation Instructions ************************* - Copyright (C) 1994-1996, 1999-2002, 2004-2015 Free Software + Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, diff -Nru datamash-1.0.7/lib/alloca.in.h datamash-1.1.1/lib/alloca.in.h --- datamash-1.0.7/lib/alloca.in.h 2015-06-17 23:45:27.000000000 +0000 +++ datamash-1.1.1/lib/alloca.in.h 2017-01-10 20:00:58.000000000 +0000 @@ -1,6 +1,6 @@ /* Memory allocation on the stack. - Copyright (C) 1995, 1999, 2001-2004, 2006-2015 Free Software Foundation, + Copyright (C) 1995, 1999, 2001-2004, 2006-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it @@ -51,6 +51,8 @@ void *_alloca (unsigned short); # pragma intrinsic (_alloca) # define alloca _alloca +# elif defined __MVS__ +# include # else # include # ifdef __cplusplus diff -Nru datamash-1.0.7/lib/anytostr.c datamash-1.1.1/lib/anytostr.c --- datamash-1.0.7/lib/anytostr.c 2015-06-17 23:45:27.000000000 +0000 +++ datamash-1.1.1/lib/anytostr.c 2017-01-10 20:00:58.000000000 +0000 @@ -1,6 +1,6 @@ /* anytostr.c -- convert integers to printable strings - Copyright (C) 2001, 2006, 2008-2015 Free Software Foundation, Inc. + Copyright (C) 2001, 2006, 2008-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/assure.h datamash-1.1.1/lib/assure.h --- datamash-1.0.7/lib/assure.h 2015-06-17 23:45:27.000000000 +0000 +++ datamash-1.1.1/lib/assure.h 2017-01-10 20:00:58.000000000 +0000 @@ -1,6 +1,6 @@ /* Run-time assert-like macros. - Copyright (C) 2014-2015 Free Software Foundation, Inc. + Copyright (C) 2014-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/base64.c datamash-1.1.1/lib/base64.c --- datamash-1.0.7/lib/base64.c 2015-06-17 23:45:27.000000000 +0000 +++ datamash-1.1.1/lib/base64.c 2017-01-10 20:00:58.000000000 +0000 @@ -1,5 +1,5 @@ /* base64.c -- Encode binary data using printable characters. - Copyright (C) 1999-2001, 2004-2006, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 1999-2001, 2004-2006, 2009-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/base64.h datamash-1.1.1/lib/base64.h --- datamash-1.0.7/lib/base64.h 2015-06-17 23:45:27.000000000 +0000 +++ datamash-1.1.1/lib/base64.h 2017-01-10 20:00:58.000000000 +0000 @@ -1,5 +1,5 @@ /* base64.h -- Encode binary data using printable characters. - Copyright (C) 2004-2006, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2004-2006, 2009-2017 Free Software Foundation, Inc. Written by Simon Josefsson. This program is free software; you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/basename.c datamash-1.1.1/lib/basename.c --- datamash-1.0.7/lib/basename.c 2015-06-17 23:45:27.000000000 +0000 +++ datamash-1.1.1/lib/basename.c 2017-01-10 20:00:58.000000000 +0000 @@ -1,6 +1,6 @@ /* basename.c -- return the last element in a file name - Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2015 Free Software + Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/basename-lgpl.c datamash-1.1.1/lib/basename-lgpl.c --- datamash-1.0.7/lib/basename-lgpl.c 2015-06-17 23:45:27.000000000 +0000 +++ datamash-1.1.1/lib/basename-lgpl.c 2017-01-10 20:00:58.000000000 +0000 @@ -1,6 +1,6 @@ /* basename.c -- return the last element in a file name - Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2015 Free Software + Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/bitrotate.h datamash-1.1.1/lib/bitrotate.h --- datamash-1.0.7/lib/bitrotate.h 2015-06-17 23:45:27.000000000 +0000 +++ datamash-1.1.1/lib/bitrotate.h 2017-01-10 20:00:58.000000000 +0000 @@ -1,5 +1,5 @@ /* bitrotate.h - Rotate bits in integers - Copyright (C) 2008-2015 Free Software Foundation, Inc. + Copyright (C) 2008-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/calloc.c datamash-1.1.1/lib/calloc.c --- datamash-1.0.7/lib/calloc.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/calloc.c 2017-01-10 20:00:58.000000000 +0000 @@ -1,6 +1,6 @@ /* calloc() function that is glibc compatible. This wrapper function is required at least on Tru64 UNIX 5.1 and mingw. - Copyright (C) 2004-2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2004-2007, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/c-ctype.c datamash-1.1.1/lib/c-ctype.c --- datamash-1.0.7/lib/c-ctype.c 2015-06-17 23:45:27.000000000 +0000 +++ datamash-1.1.1/lib/c-ctype.c 2015-12-18 16:49:29.000000000 +0000 @@ -1,395 +1,3 @@ -/* Character handling in C locale. - - Copyright 2000-2003, 2006, 2009-2015 Free Software Foundation, Inc. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, see . */ - #include - -/* Specification. */ -#define NO_C_CTYPE_MACROS +#define C_CTYPE_INLINE _GL_EXTERN_INLINE #include "c-ctype.h" - -/* The function isascii is not locale dependent. Its use in EBCDIC is - questionable. */ -bool -c_isascii (int c) -{ - return (c >= 0x00 && c <= 0x7f); -} - -bool -c_isalnum (int c) -{ -#if C_CTYPE_CONSECUTIVE_DIGITS \ - && C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE -#if C_CTYPE_ASCII - return ((c >= '0' && c <= '9') - || ((c & ~0x20) >= 'A' && (c & ~0x20) <= 'Z')); -#else - return ((c >= '0' && c <= '9') - || (c >= 'A' && c <= 'Z') - || (c >= 'a' && c <= 'z')); -#endif -#else - switch (c) - { - case '0': case '1': case '2': case '3': case '4': case '5': - case '6': case '7': case '8': case '9': - case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': - case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': - case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': - case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': - case 'Y': case 'Z': - case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': - case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': - case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': - case 's': case 't': case 'u': case 'v': case 'w': case 'x': - case 'y': case 'z': - return 1; - default: - return 0; - } -#endif -} - -bool -c_isalpha (int c) -{ -#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE -#if C_CTYPE_ASCII - return ((c & ~0x20) >= 'A' && (c & ~0x20) <= 'Z'); -#else - return ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')); -#endif -#else - switch (c) - { - case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': - case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': - case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': - case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': - case 'Y': case 'Z': - case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': - case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': - case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': - case 's': case 't': case 'u': case 'v': case 'w': case 'x': - case 'y': case 'z': - return 1; - default: - return 0; - } -#endif -} - -bool -c_isblank (int c) -{ - return (c == ' ' || c == '\t'); -} - -bool -c_iscntrl (int c) -{ -#if C_CTYPE_ASCII - return ((c & ~0x1f) == 0 || c == 0x7f); -#else - switch (c) - { - case ' ': case '!': case '"': case '#': case '$': case '%': - case '&': case '\'': case '(': case ')': case '*': case '+': - case ',': case '-': case '.': case '/': - case '0': case '1': case '2': case '3': case '4': case '5': - case '6': case '7': case '8': case '9': - case ':': case ';': case '<': case '=': case '>': case '?': - case '@': - case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': - case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': - case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': - case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': - case 'Y': case 'Z': - case '[': case '\\': case ']': case '^': case '_': case '`': - case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': - case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': - case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': - case 's': case 't': case 'u': case 'v': case 'w': case 'x': - case 'y': case 'z': - case '{': case '|': case '}': case '~': - return 0; - default: - return 1; - } -#endif -} - -bool -c_isdigit (int c) -{ -#if C_CTYPE_CONSECUTIVE_DIGITS - return (c >= '0' && c <= '9'); -#else - switch (c) - { - case '0': case '1': case '2': case '3': case '4': case '5': - case '6': case '7': case '8': case '9': - return 1; - default: - return 0; - } -#endif -} - -bool -c_islower (int c) -{ -#if C_CTYPE_CONSECUTIVE_LOWERCASE - return (c >= 'a' && c <= 'z'); -#else - switch (c) - { - case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': - case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': - case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': - case 's': case 't': case 'u': case 'v': case 'w': case 'x': - case 'y': case 'z': - return 1; - default: - return 0; - } -#endif -} - -bool -c_isgraph (int c) -{ -#if C_CTYPE_ASCII - return (c >= '!' && c <= '~'); -#else - switch (c) - { - case '!': case '"': case '#': case '$': case '%': case '&': - case '\'': case '(': case ')': case '*': case '+': case ',': - case '-': case '.': case '/': - case '0': case '1': case '2': case '3': case '4': case '5': - case '6': case '7': case '8': case '9': - case ':': case ';': case '<': case '=': case '>': case '?': - case '@': - case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': - case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': - case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': - case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': - case 'Y': case 'Z': - case '[': case '\\': case ']': case '^': case '_': case '`': - case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': - case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': - case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': - case 's': case 't': case 'u': case 'v': case 'w': case 'x': - case 'y': case 'z': - case '{': case '|': case '}': case '~': - return 1; - default: - return 0; - } -#endif -} - -bool -c_isprint (int c) -{ -#if C_CTYPE_ASCII - return (c >= ' ' && c <= '~'); -#else - switch (c) - { - case ' ': case '!': case '"': case '#': case '$': case '%': - case '&': case '\'': case '(': case ')': case '*': case '+': - case ',': case '-': case '.': case '/': - case '0': case '1': case '2': case '3': case '4': case '5': - case '6': case '7': case '8': case '9': - case ':': case ';': case '<': case '=': case '>': case '?': - case '@': - case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': - case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': - case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': - case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': - case 'Y': case 'Z': - case '[': case '\\': case ']': case '^': case '_': case '`': - case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': - case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': - case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': - case 's': case 't': case 'u': case 'v': case 'w': case 'x': - case 'y': case 'z': - case '{': case '|': case '}': case '~': - return 1; - default: - return 0; - } -#endif -} - -bool -c_ispunct (int c) -{ -#if C_CTYPE_ASCII - return ((c >= '!' && c <= '~') - && !((c >= '0' && c <= '9') - || ((c & ~0x20) >= 'A' && (c & ~0x20) <= 'Z'))); -#else - switch (c) - { - case '!': case '"': case '#': case '$': case '%': case '&': - case '\'': case '(': case ')': case '*': case '+': case ',': - case '-': case '.': case '/': - case ':': case ';': case '<': case '=': case '>': case '?': - case '@': - case '[': case '\\': case ']': case '^': case '_': case '`': - case '{': case '|': case '}': case '~': - return 1; - default: - return 0; - } -#endif -} - -bool -c_isspace (int c) -{ - return (c == ' ' || c == '\t' - || c == '\n' || c == '\v' || c == '\f' || c == '\r'); -} - -bool -c_isupper (int c) -{ -#if C_CTYPE_CONSECUTIVE_UPPERCASE - return (c >= 'A' && c <= 'Z'); -#else - switch (c) - { - case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': - case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': - case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': - case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': - case 'Y': case 'Z': - return 1; - default: - return 0; - } -#endif -} - -bool -c_isxdigit (int c) -{ -#if C_CTYPE_CONSECUTIVE_DIGITS \ - && C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE -#if C_CTYPE_ASCII - return ((c >= '0' && c <= '9') - || ((c & ~0x20) >= 'A' && (c & ~0x20) <= 'F')); -#else - return ((c >= '0' && c <= '9') - || (c >= 'A' && c <= 'F') - || (c >= 'a' && c <= 'f')); -#endif -#else - switch (c) - { - case '0': case '1': case '2': case '3': case '4': case '5': - case '6': case '7': case '8': case '9': - case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': - case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': - return 1; - default: - return 0; - } -#endif -} - -int -c_tolower (int c) -{ -#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE - return (c >= 'A' && c <= 'Z' ? c - 'A' + 'a' : c); -#else - switch (c) - { - case 'A': return 'a'; - case 'B': return 'b'; - case 'C': return 'c'; - case 'D': return 'd'; - case 'E': return 'e'; - case 'F': return 'f'; - case 'G': return 'g'; - case 'H': return 'h'; - case 'I': return 'i'; - case 'J': return 'j'; - case 'K': return 'k'; - case 'L': return 'l'; - case 'M': return 'm'; - case 'N': return 'n'; - case 'O': return 'o'; - case 'P': return 'p'; - case 'Q': return 'q'; - case 'R': return 'r'; - case 'S': return 's'; - case 'T': return 't'; - case 'U': return 'u'; - case 'V': return 'v'; - case 'W': return 'w'; - case 'X': return 'x'; - case 'Y': return 'y'; - case 'Z': return 'z'; - default: return c; - } -#endif -} - -int -c_toupper (int c) -{ -#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE - return (c >= 'a' && c <= 'z' ? c - 'a' + 'A' : c); -#else - switch (c) - { - case 'a': return 'A'; - case 'b': return 'B'; - case 'c': return 'C'; - case 'd': return 'D'; - case 'e': return 'E'; - case 'f': return 'F'; - case 'g': return 'G'; - case 'h': return 'H'; - case 'i': return 'I'; - case 'j': return 'J'; - case 'k': return 'K'; - case 'l': return 'L'; - case 'm': return 'M'; - case 'n': return 'N'; - case 'o': return 'O'; - case 'p': return 'P'; - case 'q': return 'Q'; - case 'r': return 'R'; - case 's': return 'S'; - case 't': return 'T'; - case 'u': return 'U'; - case 'v': return 'V'; - case 'w': return 'W'; - case 'x': return 'X'; - case 'y': return 'Y'; - case 'z': return 'Z'; - default: return c; - } -#endif -} diff -Nru datamash-1.0.7/lib/c-ctype.h datamash-1.1.1/lib/c-ctype.h --- datamash-1.0.7/lib/c-ctype.h 2015-06-17 23:45:27.000000000 +0000 +++ datamash-1.1.1/lib/c-ctype.h 2017-01-10 20:00:58.000000000 +0000 @@ -5,7 +5,7 @@ functions' behaviour depends on the current locale set via setlocale. - Copyright (C) 2000-2003, 2006, 2008-2015 Free Software Foundation, Inc. + Copyright (C) 2000-2003, 2006, 2008-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,6 +25,13 @@ #include +#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 extern "C" { @@ -39,38 +46,6 @@ characters. */ -/* Check whether the ASCII optimizations apply. */ - -/* ANSI C89 (and ISO C99 5.2.1.3 too) already guarantees that - '0', '1', ..., '9' have consecutive integer values. */ -#define C_CTYPE_CONSECUTIVE_DIGITS 1 - -#if ('A' <= 'Z') \ - && ('A' + 1 == 'B') && ('B' + 1 == 'C') && ('C' + 1 == 'D') \ - && ('D' + 1 == 'E') && ('E' + 1 == 'F') && ('F' + 1 == 'G') \ - && ('G' + 1 == 'H') && ('H' + 1 == 'I') && ('I' + 1 == 'J') \ - && ('J' + 1 == 'K') && ('K' + 1 == 'L') && ('L' + 1 == 'M') \ - && ('M' + 1 == 'N') && ('N' + 1 == 'O') && ('O' + 1 == 'P') \ - && ('P' + 1 == 'Q') && ('Q' + 1 == 'R') && ('R' + 1 == 'S') \ - && ('S' + 1 == 'T') && ('T' + 1 == 'U') && ('U' + 1 == 'V') \ - && ('V' + 1 == 'W') && ('W' + 1 == 'X') && ('X' + 1 == 'Y') \ - && ('Y' + 1 == 'Z') -#define C_CTYPE_CONSECUTIVE_UPPERCASE 1 -#endif - -#if ('a' <= 'z') \ - && ('a' + 1 == 'b') && ('b' + 1 == 'c') && ('c' + 1 == 'd') \ - && ('d' + 1 == 'e') && ('e' + 1 == 'f') && ('f' + 1 == 'g') \ - && ('g' + 1 == 'h') && ('h' + 1 == 'i') && ('i' + 1 == 'j') \ - && ('j' + 1 == 'k') && ('k' + 1 == 'l') && ('l' + 1 == 'm') \ - && ('m' + 1 == 'n') && ('n' + 1 == 'o') && ('o' + 1 == 'p') \ - && ('p' + 1 == 'q') && ('q' + 1 == 'r') && ('r' + 1 == 's') \ - && ('s' + 1 == 't') && ('t' + 1 == 'u') && ('u' + 1 == 'v') \ - && ('v' + 1 == 'w') && ('w' + 1 == 'x') && ('x' + 1 == 'y') \ - && ('y' + 1 == 'z') -#define C_CTYPE_CONSECUTIVE_LOWERCASE 1 -#endif - #if (' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ @@ -96,11 +71,84 @@ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126) /* The character set is ASCII or one of its variants or extensions, not EBCDIC. Testing the value of '\n' and '\r' is not relevant. */ -#define C_CTYPE_ASCII 1 +# 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 +#if 'A' < 0 +# error "EBCDIC and char is signed -- not supported" +#endif + +/* 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 declarations. */ +/* Function definitions. */ /* Unlike the functions in , which require an argument in the range of the 'unsigned char' type, the functions here operate on values that are @@ -117,179 +165,202 @@ if (c_isalpha (*s)) ... */ -extern bool c_isascii (int c) _GL_ATTRIBUTE_CONST; /* not locale dependent */ - -extern bool c_isalnum (int c) _GL_ATTRIBUTE_CONST; -extern bool c_isalpha (int c) _GL_ATTRIBUTE_CONST; -extern bool c_isblank (int c) _GL_ATTRIBUTE_CONST; -extern bool c_iscntrl (int c) _GL_ATTRIBUTE_CONST; -extern bool c_isdigit (int c) _GL_ATTRIBUTE_CONST; -extern bool c_islower (int c) _GL_ATTRIBUTE_CONST; -extern bool c_isgraph (int c) _GL_ATTRIBUTE_CONST; -extern bool c_isprint (int c) _GL_ATTRIBUTE_CONST; -extern bool c_ispunct (int c) _GL_ATTRIBUTE_CONST; -extern bool c_isspace (int c) _GL_ATTRIBUTE_CONST; -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; -extern int c_toupper (int c) _GL_ATTRIBUTE_CONST; - - -#if (defined __GNUC__ && !defined __STRICT_ANSI__ && defined __OPTIMIZE__ \ - && !defined __OPTIMIZE_SIZE__ && !defined NO_C_CTYPE_MACROS) - -/* ASCII optimizations. */ - -#undef c_isascii -#define c_isascii(c) \ - ({ int __c = (c); \ - (__c >= 0x00 && __c <= 0x7f); \ - }) +C_CTYPE_INLINE bool +c_isalnum (int c) +{ + switch (c) + { + _C_CTYPE_DIGIT: + _C_CTYPE_LOWER: + _C_CTYPE_UPPER: + return true; + default: + return false; + } +} -#if C_CTYPE_CONSECUTIVE_DIGITS \ - && C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE -#if C_CTYPE_ASCII -#undef c_isalnum -#define c_isalnum(c) \ - ({ int __c = (c); \ - ((__c >= '0' && __c <= '9') \ - || ((__c & ~0x20) >= 'A' && (__c & ~0x20) <= 'Z')); \ - }) -#else -#undef c_isalnum -#define c_isalnum(c) \ - ({ int __c = (c); \ - ((__c >= '0' && __c <= '9') \ - || (__c >= 'A' && __c <= 'Z') \ - || (__c >= 'a' && __c <= 'z')); \ - }) -#endif -#endif +C_CTYPE_INLINE bool +c_isalpha (int c) +{ + switch (c) + { + _C_CTYPE_LOWER: + _C_CTYPE_UPPER: + return true; + default: + return false; + } +} -#if C_CTYPE_CONSECUTIVE_UPPERCASE && C_CTYPE_CONSECUTIVE_LOWERCASE -#if C_CTYPE_ASCII -#undef c_isalpha -#define c_isalpha(c) \ - ({ int __c = (c); \ - ((__c & ~0x20) >= 'A' && (__c & ~0x20) <= 'Z'); \ - }) -#else -#undef c_isalpha -#define c_isalpha(c) \ - ({ int __c = (c); \ - ((__c >= 'A' && __c <= 'Z') || (__c >= 'a' && __c <= 'z')); \ - }) -#endif -#endif +/* The function isascii is not locale dependent. + 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; + } +} -#undef c_isblank -#define c_isblank(c) \ - ({ int __c = (c); \ - (__c == ' ' || __c == '\t'); \ - }) +C_CTYPE_INLINE bool +c_isblank (int c) +{ + return c == ' ' || c == '\t'; +} -#if C_CTYPE_ASCII -#undef c_iscntrl -#define c_iscntrl(c) \ - ({ int __c = (c); \ - ((__c & ~0x1f) == 0 || __c == 0x7f); \ - }) -#endif +C_CTYPE_INLINE bool +c_iscntrl (int c) +{ + switch (c) + { + _C_CTYPE_CNTRL: + return true; + default: + return false; + } +} -#if C_CTYPE_CONSECUTIVE_DIGITS -#undef c_isdigit -#define c_isdigit(c) \ - ({ int __c = (c); \ - (__c >= '0' && __c <= '9'); \ - }) -#endif +C_CTYPE_INLINE bool +c_isdigit (int c) +{ + switch (c) + { + _C_CTYPE_DIGIT: + return true; + default: + return false; + } +} -#if C_CTYPE_CONSECUTIVE_LOWERCASE -#undef c_islower -#define c_islower(c) \ - ({ int __c = (c); \ - (__c >= 'a' && __c <= 'z'); \ - }) -#endif +C_CTYPE_INLINE bool +c_isgraph (int c) +{ + switch (c) + { + _C_CTYPE_DIGIT: + _C_CTYPE_LOWER: + _C_CTYPE_PUNCT: + _C_CTYPE_UPPER: + return true; + default: + return false; + } +} -#if C_CTYPE_ASCII -#undef c_isgraph -#define c_isgraph(c) \ - ({ int __c = (c); \ - (__c >= '!' && __c <= '~'); \ - }) -#endif +C_CTYPE_INLINE bool +c_islower (int c) +{ + switch (c) + { + _C_CTYPE_LOWER: + return true; + default: + return false; + } +} -#if C_CTYPE_ASCII -#undef c_isprint -#define c_isprint(c) \ - ({ int __c = (c); \ - (__c >= ' ' && __c <= '~'); \ - }) -#endif +C_CTYPE_INLINE bool +c_isprint (int c) +{ + switch (c) + { + case ' ': + _C_CTYPE_DIGIT: + _C_CTYPE_LOWER: + _C_CTYPE_PUNCT: + _C_CTYPE_UPPER: + return true; + default: + return false; + } +} -#if C_CTYPE_ASCII -#undef c_ispunct -#define c_ispunct(c) \ - ({ int _c = (c); \ - (c_isgraph (_c) && ! c_isalnum (_c)); \ - }) -#endif +C_CTYPE_INLINE bool +c_ispunct (int c) +{ + switch (c) + { + _C_CTYPE_PUNCT: + return true; + default: + return false; + } +} -#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 +C_CTYPE_INLINE bool +c_isspace (int c) +{ + switch (c) + { + case ' ': case '\t': case '\n': case '\v': case '\f': case '\r': + return true; + default: + return false; + } +} -#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 +C_CTYPE_INLINE bool +c_isupper (int c) +{ + switch (c) + { + _C_CTYPE_UPPER: + return true; + default: + return false; + } +} -#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 +C_CTYPE_INLINE bool +c_isxdigit (int c) +{ + switch (c) + { + _C_CTYPE_DIGIT: + _C_CTYPE_A_THRU_F: + return true; + default: + return false; + } +} -#endif /* optimizing for speed */ +C_CTYPE_INLINE int +c_tolower (int c) +{ + switch (c) + { + _C_CTYPE_UPPER: + return c - 'A' + 'a'; + default: + return c; + } +} +C_CTYPE_INLINE int +c_toupper (int c) +{ + switch (c) + { + _C_CTYPE_LOWER: + return c - 'a' + 'A'; + default: + return c; + } +} #ifdef __cplusplus } #endif +_GL_INLINE_HEADER_END + #endif /* C_CTYPE_H */ diff -Nru datamash-1.0.7/lib/ceil.c datamash-1.1.1/lib/ceil.c --- datamash-1.0.7/lib/ceil.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/lib/ceil.c 2017-01-10 20:00:58.000000000 +0000 @@ -0,0 +1,117 @@ +/* Round towards positive infinity. + Copyright (C) 2007, 2010-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Bruno Haible , 2007. */ + +#if ! defined USE_LONG_DOUBLE +# include +#endif + +/* Specification. */ +#include + +#include + +#undef MIN + +#ifdef USE_LONG_DOUBLE +# define FUNC ceill +# define DOUBLE long double +# define MANT_DIG LDBL_MANT_DIG +# define MIN LDBL_MIN +# define L_(literal) literal##L +#elif ! defined USE_FLOAT +# define FUNC ceil +# define DOUBLE double +# define MANT_DIG DBL_MANT_DIG +# define MIN DBL_MIN +# define L_(literal) literal +#else /* defined USE_FLOAT */ +# define FUNC ceilf +# define DOUBLE float +# define MANT_DIG FLT_MANT_DIG +# define MIN FLT_MIN +# define L_(literal) literal##f +#endif + +/* -0.0. See minus-zero.h. */ +#if defined __hpux || defined __sgi || defined __ICC +# define MINUS_ZERO (-MIN * MIN) +#else +# define MINUS_ZERO L_(-0.0) +#endif + +/* MSVC with option -fp:strict refuses to compile constant initializers that + contain floating-point operations. Pacify this compiler. */ +#ifdef _MSC_VER +# pragma fenv_access (off) +#endif + +/* 2^(MANT_DIG-1). */ +static const DOUBLE TWO_MANT_DIG = + /* Assume MANT_DIG <= 5 * 31. + Use the identity + n = floor(n/5) + floor((n+1)/5) + ... + floor((n+4)/5). */ + (DOUBLE) (1U << ((MANT_DIG - 1) / 5)) + * (DOUBLE) (1U << ((MANT_DIG - 1 + 1) / 5)) + * (DOUBLE) (1U << ((MANT_DIG - 1 + 2) / 5)) + * (DOUBLE) (1U << ((MANT_DIG - 1 + 3) / 5)) + * (DOUBLE) (1U << ((MANT_DIG - 1 + 4) / 5)); + +DOUBLE +FUNC (DOUBLE x) +{ + /* The use of 'volatile' guarantees that excess precision bits are dropped + at each addition step and before the following comparison at the caller's + site. It is necessary on x86 systems where double-floats are not IEEE + compliant by default, to avoid that the results become platform and compiler + option dependent. 'volatile' is a portable alternative to gcc's + -ffloat-store option. */ + volatile DOUBLE y = x; + volatile DOUBLE z = y; + + if (z > L_(0.0)) + { + /* Avoid rounding errors for values near 2^k, where k >= MANT_DIG-1. */ + if (z < TWO_MANT_DIG) + { + /* Round to the next integer (nearest or up or down, doesn't matter). */ + z += TWO_MANT_DIG; + z -= TWO_MANT_DIG; + /* Enforce rounding up. */ + if (z < y) + z += L_(1.0); + } + } + else if (z < L_(0.0)) + { + /* For -1 < x < 0, return -0.0 regardless of the current rounding + mode. */ + if (z > L_(-1.0)) + z = MINUS_ZERO; + /* Avoid rounding errors for values near -2^k, where k >= MANT_DIG-1. */ + else if (z > - TWO_MANT_DIG) + { + /* Round to the next integer (nearest or up or down, doesn't matter). */ + z -= TWO_MANT_DIG; + z += TWO_MANT_DIG; + /* Enforce rounding up. */ + if (z < y) + z += L_(1.0); + } + } + return z; +} diff -Nru datamash-1.0.7/lib/ceill.c datamash-1.1.1/lib/ceill.c --- datamash-1.0.7/lib/ceill.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/lib/ceill.c 2017-01-10 20:00:58.000000000 +0000 @@ -0,0 +1,37 @@ +/* Round towards positive infinity. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Bruno Haible , 2007. */ + +#include + +#if HAVE_SAME_LONG_DOUBLE_AS_DOUBLE + +/* Specification. */ +# include + +long double +ceill (long double x) +{ + return ceil (x); +} + +#else + +# define USE_LONG_DOUBLE +# include "ceil.c" + +#endif diff -Nru datamash-1.0.7/lib/closeout.c datamash-1.1.1/lib/closeout.c --- datamash-1.0.7/lib/closeout.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/closeout.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,6 +1,6 @@ /* Close standard output and standard error, exiting with a diagnostic on error. - Copyright (C) 1998-2002, 2004, 2006, 2008-2015 Free Software Foundation, + Copyright (C) 1998-2002, 2004, 2006, 2008-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/closeout.h datamash-1.1.1/lib/closeout.h --- datamash-1.0.7/lib/closeout.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/closeout.h 2017-01-10 20:00:59.000000000 +0000 @@ -1,6 +1,6 @@ /* Close standard output and standard error. - Copyright (C) 1998, 2000, 2003-2004, 2006, 2008-2015 Free Software + Copyright (C) 1998, 2000, 2003-2004, 2006, 2008-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/close-stream.c datamash-1.1.1/lib/close-stream.c --- datamash-1.0.7/lib/close-stream.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/close-stream.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,6 +1,6 @@ /* Close a stream, with nicer error checking than fclose's. - Copyright (C) 1998-2002, 2004, 2006-2015 Free Software Foundation, Inc. + Copyright (C) 1998-2002, 2004, 2006-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/config.charset datamash-1.1.1/lib/config.charset --- datamash-1.0.7/lib/config.charset 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/config.charset 2017-01-10 20:00:59.000000000 +0000 @@ -1,7 +1,7 @@ #! /bin/sh # Output a system dependent table of character encoding aliases. # -# Copyright (C) 2000-2004, 2006-2015 Free Software Foundation, Inc. +# Copyright (C) 2000-2004, 2006-2017 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/c-strcasecmp.c datamash-1.1.1/lib/c-strcasecmp.c --- datamash-1.0.7/lib/c-strcasecmp.c 2015-06-17 23:45:27.000000000 +0000 +++ datamash-1.1.1/lib/c-strcasecmp.c 2017-01-10 20:00:58.000000000 +0000 @@ -1,5 +1,5 @@ /* c-strcasecmp.c -- case insensitive string comparator in C locale - Copyright (C) 1998-1999, 2005-2006, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 1998-1999, 2005-2006, 2009-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/c-strcaseeq.h datamash-1.1.1/lib/c-strcaseeq.h --- datamash-1.0.7/lib/c-strcaseeq.h 2015-06-17 23:45:27.000000000 +0000 +++ datamash-1.1.1/lib/c-strcaseeq.h 2017-01-10 20:00:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Optimized case-insensitive string comparison in C locale. - Copyright (C) 2001-2002, 2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2007, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published @@ -33,9 +33,6 @@ # if C_CTYPE_ASCII # define CASEEQ(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 # define CASEEQ(other,upper) \ (c_toupper (other) == (upper)) diff -Nru datamash-1.0.7/lib/c-strcase.h datamash-1.1.1/lib/c-strcase.h --- datamash-1.0.7/lib/c-strcase.h 2015-06-17 23:45:27.000000000 +0000 +++ datamash-1.1.1/lib/c-strcase.h 2017-01-10 20:00:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Case-insensitive string comparison functions in C locale. - Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2015 Free Software + Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/c-strncasecmp.c datamash-1.1.1/lib/c-strncasecmp.c --- datamash-1.0.7/lib/c-strncasecmp.c 2015-06-17 23:45:27.000000000 +0000 +++ datamash-1.1.1/lib/c-strncasecmp.c 2017-01-10 20:00:58.000000000 +0000 @@ -1,5 +1,5 @@ /* c-strncasecmp.c -- case insensitive string comparator in C locale - Copyright (C) 1998-1999, 2005-2006, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 1998-1999, 2005-2006, 2009-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/ctype.in.h datamash-1.1.1/lib/ctype.in.h --- datamash-1.0.7/lib/ctype.in.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/ctype.in.h 2017-01-10 20:00:59.000000000 +0000 @@ -1,6 +1,6 @@ /* A substitute for ISO C99 , for platforms on which it is incomplete. - Copyright (C) 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2009-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/dirname.c datamash-1.1.1/lib/dirname.c --- datamash-1.0.7/lib/dirname.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/dirname.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,6 +1,6 @@ /* dirname.c -- return all but the last element in a file name - Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2015 Free Software + Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/dirname.h datamash-1.1.1/lib/dirname.h --- datamash-1.0.7/lib/dirname.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/dirname.h 2017-01-10 20:00:59.000000000 +0000 @@ -1,6 +1,6 @@ /* Take file names apart into directory and base names. - Copyright (C) 1998, 2001, 2003-2006, 2009-2015 Free Software Foundation, + Copyright (C) 1998, 2001, 2003-2006, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/dirname-lgpl.c datamash-1.1.1/lib/dirname-lgpl.c --- datamash-1.0.7/lib/dirname-lgpl.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/dirname-lgpl.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,6 +1,6 @@ /* dirname.c -- return all but the last element in a file name - Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2015 Free Software + Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/dosname.h datamash-1.1.1/lib/dosname.h --- datamash-1.0.7/lib/dosname.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/dosname.h 2017-01-10 20:00:59.000000000 +0000 @@ -1,6 +1,6 @@ /* File names on MS-DOS/Windows systems. - Copyright (C) 2000-2001, 2004-2006, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2000-2001, 2004-2006, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/errno.in.h datamash-1.1.1/lib/errno.in.h --- datamash-1.0.7/lib/errno.in.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/errno.in.h 2017-01-10 20:00:59.000000000 +0000 @@ -1,6 +1,6 @@ /* A POSIX-like . - Copyright (C) 2008-2015 Free Software Foundation, Inc. + Copyright (C) 2008-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/error.c datamash-1.1.1/lib/error.c --- datamash-1.0.7/lib/error.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/error.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Error handler for noninteractive utilities - Copyright (C) 1990-1998, 2000-2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 1990-1998, 2000-2007, 2009-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify @@ -42,6 +42,8 @@ # define USE_UNLOCKED_IO 0 # define _GL_ATTRIBUTE_FORMAT_PRINTF(a, b) # define _GL_ARG_NONNULL(a) +#else +# include "getprogname.h" #endif #if USE_UNLOCKED_IO @@ -113,9 +115,7 @@ # endif # endif -/* The calling program should define program_name and set it to the - name of the executing program. */ -extern char *program_name; +#define program_name getprogname () # if HAVE_STRERROR_R || defined strerror_r # define __strerror_r strerror_r @@ -379,10 +379,10 @@ } #if _LIBC - __fxprintf (NULL, file_name != NULL ? "%s:%d: " : " ", + __fxprintf (NULL, file_name != NULL ? "%s:%u: " : " ", file_name, line_number); #else - fprintf (stderr, file_name != NULL ? "%s:%d: " : " ", + fprintf (stderr, file_name != NULL ? "%s:%u: " : " ", file_name, line_number); #endif diff -Nru datamash-1.0.7/lib/error.h datamash-1.1.1/lib/error.h --- datamash-1.0.7/lib/error.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/error.h 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Declaration for error-reporting function - Copyright (C) 1995-1997, 2003, 2006, 2008-2015 Free Software Foundation, + Copyright (C) 1995-1997, 2003, 2006, 2008-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. diff -Nru datamash-1.0.7/lib/exitfail.c datamash-1.1.1/lib/exitfail.c --- datamash-1.0.7/lib/exitfail.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/exitfail.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,6 +1,6 @@ /* Failure exit status - Copyright (C) 2002-2003, 2005-2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2005-2007, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/exitfail.h datamash-1.1.1/lib/exitfail.h --- datamash-1.0.7/lib/exitfail.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/exitfail.h 2017-01-10 20:00:59.000000000 +0000 @@ -1,6 +1,6 @@ /* Failure exit status - Copyright (C) 2002, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2002, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/expl.c datamash-1.1.1/lib/expl.c --- datamash-1.0.7/lib/expl.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/expl.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Exponential function. - Copyright (C) 2011-2015 Free Software Foundation, Inc. + Copyright (C) 2011-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/expl-table.c datamash-1.1.1/lib/expl-table.c --- datamash-1.0.7/lib/expl-table.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/expl-table.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Exponential function. - Copyright (C) 2011-2015 Free Software Foundation, Inc. + Copyright (C) 2011-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/fabsl.c datamash-1.1.1/lib/fabsl.c --- datamash-1.0.7/lib/fabsl.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/fabsl.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Absolute value. - Copyright (C) 2012-2015 Free Software Foundation, Inc. + Copyright (C) 2012-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/float.c datamash-1.1.1/lib/float.c --- datamash-1.0.7/lib/float.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/float.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Auxiliary definitions for . - Copyright (C) 2011-2015 Free Software Foundation, Inc. + Copyright (C) 2011-2017 Free Software Foundation, Inc. Written by Bruno Haible , 2011. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/float+.h datamash-1.1.1/lib/float+.h --- datamash-1.0.7/lib/float+.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/float+.h 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Supplemental information about the floating-point formats. - Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. Written by Bruno Haible , 2007. This program is free software; you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/float.in.h datamash-1.1.1/lib/float.in.h --- datamash-1.0.7/lib/float.in.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/float.in.h 2017-01-10 20:00:59.000000000 +0000 @@ -1,6 +1,6 @@ /* A correct . - Copyright (C) 2007-2015 Free Software Foundation, Inc. + Copyright (C) 2007-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/floor.c datamash-1.1.1/lib/floor.c --- datamash-1.0.7/lib/floor.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/floor.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Round towards negative infinity. - Copyright (C) 2007, 2010-2015 Free Software Foundation, Inc. + Copyright (C) 2007, 2010-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/floorl.c datamash-1.1.1/lib/floorl.c --- datamash-1.0.7/lib/floorl.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/lib/floorl.c 2017-01-10 20:00:59.000000000 +0000 @@ -0,0 +1,37 @@ +/* Round towards negative infinity. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Bruno Haible , 2007. */ + +#include + +#if HAVE_SAME_LONG_DOUBLE_AS_DOUBLE + +/* Specification. */ +# include + +long double +floorl (long double x) +{ + return floor (x); +} + +#else + +# define USE_LONG_DOUBLE +# include "floor.c" + +#endif diff -Nru datamash-1.0.7/lib/fpending.c datamash-1.1.1/lib/fpending.c --- datamash-1.0.7/lib/fpending.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/fpending.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* fpending.c -- return the number of pending output bytes on a stream - Copyright (C) 2000, 2004, 2006-2007, 2009-2015 Free Software Foundation, + Copyright (C) 2000, 2004, 2006-2007, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -19,12 +19,42 @@ #include +/* Specification. */ #include "fpending.h" +#include "stdio-impl.h" + /* Return the number of pending (aka buffered, unflushed) bytes on the stream, FP, that is open for writing. */ size_t __fpending (FILE *fp) { - return PENDING_OUTPUT_N_BYTES; + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + return fp->_IO_write_ptr - fp->_IO_write_base; +#elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ + return fp->_p - fp->_bf._base; +#elif defined __EMX__ /* emx+gcc */ + return fp->_ptr - fp->_buffer; +#elif defined __minix /* Minix */ + return fp_->_ptr - fp_->_buf; +#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel */ + return (fp_->_ptr ? fp_->_ptr - fp_->_base : 0); +#elif defined __UCLIBC__ /* uClibc */ + return (fp->__modeflags & __FLAG_WRITING ? fp->__bufpos - fp->__bufstart : 0); +#elif defined __QNX__ /* QNX */ + return (fp->_Mode & 0x2000 /*_MWRITE*/ ? fp->_Next - fp->_Buf : 0); +#elif defined __MINT__ /* Atari FreeMiNT */ + return fp->__bufp - fp->__buffer; +#elif defined EPLAN9 /* Plan9 */ + return fp->wp - fp->buf; +#elif defined __VMS /* VMS */ + return (*fp)->_ptr - (*fp)->_base; +#else +# error "Please port gnulib fpending.c to your platform!" + return 1; +#endif } diff -Nru datamash-1.0.7/lib/fpending.h datamash-1.1.1/lib/fpending.h --- datamash-1.0.7/lib/fpending.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/fpending.h 2017-01-10 20:00:59.000000000 +0000 @@ -1,6 +1,6 @@ /* Declare __fpending. - Copyright (C) 2000, 2003, 2005-2006, 2009-2015 Free Software Foundation, + Copyright (C) 2000, 2003, 2005-2006, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/fpucw.h datamash-1.1.1/lib/fpucw.h --- datamash-1.0.7/lib/fpucw.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/fpucw.h 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ -/* Manipulating the FPU control word. - Copyright (C) 2007-2015 Free Software Foundation, Inc. +/* Manipulating the FPU control word. -*- coding: utf-8 -*- + Copyright (C) 2007-2017 Free Software Foundation, Inc. Written by Bruno Haible , 2007. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/frexp.c datamash-1.1.1/lib/frexp.c --- datamash-1.0.7/lib/frexp.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/frexp.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Split a double into fraction and mantissa. - Copyright (C) 2007-2015 Free Software Foundation, Inc. + Copyright (C) 2007-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/frexpl.c datamash-1.1.1/lib/frexpl.c --- datamash-1.0.7/lib/frexpl.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/frexpl.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Split a 'long double' into fraction and mantissa. - Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/getopt1.c datamash-1.1.1/lib/getopt1.c --- datamash-1.0.7/lib/getopt1.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/getopt1.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright (C) 1987-1994, 1996-1998, 2004, 2006, 2009-2015 Free Software + Copyright (C) 1987-1994, 1996-1998, 2004, 2006, 2009-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. diff -Nru datamash-1.0.7/lib/getopt.c datamash-1.1.1/lib/getopt.c --- datamash-1.0.7/lib/getopt.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/getopt.c 2017-01-10 20:00:59.000000000 +0000 @@ -2,7 +2,7 @@ NOTE: getopt is part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to drepper@gnu.org before changing it! - Copyright (C) 1987-1996, 1998-2004, 2006, 2008-2015 Free Software + Copyright (C) 1987-1996, 1998-2004, 2006, 2008-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. diff -Nru datamash-1.0.7/lib/getopt.in.h datamash-1.1.1/lib/getopt.in.h --- datamash-1.0.7/lib/getopt.in.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/getopt.in.h 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Declarations for getopt. - Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2007, 2009-2015 Free Software + Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2007, 2009-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -47,15 +47,20 @@ identifiers so that they do not collide with the system functions and variables. Renaming avoids problems with some compilers and linkers. */ -#if defined __GETOPT_PREFIX && !defined __need_getopt -# if !@HAVE_GETOPT_H@ -# define __need_system_stdlib_h -# include -# undef __need_system_stdlib_h -# include -# include +#if defined __GETOPT_PREFIX +# if !defined __need_getopt +# if !@HAVE_GETOPT_H@ +# define __need_system_stdlib_h +# include +# undef __need_system_stdlib_h +# include +# include +# endif +# undef __need_getopt # endif -# undef __need_getopt +# undef __GETOPT_CONCAT +# undef __GETOPT_XCONCAT +# undef __GETOPT_ID # undef getopt # undef getopt_long # undef getopt_long_only @@ -64,6 +69,7 @@ # undef optind # undef optopt # undef option +# undef _getopt_internal # define __GETOPT_CONCAT(x, y) x ## y # define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y) # define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y) diff -Nru datamash-1.0.7/lib/getopt_int.h datamash-1.1.1/lib/getopt_int.h --- datamash-1.0.7/lib/getopt_int.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/getopt_int.h 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Internal declarations for getopt. - Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2004, 2009-2015 Free Software + Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2004, 2009-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. diff -Nru datamash-1.0.7/lib/getprogname.c datamash-1.1.1/lib/getprogname.c --- datamash-1.0.7/lib/getprogname.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/lib/getprogname.c 2017-01-10 20:00:58.000000000 +0000 @@ -0,0 +1,185 @@ +/* Program name management. + Copyright (C) 2016-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include "getprogname.h" + +#include /* get program_invocation_name declaration */ +#include /* get __argv declaration */ + +#ifdef _AIX +# include +# include +# include +#endif + +#ifdef __MVS__ +# ifndef _OPEN_SYS +# define _OPEN_SYS +# endif +# include +# include +#endif + +#ifdef __hpux +# include +# include +# include +# include +#endif + +#ifdef __sgi +# include +# include +# include +# include +# include +#endif + +#include "dirname.h" + +#ifndef HAVE_GETPROGNAME /* not Mac OS X, FreeBSD, NetBSD, OpenBSD >= 5.4, Cygwin */ +char const * +getprogname (void) +{ +# if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME /* glibc, BeOS */ + /* https://www.gnu.org/software/libc/manual/html_node/Error-Messages.html */ + return program_invocation_short_name; +# elif HAVE_DECL_PROGRAM_INVOCATION_NAME /* glibc, BeOS */ + /* https://www.gnu.org/software/libc/manual/html_node/Error-Messages.html */ + return last_component (program_invocation_name); +# elif HAVE_GETEXECNAME /* Solaris */ + /* http://docs.oracle.com/cd/E19253-01/816-5168/6mbb3hrb1/index.html */ + const char *p = getexecname (); + if (!p) + p = "?"; + return last_component (p); +# elif HAVE_DECL___ARGV /* mingw, MSVC */ + /* https://msdn.microsoft.com/en-us/library/dn727674.aspx */ + const char *p = __argv && __argv[0] ? __argv[0] : "?"; + return last_component (p); +# elif HAVE_VAR___PROGNAME /* OpenBSD, QNX */ + /* http://man.openbsd.org/style.9 */ + /* http://www.qnx.de/developers/docs/6.5.0/index.jsp?topic=%2Fcom.qnx.doc.neutrino_lib_ref%2Fp%2F__progname.html */ + /* Be careful to declare this only when we absolutely need it + (OpenBSD 5.1), rather than when it's available. Otherwise, + its mere declaration makes program_invocation_short_name + malfunction (have zero length) with Fedora 25's glibc. */ + extern char *__progname; + const char *p = __progname; + return p && p[0] ? p : "?"; +# elif _AIX /* AIX */ + /* Idea by Bastien ROUCARIÈS, + http://lists.gnu.org/archive/html/bug-gnulib/2010-12/msg00095.html + Reference: http:// + ibm.biz/knowctr#ssw_aix_53/com.ibm.aix.basetechref/doc/basetrf1/getprocs.htm + */ + static char *p; + static int first = 1; + if (first) + { + first = 0; + pid_t pid = getpid (); + struct procentry64 procs; + p = (0 < getprocs64 (&procs, sizeof procs, NULL, 0, &pid, 1) + ? strdup (procs.pi_comm) + : NULL); + if (!p) + p = "?"; + } + return p; +# elif defined __hpux + static char *p; + static int first = 1; + if (first) + { + first = 0; + pid_t pid = getpid (); + struct pst_status status; + p = (0 < pstat_getproc (&status, sizeof status, 0, pid) + ? strdup (status.pst_ucomm) + : NULL); + if (!p) + p = "?"; + } + return p; +# elif __MVS__ /* z/OS */ + /* https://www.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.bpxbd00/rtwgetp.htm */ + static char *p = "?"; + static int first = 1; + if (first) + { + pid_t pid = getpid (); + int token; + W_PSPROC buf; + first = 0; + memset (&buf, 0, sizeof(buf)); + buf.ps_cmdptr = (char *) malloc (buf.ps_cmdlen = PS_CMDBLEN_LONG); + buf.ps_conttyptr = (char *) malloc (buf.ps_conttylen = PS_CONTTYBLEN); + buf.ps_pathptr = (char *) malloc (buf.ps_pathlen = PS_PATHBLEN); + if (buf.ps_cmdptr && buf.ps_conttyptr && buf.ps_pathptr) + { + for (token = 0; token >= 0; + token = w_getpsent (token, &buf, sizeof(buf))) + { + if (token > 0 && buf.ps_pid == pid) + { + char *s = strdup (last_component (buf.ps_pathptr)); + if (s) + p = s; + break; + } + } + } + free (buf.ps_cmdptr); + free (buf.ps_conttyptr); + free (buf.ps_pathptr); + } + return p; +# elif defined __sgi /* IRIX */ + char filename[50]; + int fd; + + sprintf (filename, "/proc/pinfo/%d", (int) getpid ()); + fd = open (filename, O_RDONLY); + if (0 <= fd) + { + prpsinfo_t buf; + int ioctl_ok = 0 <= ioctl (fd, PIOCPSINFO, &buf); + close (fd); + if (ioctl_ok) + { + char *name = buf.pr_fname; + char *namesize = sizeof buf.pr_fname; + char *namenul = memchr (name, '\0', namesize); + size_t namelen = namenul ? namenul - name : namesize; + char *namecopy = malloc (namelen + 1); + if (namecopy) + { + namecopy[namelen] = 0; + return memcpy (namecopy, name, namelen); + } + } + } + return NULL; +# else +# error "getprogname module not ported to this OS" +# endif +} + +#endif diff -Nru datamash-1.0.7/lib/getprogname.h datamash-1.1.1/lib/getprogname.h --- datamash-1.0.7/lib/getprogname.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/lib/getprogname.h 2017-01-10 20:00:58.000000000 +0000 @@ -0,0 +1,40 @@ +/* Program name management. + Copyright (C) 2016-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef _GL_GETPROGNAME_H +#define _GL_GETPROGNAME_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Return the base name of the executing program. + On native Windows this will usually end in ".exe" or ".EXE". */ +#ifndef HAVE_GETPROGNAME +extern char const *getprogname (void) +# ifdef HAVE_DECL_PROGRAM_INVOCATION_NAME + _GL_ATTRIBUTE_PURE +# endif + ; +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff -Nru datamash-1.0.7/lib/gettext.h datamash-1.1.1/lib/gettext.h --- datamash-1.0.7/lib/gettext.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/gettext.h 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Convenience header for conditional use of GNU . - Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2015 Free Software + Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -225,15 +225,17 @@ if (msg_ctxt_id != NULL) #endif { + int found_translation; memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); msg_ctxt_id[msgctxt_len - 1] = '\004'; memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); translation = dcgettext (domain, msg_ctxt_id, category); + found_translation = (translation != msg_ctxt_id); #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS if (msg_ctxt_id != buf) free (msg_ctxt_id); #endif - if (translation != msg_ctxt_id) + if (found_translation) return translation; } return msgid; @@ -271,15 +273,17 @@ if (msg_ctxt_id != NULL) #endif { + int found_translation; memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); msg_ctxt_id[msgctxt_len - 1] = '\004'; memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); + found_translation = !(translation == msg_ctxt_id || translation == msgid_plural); #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS if (msg_ctxt_id != buf) free (msg_ctxt_id); #endif - if (!(translation == msg_ctxt_id || translation == msgid_plural)) + if (found_translation) return translation; } return (n == 1 ? msgid : msgid_plural); diff -Nru datamash-1.0.7/lib/gl_openssl.h datamash-1.1.1/lib/gl_openssl.h --- datamash-1.0.7/lib/gl_openssl.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/gl_openssl.h 2017-01-10 20:00:59.000000000 +0000 @@ -1,6 +1,6 @@ -/* gl_openssl.h -- wrap openssl crypto hash routines in gnulib interface +/* Wrap openssl crypto hash routines in gnulib interface. -*- coding: utf-8 -*- - Copyright (C) 2013-2015 Free Software Foundation, Inc. + Copyright (C) 2013-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/gnulib.mk datamash-1.1.1/lib/gnulib.mk --- datamash-1.0.7/lib/gnulib.mk 2015-06-22 00:26:06.000000000 +0000 +++ datamash-1.1.1/lib/gnulib.mk 2017-01-19 19:33:53.000000000 +0000 @@ -1,6 +1,6 @@ ## DO NOT EDIT! GENERATED AUTOMATICALLY! ## Process this file with automake to produce Makefile.in. -# Copyright (C) 2002-2015 Free Software Foundation, Inc. +# Copyright (C) 2002-2017 Free Software Foundation, Inc. # # 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 @@ -21,7 +21,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl --lib=libdatamash --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --makefile-name=gnulib.mk --no-conditional-dependencies --no-libtool --macro-prefix=gl announce-gen assert base64 calloc-gnu closeout configmake crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dirname do-release-commit-and-tag error expl extensions fabsl fdl gendocs getopt-gnu gettext git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload hard-locale hash hash-pjw ignore-value intprops inttostr inttypes isblank isnanl linebuffer locale localeconv maintainer-makefile mbsrtowcs minmax non-recursive-gnulib-prefix-hack progname propername random readme-release realloc-gnu size_max sqrtl stdint stdnoreturn strsep unlocked-io version-etc warnings xalloc xstrndup xstrtol xstrtoumax +# Reproduce by: gnulib-tool --import --local-dir=gl --lib=libdatamash --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --makefile-name=gnulib.mk --no-conditional-dependencies --no-libtool --macro-prefix=gl announce-gen assert base64 c-ctype calloc-gnu ceill closeout configmake crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dirname do-release-commit-and-tag error expl extensions fabsl fdl floorl fpucw gendocs getopt-gnu gettext git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload hard-locale hash hash-pjw hash-pjw-bare ignore-value intprops inttostr inttypes isblank isnanl linebuffer locale localeconv maintainer-makefile mbsrtowcs minmax modfl non-recursive-gnulib-prefix-hack pmccabe2html progname propername random readme-release realloc-gnu roundl size_max sqrtl stdint stdnoreturn stpcpy strsep unlocked-io update-copyright version-etc warnings xalloc xstrndup xstrtol xstrtoumax MOSTLYCLEANFILES += lib/core lib/*.stackdump @@ -128,6 +128,24 @@ ## end gnulib module calloc-posix +## begin gnulib module ceil + + +EXTRA_DIST += lib/ceil.c + +EXTRA_lib_libdatamash_a_SOURCES += lib/ceil.c + +## end gnulib module ceil + +## begin gnulib module ceill + + +EXTRA_DIST += lib/ceil.c lib/ceill.c + +EXTRA_lib_libdatamash_a_SOURCES += lib/ceil.c lib/ceill.c + +## end gnulib module ceill + ## begin gnulib module close-stream lib_libdatamash_a_SOURCES += lib/close-stream.c @@ -389,10 +407,19 @@ ## end gnulib module floor +## begin gnulib module floorl + + +EXTRA_DIST += lib/floor.c lib/floorl.c + +EXTRA_lib_libdatamash_a_SOURCES += lib/floor.c lib/floorl.c + +## end gnulib module floorl + ## begin gnulib module fpending -EXTRA_DIST += lib/fpending.c lib/fpending.h +EXTRA_DIST += lib/fpending.c lib/fpending.h lib/stdio-impl.h EXTRA_lib_libdatamash_a_SOURCES += lib/fpending.c @@ -457,6 +484,12 @@ ## end gnulib module getopt-posix +## begin gnulib module getprogname + +lib_libdatamash_a_SOURCES += lib/getprogname.h lib/getprogname.c + +## end gnulib module getprogname + ## begin gnulib module gettext # If your project uses "gettextize --intl" to put a source-code @@ -521,6 +554,9 @@ ## begin gnulib module 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 @@ -546,6 +582,12 @@ ## end gnulib module hash-pjw +## begin gnulib module hash-pjw-bare + +lib_libdatamash_a_SOURCES += lib/hash-pjw-bare.h lib/hash-pjw-bare.c + +## end gnulib module hash-pjw-bare + ## begin gnulib module havelib @@ -592,19 +634,19 @@ ## begin gnulib module iconv_open lib/iconv_open-aix.h: lib/iconv_open-aix.gperf - $(GPERF) -m 10 $(top_srcdir)/lib/iconv_open-aix.gperf > $(top_srcdir)/lib/iconv_open-aix.h-t + $(V_GPERF)$(GPERF) -m 10 $(top_srcdir)/lib/iconv_open-aix.gperf > $(top_srcdir)/lib/iconv_open-aix.h-t && \ mv $(top_srcdir)/lib/iconv_open-aix.h-t $(top_srcdir)/lib/iconv_open-aix.h lib/iconv_open-hpux.h: lib/iconv_open-hpux.gperf - $(GPERF) -m 10 $(top_srcdir)/lib/iconv_open-hpux.gperf > $(top_srcdir)/lib/iconv_open-hpux.h-t + $(V_GPERF)$(GPERF) -m 10 $(top_srcdir)/lib/iconv_open-hpux.gperf > $(top_srcdir)/lib/iconv_open-hpux.h-t && \ mv $(top_srcdir)/lib/iconv_open-hpux.h-t $(top_srcdir)/lib/iconv_open-hpux.h lib/iconv_open-irix.h: lib/iconv_open-irix.gperf - $(GPERF) -m 10 $(top_srcdir)/lib/iconv_open-irix.gperf > $(top_srcdir)/lib/iconv_open-irix.h-t + $(V_GPERF)$(GPERF) -m 10 $(top_srcdir)/lib/iconv_open-irix.gperf > $(top_srcdir)/lib/iconv_open-irix.h-t && \ mv $(top_srcdir)/lib/iconv_open-irix.h-t $(top_srcdir)/lib/iconv_open-irix.h lib/iconv_open-osf.h: lib/iconv_open-osf.gperf - $(GPERF) -m 10 $(top_srcdir)/lib/iconv_open-osf.gperf > $(top_srcdir)/lib/iconv_open-osf.h-t + $(V_GPERF)$(GPERF) -m 10 $(top_srcdir)/lib/iconv_open-osf.gperf > $(top_srcdir)/lib/iconv_open-osf.h-t && \ mv $(top_srcdir)/lib/iconv_open-osf.h-t $(top_srcdir)/lib/iconv_open-osf.h lib/iconv_open-solaris.h: lib/iconv_open-solaris.gperf - $(GPERF) -m 10 $(top_srcdir)/lib/iconv_open-solaris.gperf > $(top_srcdir)/lib/iconv_open-solaris.h-t + $(V_GPERF)$(GPERF) -m 10 $(top_srcdir)/lib/iconv_open-solaris.gperf > $(top_srcdir)/lib/iconv_open-solaris.h-t && \ mv $(top_srcdir)/lib/iconv_open-solaris.h-t $(top_srcdir)/lib/iconv_open-solaris.h BUILT_SOURCES += lib/iconv_open-aix.h lib/iconv_open-hpux.h lib/iconv_open-irix.h lib/iconv_open-osf.h lib/iconv_open-solaris.h MOSTLYCLEANFILES += lib/iconv_open-aix.h-t lib/iconv_open-hpux.h-t lib/iconv_open-irix.h-t lib/iconv_open-osf.h-t lib/iconv_open-solaris.h-t @@ -633,12 +675,7 @@ ## begin gnulib module inttostr -lib_libdatamash_a_SOURCES += \ - lib/imaxtostr.c \ - lib/inttostr.c \ - lib/offtostr.c \ - lib/uinttostr.c \ - lib/umaxtostr.c +lib_libdatamash_a_SOURCES += lib/imaxtostr.c lib/inttostr.c lib/offtostr.c lib/uinttostr.c lib/umaxtostr.c EXTRA_DIST += lib/anytostr.c lib/inttostr.h @@ -700,6 +737,24 @@ ## end gnulib module isblank +## begin gnulib module isfinite + + +EXTRA_DIST += lib/isfinite.c + +EXTRA_lib_libdatamash_a_SOURCES += lib/isfinite.c + +## end gnulib module isfinite + +## begin gnulib module isinf + + +EXTRA_DIST += lib/isinf.c + +EXTRA_lib_libdatamash_a_SOURCES += lib/isinf.c + +## end gnulib module isinf + ## begin gnulib module isnand-nolibm @@ -754,6 +809,34 @@ ## end gnulib module ldexpl +## begin gnulib module limits-h + +BUILT_SOURCES += $(LIMITS_H) + +# We need the following in order to create when the system +# doesn't have one that is compatible with GNU. +if GL_GENERATE_LIMITS_H +lib/limits.h: lib/limits.in.h $(top_builddir)/config.status + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_LIMITS_H''@|$(NEXT_LIMITS_H)|g' \ + < $(top_srcdir)/lib/limits.in.h; \ + } > $@-t && \ + mv $@-t $@ +else +lib/limits.h: $(top_builddir)/config.status + rm -f $@ +endif +MOSTLYCLEANFILES += lib/limits.h lib/limits.h-t + +EXTRA_DIST += lib/limits.in.h + +## end gnulib module limits-h + ## begin gnulib module linebuffer lib_libdatamash_a_SOURCES += lib/linebuffer.h lib/linebuffer.c @@ -1110,11 +1193,18 @@ -e 's|@''HAVE_DECL_TRUNCF''@|$(HAVE_DECL_TRUNCF)|g' \ -e 's|@''HAVE_DECL_TRUNCL''@|$(HAVE_DECL_TRUNCL)|g' \ | \ - sed -e 's|@''REPLACE_CBRTF''@|$(REPLACE_CBRTF)|g' \ + sed -e 's|@''REPLACE_ACOSF''@|$(REPLACE_ACOSF)|g' \ + -e 's|@''REPLACE_ASINF''@|$(REPLACE_ASINF)|g' \ + -e 's|@''REPLACE_ATANF''@|$(REPLACE_ATANF)|g' \ + -e 's|@''REPLACE_ATAN2F''@|$(REPLACE_ATAN2F)|g' \ + -e 's|@''REPLACE_CBRTF''@|$(REPLACE_CBRTF)|g' \ -e 's|@''REPLACE_CBRTL''@|$(REPLACE_CBRTL)|g' \ -e 's|@''REPLACE_CEIL''@|$(REPLACE_CEIL)|g' \ -e 's|@''REPLACE_CEILF''@|$(REPLACE_CEILF)|g' \ -e 's|@''REPLACE_CEILL''@|$(REPLACE_CEILL)|g' \ + -e 's|@''REPLACE_COSF''@|$(REPLACE_COSF)|g' \ + -e 's|@''REPLACE_COSHF''@|$(REPLACE_COSHF)|g' \ + -e 's|@''REPLACE_EXPF''@|$(REPLACE_EXPF)|g' \ -e 's|@''REPLACE_EXPM1''@|$(REPLACE_EXPM1)|g' \ -e 's|@''REPLACE_EXPM1F''@|$(REPLACE_EXPM1F)|g' \ -e 's|@''REPLACE_EXP2''@|$(REPLACE_EXP2)|g' \ @@ -1170,7 +1260,12 @@ -e 's|@''REPLACE_ROUNDL''@|$(REPLACE_ROUNDL)|g' \ -e 's|@''REPLACE_SIGNBIT''@|$(REPLACE_SIGNBIT)|g' \ -e 's|@''REPLACE_SIGNBIT_USING_GCC''@|$(REPLACE_SIGNBIT_USING_GCC)|g' \ + -e 's|@''REPLACE_SINF''@|$(REPLACE_SINF)|g' \ + -e 's|@''REPLACE_SINHF''@|$(REPLACE_SINHF)|g' \ + -e 's|@''REPLACE_SQRTF''@|$(REPLACE_SQRTF)|g' \ -e 's|@''REPLACE_SQRTL''@|$(REPLACE_SQRTL)|g' \ + -e 's|@''REPLACE_TANF''@|$(REPLACE_TANF)|g' \ + -e 's|@''REPLACE_TANHF''@|$(REPLACE_TANHF)|g' \ -e 's|@''REPLACE_TRUNC''@|$(REPLACE_TRUNC)|g' \ -e 's|@''REPLACE_TRUNCF''@|$(REPLACE_TRUNCF)|g' \ -e 's|@''REPLACE_TRUNCL''@|$(REPLACE_TRUNCL)|g' \ @@ -1261,6 +1356,24 @@ ## end gnulib module minmax +## begin gnulib module modf + + +EXTRA_DIST += lib/modf.c + +EXTRA_lib_libdatamash_a_SOURCES += lib/modf.c + +## end gnulib module modf + +## begin gnulib module modfl + + +EXTRA_DIST += lib/modfl.c + +EXTRA_lib_libdatamash_a_SOURCES += lib/modfl.c + +## end gnulib module modfl + ## begin gnulib module msvc-inval @@ -1286,6 +1399,13 @@ ## end gnulib module non-recursive-gnulib-prefix-hack +## begin gnulib module pmccabe2html + + +EXTRA_DIST += $(top_srcdir)/build-aux/pmccabe2html $(top_srcdir)/build-aux/pmccabe.css + +## end gnulib module pmccabe2html + ## begin gnulib module progname lib_libdatamash_a_SOURCES += lib/progname.h lib/progname.c @@ -1618,6 +1738,7 @@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \ + -e 's/@''HAVE_C99_STDINT_H''@/$(HAVE_C99_STDINT_H)/g' \ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ @@ -1639,6 +1760,7 @@ -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \ -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \ -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \ + -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \ < $(top_srcdir)/lib/stdint.in.h; \ } > $@-t && \ mv $@-t $@ @@ -1843,6 +1965,7 @@ -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \ -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \ -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \ + -e 's|@''HAVE_QSORT_R''@|$(HAVE_QSORT_R)|g' \ -e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \ -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \ -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \ @@ -1909,6 +2032,15 @@ ## end gnulib module stdnoreturn +## begin gnulib module stpcpy + + +EXTRA_DIST += lib/stpcpy.c + +EXTRA_lib_libdatamash_a_SOURCES += lib/stpcpy.c + +## end gnulib module stpcpy + ## begin gnulib module streq @@ -2126,6 +2258,24 @@ ## end gnulib module trim +## begin gnulib module trunc + + +EXTRA_DIST += lib/trunc.c + +EXTRA_lib_libdatamash_a_SOURCES += lib/trunc.c + +## end gnulib module trunc + +## begin gnulib module truncl + + +EXTRA_DIST += lib/trunc.c lib/truncl.c + +EXTRA_lib_libdatamash_a_SOURCES += lib/trunc.c lib/truncl.c + +## end gnulib module truncl + ## begin gnulib module u64 lib_libdatamash_a_SOURCES += lib/u64.c @@ -2214,7 +2364,6 @@ -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \ -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \ -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ - -e 's|@''HAVE_GETLOGIN''@|$(HAVE_GETLOGIN)|g' \ -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \ -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \ @@ -2236,6 +2385,7 @@ -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \ -e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \ -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \ + -e 's|@''HAVE_DECL_GETLOGIN''@|$(HAVE_DECL_GETLOGIN)|g' \ -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \ -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \ @@ -2369,6 +2519,13 @@ ## end gnulib module unlocked-io +## begin gnulib module update-copyright + + +EXTRA_DIST += $(top_srcdir)/build-aux/update-copyright + +## end gnulib module update-copyright + ## begin gnulib module useless-if-before-free @@ -2412,6 +2569,7 @@ -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \ -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \ -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \ + -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \ -e 's/@''GNULIB_BTOWC''@/$(GNULIB_BTOWC)/g' \ -e 's/@''GNULIB_WCTOB''@/$(GNULIB_WCTOB)/g' \ -e 's/@''GNULIB_MBSINIT''@/$(GNULIB_MBSINIT)/g' \ @@ -2533,6 +2691,7 @@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \ + -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \ -e 's/@''GNULIB_ISWBLANK''@/$(GNULIB_ISWBLANK)/g' \ -e 's/@''GNULIB_WCTYPE''@/$(GNULIB_WCTYPE)/g' \ -e 's/@''GNULIB_ISWCTYPE''@/$(GNULIB_ISWCTYPE)/g' \ diff -Nru datamash-1.0.7/lib/hard-locale.c datamash-1.1.1/lib/hard-locale.c --- datamash-1.0.7/lib/hard-locale.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/hard-locale.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,6 +1,6 @@ /* hard-locale.c -- Determine whether a locale is hard. - Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2015 Free Software + Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/hard-locale.h datamash-1.1.1/lib/hard-locale.h --- datamash-1.0.7/lib/hard-locale.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/hard-locale.h 2017-01-10 20:00:59.000000000 +0000 @@ -1,6 +1,6 @@ /* Determine whether a locale is hard. - Copyright (C) 1999, 2003-2004, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 1999, 2003-2004, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/hash.c datamash-1.1.1/lib/hash.c --- datamash-1.0.7/lib/hash.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/hash.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,6 +1,6 @@ /* hash - hashing table processing. - Copyright (C) 1998-2004, 2006-2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 1998-2004, 2006-2007, 2009-2017 Free Software Foundation, Inc. Written by Jim Meyering, 1992. diff -Nru datamash-1.0.7/lib/hash.h datamash-1.1.1/lib/hash.h --- datamash-1.0.7/lib/hash.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/hash.h 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* hash - hashing table processing. - Copyright (C) 1998-1999, 2001, 2003, 2009-2015 Free Software Foundation, + Copyright (C) 1998-1999, 2001, 2003, 2009-2017 Free Software Foundation, Inc. Written by Jim Meyering , 1998. diff -Nru datamash-1.0.7/lib/hash-pjw-bare.c datamash-1.1.1/lib/hash-pjw-bare.c --- datamash-1.0.7/lib/hash-pjw-bare.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/lib/hash-pjw-bare.c 2017-01-10 20:00:59.000000000 +0000 @@ -0,0 +1,42 @@ +/* hash-pjw-bare.c -- compute a hash value from a provided buffer. + + Copyright (C) 2012-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +#include "hash-pjw-bare.h" + +#include + +#define SIZE_BITS (sizeof (size_t) * CHAR_BIT) + +/* Return a hash of the N bytes of X using the method described by + Bruno Haible in http://www.haible.de/bruno/hashfunc.html. + Note that while many hash functions reduce their result via modulo + to a 0..table_size-1 range, this function does not do that. */ + +size_t +hash_pjw_bare (const void *x, size_t n) +{ + const unsigned char *s = x; + size_t h = 0; + unsigned i; + + for (i = 0; i < n; i++) + h = s[i] + ((h << 9) | (h >> (SIZE_BITS - 9))); + + return h; +} diff -Nru datamash-1.0.7/lib/hash-pjw-bare.h datamash-1.1.1/lib/hash-pjw-bare.h --- datamash-1.0.7/lib/hash-pjw-bare.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/lib/hash-pjw-bare.h 2017-01-10 20:00:59.000000000 +0000 @@ -0,0 +1,24 @@ +/* hash-pjw-bare.h -- declaration for a simple hash function + Copyright (C) 2012-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Compute a hash code for a buffer starting at X and of size N, + and return the hash code. Note that unlike hash_pjw(), it does not + return it modulo a table size. + The result is platform dependent: it depends on the size of the 'size_t' + type. */ +extern size_t hash_pjw_bare (const void *x, size_t n) _GL_ATTRIBUTE_PURE; diff -Nru datamash-1.0.7/lib/hash-pjw.c datamash-1.1.1/lib/hash-pjw.c --- datamash-1.0.7/lib/hash-pjw.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/hash-pjw.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,6 +1,6 @@ /* hash-pjw.c -- compute a hash value from a NUL-terminated string. - Copyright (C) 2001, 2003, 2006, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2001, 2003, 2006, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/hash-pjw.h datamash-1.1.1/lib/hash-pjw.h --- datamash-1.0.7/lib/hash-pjw.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/hash-pjw.h 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* hash-pjw.h -- declaration for a simple hash function - Copyright (C) 2001, 2003, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2001, 2003, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/iconv.c datamash-1.1.1/lib/iconv.c --- datamash-1.0.7/lib/iconv.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/iconv.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Character set conversion. - Copyright (C) 1999-2001, 2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 1999-2001, 2007, 2009-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/iconv_close.c datamash-1.1.1/lib/iconv_close.c --- datamash-1.0.7/lib/iconv_close.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/iconv_close.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Character set conversion. - Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/iconv.in.h datamash-1.1.1/lib/iconv.in.h --- datamash-1.0.7/lib/iconv.in.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/iconv.in.h 2017-01-10 20:00:59.000000000 +0000 @@ -1,6 +1,6 @@ /* A GNU-like . - Copyright (C) 2007-2015 Free Software Foundation, Inc. + Copyright (C) 2007-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/iconv_open.c datamash-1.1.1/lib/iconv_open.c --- datamash-1.0.7/lib/iconv_open.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/iconv_open.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Character set conversion. - Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/ignore-value.h datamash-1.1.1/lib/ignore-value.h --- datamash-1.0.7/lib/ignore-value.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/ignore-value.h 2017-01-10 20:00:59.000000000 +0000 @@ -1,6 +1,6 @@ -/* ignore a function return without a compiler warning +/* ignore a function return without a compiler warning. -*- coding: utf-8 -*- - Copyright (C) 2008-2015 Free Software Foundation, Inc. + Copyright (C) 2008-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/intprops.h datamash-1.1.1/lib/intprops.h --- datamash-1.0.7/lib/intprops.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/intprops.h 2017-01-10 20:00:59.000000000 +0000 @@ -1,10 +1,10 @@ /* intprops.h -- properties of integer types - Copyright (C) 2001-2005, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2001-2017 Free Software Foundation, Inc. - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -21,9 +21,9 @@ #define _GL_INTPROPS_H #include +#include -/* Return an integer value, converted to the same type as the integer - expression E after integer type promotion. V is the unconverted value. */ +/* 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 @@ -37,59 +37,72 @@ an integer. */ #define TYPE_IS_INTEGER(t) ((t) 1.5 == 1) -/* True if negative values of the signed integer type T use two's - complement, ones' complement, or signed magnitude representation, - respectively. Much GNU code assumes two's complement, but some - people like to be portable to all possible C hosts. */ -#define TYPE_TWOS_COMPLEMENT(t) ((t) ~ (t) 0 == (t) -1) -#define TYPE_ONES_COMPLEMENT(t) ((t) ~ (t) 0 == 0) -#define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1) - -/* True if the signed integer expression E uses two's complement. */ -#define _GL_INT_TWOS_COMPLEMENT(e) (~ _GL_INT_CONVERT (e, 0) == -1) - -/* True if the arithmetic type T is signed. */ +/* True if the real type T is signed. */ #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) -/* Return 1 if the integer expression E, after integer promotion, has - a signed type. */ -#define _GL_INT_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0) +/* 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. These - macros have undefined behavior if T is signed and has padding bits. - If this is a problem for you, please let us know how to fix it for - your host. */ +/* Minimum and maximum values for integer types and expressions. */ + +/* The width in bits of the integer type or expression T. + Padding bits are not supported; this is checked at compile-time below. */ +#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT) /* The maximum and minimum values for the integer type T. */ -#define TYPE_MINIMUM(t) \ - ((t) (! TYPE_SIGNED (t) \ - ? (t) 0 \ - : TYPE_SIGNED_MAGNITUDE (t) \ - ? ~ (t) 0 \ - : ~ TYPE_MAXIMUM (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))) + : ((((t) 1 << (TYPE_WIDTH (t) - 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) \ - (_GL_INT_SIGNED (e) \ - ? - _GL_INT_TWOS_COMPLEMENT (e) - _GL_SIGNED_INT_MAXIMUM (e) \ + (EXPR_SIGNED (e) \ + ? ~ _GL_SIGNED_INT_MAXIMUM (e) \ : _GL_INT_CONVERT (e, 0)) #define _GL_INT_MAXIMUM(e) \ - (_GL_INT_SIGNED (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) + (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH ((e) + 0) - 2)) - 1) * 2 + 1) +/* Work around OpenVMS incompatibility with C99. */ +#if !defined LLONG_MAX && defined __INT64_MAX +# define LLONG_MAX __INT64_MAX +# define LLONG_MIN __INT64_MIN +#endif + +/* 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 + 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 +/* Similarly, sanity-check one ISO/IEC TS 18661-1:2014 macro if defined. */ +#ifdef UINT_WIDTH +verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH); +#endif -/* Return 1 if the __typeof__ keyword works. This could be done by +/* 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__ \ +#if (2 <= __GNUC__ \ + || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \ || (0x5110 <= __SUNPRO_C && !__STDC__)) # define _GL_HAVE___TYPEOF__ 1 #else @@ -118,8 +131,7 @@ 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)) \ + (INT_BITS_STRLEN_BOUND (TYPE_WIDTH (t) - _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, @@ -224,24 +236,38 @@ ? (a) < (min) >> (b) \ : (max) >> (b) < (a)) +/* True if __builtin_add_overflow (A, B, P) works when P is non-null. */ +#define _GL_HAS_BUILTIN_OVERFLOW (5 <= __GNUC__) + +/* True if __builtin_add_overflow_p (A, B, C) works. */ +#define _GL_HAS_BUILTIN_OVERFLOW_P (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. */ -#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)) +#if _GL_HAS_BUILTIN_OVERFLOW_P +# define _GL_ADD_OVERFLOW(a, b, min, max) \ + __builtin_add_overflow_p (a, b, (__typeof__ ((a) + (b))) 0) +# define _GL_SUBTRACT_OVERFLOW(a, b, min, max) \ + __builtin_sub_overflow_p (a, b, (__typeof__ ((a) - (b))) 0) +# define _GL_MULTIPLY_OVERFLOW(a, b, min, max) \ + __builtin_mul_overflow_p (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 \ @@ -263,22 +289,29 @@ : (a) % - (b)) \ == 0) - -/* Integer overflow checks. +/* Check for integer overflow, and report low order bits of answer. The INT__OVERFLOW macros return 1 if the corresponding C operators might not yield numerically correct answers due to arithmetic overflow. - They work correctly on all known practical hosts, and do not rely + The INT__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: + Example usage, assuming A and B are long int: - long int i = ...; - long int j = ...; - if (INT_MULTIPLY_OVERFLOW (i, j)) - printf ("multiply would overflow"); + if (INT_MULTIPLY_OVERFLOW (a, b)) + printf ("result would overflow\n"); else - printf ("product is %ld", i * j); + 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 @@ -287,6 +320,9 @@ 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, @@ -296,8 +332,12 @@ _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW) #define INT_SUBTRACT_OVERFLOW(a, b) \ _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW) -#define INT_NEGATE_OVERFLOW(a) \ - INT_NEGATE_RANGE_OVERFLOW (a, _GL_INT_MINIMUM (a), _GL_INT_MAXIMUM (a)) +#if _GL_HAS_BUILTIN_OVERFLOW_P +# 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) \ @@ -317,4 +357,102 @@ _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) + +/* 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 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 _GL_HAS_BUILTIN_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 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 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 */ diff -Nru datamash-1.0.7/lib/inttostr.h datamash-1.1.1/lib/inttostr.h --- datamash-1.0.7/lib/inttostr.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/inttostr.h 2017-01-10 20:00:59.000000000 +0000 @@ -1,6 +1,6 @@ /* inttostr.h -- convert integers to printable strings - Copyright (C) 2001-2006, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2001-2006, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/inttypes.in.h datamash-1.1.1/lib/inttypes.in.h --- datamash-1.0.7/lib/inttypes.in.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/inttypes.in.h 2017-01-10 20:00:59.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (C) 2006-2015 Free Software Foundation, Inc. +/* Copyright (C) 2006-2017 Free Software Foundation, Inc. Written by Paul Eggert, Bruno Haible, Derek Price. This file is part of gnulib. diff -Nru datamash-1.0.7/lib/isblank.c datamash-1.1.1/lib/isblank.c --- datamash-1.0.7/lib/isblank.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/isblank.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,6 +1,6 @@ /* Test whether a character is a blank. - Copyright (C) 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/isfinite.c datamash-1.1.1/lib/isfinite.c --- datamash-1.0.7/lib/isfinite.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/lib/isfinite.c 2017-01-10 20:00:59.000000000 +0000 @@ -0,0 +1,51 @@ +/* Test for finite value (zero, subnormal, or normal, and not infinite or NaN). + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see . */ + +/* Written by Ben Pfaff , 2007. */ + +#include + +#include "isnanf-nolibm.h" +#include "isnand-nolibm.h" +#include "isnanl-nolibm.h" + +/* The "cc" compiler on HP-UX 11.11, when optimizing, simplifies the test + x - y == 0.0 to x == y, a simplification which is invalid when x and y + are Infinity. Disable this optimization. */ +#if defined __hpux && !defined __GNUC__ +static float zerof; +static double zerod; +static long double zerol; +#else +# define zerof 0.f +# define zerod 0. +# define zerol 0.L +#endif + +int gl_isfinitef (float x) +{ + return !isnanf (x) && x - x == zerof; +} + +int gl_isfinited (double x) +{ + return !isnand (x) && x - x == zerod; +} + +int gl_isfinitel (long double x) +{ + return !isnanl (x) && x - x == zerol; +} diff -Nru datamash-1.0.7/lib/isinf.c datamash-1.1.1/lib/isinf.c --- datamash-1.0.7/lib/isinf.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/lib/isinf.c 2017-01-10 20:00:59.000000000 +0000 @@ -0,0 +1,39 @@ +/* Test for positive or negative infinity. + Copyright (C) 2007-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see . */ + +/* Written by Ben Pfaff , 2008. */ + +#include + +#include + +int +gl_isinff (float x) +{ + return x < -FLT_MAX || x > FLT_MAX; +} + +int +gl_isinfd (double x) +{ + return x < -DBL_MAX || x > DBL_MAX; +} + +int +gl_isinfl (long double x) +{ + return x < -LDBL_MAX || x > LDBL_MAX; +} diff -Nru datamash-1.0.7/lib/isnan.c datamash-1.1.1/lib/isnan.c --- datamash-1.0.7/lib/isnan.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/isnan.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Test for NaN that does not need libm. - Copyright (C) 2007-2015 Free Software Foundation, Inc. + Copyright (C) 2007-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/isnand.c datamash-1.1.1/lib/isnand.c --- datamash-1.0.7/lib/isnand.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/isnand.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Test for NaN that does not need libm. - Copyright (C) 2008-2015 Free Software Foundation, Inc. + Copyright (C) 2008-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/isnand-nolibm.h datamash-1.1.1/lib/isnand-nolibm.h --- datamash-1.0.7/lib/isnand-nolibm.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/isnand-nolibm.h 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Test for NaN that does not need libm. - Copyright (C) 2007-2015 Free Software Foundation, Inc. + Copyright (C) 2007-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/isnanf.c datamash-1.1.1/lib/isnanf.c --- datamash-1.0.7/lib/isnanf.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/isnanf.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Test for NaN that does not need libm. - Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/isnanf-nolibm.h datamash-1.1.1/lib/isnanf-nolibm.h --- datamash-1.0.7/lib/isnanf-nolibm.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/isnanf-nolibm.h 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Test for NaN that does not need libm. - Copyright (C) 2007-2015 Free Software Foundation, Inc. + Copyright (C) 2007-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/isnanl.c datamash-1.1.1/lib/isnanl.c --- datamash-1.0.7/lib/isnanl.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/isnanl.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Test for NaN that does not need libm. - Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/isnanl-nolibm.h datamash-1.1.1/lib/isnanl-nolibm.h --- datamash-1.0.7/lib/isnanl-nolibm.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/isnanl-nolibm.h 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Test for NaN that does not need libm. - Copyright (C) 2007-2015 Free Software Foundation, Inc. + Copyright (C) 2007-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/iswblank.c datamash-1.1.1/lib/iswblank.c --- datamash-1.0.7/lib/iswblank.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/iswblank.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Test wide character for being blank. - Copyright (C) 2008-2015 Free Software Foundation, Inc. + Copyright (C) 2008-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/itold.c datamash-1.1.1/lib/itold.c --- datamash-1.0.7/lib/itold.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/itold.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Replacement for 'int' to 'long double' conversion routine. - Copyright (C) 2011-2015 Free Software Foundation, Inc. + Copyright (C) 2011-2017 Free Software Foundation, Inc. Written by Bruno Haible , 2011. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/ldexpl.c datamash-1.1.1/lib/ldexpl.c --- datamash-1.0.7/lib/ldexpl.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/ldexpl.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,7 +1,7 @@ /* Emulation for ldexpl. Contributed by Paolo Bonzini - Copyright 2002-2003, 2007-2015 Free Software Foundation, Inc. + Copyright 2002-2003, 2007-2017 Free Software Foundation, Inc. This file is part of gnulib. diff -Nru datamash-1.0.7/lib/limits.in.h datamash-1.1.1/lib/limits.in.h --- datamash-1.0.7/lib/limits.in.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/lib/limits.in.h 2017-01-10 20:00:58.000000000 +0000 @@ -0,0 +1,63 @@ +/* A GNU-like . + + Copyright 2016-2017 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 3, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see . */ + +#ifndef _@GUARD_PREFIX@_LIMITS_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_LIMITS_H@ + +#ifndef _@GUARD_PREFIX@_LIMITS_H +#define _@GUARD_PREFIX@_LIMITS_H + +/* The number of usable bits in an unsigned or signed integer type + with minimum value MIN and maximum value MAX, as an int expression + suitable in #if. Cover all known practical hosts. This + implementation exploits the fact that MAX is 1 less than a power of + 2, and merely counts the number of 1 bits in MAX; "COBn" means + "count the number of 1 bits in the low-order n bits"). */ +#define _GL_INTEGER_WIDTH(min, max) (((min) < 0) + _GL_COB128 (max)) +#define _GL_COB128(n) (_GL_COB64 ((n) >> 31 >> 31 >> 2) + _GL_COB64 (n)) +#define _GL_COB64(n) (_GL_COB32 ((n) >> 31 >> 1) + _GL_COB32 (n)) +#define _GL_COB32(n) (_GL_COB16 ((n) >> 16) + _GL_COB16 (n)) +#define _GL_COB16(n) (_GL_COB8 ((n) >> 8) + _GL_COB8 (n)) +#define _GL_COB8(n) (_GL_COB4 ((n) >> 4) + _GL_COB4 (n)) +#define _GL_COB4(n) (!!((n) & 8) + !!((n) & 4) + !!((n) & 2) + !!((n) & 1)) + +/* Macros specified by ISO/IEC TS 18661-1:2014. */ + +#if (! defined ULLONG_WIDTH \ + && (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__)) +# define CHAR_WIDTH _GL_INTEGER_WIDTH (CHAR_MIN, CHAR_MAX) +# define SCHAR_WIDTH _GL_INTEGER_WIDTH (SCHAR_MIN, SCHAR_MAX) +# define UCHAR_WIDTH _GL_INTEGER_WIDTH (0, UCHAR_MAX) +# define SHRT_WIDTH _GL_INTEGER_WIDTH (SHRT_MIN, SHRT_MAX) +# define USHRT_WIDTH _GL_INTEGER_WIDTH (0, USHRT_MAX) +# define INT_WIDTH _GL_INTEGER_WIDTH (INT_MIN, INT_MAX) +# define UINT_WIDTH _GL_INTEGER_WIDTH (0, UINT_MAX) +# define LONG_WIDTH _GL_INTEGER_WIDTH (LONG_MIN, LONG_MAX) +# define ULONG_WIDTH _GL_INTEGER_WIDTH (0, ULONG_MAX) +# define LLONG_WIDTH _GL_INTEGER_WIDTH (LLONG_MIN, LLONG_MAX) +# define ULLONG_WIDTH _GL_INTEGER_WIDTH (0, ULLONG_MAX) +#endif /* !ULLONG_WIDTH && (_GNU_SOURCE || __STDC_WANT_IEC_60559_BFP_EXT__) */ + +#endif /* _@GUARD_PREFIX@_LIMITS_H */ +#endif /* _@GUARD_PREFIX@_LIMITS_H */ diff -Nru datamash-1.0.7/lib/linebuffer.c datamash-1.1.1/lib/linebuffer.c --- datamash-1.0.7/lib/linebuffer.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/linebuffer.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,6 +1,6 @@ /* linebuffer.c -- read arbitrarily long lines - Copyright (C) 1986, 1991, 1998-1999, 2001, 2003-2004, 2006-2007, 2009-2015 + Copyright (C) 1986, 1991, 1998-1999, 2001, 2003-2004, 2006-2007, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/linebuffer.h datamash-1.1.1/lib/linebuffer.h --- datamash-1.0.7/lib/linebuffer.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/linebuffer.h 2017-01-10 20:00:59.000000000 +0000 @@ -1,6 +1,6 @@ /* linebuffer.h -- declarations for reading arbitrarily long lines - Copyright (C) 1986, 1991, 1998-1999, 2002-2003, 2007, 2009-2015 Free + Copyright (C) 1986, 1991, 1998-1999, 2002-2003, 2007, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/localcharset.c datamash-1.1.1/lib/localcharset.c --- datamash-1.0.7/lib/localcharset.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/localcharset.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,6 +1,6 @@ /* Determine a canonical name for the current locale's character encoding. - Copyright (C) 2000-2006, 2008-2015 Free Software Foundation, Inc. + Copyright (C) 2000-2006, 2008-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -507,7 +507,7 @@ current_locale = setlocale (LC_CTYPE, NULL); pdot = strrchr (current_locale, '.'); - if (pdot) + if (pdot && 2 + strlen (pdot + 1) + 1 <= sizeof (buf)) sprintf (buf, "CP%s", pdot + 1); else { diff -Nru datamash-1.0.7/lib/localcharset.h datamash-1.1.1/lib/localcharset.h --- datamash-1.0.7/lib/localcharset.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/localcharset.h 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Determine a canonical name for the current locale's character encoding. - Copyright (C) 2000-2003, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2000-2003, 2009-2017 Free Software Foundation, Inc. This file is part of the GNU CHARSET Library. This program is free software; you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/localeconv.c datamash-1.1.1/lib/localeconv.c --- datamash-1.0.7/lib/localeconv.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/localeconv.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Query locale dependent information for formatting numbers. - Copyright (C) 2012-2015 Free Software Foundation, Inc. + Copyright (C) 2012-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/locale.in.h datamash-1.1.1/lib/locale.in.h --- datamash-1.0.7/lib/locale.in.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/locale.in.h 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* A POSIX . - Copyright (C) 2007-2015 Free Software Foundation, Inc. + Copyright (C) 2007-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/local.mk datamash-1.1.1/lib/local.mk --- datamash-1.0.7/lib/local.mk 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/lib/local.mk 2017-01-17 17:50:20.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2014-2015 Assaf Gordon +# Copyright (C) 2014-2017 Assaf Gordon # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without diff -Nru datamash-1.0.7/lib/malloca.c datamash-1.1.1/lib/malloca.c --- datamash-1.0.7/lib/malloca.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/malloca.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Safe automatic memory allocation. - Copyright (C) 2003, 2006-2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2003, 2006-2007, 2009-2017 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software; you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/malloca.h datamash-1.1.1/lib/malloca.h --- datamash-1.0.7/lib/malloca.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/malloca.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Safe automatic memory allocation. - Copyright (C) 2003-2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2003-2007, 2009-2017 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software; you can redistribute it and/or modify @@ -21,6 +21,9 @@ #include #include #include +#include + +#include "xalloc-oversized.h" #ifdef __cplusplus @@ -73,15 +76,7 @@ It allocates an array of N objects, each with S bytes of memory, on the stack. S must be positive and N must be nonnegative. The array must be freed using freea() before the function returns. */ -#if 1 -/* Cf. the definition of xalloc_oversized. */ -# define nmalloca(n, s) \ - ((n) > (size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / (s) \ - ? NULL \ - : malloca ((n) * (s))) -#else -extern void * nmalloca (size_t n, size_t s); -#endif +#define nmalloca(n, s) (xalloc_oversized (n, s) ? NULL : malloca ((n) * (s))) #ifdef __cplusplus diff -Nru datamash-1.0.7/lib/malloc.c datamash-1.1.1/lib/malloc.c --- datamash-1.0.7/lib/malloc.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/malloc.c 2017-01-10 20:00:59.000000000 +0000 @@ -1,6 +1,6 @@ /* malloc() function that is glibc compatible. - Copyright (C) 1997-1998, 2006-2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 1997-1998, 2006-2007, 2009-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/math.c datamash-1.1.1/lib/math.c --- datamash-1.0.7/lib/math.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/math.c 2015-12-18 16:49:32.000000000 +0000 @@ -1,3 +1,4 @@ #include #define _GL_MATH_INLINE _GL_EXTERN_INLINE #include "math.h" +typedef int dummy; diff -Nru datamash-1.0.7/lib/math.in.h datamash-1.1.1/lib/math.in.h --- datamash-1.0.7/lib/math.in.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/math.in.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* A GNU-like . - Copyright (C) 2002-2003, 2007-2015 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2007-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -63,6 +63,7 @@ return func (l); \ } # define _GL_MATH_CXX_REAL_FLOATING_DECL_2(func) \ +_GL_BEGIN_NAMESPACE \ inline int \ func (float f) \ { \ @@ -77,7 +78,8 @@ func (long double l) \ { \ return _gl_cxx_ ## func ## l (l); \ -} +} \ +_GL_END_NAMESPACE #endif /* Helper macros to define a portability warning for the @@ -210,11 +212,20 @@ #if @GNULIB_ACOSF@ -# if !@HAVE_ACOSF@ -# undef acosf +# if @REPLACE_ACOSF@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef acosf +# define acosf rpl_acosf +# endif +_GL_FUNCDECL_RPL (acosf, float, (float x)); +_GL_CXXALIAS_RPL (acosf, float, (float x)); +# else +# if !@HAVE_ACOSF@ +# undef acosf _GL_FUNCDECL_SYS (acosf, float, (float x)); -# endif +# endif _GL_CXXALIAS_SYS (acosf, float, (float x)); +# endif _GL_CXXALIASWARN (acosf); #elif defined GNULIB_POSIXCHECK # undef acosf @@ -241,11 +252,20 @@ #if @GNULIB_ASINF@ -# if !@HAVE_ASINF@ -# undef asinf +# if @REPLACE_ASINF@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef asinf +# define asinf rpl_asinf +# endif +_GL_FUNCDECL_RPL (asinf, float, (float x)); +_GL_CXXALIAS_RPL (asinf, float, (float x)); +# else +# if !@HAVE_ASINF@ +# undef asinf _GL_FUNCDECL_SYS (asinf, float, (float x)); -# endif +# endif _GL_CXXALIAS_SYS (asinf, float, (float x)); +# endif _GL_CXXALIASWARN (asinf); #elif defined GNULIB_POSIXCHECK # undef asinf @@ -272,11 +292,20 @@ #if @GNULIB_ATANF@ -# if !@HAVE_ATANF@ -# undef atanf +# if @REPLACE_ATANF@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef atanf +# define atanf rpl_atanf +# endif +_GL_FUNCDECL_RPL (atanf, float, (float x)); +_GL_CXXALIAS_RPL (atanf, float, (float x)); +# else +# if !@HAVE_ATANF@ +# undef atanf _GL_FUNCDECL_SYS (atanf, float, (float x)); -# endif +# endif _GL_CXXALIAS_SYS (atanf, float, (float x)); +# endif _GL_CXXALIASWARN (atanf); #elif defined GNULIB_POSIXCHECK # undef atanf @@ -303,11 +332,20 @@ #if @GNULIB_ATAN2F@ -# if !@HAVE_ATAN2F@ -# undef atan2f +# if @REPLACE_ATAN2F@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef atan2f +# define atan2f rpl_atan2f +# endif +_GL_FUNCDECL_RPL (atan2f, float, (float y, float x)); +_GL_CXXALIAS_RPL (atan2f, float, (float y, float x)); +# else +# if !@HAVE_ATAN2F@ +# undef atan2f _GL_FUNCDECL_SYS (atan2f, float, (float y, float x)); -# endif +# endif _GL_CXXALIAS_SYS (atan2f, float, (float y, float x)); +# endif _GL_CXXALIASWARN (atan2f); #elif defined GNULIB_POSIXCHECK # undef atan2f @@ -406,6 +444,7 @@ #if @GNULIB_CEIL@ # if @REPLACE_CEIL@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef ceil # define ceil rpl_ceil # endif _GL_FUNCDECL_RPL (ceil, double, (double x)); @@ -485,11 +524,20 @@ #if @GNULIB_COSF@ -# if !@HAVE_COSF@ -# undef cosf +# if @REPLACE_COSF@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef cosf +# define cosf rpl_cosf +# endif +_GL_FUNCDECL_RPL (cosf, float, (float x)); +_GL_CXXALIAS_RPL (cosf, float, (float x)); +# else +# if !@HAVE_COSF@ +# undef cosf _GL_FUNCDECL_SYS (cosf, float, (float x)); -# endif +# endif _GL_CXXALIAS_SYS (cosf, float, (float x)); +# endif _GL_CXXALIASWARN (cosf); #elif defined GNULIB_POSIXCHECK # undef cosf @@ -516,11 +564,20 @@ #if @GNULIB_COSHF@ -# if !@HAVE_COSHF@ -# undef coshf +# if @REPLACE_COSHF@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef coshf +# define coshf rpl_coshf +# endif +_GL_FUNCDECL_RPL (coshf, float, (float x)); +_GL_CXXALIAS_RPL (coshf, float, (float x)); +# else +# if !@HAVE_COSHF@ +# undef coshf _GL_FUNCDECL_SYS (coshf, float, (float x)); -# endif +# endif _GL_CXXALIAS_SYS (coshf, float, (float x)); +# endif _GL_CXXALIASWARN (coshf); #elif defined GNULIB_POSIXCHECK # undef coshf @@ -532,11 +589,20 @@ #if @GNULIB_EXPF@ -# if !@HAVE_EXPF@ -# undef expf +# if @REPLACE_EXPF@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef expf +# define expf rpl_expf +# endif +_GL_FUNCDECL_RPL (expf, float, (float x)); +_GL_CXXALIAS_RPL (expf, float, (float x)); +# else +# if !@HAVE_EXPF@ +# undef expf _GL_FUNCDECL_SYS (expf, float, (float x)); -# endif +# endif _GL_CXXALIAS_SYS (expf, float, (float x)); +# endif _GL_CXXALIASWARN (expf); #elif defined GNULIB_POSIXCHECK # undef expf @@ -753,6 +819,7 @@ #if @GNULIB_FLOOR@ # if @REPLACE_FLOOR@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef floor # define floor rpl_floor # endif _GL_FUNCDECL_RPL (floor, double, (double x)); @@ -973,6 +1040,7 @@ #if @GNULIB_FREXP@ # if @REPLACE_FREXP@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef frexp # define frexp rpl_frexp # endif _GL_FUNCDECL_RPL (frexp, double, (double x, int *expptr) _GL_ARG_NONNULL ((2))); @@ -980,7 +1048,7 @@ # else _GL_CXXALIAS_SYS (frexp, double, (double x, int *expptr)); # endif -_GL_CXXALIASWARN (frexp); +_GL_CXXALIASWARN1 (frexp, double, (double x, int *expptr)); #elif defined GNULIB_POSIXCHECK # undef frexp /* Assume frexp is always declared. */ @@ -1822,11 +1890,20 @@ #if @GNULIB_SINF@ -# if !@HAVE_SINF@ -# undef sinf +# if @REPLACE_SINF@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef sinf +# define sinf rpl_sinf +# endif +_GL_FUNCDECL_RPL (sinf, float, (float x)); +_GL_CXXALIAS_RPL (sinf, float, (float x)); +# else +# if !@HAVE_SINF@ + # undef sinf _GL_FUNCDECL_SYS (sinf, float, (float x)); -# endif +# endif _GL_CXXALIAS_SYS (sinf, float, (float x)); +# endif _GL_CXXALIASWARN (sinf); #elif defined GNULIB_POSIXCHECK # undef sinf @@ -1853,11 +1930,20 @@ #if @GNULIB_SINHF@ -# if !@HAVE_SINHF@ -# undef sinhf +# if @REPLACE_SINHF@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef sinhf +# define sinhf rpl_sinhf +# endif +_GL_FUNCDECL_RPL (sinhf, float, (float x)); +_GL_CXXALIAS_RPL (sinhf, float, (float x)); +# else +# if !@HAVE_SINHF@ +# undef sinhf _GL_FUNCDECL_SYS (sinhf, float, (float x)); -# endif +# endif _GL_CXXALIAS_SYS (sinhf, float, (float x)); +# endif _GL_CXXALIASWARN (sinhf); #elif defined GNULIB_POSIXCHECK # undef sinhf @@ -1869,11 +1955,20 @@ #if @GNULIB_SQRTF@ -# if !@HAVE_SQRTF@ -# undef sqrtf +# if @REPLACE_SQRTF@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef sqrtf +# define sqrtf rpl_sqrtf +# endif +_GL_FUNCDECL_RPL (sqrtf, float, (float x)); +_GL_CXXALIAS_RPL (sqrtf, float, (float x)); +# else +# if !@HAVE_SQRTF@ +# undef sqrtf _GL_FUNCDECL_SYS (sqrtf, float, (float x)); -# endif +# endif _GL_CXXALIAS_SYS (sqrtf, float, (float x)); +# endif _GL_CXXALIASWARN (sqrtf); #elif defined GNULIB_POSIXCHECK # undef sqrtf @@ -1909,11 +2004,20 @@ #if @GNULIB_TANF@ -# if !@HAVE_TANF@ -# undef tanf +# if @REPLACE_TANF@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef tanf +# define tanf rpl_tanf +# endif +_GL_FUNCDECL_RPL (tanf, float, (float x)); +_GL_CXXALIAS_RPL (tanf, float, (float x)); +# else +# if !@HAVE_TANF@ +# undef tanf _GL_FUNCDECL_SYS (tanf, float, (float x)); -# endif +# endif _GL_CXXALIAS_SYS (tanf, float, (float x)); +# endif _GL_CXXALIASWARN (tanf); #elif defined GNULIB_POSIXCHECK # undef tanf @@ -1940,11 +2044,20 @@ #if @GNULIB_TANHF@ -# if !@HAVE_TANHF@ -# undef tanhf +# if @REPLACE_TANHF@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef tanhf +# define tanhf rpl_tanhf +# endif +_GL_FUNCDECL_RPL (tanhf, float, (float x)); +_GL_CXXALIAS_RPL (tanhf, float, (float x)); +# else +# if !@HAVE_TANHF@ +# undef tanhf _GL_FUNCDECL_SYS (tanhf, float, (float x)); -# endif +# endif _GL_CXXALIAS_SYS (tanhf, float, (float x)); +# endif _GL_CXXALIASWARN (tanhf); #elif defined GNULIB_POSIXCHECK # undef tanhf @@ -1958,6 +2071,7 @@ #if @GNULIB_TRUNCF@ # if @REPLACE_TRUNCF@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef truncf # define truncf rpl_truncf # endif _GL_FUNCDECL_RPL (truncf, float, (float x)); @@ -1980,6 +2094,7 @@ #if @GNULIB_TRUNC@ # if @REPLACE_TRUNC@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef trunc # define trunc rpl_trunc # endif _GL_FUNCDECL_RPL (trunc, double, (double x)); @@ -2039,7 +2154,7 @@ gl_isfinitef (x)) # endif # ifdef __cplusplus -# ifdef isfinite +# if defined isfinite || defined GNULIB_NAMESPACE _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isfinite) # undef isfinite _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isfinite) @@ -2066,7 +2181,7 @@ gl_isinff (x)) # endif # ifdef __cplusplus -# ifdef isinf +# if defined isinf || defined GNULIB_NAMESPACE _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isinf) # undef isinf _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isinf) @@ -2184,7 +2299,7 @@ __builtin_isnanf ((float)(x))) # endif # ifdef __cplusplus -# ifdef isnan +# if defined isnan || defined GNULIB_NAMESPACE _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isnan) # undef isnan _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isnan) @@ -2205,7 +2320,8 @@ #if @GNULIB_SIGNBIT@ -# if @REPLACE_SIGNBIT_USING_GCC@ +# if (@REPLACE_SIGNBIT_USING_GCC@ \ + && (!defined __cplusplus || __cplusplus < 201103)) # undef signbit /* GCC 4.0 and newer provides three built-ins for signbit. */ # define signbit(x) \ @@ -2258,7 +2374,7 @@ gl_signbitf (x)) # endif # ifdef __cplusplus -# ifdef signbit +# if defined signbit || defined GNULIB_NAMESPACE _GL_MATH_CXX_REAL_FLOATING_DECL_1 (signbit) # undef signbit _GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit) diff -Nru datamash-1.0.7/lib/mbchar.c datamash-1.1.1/lib/mbchar.c --- datamash-1.0.7/lib/mbchar.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/mbchar.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2006, 2009-2015 Free Software Foundation, Inc. +/* Copyright (C) 2001, 2006, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/mbchar.h datamash-1.1.1/lib/mbchar.h --- datamash-1.0.7/lib/mbchar.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/mbchar.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Multibyte character data type. - Copyright (C) 2001, 2005-2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2001, 2005-2007, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/mbiter.h datamash-1.1.1/lib/mbiter.h --- datamash-1.0.7/lib/mbiter.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/mbiter.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Iterating through multibyte strings: macros for multi-byte encodings. - Copyright (C) 2001, 2005, 2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2001, 2005, 2007, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/mbrtowc.c datamash-1.1.1/lib/mbrtowc.c --- datamash-1.0.7/lib/mbrtowc.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/mbrtowc.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Convert multibyte character to wide character. - Copyright (C) 1999-2002, 2005-2015 Free Software Foundation, Inc. + Copyright (C) 1999-2002, 2005-2017 Free Software Foundation, Inc. Written by Bruno Haible , 2008. This program is free software: you can redistribute it and/or modify @@ -20,6 +20,11 @@ /* Specification. */ #include +#if C_LOCALE_MAYBE_EILSEQ +# include "hard-locale.h" +# include +#endif + #if GNULIB_defined_mbstate_t /* Implement mbrtowc() on top of mbtowc(). */ @@ -328,6 +333,9 @@ size_t rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) { + size_t ret; + wchar_t wc; + # if MBRTOWC_NULL_ARG2_BUG || MBRTOWC_RETVAL_BUG || MBRTOWC_EMPTY_INPUT_BUG if (s == NULL) { @@ -342,6 +350,9 @@ return (size_t) -2; # endif + if (! pwc) + pwc = &wc; + # if MBRTOWC_RETVAL_BUG { static mbstate_t internal_state; @@ -357,8 +368,7 @@ size_t count = 0; for (; n > 0; s++, n--) { - wchar_t wc; - size_t ret = mbrtowc (&wc, s, 1, ps); + ret = mbrtowc (&wc, s, 1, ps); if (ret == (size_t)(-1)) return (size_t)(-1); @@ -366,8 +376,7 @@ if (ret != (size_t)(-2)) { /* The multibyte character has been completed. */ - if (pwc != NULL) - *pwc = wc; + *pwc = wc; return (wc == 0 ? 0 : count); } } @@ -376,32 +385,23 @@ } # endif -# if MBRTOWC_NUL_RETVAL_BUG - { - wchar_t wc; - size_t ret = mbrtowc (&wc, s, n, ps); + ret = mbrtowc (pwc, s, n, ps); - if (ret != (size_t)(-1) && ret != (size_t)(-2)) - { - if (pwc != NULL) - *pwc = wc; - if (wc == 0) - ret = 0; - } - return ret; - } -# else - { -# if MBRTOWC_NULL_ARG1_BUG - wchar_t dummy; - - if (pwc == NULL) - pwc = &dummy; -# endif +# if MBRTOWC_NUL_RETVAL_BUG + if (ret < (size_t) -2 && !*pwc) + return 0; +# endif - return mbrtowc (pwc, s, n, ps); - } +# if C_LOCALE_MAYBE_EILSEQ + if ((size_t) -2 <= ret && n != 0 && ! hard_locale (LC_CTYPE)) + { + unsigned char uc = *s; + *pwc = uc; + return 1; + } # endif + + return ret; } #endif diff -Nru datamash-1.0.7/lib/mbsinit.c datamash-1.1.1/lib/mbsinit.c --- datamash-1.0.7/lib/mbsinit.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/mbsinit.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Test for initial conversion state. - Copyright (C) 2008-2015 Free Software Foundation, Inc. + Copyright (C) 2008-2017 Free Software Foundation, Inc. Written by Bruno Haible , 2008. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/mbslen.c datamash-1.1.1/lib/mbslen.c --- datamash-1.0.7/lib/mbslen.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/mbslen.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Counting the multibyte characters in a string. - Copyright (C) 2007-2015 Free Software Foundation, Inc. + Copyright (C) 2007-2017 Free Software Foundation, Inc. Written by Bruno Haible , 2007. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/mbsrtowcs.c datamash-1.1.1/lib/mbsrtowcs.c --- datamash-1.0.7/lib/mbsrtowcs.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/mbsrtowcs.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Convert string to wide string. - Copyright (C) 2008-2015 Free Software Foundation, Inc. + Copyright (C) 2008-2017 Free Software Foundation, Inc. Written by Bruno Haible , 2008. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/mbsrtowcs-impl.h datamash-1.1.1/lib/mbsrtowcs-impl.h --- datamash-1.0.7/lib/mbsrtowcs-impl.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/mbsrtowcs-impl.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Convert string to wide string. - Copyright (C) 2008-2015 Free Software Foundation, Inc. + Copyright (C) 2008-2017 Free Software Foundation, Inc. Written by Bruno Haible , 2008. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/mbsrtowcs-state.c datamash-1.1.1/lib/mbsrtowcs-state.c --- datamash-1.0.7/lib/mbsrtowcs-state.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/mbsrtowcs-state.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Convert string to wide string. - Copyright (C) 2008-2015 Free Software Foundation, Inc. + Copyright (C) 2008-2017 Free Software Foundation, Inc. Written by Bruno Haible , 2008. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/mbsstr.c datamash-1.1.1/lib/mbsstr.c --- datamash-1.0.7/lib/mbsstr.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/mbsstr.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ -/* Searching in a string. - Copyright (C) 2005-2015 Free Software Foundation, Inc. +/* Searching in a string. -*- coding: utf-8 -*- + Copyright (C) 2005-2017 Free Software Foundation, Inc. Written by Bruno Haible , 2005. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/mbuiter.h datamash-1.1.1/lib/mbuiter.h --- datamash-1.0.7/lib/mbuiter.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/mbuiter.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Iterating through multibyte strings: macros for multi-byte encodings. - Copyright (C) 2001, 2005, 2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2001, 2005, 2007, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/md5.c datamash-1.1.1/lib/md5.c --- datamash-1.0.7/lib/md5.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/md5.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* Functions to compute MD5 message digest of files or memory blocks. according to the definition of MD5 in RFC 1321 from April 1992. - Copyright (C) 1995-1997, 1999-2001, 2005-2006, 2008-2015 Free Software + Copyright (C) 1995-1997, 1999-2001, 2005-2006, 2008-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -259,7 +259,7 @@ /* Process available complete blocks. */ if (len >= 64) { -#if !_STRING_ARCH_unaligned +#if !(_STRING_ARCH_unaligned || _STRING_INLINE_unaligned) # define UNALIGNED_P(p) ((uintptr_t) (p) % alignof (uint32_t) != 0) if (UNALIGNED_P (buffer)) while (len > 64) diff -Nru datamash-1.0.7/lib/md5.h datamash-1.1.1/lib/md5.h --- datamash-1.0.7/lib/md5.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/md5.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* Declaration of functions and data types used for MD5 sum computing library functions. - Copyright (C) 1995-1997, 1999-2001, 2004-2006, 2008-2015 Free Software + Copyright (C) 1995-1997, 1999-2001, 2004-2006, 2008-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. diff -Nru datamash-1.0.7/lib/memchr.c datamash-1.1.1/lib/memchr.c --- datamash-1.0.7/lib/memchr.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/memchr.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2015 +/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2017 Free Software Foundation, Inc. Based on strlen implementation by Torbjorn Granlund (tege@sics.se), diff -Nru datamash-1.0.7/lib/minmax.h datamash-1.1.1/lib/minmax.h --- datamash-1.0.7/lib/minmax.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/minmax.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* MIN, MAX macros. - Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2015 Free Software + Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/modf.c datamash-1.1.1/lib/modf.c --- datamash-1.0.7/lib/modf.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/lib/modf.c 2017-01-10 20:01:00.000000000 +0000 @@ -0,0 +1,44 @@ +/* Get signed integer and fractional parts of a floating-point number. + Copyright (C) 2012-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include + +double +modf (double x, double *iptr) +{ + if (isfinite (x)) + { + double integer_part = trunc (x); + *iptr = integer_part; + return x - integer_part; + } + else + { + if (isinf (x)) + { + *iptr = x; + return 1.0 / x; + } + else /* isnand (x) */ + { + *iptr = x; + return x; + } + } +} diff -Nru datamash-1.0.7/lib/modfl.c datamash-1.1.1/lib/modfl.c --- datamash-1.0.7/lib/modfl.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/lib/modfl.c 2017-01-10 20:01:00.000000000 +0000 @@ -0,0 +1,59 @@ +/* Get signed integer and fractional parts of a floating-point number. + Copyright (C) 2012-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +/* Specification. */ +#include + +#if HAVE_SAME_LONG_DOUBLE_AS_DOUBLE + +long double +modfl (long double x, long double *iptr) +{ + double integer_part; + double fractional_part = modf (x, &integer_part); + *iptr = integer_part; + return fractional_part; +} + +#else + +long double +modfl (long double x, long double *iptr) +{ + if (isfinite (x)) + { + long double integer_part = truncl (x); + *iptr = integer_part; + return x - integer_part; + } + else + { + if (isinf (x)) + { + *iptr = x; + return 1.0L / x; + } + else /* isnanl (x) */ + { + *iptr = x; + return x; + } + } +} + +#endif diff -Nru datamash-1.0.7/lib/msvc-inval.c datamash-1.1.1/lib/msvc-inval.c --- datamash-1.0.7/lib/msvc-inval.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/msvc-inval.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Invalid parameter handler for MSVC runtime libraries. - Copyright (C) 2011-2015 Free Software Foundation, Inc. + Copyright (C) 2011-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/msvc-inval.h datamash-1.1.1/lib/msvc-inval.h --- datamash-1.0.7/lib/msvc-inval.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/msvc-inval.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Invalid parameter handler for MSVC runtime libraries. - Copyright (C) 2011-2015 Free Software Foundation, Inc. + Copyright (C) 2011-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/msvc-nothrow.c datamash-1.1.1/lib/msvc-nothrow.c --- datamash-1.0.7/lib/msvc-nothrow.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/msvc-nothrow.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* Wrappers that don't throw invalid parameter notifications with MSVC runtime libraries. - Copyright (C) 2011-2015 Free Software Foundation, Inc. + Copyright (C) 2011-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/msvc-nothrow.h datamash-1.1.1/lib/msvc-nothrow.h --- datamash-1.0.7/lib/msvc-nothrow.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/msvc-nothrow.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* Wrappers that don't throw invalid parameter notifications with MSVC runtime libraries. - Copyright (C) 2011-2015 Free Software Foundation, Inc. + Copyright (C) 2011-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/progname.c datamash-1.1.1/lib/progname.c --- datamash-1.0.7/lib/progname.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/progname.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Program name management. - Copyright (C) 2001-2003, 2005-2015 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2005-2017 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/progname.h datamash-1.1.1/lib/progname.h --- datamash-1.0.7/lib/progname.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/progname.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Program name management. - Copyright (C) 2001-2004, 2006, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2001-2004, 2006, 2009-2017 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/propername.c datamash-1.1.1/lib/propername.c --- datamash-1.0.7/lib/propername.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/propername.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Localization of proper names. - Copyright (C) 2006-2015 Free Software Foundation, Inc. + Copyright (C) 2006-2017 Free Software Foundation, Inc. Written by Bruno Haible , 2006. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/propername.h datamash-1.1.1/lib/propername.h --- datamash-1.0.7/lib/propername.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/propername.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ -/* Localization of proper names. - Copyright (C) 2006, 2008-2015 Free Software Foundation, Inc. +/* Localization of proper names. -*- coding: utf-8 -*- + Copyright (C) 2006, 2008-2017 Free Software Foundation, Inc. Written by Bruno Haible , 2006. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/quotearg.c datamash-1.1.1/lib/quotearg.c --- datamash-1.0.7/lib/quotearg.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/quotearg.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* quotearg.c - quote arguments for output - Copyright (C) 1998-2002, 2004-2015 Free Software Foundation, Inc. + Copyright (C) 1998-2002, 2004-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -29,6 +29,7 @@ #include "quotearg.h" #include "quote.h" +#include "minmax.h" #include "xalloc.h" #include "c-strcaseeq.h" #include "localcharset.h" @@ -37,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -77,6 +79,8 @@ "literal", "shell", "shell-always", + "shell-escape", + "shell-escape-always", "c", "c-maybe", "escape", @@ -91,6 +95,8 @@ literal_quoting_style, shell_quoting_style, shell_always_quoting_style, + shell_escape_quoting_style, + shell_escape_always_quoting_style, c_quoting_style, c_maybe_quoting_style, escape_quoting_style, @@ -116,7 +122,7 @@ /* Get the value of O's quoting style. If O is null, use the default. */ enum quoting_style -get_quoting_style (struct quoting_options *o) +get_quoting_style (struct quoting_options const *o) { return (o ? o : &default_quoting_options)->style; } @@ -248,11 +254,15 @@ { size_t i; size_t len = 0; + size_t orig_buffersize = 0; char const *quote_string = 0; size_t quote_string_len = 0; bool backslash_escapes = false; bool unibyte_locale = MB_CUR_MAX == 1; bool elide_outer_quotes = (flags & QA_ELIDE_OUTER_QUOTES) != 0; + bool pending_shell_escape_end = false; + bool encountered_single_quote = false; + bool all_c_and_shell_quote_compat = true; #define STORE(c) \ do \ @@ -263,6 +273,38 @@ } \ while (0) +#define START_ESC() \ + do \ + { \ + if (elide_outer_quotes) \ + goto force_outer_quoting_style; \ + escaping = true; \ + if (quoting_style == shell_always_quoting_style \ + && ! pending_shell_escape_end) \ + { \ + STORE ('\''); \ + STORE ('$'); \ + STORE ('\''); \ + pending_shell_escape_end = true; \ + } \ + STORE ('\\'); \ + } \ + while (0) + +#define END_ESC() \ + do \ + { \ + if (pending_shell_escape_end && ! escaping) \ + { \ + STORE ('\''); \ + STORE ('\''); \ + pending_shell_escape_end = false; \ + } \ + } \ + while (0) + + process_input: + switch (quoting_style) { case c_maybe_quoting_style: @@ -321,11 +363,18 @@ } break; + case shell_escape_quoting_style: + backslash_escapes = true; + /* Fall through. */ case shell_quoting_style: - quoting_style = shell_always_quoting_style; elide_outer_quotes = true; /* Fall through. */ + case shell_escape_always_quoting_style: + if (!elide_outer_quotes) + backslash_escapes = true; + /* Fall through. */ case shell_always_quoting_style: + quoting_style = shell_always_quoting_style; if (!elide_outer_quotes) STORE ('\''); quote_string = "'"; @@ -345,8 +394,11 @@ unsigned char c; unsigned char esc; bool is_right_quote = false; + bool escaping = false; + bool c_and_shell_quote_compat = false; if (backslash_escapes + && quoting_style != shell_always_quoting_style && quote_string_len && (i + quote_string_len <= (argsize == SIZE_MAX && 1 < quote_string_len @@ -367,15 +419,15 @@ case '\0': if (backslash_escapes) { - if (elide_outer_quotes) - goto force_outer_quoting_style; - STORE ('\\'); + START_ESC (); /* If quote_string were to begin with digits, we'd need to test for the end of the arg as well. However, it's hard to imagine any locale that would use digits in quotes, and set_custom_quoting is documented not to - accept them. */ - if (i + 1 < argsize && '0' <= arg[i + 1] && arg[i + 1] <= '9') + accept them. Use only a single \0 with shell-escape + as currently digits are not printed within $'...' */ + if (quoting_style != shell_always_quoting_style + && i + 1 < argsize && '0' <= arg[i + 1] && arg[i + 1] <= '9') { STORE ('0'); STORE ('0'); @@ -436,6 +488,14 @@ case '\t': esc = 't'; goto c_and_shell_escape; case '\v': esc = 'v'; goto c_escape; case '\\': esc = c; + /* Never need to escape '\' in shell case. */ + if (quoting_style == shell_always_quoting_style) + { + if (elide_outer_quotes) + goto force_outer_quoting_style; + goto store_c; + } + /* No need to escape the escape if we are trying to elide outer quotes and nothing else is problematic. */ if (backslash_escapes && elide_outer_quotes && quote_string_len) @@ -463,6 +523,8 @@ break; /* Fall through. */ case ' ': + c_and_shell_quote_compat = true; + /* Fall through. */ case '!': /* special in bash */ case '"': case '$': case '&': case '(': case ')': case '*': case ';': @@ -481,13 +543,26 @@ break; case '\'': + encountered_single_quote = true; + c_and_shell_quote_compat = true; if (quoting_style == shell_always_quoting_style) { if (elide_outer_quotes) goto force_outer_quoting_style; + + if (buffersize && ! orig_buffersize) + { + /* Just scan string to see if supports a more concise + representation, rather than writing a longer string + but returning the length of the more concise form. */ + orig_buffersize = buffersize; + buffersize = 0; + } + STORE ('\''); STORE ('\\'); STORE ('\''); + pending_shell_escape_end = false; } break; @@ -513,6 +588,7 @@ them. Also, a digit or a special letter would cause trouble if it appeared in quote_these_too, but that's also documented as not accepting them. */ + c_and_shell_quote_compat = true; break; default: @@ -591,6 +667,8 @@ while (! mbsinit (&mbstate)); } + c_and_shell_quote_compat = printable; + if (1 < m || (backslash_escapes && ! printable)) { /* Output a multibyte sequence, or an escaped @@ -601,9 +679,7 @@ { if (backslash_escapes && ! printable) { - if (elide_outer_quotes) - goto force_outer_quoting_style; - STORE ('\\'); + START_ESC (); STORE ('0' + (c >> 6)); STORE ('0' + ((c >> 3) & 7)); c = '0' + (c & 7); @@ -615,6 +691,7 @@ } if (ilim <= i + 1) break; + END_ESC (); STORE (c); c = arg[++i]; } @@ -624,25 +701,49 @@ } } - if (! ((backslash_escapes || elide_outer_quotes) + if (! (((backslash_escapes && quoting_style != shell_always_quoting_style) + || elide_outer_quotes) && quote_these_too && quote_these_too[c / INT_BITS] >> (c % INT_BITS) & 1) && !is_right_quote) goto store_c; store_escape: - if (elide_outer_quotes) - goto force_outer_quoting_style; - STORE ('\\'); + START_ESC (); store_c: + END_ESC (); STORE (c); + + if (! c_and_shell_quote_compat) + all_c_and_shell_quote_compat = false; } if (len == 0 && quoting_style == shell_always_quoting_style && elide_outer_quotes) goto force_outer_quoting_style; + /* Single shell quotes (') are commonly enough used as an apostrophe, + that we attempt to minimize the quoting in this case. Note itʼs + better to use the apostrophe modifier "\u02BC" if possible, as that + renders better and works with the word match regex \W+ etc. */ + if (quoting_style == shell_always_quoting_style && ! elide_outer_quotes + && encountered_single_quote) + { + if (all_c_and_shell_quote_compat) + return quotearg_buffer_restyled (buffer, orig_buffersize, arg, argsize, + c_quoting_style, + flags, quote_these_too, + left_quote, right_quote); + else if (! buffersize && orig_buffersize) + { + /* Disable read-only scan, and reprocess to write quoted string. */ + buffersize = orig_buffersize; + len = 0; + goto process_input; + } + } + if (quote_string && !elide_outer_quotes) for (; *quote_string; quote_string++) STORE (*quote_string); @@ -654,6 +755,8 @@ force_outer_quoting_style: /* Don't reuse quote_these_too, since the addition of outer quotes sufficiently quotes the specified characters. */ + if (quoting_style == shell_always_quoting_style && backslash_escapes) + quoting_style = shell_escape_always_quoting_style; return quotearg_buffer_restyled (buffer, buffersize, arg, argsize, quoting_style, flags & ~QA_ELIDE_OUTER_QUOTES, NULL, @@ -729,7 +832,7 @@ /* Preallocate a slot 0 buffer, so that the caller can always quote one small component of a "memory exhausted" message in slot 0. */ static char slot0[256]; -static unsigned int nslots = 1; +static int nslots = 1; static struct slotvec slotvec0 = {sizeof slot0, slot0}; static struct slotvec *slotvec = &slotvec0; @@ -737,7 +840,7 @@ quotearg_free (void) { struct slotvec *sv = slotvec; - unsigned int i; + int i; for (i = 1; i < nslots; i++) free (sv[i].val); if (sv[0].val != slot0) @@ -768,30 +871,23 @@ { int e = errno; - unsigned int n0 = n; struct slotvec *sv = slotvec; if (n < 0) abort (); - if (nslots <= n0) + if (nslots <= n) { - /* FIXME: technically, the type of n1 should be 'unsigned int', - but that evokes an unsuppressible warning from gcc-4.0.1 and - older. If gcc ever provides an option to suppress that warning, - revert to the original type, so that the test in xalloc_oversized - is once again performed only at compile time. */ - size_t n1 = n0 + 1; bool preallocated = (sv == &slotvec0); - if (xalloc_oversized (n1, sizeof *sv)) + if (MIN (INT_MAX, MIN (PTRDIFF_MAX, SIZE_MAX) / sizeof *sv) <= n) xalloc_die (); - slotvec = sv = xrealloc (preallocated ? NULL : sv, n1 * sizeof *sv); + slotvec = sv = xrealloc (preallocated ? NULL : sv, (n + 1) * sizeof *sv); if (preallocated) *sv = slotvec0; - memset (sv + nslots, 0, (n1 - nslots) * sizeof *sv); - nslots = n1; + memset (sv + nslots, 0, (n + 1 - nslots) * sizeof *sv); + nslots = n + 1; } { @@ -901,6 +997,15 @@ } char * +quotearg_n_style_colon (int n, enum quoting_style s, char const *arg) +{ + struct quoting_options options; + options = quoting_options_from_style (s); + set_char_quoting (&options, ':', 1); + return quotearg_n_options (n, arg, SIZE_MAX, &options); +} + +char * quotearg_n_custom (int n, char const *left_quote, char const *right_quote, char const *arg) { diff -Nru datamash-1.0.7/lib/quotearg.h datamash-1.1.1/lib/quotearg.h --- datamash-1.0.7/lib/quotearg.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/quotearg.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* quotearg.h - quote arguments for output - Copyright (C) 1998-2002, 2004, 2006, 2008-2015 Free Software Foundation, + Copyright (C) 1998-2002, 2004, 2006, 2008-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -73,6 +73,37 @@ */ shell_always_quoting_style, + /* Quote names for the shell if they contain shell metacharacters + or other problematic characters (ls --quoting-style=shell-escape). + Non printable characters are quoted using the $'...' syntax, + which originated in ksh93 and is widely supported by most shells, + and proposed for inclusion in POSIX. + + quotearg_buffer: + "simple", "''$'\\0'' '$'\\t\\n'\\''\"'$'\\033''??/\\'", "a:b" + quotearg: + "simple", "''$'\\0'' '$'\\t\\n'\\''\"'$'\\033''??/\\'", "a:b" + quotearg_colon: + "simple", "''$'\\0'' '$'\\t\\n'\\''\"'$'\\033''??/\\'", "'a:b'" + */ + shell_escape_quoting_style, + + /* Quote names for the shell even if they would normally not + require quoting (ls --quoting-style=shell-escape). + Non printable characters are quoted using the $'...' syntax, + which originated in ksh93 and is widely supported by most shells, + and proposed for inclusion in POSIX. Behaves like + shell_escape_quoting_style if QA_ELIDE_OUTER_QUOTES is in effect. + + quotearg_buffer: + "simple", "''$'\\0'' '$'\\t\\n'\\''\"'$'\\033''??/\'", "a:b" + quotearg: + "simple", "''$'\\0'' '$'\\t\\n'\\''\"'$'\\033''??/\'", "a:b" + quotearg_colon: + "simple", "''$'\\0'' '$'\\t\\n'\\''\"'$'\\033''??/\'", "'a:b'" + */ + shell_escape_always_quoting_style, + /* Quote names as for a C language string (ls --quoting-style=c). Behaves like c_maybe_quoting_style if QA_ELIDE_OUTER_QUOTES is in effect. Split into consecutive strings if @@ -247,7 +278,7 @@ struct quoting_options *clone_quoting_options (struct quoting_options *o); /* Get the value of O's quoting style. If O is null, use the default. */ -enum quoting_style get_quoting_style (struct quoting_options *o); +enum quoting_style get_quoting_style (struct quoting_options const *o); /* In O (or in the default if O is null), set the value of the quoting style to S. */ @@ -362,6 +393,9 @@ /* Like quotearg_colon (ARG), except it can quote null bytes. */ char *quotearg_colon_mem (char const *arg, size_t argsize); +/* Like quotearg_n_style, except with ':' quoting enabled. */ +char *quotearg_n_style_colon (int n, enum quoting_style s, char const *arg); + /* Like quotearg_n_style (N, S, ARG) but with S as custom_quoting_style with left quote as LEFT_QUOTE and right quote as RIGHT_QUOTE. See set_custom_quoting for a description of acceptable LEFT_QUOTE and diff -Nru datamash-1.0.7/lib/quote.h datamash-1.1.1/lib/quote.h --- datamash-1.0.7/lib/quote.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/quote.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* quote.h - prototypes for quote.c - Copyright (C) 1998-2001, 2003, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 1998-2001, 2003, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/random.c datamash-1.1.1/lib/random.c --- datamash-1.0.7/lib/random.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/random.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Family of functions for random integers. - Copyright (C) 1995-1997, 2000-2002, 2012-2015 Free Software Foundation, Inc. + Copyright (C) 1995-1997, 2000-2002, 2012-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/random_r.c datamash-1.1.1/lib/random_r.c --- datamash-1.0.7/lib/random_r.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/random_r.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 1995, 2005, 2008-2015 Free Software Foundation, Inc. + Copyright (C) 1995, 2005, 2008-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/realloc.c datamash-1.1.1/lib/realloc.c --- datamash-1.0.7/lib/realloc.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/realloc.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* realloc() function that is glibc compatible. - Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2015 Free Software + Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/ref-add.sin datamash-1.1.1/lib/ref-add.sin --- datamash-1.0.7/lib/ref-add.sin 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/ref-add.sin 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ # Add this package to a list of references stored in a text file. # -# Copyright (C) 2000, 2009-2015 Free Software Foundation, Inc. +# Copyright (C) 2000, 2009-2017 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/ref-del.sin datamash-1.1.1/lib/ref-del.sin --- datamash-1.0.7/lib/ref-del.sin 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/ref-del.sin 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ # Remove this package from a list of references stored in a text file. # -# Copyright (C) 2000, 2009-2015 Free Software Foundation, Inc. +# Copyright (C) 2000, 2009-2017 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/round.c datamash-1.1.1/lib/round.c --- datamash-1.0.7/lib/round.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/round.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Round toward nearest, breaking ties away from zero. - Copyright (C) 2007, 2010-2015 Free Software Foundation, Inc. + Copyright (C) 2007, 2010-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/roundl.c datamash-1.1.1/lib/roundl.c --- datamash-1.0.7/lib/roundl.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/roundl.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Round toward nearest, breaking ties away from zero. - Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/sha1.c datamash-1.1.1/lib/sha1.c --- datamash-1.0.7/lib/sha1.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/sha1.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,7 +1,7 @@ /* sha1.c - Functions to compute SHA1 message digest of files or memory blocks according to the NIST specification FIPS-180-1. - Copyright (C) 2000-2001, 2003-2006, 2008-2015 Free Software Foundation, Inc. + Copyright (C) 2000-2001, 2003-2006, 2008-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the @@ -246,7 +246,7 @@ /* Process available complete blocks. */ if (len >= 64) { -#if !_STRING_ARCH_unaligned +#if !(_STRING_ARCH_unaligned || _STRING_INLINE_unaligned) # define UNALIGNED_P(p) ((uintptr_t) (p) % alignof (uint32_t) != 0) if (UNALIGNED_P (buffer)) while (len > 64) diff -Nru datamash-1.0.7/lib/sha1.h datamash-1.1.1/lib/sha1.h --- datamash-1.0.7/lib/sha1.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/sha1.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* Declarations of functions and data types used for SHA1 sum library functions. - Copyright (C) 2000-2001, 2003, 2005-2006, 2008-2015 Free Software + Copyright (C) 2000-2001, 2003, 2005-2006, 2008-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it diff -Nru datamash-1.0.7/lib/sha256.c datamash-1.1.1/lib/sha256.c --- datamash-1.0.7/lib/sha256.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/sha256.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,7 +1,7 @@ /* sha256.c - Functions to compute SHA256 and SHA224 message digest of files or memory blocks according to the NIST specification FIPS-180-2. - Copyright (C) 2005-2006, 2008-2015 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2008-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -379,7 +379,7 @@ /* Process available complete blocks. */ if (len >= 64) { -#if !_STRING_ARCH_unaligned +#if !(_STRING_ARCH_unaligned || _STRING_INLINE_unaligned) # define UNALIGNED_P(p) ((uintptr_t) (p) % alignof (uint32_t) != 0) if (UNALIGNED_P (buffer)) while (len > 64) diff -Nru datamash-1.0.7/lib/sha256.h datamash-1.1.1/lib/sha256.h --- datamash-1.0.7/lib/sha256.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/sha256.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* Declarations of functions and data types used for SHA256 and SHA224 sum library functions. - Copyright (C) 2005-2006, 2008-2015 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2008-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/sha512.c datamash-1.1.1/lib/sha512.c --- datamash-1.0.7/lib/sha512.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/sha512.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,7 +1,7 @@ /* sha512.c - Functions to compute SHA512 and SHA384 message digest of files or memory blocks according to the NIST specification FIPS-180-2. - Copyright (C) 2005-2006, 2008-2015 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2008-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -387,7 +387,7 @@ /* Process available complete blocks. */ if (len >= 128) { -#if !_STRING_ARCH_unaligned +#if !(_STRING_ARCH_unaligned || _STRING_INLINE_unaligned) # define UNALIGNED_P(p) ((uintptr_t) (p) % alignof (u64) != 0) if (UNALIGNED_P (buffer)) while (len > 128) diff -Nru datamash-1.0.7/lib/sha512.h datamash-1.1.1/lib/sha512.h --- datamash-1.0.7/lib/sha512.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/sha512.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* Declarations of functions and data types used for SHA512 and SHA384 sum library functions. - Copyright (C) 2005-2006, 2008-2015 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2008-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/signbitd.c datamash-1.1.1/lib/signbitd.c --- datamash-1.0.7/lib/signbitd.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/signbitd.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* signbit() macro: Determine the sign bit of a floating-point number. - Copyright (C) 2007-2015 Free Software Foundation, Inc. + Copyright (C) 2007-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/signbitf.c datamash-1.1.1/lib/signbitf.c --- datamash-1.0.7/lib/signbitf.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/signbitf.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* signbit() macro: Determine the sign bit of a floating-point number. - Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/signbitl.c datamash-1.1.1/lib/signbitl.c --- datamash-1.0.7/lib/signbitl.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/signbitl.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* signbit() macro: Determine the sign bit of a floating-point number. - Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/size_max.h datamash-1.1.1/lib/size_max.h --- datamash-1.0.7/lib/size_max.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/size_max.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* size_max.h -- declare SIZE_MAX through system headers - Copyright (C) 2005-2006, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009-2017 Free Software Foundation, Inc. Written by Simon Josefsson. This program is free software; you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/sqrtl.c datamash-1.1.1/lib/sqrtl.c --- datamash-1.0.7/lib/sqrtl.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/sqrtl.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,7 +1,7 @@ /* Emulation for sqrtl. Contributed by Paolo Bonzini - Copyright 2002-2003, 2007, 2009-2015 Free Software Foundation, Inc. + Copyright 2002-2003, 2007, 2009-2017 Free Software Foundation, Inc. This file is part of gnulib. diff -Nru datamash-1.0.7/lib/stdalign.in.h datamash-1.1.1/lib/stdalign.in.h --- datamash-1.0.7/lib/stdalign.in.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/stdalign.in.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* A substitute for ISO C11 . - Copyright 2011-2015 Free Software Foundation, Inc. + Copyright 2011-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -52,7 +52,10 @@ #undef _Alignas #undef _Alignof -#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 +/* GCC releases before GCC 4.9 had a bug in _Alignof. See GCC bug 52023 + . */ +#if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \ + || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9))) # ifdef __cplusplus # if 201103 <= __cplusplus # define _Alignof(type) alignof (type) @@ -64,7 +67,9 @@ # define _Alignof(type) offsetof (struct { char __a; type __b; }, __b) # endif #endif -#define alignof _Alignof +#if ! (defined __cplusplus && 201103 <= __cplusplus) +# define alignof _Alignof +#endif #define __alignof_is_defined 1 /* alignas (A), also known as _Alignas (A), aligns a variable or type @@ -98,15 +103,18 @@ # elif ((defined __APPLE__ && defined __MACH__ \ ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \ : __GNUC__) \ - || __HP_cc || __HP_aCC || __IBMC__ || __IBMCPP__ \ - || __ICC || 0x5110 <= __SUNPRO_C) + || 061200 <= __HP_cc || 061200 <= __HP_aCC \ + || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__) # define _Alignas(a) __attribute__ ((__aligned__ (a))) # elif 1300 <= _MSC_VER # define _Alignas(a) __declspec (align (a)) # endif #endif -#if defined _Alignas || (defined __STDC_VERSION && 201112 <= __STDC_VERSION__) +#if ((defined _Alignas && ! (defined __cplusplus && 201103 <= __cplusplus)) \ + || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) # define alignas _Alignas +#endif +#if defined alignas || (defined __cplusplus && 201103 <= __cplusplus) # define __alignas_is_defined 1 #endif diff -Nru datamash-1.0.7/lib/stdarg.in.h datamash-1.1.1/lib/stdarg.in.h --- datamash-1.0.7/lib/stdarg.in.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/stdarg.in.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Substitute for and wrapper around . - Copyright (C) 2008-2015 Free Software Foundation, Inc. + Copyright (C) 2008-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/stdbool.in.h datamash-1.1.1/lib/stdbool.in.h --- datamash-1.0.7/lib/stdbool.in.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/stdbool.in.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2003, 2006-2015 Free Software Foundation, Inc. +/* Copyright (C) 2001-2003, 2006-2017 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/stddef.in.h datamash-1.1.1/lib/stddef.in.h --- datamash-1.0.7/lib/stddef.in.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/stddef.in.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* A substitute for POSIX 2008 , for platforms that have issues. - Copyright (C) 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2009-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -81,8 +81,10 @@ # define wchar_t int #endif -/* Some platforms lack max_align_t. */ -#if !@HAVE_MAX_ALIGN_T@ +/* Some platforms lack max_align_t. The check for _GCC_MAX_ALIGN_T is + a hack in case the configure-time test was done with g++ even though + we are currently compiling with gcc. */ +#if ! (@HAVE_MAX_ALIGN_T@ || defined _GCC_MAX_ALIGN_T) /* On the x86, the maximum storage alignment of double, long, etc. is 4, but GCC's C11 ABI for x86 says that max_align_t has an alignment of 8, and the C11 standard allows this. Work around this problem by diff -Nru datamash-1.0.7/lib/stdint.in.h datamash-1.1.1/lib/stdint.in.h --- datamash-1.0.7/lib/stdint.in.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/stdint.in.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2002, 2004-2015 Free Software Foundation, Inc. +/* Copyright (C) 2001-2002, 2004-2017 Free Software Foundation, Inc. Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood. This file is part of gnulib. @@ -79,54 +79,60 @@ #if ! defined _@GUARD_PREFIX@_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H #define _@GUARD_PREFIX@_STDINT_H +/* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX, + LONG_MIN, LONG_MAX, ULONG_MAX, _GL_INTEGER_WIDTH. */ +#include + +/* Override WINT_MIN and WINT_MAX if gnulib's or overrides + wint_t. */ +#if @GNULIB_OVERRIDES_WINT_T@ +# undef WINT_MIN +# undef WINT_MAX +# define WINT_MIN 0x0U +# define WINT_MAX 0xffffffffU +#endif + +#if ! @HAVE_C99_STDINT_H@ + /* defines some of the stdint.h types as well, on glibc, IRIX 6.5, and OpenBSD 3.8 (via ). AIX 5.2 isn't needed and causes troubles. Mac OS X 10.4.6 includes (which is us), but relies on the system definitions, so include after @NEXT_STDINT_H@. */ -#if @HAVE_SYS_TYPES_H@ && ! defined _AIX -# include -#endif - -/* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX, - LONG_MIN, LONG_MAX, ULONG_MAX. */ -#include +# if @HAVE_SYS_TYPES_H@ && ! defined _AIX +# include +# endif -#if @HAVE_INTTYPES_H@ +# if @HAVE_INTTYPES_H@ /* In OpenBSD 3.8, includes , which defines int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__. also defines intptr_t and uintptr_t. */ -# include -#elif @HAVE_SYS_INTTYPES_H@ +# include +# elif @HAVE_SYS_INTTYPES_H@ /* Solaris 7 has the types except the *_fast*_t types, and the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX. */ -# include -#endif +# include +# endif -#if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__ +# if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__ /* Linux libc4 >= 4.6.7 and libc5 have a that defines int{8,16,32,64}_t and __BIT_TYPES_DEFINED__. In libc5 >= 5.2.2 it is included by . */ -# include -#endif +# include +# endif -#undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H +# undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H /* Minimum and maximum values for an integer type under the usual assumption. Return an unspecified value if BITS == 0, adding a check to pacify picky compilers. */ -#define _STDINT_MIN(signed, bits, zero) \ - ((signed) ? (- ((zero) + 1) << ((bits) ? (bits) - 1 : 0)) : (zero)) +# define _STDINT_MIN(signed, bits, zero) \ + ((signed) ? ~ _STDINT_MAX (signed, bits, zero) : (zero)) -#define _STDINT_MAX(signed, bits, zero) \ - ((signed) \ - ? ~ _STDINT_MIN (signed, bits, zero) \ - : /* The expression for the unsigned case. The subtraction of (signed) \ - is a nop in the unsigned case and avoids "signed integer overflow" \ - warnings in the signed case. */ \ - ((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1) +# define _STDINT_MAX(signed, bits, zero) \ + (((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1) #if !GNULIB_defined_stdint_types @@ -135,26 +141,26 @@ /* Here we assume a standard architecture where the hardware integer types have 8, 16, 32, optionally 64 bits. */ -#undef int8_t -#undef uint8_t +# undef int8_t +# undef uint8_t typedef signed char gl_int8_t; typedef unsigned char gl_uint8_t; -#define int8_t gl_int8_t -#define uint8_t gl_uint8_t +# define int8_t gl_int8_t +# define uint8_t gl_uint8_t -#undef int16_t -#undef uint16_t +# undef int16_t +# undef uint16_t typedef short int gl_int16_t; typedef unsigned short int gl_uint16_t; -#define int16_t gl_int16_t -#define uint16_t gl_uint16_t +# define int16_t gl_int16_t +# define uint16_t gl_uint16_t -#undef int32_t -#undef uint32_t +# undef int32_t +# undef uint32_t typedef int gl_int32_t; typedef unsigned int gl_uint32_t; -#define int32_t gl_int32_t -#define uint32_t gl_uint32_t +# define int32_t gl_int32_t +# define uint32_t gl_uint32_t /* If the system defines INT64_MAX, assume int64_t works. That way, if the underlying platform defines int64_t to be a 64-bit long long @@ -162,54 +168,54 @@ int, which would mess up C++ name mangling. We must use #ifdef rather than #if, to avoid an error with HP-UX 10.20 cc. */ -#ifdef INT64_MAX -# define GL_INT64_T -#else +# ifdef INT64_MAX +# define GL_INT64_T +# else /* Do not undefine int64_t if gnulib is not being used with 64-bit types, since otherwise it breaks platforms like Tandem/NSK. */ -# if LONG_MAX >> 31 >> 31 == 1 -# undef int64_t +# if LONG_MAX >> 31 >> 31 == 1 +# undef int64_t typedef long int gl_int64_t; -# define int64_t gl_int64_t -# define GL_INT64_T -# elif defined _MSC_VER -# undef int64_t +# define int64_t gl_int64_t +# define GL_INT64_T +# elif defined _MSC_VER +# undef int64_t typedef __int64 gl_int64_t; -# define int64_t gl_int64_t -# define GL_INT64_T -# elif @HAVE_LONG_LONG_INT@ -# undef int64_t +# define int64_t gl_int64_t +# define GL_INT64_T +# elif @HAVE_LONG_LONG_INT@ +# undef int64_t typedef long long int gl_int64_t; -# define int64_t gl_int64_t -# define GL_INT64_T +# define int64_t gl_int64_t +# define GL_INT64_T +# endif # endif -#endif -#ifdef UINT64_MAX -# define GL_UINT64_T -#else -# if ULONG_MAX >> 31 >> 31 >> 1 == 1 -# undef uint64_t -typedef unsigned long int gl_uint64_t; -# define uint64_t gl_uint64_t +# ifdef UINT64_MAX # define GL_UINT64_T -# elif defined _MSC_VER -# undef uint64_t +# else +# if ULONG_MAX >> 31 >> 31 >> 1 == 1 +# undef uint64_t +typedef unsigned long int gl_uint64_t; +# define uint64_t gl_uint64_t +# define GL_UINT64_T +# elif defined _MSC_VER +# undef uint64_t typedef unsigned __int64 gl_uint64_t; -# define uint64_t gl_uint64_t -# define GL_UINT64_T -# elif @HAVE_UNSIGNED_LONG_LONG_INT@ -# undef uint64_t +# define uint64_t gl_uint64_t +# define GL_UINT64_T +# elif @HAVE_UNSIGNED_LONG_LONG_INT@ +# undef uint64_t typedef unsigned long long int gl_uint64_t; -# define uint64_t gl_uint64_t -# define GL_UINT64_T +# define uint64_t gl_uint64_t +# define GL_UINT64_T +# endif # endif -#endif /* Avoid collision with Solaris 2.5.1 etc. */ -#define _UINT8_T -#define _UINT32_T -#define _UINT64_T +# define _UINT8_T +# define _UINT32_T +# define _UINT64_T /* 7.18.1.2. Minimum-width integer types */ @@ -218,26 +224,26 @@ types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types are the same as the corresponding N_t types. */ -#undef int_least8_t -#undef uint_least8_t -#undef int_least16_t -#undef uint_least16_t -#undef int_least32_t -#undef uint_least32_t -#undef int_least64_t -#undef uint_least64_t -#define int_least8_t int8_t -#define uint_least8_t uint8_t -#define int_least16_t int16_t -#define uint_least16_t uint16_t -#define int_least32_t int32_t -#define uint_least32_t uint32_t -#ifdef GL_INT64_T -# define int_least64_t int64_t -#endif -#ifdef GL_UINT64_T -# define uint_least64_t uint64_t -#endif +# undef int_least8_t +# undef uint_least8_t +# undef int_least16_t +# undef uint_least16_t +# undef int_least32_t +# undef uint_least32_t +# undef int_least64_t +# undef uint_least64_t +# define int_least8_t int8_t +# define uint_least8_t uint8_t +# define int_least16_t int16_t +# define uint_least16_t uint16_t +# define int_least32_t int32_t +# define uint_least32_t uint32_t +# ifdef GL_INT64_T +# define int_least64_t int64_t +# endif +# ifdef GL_UINT64_T +# define uint_least64_t uint64_t +# endif /* 7.18.1.3. Fastest minimum-width integer types */ @@ -250,50 +256,55 @@ uses types consistent with glibc, as that lessens the chance of incompatibility with older GNU hosts. */ -#undef int_fast8_t -#undef uint_fast8_t -#undef int_fast16_t -#undef uint_fast16_t -#undef int_fast32_t -#undef uint_fast32_t -#undef int_fast64_t -#undef uint_fast64_t +# undef int_fast8_t +# undef uint_fast8_t +# undef int_fast16_t +# undef uint_fast16_t +# undef int_fast32_t +# undef uint_fast32_t +# undef int_fast64_t +# undef uint_fast64_t typedef signed char gl_int_fast8_t; typedef unsigned char gl_uint_fast8_t; -#ifdef __sun +# ifdef __sun /* Define types compatible with SunOS 5.10, so that code compiled under earlier SunOS versions works with code compiled under SunOS 5.10. */ typedef int gl_int_fast32_t; typedef unsigned int gl_uint_fast32_t; -#else +# else typedef long int gl_int_fast32_t; typedef unsigned long int gl_uint_fast32_t; -#endif +# endif typedef gl_int_fast32_t gl_int_fast16_t; typedef gl_uint_fast32_t gl_uint_fast16_t; -#define int_fast8_t gl_int_fast8_t -#define uint_fast8_t gl_uint_fast8_t -#define int_fast16_t gl_int_fast16_t -#define uint_fast16_t gl_uint_fast16_t -#define int_fast32_t gl_int_fast32_t -#define uint_fast32_t gl_uint_fast32_t -#ifdef GL_INT64_T -# define int_fast64_t int64_t -#endif -#ifdef GL_UINT64_T -# define uint_fast64_t uint64_t -#endif +# define int_fast8_t gl_int_fast8_t +# define uint_fast8_t gl_uint_fast8_t +# define int_fast16_t gl_int_fast16_t +# define uint_fast16_t gl_uint_fast16_t +# define int_fast32_t gl_int_fast32_t +# define uint_fast32_t gl_uint_fast32_t +# ifdef GL_INT64_T +# define int_fast64_t int64_t +# endif +# ifdef GL_UINT64_T +# define uint_fast64_t uint64_t +# endif /* 7.18.1.4. Integer types capable of holding object pointers */ -#undef intptr_t -#undef uintptr_t +/* kLIBC's stdint.h defines _INTPTR_T_DECLARED and needs its own + definitions of intptr_t and uintptr_t (which use int and unsigned) + to avoid clashes with declarations of system functions like sbrk. */ +# ifndef _INTPTR_T_DECLARED +# undef intptr_t +# undef uintptr_t typedef long int gl_intptr_t; typedef unsigned long int gl_uintptr_t; -#define intptr_t gl_intptr_t -#define uintptr_t gl_uintptr_t +# define intptr_t gl_intptr_t +# define uintptr_t gl_uintptr_t +# endif /* 7.18.1.5. Greatest-width integer types */ @@ -304,33 +315,33 @@ similarly for UINTMAX_MAX and uintmax_t. This avoids problems with assuming one type where another is used by the system. */ -#ifndef INTMAX_MAX -# undef INTMAX_C -# undef intmax_t -# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 +# ifndef INTMAX_MAX +# undef INTMAX_C +# undef intmax_t +# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 typedef long long int gl_intmax_t; -# define intmax_t gl_intmax_t -# elif defined GL_INT64_T -# define intmax_t int64_t -# else +# define intmax_t gl_intmax_t +# elif defined GL_INT64_T +# define intmax_t int64_t +# else typedef long int gl_intmax_t; -# define intmax_t gl_intmax_t +# define intmax_t gl_intmax_t +# endif # endif -#endif -#ifndef UINTMAX_MAX -# undef UINTMAX_C -# undef uintmax_t -# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +# ifndef UINTMAX_MAX +# undef UINTMAX_C +# undef uintmax_t +# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 typedef unsigned long long int gl_uintmax_t; -# define uintmax_t gl_uintmax_t -# elif defined GL_UINT64_T -# define uintmax_t uint64_t -# else +# define uintmax_t gl_uintmax_t +# elif defined GL_UINT64_T +# define uintmax_t uint64_t +# else typedef unsigned long int gl_uintmax_t; -# define uintmax_t gl_uintmax_t +# define uintmax_t gl_uintmax_t +# endif # endif -#endif /* Verify that intmax_t and uintmax_t have the same size. Too much code breaks if this is not the case. If this check fails, the reason is likely @@ -338,8 +349,8 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) ? 1 : -1]; -#define GNULIB_defined_stdint_types 1 -#endif /* !GNULIB_defined_stdint_types */ +# define GNULIB_defined_stdint_types 1 +# endif /* !GNULIB_defined_stdint_types */ /* 7.18.2. Limits of specified-width integer types */ @@ -348,37 +359,37 @@ /* Here we assume a standard architecture where the hardware integer types have 8, 16, 32, optionally 64 bits. */ -#undef INT8_MIN -#undef INT8_MAX -#undef UINT8_MAX -#define INT8_MIN (~ INT8_MAX) -#define INT8_MAX 127 -#define UINT8_MAX 255 - -#undef INT16_MIN -#undef INT16_MAX -#undef UINT16_MAX -#define INT16_MIN (~ INT16_MAX) -#define INT16_MAX 32767 -#define UINT16_MAX 65535 - -#undef INT32_MIN -#undef INT32_MAX -#undef UINT32_MAX -#define INT32_MIN (~ INT32_MAX) -#define INT32_MAX 2147483647 -#define UINT32_MAX 4294967295U +# undef INT8_MIN +# undef INT8_MAX +# undef UINT8_MAX +# define INT8_MIN (~ INT8_MAX) +# define INT8_MAX 127 +# define UINT8_MAX 255 + +# undef INT16_MIN +# undef INT16_MAX +# undef UINT16_MAX +# define INT16_MIN (~ INT16_MAX) +# define INT16_MAX 32767 +# define UINT16_MAX 65535 + +# undef INT32_MIN +# undef INT32_MAX +# undef UINT32_MAX +# define INT32_MIN (~ INT32_MAX) +# define INT32_MAX 2147483647 +# define UINT32_MAX 4294967295U -#if defined GL_INT64_T && ! defined INT64_MAX +# if defined GL_INT64_T && ! defined INT64_MAX /* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0 evaluates the latter incorrectly in preprocessor expressions. */ -# define INT64_MIN (- INTMAX_C (1) << 63) -# define INT64_MAX INTMAX_C (9223372036854775807) -#endif +# define INT64_MIN (- INTMAX_C (1) << 63) +# define INT64_MAX INTMAX_C (9223372036854775807) +# endif -#if defined GL_UINT64_T && ! defined UINT64_MAX -# define UINT64_MAX UINTMAX_C (18446744073709551615) -#endif +# if defined GL_UINT64_T && ! defined UINT64_MAX +# define UINT64_MAX UINTMAX_C (18446744073709551615) +# endif /* 7.18.2.2. Limits of minimum-width integer types */ @@ -386,38 +397,38 @@ types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types are the same as the corresponding N_t types. */ -#undef INT_LEAST8_MIN -#undef INT_LEAST8_MAX -#undef UINT_LEAST8_MAX -#define INT_LEAST8_MIN INT8_MIN -#define INT_LEAST8_MAX INT8_MAX -#define UINT_LEAST8_MAX UINT8_MAX - -#undef INT_LEAST16_MIN -#undef INT_LEAST16_MAX -#undef UINT_LEAST16_MAX -#define INT_LEAST16_MIN INT16_MIN -#define INT_LEAST16_MAX INT16_MAX -#define UINT_LEAST16_MAX UINT16_MAX - -#undef INT_LEAST32_MIN -#undef INT_LEAST32_MAX -#undef UINT_LEAST32_MAX -#define INT_LEAST32_MIN INT32_MIN -#define INT_LEAST32_MAX INT32_MAX -#define UINT_LEAST32_MAX UINT32_MAX - -#undef INT_LEAST64_MIN -#undef INT_LEAST64_MAX -#ifdef GL_INT64_T -# define INT_LEAST64_MIN INT64_MIN -# define INT_LEAST64_MAX INT64_MAX -#endif - -#undef UINT_LEAST64_MAX -#ifdef GL_UINT64_T -# define UINT_LEAST64_MAX UINT64_MAX -#endif +# undef INT_LEAST8_MIN +# undef INT_LEAST8_MAX +# undef UINT_LEAST8_MAX +# define INT_LEAST8_MIN INT8_MIN +# define INT_LEAST8_MAX INT8_MAX +# define UINT_LEAST8_MAX UINT8_MAX + +# undef INT_LEAST16_MIN +# undef INT_LEAST16_MAX +# undef UINT_LEAST16_MAX +# define INT_LEAST16_MIN INT16_MIN +# define INT_LEAST16_MAX INT16_MAX +# define UINT_LEAST16_MAX UINT16_MAX + +# undef INT_LEAST32_MIN +# undef INT_LEAST32_MAX +# undef UINT_LEAST32_MAX +# define INT_LEAST32_MIN INT32_MIN +# define INT_LEAST32_MAX INT32_MAX +# define UINT_LEAST32_MAX UINT32_MAX + +# undef INT_LEAST64_MIN +# undef INT_LEAST64_MAX +# ifdef GL_INT64_T +# define INT_LEAST64_MIN INT64_MIN +# define INT_LEAST64_MAX INT64_MAX +# endif + +# undef UINT_LEAST64_MAX +# ifdef GL_UINT64_T +# define UINT_LEAST64_MAX UINT64_MAX +# endif /* 7.18.2.3. Limits of fastest minimum-width integer types */ @@ -425,117 +436,117 @@ types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types are taken from the same list of types. */ -#undef INT_FAST8_MIN -#undef INT_FAST8_MAX -#undef UINT_FAST8_MAX -#define INT_FAST8_MIN SCHAR_MIN -#define INT_FAST8_MAX SCHAR_MAX -#define UINT_FAST8_MAX UCHAR_MAX - -#undef INT_FAST16_MIN -#undef INT_FAST16_MAX -#undef UINT_FAST16_MAX -#define INT_FAST16_MIN INT_FAST32_MIN -#define INT_FAST16_MAX INT_FAST32_MAX -#define UINT_FAST16_MAX UINT_FAST32_MAX - -#undef INT_FAST32_MIN -#undef INT_FAST32_MAX -#undef UINT_FAST32_MAX -#ifdef __sun -# define INT_FAST32_MIN INT_MIN -# define INT_FAST32_MAX INT_MAX -# define UINT_FAST32_MAX UINT_MAX -#else -# define INT_FAST32_MIN LONG_MIN -# define INT_FAST32_MAX LONG_MAX -# define UINT_FAST32_MAX ULONG_MAX -#endif +# undef INT_FAST8_MIN +# undef INT_FAST8_MAX +# undef UINT_FAST8_MAX +# define INT_FAST8_MIN SCHAR_MIN +# define INT_FAST8_MAX SCHAR_MAX +# define UINT_FAST8_MAX UCHAR_MAX + +# undef INT_FAST16_MIN +# undef INT_FAST16_MAX +# undef UINT_FAST16_MAX +# define INT_FAST16_MIN INT_FAST32_MIN +# define INT_FAST16_MAX INT_FAST32_MAX +# define UINT_FAST16_MAX UINT_FAST32_MAX + +# undef INT_FAST32_MIN +# undef INT_FAST32_MAX +# undef UINT_FAST32_MAX +# ifdef __sun +# define INT_FAST32_MIN INT_MIN +# define INT_FAST32_MAX INT_MAX +# define UINT_FAST32_MAX UINT_MAX +# else +# define INT_FAST32_MIN LONG_MIN +# define INT_FAST32_MAX LONG_MAX +# define UINT_FAST32_MAX ULONG_MAX +# endif -#undef INT_FAST64_MIN -#undef INT_FAST64_MAX -#ifdef GL_INT64_T -# define INT_FAST64_MIN INT64_MIN -# define INT_FAST64_MAX INT64_MAX -#endif +# undef INT_FAST64_MIN +# undef INT_FAST64_MAX +# ifdef GL_INT64_T +# define INT_FAST64_MIN INT64_MIN +# define INT_FAST64_MAX INT64_MAX +# endif -#undef UINT_FAST64_MAX -#ifdef GL_UINT64_T -# define UINT_FAST64_MAX UINT64_MAX -#endif +# undef UINT_FAST64_MAX +# ifdef GL_UINT64_T +# define UINT_FAST64_MAX UINT64_MAX +# endif /* 7.18.2.4. Limits of integer types capable of holding object pointers */ -#undef INTPTR_MIN -#undef INTPTR_MAX -#undef UINTPTR_MAX -#define INTPTR_MIN LONG_MIN -#define INTPTR_MAX LONG_MAX -#define UINTPTR_MAX ULONG_MAX +# undef INTPTR_MIN +# undef INTPTR_MAX +# undef UINTPTR_MAX +# define INTPTR_MIN LONG_MIN +# define INTPTR_MAX LONG_MAX +# define UINTPTR_MAX ULONG_MAX /* 7.18.2.5. Limits of greatest-width integer types */ -#ifndef INTMAX_MAX -# undef INTMAX_MIN -# ifdef INT64_MAX -# define INTMAX_MIN INT64_MIN -# define INTMAX_MAX INT64_MAX -# else -# define INTMAX_MIN INT32_MIN -# define INTMAX_MAX INT32_MAX +# ifndef INTMAX_MAX +# undef INTMAX_MIN +# ifdef INT64_MAX +# define INTMAX_MIN INT64_MIN +# define INTMAX_MAX INT64_MAX +# else +# define INTMAX_MIN INT32_MIN +# define INTMAX_MAX INT32_MAX +# endif # endif -#endif -#ifndef UINTMAX_MAX -# ifdef UINT64_MAX -# define UINTMAX_MAX UINT64_MAX -# else -# define UINTMAX_MAX UINT32_MAX +# ifndef UINTMAX_MAX +# ifdef UINT64_MAX +# define UINTMAX_MAX UINT64_MAX +# else +# define UINTMAX_MAX UINT32_MAX +# endif # endif -#endif /* 7.18.3. Limits of other integer types */ /* ptrdiff_t limits */ -#undef PTRDIFF_MIN -#undef PTRDIFF_MAX -#if @APPLE_UNIVERSAL_BUILD@ -# ifdef _LP64 -# define PTRDIFF_MIN _STDINT_MIN (1, 64, 0l) -# define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l) +# undef PTRDIFF_MIN +# undef PTRDIFF_MAX +# if @APPLE_UNIVERSAL_BUILD@ +# ifdef _LP64 +# define PTRDIFF_MIN _STDINT_MIN (1, 64, 0l) +# define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l) +# else +# define PTRDIFF_MIN _STDINT_MIN (1, 32, 0) +# define PTRDIFF_MAX _STDINT_MAX (1, 32, 0) +# endif # else -# define PTRDIFF_MIN _STDINT_MIN (1, 32, 0) -# define PTRDIFF_MAX _STDINT_MAX (1, 32, 0) -# endif -#else -# define PTRDIFF_MIN \ +# define PTRDIFF_MIN \ _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) -# define PTRDIFF_MAX \ +# define PTRDIFF_MAX \ _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) -#endif +# endif /* sig_atomic_t limits */ -#undef SIG_ATOMIC_MIN -#undef SIG_ATOMIC_MAX -#define SIG_ATOMIC_MIN \ +# undef SIG_ATOMIC_MIN +# undef SIG_ATOMIC_MAX +# define SIG_ATOMIC_MIN \ _STDINT_MIN (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \ 0@SIG_ATOMIC_T_SUFFIX@) -#define SIG_ATOMIC_MAX \ +# define SIG_ATOMIC_MAX \ _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \ 0@SIG_ATOMIC_T_SUFFIX@) /* size_t limit */ -#undef SIZE_MAX -#if @APPLE_UNIVERSAL_BUILD@ -# ifdef _LP64 -# define SIZE_MAX _STDINT_MAX (0, 64, 0ul) +# undef SIZE_MAX +# if @APPLE_UNIVERSAL_BUILD@ +# ifdef _LP64 +# define SIZE_MAX _STDINT_MAX (0, 64, 0ul) +# else +# define SIZE_MAX _STDINT_MAX (0, 32, 0ul) +# endif # else -# define SIZE_MAX _STDINT_MAX (0, 32, 0ul) +# define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@) # endif -#else -# define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@) -#endif /* wchar_t limits */ /* Get WCHAR_MIN, WCHAR_MAX. @@ -543,29 +554,29 @@ sequence of nested includes -> -> -> , and the latter includes and assumes its types are already defined. */ -#if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX) +# if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX) /* BSD/OS 4.0.1 has a bug: , and must be included before . */ -# include -# include -# include -# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H -# include -# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H -#endif -#undef WCHAR_MIN -#undef WCHAR_MAX -#define WCHAR_MIN \ +# include +# include +# include +# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H +# include +# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H +# endif +# undef WCHAR_MIN +# undef WCHAR_MAX +# define WCHAR_MIN \ _STDINT_MIN (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) -#define WCHAR_MAX \ +# define WCHAR_MAX \ _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@) /* wint_t limits */ -#undef WINT_MIN -#undef WINT_MAX -#define WINT_MIN \ +# undef WINT_MIN +# undef WINT_MAX +# define WINT_MIN \ _STDINT_MIN (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) -#define WINT_MAX \ +# define WINT_MAX \ _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@) /* 7.18.4. Macros for integer constants */ @@ -576,59 +587,120 @@ /* Here we assume a standard architecture where the hardware integer types have 8, 16, 32, optionally 64 bits, and int is 32 bits. */ -#undef INT8_C -#undef UINT8_C -#define INT8_C(x) x -#define UINT8_C(x) x - -#undef INT16_C -#undef UINT16_C -#define INT16_C(x) x -#define UINT16_C(x) x - -#undef INT32_C -#undef UINT32_C -#define INT32_C(x) x -#define UINT32_C(x) x ## U - -#undef INT64_C -#undef UINT64_C -#if LONG_MAX >> 31 >> 31 == 1 -# define INT64_C(x) x##L -#elif defined _MSC_VER -# define INT64_C(x) x##i64 -#elif @HAVE_LONG_LONG_INT@ -# define INT64_C(x) x##LL -#endif -#if ULONG_MAX >> 31 >> 31 >> 1 == 1 -# define UINT64_C(x) x##UL -#elif defined _MSC_VER -# define UINT64_C(x) x##ui64 -#elif @HAVE_UNSIGNED_LONG_LONG_INT@ -# define UINT64_C(x) x##ULL -#endif +# undef INT8_C +# undef UINT8_C +# define INT8_C(x) x +# define UINT8_C(x) x + +# undef INT16_C +# undef UINT16_C +# define INT16_C(x) x +# define UINT16_C(x) x + +# undef INT32_C +# undef UINT32_C +# define INT32_C(x) x +# define UINT32_C(x) x ## U + +# undef INT64_C +# undef UINT64_C +# if LONG_MAX >> 31 >> 31 == 1 +# define INT64_C(x) x##L +# elif defined _MSC_VER +# define INT64_C(x) x##i64 +# elif @HAVE_LONG_LONG_INT@ +# define INT64_C(x) x##LL +# endif +# if ULONG_MAX >> 31 >> 31 >> 1 == 1 +# define UINT64_C(x) x##UL +# elif defined _MSC_VER +# define UINT64_C(x) x##ui64 +# elif @HAVE_UNSIGNED_LONG_LONG_INT@ +# define UINT64_C(x) x##ULL +# endif /* 7.18.4.2. Macros for greatest-width integer constants */ -#ifndef INTMAX_C -# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 -# define INTMAX_C(x) x##LL -# elif defined GL_INT64_T -# define INTMAX_C(x) INT64_C(x) -# else -# define INTMAX_C(x) x##L +# ifndef INTMAX_C +# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 +# define INTMAX_C(x) x##LL +# elif defined GL_INT64_T +# define INTMAX_C(x) INT64_C(x) +# else +# define INTMAX_C(x) x##L +# endif # endif -#endif -#ifndef UINTMAX_C -# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 -# define UINTMAX_C(x) x##ULL -# elif defined GL_UINT64_T -# define UINTMAX_C(x) UINT64_C(x) -# else -# define UINTMAX_C(x) x##UL +# ifndef UINTMAX_C +# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 +# define UINTMAX_C(x) x##ULL +# elif defined GL_UINT64_T +# define UINTMAX_C(x) UINT64_C(x) +# else +# define UINTMAX_C(x) x##UL +# endif # endif -#endif + +#endif /* !@HAVE_C99_STDINT_H@ */ + +/* Macros specified by ISO/IEC TS 18661-1:2014. */ + +#if (!defined UINTMAX_WIDTH \ + && (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__)) +# ifdef INT8_MAX +# define INT8_WIDTH _GL_INTEGER_WIDTH (INT8_MIN, INT8_MAX) +# endif +# ifdef UINT8_MAX +# define UINT8_WIDTH _GL_INTEGER_WIDTH (0, UINT8_MAX) +# endif +# ifdef INT16_MAX +# define INT16_WIDTH _GL_INTEGER_WIDTH (INT16_MIN, INT16_MAX) +# endif +# ifdef UINT16_MAX +# define UINT16_WIDTH _GL_INTEGER_WIDTH (0, UINT16_MAX) +# endif +# ifdef INT32_MAX +# define INT32_WIDTH _GL_INTEGER_WIDTH (INT32_MIN, INT32_MAX) +# endif +# ifdef UINT32_MAX +# define UINT32_WIDTH _GL_INTEGER_WIDTH (0, UINT32_MAX) +# endif +# ifdef INT64_MAX +# define INT64_WIDTH _GL_INTEGER_WIDTH (INT64_MIN, INT64_MAX) +# endif +# ifdef UINT64_MAX +# define UINT64_WIDTH _GL_INTEGER_WIDTH (0, UINT64_MAX) +# endif +# define INT_LEAST8_WIDTH _GL_INTEGER_WIDTH (INT_LEAST8_MIN, INT_LEAST8_MAX) +# define UINT_LEAST8_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST8_MAX) +# define INT_LEAST16_WIDTH _GL_INTEGER_WIDTH (INT_LEAST16_MIN, INT_LEAST16_MAX) +# define UINT_LEAST16_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST16_MAX) +# define INT_LEAST32_WIDTH _GL_INTEGER_WIDTH (INT_LEAST32_MIN, INT_LEAST32_MAX) +# define UINT_LEAST32_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST32_MAX) +# define INT_LEAST64_WIDTH _GL_INTEGER_WIDTH (INT_LEAST64_MIN, INT_LEAST64_MAX) +# define UINT_LEAST64_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST64_MAX) +# define INT_FAST8_WIDTH _GL_INTEGER_WIDTH (INT_FAST8_MIN, INT_FAST8_MAX) +# define UINT_FAST8_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST8_MAX) +# define INT_FAST16_WIDTH _GL_INTEGER_WIDTH (INT_FAST16_MIN, INT_FAST16_MAX) +# define UINT_FAST16_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST16_MAX) +# define INT_FAST32_WIDTH _GL_INTEGER_WIDTH (INT_FAST32_MIN, INT_FAST32_MAX) +# define UINT_FAST32_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST32_MAX) +# define INT_FAST64_WIDTH _GL_INTEGER_WIDTH (INT_FAST64_MIN, INT_FAST64_MAX) +# define UINT_FAST64_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST64_MAX) +# define INTPTR_WIDTH _GL_INTEGER_WIDTH (INTPTR_MIN, INTPTR_MAX) +# define UINTPTR_WIDTH _GL_INTEGER_WIDTH (0, UINTPTR_MAX) +# define INTMAX_WIDTH _GL_INTEGER_WIDTH (INTMAX_MIN, INTMAX_MAX) +# define UINTMAX_WIDTH _GL_INTEGER_WIDTH (0, UINTMAX_MAX) +# define PTRDIFF_WIDTH _GL_INTEGER_WIDTH (PTRDIFF_MIN, PTRDIFF_MAX) +# define SIZE_WIDTH _GL_INTEGER_WIDTH (0, SIZE_MAX) +# define WCHAR_WIDTH _GL_INTEGER_WIDTH (WCHAR_MIN, WCHAR_MAX) +# ifdef WINT_MAX +# define WINT_WIDTH _GL_INTEGER_WIDTH (WINT_MIN, WINT_MAX) +# endif +# ifdef SIG_ATOMIC_MAX +# define SIG_ATOMIC_WIDTH _GL_INTEGER_WIDTH (SIG_ATOMIC_MIN, SIG_ATOMIC_MAX) +# endif +#endif /* !WINT_WIDTH && (_GNU_SOURCE || __STDC_WANT_IEC_60559_BFP_EXT__) */ #endif /* _@GUARD_PREFIX@_STDINT_H */ #endif /* !(defined __ANDROID__ && ...) */ diff -Nru datamash-1.0.7/lib/stdio-impl.h datamash-1.1.1/lib/stdio-impl.h --- datamash-1.0.7/lib/stdio-impl.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/lib/stdio-impl.h 2017-01-10 20:00:58.000000000 +0000 @@ -0,0 +1,140 @@ +/* Implementation details of FILE streams. + Copyright (C) 2007-2008, 2010-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Many stdio implementations have the same logic and therefore can share + the same implementation of stdio extension API, except that some fields + have different naming conventions, or their access requires some casts. */ + + +/* BSD stdio derived implementations. */ + +#if defined __NetBSD__ /* NetBSD */ +/* Get __NetBSD_Version__. */ +# include +#endif + +#include /* For detecting Plan9. */ + +#if defined __sferror || defined __DragonFly__ || defined __ANDROID__ + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ + +# if defined __DragonFly__ /* DragonFly */ + /* See . */ +# define fp_ ((struct { struct __FILE_public pub; \ + struct { unsigned char *_base; int _size; } _bf; \ + void *cookie; \ + void *_close; \ + void *_read; \ + void *_seek; \ + void *_write; \ + struct { unsigned char *_base; int _size; } _ub; \ + int _ur; \ + unsigned char _ubuf[3]; \ + unsigned char _nbuf[1]; \ + struct { unsigned char *_base; int _size; } _lb; \ + int _blksize; \ + fpos_t _offset; \ + /* More fields, not relevant here. */ \ + } *) fp) + /* See . */ +# define _p pub._p +# define _flags pub._flags +# define _r pub._r +# define _w pub._w +# else +# define fp_ fp +# endif + +# if (defined __NetBSD__ && __NetBSD_Version__ >= 105270000) || defined __OpenBSD__ || defined __minix || defined __ANDROID__ /* NetBSD >= 1.5ZA, OpenBSD, Minix 3, Android */ + /* See + and */ + struct __sfileext + { + struct __sbuf _ub; /* ungetc buffer */ + /* More fields, not relevant here. */ + }; +# define fp_ub ((struct __sfileext *) fp->_ext._base)->_ub +# else /* FreeBSD, NetBSD <= 1.5Z, DragonFly, Mac OS X, Cygwin, Android */ +# define fp_ub fp_->_ub +# endif + +# define HASUB(fp) (fp_ub._base != NULL) + +#endif + + +/* SystemV derived implementations. */ + +#ifdef __TANDEM /* NonStop Kernel */ +# ifndef _IOERR +/* These values were determined by the program 'stdioext-flags' at + . */ +# define _IOERR 0x40 +# define _IOREAD 0x80 +# define _IOWRT 0x4 +# define _IORW 0x100 +# endif +#endif + +#if defined _IOERR + +# if defined __sun && defined _LP64 /* Solaris/{SPARC,AMD64} 64-bit */ +# define fp_ ((struct { unsigned char *_ptr; \ + unsigned char *_base; \ + unsigned char *_end; \ + long _cnt; \ + int _file; \ + unsigned int _flag; \ + } *) fp) +# else +# define fp_ fp +# endif + +# if defined _SCO_DS /* OpenServer */ +# define _cnt __cnt +# define _ptr __ptr +# define _base __base +# define _flag __flag +# endif + +#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ /* newer Windows with MSVC */ + +/* does not define the innards of FILE any more. */ +# define WINDOWS_OPAQUE_FILE + +struct _gl_real_FILE +{ + /* Note: Compared to older Windows and to mingw, it has the fields + _base and _cnt swapped. */ + unsigned char *_ptr; + unsigned char *_base; + int _cnt; + int _flag; + int _file; + int _charbuf; + int _bufsiz; +}; +# define fp_ ((struct _gl_real_FILE *) fp) + +/* These values were determined by a program similar to the one at + . */ +# define _IOREAD 0x1 +# define _IOWRT 0x2 +# define _IORW 0x4 +# define _IOEOF 0x8 +# define _IOERR 0x10 + +#endif diff -Nru datamash-1.0.7/lib/stdio.in.h datamash-1.1.1/lib/stdio.in.h --- datamash-1.0.7/lib/stdio.in.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/stdio.in.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* A GNU-like . - Copyright (C) 2004, 2007-2015 Free Software Foundation, Inc. + Copyright (C) 2004, 2007-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -118,6 +118,26 @@ # include #endif +/* MSVC declares 'perror' in , not in . We must include + it before we #define perror rpl_perror. */ +/* But in any case avoid namespace pollution on glibc systems. */ +#if (@GNULIB_PERROR@ || defined GNULIB_POSIXCHECK) \ + && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \ + && ! defined __GLIBC__ +# include +#endif + +/* MSVC declares 'remove' in , not in . We must include + it before we #define remove rpl_remove. */ +/* MSVC declares 'rename' in , not in . We must include + it before we #define rename rpl_rename. */ +/* But in any case avoid namespace pollution on glibc systems. */ +#if (@GNULIB_REMOVE@ || @GNULIB_RENAME@ || defined GNULIB_POSIXCHECK) \ + && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \ + && ! defined __GLIBC__ +# include +#endif + /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ @@ -723,11 +743,10 @@ so any use of gets warrants an unconditional warning; besides, C11 removed it. */ #undef gets -#if HAVE_RAW_DECL_GETS +#if HAVE_RAW_DECL_GETS && !defined __cplusplus _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); #endif - #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@ struct obstack; /* Grow an obstack with formatted output. Return the number of diff -Nru datamash-1.0.7/lib/stdlib.in.h datamash-1.1.1/lib/stdlib.in.h --- datamash-1.0.7/lib/stdlib.in.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/stdlib.in.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* A GNU-like . - Copyright (C) 1995, 2001-2004, 2006-2015 Free Software Foundation, Inc. + Copyright (C) 1995, 2001-2004, 2006-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -521,6 +521,9 @@ #endif #if @GNULIB_QSORT_R@ +/* Sort an array of NMEMB elements, starting at address BASE, each element + occupying SIZE bytes, in ascending order according to the comparison + function COMPARE. */ # if @REPLACE_QSORT_R@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef qsort_r @@ -535,12 +538,24 @@ void *), void *arg)); # else +# if !@HAVE_QSORT_R@ +_GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, + int (*compare) (void const *, void const *, + void *), + void *arg) _GL_ARG_NONNULL ((1, 4))); +# endif _GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, int (*compare) (void const *, void const *, void *), void *arg)); # endif _GL_CXXALIASWARN (qsort_r); +#elif defined GNULIB_POSIXCHECK +# undef qsort_r +# if HAVE_RAW_DECL_QSORT_R +_GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - " + "use gnulib module qsort_r for portability"); +# endif #endif diff -Nru datamash-1.0.7/lib/stdnoreturn.in.h datamash-1.1.1/lib/stdnoreturn.in.h --- datamash-1.0.7/lib/stdnoreturn.in.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/stdnoreturn.in.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* A substitute for ISO C11 . - Copyright 2012-2015 Free Software Foundation, Inc. + Copyright 2012-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/stpcpy.c datamash-1.1.1/lib/stpcpy.c --- datamash-1.0.7/lib/stpcpy.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/lib/stpcpy.c 2017-01-10 20:01:00.000000000 +0000 @@ -0,0 +1,49 @@ +/* stpcpy.c -- copy a string and return pointer to end of new string + Copyright (C) 1992, 1995, 1997-1998, 2006, 2009-2017 Free Software + Foundation, Inc. + + NOTE: The canonical source of this file is maintained with the GNU C Library. + Bugs can be reported to bug-glibc@prep.ai.mit.edu. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 3 of the License, or any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include + +#include + +#undef __stpcpy +#ifdef _LIBC +# undef stpcpy +#endif + +#ifndef weak_alias +# define __stpcpy stpcpy +#endif + +/* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */ +char * +__stpcpy (char *dest, const char *src) +{ + register char *d = dest; + register const char *s = src; + + do + *d++ = *s; + while (*s++ != '\0'); + + return d - 1; +} +#ifdef weak_alias +weak_alias (__stpcpy, stpcpy) +#endif diff -Nru datamash-1.0.7/lib/streq.h datamash-1.1.1/lib/streq.h --- datamash-1.0.7/lib/streq.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/streq.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Optimized string comparison. - Copyright (C) 2001-2002, 2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2007, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published diff -Nru datamash-1.0.7/lib/strerror.c datamash-1.1.1/lib/strerror.c --- datamash-1.0.7/lib/strerror.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/strerror.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* strerror.c --- POSIX compatible system error routine - Copyright (C) 2007-2015 Free Software Foundation, Inc. + Copyright (C) 2007-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -66,5 +66,6 @@ if (sizeof buf <= len) abort (); - return memcpy (buf, msg, len + 1); + memcpy (buf, msg, len + 1); + return buf; } diff -Nru datamash-1.0.7/lib/strerror-override.c datamash-1.1.1/lib/strerror-override.c --- datamash-1.0.7/lib/strerror-override.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/strerror-override.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* strerror-override.c --- POSIX compatible system error routine - Copyright (C) 2010-2015 Free Software Foundation, Inc. + Copyright (C) 2010-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/strerror-override.h datamash-1.1.1/lib/strerror-override.h --- datamash-1.0.7/lib/strerror-override.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/strerror-override.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* strerror-override.h --- POSIX compatible system error routine - Copyright (C) 2010-2015 Free Software Foundation, Inc. + Copyright (C) 2010-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/striconv.c datamash-1.1.1/lib/striconv.c --- datamash-1.0.7/lib/striconv.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/striconv.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Charset conversion. - Copyright (C) 2001-2007, 2010-2015 Free Software Foundation, Inc. + Copyright (C) 2001-2007, 2010-2017 Free Software Foundation, Inc. Written by Bruno Haible and Simon Josefsson. This program is free software; you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/striconv.h datamash-1.1.1/lib/striconv.h --- datamash-1.0.7/lib/striconv.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/striconv.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Charset conversion. - Copyright (C) 2001-2004, 2006-2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2001-2004, 2006-2007, 2009-2017 Free Software Foundation, Inc. Written by Bruno Haible and Simon Josefsson. This program is free software; you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/string.in.h datamash-1.1.1/lib/string.in.h --- datamash-1.0.7/lib/string.in.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/string.in.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* A GNU-like . - Copyright (C) 1995-1996, 2001-2015 Free Software Foundation, Inc. + Copyright (C) 1995-1996, 2001-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,16 +15,32 @@ You should have received a copy of the GNU General Public License along with this program; if not, see . */ -#ifndef _@GUARD_PREFIX@_STRING_H - #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ #endif @PRAGMA_COLUMNS@ +#if defined _GL_ALREADY_INCLUDING_STRING_H +/* Special invocation convention: + - On OS X/NetBSD we have a sequence of nested includes + -> -> "string.h" + In this situation system _chk variants due to -D_FORTIFY_SOURCE + might be used after any replacements defined here. */ + +#@INCLUDE_NEXT@ @NEXT_STRING_H@ + +#else +/* Normal invocation convention. */ + +#ifndef _@GUARD_PREFIX@_STRING_H + +#define _GL_ALREADY_INCLUDING_STRING_H + /* The include_next requires a split double-inclusion guard. */ #@INCLUDE_NEXT@ @NEXT_STRING_H@ +#undef _GL_ALREADY_INCLUDING_STRING_H + #ifndef _@GUARD_PREFIX@_STRING_H #define _@GUARD_PREFIX@_STRING_H @@ -400,15 +416,15 @@ # undef strndup # define strndup rpl_strndup # endif -_GL_FUNCDECL_RPL (strndup, char *, (char const *__string, size_t __n) +_GL_FUNCDECL_RPL (strndup, char *, (char const *__s, size_t __n) _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (strndup, char *, (char const *__string, size_t __n)); +_GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n)); # else # if ! @HAVE_DECL_STRNDUP@ -_GL_FUNCDECL_SYS (strndup, char *, (char const *__string, size_t __n) +_GL_FUNCDECL_SYS (strndup, char *, (char const *__s, size_t __n) _GL_ARG_NONNULL ((1))); # endif -_GL_CXXALIAS_SYS (strndup, char *, (char const *__string, size_t __n)); +_GL_CXXALIAS_SYS (strndup, char *, (char const *__s, size_t __n)); # endif _GL_CXXALIASWARN (strndup); #elif defined GNULIB_POSIXCHECK @@ -428,17 +444,17 @@ # undef strnlen # define strnlen rpl_strnlen # endif -_GL_FUNCDECL_RPL (strnlen, size_t, (char const *__string, size_t __maxlen) +_GL_FUNCDECL_RPL (strnlen, size_t, (char const *__s, size_t __maxlen) _GL_ATTRIBUTE_PURE _GL_ARG_NONNULL ((1))); -_GL_CXXALIAS_RPL (strnlen, size_t, (char const *__string, size_t __maxlen)); +_GL_CXXALIAS_RPL (strnlen, size_t, (char const *__s, size_t __maxlen)); # else # if ! @HAVE_DECL_STRNLEN@ -_GL_FUNCDECL_SYS (strnlen, size_t, (char const *__string, size_t __maxlen) +_GL_FUNCDECL_SYS (strnlen, size_t, (char const *__s, size_t __maxlen) _GL_ATTRIBUTE_PURE _GL_ARG_NONNULL ((1))); # endif -_GL_CXXALIAS_SYS (strnlen, size_t, (char const *__string, size_t __maxlen)); +_GL_CXXALIAS_SYS (strnlen, size_t, (char const *__s, size_t __maxlen)); # endif _GL_CXXALIASWARN (strnlen); #elif defined GNULIB_POSIXCHECK @@ -1027,3 +1043,4 @@ #endif /* _@GUARD_PREFIX@_STRING_H */ #endif /* _@GUARD_PREFIX@_STRING_H */ +#endif diff -Nru datamash-1.0.7/lib/stripslash.c datamash-1.1.1/lib/stripslash.c --- datamash-1.0.7/lib/stripslash.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/stripslash.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* stripslash.c -- remove redundant trailing slashes from a file name - Copyright (C) 1990, 2001, 2003-2006, 2009-2015 Free Software Foundation, + Copyright (C) 1990, 2001, 2003-2006, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/str-kmp.h datamash-1.1.1/lib/str-kmp.h --- datamash-1.0.7/lib/str-kmp.h 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/str-kmp.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* Substring search in a NUL terminated string of UNIT elements, using the Knuth-Morris-Pratt algorithm. - Copyright (C) 2005-2015 Free Software Foundation, Inc. + Copyright (C) 2005-2017 Free Software Foundation, Inc. Written by Bruno Haible , 2005. This program is free software; you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/strndup.c datamash-1.1.1/lib/strndup.c --- datamash-1.0.7/lib/strndup.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/strndup.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* A replacement function, for systems that lack strndup. - Copyright (C) 1996-1998, 2001-2003, 2005-2007, 2009-2015 Free Software + Copyright (C) 1996-1998, 2001-2003, 2005-2007, 2009-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it diff -Nru datamash-1.0.7/lib/strnlen1.c datamash-1.1.1/lib/strnlen1.c --- datamash-1.0.7/lib/strnlen1.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/strnlen1.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Find the length of STRING + 1, but scan at most MAXLEN bytes. - Copyright (C) 2005-2006, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/strnlen1.h datamash-1.1.1/lib/strnlen1.h --- datamash-1.0.7/lib/strnlen1.h 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/strnlen1.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Find the length of STRING + 1, but scan at most MAXLEN bytes. - Copyright (C) 2005, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2005, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/strnlen.c datamash-1.1.1/lib/strnlen.c --- datamash-1.0.7/lib/strnlen.c 2015-06-17 23:45:28.000000000 +0000 +++ datamash-1.1.1/lib/strnlen.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Find the length of STRING, but scan at most MAXLEN characters. - Copyright (C) 2005-2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2005-2007, 2009-2017 Free Software Foundation, Inc. Written by Simon Josefsson. This program is free software; you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/strsep.c datamash-1.1.1/lib/strsep.c --- datamash-1.0.7/lib/strsep.c 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/strsep.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (C) 2004, 2007, 2009-2015 Free Software Foundation, Inc. +/* Copyright (C) 2004, 2007, 2009-2017 Free Software Foundation, Inc. Written by Yoann Vandoorselaere . diff -Nru datamash-1.0.7/lib/strtoimax.c datamash-1.1.1/lib/strtoimax.c --- datamash-1.0.7/lib/strtoimax.c 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/strtoimax.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* Convert string representation of a number into an intmax_t value. - Copyright (C) 1999, 2001-2004, 2006, 2009-2015 Free Software Foundation, + Copyright (C) 1999, 2001-2004, 2006, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/strtol.c datamash-1.1.1/lib/strtol.c --- datamash-1.0.7/lib/strtol.c 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/strtol.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* Convert string representation of a number into an integer value. - Copyright (C) 1991-1992, 1994-1999, 2003, 2005-2007, 2009-2015 Free Software + Copyright (C) 1991-1992, 1994-1999, 2003, 2005-2007, 2009-2017 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C @@ -121,30 +121,19 @@ /* The extra casts in the following macros work around compiler bugs, e.g., in Cray C 5.0.3.0. */ -/* True if negative values of the signed integer type T use two's - complement, ones' complement, or signed magnitude representation, - respectively. Much GNU code assumes two's complement, but some - people like to be portable to all possible C hosts. */ -# define TYPE_TWOS_COMPLEMENT(t) ((t) ~ (t) 0 == (t) -1) -# define TYPE_ONES_COMPLEMENT(t) ((t) ~ (t) 0 == 0) -# define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1) - /* True if the arithmetic type T is signed. */ # define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) -/* The maximum and minimum values for the integer type T. These - macros have undefined behavior if T is signed and has padding bits. - If this is a problem for you, please let us know how to fix it for - your host. */ -# define TYPE_MINIMUM(t) \ - ((t) (! TYPE_SIGNED (t) \ - ? (t) 0 \ - : TYPE_SIGNED_MAGNITUDE (t) \ - ? ~ (t) 0 \ - : ~ TYPE_MAXIMUM (t))) -# define TYPE_MAXIMUM(t) \ - ((t) (! TYPE_SIGNED (t) \ - ? (t) -1 \ +/* Minimum and maximum values for integer types. + These macros have undefined behavior for signed types that either + have padding bits or do not use two's complement. If this is a + problem for you, please let us know how to fix it for your host. */ + +/* 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))) # ifndef ULLONG_MAX diff -Nru datamash-1.0.7/lib/strtoul.c datamash-1.1.1/lib/strtoul.c --- datamash-1.0.7/lib/strtoul.c 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/strtoul.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1997, 2009-2015 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1997, 2009-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/strtoull.c datamash-1.1.1/lib/strtoull.c --- datamash-1.0.7/lib/strtoull.c 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/strtoull.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Function to parse an 'unsigned long long int' from text. - Copyright (C) 1995-1997, 1999, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 1995-1997, 1999, 2009-2017 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@gnu.org. diff -Nru datamash-1.0.7/lib/sys_types.in.h datamash-1.1.1/lib/sys_types.in.h --- datamash-1.0.7/lib/sys_types.in.h 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/sys_types.in.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* Provide a more complete sys/types.h. - Copyright (C) 2011-2015 Free Software Foundation, Inc. + Copyright (C) 2011-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/trim.c datamash-1.1.1/lib/trim.c --- datamash-1.0.7/lib/trim.c 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/trim.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Removes leading and/or trailing whitespaces - Copyright (C) 2006-2015 Free Software Foundation, Inc. + Copyright (C) 2006-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -31,7 +31,7 @@ #include "xalloc.h" /* Use this to suppress gcc's "...may be used before initialized" warnings. */ -#ifdef lint +#if defined GCC_LINT || defined lint # define IF_LINT(Code) Code #else # define IF_LINT(Code) /* empty */ diff -Nru datamash-1.0.7/lib/trim.h datamash-1.1.1/lib/trim.h --- datamash-1.0.7/lib/trim.h 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/trim.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Removes leading and/or trailing whitespaces - Copyright (C) 2006, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/trunc.c datamash-1.1.1/lib/trunc.c --- datamash-1.0.7/lib/trunc.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/lib/trunc.c 2017-01-10 20:01:00.000000000 +0000 @@ -0,0 +1,121 @@ +/* Round towards zero. + Copyright (C) 2007, 2010-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Bruno Haible , 2007. */ + +#if ! defined USE_LONG_DOUBLE +# include +#endif + +/* Specification. */ +#include + +#include + +#undef MIN + +#ifdef USE_LONG_DOUBLE +# define FUNC truncl +# define DOUBLE long double +# define MANT_DIG LDBL_MANT_DIG +# define MIN LDBL_MIN +# define L_(literal) literal##L +#elif ! defined USE_FLOAT +# define FUNC trunc +# define DOUBLE double +# define MANT_DIG DBL_MANT_DIG +# define MIN DBL_MIN +# define L_(literal) literal +#else /* defined USE_FLOAT */ +# define FUNC truncf +# define DOUBLE float +# define MANT_DIG FLT_MANT_DIG +# define MIN FLT_MIN +# define L_(literal) literal##f +#endif + +/* -0.0. See minus-zero.h. */ +#if defined __hpux || defined __sgi || defined __ICC +# define MINUS_ZERO (-MIN * MIN) +#else +# define MINUS_ZERO L_(-0.0) +#endif + +/* MSVC with option -fp:strict refuses to compile constant initializers that + contain floating-point operations. Pacify this compiler. */ +#ifdef _MSC_VER +# pragma fenv_access (off) +#endif + +/* 2^(MANT_DIG-1). */ +static const DOUBLE TWO_MANT_DIG = + /* Assume MANT_DIG <= 5 * 31. + Use the identity + n = floor(n/5) + floor((n+1)/5) + ... + floor((n+4)/5). */ + (DOUBLE) (1U << ((MANT_DIG - 1) / 5)) + * (DOUBLE) (1U << ((MANT_DIG - 1 + 1) / 5)) + * (DOUBLE) (1U << ((MANT_DIG - 1 + 2) / 5)) + * (DOUBLE) (1U << ((MANT_DIG - 1 + 3) / 5)) + * (DOUBLE) (1U << ((MANT_DIG - 1 + 4) / 5)); + +DOUBLE +FUNC (DOUBLE x) +{ + /* The use of 'volatile' guarantees that excess precision bits are dropped + at each addition step and before the following comparison at the caller's + site. It is necessary on x86 systems where double-floats are not IEEE + compliant by default, to avoid that the results become platform and compiler + option dependent. 'volatile' is a portable alternative to gcc's + -ffloat-store option. */ + volatile DOUBLE y = x; + volatile DOUBLE z = y; + + if (z > L_(0.0)) + { + /* For 0 < x < 1, return +0.0 even if the current rounding mode is + FE_DOWNWARD. */ + if (z < L_(1.0)) + z = L_(0.0); + /* Avoid rounding errors for values near 2^k, where k >= MANT_DIG-1. */ + else if (z < TWO_MANT_DIG) + { + /* Round to the next integer (nearest or up or down, doesn't matter). */ + z += TWO_MANT_DIG; + z -= TWO_MANT_DIG; + /* Enforce rounding down. */ + if (z > y) + z -= L_(1.0); + } + } + else if (z < L_(0.0)) + { + /* For -1 < x < 0, return -0.0 regardless of the current rounding + mode. */ + if (z > L_(-1.0)) + z = MINUS_ZERO; + /* Avoid rounding errors for values near -2^k, where k >= MANT_DIG-1. */ + else if (z > - TWO_MANT_DIG) + { + /* Round to the next integer (nearest or up or down, doesn't matter). */ + z -= TWO_MANT_DIG; + z += TWO_MANT_DIG; + /* Enforce rounding up. */ + if (z < y) + z += L_(1.0); + } + } + return z; +} diff -Nru datamash-1.0.7/lib/truncl.c datamash-1.1.1/lib/truncl.c --- datamash-1.0.7/lib/truncl.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/lib/truncl.c 2017-01-10 20:01:00.000000000 +0000 @@ -0,0 +1,37 @@ +/* Round towards zero. + Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +/* Written by Bruno Haible , 2007. */ + +#include + +#if HAVE_SAME_LONG_DOUBLE_AS_DOUBLE + +/* Specification. */ +# include + +long double +truncl (long double x) +{ + return trunc (x); +} + +#else + +# define USE_LONG_DOUBLE +# include "trunc.c" + +#endif diff -Nru datamash-1.0.7/lib/u64.c datamash-1.1.1/lib/u64.c --- datamash-1.0.7/lib/u64.c 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/u64.c 2015-12-18 16:49:33.000000000 +0000 @@ -1,3 +1,4 @@ #include #define _GL_U64_INLINE _GL_EXTERN_INLINE #include "u64.h" +typedef int dummy; diff -Nru datamash-1.0.7/lib/u64.h datamash-1.1.1/lib/u64.h --- datamash-1.0.7/lib/u64.h 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/u64.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* uint64_t-like operations that work even on hosts lacking uint64_t - Copyright (C) 2006, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/unistd.c datamash-1.1.1/lib/unistd.c --- datamash-1.0.7/lib/unistd.c 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/unistd.c 2015-12-18 16:49:33.000000000 +0000 @@ -1,3 +1,4 @@ #include #define _GL_UNISTD_INLINE _GL_EXTERN_INLINE #include "unistd.h" +typedef int dummy; diff -Nru datamash-1.0.7/lib/unistd.in.h datamash-1.1.1/lib/unistd.in.h --- datamash-1.0.7/lib/unistd.in.h 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/unistd.in.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Substitute for and wrapper around . - Copyright (C) 2003-2015 Free Software Foundation, Inc. + Copyright (C) 2003-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -55,9 +55,13 @@ #include /* mingw doesn't define the SEEK_* or *_FILENO macros in . */ +/* MSVC declares 'unlink' in , not in . We must include + it before we #define unlink rpl_unlink. */ /* Cygwin 1.7.1 declares symlinkat in , not in . */ /* But avoid namespace pollution on glibc systems. */ #if (!(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) \ + || ((@GNULIB_UNLINK@ || defined GNULIB_POSIXCHECK) \ + && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) \ || ((@GNULIB_SYMLINKAT@ || defined GNULIB_POSIXCHECK) \ && defined __CYGWIN__)) \ && ! defined __GLIBC__ @@ -776,7 +780,7 @@ ${LOGNAME-$USER} on Unix platforms, $USERNAME on native Windows platforms. */ -# if !@HAVE_GETLOGIN@ +# if !@HAVE_DECL_GETLOGIN@ _GL_FUNCDECL_SYS (getlogin, char *, (void)); # endif _GL_CXXALIAS_SYS (getlogin, char *, (void)); diff -Nru datamash-1.0.7/lib/unistr/u8-mbtoucr.c datamash-1.1.1/lib/unistr/u8-mbtoucr.c --- datamash-1.0.7/lib/unistr/u8-mbtoucr.c 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/unistr/u8-mbtoucr.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Look at first character in UTF-8 string, returning an error code. - Copyright (C) 1999-2002, 2006-2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 1999-2002, 2006-2007, 2009-2017 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software: you can redistribute it and/or modify it @@ -92,10 +92,7 @@ { if ((s[1] ^ 0x80) < 0x40 && (c >= 0xf1 || s[1] >= 0x90) -#if 1 - && (c < 0xf4 || (c == 0xf4 && s[1] < 0x90)) -#endif - ) + && (c < 0xf4 || (c == 0xf4 && s[1] < 0x90))) { if (n >= 3) { @@ -138,146 +135,6 @@ return -2; } } -#if 0 - else if (c < 0xfc) - { - if (n >= 2) - { - if ((s[1] ^ 0x80) < 0x40 - && (c >= 0xf9 || s[1] >= 0x88)) - { - if (n >= 3) - { - if ((s[2] ^ 0x80) < 0x40) - { - if (n >= 4) - { - if ((s[3] ^ 0x80) < 0x40) - { - if (n >= 5) - { - if ((s[4] ^ 0x80) < 0x40) - { - *puc = ((unsigned int) (c & 0x03) << 24) - | ((unsigned int) (s[1] ^ 0x80) << 18) - | ((unsigned int) (s[2] ^ 0x80) << 12) - | ((unsigned int) (s[3] ^ 0x80) << 6) - | (unsigned int) (s[4] ^ 0x80); - return 5; - } - /* invalid multibyte character */ - } - else - { - /* incomplete multibyte character */ - *puc = 0xfffd; - return -2; - } - } - /* invalid multibyte character */ - } - else - { - /* incomplete multibyte character */ - *puc = 0xfffd; - return -2; - } - } - /* invalid multibyte character */ - } - else - { - /* incomplete multibyte character */ - *puc = 0xfffd; - return -2; - } - } - /* invalid multibyte character */ - } - else - { - /* incomplete multibyte character */ - *puc = 0xfffd; - return -2; - } - } - else if (c < 0xfe) - { - if (n >= 2) - { - if ((s[1] ^ 0x80) < 0x40 - && (c >= 0xfd || s[1] >= 0x84)) - { - if (n >= 3) - { - if ((s[2] ^ 0x80) < 0x40) - { - if (n >= 4) - { - if ((s[3] ^ 0x80) < 0x40) - { - if (n >= 5) - { - if ((s[4] ^ 0x80) < 0x40) - { - if (n >= 6) - { - if ((s[5] ^ 0x80) < 0x40) - { - *puc = ((unsigned int) (c & 0x01) << 30) - | ((unsigned int) (s[1] ^ 0x80) << 24) - | ((unsigned int) (s[2] ^ 0x80) << 18) - | ((unsigned int) (s[3] ^ 0x80) << 12) - | ((unsigned int) (s[4] ^ 0x80) << 6) - | (unsigned int) (s[5] ^ 0x80); - return 6; - } - /* invalid multibyte character */ - } - else - { - /* incomplete multibyte character */ - *puc = 0xfffd; - return -2; - } - } - /* invalid multibyte character */ - } - else - { - /* incomplete multibyte character */ - *puc = 0xfffd; - return -2; - } - } - /* invalid multibyte character */ - } - else - { - /* incomplete multibyte character */ - *puc = 0xfffd; - return -2; - } - } - /* invalid multibyte character */ - } - else - { - /* incomplete multibyte character */ - *puc = 0xfffd; - return -2; - } - } - /* invalid multibyte character */ - } - else - { - /* incomplete multibyte character */ - *puc = 0xfffd; - return -2; - } - } -#endif } /* invalid multibyte character */ *puc = 0xfffd; diff -Nru datamash-1.0.7/lib/unistr/u8-uctomb-aux.c datamash-1.1.1/lib/unistr/u8-uctomb-aux.c --- datamash-1.0.7/lib/unistr/u8-uctomb-aux.c 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/unistr/u8-uctomb-aux.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Conversion UCS-4 to UTF-8. - Copyright (C) 2002, 2006-2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2002, 2006-2007, 2009-2017 Free Software Foundation, Inc. Written by Bruno Haible , 2002. This program is free software: you can redistribute it and/or modify it @@ -37,17 +37,8 @@ else return -1; } -#if 0 - else if (uc < 0x200000) - count = 4; - else if (uc < 0x4000000) - count = 5; - else if (uc <= 0x7fffffff) - count = 6; -#else else if (uc < 0x110000) count = 4; -#endif else return -1; @@ -56,12 +47,10 @@ switch (count) /* note: code falls through cases! */ { -#if 0 - case 6: s[5] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x4000000; - case 5: s[4] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x200000; -#endif case 4: s[3] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x10000; + /* fallthrough */ case 3: s[2] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x800; + /* fallthrough */ case 2: s[1] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0xc0; /*case 1:*/ s[0] = uc; } diff -Nru datamash-1.0.7/lib/unistr/u8-uctomb.c datamash-1.1.1/lib/unistr/u8-uctomb.c --- datamash-1.0.7/lib/unistr/u8-uctomb.c 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/unistr/u8-uctomb.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Store a character in UTF-8 string. - Copyright (C) 2002, 2005-2006, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2002, 2005-2006, 2009-2017 Free Software Foundation, Inc. Written by Bruno Haible , 2002. This program is free software: you can redistribute it and/or modify it @@ -52,17 +52,8 @@ else return -1; } -#if 0 - else if (uc < 0x200000) - count = 4; - else if (uc < 0x4000000) - count = 5; - else if (uc <= 0x7fffffff) - count = 6; -#else else if (uc < 0x110000) count = 4; -#endif else return -1; @@ -70,10 +61,6 @@ { switch (count) /* note: code falls through cases! */ { -#if 0 - case 6: s[5] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x4000000; - case 5: s[4] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x200000; -#endif case 4: s[3] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x10000; case 3: s[2] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x800; case 2: s[1] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0xc0; diff -Nru datamash-1.0.7/lib/unistr.in.h datamash-1.1.1/lib/unistr.in.h --- datamash-1.0.7/lib/unistr.in.h 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/unistr.in.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Elementary Unicode string functions. - Copyright (C) 2001-2002, 2005-2015 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2005-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published @@ -197,15 +197,11 @@ { uint32_t c = *s; -# if CONFIG_UNICODE_SAFETY if (c < 0xd800 || (c >= 0xe000 && c < 0x110000)) -# endif *puc = c; -# if CONFIG_UNICODE_SAFETY else /* invalid multibyte character */ *puc = 0xfffd; -# endif return 1; } # endif diff -Nru datamash-1.0.7/lib/unitypes.in.h datamash-1.1.1/lib/unitypes.in.h --- datamash-1.0.7/lib/unitypes.in.h 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/unitypes.in.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Elementary types and macros for the GNU UniString library. - Copyright (C) 2002, 2005-2006, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2002, 2005-2006, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published diff -Nru datamash-1.0.7/lib/uniwidth/cjk.h datamash-1.1.1/lib/uniwidth/cjk.h --- datamash-1.0.7/lib/uniwidth/cjk.h 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/uniwidth/cjk.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Test for CJK encoding. - Copyright (C) 2001-2002, 2005-2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2005-2007, 2009-2017 Free Software Foundation, Inc. Written by Bruno Haible , 2002. This program is free software: you can redistribute it and/or modify it diff -Nru datamash-1.0.7/lib/uniwidth/width.c datamash-1.1.1/lib/uniwidth/width.c --- datamash-1.0.7/lib/uniwidth/width.c 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/uniwidth/width.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Determine display width of Unicode character. - Copyright (C) 2001-2002, 2006-2015 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2006-2017 Free Software Foundation, Inc. Written by Bruno Haible , 2002. This program is free software: you can redistribute it and/or modify it @@ -32,7 +32,7 @@ * - Zero width characters; generated from * "grep '^[^;]*;ZERO WIDTH ' UnicodeData.txt" */ -static const unsigned char nonspacing_table_data[35*64] = { +static const unsigned char nonspacing_table_data[36*64] = { /* 0x0000-0x01ff */ 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, /* 0x0000-0x003f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, /* 0x0040-0x007f */ @@ -73,7 +73,7 @@ 0x00, 0x00, 0xc0, 0xfb, 0xef, 0x3e, 0x00, 0x00, /* 0x0800-0x083f */ 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, /* 0x0840-0x087f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0880-0x08bf */ - 0x00, 0x00, 0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, /* 0x08c0-0x08ff */ + 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, /* 0x08c0-0x08ff */ 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, /* 0x0900-0x093f */ 0xfe, 0x21, 0xfe, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x0940-0x097f */ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* 0x0980-0x09bf */ @@ -189,7 +189,7 @@ /* 0xa600-0xa7ff */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa600-0xa63f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xf7, 0x3f, /* 0xa640-0xa67f */ - 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, /* 0xa680-0xa6bf */ + 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, /* 0xa680-0xa6bf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, /* 0xa6c0-0xa6ff */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa700-0xa73f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa740-0xa77f */ @@ -223,7 +223,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfb80-0xfbbf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfbc0-0xfbff */ /* 0xfe00-0xffff */ - 0xff, 0xff, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, /* 0xfe00-0xfe3f */ + 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, /* 0xfe00-0xfe3f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfe40-0xfe7f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfe80-0xfebf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, /* 0xfec0-0xfeff */ @@ -266,13 +266,13 @@ 0x07, 0x00, 0x00, 0x00, 0x80, 0xef, 0x1f, 0x00, /* 0x11100-0x1113f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, /* 0x11140-0x1117f */ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, /* 0x11180-0x111bf */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x111c0-0x111ff */ + 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x111c0-0x111ff */ /* 0x11200-0x113ff */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xd3, 0x00, /* 0x11200-0x1123f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11240-0x1127f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11280-0x112bf */ 0x00, 0x00, 0x00, 0x80, 0xf8, 0x07, 0x00, 0x00, /* 0x112c0-0x112ff */ - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* 0x11300-0x1133f */ + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* 0x11300-0x1133f */ 0x01, 0x00, 0x00, 0x00, 0xc0, 0x1f, 0x1f, 0x00, /* 0x11340-0x1137f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11380-0x113bf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x113c0-0x113ff */ @@ -284,13 +284,13 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11500-0x1153f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11540-0x1157f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0xb0, /* 0x11580-0x115bf */ - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x115c0-0x115ff */ + 0x01, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, /* 0x115c0-0x115ff */ /* 0x11600-0x117ff */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xa7, /* 0x11600-0x1163f */ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11640-0x1167f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0xbf, 0x00, /* 0x11680-0x116bf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x116c0-0x116ff */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11700-0x1173f */ + 0x00, 0x00, 0x00, 0xe0, 0xbc, 0x0f, 0x00, 0x00, /* 0x11700-0x1173f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11740-0x1177f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11780-0x117bf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x117c0-0x117ff */ @@ -339,6 +339,15 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d340-0x1d37f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d380-0x1d3bf */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d3c0-0x1d3ff */ + /* 0x1da00-0x1dbff */ + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xf8, /* 0x1da00-0x1da3f */ + 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x20, 0x00, /* 0x1da40-0x1da7f */ + 0x10, 0x00, 0x00, 0xf8, 0xfe, 0xff, 0x00, 0x00, /* 0x1da80-0x1dabf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1dac0-0x1daff */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1db00-0x1db3f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1db40-0x1db7f */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1db80-0x1dbbf */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1dbc0-0x1dbff */ /* 0x1e800-0x1e9ff */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e800-0x1e83f */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e840-0x1e87f */ @@ -379,8 +388,8 @@ -1, -1, -1, -1, -1, -1, -1, -1, /* 0x1a000-0x1afff */ -1, -1, -1, -1, -1, -1, 31, -1, /* 0x1b000-0x1bfff */ -1, -1, -1, -1, -1, -1, -1, -1, /* 0x1c000-0x1cfff */ - 32, 33, -1, -1, -1, -1, -1, -1, /* 0x1d000-0x1dfff */ - -1, -1, -1, -1, 34, -1, -1, -1 /* 0x1e000-0x1efff */ + 32, 33, -1, -1, -1, 34, -1, -1, /* 0x1d000-0x1dfff */ + -1, -1, -1, -1, 35, -1, -1, -1 /* 0x1e000-0x1efff */ }; /* Determine number of column positions required for UC. */ diff -Nru datamash-1.0.7/lib/uniwidth.in.h datamash-1.1.1/lib/uniwidth.in.h --- datamash-1.0.7/lib/uniwidth.in.h 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/uniwidth.in.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Display width functions. - Copyright (C) 2001-2002, 2005, 2007, 2009-2015 Free Software Foundation, + Copyright (C) 2001-2002, 2005, 2007, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it diff -Nru datamash-1.0.7/lib/unlocked-io.h datamash-1.1.1/lib/unlocked-io.h --- datamash-1.0.7/lib/unlocked-io.h 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/unlocked-io.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* Prefer faster, non-thread-safe stdio functions if available. - Copyright (C) 2001-2004, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2001-2004, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/verify.h datamash-1.1.1/lib/verify.h --- datamash-1.0.7/lib/verify.h 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/verify.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* Compile-time assert-like macros. - Copyright (C) 2005-2006, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -263,7 +263,7 @@ # define assume(R) ((R) ? (void) 0 : __builtin_unreachable ()) #elif 1200 <= _MSC_VER # define assume(R) __assume (R) -#elif (defined lint \ +#elif ((defined GCC_LINT || defined lint) \ && (__has_builtin (__builtin_trap) \ || 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__)))) /* Doing it this way helps various packages when configured with diff -Nru datamash-1.0.7/lib/version-etc.c datamash-1.1.1/lib/version-etc.c --- datamash-1.0.7/lib/version-etc.c 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/version-etc.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Print --version and bug-reporting information in a consistent format. - Copyright (C) 1999-2015 Free Software Foundation, Inc. + Copyright (C) 1999-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -38,7 +38,7 @@ # define PACKAGE PACKAGE_TARNAME #endif -enum { COPYRIGHT_YEAR = 2015 }; +enum { COPYRIGHT_YEAR = 2017 }; /* The three functions below display the --version information the standard way. diff -Nru datamash-1.0.7/lib/version-etc.h datamash-1.1.1/lib/version-etc.h --- datamash-1.0.7/lib/version-etc.h 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/version-etc.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Print --version and bug-reporting information in a consistent format. - Copyright (C) 1999, 2003, 2005, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 1999, 2003, 2005, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/wchar.in.h datamash-1.1.1/lib/wchar.in.h --- datamash-1.0.7/lib/wchar.in.h 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/wchar.in.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* A substitute for ISO C99 , for platforms that have issues. - Copyright (C) 2007-2015 Free Software Foundation, Inc. + Copyright (C) 2007-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -30,15 +30,23 @@ #endif @PRAGMA_COLUMNS@ -#if defined __need_mbstate_t || defined __need_wint_t || (defined __hpux && ((defined _INTTYPES_INCLUDED && !defined strtoimax) || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) || defined _GL_ALREADY_INCLUDING_WCHAR_H +#if (((defined __need_mbstate_t || defined __need_wint_t) \ + && !defined __MINGW32__ && !defined __KLIBC__) \ + || (defined __hpux \ + && ((defined _INTTYPES_INCLUDED && !defined strtoimax) \ + || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) \ + || (defined __MINGW32__ && defined __STRING_H_SOURCED__) \ + || defined _GL_ALREADY_INCLUDING_WCHAR_H) /* Special invocation convention: - - Inside glibc and uClibc header files. + - Inside glibc and uClibc header files, but not MinGW. - On HP-UX 11.00 we have a sequence of nested includes -> -> , and the latter includes , once indirectly -> -> -> and once directly. In both situations 'wint_t' is not yet defined, therefore we cannot provide the function overrides; instead include only the system's . + - With MinGW 3.22, when includes , only some part of + is actually processed, and that doesn't include 'mbstate_t'. - On IRIX 6.5, similarly, we have an include -> , and the latter includes . But here, we have no way to detect whether is completely included or is still being included. */ @@ -105,10 +113,10 @@ # define WEOF -1 # endif #else -/* MSVC defines wint_t as 'unsigned short' in . +/* mingw and MSVC define wint_t as 'unsigned short' in . This is too small: ISO C 99 section 7.24.1.(2) says that wint_t must be "unchanged by default argument promotions". Override it. */ -# if defined _MSC_VER +# if @GNULIB_OVERRIDES_WINT_T@ # if !GNULIB_defined_wint_t # include typedef unsigned int rpl_wint_t; @@ -440,6 +448,11 @@ # if !@HAVE_DECL_WCWIDTH@ /* wcwidth exists but is not declared. */ _GL_FUNCDECL_SYS (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE); +# elif defined __KLIBC__ +/* On OS/2 kLIBC, wcwidth is a macro that expands to the name of a + static inline function. The implementation of wcwidth in wcwidth.c + causes a "conflicting types" error. */ +# undef wcwidth # endif _GL_CXXALIAS_SYS (wcwidth, int, (wchar_t)); # endif diff -Nru datamash-1.0.7/lib/wctype.in.h datamash-1.1.1/lib/wctype.in.h --- datamash-1.0.7/lib/wctype.in.h 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/wctype.in.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* A substitute for ISO C99 , for platforms that lack it. - Copyright (C) 2006-2015 Free Software Foundation, Inc. + Copyright (C) 2006-2017 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,13 +25,25 @@ * wctrans_t, and wctype_t are not yet implemented. */ -#ifndef _@GUARD_PREFIX@_WCTYPE_H - #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ #endif @PRAGMA_COLUMNS@ +#if (defined __MINGW32__ && defined __CTYPE_H_SOURCED__) + +/* Special invocation convention: + - With MinGW 3.22, when includes , only some part of + is being processed, which doesn't include the idempotency + guard. */ + +#@INCLUDE_NEXT@ @NEXT_WCTYPE_H@ + +#else +/* Normal invocation convention. */ + +#ifndef _@GUARD_PREFIX@_WCTYPE_H + #if @HAVE_WINT_T@ /* Solaris 2.5 has a bug: must be included before . Tru64 with Desktop Toolkit C has a bug: must be included before @@ -93,10 +105,10 @@ # define WEOF -1 # endif #else -/* MSVC defines wint_t as 'unsigned short' in . +/* mingw and MSVC define wint_t as 'unsigned short' in . This is too small: ISO C 99 section 7.24.1.(2) says that wint_t must be "unchanged by default argument promotions". Override it. */ -# if defined _MSC_VER +# if @GNULIB_OVERRIDES_WINT_T@ # if !GNULIB_defined_wint_t # include typedef unsigned int rpl_wint_t; @@ -512,3 +524,4 @@ #endif /* _@GUARD_PREFIX@_WCTYPE_H */ #endif /* _@GUARD_PREFIX@_WCTYPE_H */ +#endif diff -Nru datamash-1.0.7/lib/wcwidth.c datamash-1.1.1/lib/wcwidth.c --- datamash-1.0.7/lib/wcwidth.c 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/wcwidth.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Determine the number of screen columns needed for a character. - Copyright (C) 2006-2007, 2010-2015 Free Software Foundation, Inc. + Copyright (C) 2006-2007, 2010-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/xalloc-die.c datamash-1.1.1/lib/xalloc-die.c --- datamash-1.0.7/lib/xalloc-die.c 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/xalloc-die.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* Report a memory allocation failure and exit. - Copyright (C) 1997-2000, 2002-2004, 2006, 2009-2015 Free Software + Copyright (C) 1997-2000, 2002-2004, 2006, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/xalloc.h datamash-1.1.1/lib/xalloc.h --- datamash-1.0.7/lib/xalloc.h 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/xalloc.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* xalloc.h -- malloc with out-of-memory checking - Copyright (C) 1990-2000, 2003-2004, 2006-2015 Free Software Foundation, Inc. + Copyright (C) 1990-2000, 2003-2004, 2006-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -19,6 +19,7 @@ #define XALLOC_H_ #include +#include #include "xalloc-oversized.h" @@ -197,10 +198,11 @@ else { /* Set N = floor (1.5 * N) + 1 so that progress is made even if N == 0. - Check for overflow, so that N * S stays in size_t range. - The check may be slightly conservative, but an exact check isn't - worth the trouble. */ - if ((size_t) -1 / 3 * 2 / s <= n) + Check for overflow, so that N * S stays in both ptrdiff_t and + size_t range. The check may be slightly conservative, but an + exact check isn't worth the trouble. */ + if ((PTRDIFF_MAX < SIZE_MAX ? PTRDIFF_MAX : SIZE_MAX) / 3 * 2 / s + <= n) xalloc_die (); n += n / 2 + 1; } diff -Nru datamash-1.0.7/lib/xalloc-oversized.h datamash-1.1.1/lib/xalloc-oversized.h --- datamash-1.0.7/lib/xalloc-oversized.h 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/xalloc-oversized.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* xalloc-oversized.h -- memory allocation size checking - Copyright (C) 1990-2000, 2003-2004, 2006-2015 Free Software Foundation, Inc. + Copyright (C) 1990-2000, 2003-2004, 2006-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,23 +16,45 @@ along with this program. If not, see . */ #ifndef XALLOC_OVERSIZED_H_ -# define XALLOC_OVERSIZED_H_ +#define XALLOC_OVERSIZED_H_ -# include - -/* Return 1 if an array of N objects, each of size S, cannot exist due - to size arithmetic overflow. S must be positive and N must be - nonnegative. This is a macro, not a function, so that it - works correctly even when SIZE_MAX < N. +#include +#include +/* True if N * S would overflow in a size_t calculation, + or would generate a value larger than PTRDIFF_MAX. + This expands to a constant expression if N and S are both constants. By gnulib convention, SIZE_MAX represents overflow in size - calculations, so the conservative dividend to use here is - SIZE_MAX - 1, since SIZE_MAX might represent an overflowed value. - However, malloc (SIZE_MAX) fails on all known hosts where - sizeof (ptrdiff_t) <= sizeof (size_t), so do not bother to test for - exactly-SIZE_MAX allocations on such hosts; this avoids a test and - branch when S is known to be 1. */ + calculations, so the conservative size_t-based dividend to use here + is SIZE_MAX - 1. */ +#define __xalloc_oversized(n, s) \ + ((size_t) (PTRDIFF_MAX < SIZE_MAX ? PTRDIFF_MAX : SIZE_MAX - 1) / (s) < (n)) + +#if PTRDIFF_MAX < SIZE_MAX +typedef ptrdiff_t __xalloc_count_type; +#else +typedef size_t __xalloc_count_type; +#endif + +/* Return 1 if an array of N objects, each of size S, cannot exist + reliably due to size or ptrdiff_t arithmetic overflow. S must be + positive and N must be nonnegative. This is a macro, not a + function, so that it works correctly even when SIZE_MAX < N. */ + +#if 7 <= __GNUC__ +# define xalloc_oversized(n, s) \ + __builtin_mul_overflow_p (n, s, (__xalloc_count_type) 1) +#elif 5 <= __GNUC__ && !__STRICT_ANSI__ # define xalloc_oversized(n, s) \ - ((size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / (s) < (n)) + (__builtin_constant_p (n) && __builtin_constant_p (s) \ + ? __xalloc_oversized (n, s) \ + : ({ __xalloc_count_type __xalloc_count; \ + __builtin_mul_overflow (n, s, &__xalloc_count); })) + +/* Other compilers use integer division; this may be slower but is + more portable. */ +#else +# define xalloc_oversized(n, s) __xalloc_oversized (n, s) +#endif #endif /* !XALLOC_OVERSIZED_H_ */ diff -Nru datamash-1.0.7/lib/xmalloc.c datamash-1.1.1/lib/xmalloc.c --- datamash-1.0.7/lib/xmalloc.c 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/xmalloc.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* xmalloc.c -- malloc with out of memory checking - Copyright (C) 1990-2000, 2002-2006, 2008-2015 Free Software Foundation, Inc. + Copyright (C) 1990-2000, 2002-2006, 2008-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -93,11 +93,11 @@ xcalloc (size_t n, size_t s) { void *p; - /* Test for overflow, since some calloc implementations don't have - proper overflow checks. But omit overflow and size-zero tests if - HAVE_GNU_CALLOC, since GNU calloc catches overflow and never - returns NULL if successful. */ - if ((! HAVE_GNU_CALLOC && xalloc_oversized (n, s)) + /* Test for overflow, since objects with size greater than + PTRDIFF_MAX cause pointer subtraction to go awry. Omit size-zero + tests if HAVE_GNU_CALLOC, since GNU calloc never returns NULL if + successful. */ + if (xalloc_oversized (n, s) || (! (p = calloc (n, s)) && (HAVE_GNU_CALLOC || n != 0))) xalloc_die (); return p; diff -Nru datamash-1.0.7/lib/xstriconv.c datamash-1.1.1/lib/xstriconv.c --- datamash-1.0.7/lib/xstriconv.c 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/xstriconv.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Charset conversion with out-of-memory checking. - Copyright (C) 2001-2004, 2006, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2001-2004, 2006, 2009-2017 Free Software Foundation, Inc. Written by Bruno Haible. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/xstriconv.h datamash-1.1.1/lib/xstriconv.h --- datamash-1.0.7/lib/xstriconv.h 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/xstriconv.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,5 +1,5 @@ /* Charset conversion with out-of-memory checking. - Copyright (C) 2001-2004, 2006-2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2001-2004, 2006-2007, 2009-2017 Free Software Foundation, Inc. Written by Bruno Haible and Simon Josefsson. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/xstrndup.c datamash-1.1.1/lib/xstrndup.c --- datamash-1.0.7/lib/xstrndup.c 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/xstrndup.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* Duplicate a bounded initial segment of a string, with out-of-memory checking. - Copyright (C) 2003, 2006-2007, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2003, 2006-2007, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/xstrndup.h datamash-1.1.1/lib/xstrndup.h --- datamash-1.0.7/lib/xstrndup.h 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/xstrndup.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* Duplicate a bounded initial segment of a string, with out-of-memory checking. - Copyright (C) 2003, 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2003, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff -Nru datamash-1.0.7/lib/xstrtol.c datamash-1.1.1/lib/xstrtol.c --- datamash-1.0.7/lib/xstrtol.c 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/xstrtol.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* A more useful interface to strtol. - Copyright (C) 1995-1996, 1998-2001, 2003-2007, 2009-2015 Free Software + Copyright (C) 1995-1996, 1998-2001, 2003-2007, 2009-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -148,8 +148,11 @@ return err | LONGINT_INVALID_SUFFIX_CHAR; } - if (strchr (valid_suffixes, '0')) + switch (**p) { + case 'E': case 'G': case 'g': case 'k': case 'K': case 'M': case 'm': + case 'P': case 'T': case 't': case 'Y': case 'Z': + /* The "valid suffix" '0' is a special flag meaning that an optional second suffix is allowed, which can change the base. A suffix "B" (e.g. "100MB") stands for a power @@ -157,19 +160,20 @@ a power of 1024. If no suffix (e.g. "100M"), assume power-of-1024. */ - switch (p[0][1]) - { - case 'i': - if (p[0][2] == 'B') - suffixes += 2; - break; - - case 'B': - case 'D': /* 'D' is obsolescent */ - base = 1000; - suffixes++; - break; - } + if (strchr (valid_suffixes, '0')) + switch (p[0][1]) + { + case 'i': + if (p[0][2] == 'B') + suffixes += 2; + break; + + case 'B': + case 'D': /* 'D' is obsolescent */ + base = 1000; + suffixes++; + break; + } } switch (**p) @@ -179,6 +183,9 @@ break; case 'B': + /* This obsolescent first suffix is distinct from the 'B' + second suffix above. E.g., 'tar -L 1000B' means change + the tape after writing 1000 KiB of data. */ overflow = bkm_scale (&tmp, 1024); break; diff -Nru datamash-1.0.7/lib/xstrtol-error.c datamash-1.1.1/lib/xstrtol-error.c --- datamash-1.0.7/lib/xstrtol-error.c 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/xstrtol-error.c 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* A more useful interface to strtol. - Copyright (C) 1995-1996, 1998-1999, 2001-2004, 2006-2015 Free Software + Copyright (C) 1995-1996, 1998-1999, 2001-2004, 2006-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/lib/xstrtol.h datamash-1.1.1/lib/xstrtol.h --- datamash-1.0.7/lib/xstrtol.h 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/lib/xstrtol.h 2017-01-10 20:01:00.000000000 +0000 @@ -1,6 +1,6 @@ /* A more useful interface to strtol. - Copyright (C) 1995-1996, 1998-1999, 2001-2004, 2006-2015 Free Software + Copyright (C) 1995-1996, 1998-1999, 2001-2004, 2006-2017 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.0.7/m4/00gnulib.m4 datamash-1.1.1/m4/00gnulib.m4 --- datamash-1.0.7/m4/00gnulib.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/00gnulib.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # 00gnulib.m4 serial 3 -dnl Copyright (C) 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/absolute-header.m4 datamash-1.1.1/m4/absolute-header.m4 --- datamash-1.0.7/m4/absolute-header.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/absolute-header.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # absolute-header.m4 serial 16 -dnl Copyright (C) 2006-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/alloca.m4 datamash-1.1.1/m4/alloca.m4 --- datamash-1.0.7/m4/alloca.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/alloca.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # alloca.m4 serial 14 -dnl Copyright (C) 2002-2004, 2006-2007, 2009-2015 Free Software Foundation, +dnl Copyright (C) 2002-2004, 2006-2007, 2009-2017 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff -Nru datamash-1.0.7/m4/assert.m4 datamash-1.1.1/m4/assert.m4 --- datamash-1.0.7/m4/assert.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/assert.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,6 +1,6 @@ #serial 7 -# Copyright (C) 1998-1999, 2001, 2004, 2008-2015 Free Software Foundation, Inc. +# Copyright (C) 1998-1999, 2001, 2004, 2008-2017 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/base64.m4 datamash-1.1.1/m4/base64.m4 --- datamash-1.0.7/m4/base64.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/base64.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # base64.m4 serial 4 -dnl Copyright (C) 2004, 2006, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2004, 2006, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/calloc.m4 datamash-1.1.1/m4/calloc.m4 --- datamash-1.0.7/m4/calloc.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/calloc.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,6 +1,6 @@ -# calloc.m4 serial 15 +# calloc.m4 serial 16 -# Copyright (C) 2004-2015 Free Software Foundation, Inc. +# Copyright (C) 2004-2017 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -25,10 +25,14 @@ [AC_LANG_PROGRAM( [AC_INCLUDES_DEFAULT], [[int result = 0; - if (!calloc (0, 0)) + char *p = calloc (0, 0); + if (!p) result |= 1; - if (calloc ((size_t) -1 / 8 + 1, 8)) + free (p); + p = calloc ((size_t) -1 / 8 + 1, 8); + if (p) result |= 2; + free (p); return result; ]])], [ac_cv_func_calloc_0_nonnull=yes], diff -Nru datamash-1.0.7/m4/ceill.m4 datamash-1.1.1/m4/ceill.m4 --- datamash-1.0.7/m4/ceill.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/ceill.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # ceill.m4 serial 14 -dnl Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -69,6 +69,31 @@ else HAVE_DECL_CEILL=0 fi + dnl On OpenBSD5.6 the system's native ceill() is buggy: + dnl it returns '0' for small values. Test for this anomaly. + if test $REPLACE_CEILL = 0 ; then + AC_CACHE_CHECK([whether ceill() breaks with small values], + [gl_cv_func_ceill_buggy], + [ + save_LIBS="$LIBS" + LIBS="$CEILL_LIBM" + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include +long double d = 0.3L;]], + [[return (!(ceill (d) == 1)); ]])], + [gl_cv_func_ceill_buggy=no], [gl_cv_func_ceill_buggy=yes], + [case $host_os in + openbsd*) gl_cv_func_ceill_buggy="guessing yes";; + *) gl_cv_func_ceill_buggy="guessing no";; + esac]) + LIBS="$save_LIBS" + ]) + case "$gl_cv_func_ceill_buggy" in + *yes) + REPLACE_CEILL=1 ;; + esac + fi if test $HAVE_DECL_CEILL = 0 || test $REPLACE_CEILL = 1; then dnl Find libraries needed to link lib/ceill.c. if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then diff -Nru datamash-1.0.7/m4/ceil.m4 datamash-1.1.1/m4/ceil.m4 --- datamash-1.0.7/m4/ceil.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/ceil.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # ceil.m4 serial 9 -dnl Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/check-math-lib.m4 datamash-1.1.1/m4/check-math-lib.m4 --- datamash-1.0.7/m4/check-math-lib.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/check-math-lib.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # check-math-lib.m4 serial 4 -dnl Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/closeout.m4 datamash-1.1.1/m4/closeout.m4 --- datamash-1.0.7/m4/closeout.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/closeout.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # closeout.m4 serial 6 -dnl Copyright (C) 2002-2003, 2005-2006, 2009-2015 Free Software Foundation, +dnl Copyright (C) 2002-2003, 2005-2006, 2009-2017 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff -Nru datamash-1.0.7/m4/close-stream.m4 datamash-1.1.1/m4/close-stream.m4 --- datamash-1.0.7/m4/close-stream.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/close-stream.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ #serial 4 -dnl Copyright (C) 2006-2007, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2007, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/codeset.m4 datamash-1.1.1/m4/codeset.m4 --- datamash-1.0.7/m4/codeset.m4 2015-06-17 23:45:12.000000000 +0000 +++ datamash-1.1.1/m4/codeset.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,6 @@ # codeset.m4 serial 5 (gettext-0.18.2) -dnl Copyright (C) 2000-2002, 2006, 2008-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016 Free Software Foundation, +dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/configmake.m4 datamash-1.1.1/m4/configmake.m4 --- datamash-1.0.7/m4/configmake.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/configmake.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # configmake.m4 serial 2 -dnl Copyright (C) 2010-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2010-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/ctype.m4 datamash-1.1.1/m4/ctype.m4 --- datamash-1.0.7/m4/ctype.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/ctype.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # ctype_h.m4 serial 6 -dnl Copyright (C) 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/dirname.m4 datamash-1.1.1/m4/dirname.m4 --- datamash-1.0.7/m4/dirname.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/dirname.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ #serial 10 -*- autoconf -*- -dnl Copyright (C) 2002-2006, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/double-slash-root.m4 datamash-1.1.1/m4/double-slash-root.m4 --- datamash-1.0.7/m4/double-slash-root.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/double-slash-root.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # double-slash-root.m4 serial 4 -*- Autoconf -*- -dnl Copyright (C) 2006, 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/eealloc.m4 datamash-1.1.1/m4/eealloc.m4 --- datamash-1.0.7/m4/eealloc.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/eealloc.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # eealloc.m4 serial 3 -dnl Copyright (C) 2003, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/errno_h.m4 datamash-1.1.1/m4/errno_h.m4 --- datamash-1.0.7/m4/errno_h.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/errno_h.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # errno_h.m4 serial 12 -dnl Copyright (C) 2004, 2006, 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2004, 2006, 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/error.m4 datamash-1.1.1/m4/error.m4 --- datamash-1.0.7/m4/error.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/error.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,6 +1,6 @@ #serial 14 -# Copyright (C) 1996-1998, 2001-2004, 2009-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-1998, 2001-2004, 2009-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff -Nru datamash-1.0.7/m4/expl.m4 datamash-1.1.1/m4/expl.m4 --- datamash-1.0.7/m4/expl.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/expl.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # expl.m4 serial 8 -dnl Copyright (C) 2010-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2010-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/exp.m4 datamash-1.1.1/m4/exp.m4 --- datamash-1.0.7/m4/exp.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/exp.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # exp.m4 serial 1 -dnl Copyright (C) 2011-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/exponentd.m4 datamash-1.1.1/m4/exponentd.m4 --- datamash-1.0.7/m4/exponentd.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/exponentd.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # exponentd.m4 serial 3 -dnl Copyright (C) 2007-2008, 2010-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2008, 2010-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/exponentf.m4 datamash-1.1.1/m4/exponentf.m4 --- datamash-1.0.7/m4/exponentf.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/exponentf.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # exponentf.m4 serial 2 -dnl Copyright (C) 2007-2008, 2010-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2008, 2010-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/exponentl.m4 datamash-1.1.1/m4/exponentl.m4 --- datamash-1.0.7/m4/exponentl.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/exponentl.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # exponentl.m4 serial 3 -dnl Copyright (C) 2007-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/extensions.m4 datamash-1.1.1/m4/extensions.m4 --- datamash-1.0.7/m4/extensions.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/extensions.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,7 +1,7 @@ -# serial 13 -*- Autoconf -*- +# serial 15 -*- Autoconf -*- # Enable extensions on systems that normally disable them. -# Copyright (C) 2003, 2006-2015 Free Software Foundation, Inc. +# Copyright (C) 2003, 2006-2017 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -60,7 +60,7 @@ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif -/* Enable general extensions on OS X. */ +/* Enable general extensions on macOS. */ #ifndef _DARWIN_C_SOURCE # undef _DARWIN_C_SOURCE #endif @@ -68,14 +68,38 @@ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif -/* Use GNU style printf and scanf. */ -#ifndef __USE_MINGW_ANSI_STDIO -# undef __USE_MINGW_ANSI_STDIO -#endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif +/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */ +#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */ +#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ +# undef __STDC_WANT_IEC_60559_BFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */ +#ifndef __STDC_WANT_IEC_60559_DFP_EXT__ +# undef __STDC_WANT_IEC_60559_DFP_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */ +#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__ +# undef __STDC_WANT_IEC_60559_FUNCS_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */ +#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__ +# undef __STDC_WANT_IEC_60559_TYPES_EXT__ +#endif +/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */ +#ifndef __STDC_WANT_LIB_EXT2__ +# undef __STDC_WANT_LIB_EXT2__ +#endif +/* Enable extensions specified by ISO/IEC 24747:2009. */ +#ifndef __STDC_WANT_MATH_SPEC_FUNCS__ +# undef __STDC_WANT_MATH_SPEC_FUNCS__ +#endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE @@ -104,8 +128,14 @@ AC_DEFINE([_ALL_SOURCE]) AC_DEFINE([_DARWIN_C_SOURCE]) AC_DEFINE([_GNU_SOURCE]) - AC_DEFINE([__USE_MINGW_ANSI_STDIO]) AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) + AC_DEFINE([__STDC_WANT_IEC_60559_ATTRIBS_EXT__]) + AC_DEFINE([__STDC_WANT_IEC_60559_BFP_EXT__]) + AC_DEFINE([__STDC_WANT_IEC_60559_DFP_EXT__]) + AC_DEFINE([__STDC_WANT_IEC_60559_FUNCS_EXT__]) + AC_DEFINE([__STDC_WANT_IEC_60559_TYPES_EXT__]) + AC_DEFINE([__STDC_WANT_LIB_EXT2__]) + AC_DEFINE([__STDC_WANT_MATH_SPEC_FUNCS__]) AC_DEFINE([_TANDEM_SOURCE]) AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined], [ac_cv_should_define__xopen_source], diff -Nru datamash-1.0.7/m4/extern-inline.m4 datamash-1.1.1/m4/extern-inline.m4 --- datamash-1.0.7/m4/extern-inline.m4 2015-06-22 00:25:58.000000000 +0000 +++ datamash-1.1.1/m4/extern-inline.m4 2017-01-19 19:33:39.000000000 +0000 @@ -1,6 +1,6 @@ dnl 'extern inline' a la ISO C99. -dnl Copyright 2012-2015 Free Software Foundation, Inc. +dnl Copyright 2012-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -54,6 +54,7 @@ ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \ : (199901L <= __STDC_VERSION__ \ && !defined __HP_cc \ + && !defined __PGI \ && !(defined __SUNPRO_C && __STDC__))) \ && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) # define _GL_INLINE inline diff -Nru datamash-1.0.7/m4/fabsl.m4 datamash-1.1.1/m4/fabsl.m4 --- datamash-1.0.7/m4/fabsl.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/fabsl.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # fabsl.m4 serial 2 -dnl Copyright (C) 2011-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/fabs.m4 datamash-1.1.1/m4/fabs.m4 --- datamash-1.0.7/m4/fabs.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/fabs.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # fabs.m4 serial 1 -dnl Copyright (C) 2011-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/fcntl-o.m4 datamash-1.1.1/m4/fcntl-o.m4 --- datamash-1.0.7/m4/fcntl-o.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/fcntl-o.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # fcntl-o.m4 serial 4 -dnl Copyright (C) 2006, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/float_h.m4 datamash-1.1.1/m4/float_h.m4 --- datamash-1.0.7/m4/float_h.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/float_h.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # float_h.m4 serial 9 -dnl Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/floorl.m4 datamash-1.1.1/m4/floorl.m4 --- datamash-1.0.7/m4/floorl.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/floorl.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # floorl.m4 serial 11 -dnl Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/floor.m4 datamash-1.1.1/m4/floor.m4 --- datamash-1.0.7/m4/floor.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/floor.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # floor.m4 serial 8 -dnl Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/fpending.m4 datamash-1.1.1/m4/fpending.m4 --- datamash-1.0.7/m4/fpending.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/fpending.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,6 +1,6 @@ -# serial 21 +# serial 22 -# Copyright (C) 2000-2001, 2004-2015 Free Software Foundation, Inc. +# Copyright (C) 2000-2001, 2004-2017 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -11,7 +11,7 @@ dnl Find out how to determine the number of pending output bytes on a stream. dnl glibc (2.1.93 and newer) and Solaris provide __fpending. On other systems, -dnl we have to grub around in the FILE struct. +dnl we have to grub around in the (possibly opaque) FILE struct. AC_DEFUN([gl_FUNC_FPENDING], [ @@ -34,66 +34,3 @@ AC_CHECK_DECLS([__fpending], [], [], [$fp_headers]) fi ]) - -AC_DEFUN([gl_PREREQ_FPENDING], -[ - AC_CACHE_CHECK( - [how to determine the number of pending output bytes on a stream], - ac_cv_sys_pending_output_n_bytes, - [ - for ac_expr in \ - \ - '# glibc2' \ - 'fp->_IO_write_ptr - fp->_IO_write_base' \ - \ - '# traditional Unix' \ - 'fp->_ptr - fp->_base' \ - \ - '# BSD' \ - 'fp->_p - fp->_bf._base' \ - \ - '# SCO, Unixware' \ - '(fp->__ptr ? fp->__ptr - fp->__base : 0)' \ - \ - '# QNX' \ - '(fp->_Mode & 0x2000 /*_MWRITE*/ ? fp->_Next - fp->_Buf : 0)' \ - \ - '# old glibc?' \ - 'fp->__bufp - fp->__buffer' \ - \ - '# old glibc iostream?' \ - 'fp->_pptr - fp->_pbase' \ - \ - '# emx+gcc' \ - 'fp->_ptr - fp->_buffer' \ - \ - '# Minix' \ - 'fp->_ptr - fp->_buf' \ - \ - '# Plan9' \ - 'fp->wp - fp->buf' \ - \ - '# VMS' \ - '(*fp)->_ptr - (*fp)->_base' \ - \ - '# e.g., DGUX R4.11; the info is not available' \ - 1 \ - ; do - - # Skip each embedded comment. - case "$ac_expr" in '#'*) continue;; esac - - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[FILE *fp = stdin; (void) ($ac_expr);]])], - [fp_done=yes] - ) - test "$fp_done" = yes && break - done - - ac_cv_sys_pending_output_n_bytes=$ac_expr - ] - ) - AC_DEFINE_UNQUOTED([PENDING_OUTPUT_N_BYTES], - $ac_cv_sys_pending_output_n_bytes, - [the number of pending output bytes on stream 'fp']) -]) diff -Nru datamash-1.0.7/m4/fpieee.m4 datamash-1.1.1/m4/fpieee.m4 --- datamash-1.0.7/m4/fpieee.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/fpieee.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ -# fpieee.m4 serial 2 -dnl Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc. +# fpieee.m4 serial 2 -*- coding: utf-8 -*- +dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/frexpl.m4 datamash-1.1.1/m4/frexpl.m4 --- datamash-1.0.7/m4/frexpl.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/frexpl.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # frexpl.m4 serial 20 -dnl Copyright (C) 2007-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/frexp.m4 datamash-1.1.1/m4/frexp.m4 --- datamash-1.0.7/m4/frexp.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/frexp.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # frexp.m4 serial 15 -dnl Copyright (C) 2007-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/getopt.m4 datamash-1.1.1/m4/getopt.m4 --- datamash-1.0.7/m4/getopt.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/getopt.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # getopt.m4 serial 44 -dnl Copyright (C) 2002-2006, 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/getprogname.m4 datamash-1.1.1/m4/getprogname.m4 --- datamash-1.0.7/m4/getprogname.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/m4/getprogname.m4 2017-01-10 20:00:58.000000000 +0000 @@ -0,0 +1,43 @@ +# getprogname.m4 - check for getprogname or replacements for it + +# Copyright (C) 2016-2017 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +AC_DEFUN([gl_FUNC_GETPROGNAME], +[ + AC_CHECK_FUNCS_ONCE([getprogname getexecname]) + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + ac_found=0 + AC_CHECK_DECLS([program_invocation_name], [ac_found=1], [], + [#include ]) + AC_CHECK_DECLS([program_invocation_short_name], [ac_found=1], [], + [#include ]) + AC_CHECK_DECLS([__argv], [ac_found=1], [], [#include ]) + + # Incur the cost of this test only if none of the above worked. + if test $ac_found = 0; then + # On OpenBSD 5.1, using the global __progname variable appears to be + # the only way to implement getprogname. + AC_CACHE_CHECK([whether __progname is defined in default libraries], + [gl_cv_var___progname], + [ + gl_cv_var___progname= + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[extern char *__progname;]], + [[return *__progname;]] + )], + [gl_cv_var___progname=yes] + ) + ] + ) + if test "$gl_cv_var___progname" = yes; then + AC_DEFINE([HAVE_VAR___PROGNAME], 1, + [Define if you have a global __progname variable]) + fi + fi +]) diff -Nru datamash-1.0.7/m4/gettext.m4 datamash-1.1.1/m4/gettext.m4 --- datamash-1.0.7/m4/gettext.m4 2015-06-17 23:45:12.000000000 +0000 +++ datamash-1.1.1/m4/gettext.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,16 +1,16 @@ -# gettext.m4 serial 66 (gettext-0.18.2) -dnl Copyright (C) 1995-2014 Free Software Foundation, Inc. +# gettext.m4 serial 68 (gettext-0.19.8) +dnl Copyright (C) 1995-2014, 2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl -dnl This file can can be used in projects which are not available under +dnl This file can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU -dnl gettext package package is covered by the GNU General Public License. +dnl gettext package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: @@ -161,13 +161,18 @@ [AC_LANG_PROGRAM( [[ #include -$gt_revision_test_code +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; +#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings) +#else +#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 +#endif +$gt_revision_test_code ]], [[ bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings +return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ]])], [eval "$gt_func_gnugettext_libc=yes"], [eval "$gt_func_gnugettext_libc=no"])]) @@ -193,17 +198,22 @@ [AC_LANG_PROGRAM( [[ #include -$gt_revision_test_code +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); +#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) +#else +#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 +#endif +$gt_revision_test_code ]], [[ bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") +return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ]])], [eval "$gt_func_gnugettext_libintl=yes"], [eval "$gt_func_gnugettext_libintl=no"]) @@ -214,17 +224,22 @@ [AC_LANG_PROGRAM( [[ #include -$gt_revision_test_code +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); +#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) +#else +#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 +#endif +$gt_revision_test_code ]], [[ bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") +return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION ]])], [LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" @@ -399,3 +414,7 @@ dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) + + +dnl Usage: AM_GNU_GETTEXT_REQUIRE_VERSION([gettext-version]) +AC_DEFUN([AM_GNU_GETTEXT_REQUIRE_VERSION], []) diff -Nru datamash-1.0.7/m4/glibc21.m4 datamash-1.1.1/m4/glibc21.m4 --- datamash-1.0.7/m4/glibc21.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/glibc21.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # glibc21.m4 serial 5 -dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2015 Free Software Foundation, +dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2017 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff -Nru datamash-1.0.7/m4/gl-openssl.m4 datamash-1.1.1/m4/gl-openssl.m4 --- datamash-1.0.7/m4/gl-openssl.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/gl-openssl.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # gl-openssl.m4 serial 3 -dnl Copyright (C) 2013-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2013-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/gnulib-cache.m4 datamash-1.1.1/m4/gnulib-cache.m4 --- datamash-1.0.7/m4/gnulib-cache.m4 2015-06-17 23:45:38.000000000 +0000 +++ datamash-1.1.1/m4/gnulib-cache.m4 2017-01-10 20:38:41.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2015 Free Software Foundation, Inc. +# Copyright (C) 2002-2017 Free Software Foundation, Inc. # # 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 @@ -27,7 +27,7 @@ # Specification in the form of a command-line invocation: -# gnulib-tool --import --dir=. --local-dir=gl --lib=libdatamash --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --makefile-name=gnulib.mk --no-conditional-dependencies --no-libtool --macro-prefix=gl announce-gen assert base64 calloc-gnu closeout configmake crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dirname do-release-commit-and-tag error expl extensions fabsl fdl gendocs getopt-gnu gettext git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload hard-locale hash hash-pjw ignore-value intprops inttostr inttypes isblank isnanl linebuffer locale localeconv maintainer-makefile mbsrtowcs minmax non-recursive-gnulib-prefix-hack progname propername random readme-release realloc-gnu size_max sqrtl stdint stdnoreturn strsep unlocked-io version-etc warnings xalloc xstrndup xstrtol xstrtoumax +# gnulib-tool --import --local-dir=gl --lib=libdatamash --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --makefile-name=gnulib.mk --no-conditional-dependencies --no-libtool --macro-prefix=gl announce-gen assert base64 c-ctype calloc-gnu ceill closeout configmake crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dirname do-release-commit-and-tag error expl extensions fabsl fdl floorl fpucw gendocs getopt-gnu gettext git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload hard-locale hash hash-pjw hash-pjw-bare ignore-value intprops inttostr inttypes isblank isnanl linebuffer locale localeconv maintainer-makefile mbsrtowcs minmax modfl non-recursive-gnulib-prefix-hack pmccabe2html progname propername random readme-release realloc-gnu roundl size_max sqrtl stdint stdnoreturn stpcpy strsep unlocked-io update-copyright version-etc warnings xalloc xstrndup xstrtol xstrtoumax # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([gl]) @@ -35,7 +35,9 @@ announce-gen assert base64 + c-ctype calloc-gnu + ceill closeout configmake crypto/md5 @@ -49,6 +51,8 @@ extensions fabsl fdl + floorl + fpucw gendocs getopt-gnu gettext @@ -59,6 +63,7 @@ hard-locale hash hash-pjw + hash-pjw-bare ignore-value intprops inttostr @@ -71,18 +76,23 @@ maintainer-makefile mbsrtowcs minmax + modfl non-recursive-gnulib-prefix-hack + pmccabe2html progname propername random readme-release realloc-gnu + roundl size_max sqrtl stdint stdnoreturn + stpcpy strsep unlocked-io + update-copyright version-etc warnings xalloc diff -Nru datamash-1.0.7/m4/gnulib-common.m4 datamash-1.1.1/m4/gnulib-common.m4 --- datamash-1.0.7/m4/gnulib-common.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/gnulib-common.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # gnulib-common.m4 serial 36 -dnl Copyright (C) 2007-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -253,9 +253,10 @@ [ dnl Minix 3 comes with two toolchains: The Amsterdam Compiler Kit compiler dnl as "cc", and GCC as "gcc". They have different object file formats and - dnl library formats. In particular, the GNU binutils programs ar, ranlib + dnl library formats. In particular, the GNU binutils programs ar and ranlib dnl produce libraries that work only with gcc, not with cc. AC_REQUIRE([AC_PROG_CC]) + AC_BEFORE([$0], [AM_PROG_AR]) AC_CACHE_CHECK([for Minix Amsterdam compiler], [gl_cv_c_amsterdam_compiler], [ AC_EGREP_CPP([Amsterdam], @@ -267,25 +268,37 @@ [gl_cv_c_amsterdam_compiler=yes], [gl_cv_c_amsterdam_compiler=no]) ]) - if test -z "$AR"; then - if test $gl_cv_c_amsterdam_compiler = yes; then + + dnl Don't compete with AM_PROG_AR's decision about AR/ARFLAGS if we are not + dnl building with __ACK__. + if test $gl_cv_c_amsterdam_compiler = yes; then + if test -z "$AR"; then AR='cc -c.a' - if test -z "$ARFLAGS"; then - ARFLAGS='-o' - fi - else - dnl Use the Automake-documented default values for AR and ARFLAGS, - dnl but prefer ${host}-ar over ar (useful for cross-compiling). - AC_CHECK_TOOL([AR], [ar], [ar]) - if test -z "$ARFLAGS"; then - ARFLAGS='cru' - fi fi - else if test -z "$ARFLAGS"; then - ARFLAGS='cru' + ARFLAGS='-o' fi + else + dnl AM_PROG_AR was added in automake v1.11.2. AM_PROG_AR does not AC_SUBST + dnl ARFLAGS variable (it is filed into Makefile.in directly by automake + dnl script on-demand, if not specified by ./configure of course). + dnl Don't AC_REQUIRE the AM_PROG_AR otherwise the code for __ACK__ above + dnl will be ignored. Also, pay attention to call AM_PROG_AR in else block + dnl because AM_PROG_AR is written so it could re-set AR variable even for + dnl __ACK__. It may seem like its easier to avoid calling the macro here, + dnl but we need to AC_SUBST both AR/ARFLAGS (thus those must have some good + dnl default value and automake should usually know them). + m4_ifdef([AM_PROG_AR], [AM_PROG_AR], [:]) fi + + dnl In case the code above has not helped with setting AR/ARFLAGS, use + dnl Automake-documented default values for AR and ARFLAGS, but prefer + dnl ${host}-ar over ar (useful for cross-compiling). + AC_CHECK_TOOL([AR], [ar], [ar]) + if test -z "$ARFLAGS"; then + ARFLAGS='cr' + fi + AC_SUBST([AR]) AC_SUBST([ARFLAGS]) if test -z "$RANLIB"; then diff -Nru datamash-1.0.7/m4/gnulib-comp.m4 datamash-1.1.1/m4/gnulib-comp.m4 --- datamash-1.0.7/m4/gnulib-comp.m4 2015-06-17 23:45:40.000000000 +0000 +++ datamash-1.1.1/m4/gnulib-comp.m4 2017-01-10 20:38:43.000000000 +0000 @@ -1,5 +1,5 @@ # DO NOT EDIT! GENERATED AUTOMATICALLY! -# Copyright (C) 2002-2015 Free Software Foundation, Inc. +# Copyright (C) 2002-2017 Free Software Foundation, Inc. # # 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 @@ -37,7 +37,11 @@ m4_pattern_allow([^gl_ES$])dnl a valid locale name m4_pattern_allow([^gl_LIBOBJS$])dnl a variable m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable + + # Pre-early section. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([gl_PROG_AR_RANLIB]) + AC_REQUIRE([AM_PROG_CC_C_O]) # Code from module absolute-header: # Code from module alloca-opt: @@ -51,6 +55,8 @@ # Code from module c-strcaseeq: # Code from module calloc-gnu: # Code from module calloc-posix: + # Code from module ceil: + # Code from module ceill: # Code from module close-stream: # Code from module closeout: # Code from module configmake: @@ -70,13 +76,13 @@ # Code from module exp: # Code from module expl: # Code from module extensions: - AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) # Code from module extern-inline: # Code from module fabs: # Code from module fabsl: # Code from module fdl: # Code from module float: # Code from module floor: + # Code from module floorl: # Code from module fpending: # Code from module fpieee: AC_REQUIRE([gl_FP_IEEE]) @@ -86,6 +92,7 @@ # Code from module gendocs: # Code from module getopt-gnu: # Code from module getopt-posix: + # Code from module getprogname: # Code from module gettext: # Code from module gettext-h: # Code from module git-version-gen: @@ -97,6 +104,7 @@ # Code from module hard-locale: # Code from module hash: # Code from module hash-pjw: + # Code from module hash-pjw-bare: # Code from module havelib: # Code from module iconv: # Code from module iconv-h: @@ -109,6 +117,8 @@ # Code from module inttypes: # Code from module inttypes-incomplete: # Code from module isblank: + # Code from module isfinite: + # Code from module isinf: # Code from module isnand-nolibm: # Code from module isnanf-nolibm: # Code from module isnanl: @@ -116,6 +126,7 @@ # Code from module iswblank: # Code from module ldexp: # Code from module ldexpl: + # Code from module limits-h: # Code from module linebuffer: # Code from module localcharset: # Code from module locale: @@ -134,11 +145,14 @@ # Code from module mbuiter: # Code from module memchr: # Code from module minmax: + # Code from module modf: + # Code from module modfl: # Code from module msvc-inval: # Code from module msvc-nothrow: # Code from module multiarch: # Code from module nocrash: # Code from module non-recursive-gnulib-prefix-hack: + # Code from module pmccabe2html: # Code from module progname: # Code from module propername: # Code from module quotearg: @@ -173,6 +187,7 @@ # Code from module stdio: # Code from module stdlib: # Code from module stdnoreturn: + # Code from module stpcpy: # Code from module streq: # Code from module strerror: # Code from module strerror-override: @@ -186,6 +201,8 @@ # Code from module strtoumax: # Code from module sys_types: # Code from module trim: + # Code from module trunc: + # Code from module truncl: # Code from module u64: # Code from module unistd: # Code from module unistr/base: @@ -195,6 +212,7 @@ # Code from module uniwidth/base: # Code from module uniwidth/width: # Code from module unlocked-io: + # Code from module update-copyright: # Code from module useless-if-before-free: # Code from module vc-list-files: # Code from module verify: @@ -241,6 +259,16 @@ AC_LIBOBJ([calloc]) fi gl_STDLIB_MODULE_INDICATOR([calloc-posix]) + gl_FUNC_CEIL + if test $REPLACE_CEIL = 1; then + AC_LIBOBJ([ceil]) + fi + gl_MATH_MODULE_INDICATOR([ceil]) + gl_FUNC_CEILL + if test $HAVE_DECL_CEILL = 0 || test $REPLACE_CEILL = 1; then + AC_LIBOBJ([ceill]) + fi + gl_MATH_MODULE_INDICATOR([ceill]) gl_CLOSE_STREAM gl_MODULE_INDICATOR([close-stream]) gl_CLOSEOUT @@ -289,17 +317,21 @@ AC_LIBOBJ([floor]) fi gl_MATH_MODULE_INDICATOR([floor]) + gl_FUNC_FLOORL + if test $HAVE_DECL_FLOORL = 0 || test $REPLACE_FLOORL = 1; then + AC_LIBOBJ([floorl]) + fi + gl_MATH_MODULE_INDICATOR([floorl]) gl_FUNC_FPENDING if test $gl_cv_func___fpending = no; then AC_LIBOBJ([fpending]) - gl_PREREQ_FPENDING fi - gl_FUNC_FREXP + AC_REQUIRE([gl_FUNC_FREXP]) if test $gl_func_frexp != yes; then AC_LIBOBJ([frexp]) fi gl_MATH_MODULE_INDICATOR([frexp]) - gl_FUNC_FREXPL + AC_REQUIRE([gl_FUNC_FREXPL]) if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl = no; then AC_LIBOBJ([frexpl]) fi @@ -313,7 +345,6 @@ GNULIB_GL_UNISTD_H_GETOPT=1 fi AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT]) - gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu]) gl_FUNC_GETOPT_POSIX if test $REPLACE_GETOPT = 1; then AC_LIBOBJ([getopt]) @@ -323,6 +354,7 @@ GNULIB_GL_UNISTD_H_GETOPT=1 fi AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT]) + gl_FUNC_GETPROGNAME dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac. AM_GNU_GETTEXT_VERSION([0.18.1]) AC_SUBST([LIBINTL]) @@ -359,6 +391,16 @@ AC_LIBOBJ([isblank]) fi gl_CTYPE_MODULE_INDICATOR([isblank]) + gl_ISFINITE + if test $REPLACE_ISFINITE = 1; then + AC_LIBOBJ([isfinite]) + fi + gl_MATH_MODULE_INDICATOR([isfinite]) + gl_ISINF + if test $REPLACE_ISINF = 1; then + AC_LIBOBJ([isinf]) + fi + gl_MATH_MODULE_INDICATOR([isinf]) gl_FUNC_ISNAND_NO_LIBM if test $gl_func_isnand_no_libm != yes; then AC_LIBOBJ([isnand]) @@ -398,6 +440,7 @@ AC_LIBOBJ([ldexpl]) fi gl_MATH_MODULE_INDICATOR([ldexpl]) + gl_LIMITS_H gl_LOCALCHARSET LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\"" AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT]) @@ -450,11 +493,21 @@ fi gl_STRING_MODULE_INDICATOR([memchr]) gl_MINMAX - gl_MSVC_INVAL + gl_FUNC_MODF + if test $REPLACE_MODF = 1; then + AC_LIBOBJ([modf]) + fi + gl_MATH_MODULE_INDICATOR([modf]) + gl_FUNC_MODFL + if test $HAVE_MODFL = 0 || test $REPLACE_MODFL = 1; then + AC_LIBOBJ([modfl]) + fi + gl_MATH_MODULE_INDICATOR([modfl]) + AC_REQUIRE([gl_MSVC_INVAL]) if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then AC_LIBOBJ([msvc-inval]) fi - gl_MSVC_NOTHROW + AC_REQUIRE([gl_MSVC_NOTHROW]) if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then AC_LIBOBJ([msvc-nothrow]) fi @@ -462,8 +515,12 @@ dnl Run our hack near the end, just before config.status creation. dnl It must happen late, i.e., after gl_LIBOBJS has been finalized. AC_CONFIG_COMMANDS_PRE([ + dnl Note we can't currently pass $gl_source_base instead of 'lib', + dnl because $gl_source_base is unset or the wrong value in the references + dnl generated in m4/non-recursive-gnulib-prefix-hack.m4 gl_NON_RECURSIVE_GNULIB_PREFIX_HACK([lib]) ]) + AC_PATH_PROG([PMCCABE], [pmccabe], [false]) AC_CHECK_DECLS([program_invocation_name], [], [], [#include ]) AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include ]) m4_ifdef([AM_XGETTEXT_OPTION], @@ -525,6 +582,12 @@ gl_STDIO_H gl_STDLIB_H gl_STDNORETURN_H + gl_FUNC_STPCPY + if test $HAVE_STPCPY = 0; then + AC_LIBOBJ([stpcpy]) + gl_PREREQ_STPCPY + fi + gl_STRING_MODULE_INDICATOR([stpcpy]) gl_FUNC_STRERROR if test $REPLACE_STRERROR = 1; then AC_LIBOBJ([strerror]) @@ -573,6 +636,16 @@ gl_INTTYPES_MODULE_INDICATOR([strtoumax]) gl_SYS_TYPES_H AC_PROG_MKDIR_P + gl_FUNC_TRUNC + if test $HAVE_DECL_TRUNC = 0 || test $REPLACE_TRUNC = 1; then + AC_LIBOBJ([trunc]) + fi + gl_MATH_MODULE_INDICATOR([trunc]) + gl_FUNC_TRUNCL + if test $HAVE_DECL_TRUNCL = 0 || test $REPLACE_TRUNCL = 1; then + AC_LIBOBJ([truncl]) + fi + gl_MATH_MODULE_INDICATOR([truncl]) gl_UNISTD_H gl_LIBUNISTRING_LIBHEADER([0.9.4], [unistr.h]) gl_MODULE_INDICATOR([unistr/u8-mbtoucr]) @@ -581,7 +654,7 @@ gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-uctomb]) gl_LIBUNISTRING_LIBHEADER([0.9.4], [unitypes.h]) gl_LIBUNISTRING_LIBHEADER([0.9.4], [uniwidth.h]) - gl_LIBUNISTRING_MODULE([0.9.5], [uniwidth/width]) + gl_LIBUNISTRING_MODULE([0.9.6], [uniwidth/width]) gl_FUNC_GLIBC_UNLOCKED_IO gl_VERSION_ETC gl_WCHAR_H @@ -742,12 +815,15 @@ build-aux/gitlog-to-changelog build-aux/gnu-web-doc-update build-aux/gnupload + build-aux/pmccabe.css + build-aux/pmccabe2html build-aux/prefix-gnulib-mk build-aux/snippet/_Noreturn.h build-aux/snippet/arg-nonnull.h build-aux/snippet/c++defs.h build-aux/snippet/unused-parameter.h build-aux/snippet/warn-on-use.h + build-aux/update-copyright build-aux/useless-if-before-free build-aux/vc-list-files doc/fdl.texi @@ -769,6 +845,8 @@ lib/c-strcaseeq.h lib/c-strncasecmp.c lib/calloc.c + lib/ceil.c + lib/ceill.c lib/close-stream.c lib/close-stream.h lib/closeout.c @@ -791,6 +869,7 @@ lib/float.c lib/float.in.h lib/floor.c + lib/floorl.c lib/fpending.c lib/fpending.h lib/fpucw.h @@ -800,10 +879,14 @@ lib/getopt.in.h lib/getopt1.c lib/getopt_int.h + lib/getprogname.c + lib/getprogname.h lib/gettext.h lib/gl_openssl.h lib/hard-locale.c lib/hard-locale.h + lib/hash-pjw-bare.c + lib/hash-pjw-bare.h lib/hash-pjw.c lib/hash-pjw.h lib/hash.c @@ -824,6 +907,8 @@ lib/inttostr.h lib/inttypes.in.h lib/isblank.c + lib/isfinite.c + lib/isinf.c lib/isnan.c lib/isnand-nolibm.h lib/isnand.c @@ -834,6 +919,7 @@ lib/iswblank.c lib/itold.c lib/ldexpl.c + lib/limits.in.h lib/linebuffer.c lib/linebuffer.h lib/localcharset.c @@ -864,6 +950,8 @@ lib/memchr.c lib/memchr.valgrind lib/minmax.h + lib/modf.c + lib/modfl.c lib/msvc-inval.c lib/msvc-inval.h lib/msvc-nothrow.c @@ -899,9 +987,11 @@ lib/stdbool.in.h lib/stddef.in.h lib/stdint.in.h + lib/stdio-impl.h lib/stdio.in.h lib/stdlib.in.h lib/stdnoreturn.in.h + lib/stpcpy.c lib/str-kmp.h lib/streq.h lib/strerror-override.c @@ -924,6 +1014,8 @@ lib/sys_types.in.h lib/trim.c lib/trim.h + lib/trunc.c + lib/truncl.c lib/u64.c lib/u64.h lib/uinttostr.c @@ -996,6 +1088,7 @@ m4/frexp.m4 m4/frexpl.m4 m4/getopt.m4 + m4/getprogname.m4 m4/gettext.m4 m4/gl-openssl.m4 m4/glibc2.m4 @@ -1017,6 +1110,8 @@ m4/inttypes.m4 m4/inttypes_h.m4 m4/isblank.m4 + m4/isfinite.m4 + m4/isinf.m4 m4/isnand.m4 m4/isnanf.m4 m4/isnanl.m4 @@ -1028,6 +1123,7 @@ m4/lib-link.m4 m4/lib-prefix.m4 m4/libunistring-base.m4 + m4/limits-h.m4 m4/localcharset.m4 m4/locale-fr.m4 m4/locale-ja.m4 @@ -1051,6 +1147,8 @@ m4/memchr.m4 m4/minmax.m4 m4/mmap-anon.m4 + m4/modf.m4 + m4/modfl.m4 m4/msvc-inval.m4 m4/msvc-nothrow.m4 m4/multiarch.m4 @@ -1084,6 +1182,7 @@ m4/stdio_h.m4 m4/stdlib_h.m4 m4/stdnoreturn.m4 + m4/stpcpy.m4 m4/strerror.m4 m4/string_h.m4 m4/strndup.m4 @@ -1094,6 +1193,8 @@ m4/sys_socket_h.m4 m4/sys_types_h.m4 m4/threadlib.m4 + m4/trunc.m4 + m4/truncl.m4 m4/uintmax_t.m4 m4/unistd_h.m4 m4/unlocked-io.m4 diff -Nru datamash-1.0.7/m4/hard-locale.m4 datamash-1.1.1/m4/hard-locale.m4 --- datamash-1.0.7/m4/hard-locale.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/hard-locale.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # hard-locale.m4 serial 8 -dnl Copyright (C) 2002-2006, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/iconv_h.m4 datamash-1.1.1/m4/iconv_h.m4 --- datamash-1.0.7/m4/iconv_h.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/iconv_h.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # iconv_h.m4 serial 8 -dnl Copyright (C) 2007-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/iconv.m4 datamash-1.1.1/m4/iconv.m4 --- datamash-1.0.7/m4/iconv.m4 2015-06-17 23:45:12.000000000 +0000 +++ datamash-1.1.1/m4/iconv.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ -# iconv.m4 serial 19 (gettext-0.18.2) -dnl Copyright (C) 2000-2002, 2007-2014 Free Software Foundation, Inc. +# iconv.m4 serial 20 +dnl Copyright (C) 2000-2002, 2007-2014, 2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -258,14 +258,18 @@ am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([ $am_cv_proto_iconv]) - AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], - [Define as const if the declaration of iconv() needs const.]) - dnl Also substitute ICONV_CONST in the gnulib generated . - m4_ifdef([gl_ICONV_H_DEFAULTS], - [AC_REQUIRE([gl_ICONV_H_DEFAULTS]) - if test -n "$am_cv_proto_iconv_arg1"; then - ICONV_CONST="const" - fi - ]) + else + dnl When compiling GNU libiconv on a system that does not have iconv yet, + dnl pick the POSIX compliant declaration without 'const'. + am_cv_proto_iconv_arg1="" fi + AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], + [Define as const if the declaration of iconv() needs const.]) + dnl Also substitute ICONV_CONST in the gnulib generated . + m4_ifdef([gl_ICONV_H_DEFAULTS], + [AC_REQUIRE([gl_ICONV_H_DEFAULTS]) + if test -n "$am_cv_proto_iconv_arg1"; then + ICONV_CONST="const" + fi + ]) ]) diff -Nru datamash-1.0.7/m4/iconv_open.m4 datamash-1.1.1/m4/iconv_open.m4 --- datamash-1.0.7/m4/iconv_open.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/iconv_open.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # iconv_open.m4 serial 14 -dnl Copyright (C) 2007-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/include_next.m4 datamash-1.1.1/m4/include_next.m4 --- datamash-1.0.7/m4/include_next.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/include_next.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # include_next.m4 serial 23 -dnl Copyright (C) 2006-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/inline.m4 datamash-1.1.1/m4/inline.m4 --- datamash-1.0.7/m4/inline.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/inline.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # inline.m4 serial 4 -dnl Copyright (C) 2006, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/intlmacosx.m4 datamash-1.1.1/m4/intlmacosx.m4 --- datamash-1.0.7/m4/intlmacosx.m4 2015-06-17 23:45:12.000000000 +0000 +++ datamash-1.1.1/m4/intlmacosx.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,16 +1,16 @@ # intlmacosx.m4 serial 5 (gettext-0.18.2) -dnl Copyright (C) 2004-2014 Free Software Foundation, Inc. +dnl Copyright (C) 2004-2014, 2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl -dnl This file can can be used in projects which are not available under +dnl This file can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU -dnl gettext package package is covered by the GNU General Public License. +dnl gettext package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Checks for special options needed on Mac OS X. diff -Nru datamash-1.0.7/m4/inttostr.m4 datamash-1.1.1/m4/inttostr.m4 --- datamash-1.0.7/m4/inttostr.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/inttostr.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ #serial 8 -dnl Copyright (C) 2004-2006, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2004-2006, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/inttypes.m4 datamash-1.1.1/m4/inttypes.m4 --- datamash-1.0.7/m4/inttypes.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/inttypes.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # inttypes.m4 serial 26 -dnl Copyright (C) 2006-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/inttypes-pri.m4 datamash-1.1.1/m4/inttypes-pri.m4 --- datamash-1.0.7/m4/inttypes-pri.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/inttypes-pri.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # inttypes-pri.m4 serial 7 (gettext-0.18.2) -dnl Copyright (C) 1997-2002, 2006, 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 1997-2002, 2006, 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/isblank.m4 datamash-1.1.1/m4/isblank.m4 --- datamash-1.0.7/m4/isblank.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/isblank.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # isblank.m4 serial 3 -dnl Copyright (C) 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/isfinite.m4 datamash-1.1.1/m4/isfinite.m4 --- datamash-1.0.7/m4/isfinite.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/m4/isfinite.m4 2017-01-10 20:01:01.000000000 +0000 @@ -0,0 +1,149 @@ +# isfinite.m4 serial 15 +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_ISFINITE], +[ + AC_REQUIRE([gl_MATH_H_DEFAULTS]) + dnl Persuade glibc to declare isfinite. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_CHECK_DECLS([isfinite], , , [[#include ]]) + if test "$ac_cv_have_decl_isfinite" = yes; then + gl_CHECK_MATH_LIB([ISFINITE_LIBM], + [x = isfinite (x) + isfinite ((float) x);]) + if test "$ISFINITE_LIBM" != missing; then + dnl Test whether isfinite() on 'long double' works. + gl_ISFINITEL_WORKS + case "$gl_cv_func_isfinitel_works" in + *yes) ;; + *) ISFINITE_LIBM=missing;; + esac + dnl Also, isfinite() on 'double' does not work on Linux/ia64 (because of + dnl signalling NaNs). But this does not have to be tested, since + dnl isfinite(long double) also does not work in this situation. + fi + fi + if test "$ac_cv_have_decl_isfinite" != yes || + test "$ISFINITE_LIBM" = missing; then + REPLACE_ISFINITE=1 + dnl No libraries are needed to link lib/isfinite.c. + ISFINITE_LIBM= + fi + AC_SUBST([ISFINITE_LIBM]) +]) + +dnl Test whether isfinite() on 'long double' recognizes all canonical values +dnl which are neither finite nor infinite. +AC_DEFUN([gl_ISFINITEL_WORKS], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gl_BIGENDIAN]) + AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether isfinite(long double) works], [gl_cv_func_isfinitel_works], + [ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#include +#include +#include +#define NWORDS \ + ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { unsigned int word[NWORDS]; long double value; } + memory_long_double; +/* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the + runtime type conversion. */ +#ifdef __sgi +static long double NaNl () +{ + double zero = 0.0; + return zero / zero; +} +#else +# define NaNl() (0.0L / 0.0L) +#endif +int main () +{ + int result = 0; + + { + memory_long_double m; + unsigned int i; + + /* The isfinite macro should be immune against changes in the sign bit and + in the mantissa bits. The xor operation twiddles a bit that can only be + a sign bit or a mantissa bit (since the exponent never extends to + bit 31). */ + m.value = NaNl (); + m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1); + for (i = 0; i < NWORDS; i++) + m.word[i] |= 1; + if (isfinite (m.value)) + result |= 1; + } + +#if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE +/* Representation of an 80-bit 'long double' as an initializer for a sequence + of 'unsigned int' words. */ +# ifdef WORDS_BIGENDIAN +# define LDBL80_WORDS(exponent,manthi,mantlo) \ + { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ + ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ + (unsigned int) (mantlo) << 16 \ + } +# else +# define LDBL80_WORDS(exponent,manthi,mantlo) \ + { mantlo, manthi, exponent } +# endif + { /* Quiet NaN. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + if (isfinite (x.value)) + result |= 2; + } + { + /* Signalling NaN. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + if (isfinite (x.value)) + result |= 2; + } + /* isfinite should return something even for noncanonical values. */ + { /* Pseudo-NaN. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + if (isfinite (x.value) && !isfinite (x.value)) + result |= 4; + } + { /* Pseudo-Infinity. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + if (isfinite (x.value) && !isfinite (x.value)) + result |= 8; + } + { /* Pseudo-Zero. */ + static memory_long_double x = + { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + if (isfinite (x.value) && !isfinite (x.value)) + result |= 16; + } + { /* Unnormalized number. */ + static memory_long_double x = + { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + if (isfinite (x.value) && !isfinite (x.value)) + result |= 32; + } + { /* Pseudo-Denormal. */ + static memory_long_double x = + { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + if (isfinite (x.value) && !isfinite (x.value)) + result |= 64; + } +#endif + + return result; +}]])], [gl_cv_func_isfinitel_works=yes], [gl_cv_func_isfinitel_works=no], + [gl_cv_func_isfinitel_works="guessing yes"]) + ]) +]) diff -Nru datamash-1.0.7/m4/isinf.m4 datamash-1.1.1/m4/isinf.m4 --- datamash-1.0.7/m4/isinf.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/m4/isinf.m4 2017-01-10 20:01:01.000000000 +0000 @@ -0,0 +1,156 @@ +# isinf.m4 serial 11 +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_ISINF], +[ + AC_REQUIRE([gl_MATH_H_DEFAULTS]) + dnl Persuade glibc to declare isinf. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_CHECK_DECLS([isinf], , , + [[#include + #ifndef isinf + #error "isinf must be a macro, not a function" + #endif + ]]) + if test "$ac_cv_have_decl_isinf" = yes; then + gl_CHECK_MATH_LIB([ISINF_LIBM], [x = isinf (x) + isinf ((float) x);]) + if test "$ISINF_LIBM" != missing; then + dnl Test whether isinf() on 'long double' works. + gl_ISINFL_WORKS + case "$gl_cv_func_isinfl_works" in + *yes) ;; + *) ISINF_LIBM=missing;; + esac + fi + fi + if test "$ac_cv_have_decl_isinf" != yes || + test "$ISINF_LIBM" = missing; then + REPLACE_ISINF=1 + dnl No libraries are needed to link lib/isinf.c. + ISINF_LIBM= + fi + AC_SUBST([ISINF_LIBM]) +]) + +dnl Test whether isinf() works: +dnl 1) Whether it correctly returns false for LDBL_MAX. +dnl 2) Whether on 'long double' recognizes all canonical values which are +dnl infinite. +AC_DEFUN([gl_ISINFL_WORKS], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gl_BIGENDIAN]) + AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether isinf(long double) works], [gl_cv_func_isinfl_works], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +#include +#define NWORDS \ + ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) +typedef union { unsigned int word[NWORDS]; long double value; } + memory_long_double; +/* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the + runtime type conversion. */ +#ifdef __sgi +static long double NaNl () +{ + double zero = 0.0; + return zero / zero; +} +#else +# define NaNl() (0.0L / 0.0L) +#endif +int main () +{ + int result = 0; + + if (isinf (LDBL_MAX)) + result |= 1; + + { + memory_long_double m; + unsigned int i; + + /* The isinf macro should be immune against changes in the sign bit and + in the mantissa bits. The xor operation twiddles a bit that can only be + a sign bit or a mantissa bit (since the exponent never extends to + bit 31). */ + m.value = NaNl (); + m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1); + for (i = 0; i < NWORDS; i++) + m.word[i] |= 1; + if (isinf (m.value)) + result |= 2; + } + +#if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE +/* Representation of an 80-bit 'long double' as an initializer for a sequence + of 'unsigned int' words. */ +# ifdef WORDS_BIGENDIAN +# define LDBL80_WORDS(exponent,manthi,mantlo) \ + { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \ + ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16), \ + (unsigned int) (mantlo) << 16 \ + } +# else +# define LDBL80_WORDS(exponent,manthi,mantlo) \ + { mantlo, manthi, exponent } +# endif + { /* Quiet NaN. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + if (isinf (x.value)) + result |= 2; + } + { + /* Signalling NaN. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + if (isinf (x.value)) + result |= 2; + } + /* isinf should return something even for noncanonical values. */ + { /* Pseudo-NaN. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + if (isinf (x.value) && !isinf (x.value)) + result |= 4; + } + { /* Pseudo-Infinity. */ + static memory_long_double x = + { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + if (isinf (x.value) && !isinf (x.value)) + result |= 8; + } + { /* Pseudo-Zero. */ + static memory_long_double x = + { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + if (isinf (x.value) && !isinf (x.value)) + result |= 16; + } + { /* Unnormalized number. */ + static memory_long_double x = + { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + if (isinf (x.value) && !isinf (x.value)) + result |= 32; + } + { /* Pseudo-Denormal. */ + static memory_long_double x = + { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + if (isinf (x.value) && !isinf (x.value)) + result |= 64; + } +#endif + + return result; +}]])], [gl_cv_func_isinfl_works=yes], [gl_cv_func_isinfl_works=no], + [gl_cv_func_isinfl_works="guessing yes"]) + ]) +]) diff -Nru datamash-1.0.7/m4/isnand.m4 datamash-1.1.1/m4/isnand.m4 --- datamash-1.0.7/m4/isnand.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/isnand.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # isnand.m4 serial 11 -dnl Copyright (C) 2007-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/isnanf.m4 datamash-1.1.1/m4/isnanf.m4 --- datamash-1.0.7/m4/isnanf.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/isnanf.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # isnanf.m4 serial 14 -dnl Copyright (C) 2007-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/isnanl.m4 datamash-1.1.1/m4/isnanl.m4 --- datamash-1.0.7/m4/isnanl.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/isnanl.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # isnanl.m4 serial 19 -dnl Copyright (C) 2007-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/iswblank.m4 datamash-1.1.1/m4/iswblank.m4 --- datamash-1.0.7/m4/iswblank.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/iswblank.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # iswblank.m4 serial 4 -dnl Copyright (C) 2011-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/ldexpl.m4 datamash-1.1.1/m4/ldexpl.m4 --- datamash-1.0.7/m4/ldexpl.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/ldexpl.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # ldexpl.m4 serial 16 -dnl Copyright (C) 2007-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/ldexp.m4 datamash-1.1.1/m4/ldexp.m4 --- datamash-1.0.7/m4/ldexp.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/ldexp.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # ldexp.m4 serial 1 -dnl Copyright (C) 2010-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2010-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/lib-ld.m4 datamash-1.1.1/m4/lib-ld.m4 --- datamash-1.0.7/m4/lib-ld.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/lib-ld.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # lib-ld.m4 serial 6 -dnl Copyright (C) 1996-2003, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 1996-2003, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/lib-link.m4 datamash-1.1.1/m4/lib-link.m4 --- datamash-1.0.7/m4/lib-link.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/lib-link.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # lib-link.m4 serial 26 (gettext-0.18.2) -dnl Copyright (C) 2001-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/lib-prefix.m4 datamash-1.1.1/m4/lib-prefix.m4 --- datamash-1.0.7/m4/lib-prefix.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/lib-prefix.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # lib-prefix.m4 serial 7 (gettext-0.18) -dnl Copyright (C) 2001-2005, 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2005, 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/libunistring-base.m4 datamash-1.1.1/m4/libunistring-base.m4 --- datamash-1.0.7/m4/libunistring-base.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/libunistring-base.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # libunistring-base.m4 serial 5 -dnl Copyright (C) 2010-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2010-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/limits-h.m4 datamash-1.1.1/m4/limits-h.m4 --- datamash-1.0.7/m4/limits-h.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/m4/limits-h.m4 2017-01-10 20:00:58.000000000 +0000 @@ -0,0 +1,31 @@ +dnl Check whether limits.h has needed features. + +dnl Copyright 2016-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Paul Eggert. + +AC_DEFUN_ONCE([gl_LIMITS_H], +[ + gl_CHECK_NEXT_HEADERS([limits.h]) + + AC_CACHE_CHECK([whether limits.h has ULLONG_WIDTH etc.], + [gl_cv_header_limits_width], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#ifndef __STDC_WANT_IEC_60559_BFP_EXT__ + #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 + #endif + #include + int ullw = ULLONG_WIDTH;]])], + [gl_cv_header_limits_width=yes], + [gl_cv_header_limits_width=no])]) + if test "$gl_cv_header_limits_width" = yes; then + LIMITS_H= + else + LIMITS_H=limits.h + fi + AC_SUBST([LIMITS_H]) + AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"]) +]) diff -Nru datamash-1.0.7/m4/localcharset.m4 datamash-1.1.1/m4/localcharset.m4 --- datamash-1.0.7/m4/localcharset.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/localcharset.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # localcharset.m4 serial 7 -dnl Copyright (C) 2002, 2004, 2006, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2004, 2006, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/localeconv.m4 datamash-1.1.1/m4/localeconv.m4 --- datamash-1.0.7/m4/localeconv.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/localeconv.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # localeconv.m4 serial 1 -dnl Copyright (C) 2012-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2012-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/locale-fr.m4 datamash-1.1.1/m4/locale-fr.m4 --- datamash-1.0.7/m4/locale-fr.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/locale-fr.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # locale-fr.m4 serial 17 -dnl Copyright (C) 2003, 2005-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2005-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/locale_h.m4 datamash-1.1.1/m4/locale_h.m4 --- datamash-1.0.7/m4/locale_h.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/locale_h.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # locale_h.m4 serial 19 -dnl Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/locale-ja.m4 datamash-1.1.1/m4/locale-ja.m4 --- datamash-1.0.7/m4/locale-ja.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/locale-ja.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # locale-ja.m4 serial 12 -dnl Copyright (C) 2003, 2005-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2005-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/locale-zh.m4 datamash-1.1.1/m4/locale-zh.m4 --- datamash-1.0.7/m4/locale-zh.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/locale-zh.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # locale-zh.m4 serial 12 -dnl Copyright (C) 2003, 2005-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2005-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/longlong.m4 datamash-1.1.1/m4/longlong.m4 --- datamash-1.0.7/m4/longlong.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/longlong.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # longlong.m4 serial 17 -dnl Copyright (C) 1999-2007, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 1999-2007, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/malloca.m4 datamash-1.1.1/m4/malloca.m4 --- datamash-1.0.7/m4/malloca.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/malloca.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # malloca.m4 serial 1 -dnl Copyright (C) 2003-2004, 2006-2007, 2009-2015 Free Software Foundation, +dnl Copyright (C) 2003-2004, 2006-2007, 2009-2017 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff -Nru datamash-1.0.7/m4/malloc.m4 datamash-1.1.1/m4/malloc.m4 --- datamash-1.0.7/m4/malloc.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/malloc.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,13 +1,13 @@ -# malloc.m4 serial 14 -dnl Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc. +# malloc.m4 serial 15 +dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. m4_version_prereq([2.70], [] ,[ -# This is taken from the following Autoconf patch: -# http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=7fbb553727ed7e0e689a17594b58559ecf3ea6e9 +# This is adapted with modifications from upstream Autoconf here: +# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c AC_DEFUN([_AC_FUNC_MALLOC_IF], [ AC_REQUIRE([AC_HEADER_STDC])dnl @@ -23,7 +23,10 @@ char *malloc (); #endif ]], - [[return ! malloc (0);]]) + [[char *p = malloc (0); + int result = !p; + free (p); + return result;]]) ], [ac_cv_func_malloc_0_nonnull=yes], [ac_cv_func_malloc_0_nonnull=no], diff -Nru datamash-1.0.7/m4/mathfunc.m4 datamash-1.1.1/m4/mathfunc.m4 --- datamash-1.0.7/m4/mathfunc.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/mathfunc.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # mathfunc.m4 serial 11 -dnl Copyright (C) 2010-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2010-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/math_h.m4 datamash-1.1.1/m4/math_h.m4 --- datamash-1.0.7/m4/math_h.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/math_h.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ -# math_h.m4 serial 114 -dnl Copyright (C) 2007-2015 Free Software Foundation, Inc. +# math_h.m4 serial 115 +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -256,11 +256,18 @@ HAVE_DECL_TRUNC=1; AC_SUBST([HAVE_DECL_TRUNC]) HAVE_DECL_TRUNCF=1; AC_SUBST([HAVE_DECL_TRUNCF]) HAVE_DECL_TRUNCL=1; AC_SUBST([HAVE_DECL_TRUNCL]) + REPLACE_ACOSF=0; AC_SUBST([REPLACE_ACOSF]) + REPLACE_ASINF=0; AC_SUBST([REPLACE_ASINF]) + REPLACE_ATANF=0; AC_SUBST([REPLACE_ATANF]) + REPLACE_ATAN2F=0; AC_SUBST([REPLACE_ATAN2F]) REPLACE_CBRTF=0; AC_SUBST([REPLACE_CBRTF]) REPLACE_CBRTL=0; AC_SUBST([REPLACE_CBRTL]) REPLACE_CEIL=0; AC_SUBST([REPLACE_CEIL]) REPLACE_CEILF=0; AC_SUBST([REPLACE_CEILF]) REPLACE_CEILL=0; AC_SUBST([REPLACE_CEILL]) + REPLACE_COSF=0; AC_SUBST([REPLACE_COSF]) + REPLACE_COSHF=0; AC_SUBST([REPLACE_COSHF]) + REPLACE_EXPF=0; AC_SUBST([REPLACE_EXPF]) REPLACE_EXPM1=0; AC_SUBST([REPLACE_EXPM1]) REPLACE_EXPM1F=0; AC_SUBST([REPLACE_EXPM1F]) REPLACE_EXP2=0; AC_SUBST([REPLACE_EXP2]) @@ -315,7 +322,12 @@ REPLACE_ROUNDL=0; AC_SUBST([REPLACE_ROUNDL]) REPLACE_SIGNBIT=0; AC_SUBST([REPLACE_SIGNBIT]) REPLACE_SIGNBIT_USING_GCC=0; AC_SUBST([REPLACE_SIGNBIT_USING_GCC]) + REPLACE_SINF=0; AC_SUBST([REPLACE_SINF]) + REPLACE_SINHF=0; AC_SUBST([REPLACE_SINHF]) + REPLACE_SQRTF=0; AC_SUBST([REPLACE_SQRTF]) REPLACE_SQRTL=0; AC_SUBST([REPLACE_SQRTL]) + REPLACE_TANF=0; AC_SUBST([REPLACE_TANF]) + REPLACE_TANHF=0; AC_SUBST([REPLACE_TANHF]) REPLACE_TRUNC=0; AC_SUBST([REPLACE_TRUNC]) REPLACE_TRUNCF=0; AC_SUBST([REPLACE_TRUNCF]) REPLACE_TRUNCL=0; AC_SUBST([REPLACE_TRUNCL]) diff -Nru datamash-1.0.7/m4/mbchar.m4 datamash-1.1.1/m4/mbchar.m4 --- datamash-1.0.7/m4/mbchar.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/mbchar.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # mbchar.m4 serial 9 -dnl Copyright (C) 2005-2007, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2007, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/mbiter.m4 datamash-1.1.1/m4/mbiter.m4 --- datamash-1.0.7/m4/mbiter.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/mbiter.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # mbiter.m4 serial 7 -dnl Copyright (C) 2005, 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/mbrtowc.m4 datamash-1.1.1/m4/mbrtowc.m4 --- datamash-1.0.7/m4/mbrtowc.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/mbrtowc.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ -# mbrtowc.m4 serial 26 -dnl Copyright (C) 2001-2002, 2004-2005, 2008-2015 Free Software Foundation, +# mbrtowc.m4 serial 27 -*- coding: utf-8 -*- +dnl Copyright (C) 2001-2002, 2004-2005, 2008-2017 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -40,6 +40,7 @@ gl_MBRTOWC_RETVAL gl_MBRTOWC_NUL_RETVAL gl_MBRTOWC_EMPTY_INPUT + gl_MBRTOWC_C_LOCALE case "$gl_cv_func_mbrtowc_null_arg1" in *yes) ;; *) AC_DEFINE([MBRTOWC_NULL_ARG1_BUG], [1], @@ -76,6 +77,13 @@ REPLACE_MBRTOWC=1 ;; esac + case $gl_cv_C_locale_sans_EILSEQ in + *yes) ;; + *) AC_DEFINE([C_LOCALE_MAYBE_EILSEQ], [1], + [Define to 1 if the C locale may have encoding errors.]) + REPLACE_MBRTOWC=1 + ;; + esac fi fi ]) @@ -156,7 +164,7 @@ memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) if (mbsinit (&state)) - return 1; + return 2; } return 0; }]])], @@ -216,7 +224,7 @@ memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, input + 3, 6, &state) != 4 && mbtowc (&wc, input + 3, 6) == 4) - return 1; + return 2; } return 0; }]])], @@ -344,7 +352,7 @@ mbrtowc (&wc, NULL, 5, &state); /* Check that wc was not modified. */ if (wc != (wchar_t) 0xBADFACE) - return 1; + return 2; } return 0; }]])], @@ -531,7 +539,7 @@ memset (&state, '\0', sizeof (mbstate_t)); if (mbrtowc (&wc, "", 1, &state) != 0) - return 1; + return 2; } return 0; }]])], @@ -569,14 +577,54 @@ int main (void) { - return mbrtowc (&wc, "", 0, &mbs) == (size_t) -2; + return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2; }]])], - [gl_cv_func_mbrtowc_empty_input=no], [gl_cv_func_mbrtowc_empty_input=yes], + [gl_cv_func_mbrtowc_empty_input=no], [:]) ]) ]) +dnl Test whether mbrtowc reports encoding errors in the C locale. +dnl Although POSIX was never intended to allow this, the GNU C Library +dnl and other implementations do it. See: +dnl https://sourceware.org/bugzilla/show_bug.cgi?id=19932 + +AC_DEFUN([gl_MBRTOWC_C_LOCALE], +[ + AC_CACHE_CHECK([whether the C locale is free of encoding errors], + [gl_cv_C_locale_sans_EILSEQ], + [ + dnl Initial guess, used when cross-compiling or when no suitable locale + dnl is present. + gl_cv_C_locale_sans_EILSEQ="guessing no" + + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include + #include + ]], [[ + int i; + char *locale = setlocale (LC_ALL, "C"); + if (! locale) + return 2; + for (i = CHAR_MIN; i <= CHAR_MAX; i++) + { + char c = i; + wchar_t wc; + mbstate_t mbs = { 0, }; + size_t ss = mbrtowc (&wc, &c, 1, &mbs); + if (1 < ss) + return 3; + } + return 0; + ]])], + [gl_cv_C_locale_sans_EILSEQ=yes], + [gl_cv_C_locale_sans_EILSEQ=no], + [:])]) +]) + # Prerequisites of lib/mbrtowc.c. AC_DEFUN([gl_PREREQ_MBRTOWC], [ : diff -Nru datamash-1.0.7/m4/mbsinit.m4 datamash-1.1.1/m4/mbsinit.m4 --- datamash-1.0.7/m4/mbsinit.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/mbsinit.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # mbsinit.m4 serial 8 -dnl Copyright (C) 2008, 2010-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2008, 2010-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/mbslen.m4 datamash-1.1.1/m4/mbslen.m4 --- datamash-1.0.7/m4/mbslen.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/mbslen.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # mbslen.m4 serial 2 -dnl Copyright (C) 2010-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2010-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/mbsrtowcs.m4 datamash-1.1.1/m4/mbsrtowcs.m4 --- datamash-1.0.7/m4/mbsrtowcs.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/mbsrtowcs.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # mbsrtowcs.m4 serial 13 -dnl Copyright (C) 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/mbstate_t.m4 datamash-1.1.1/m4/mbstate_t.m4 --- datamash-1.0.7/m4/mbstate_t.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/mbstate_t.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # mbstate_t.m4 serial 13 -dnl Copyright (C) 2000-2002, 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2000-2002, 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/md5.m4 datamash-1.1.1/m4/md5.m4 --- datamash-1.0.7/m4/md5.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/md5.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # md5.m4 serial 14 -dnl Copyright (C) 2002-2006, 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/memchr.m4 datamash-1.1.1/m4/memchr.m4 --- datamash-1.0.7/m4/memchr.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/memchr.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # memchr.m4 serial 12 -dnl Copyright (C) 2002-2004, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2004, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/minmax.m4 datamash-1.1.1/m4/minmax.m4 --- datamash-1.0.7/m4/minmax.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/minmax.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # minmax.m4 serial 4 -dnl Copyright (C) 2005, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/mmap-anon.m4 datamash-1.1.1/m4/mmap-anon.m4 --- datamash-1.0.7/m4/mmap-anon.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/mmap-anon.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # mmap-anon.m4 serial 10 -dnl Copyright (C) 2005, 2007, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2007, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/modfl.m4 datamash-1.1.1/m4/modfl.m4 --- datamash-1.0.7/m4/modfl.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/m4/modfl.m4 2017-01-10 20:01:01.000000000 +0000 @@ -0,0 +1,94 @@ +# modfl.m4 serial 3 +dnl Copyright (C) 2011-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_MODFL], +[ + m4_divert_text([DEFAULTS], [gl_modfl_required=plain]) + AC_REQUIRE([gl_MATH_H_DEFAULTS]) + AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) + + dnl Persuade glibc to declare modfl(). + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + dnl Test whether modfl() exists. We cannot assume that modfl(), if it + dnl exists, is defined in the same library as modf(). This is not the case + dnl on FreeBSD, Solaris. + gl_MATHFUNC([modfl], [long double], [(long double, long double *)]) + if test $gl_cv_func_modfl_no_libm = yes \ + || test $gl_cv_func_modfl_in_libm = yes; then + : + m4_ifdef([gl_FUNC_MODFL_IEEE], [ + if test $gl_modfl_required = ieee && test $REPLACE_MODFL = 0; then + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether modfl works according to ISO C 99 with IEC 60559], + [gl_cv_func_modfl_ieee], + [ + save_LIBS="$LIBS" + LIBS="$LIBS $MODFL_LIBM" + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#ifndef __NO_MATH_INLINES +# define __NO_MATH_INLINES 1 /* for glibc */ +#endif +#include +]gl_LONG_DOUBLE_MINUS_ZERO_CODE[ +]gl_LONG_DOUBLE_SIGNBIT_CODE[ +/* Compare two numbers with ==. + This is a separate function because IRIX 6.5 "cc -O" miscompiles an + 'x == x' test. */ +static int +numeric_equal (long double x, long double y) +{ + return x == y; +} +static long double dummy (long double x, long double *iptr) { return 0; } +long double zero; +long double minus_one = - 1.0L; +int main (int argc, char *argv[]) +{ + long double (*my_modfl) (long double, long double *) = argc ? modfl : dummy; + long double i; + long double f; + /* Test modfl(-Inf,...). + This test fails on IRIX 6.5, OSF/1 5.1, mingw. */ + f = my_modfl (minus_one / zero, &i); + if (!(f == 0.0L) || (signbitl (minus_zerol) && !signbitl (f))) + return 1; + return 0; +} + ]])], + [gl_cv_func_modfl_ieee=yes], + [gl_cv_func_modfl_ieee=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_modfl_ieee="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_modfl_ieee="guessing no" ;; + esac + ]) + LIBS="$save_LIBS" + ]) + case "$gl_cv_func_modfl_ieee" in + *yes) ;; + *) REPLACE_MODFL=1 ;; + esac + fi + ]) + else + HAVE_MODFL=0 + fi + if test $HAVE_MODFL = 0 || test $REPLACE_MODFL = 1; then + dnl Find libraries needed to link lib/modfl.c. + if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then + AC_REQUIRE([gl_FUNC_MODF]) + MODFL_LIBM="$MODF_LIBM" + else + AC_REQUIRE([gl_FUNC_TRUNCL]) + MODFL_LIBM="$TRUNCL_LIBM" + fi + fi + AC_SUBST([MODFL_LIBM]) +]) diff -Nru datamash-1.0.7/m4/modf.m4 datamash-1.1.1/m4/modf.m4 --- datamash-1.0.7/m4/modf.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/m4/modf.m4 2017-01-10 20:01:01.000000000 +0000 @@ -0,0 +1,83 @@ +# modf.m4 serial 3 +dnl Copyright (C) 2011-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_MODF], +[ + m4_divert_text([DEFAULTS], [gl_modf_required=plain]) + AC_REQUIRE([gl_MATH_H_DEFAULTS]) + + dnl Determine MODF_LIBM. + gl_MATHFUNC([modf], [double], [(double, double *)]) + + m4_ifdef([gl_FUNC_MODF_IEEE], [ + if test $gl_modf_required = ieee && test $REPLACE_MODF = 0; then + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether modf works according to ISO C 99 with IEC 60559], + [gl_cv_func_modf_ieee], + [ + save_LIBS="$LIBS" + LIBS="$LIBS $MODF_LIBM" + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#ifndef __NO_MATH_INLINES +# define __NO_MATH_INLINES 1 /* for glibc */ +#endif +#include +]gl_DOUBLE_MINUS_ZERO_CODE[ +]gl_DOUBLE_SIGNBIT_CODE[ +/* Compare two numbers with ==. + This is a separate function because IRIX 6.5 "cc -O" miscompiles an + 'x == x' test. */ +static int +numeric_equal (double x, double y) +{ + return x == y; +} +static double dummy (double x, double *iptr) { return 0; } +double zero; +double minus_one = - 1.0; +int main (int argc, char *argv[]) +{ + double (*my_modf) (double, double *) = argc ? modf : dummy; + int result = 0; + double i; + double f; + /* Test modf(NaN,...). + This test fails on NetBSD 5.1, Cygwin. */ + f = my_modf (zero / zero, &i); + if (numeric_equal (f, f)) + result |= 1; + /* Test modf(-Inf,...). + This test fails on FreeBSD 6.4, OpenBSD 4.9, IRIX 6.5, OSF/1 5.1. */ + f = my_modf (minus_one / zero, &i); + if (!(f == 0.0) || (signbitd (minus_zerod) && !signbitd (f))) + result |= 2; + return result; +} + ]])], + [gl_cv_func_modf_ieee=yes], + [gl_cv_func_modf_ieee=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_modf_ieee="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_modf_ieee="guessing no" ;; + esac + ]) + LIBS="$save_LIBS" + ]) + case "$gl_cv_func_modf_ieee" in + *yes) ;; + *) REPLACE_MODF=1 ;; + esac + fi + ]) + if test $REPLACE_MODF = 1; then + dnl Find libraries needed to link lib/modf.c. + AC_REQUIRE([gl_FUNC_TRUNC]) + MODF_LIBM="$TRUNC_LIBM" + fi +]) diff -Nru datamash-1.0.7/m4/msvc-inval.m4 datamash-1.1.1/m4/msvc-inval.m4 --- datamash-1.0.7/m4/msvc-inval.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/msvc-inval.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # msvc-inval.m4 serial 1 -dnl Copyright (C) 2011-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/msvc-nothrow.m4 datamash-1.1.1/m4/msvc-nothrow.m4 --- datamash-1.0.7/m4/msvc-nothrow.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/msvc-nothrow.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # msvc-nothrow.m4 serial 1 -dnl Copyright (C) 2011-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/multiarch.m4 datamash-1.1.1/m4/multiarch.m4 --- datamash-1.0.7/m4/multiarch.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/multiarch.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # multiarch.m4 serial 7 -dnl Copyright (C) 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/nls.m4 datamash-1.1.1/m4/nls.m4 --- datamash-1.0.7/m4/nls.m4 2015-06-17 23:45:13.000000000 +0000 +++ datamash-1.1.1/m4/nls.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,17 +1,17 @@ # nls.m4 serial 5 (gettext-0.18) -dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014 Free Software Foundation, -dnl Inc. +dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014, 2016 Free Software +dnl Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl -dnl This file can can be used in projects which are not available under +dnl This file can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU -dnl gettext package package is covered by the GNU General Public License. +dnl gettext package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: diff -Nru datamash-1.0.7/m4/nocrash.m4 datamash-1.1.1/m4/nocrash.m4 --- datamash-1.0.7/m4/nocrash.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/nocrash.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # nocrash.m4 serial 4 -dnl Copyright (C) 2005, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -110,11 +110,12 @@ #else /* Avoid a crash on POSIX systems. */ #include +#include /* A POSIX signal handler. */ static void exception_handler (int sig) { - exit (1); + _exit (1); } static void nocrash_init (void) diff -Nru datamash-1.0.7/m4/non-recursive-gnulib-prefix-hack.m4 datamash-1.1.1/m4/non-recursive-gnulib-prefix-hack.m4 --- datamash-1.0.7/m4/non-recursive-gnulib-prefix-hack.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/non-recursive-gnulib-prefix-hack.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,4 +1,4 @@ -dnl Copyright (C) 2012-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2012-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -10,7 +10,7 @@ AC_DEFUN([gl_NON_RECURSIVE_GNULIB_PREFIX_HACK], [ # Tell AC_LIBSOURCES where to find source files like alloca.c. - AC_CONFIG_LIBOBJ_DIR([lib]) + AC_CONFIG_LIBOBJ_DIR([$1]) # This hack originated in bison. It is required when using non-recursive # automake rules to build from gnulib-provided lib/ sources. Hence, LIB_DIR @@ -26,7 +26,7 @@ do eval "ac_val=\$$ac_var" case $ac_var:$ac_val in - (*_H:*.h) eval "$ac_var=$1/\$$ac_var";; + *_H:*.h) eval "$ac_var=$1/\$$ac_var";; esac done ]) diff -Nru datamash-1.0.7/m4/off_t.m4 datamash-1.1.1/m4/off_t.m4 --- datamash-1.0.7/m4/off_t.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/off_t.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # off_t.m4 serial 1 -dnl Copyright (C) 2012-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2012-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/po.m4 datamash-1.1.1/m4/po.m4 --- datamash-1.0.7/m4/po.m4 2015-06-17 23:45:13.000000000 +0000 +++ datamash-1.1.1/m4/po.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,16 +1,16 @@ # po.m4 serial 24 (gettext-0.19) -dnl Copyright (C) 1995-2014 Free Software Foundation, Inc. +dnl Copyright (C) 1995-2014, 2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl -dnl This file can can be used in projects which are not available under +dnl This file can be used in projects which are not available under dnl the GNU General Public License or the GNU Library General Public dnl License but which still want to provide support for the GNU gettext dnl functionality. dnl Please note that the actual code of the GNU gettext library is covered dnl by the GNU Library General Public License, and the rest of the GNU -dnl gettext package package is covered by the GNU General Public License. +dnl gettext package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: diff -Nru datamash-1.0.7/m4/progtest.m4 datamash-1.1.1/m4/progtest.m4 --- datamash-1.0.7/m4/progtest.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/progtest.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # progtest.m4 serial 7 (gettext-0.18.2) -dnl Copyright (C) 1996-2003, 2005, 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 1996-2003, 2005, 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/quotearg.m4 datamash-1.1.1/m4/quotearg.m4 --- datamash-1.0.7/m4/quotearg.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/quotearg.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # quotearg.m4 serial 9 -dnl Copyright (C) 2002, 2004-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2004-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/random.m4 datamash-1.1.1/m4/random.m4 --- datamash-1.0.7/m4/random.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/random.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # random.m4 serial 1 -dnl Copyright (C) 2012-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2012-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/random_r.m4 datamash-1.1.1/m4/random_r.m4 --- datamash-1.0.7/m4/random_r.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/random_r.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # serial 5 -dnl Copyright (C) 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/realloc.m4 datamash-1.1.1/m4/realloc.m4 --- datamash-1.0.7/m4/realloc.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/realloc.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,13 +1,13 @@ -# realloc.m4 serial 13 -dnl Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc. +# realloc.m4 serial 14 +dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. m4_version_prereq([2.70], [] ,[ -# This is taken from the following Autoconf patch: -# http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=7fbb553727ed7e0e689a17594b58559ecf3ea6e9 +# This is adapted with modifications from upstream Autoconf here: +# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c AC_DEFUN([_AC_FUNC_REALLOC_IF], [ AC_REQUIRE([AC_HEADER_STDC])dnl @@ -23,7 +23,10 @@ char *realloc (); #endif ]], - [[return ! realloc (0, 0);]]) + [[char *p = realloc (0, 0); + int result = !p; + free (p); + return result;]]) ], [ac_cv_func_realloc_0_nonnull=yes], [ac_cv_func_realloc_0_nonnull=no], diff -Nru datamash-1.0.7/m4/roundl.m4 datamash-1.1.1/m4/roundl.m4 --- datamash-1.0.7/m4/roundl.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/roundl.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # roundl.m4 serial 15 -dnl Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/round.m4 datamash-1.1.1/m4/round.m4 --- datamash-1.0.7/m4/round.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/round.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # round.m4 serial 16 -dnl Copyright (C) 2007, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/sha1.m4 datamash-1.1.1/m4/sha1.m4 --- datamash-1.0.7/m4/sha1.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/sha1.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # sha1.m4 serial 12 -dnl Copyright (C) 2002-2006, 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/sha256.m4 datamash-1.1.1/m4/sha256.m4 --- datamash-1.0.7/m4/sha256.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/sha256.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # sha256.m4 serial 8 -dnl Copyright (C) 2005, 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/sha512.m4 datamash-1.1.1/m4/sha512.m4 --- datamash-1.0.7/m4/sha512.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/sha512.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # sha512.m4 serial 9 -dnl Copyright (C) 2005-2006, 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2006, 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/signbit.m4 datamash-1.1.1/m4/signbit.m4 --- datamash-1.0.7/m4/signbit.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/signbit.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # signbit.m4 serial 13 -dnl Copyright (C) 2007-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/size_max.m4 datamash-1.1.1/m4/size_max.m4 --- datamash-1.0.7/m4/size_max.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/size_max.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # size_max.m4 serial 10 -dnl Copyright (C) 2003, 2005-2006, 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2005-2006, 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/sqrtl.m4 datamash-1.1.1/m4/sqrtl.m4 --- datamash-1.0.7/m4/sqrtl.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/sqrtl.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # sqrtl.m4 serial 9 -dnl Copyright (C) 2010-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2010-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/sqrt.m4 datamash-1.1.1/m4/sqrt.m4 --- datamash-1.0.7/m4/sqrt.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/sqrt.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # sqrt.m4 serial 3 -dnl Copyright (C) 2010-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2010-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/ssize_t.m4 datamash-1.1.1/m4/ssize_t.m4 --- datamash-1.0.7/m4/ssize_t.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/ssize_t.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # ssize_t.m4 serial 5 (gettext-0.18.2) -dnl Copyright (C) 2001-2003, 2006, 2010-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2003, 2006, 2010-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/stdalign.m4 datamash-1.1.1/m4/stdalign.m4 --- datamash-1.0.7/m4/stdalign.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/stdalign.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,6 +1,6 @@ # Check for stdalign.h that conforms to C11. -dnl Copyright 2011-2015 Free Software Foundation, Inc. +dnl Copyright 2011-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/stdarg.m4 datamash-1.1.1/m4/stdarg.m4 --- datamash-1.0.7/m4/stdarg.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/stdarg.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ # stdarg.m4 serial 6 -dnl Copyright (C) 2006, 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/stdbool.m4 datamash-1.1.1/m4/stdbool.m4 --- datamash-1.0.7/m4/stdbool.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/stdbool.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,11 +1,11 @@ # Check for stdbool.h that conforms to C99. -dnl Copyright (C) 2002-2006, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. -#serial 5 +#serial 7 # Prepare for substituting if it is not supported. @@ -43,56 +43,64 @@ [AC_LANG_PROGRAM( [[ #include - #ifndef bool - "error: bool is not defined" - #endif - #ifndef false - "error: false is not defined" - #endif - #if false - "error: false is not 0" - #endif - #ifndef true - "error: true is not defined" - #endif - #if true != 1 - "error: true is not 1" + + #ifdef __cplusplus + typedef bool Bool; + #else + typedef _Bool Bool; + #ifndef bool + "error: bool is not defined" + #endif + #ifndef false + "error: false is not defined" + #endif + #if false + "error: false is not 0" + #endif + #ifndef true + "error: true is not defined" + #endif + #if true != 1 + "error: true is not 1" + #endif #endif + #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif - struct s { _Bool s: 1; _Bool t; } s; + struct s { Bool s: 1; Bool t; bool u: 1; bool v; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; /* See body of main program for 'e'. */ - char f[(_Bool) 0.0 == false ? 1 : -1]; + char f[(Bool) 0.0 == false ? 1 : -1]; char g[true]; - char h[sizeof (_Bool)]; + char h[sizeof (Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ - _Bool n[m]; + Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; - char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; + char p[-1 - (Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ - _Bool q = true; - _Bool *pq = &q; + Bool q = true; + Bool *pq = &q; + bool *qq = &q; ]], [[ bool e = &s; - *pq |= q; - *pq |= ! q; + *pq |= q; *pq |= ! q; + *qq |= q; *qq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l - + !m + !n + !o + !p + !q + !pq); + + !m + !n + !o + !p + !q + !pq + !qq); ]])], [ac_cv_header_stdbool_h=yes], [ac_cv_header_stdbool_h=no])]) diff -Nru datamash-1.0.7/m4/stddef_h.m4 datamash-1.1.1/m4/stddef_h.m4 --- datamash-1.0.7/m4/stddef_h.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/stddef_h.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,6 +1,6 @@ dnl A placeholder for , for platforms that have issues. # stddef_h.m4 serial 5 -dnl Copyright (C) 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/stdint.m4 datamash-1.1.1/m4/stdint.m4 --- datamash-1.0.7/m4/stdint.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/stdint.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ -# stdint.m4 serial 43 -dnl Copyright (C) 2001-2015 Free Software Foundation, Inc. +# stdint.m4 serial 50 +dnl Copyright (C) 2001-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -11,6 +11,9 @@ [ AC_PREREQ([2.59])dnl + AC_REQUIRE([gl_LIMITS_H]) + AC_REQUIRE([gt_TYPE_WINT_T]) + dnl Check for long long int and unsigned long long int. AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) if test $ac_cv_type_long_long_int = yes; then @@ -70,6 +73,8 @@ AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 #include /* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in . */ #if !(defined WCHAR_MIN && defined WCHAR_MAX) @@ -150,6 +155,15 @@ intmax_t i = INTMAX_MAX; uintmax_t j = UINTMAX_MAX; +/* Check that SIZE_MAX has the correct type, if possible. */ +#if 201112 <= __STDC_VERSION__ +int k = _Generic (SIZE_MAX, size_t: 0); +#elif (2 <= __GNUC__ || defined __IBM__TYPEOF__ \ + || (0x5110 <= __SUNPRO_C && !__STDC__)) +extern size_t k; +extern __typeof__ (SIZE_MAX) k; +#endif + #include /* for CHAR_BIT */ #define TYPE_MINIMUM(t) \ ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t))) @@ -218,6 +232,8 @@ AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#define __STDC_CONSTANT_MACROS 1 +#define __STDC_LIMIT_MACROS 1 #include ] gl_STDINT_INCLUDES @@ -278,28 +294,74 @@ ]) ]) fi + + HAVE_C99_STDINT_H=0 + HAVE_SYS_BITYPES_H=0 + HAVE_SYS_INTTYPES_H=0 + STDINT_H=stdint.h if test "$gl_cv_header_working_stdint_h" = yes; then - STDINT_H= + HAVE_C99_STDINT_H=1 + dnl Now see whether the system works without + dnl __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined. + AC_CACHE_CHECK([whether stdint.h predates C++11], + [gl_cv_header_stdint_predates_cxx11_h], + [gl_cv_header_stdint_predates_cxx11_h=yes + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ +#include +] +gl_STDINT_INCLUDES +[ +intmax_t im = INTMAX_MAX; +int32_t i32 = INT32_C (0x7fffffff); + ]])], + [gl_cv_header_stdint_predates_cxx11_h=no])]) + + if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then + AC_DEFINE([__STDC_CONSTANT_MACROS], [1], + [Define to 1 if the system predates C++11.]) + AC_DEFINE([__STDC_LIMIT_MACROS], [1], + [Define to 1 if the system predates C++11.]) + fi + AC_CACHE_CHECK([whether stdint.h has UINTMAX_WIDTH etc.], + [gl_cv_header_stdint_width], + [gl_cv_header_stdint_width=no + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + /* Work if build is not clean. */ + #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 + #ifndef __STDC_WANT_IEC_60559_BFP_EXT__ + #define __STDC_WANT_IEC_60559_BFP_EXT__ 1 + #endif + #include + ]gl_STDINT_INCLUDES[ + int iw = UINTMAX_WIDTH; + ]])], + [gl_cv_header_stdint_width=yes])]) + if test "$gl_cv_header_stdint_width" = yes; then + STDINT_H= + fi else dnl Check for , and for dnl (used in Linux libc4 >= 4.6.7 and libc5). AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h]) if test $ac_cv_header_sys_inttypes_h = yes; then HAVE_SYS_INTTYPES_H=1 - else - HAVE_SYS_INTTYPES_H=0 fi - AC_SUBST([HAVE_SYS_INTTYPES_H]) if test $ac_cv_header_sys_bitypes_h = yes; then HAVE_SYS_BITYPES_H=1 - else - HAVE_SYS_BITYPES_H=0 fi - AC_SUBST([HAVE_SYS_BITYPES_H]) - gl_STDINT_TYPE_PROPERTIES - STDINT_H=stdint.h fi + + dnl The substitute stdint.h needs the substitute limit.h's _GL_INTEGER_WIDTH. + LIMITS_H=limits.h + AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"]) + + AC_SUBST([HAVE_C99_STDINT_H]) + AC_SUBST([HAVE_SYS_BITYPES_H]) + AC_SUBST([HAVE_SYS_INTTYPES_H]) AC_SUBST([STDINT_H]) AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_H"]) ]) @@ -467,7 +529,7 @@ dnl requirement that wint_t is "unchanged by default argument promotions". dnl In this case gnulib's and override wint_t. dnl Set the variable BITSIZEOF_WINT_T accordingly. - if test $BITSIZEOF_WINT_T -lt 32; then + if test $GNULIB_OVERRIDES_WINT_T = 1; then BITSIZEOF_WINT_T=32 fi ]) @@ -477,8 +539,3 @@ m4_ifdef([AC_COMPUTE_INT], [], [ AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])]) ]) - -# Hey Emacs! -# Local Variables: -# indent-tabs-mode: nil -# End: diff -Nru datamash-1.0.7/m4/stdio_h.m4 datamash-1.1.1/m4/stdio_h.m4 --- datamash-1.0.7/m4/stdio_h.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/stdio_h.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,14 +1,18 @@ -# stdio_h.m4 serial 46 -dnl Copyright (C) 2007-2015 Free Software Foundation, Inc. +# stdio_h.m4 serial 48 +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_STDIO_H], [ - dnl For __USE_MINGW_ANSI_STDIO - AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) - + AH_VERBATIM([MINGW_ANSI_STDIO], +[/* Use GNU style printf and scanf. */ +#ifndef __USE_MINGW_ANSI_STDIO +# undef __USE_MINGW_ANSI_STDIO +#endif +]) + AC_DEFINE([__USE_MINGW_ANSI_STDIO]) AC_REQUIRE([gl_STDIO_H_DEFAULTS]) gl_NEXT_HEADERS([stdio.h]) diff -Nru datamash-1.0.7/m4/stdlib_h.m4 datamash-1.1.1/m4/stdlib_h.m4 --- datamash-1.0.7/m4/stdlib_h.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/stdlib_h.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,5 +1,5 @@ -# stdlib_h.m4 serial 42 -dnl Copyright (C) 2007-2015 Free Software Foundation, Inc. +# stdlib_h.m4 serial 43 +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -21,7 +21,7 @@ #endif ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps - posix_openpt ptsname ptsname_r random random_r realpath rpmatch + posix_openpt ptsname ptsname_r qsort_r random random_r realpath rpmatch secure_getenv setenv setstate setstate_r srandom srandom_r strtod strtoll strtoull unlockpt unsetenv]) ]) @@ -85,6 +85,7 @@ HAVE_POSIX_OPENPT=1; AC_SUBST([HAVE_POSIX_OPENPT]) HAVE_PTSNAME=1; AC_SUBST([HAVE_PTSNAME]) HAVE_PTSNAME_R=1; AC_SUBST([HAVE_PTSNAME_R]) + HAVE_QSORT_R=1; AC_SUBST([HAVE_QSORT_R]) HAVE_RANDOM=1; AC_SUBST([HAVE_RANDOM]) HAVE_RANDOM_H=1; AC_SUBST([HAVE_RANDOM_H]) HAVE_RANDOM_R=1; AC_SUBST([HAVE_RANDOM_R]) diff -Nru datamash-1.0.7/m4/stdnoreturn.m4 datamash-1.1.1/m4/stdnoreturn.m4 --- datamash-1.0.7/m4/stdnoreturn.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/stdnoreturn.m4 2017-01-10 20:01:01.000000000 +0000 @@ -1,6 +1,6 @@ # Check for stdnoreturn.h that conforms to C11. -dnl Copyright 2012-2015 Free Software Foundation, Inc. +dnl Copyright 2012-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/stpcpy.m4 datamash-1.1.1/m4/stpcpy.m4 --- datamash-1.0.7/m4/stpcpy.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/m4/stpcpy.m4 2017-01-10 20:01:01.000000000 +0000 @@ -0,0 +1,25 @@ +# stpcpy.m4 serial 8 +dnl Copyright (C) 2002, 2007, 2009-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_STPCPY], +[ + dnl Persuade glibc to declare stpcpy(). + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + dnl The stpcpy() declaration in lib/string.in.h uses 'restrict'. + AC_REQUIRE([AC_C_RESTRICT]) + + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_CHECK_FUNCS([stpcpy]) + if test $ac_cv_func_stpcpy = no; then + HAVE_STPCPY=0 + fi +]) + +# Prerequisites of lib/stpcpy.c. +AC_DEFUN([gl_PREREQ_STPCPY], [ + : +]) diff -Nru datamash-1.0.7/m4/strerror.m4 datamash-1.1.1/m4/strerror.m4 --- datamash-1.0.7/m4/strerror.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/strerror.m4 2017-01-10 20:01:02.000000000 +0000 @@ -1,5 +1,5 @@ # strerror.m4 serial 17 -dnl Copyright (C) 2002, 2007-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2007-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/string_h.m4 datamash-1.1.1/m4/string_h.m4 --- datamash-1.0.7/m4/string_h.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/string_h.m4 2017-01-10 20:01:02.000000000 +0000 @@ -1,6 +1,6 @@ # Configure a GNU-like replacement for . -# Copyright (C) 2007-2015 Free Software Foundation, Inc. +# Copyright (C) 2007-2017 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/strndup.m4 datamash-1.1.1/m4/strndup.m4 --- datamash-1.0.7/m4/strndup.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/strndup.m4 2017-01-10 20:01:02.000000000 +0000 @@ -1,5 +1,5 @@ -# strndup.m4 serial 21 -dnl Copyright (C) 2002-2003, 2005-2015 Free Software Foundation, Inc. +# strndup.m4 serial 22 +dnl Copyright (C) 2002-2003, 2005-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -31,11 +31,14 @@ #endif char *strndup (const char *, size_t); #endif + int result; char *s; s = strndup ("some longer string", 15); free (s); s = strndup ("shorter string", 13); - return s[13] != '\0';]])], + result = s[13] != '\0'; + free (s); + return result;]])], [gl_cv_func_strndup_works=yes], [gl_cv_func_strndup_works=no], [ diff -Nru datamash-1.0.7/m4/strnlen.m4 datamash-1.1.1/m4/strnlen.m4 --- datamash-1.0.7/m4/strnlen.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/strnlen.m4 2017-01-10 20:01:02.000000000 +0000 @@ -1,5 +1,5 @@ # strnlen.m4 serial 13 -dnl Copyright (C) 2002-2003, 2005-2007, 2009-2015 Free Software Foundation, +dnl Copyright (C) 2002-2003, 2005-2007, 2009-2017 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff -Nru datamash-1.0.7/m4/strsep.m4 datamash-1.1.1/m4/strsep.m4 --- datamash-1.0.7/m4/strsep.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/strsep.m4 2017-01-10 20:01:02.000000000 +0000 @@ -1,5 +1,5 @@ # strsep.m4 serial 10 -dnl Copyright (C) 2002-2004, 2007, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2004, 2007, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/strtoull.m4 datamash-1.1.1/m4/strtoull.m4 --- datamash-1.0.7/m4/strtoull.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/strtoull.m4 2017-01-10 20:01:02.000000000 +0000 @@ -1,5 +1,5 @@ # strtoull.m4 serial 7 -dnl Copyright (C) 2002, 2004, 2006, 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2004, 2006, 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/strtoumax.m4 datamash-1.1.1/m4/strtoumax.m4 --- datamash-1.0.7/m4/strtoumax.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/strtoumax.m4 2017-01-10 20:01:02.000000000 +0000 @@ -1,5 +1,5 @@ # strtoumax.m4 serial 12 -dnl Copyright (C) 2002-2004, 2006, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2004, 2006, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/sys_socket_h.m4 datamash-1.1.1/m4/sys_socket_h.m4 --- datamash-1.0.7/m4/sys_socket_h.m4 2015-06-17 23:45:29.000000000 +0000 +++ datamash-1.1.1/m4/sys_socket_h.m4 2017-01-10 20:01:02.000000000 +0000 @@ -1,5 +1,5 @@ # sys_socket_h.m4 serial 23 -dnl Copyright (C) 2005-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/sys_types_h.m4 datamash-1.1.1/m4/sys_types_h.m4 --- datamash-1.0.7/m4/sys_types_h.m4 2015-06-17 23:45:30.000000000 +0000 +++ datamash-1.1.1/m4/sys_types_h.m4 2017-01-10 20:01:02.000000000 +0000 @@ -1,5 +1,5 @@ -# sys_types_h.m4 serial 5 -dnl Copyright (C) 2011-2015 Free Software Foundation, Inc. +# sys_types_h.m4 serial 6 +dnl Copyright (C) 2011-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -22,3 +22,28 @@ AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS], [ ]) + +# This works around a buggy version in autoconf <= 2.69. +# See + +m4_version_prereq([2.70], [], [ + +# This is taken from the following Autoconf patch: +# http://git.sv.gnu.org/cgit/autoconf.git/commit/?id=e17a30e98 + +m4_undefine([AC_HEADER_MAJOR]) +AC_DEFUN([AC_HEADER_MAJOR], +[AC_CHECK_HEADERS_ONCE([sys/types.h]) +AC_CHECK_HEADER([sys/mkdev.h], + [AC_DEFINE([MAJOR_IN_MKDEV], [1], + [Define to 1 if `major', `minor', and `makedev' are declared in + .])]) +if test $ac_cv_header_sys_mkdev_h = no; then + AC_CHECK_HEADER([sys/sysmacros.h], + [AC_DEFINE([MAJOR_IN_SYSMACROS], [1], + [Define to 1 if `major', `minor', and `makedev' are declared in + .])]) +fi +]) + +]) diff -Nru datamash-1.0.7/m4/truncl.m4 datamash-1.1.1/m4/truncl.m4 --- datamash-1.0.7/m4/truncl.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/m4/truncl.m4 2017-01-10 20:01:02.000000000 +0000 @@ -0,0 +1,131 @@ +# truncl.m4 serial 11 +dnl Copyright (C) 2007-2008, 2010-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_TRUNCL], +[ + m4_divert_text([DEFAULTS], [gl_truncl_required=plain]) + AC_REQUIRE([gl_MATH_H_DEFAULTS]) + AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + + dnl Persuade glibc to declare truncl(). + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + dnl Test whether truncl() is declared. + AC_CHECK_DECLS([truncl], , , [[#include ]]) + if test "$ac_cv_have_decl_truncl" = yes; then + dnl Test whether truncl() can be used without libm. + TRUNCL_LIBM=? + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double x;]], + [[x = truncl(x);]])], + [TRUNCL_LIBM=]) + if test "$TRUNCL_LIBM" = "?"; then + save_LIBS="$LIBS" + LIBS="$LIBS -lm" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + long double x;]], + [[x = truncl(x);]])], + [TRUNCL_LIBM="-lm"]) + LIBS="$save_LIBS" + fi + if test "$TRUNCL_LIBM" = "?"; then + TRUNCL_LIBM= + fi + dnl Test whether truncl() works. It crashes on OSF/1 4.0d. + save_LIBS="$LIBS" + LIBS="$LIBS $TRUNCL_LIBM" + AC_CACHE_CHECK([whether truncl works], [gl_cv_func_truncl_works], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +long double x; +int main() +{ + x = truncl (0.0L); + return 0; +}]])], + [gl_cv_func_truncl_works=yes], + [gl_cv_func_truncl_works=no], + [case "$host_os" in + osf4*) gl_cv_func_truncl_works="guessing no";; + *) gl_cv_func_truncl_works="guessing yes";; + esac + ]) + ]) + LIBS="$save_LIBS" + case "$gl_cv_func_truncl_works" in + *yes) ;; + *) REPLACE_TRUNCL=1 ;; + esac + m4_ifdef([gl_FUNC_TRUNCL_IEEE], [ + if test $gl_truncl_required = ieee && test $REPLACE_TRUNCL = 0; then + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether truncl works according to ISO C 99 with IEC 60559], + [gl_cv_func_truncl_ieee], + [ + save_LIBS="$LIBS" + LIBS="$LIBS $TRUNCL_LIBM" + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#ifndef __NO_MATH_INLINES +# define __NO_MATH_INLINES 1 /* for glibc */ +#endif +#include +]gl_LONG_DOUBLE_MINUS_ZERO_CODE[ +]gl_LONG_DOUBLE_SIGNBIT_CODE[ +static long double dummy (long double f) { return 0; } +int main (int argc, char *argv[]) +{ + long double (*my_truncl) (long double) = argc ? truncl : dummy; + /* Test whether truncl (-0.3L) is -0.0L. */ + if (signbitl (minus_zerol) && !signbitl (my_truncl (-0.3L))) + return 1; + return 0; +} + ]])], + [gl_cv_func_truncl_ieee=yes], + [gl_cv_func_truncl_ieee=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_truncl_ieee="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_truncl_ieee="guessing no" ;; + esac + ]) + LIBS="$save_LIBS" + ]) + case "$gl_cv_func_truncl_ieee" in + *yes) ;; + *) REPLACE_TRUNCL=1 ;; + esac + fi + ]) + else + HAVE_DECL_TRUNCL=0 + fi + if test $HAVE_DECL_TRUNCL = 0 || test $REPLACE_TRUNCL = 1; then + dnl Find libraries needed to link lib/truncl.c. + if test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1; then + AC_REQUIRE([gl_FUNC_TRUNC]) + TRUNCL_LIBM="$TRUNC_LIBM" + else + TRUNCL_LIBM= + fi + fi + AC_SUBST([TRUNCL_LIBM]) +]) diff -Nru datamash-1.0.7/m4/trunc.m4 datamash-1.1.1/m4/trunc.m4 --- datamash-1.0.7/m4/trunc.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/m4/trunc.m4 2017-01-10 20:01:02.000000000 +0000 @@ -0,0 +1,95 @@ +# trunc.m4 serial 9 +dnl Copyright (C) 2007, 2010-2017 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_FUNC_TRUNC], +[ + m4_divert_text([DEFAULTS], [gl_trunc_required=plain]) + AC_REQUIRE([gl_MATH_H_DEFAULTS]) + dnl Persuade glibc to declare trunc(). + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + dnl Test whether trunc() is declared. + AC_CHECK_DECLS([trunc], , , [[#include ]]) + if test "$ac_cv_have_decl_trunc" = yes; then + dnl Test whether trunc() can be used without libm. + TRUNC_LIBM=? + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + double x;]], + [[x = trunc(x);]])], + [TRUNC_LIBM=]) + if test "$TRUNC_LIBM" = "?"; then + save_LIBS="$LIBS" + LIBS="$LIBS -lm" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#ifndef __NO_MATH_INLINES + # define __NO_MATH_INLINES 1 /* for glibc */ + #endif + #include + double x;]], + [[x = trunc(x);]])], + [TRUNC_LIBM="-lm"]) + LIBS="$save_LIBS" + fi + if test "$TRUNC_LIBM" = "?"; then + TRUNC_LIBM= + fi + m4_ifdef([gl_FUNC_TRUNC_IEEE], [ + if test $gl_trunc_required = ieee && test $REPLACE_TRUNC = 0; then + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether trunc works according to ISO C 99 with IEC 60559], + [gl_cv_func_trunc_ieee], + [ + save_LIBS="$LIBS" + LIBS="$LIBS $TRUNC_LIBM" + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#ifndef __NO_MATH_INLINES +# define __NO_MATH_INLINES 1 /* for glibc */ +#endif +#include +]gl_DOUBLE_MINUS_ZERO_CODE[ +]gl_DOUBLE_SIGNBIT_CODE[ +static double dummy (double f) { return 0; } +int main (int argc, char *argv[]) +{ + double (*my_trunc) (double) = argc ? trunc : dummy; + /* Test whether trunc (-0.0) is -0.0. */ + if (signbitd (minus_zerod) && !signbitd (my_trunc (minus_zerod))) + return 1; + return 0; +} + ]])], + [gl_cv_func_trunc_ieee=yes], + [gl_cv_func_trunc_ieee=no], + [case "$host_os" in + # Guess yes on glibc systems. + *-gnu*) gl_cv_func_trunc_ieee="guessing yes" ;; + # If we don't know, assume the worst. + *) gl_cv_func_trunc_ieee="guessing no" ;; + esac + ]) + LIBS="$save_LIBS" + ]) + case "$gl_cv_func_trunc_ieee" in + *yes) ;; + *) REPLACE_TRUNC=1 ;; + esac + fi + ]) + else + HAVE_DECL_TRUNC=0 + fi + if test $HAVE_DECL_TRUNC = 0 || test $REPLACE_TRUNC = 1; then + dnl No libraries are needed to link lib/trunc.c. + TRUNC_LIBM= + fi + AC_SUBST([TRUNC_LIBM]) +]) diff -Nru datamash-1.0.7/m4/unistd_h.m4 datamash-1.1.1/m4/unistd_h.m4 --- datamash-1.0.7/m4/unistd_h.m4 2015-06-17 23:45:30.000000000 +0000 +++ datamash-1.1.1/m4/unistd_h.m4 2017-01-10 20:01:02.000000000 +0000 @@ -1,5 +1,5 @@ -# unistd_h.m4 serial 68 -dnl Copyright (C) 2006-2015 Free Software Foundation, Inc. +# unistd_h.m4 serial 69 +dnl Copyright (C) 2006-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -145,6 +145,7 @@ HAVE_DECL_FCHDIR=1; AC_SUBST([HAVE_DECL_FCHDIR]) HAVE_DECL_FDATASYNC=1; AC_SUBST([HAVE_DECL_FDATASYNC]) HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME]) + HAVE_DECL_GETLOGIN=1; AC_SUBST([HAVE_DECL_GETLOGIN]) HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R]) HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE]) HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL]) diff -Nru datamash-1.0.7/m4/unlocked-io.m4 datamash-1.1.1/m4/unlocked-io.m4 --- datamash-1.0.7/m4/unlocked-io.m4 2015-06-17 23:45:30.000000000 +0000 +++ datamash-1.1.1/m4/unlocked-io.m4 2017-01-10 20:01:02.000000000 +0000 @@ -1,6 +1,6 @@ # unlocked-io.m4 serial 15 -# Copyright (C) 1998-2006, 2009-2015 Free Software Foundation, Inc. +# Copyright (C) 1998-2006, 2009-2017 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff -Nru datamash-1.0.7/m4/version-etc.m4 datamash-1.1.1/m4/version-etc.m4 --- datamash-1.0.7/m4/version-etc.m4 2015-06-17 23:45:30.000000000 +0000 +++ datamash-1.1.1/m4/version-etc.m4 2017-01-10 20:01:02.000000000 +0000 @@ -1,5 +1,5 @@ # version-etc.m4 serial 1 -# Copyright (C) 2009-2015 Free Software Foundation, Inc. +# Copyright (C) 2009-2017 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/warnings.m4 datamash-1.1.1/m4/warnings.m4 --- datamash-1.0.7/m4/warnings.m4 2015-06-17 23:45:30.000000000 +0000 +++ datamash-1.1.1/m4/warnings.m4 2017-01-10 20:01:02.000000000 +0000 @@ -1,5 +1,5 @@ # warnings.m4 serial 11 -dnl Copyright (C) 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/warn-on-use.m4 datamash-1.1.1/m4/warn-on-use.m4 --- datamash-1.0.7/m4/warn-on-use.m4 2015-06-17 23:45:30.000000000 +0000 +++ datamash-1.1.1/m4/warn-on-use.m4 2017-01-10 20:01:02.000000000 +0000 @@ -1,5 +1,5 @@ # warn-on-use.m4 serial 5 -dnl Copyright (C) 2010-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2010-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/wchar_h.m4 datamash-1.1.1/m4/wchar_h.m4 --- datamash-1.0.7/m4/wchar_h.m4 2015-06-17 23:45:30.000000000 +0000 +++ datamash-1.1.1/m4/wchar_h.m4 2017-01-10 20:01:02.000000000 +0000 @@ -1,13 +1,13 @@ dnl A placeholder for ISO C99 , for platforms that have issues. -dnl Copyright (C) 2007-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Written by Eric Blake. -# wchar_h.m4 serial 39 +# wchar_h.m4 serial 40 AC_DEFUN([gl_WCHAR_H], [ @@ -81,8 +81,14 @@ extern int zero (void); int main () { return zero(); } ]])]) + dnl Do not rename the object file from conftest.$ac_objext to + dnl conftest1.$ac_objext, as this will cause the link to fail on + dnl z/OS when using the XPLINK object format (due to duplicate + dnl CSECT names). Instead, temporarily redefine $ac_compile so + dnl that the object file has the latter name from the start. + save_ac_compile="$ac_compile" + ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/` if AC_TRY_EVAL([ac_compile]); then - mv conftest.$ac_objext conftest1.$ac_objext AC_LANG_CONFTEST([ AC_LANG_SOURCE([[#define wcstod renamed_wcstod /* Tru64 with Desktop Toolkit C has a bug: must be included before @@ -95,8 +101,9 @@ #include int zero (void) { return 0; } ]])]) + dnl See note above about renaming object files. + ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/` if AC_TRY_EVAL([ac_compile]); then - mv conftest.$ac_objext conftest2.$ac_objext if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then : else @@ -104,6 +111,7 @@ fi fi fi + ac_compile="$save_ac_compile" rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext ]) if test $gl_cv_header_wchar_h_correct_inline = no; then diff -Nru datamash-1.0.7/m4/wchar_t.m4 datamash-1.1.1/m4/wchar_t.m4 --- datamash-1.0.7/m4/wchar_t.m4 2015-06-17 23:45:30.000000000 +0000 +++ datamash-1.1.1/m4/wchar_t.m4 2017-01-10 20:01:02.000000000 +0000 @@ -1,5 +1,5 @@ # wchar_t.m4 serial 4 (gettext-0.18.2) -dnl Copyright (C) 2002-2003, 2008-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2003, 2008-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/wctype_h.m4 datamash-1.1.1/m4/wctype_h.m4 --- datamash-1.0.7/m4/wctype_h.m4 2015-06-17 23:45:30.000000000 +0000 +++ datamash-1.1.1/m4/wctype_h.m4 2017-01-10 20:01:02.000000000 +0000 @@ -2,7 +2,7 @@ dnl A placeholder for ISO C99 , for platforms that lack it. -dnl Copyright (C) 2006-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/wcwidth.m4 datamash-1.1.1/m4/wcwidth.m4 --- datamash-1.0.7/m4/wcwidth.m4 2015-06-17 23:45:30.000000000 +0000 +++ datamash-1.1.1/m4/wcwidth.m4 2017-01-10 20:01:02.000000000 +0000 @@ -1,5 +1,5 @@ # wcwidth.m4 serial 23 -dnl Copyright (C) 2006-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -39,6 +39,7 @@ dnl On Mac OS X 10.3, wcwidth(0x0301) (COMBINING ACUTE ACCENT) returns 1. dnl On OpenBSD 5.0, wcwidth(0x05B0) (HEBREW POINT SHEVA) returns 1. dnl On OSF/1 5.1, wcwidth(0x200B) (ZERO WIDTH SPACE) returns 1. + dnl On OpenBSD 5.8, wcwidth(0xFF1A) (FULLWIDTH COLON) returns 0. dnl This leads to bugs in 'ls' (coreutils). AC_CACHE_CHECK([whether wcwidth works reasonably in UTF-8 locales], [gl_cv_func_wcwidth_works], @@ -74,6 +75,8 @@ result |= 2; if (wcwidth (0x200B) > 0) result |= 4; + if (wcwidth (0xFF1A) == 0) + result |= 8; } return result; }]])], diff -Nru datamash-1.0.7/m4/wint_t.m4 datamash-1.1.1/m4/wint_t.m4 --- datamash-1.0.7/m4/wint_t.m4 2015-06-17 23:45:30.000000000 +0000 +++ datamash-1.1.1/m4/wint_t.m4 2017-01-10 20:01:02.000000000 +0000 @@ -1,11 +1,12 @@ -# wint_t.m4 serial 5 (gettext-0.18.2) -dnl Copyright (C) 2003, 2007-2015 Free Software Foundation, Inc. +# wint_t.m4 serial 6 +dnl Copyright (C) 2003, 2007-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. -dnl Test whether has the 'wint_t' type. +dnl Test whether has the 'wint_t' type and whether gnulib's +dnl or would, if present, override 'wint_t'. dnl Prerequisite: AC_PROG_CC AC_DEFUN([gt_TYPE_WINT_T], @@ -28,5 +29,34 @@ [gt_cv_c_wint_t=no])]) if test $gt_cv_c_wint_t = yes; then AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.]) + + dnl Determine whether gnulib's or would, if present, + dnl override 'wint_t'. + AC_CACHE_CHECK([whether wint_t is too small], + [gl_cv_type_wint_t_too_small], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be + included before . */ +#if !(defined __GLIBC__ && !defined __UCLIBC__) +# include +# include +# include +#endif +#include + int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1]; + ]])], + [gl_cv_type_wint_t_too_small=no], + [gl_cv_type_wint_t_too_small=yes])]) + if test $gl_cv_type_wint_t_too_small = yes; then + GNULIB_OVERRIDES_WINT_T=1 + else + GNULIB_OVERRIDES_WINT_T=0 + fi + else + GNULIB_OVERRIDES_WINT_T=0 fi + AC_SUBST([GNULIB_OVERRIDES_WINT_T]) ]) diff -Nru datamash-1.0.7/m4/xalloc.m4 datamash-1.1.1/m4/xalloc.m4 --- datamash-1.0.7/m4/xalloc.m4 2015-06-17 23:45:30.000000000 +0000 +++ datamash-1.1.1/m4/xalloc.m4 2017-01-10 20:01:02.000000000 +0000 @@ -1,5 +1,5 @@ # xalloc.m4 serial 18 -dnl Copyright (C) 2002-2006, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/xstrndup.m4 datamash-1.1.1/m4/xstrndup.m4 --- datamash-1.0.7/m4/xstrndup.m4 2015-06-17 23:45:30.000000000 +0000 +++ datamash-1.1.1/m4/xstrndup.m4 2017-01-10 20:01:02.000000000 +0000 @@ -1,5 +1,5 @@ # xstrndup.m4 serial 2 -dnl Copyright (C) 2003, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/m4/xstrtol.m4 datamash-1.1.1/m4/xstrtol.m4 --- datamash-1.0.7/m4/xstrtol.m4 2015-06-17 23:45:30.000000000 +0000 +++ datamash-1.1.1/m4/xstrtol.m4 2017-01-10 20:01:02.000000000 +0000 @@ -1,5 +1,5 @@ #serial 11 -dnl Copyright (C) 2002-2007, 2009-2015 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2007, 2009-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. diff -Nru datamash-1.0.7/maint.mk datamash-1.1.1/maint.mk --- datamash-1.0.7/maint.mk 2015-06-17 23:45:30.000000000 +0000 +++ datamash-1.1.1/maint.mk 2017-01-10 20:01:02.000000000 +0000 @@ -2,7 +2,7 @@ # This Makefile fragment tries to be general-purpose enough to be # used by many projects via the gnulib maintainer-makefile module. -## Copyright (C) 2001-2015 Free Software Foundation, Inc. +## Copyright (C) 2001-2017 Free Software Foundation, Inc. ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -55,6 +55,10 @@ VC_LIST = $(srcdir)/$(_build-aux)/vc-list-files -C $(srcdir) +# You can override this variable in cfg.mk if your gnulib submodule lives +# in a different location. +gnulib_dir ?= $(srcdir)/gnulib + # You can override this variable in cfg.mk to set your own regexp # matching files to ignore. VC_LIST_ALWAYS_EXCLUDE_REGEX ?= ^$$ @@ -437,17 +441,26 @@ halt='the above files do not include ' \ $(_sc_search_regexp) +# Print each file name for which the first #include does not match +# $(config_h_header). Like grep -m 1, this only looks at the first match. +perl_config_h_first_ = \ + -e 'BEGIN {$$ret = 0}' \ + -e 'if (/^\# *include\b/) {' \ + -e ' if (not m{^\# *include $(config_h_header)}) {' \ + -e ' print "$$ARGV\n";' \ + -e ' $$ret = 1;' \ + -e ' }' \ + -e ' \# Move on to next file after first include' \ + -e ' close ARGV;' \ + -e '}' \ + -e 'END {exit $$ret}' + # You must include before including any other header file. # This can possibly be via a package-specific header, if given by cfg.mk. sc_require_config_h_first: @if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \ - fail=0; \ - for i in $$($(VC_LIST_EXCEPT) | grep '\.c$$'); do \ - grep '^# *include\>' $$i | $(SED) 1q \ - | grep -E '^# *include $(config_h_header)' > /dev/null \ - || { echo $$i; fail=1; }; \ - done; \ - test $$fail = 1 && \ + files=$$($(VC_LIST_EXCEPT) | grep '\.c$$') && \ + perl -n $(perl_config_h_first_) $$files || \ { echo '$(ME): the above files include some other header' \ 'before ' 1>&2; exit 1; } || :; \ else :; \ @@ -648,18 +661,14 @@ re='\<(strn?casecmp|ffs(ll)?)\>' \ $(_sc_header_without_use) -# Get the list of symbol names with this: -# perl -lne '/^# *define ([A-Z]\w+)\(/ and print $1' lib/intprops.h|fmt -_intprops_names = \ - TYPE_IS_INTEGER TYPE_TWOS_COMPLEMENT TYPE_ONES_COMPLEMENT \ - TYPE_SIGNED_MAGNITUDE TYPE_SIGNED TYPE_MINIMUM TYPE_MAXIMUM \ - INT_BITS_STRLEN_BOUND INT_STRLEN_BOUND INT_BUFSIZE_BOUND \ - INT_ADD_RANGE_OVERFLOW INT_SUBTRACT_RANGE_OVERFLOW \ - INT_NEGATE_RANGE_OVERFLOW INT_MULTIPLY_RANGE_OVERFLOW \ - INT_DIVIDE_RANGE_OVERFLOW INT_REMAINDER_RANGE_OVERFLOW \ - INT_LEFT_SHIFT_RANGE_OVERFLOW INT_ADD_OVERFLOW INT_SUBTRACT_OVERFLOW \ - INT_NEGATE_OVERFLOW INT_MULTIPLY_OVERFLOW INT_DIVIDE_OVERFLOW \ - INT_REMAINDER_OVERFLOW INT_LEFT_SHIFT_OVERFLOW +# Extract the raw list of symbol names with this: +gl_extract_define_simple = \ + /^\# *define ([A-Z]\w+)\(/ and print $$1 +# Filter out duplicates and convert to a space-separated list: +_intprops_names = \ + $(shell f=$(gnulib_dir)/lib/intprops.h; \ + perl -lne '$(gl_extract_define_simple)' $$f | sort -u | tr '\n' ' ') +# Remove trailing space and convert to a regular expression: _intprops_syms_re = $(subst $(_sp),|,$(strip $(_intprops_names))) # Prohibit the inclusion of intprops.h without an actual use. sc_prohibit_intprops_without_use: @@ -709,15 +718,6 @@ $(_sc_search_regexp) # Ensure that each .c file containing a "main" function also -# calls set_program_name. -sc_program_name: - @require='set_program_name *\(.*\);' \ - in_vc_files='\.c$$' \ - containing='\
$@-1; \ - files=; \ - for file in $$($(VC_LIST_EXCEPT)) $(generated_files); do \ - test -r $$file || continue; \ - case $$file in \ - *.m4|*.mk) continue ;; \ - *.?|*.??) ;; \ - *) continue;; \ - esac; \ - case $$file in \ - *.[ch]) \ - base=`expr " $$file" : ' \(.*\)\..'`; \ - { test -f $$base.l || test -f $$base.y; } && continue;; \ - esac; \ - files="$$files $$file"; \ - done; \ + files=$$(perl $(perl_translatable_files_list_) \ + $$($(VC_LIST_EXCEPT)) $(generated_files)); \ grep -E -l '$(_gl_translatable_string_re)' $$files \ | $(SED) 's|^$(_dot_escaped_srcdir)/||' | sort -u > $@-2; \ diff -u -L $(po_file) -L $(po_file) $@-1 $@-2 \ @@ -1285,7 +1293,6 @@ rel-files = $(DIST_ARCHIVES) -gnulib_dir ?= $(srcdir)/gnulib gnulib-version = $$(cd $(gnulib_dir) \ && { git describe || git rev-parse --short=10 HEAD; } ) bootstrap-tools ?= autoconf,automake,gnulib @@ -1495,7 +1502,10 @@ --highlight --frames --legend \ --title "$(PACKAGE_NAME)" -coverage: init-coverage build-coverage gen-coverage +coverage: + $(MAKE) init-coverage + $(MAKE) build-coverage + $(MAKE) gen-coverage # Some projects carry local adjustments for gnulib modules via patches in # a gnulib patch directory whose default name is gl/ (defined in bootstrap @@ -1600,7 +1610,7 @@ # do not need to be marked. Symbols matching '__.*' are # reserved by the compiler, so are automatically excluded below. _gl_TS_unmarked_extern_functions ?= main usage -_gl_TS_function_match ?= /^(?:$(_gl_TS_extern)) +.*?(\S+) *\(/ +_gl_TS_function_match ?= /^(?:$(_gl_TS_extern)) +.*?(\w+) *\(/ # If your project uses a macro like "XTERN", then put # the following in cfg.mk to override this default: @@ -1633,6 +1643,7 @@ .PHONY: _gl_tight_scope _gl_tight_scope: $(bin_PROGRAMS) + sed_wrap='s/^/^_?/;s/$$/$$/'; \ t=exceptions-$$$$; \ trap 's=$$?; rm -f $$t; exit $$s' 0; \ for sig in 1 2 3 13 15; do \ @@ -1642,19 +1653,19 @@ test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`; \ hdr=`for f in $(_gl_TS_headers); do \ test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`; \ - ( printf '^%s$$\n' '__.*' $(_gl_TS_unmarked_extern_functions); \ + ( printf '%s\n' '__.*' $(_gl_TS_unmarked_extern_functions); \ grep -h -A1 '^extern .*[^;]$$' $$src \ - | grep -vE '^(extern |--)' | $(SED) 's/ .*//'; \ + | grep -vE '^(extern |--|#)' | $(SED) 's/ .*//; /^$$/d'; \ perl -lne \ - '$(_gl_TS_function_match) and print "^$$1\$$"' $$hdr; \ - ) | sort -u > $$t; \ + '$(_gl_TS_function_match) and print $$1' $$hdr; \ + ) | sort -u | $(SED) "$$sed_wrap" > $$t; \ nm -g $(_gl_TS_obj_files)|$(SED) -n 's/.* T //p'|grep -Ev -f $$t \ && { echo the above functions should have static scope >&2; \ exit 1; } || : ; \ - ( printf '^%s$$\n' '__.*' $(_gl_TS_unmarked_extern_vars); \ - perl -lne '$(_gl_TS_var_match) and print "^$$1\$$"' \ + ( printf '%s\n' '__.*' main $(_gl_TS_unmarked_extern_vars); \ + perl -lne '$(_gl_TS_var_match) and print $$1' \ $$hdr $(_gl_TS_other_headers) \ - ) | sort -u > $$t; \ + ) | sort -u | $(SED) "$$sed_wrap" > $$t; \ nm -g $(_gl_TS_obj_files) | $(SED) -n 's/.* [BCDGRS] //p' \ | sort -u | grep -Ev -f $$t \ && { echo the above variables should have static scope >&2; \ diff -Nru datamash-1.0.7/Makefile.am datamash-1.1.1/Makefile.am --- datamash-1.0.7/Makefile.am 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/Makefile.am 2017-01-17 17:50:20.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2013-2015 Assaf Gordon +# Copyright (C) 2013-2017 Assaf Gordon # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without @@ -35,8 +35,11 @@ src/utils.c src/utils.h \ src/text-lines.c src/text-lines.h \ src/column-headers.c src/column-headers.h \ + src/op-defs.c src/op-defs.h \ + src/op-scanner.c src/op-scanner.h \ + src/op-parser.c src/op-parser.h \ src/field-ops.c src/field-ops.h \ - src/strcnt.c src/strcnt.h \ + src/crosstab.c src/crosstab.h \ src/datamash.c datamash_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS) $(MINGW_CFLAGS) @@ -111,14 +114,20 @@ tests/datamash-show-env.sh \ tests/datamash-tests.pl \ tests/datamash-tests-2.pl \ + tests/datamash-parser.pl \ + tests/datamash-error-msgs.pl \ tests/datamash-md5.pl \ tests/datamash-sha.pl \ tests/datamash-rand.sh \ tests/datamash-stats.pl \ tests/datamash-transpose.pl \ + tests/datamash-crosstab.pl \ + tests/datamash-pair-tests.pl \ + tests/datamash-check-tabular.pl \ tests/datamash-sort-header.sh \ tests/datamash-sort-errors.sh \ tests/datamash-io-errors.sh \ + tests/datamash-strbin.sh \ tests/datamash-valgrind.sh EXTRA_DIST += \ @@ -164,6 +173,11 @@ EXTRA_DIST += $(dist_examples_DATA) +if ENABLE_BASH_COMPLETION +bashcompletiondir = $(BASH_COMPLETION_DIR) +dist_bashcompletion_DATA = contrib/bash-completion/datamash +endif + @@ -219,11 +233,36 @@ email = $(PACKAGE_BUGREPORT) gendocs_args = --email $(email) $(manual) $(manual_title) +# This will affect the result of 'make web-manual' +# all generated HTML files will contain the embedded CSS statements. +# 'gendocs_options_' is used in the 'web-manual' target in 'maint.mk'. +gendocs_options_=\ + --html "--css-include=$(abs_top_srcdir)/doc/datamash-texinfo.css" + include $(top_srcdir)/lib/local.mk include $(top_srcdir)/doc/local.mk ## +## Compute program's code complexity +## using gnulib's pmccabe2html module + +cyclo_sources = ${top_srcdir}/src/*.[ch] +svweburl="http://git.savannah.gnu.org/cgit/" + +cyclo-$(PACKAGE).html: $(cyclo_sources) + $(PMCCABE) $(cyclo_sources) \ + | sort -nr \ + | $(AWK) -f ${top_srcdir}/build-aux/pmccabe2html \ + -v lang=html -v name="$(PACKAGE_NAME)" \ + -v vcurl="$(svweburl)/$(PACKAGE).git/tree/%FILENAME%" \ + -v url="http://www.gnu.org/software/$(PACKAGE)/" \ + -v css=${top_srcdir}/build-aux/pmccabe.css \ + -v cut_dir=${top_srcdir}/ \ + > $@-tmp + mv $@-tmp $@ + +## ## ## diff -Nru datamash-1.0.7/Makefile.in datamash-1.1.1/Makefile.in --- datamash-1.0.7/Makefile.in 2015-06-22 00:26:22.000000000 +0000 +++ datamash-1.1.1/Makefile.in 2017-01-19 19:34:08.000000000 +0000 @@ -14,7 +14,7 @@ @SET_MAKE@ -# Copyright (C) 2013-2015 Assaf Gordon +# Copyright (C) 2013-2017 Assaf Gordon # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without @@ -24,7 +24,7 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# Copyright (C) 2014-2015 Assaf Gordon +# Copyright (C) 2014-2017 Assaf Gordon # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without @@ -34,7 +34,7 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# Copyright (C) 2002-2015 Free Software Foundation, Inc. +# Copyright (C) 2002-2017 Free Software Foundation, Inc. # # 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 @@ -55,7 +55,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl --lib=libdatamash --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --makefile-name=gnulib.mk --no-conditional-dependencies --no-libtool --macro-prefix=gl announce-gen assert base64 calloc-gnu closeout configmake crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dirname do-release-commit-and-tag error expl extensions fabsl fdl gendocs getopt-gnu gettext git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload hard-locale hash hash-pjw ignore-value intprops inttostr inttypes isblank isnanl linebuffer locale localeconv maintainer-makefile mbsrtowcs minmax non-recursive-gnulib-prefix-hack progname propername random readme-release realloc-gnu size_max sqrtl stdint stdnoreturn strsep unlocked-io version-etc warnings xalloc xstrndup xstrtol xstrtoumax +# Reproduce by: gnulib-tool --import --local-dir=gl --lib=libdatamash --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --makefile-name=gnulib.mk --no-conditional-dependencies --no-libtool --macro-prefix=gl announce-gen assert base64 c-ctype calloc-gnu ceill closeout configmake crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dirname do-release-commit-and-tag error expl extensions fabsl fdl floorl fpucw gendocs getopt-gnu gettext git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload hard-locale hash hash-pjw hash-pjw-bare ignore-value intprops inttostr inttypes isblank isnanl linebuffer locale localeconv maintainer-makefile mbsrtowcs minmax modfl non-recursive-gnulib-prefix-hack pmccabe2html progname propername random readme-release realloc-gnu roundl size_max sqrtl stdint stdnoreturn stpcpy strsep unlocked-io update-copyright version-etc warnings xalloc xstrndup xstrtol xstrtoumax # Make GNU Datamash documentation. -*-Makefile-*- # This is included by the top-level Makefile.am. @@ -66,7 +66,7 @@ # Software Foundation, Inc. # Modifications for GNU Datamash are -# Copyright (C) 2014-2015 Assaf Gordon +# Copyright (C) 2014-2017 Assaf Gordon # 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 @@ -155,12 +155,14 @@ $(srcdir)/config.in ABOUT-NLS $(top_srcdir)/build-aux/depcomp \ $(doc_datamash_TEXINFOS) $(top_srcdir)/build-aux/mdate-sh \ $(srcdir)/doc/version.texi $(srcdir)/doc/stamp-vti \ - $(top_srcdir)/build-aux/texinfo.tex $(dist_examples_DATA) \ - $(top_srcdir)/build-aux/test-driver COPYING THANKS \ - build-aux/compile build-aux/config.guess \ + $(top_srcdir)/build-aux/texinfo.tex \ + $(am__dist_bashcompletion_DATA_DIST) $(dist_examples_DATA) \ + $(top_srcdir)/build-aux/test-driver COPYING THANKS TODO \ + build-aux/ar-lib build-aux/compile build-aux/config.guess \ build-aux/config.rpath build-aux/config.sub build-aux/depcomp \ build-aux/install-sh build-aux/mdate-sh build-aux/missing \ - build-aux/texinfo.tex $(top_srcdir)/build-aux/compile \ + build-aux/texinfo.tex $(top_srcdir)/build-aux/ar-lib \ + $(top_srcdir)/build-aux/compile \ $(top_srcdir)/build-aux/config.guess \ $(top_srcdir)/build-aux/config.rpath \ $(top_srcdir)/build-aux/config.sub \ @@ -191,32 +193,35 @@ $(top_srcdir)/m4/floorl.m4 $(top_srcdir)/m4/fpending.m4 \ $(top_srcdir)/m4/fpieee.m4 $(top_srcdir)/m4/frexp.m4 \ $(top_srcdir)/m4/frexpl.m4 $(top_srcdir)/m4/getopt.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gl-openssl.m4 \ - $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnulib-common.m4 \ + $(top_srcdir)/m4/getprogname.m4 $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gl-openssl.m4 $(top_srcdir)/m4/glibc21.m4 \ + $(top_srcdir)/m4/gnulib-common.m4 \ $(top_srcdir)/m4/gnulib-comp.m4 \ $(top_srcdir)/m4/hard-locale.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/iconv_h.m4 $(top_srcdir)/m4/iconv_open.m4 \ $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inline.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/inttostr.m4 \ $(top_srcdir)/m4/inttypes-pri.m4 $(top_srcdir)/m4/inttypes.m4 \ - $(top_srcdir)/m4/isblank.m4 $(top_srcdir)/m4/isnand.m4 \ + $(top_srcdir)/m4/isblank.m4 $(top_srcdir)/m4/isfinite.m4 \ + $(top_srcdir)/m4/isinf.m4 $(top_srcdir)/m4/isnand.m4 \ $(top_srcdir)/m4/isnanf.m4 $(top_srcdir)/m4/isnanl.m4 \ $(top_srcdir)/m4/iswblank.m4 $(top_srcdir)/m4/ldexp.m4 \ $(top_srcdir)/m4/ldexpl.m4 $(top_srcdir)/m4/lib-ld.m4 \ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ $(top_srcdir)/m4/libunistring-base.m4 \ - $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \ - $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-zh.m4 \ - $(top_srcdir)/m4/locale_h.m4 $(top_srcdir)/m4/localeconv.m4 \ - $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/malloc.m4 \ - $(top_srcdir)/m4/malloca.m4 $(top_srcdir)/m4/math_h.m4 \ - $(top_srcdir)/m4/mathfunc.m4 $(top_srcdir)/m4/mbchar.m4 \ - $(top_srcdir)/m4/mbiter.m4 $(top_srcdir)/m4/mbrtowc.m4 \ - $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbslen.m4 \ - $(top_srcdir)/m4/mbsrtowcs.m4 $(top_srcdir)/m4/mbstate_t.m4 \ - $(top_srcdir)/m4/md5.m4 $(top_srcdir)/m4/memchr.m4 \ - $(top_srcdir)/m4/minmax.m4 $(top_srcdir)/m4/mmap-anon.m4 \ - $(top_srcdir)/m4/msvc-inval.m4 \ + $(top_srcdir)/m4/limits-h.m4 $(top_srcdir)/m4/localcharset.m4 \ + $(top_srcdir)/m4/locale-fr.m4 $(top_srcdir)/m4/locale-ja.m4 \ + $(top_srcdir)/m4/locale-zh.m4 $(top_srcdir)/m4/locale_h.m4 \ + $(top_srcdir)/m4/localeconv.m4 $(top_srcdir)/m4/longlong.m4 \ + $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \ + $(top_srcdir)/m4/math_h.m4 $(top_srcdir)/m4/mathfunc.m4 \ + $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \ + $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbsinit.m4 \ + $(top_srcdir)/m4/mbslen.m4 $(top_srcdir)/m4/mbsrtowcs.m4 \ + $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/md5.m4 \ + $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/minmax.m4 \ + $(top_srcdir)/m4/mmap-anon.m4 $(top_srcdir)/m4/modf.m4 \ + $(top_srcdir)/m4/modfl.m4 $(top_srcdir)/m4/msvc-inval.m4 \ $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/nocrash.m4 \ $(top_srcdir)/m4/non-recursive-gnulib-prefix-hack.m4 \ @@ -232,12 +237,13 @@ $(top_srcdir)/m4/stdarg.m4 $(top_srcdir)/m4/stdbool.m4 \ $(top_srcdir)/m4/stddef_h.m4 $(top_srcdir)/m4/stdint.m4 \ $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \ - $(top_srcdir)/m4/stdnoreturn.m4 $(top_srcdir)/m4/strerror.m4 \ - $(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strndup.m4 \ - $(top_srcdir)/m4/strnlen.m4 $(top_srcdir)/m4/strsep.m4 \ - $(top_srcdir)/m4/strtoull.m4 $(top_srcdir)/m4/strtoumax.m4 \ - $(top_srcdir)/m4/sys_socket_h.m4 \ - $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/unistd_h.m4 \ + $(top_srcdir)/m4/stdnoreturn.m4 $(top_srcdir)/m4/stpcpy.m4 \ + $(top_srcdir)/m4/strerror.m4 $(top_srcdir)/m4/string_h.m4 \ + $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \ + $(top_srcdir)/m4/strsep.m4 $(top_srcdir)/m4/strtoull.m4 \ + $(top_srcdir)/m4/strtoumax.m4 $(top_srcdir)/m4/sys_socket_h.m4 \ + $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/trunc.m4 \ + $(top_srcdir)/m4/truncl.m4 $(top_srcdir)/m4/unistd_h.m4 \ $(top_srcdir)/m4/unlocked-io.m4 \ $(top_srcdir)/m4/version-etc.m4 \ $(top_srcdir)/m4/warn-on-use.m4 $(top_srcdir)/m4/warnings.m4 \ @@ -267,22 +273,23 @@ lib/close-stream.c lib/closeout.c lib/md5.c lib/sha1.c \ lib/sha256.c lib/sha512.c lib/dirname.c lib/basename.c \ lib/dirname-lgpl.c lib/basename-lgpl.c lib/stripslash.c \ - lib/exitfail.c lib/gettext.h lib/hard-locale.c lib/hash.c \ - lib/hash-pjw.h lib/hash-pjw.c lib/imaxtostr.c lib/inttostr.c \ - lib/offtostr.c lib/uinttostr.c lib/umaxtostr.c \ - lib/linebuffer.h lib/linebuffer.c lib/localcharset.h \ - lib/localcharset.c lib/malloca.c lib/math.c lib/mbchar.c \ - lib/mbiter.h lib/mbiter.c lib/mbslen.c lib/mbsstr.c \ - lib/mbuiter.h lib/mbuiter.c lib/minmax.h lib/progname.h \ - lib/progname.c lib/propername.h lib/propername.c \ - lib/quotearg.c lib/size_max.h lib/striconv.h lib/striconv.c \ - lib/strnlen1.h lib/strnlen1.c lib/trim.c lib/u64.c \ - lib/unistd.c lib/unistr/u8-mbtoucr.c lib/unistr/u8-uctomb.c \ - lib/unistr/u8-uctomb-aux.c lib/uniwidth/width.c \ - lib/version-etc.h lib/version-etc.c lib/wctype-h.c \ - lib/xmalloc.c lib/xalloc-die.c lib/xstriconv.h lib/xstriconv.c \ - lib/xstrndup.h lib/xstrndup.c lib/xstrtol.c lib/xstrtoul.c \ - lib/xstrtol-error.c lib/xstrtoumax.c + lib/exitfail.c lib/getprogname.h lib/getprogname.c \ + lib/gettext.h lib/hard-locale.c lib/hash.c lib/hash-pjw.h \ + lib/hash-pjw.c lib/hash-pjw-bare.h lib/hash-pjw-bare.c \ + lib/imaxtostr.c lib/inttostr.c lib/offtostr.c lib/uinttostr.c \ + lib/umaxtostr.c lib/linebuffer.h lib/linebuffer.c \ + lib/localcharset.h lib/localcharset.c lib/malloca.c lib/math.c \ + lib/mbchar.c lib/mbiter.h lib/mbiter.c lib/mbslen.c \ + lib/mbsstr.c lib/mbuiter.h lib/mbuiter.c lib/minmax.h \ + lib/progname.h lib/progname.c lib/propername.h \ + lib/propername.c lib/quotearg.c lib/size_max.h lib/striconv.h \ + lib/striconv.c lib/strnlen1.h lib/strnlen1.c lib/trim.c \ + lib/u64.c lib/unistd.c lib/unistr/u8-mbtoucr.c \ + lib/unistr/u8-uctomb.c lib/unistr/u8-uctomb-aux.c \ + lib/uniwidth/width.c lib/version-etc.h lib/version-etc.c \ + lib/wctype-h.c lib/xmalloc.c lib/xalloc-die.c lib/xstriconv.h \ + lib/xstriconv.c lib/xstrndup.h lib/xstrndup.c lib/xstrtol.c \ + lib/xstrtoul.c lib/xstrtol-error.c lib/xstrtoumax.c am__dirstamp = $(am__leading_dot)dirstamp @LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE@am__objects_1 = lib/unistr/u8-mbtoucr.$(OBJEXT) @LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE@am__objects_2 = lib/unistr/u8-uctomb.$(OBJEXT) \ @@ -296,8 +303,9 @@ lib/sha512.$(OBJEXT) lib/dirname.$(OBJEXT) \ lib/basename.$(OBJEXT) lib/dirname-lgpl.$(OBJEXT) \ lib/basename-lgpl.$(OBJEXT) lib/stripslash.$(OBJEXT) \ - lib/exitfail.$(OBJEXT) lib/hard-locale.$(OBJEXT) \ - lib/hash.$(OBJEXT) lib/hash-pjw.$(OBJEXT) \ + lib/exitfail.$(OBJEXT) lib/getprogname.$(OBJEXT) \ + lib/hard-locale.$(OBJEXT) lib/hash.$(OBJEXT) \ + lib/hash-pjw.$(OBJEXT) lib/hash-pjw-bare.$(OBJEXT) \ lib/imaxtostr.$(OBJEXT) lib/inttostr.$(OBJEXT) \ lib/offtostr.$(OBJEXT) lib/uinttostr.$(OBJEXT) \ lib/umaxtostr.$(OBJEXT) lib/linebuffer.$(OBJEXT) \ @@ -316,12 +324,17 @@ lib/xstrtol-error.$(OBJEXT) lib/xstrtoumax.$(OBJEXT) lib_libdatamash_a_OBJECTS = $(am_lib_libdatamash_a_OBJECTS) am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(infodir)" \ - "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(examplesdir)" + "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(bashcompletiondir)" \ + "$(DESTDIR)$(examplesdir)" PROGRAMS = $(bin_PROGRAMS) am_datamash_OBJECTS = src/datamash-text-options.$(OBJEXT) \ src/datamash-utils.$(OBJEXT) src/datamash-text-lines.$(OBJEXT) \ src/datamash-column-headers.$(OBJEXT) \ - src/datamash-field-ops.$(OBJEXT) src/datamash-strcnt.$(OBJEXT) \ + src/datamash-op-defs.$(OBJEXT) \ + src/datamash-op-scanner.$(OBJEXT) \ + src/datamash-op-parser.$(OBJEXT) \ + src/datamash-field-ops.$(OBJEXT) \ + src/datamash-crosstab.$(OBJEXT) \ src/datamash-datamash.$(OBJEXT) datamash_OBJECTS = $(am_datamash_OBJECTS) datamash_DEPENDENCIES = $(top_builddir)/lib/lib$(PACKAGE).a \ @@ -410,7 +423,6 @@ TEXI2DVI = texi2dvi TEXI2PDF = $(TEXI2DVI) --pdf --batch MAKEINFOHTML = $(MAKEINFO) --html -AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) DVIPS = dvips RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ @@ -455,7 +467,8 @@ man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) -DATA = $(dist_examples_DATA) +am__dist_bashcompletion_DATA_DIST = contrib/bash-completion/datamash +DATA = $(dist_bashcompletion_DATA) $(dist_examples_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ @@ -716,6 +729,7 @@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BASH_COMPLETION_DIR = @BASH_COMPLETION_DIR@ BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@ BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@ BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@ @@ -723,6 +737,8 @@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ +CEILL_LIBM = @CEILL_LIBM@ +CEIL_LIBM = @CEIL_LIBM@ CFLAGS = @CFLAGS@ CONFIG_INCLUDE = @CONFIG_INCLUDE@ CPP = @CPP@ @@ -747,6 +763,7 @@ FABSL_LIBM = @FABSL_LIBM@ FABS_LIBM = @FABS_LIBM@ FLOAT_H = @FLOAT_H@ +FLOORL_LIBM = @FLOORL_LIBM@ FLOOR_LIBM = @FLOOR_LIBM@ FREXPL_LIBM = @FREXPL_LIBM@ FREXP_LIBM = @FREXP_LIBM@ @@ -931,6 +948,7 @@ GNULIB_MODFL = @GNULIB_MODFL@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@ GNULIB_PCLOSE = @GNULIB_PCLOSE@ GNULIB_PERROR = @GNULIB_PERROR@ GNULIB_PIPE = @GNULIB_PIPE@ @@ -1085,6 +1103,7 @@ HAVE_ATANL = @HAVE_ATANL@ HAVE_ATOLL = @HAVE_ATOLL@ HAVE_BTOWC = @HAVE_BTOWC@ +HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@ HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@ HAVE_CBRT = @HAVE_CBRT@ HAVE_CBRTF = @HAVE_CBRTF@ @@ -1122,6 +1141,7 @@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@ +HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@ HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ @@ -1256,6 +1276,7 @@ HAVE_PTSNAME = @HAVE_PTSNAME@ HAVE_PTSNAME_R = @HAVE_PTSNAME_R@ HAVE_PWRITE = @HAVE_PWRITE@ +HAVE_QSORT_R = @HAVE_QSORT_R@ HAVE_RANDOM = @HAVE_RANDOM@ HAVE_RANDOM_H = @HAVE_RANDOM_H@ HAVE_RANDOM_R = @HAVE_RANDOM_R@ @@ -1365,6 +1386,8 @@ INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@ INTLLIBS = @INTLLIBS@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +ISFINITE_LIBM = @ISFINITE_LIBM@ +ISINF_LIBM = @ISINF_LIBM@ ISNANL_LIBM = @ISNANL_LIBM@ LDEXPL_LIBM = @LDEXPL_LIBM@ LDEXP_LIBM = @LDEXP_LIBM@ @@ -1379,6 +1402,7 @@ LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@ LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@ LIB_CRYPTO = @LIB_CRYPTO@ +LIMITS_H = @LIMITS_H@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ LOCALE_FR = @LOCALE_FR@ LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@ @@ -1389,6 +1413,8 @@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ +MODFL_LIBM = @MODFL_LIBM@ +MODF_LIBM = @MODF_LIBM@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ @@ -1398,6 +1424,7 @@ NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@ NEXT_AS_FIRST_DIRECTIVE_ICONV_H = @NEXT_AS_FIRST_DIRECTIVE_ICONV_H@ NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@ +NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@ NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@ NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@ NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@ @@ -1416,6 +1443,7 @@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ NEXT_ICONV_H = @NEXT_ICONV_H@ NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ +NEXT_LIMITS_H = @NEXT_LIMITS_H@ NEXT_LOCALE_H = @NEXT_LOCALE_H@ NEXT_MATH_H = @NEXT_MATH_H@ NEXT_STDARG_H = @NEXT_STDARG_H@ @@ -1438,6 +1466,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ +PMCCABE = @PMCCABE@ POSUB = @POSUB@ POW_LIBM = @POW_LIBM@ PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ @@ -1446,6 +1475,10 @@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ +REPLACE_ACOSF = @REPLACE_ACOSF@ +REPLACE_ASINF = @REPLACE_ASINF@ +REPLACE_ATAN2F = @REPLACE_ATAN2F@ +REPLACE_ATANF = @REPLACE_ATANF@ REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CALLOC = @REPLACE_CALLOC@ REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ @@ -1456,12 +1489,15 @@ REPLACE_CEILL = @REPLACE_CEILL@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ +REPLACE_COSF = @REPLACE_COSF@ +REPLACE_COSHF = @REPLACE_COSHF@ REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ REPLACE_EXP2 = @REPLACE_EXP2@ REPLACE_EXP2L = @REPLACE_EXP2L@ +REPLACE_EXPF = @REPLACE_EXPF@ REPLACE_EXPM1 = @REPLACE_EXPM1@ REPLACE_EXPM1F = @REPLACE_EXPM1F@ REPLACE_FABSL = @REPLACE_FABSL@ @@ -1581,9 +1617,12 @@ REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ REPLACE_SIGNBIT = @REPLACE_SIGNBIT@ REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@ +REPLACE_SINF = @REPLACE_SINF@ +REPLACE_SINHF = @REPLACE_SINHF@ REPLACE_SLEEP = @REPLACE_SLEEP@ REPLACE_SNPRINTF = @REPLACE_SNPRINTF@ REPLACE_SPRINTF = @REPLACE_SPRINTF@ +REPLACE_SQRTF = @REPLACE_SQRTF@ REPLACE_SQRTL = @REPLACE_SQRTL@ REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@ REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@ @@ -1605,6 +1644,8 @@ REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@ REPLACE_SYMLINK = @REPLACE_SYMLINK@ REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@ +REPLACE_TANF = @REPLACE_TANF@ +REPLACE_TANHF = @REPLACE_TANHF@ REPLACE_TMPFILE = @REPLACE_TMPFILE@ REPLACE_TOWLOWER = @REPLACE_TOWLOWER@ REPLACE_TRUNC = @REPLACE_TRUNC@ @@ -1645,6 +1686,8 @@ STDINT_H = @STDINT_H@ STDNORETURN_H = @STDNORETURN_H@ STRIP = @STRIP@ +TRUNCL_LIBM = @TRUNCL_LIBM@ +TRUNC_LIBM = @TRUNC_LIBM@ UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@ UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@ UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@ @@ -1664,6 +1707,7 @@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ @@ -1742,17 +1786,18 @@ tests/init.sh init.cfg $(TESTS) cfg.mk $(dist_examples_DATA) \ lib/alloca.in.h $(top_srcdir)/build-aux/announce-gen \ lib/assure.h lib/c-strcaseeq.h lib/calloc.c lib/calloc.c \ - lib/close-stream.h lib/closeout.h lib/gl_openssl.h lib/md5.h \ - lib/gl_openssl.h lib/sha1.h lib/gl_openssl.h lib/sha256.h \ - lib/gl_openssl.h lib/sha512.h lib/ctype.in.h lib/stripslash.c \ - lib/dirname.h \ + lib/ceil.c lib/ceil.c lib/ceill.c lib/close-stream.h \ + lib/closeout.h lib/gl_openssl.h lib/md5.h lib/gl_openssl.h \ + lib/sha1.h lib/gl_openssl.h lib/sha256.h lib/gl_openssl.h \ + lib/sha512.h lib/ctype.in.h lib/stripslash.c lib/dirname.h \ $(top_srcdir)/build-aux/do-release-commit-and-tag \ lib/dosname.h lib/errno.in.h lib/error.c lib/error.h \ lib/exitfail.h lib/expl-table.c lib/expl.c lib/fabsl.c \ - lib/float.c lib/float.in.h lib/itold.c lib/floor.c \ - lib/fpending.c lib/fpending.h lib/fpucw.h lib/frexp.c \ - lib/frexp.c lib/frexpl.c $(top_srcdir)/build-aux/gendocs.sh \ - lib/getopt.c lib/getopt.in.h lib/getopt1.c lib/getopt_int.h \ + lib/float.c lib/float.in.h lib/itold.c lib/floor.c lib/floor.c \ + lib/floorl.c lib/fpending.c lib/fpending.h lib/stdio-impl.h \ + lib/fpucw.h lib/frexp.c lib/frexp.c lib/frexpl.c \ + $(top_srcdir)/build-aux/gendocs.sh lib/getopt.c \ + lib/getopt.in.h lib/getopt1.c lib/getopt_int.h \ $(top_srcdir)/build-aux/config.rpath \ $(top_srcdir)/build-aux/git-version-gen \ $(top_srcdir)/build-aux/gitlog-to-changelog \ @@ -1767,50 +1812,56 @@ lib/iconv_open-irix.gperf lib/iconv_open-osf.gperf \ lib/iconv_open-solaris.gperf lib/iconv_open.c \ lib/ignore-value.h lib/intprops.h lib/anytostr.c \ - lib/inttostr.h lib/inttypes.in.h lib/isblank.c lib/float+.h \ - lib/isnan.c lib/isnand-nolibm.h lib/isnand.c lib/float+.h \ - lib/isnan.c lib/isnanf-nolibm.h lib/isnanf.c lib/float+.h \ - lib/isnan.c lib/isnanl.c lib/float+.h lib/isnan.c \ - lib/isnanl-nolibm.h lib/isnanl.c lib/iswblank.c lib/ldexpl.c \ - lib/config.charset lib/ref-add.sin lib/ref-del.sin \ - lib/locale.in.h lib/localeconv.c $(top_srcdir)/maint.mk \ - lib/malloc.c lib/malloca.h lib/malloca.valgrind lib/math.in.h \ - lib/mbchar.h lib/mbrtowc.c lib/mbsinit.c lib/mbsrtowcs-impl.h \ + lib/inttostr.h lib/inttypes.in.h lib/isblank.c lib/isfinite.c \ + lib/isinf.c lib/float+.h lib/isnan.c lib/isnand-nolibm.h \ + lib/isnand.c lib/float+.h lib/isnan.c lib/isnanf-nolibm.h \ + lib/isnanf.c lib/float+.h lib/isnan.c lib/isnanl.c \ + lib/float+.h lib/isnan.c lib/isnanl-nolibm.h lib/isnanl.c \ + lib/iswblank.c lib/ldexpl.c lib/limits.in.h lib/config.charset \ + lib/ref-add.sin lib/ref-del.sin lib/locale.in.h \ + lib/localeconv.c $(top_srcdir)/maint.mk lib/malloc.c \ + lib/malloca.h lib/malloca.valgrind lib/math.in.h lib/mbchar.h \ + lib/mbrtowc.c lib/mbsinit.c lib/mbsrtowcs-impl.h \ lib/mbsrtowcs-state.c lib/mbsrtowcs.c lib/str-kmp.h \ - lib/memchr.c lib/memchr.valgrind lib/msvc-inval.c \ - lib/msvc-inval.h lib/msvc-nothrow.c lib/msvc-nothrow.h \ - $(top_srcdir)/build-aux/prefix-gnulib-mk lib/quote.h \ - lib/quotearg.h lib/random.c lib/random_r.c \ - $(top_srcdir)/README-release lib/realloc.c lib/realloc.c \ - lib/round.c lib/round.c lib/roundl.c lib/float+.h \ - lib/signbitd.c lib/signbitf.c lib/signbitl.c \ - $(top_srcdir)/build-aux/snippet/_Noreturn.h \ + lib/memchr.c lib/memchr.valgrind lib/modf.c lib/modfl.c \ + lib/msvc-inval.c lib/msvc-inval.h lib/msvc-nothrow.c \ + lib/msvc-nothrow.h $(top_srcdir)/build-aux/prefix-gnulib-mk \ + $(top_srcdir)/build-aux/pmccabe2html \ + $(top_srcdir)/build-aux/pmccabe.css lib/quote.h lib/quotearg.h \ + lib/random.c lib/random_r.c $(top_srcdir)/README-release \ + lib/realloc.c lib/realloc.c lib/round.c lib/round.c \ + lib/roundl.c lib/float+.h lib/signbitd.c lib/signbitf.c \ + lib/signbitl.c $(top_srcdir)/build-aux/snippet/_Noreturn.h \ $(top_srcdir)/build-aux/snippet/arg-nonnull.h \ $(top_srcdir)/build-aux/snippet/c++defs.h \ $(top_srcdir)/build-aux/snippet/unused-parameter.h \ $(top_srcdir)/build-aux/snippet/warn-on-use.h lib/sqrtl.c \ lib/stdalign.in.h lib/stdarg.in.h lib/stdbool.in.h \ lib/stddef.in.h lib/stdint.in.h lib/stdio.in.h lib/stdlib.in.h \ - lib/stdnoreturn.in.h lib/streq.h lib/strerror.c \ + lib/stdnoreturn.in.h lib/stpcpy.c lib/streq.h lib/strerror.c \ lib/strerror-override.c lib/strerror-override.h \ lib/string.in.h lib/strndup.c lib/strnlen.c lib/strsep.c \ lib/strtol.c lib/strtoul.c lib/strtoull.c lib/strtoimax.c \ - lib/strtoumax.c lib/sys_types.in.h lib/trim.h lib/u64.h \ - lib/unistd.in.h lib/unistr.in.h lib/unitypes.in.h \ - lib/localcharset.h lib/uniwidth.in.h lib/uniwidth/cjk.h \ - lib/unlocked-io.h \ + lib/strtoumax.c lib/sys_types.in.h lib/trim.h lib/trunc.c \ + lib/trunc.c lib/truncl.c lib/u64.h lib/unistd.in.h \ + lib/unistr.in.h lib/unitypes.in.h lib/localcharset.h \ + lib/uniwidth.in.h lib/uniwidth/cjk.h lib/unlocked-io.h \ + $(top_srcdir)/build-aux/update-copyright \ $(top_srcdir)/build-aux/useless-if-before-free \ $(top_srcdir)/build-aux/vc-list-files lib/verify.h \ lib/wchar.in.h lib/wctype.in.h lib/wcwidth.c lib/xalloc.h \ - lib/xalloc-oversized.h lib/xstrtol.h + lib/xalloc-oversized.h lib/xstrtol.h doc/datamash-texinfo.css SUBDIRS = po datamash_SOURCES = src/system.h \ src/text-options.c src/text-options.h \ src/utils.c src/utils.h \ src/text-lines.c src/text-lines.h \ src/column-headers.c src/column-headers.h \ + src/op-defs.c src/op-defs.h \ + src/op-scanner.c src/op-scanner.h \ + src/op-parser.c src/op-parser.h \ src/field-ops.c src/field-ops.h \ - src/strcnt.c src/strcnt.h \ + src/crosstab.c src/crosstab.h \ src/datamash.c datamash_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS) $(MINGW_CFLAGS) @@ -1843,14 +1894,20 @@ tests/datamash-show-env.sh \ tests/datamash-tests.pl \ tests/datamash-tests-2.pl \ + tests/datamash-parser.pl \ + tests/datamash-error-msgs.pl \ tests/datamash-md5.pl \ tests/datamash-sha.pl \ tests/datamash-rand.sh \ tests/datamash-stats.pl \ tests/datamash-transpose.pl \ + tests/datamash-crosstab.pl \ + tests/datamash-pair-tests.pl \ + tests/datamash-check-tabular.pl \ tests/datamash-sort-header.sh \ tests/datamash-sort-errors.sh \ tests/datamash-io-errors.sh \ + tests/datamash-strbin.sh \ tests/datamash-valgrind.sh @@ -1870,6 +1927,8 @@ examples/scores.txt examples/scores_h.txt \ examples/genes.txt examples/genes_h.txt +@ENABLE_BASH_COMPLETION_TRUE@bashcompletiondir = $(BASH_COMPLETION_DIR) +@ENABLE_BASH_COMPLETION_TRUE@dist_bashcompletion_DATA = contrib/bash-completion/datamash LOG_COMPILER = MAINTAINERCLEANFILES = lib/iconv_open-aix.h lib/iconv_open-hpux.h \ lib/iconv_open-irix.h lib/iconv_open-osf.h \ @@ -1882,9 +1941,9 @@ lib/iconv_open-aix.h-t lib/iconv_open-hpux.h-t \ lib/iconv_open-irix.h-t lib/iconv_open-osf.h-t \ lib/iconv_open-solaris.h-t lib/inttypes.h lib/inttypes.h-t \ - lib/locale.h lib/locale.h-t lib/math.h lib/math.h-t \ - lib/arg-nonnull.h lib/arg-nonnull.h-t lib/c++defs.h \ - lib/c++defs.h-t lib/unused-parameter.h \ + lib/limits.h lib/limits.h-t lib/locale.h lib/locale.h-t \ + lib/math.h lib/math.h-t lib/arg-nonnull.h lib/arg-nonnull.h-t \ + lib/c++defs.h lib/c++defs.h-t lib/unused-parameter.h \ lib/unused-parameter.h-t lib/warn-on-use.h lib/warn-on-use.h-t \ lib/stdalign.h lib/stdalign.h-t lib/stdarg.h lib/stdarg.h-t \ lib/stdbool.h lib/stdbool.h-t lib/stddef.h lib/stddef.h-t \ @@ -1915,11 +1974,11 @@ $(FLOAT_H) $(GETOPT_H) $(ICONV_H) lib/iconv_open-aix.h \ lib/iconv_open-hpux.h lib/iconv_open-irix.h \ lib/iconv_open-osf.h lib/iconv_open-solaris.h lib/inttypes.h \ - lib/locale.h lib/math.h lib/arg-nonnull.h lib/c++defs.h \ - lib/unused-parameter.h lib/warn-on-use.h $(STDALIGN_H) \ - $(STDARG_H) $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) lib/stdio.h \ - lib/stdlib.h $(STDNORETURN_H) lib/string.h lib/sys/types.h \ - lib/unistd.h $(LIBUNISTRING_UNISTR_H) \ + $(LIMITS_H) lib/locale.h lib/math.h lib/arg-nonnull.h \ + lib/c++defs.h lib/unused-parameter.h lib/warn-on-use.h \ + $(STDALIGN_H) $(STDARG_H) $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) \ + lib/stdio.h lib/stdlib.h $(STDNORETURN_H) lib/string.h \ + lib/sys/types.h lib/unistd.h $(LIBUNISTRING_UNISTR_H) \ $(LIBUNISTRING_UNITYPES_H) $(LIBUNISTRING_UNIWIDTH_H) \ lib/wchar.h lib/wctype.h gendocs = build-aux/gendocs.sh @@ -1929,51 +1988,66 @@ manual_title = GNU datamash email = $(PACKAGE_BUGREPORT) gendocs_args = --email $(email) $(manual) $(manual_title) + +# This will affect the result of 'make web-manual' +# all generated HTML files will contain the embedded CSS statements. +# 'gendocs_options_' is used in the 'web-manual' target in 'maint.mk'. +gendocs_options_ = \ + --html "--css-include=$(abs_top_srcdir)/doc/datamash-texinfo.css" + lib_libdatamash_a_SOURCES = lib/base64.h lib/base64.c lib/bitrotate.h \ lib/bitrotate.c lib/c-ctype.h lib/c-ctype.c lib/c-strcase.h \ lib/c-strcasecmp.c lib/c-strncasecmp.c lib/close-stream.c \ lib/closeout.c lib/md5.c lib/sha1.c lib/sha256.c lib/sha512.c \ lib/dirname.c lib/basename.c lib/dirname-lgpl.c \ lib/basename-lgpl.c lib/stripslash.c lib/exitfail.c \ - lib/gettext.h lib/hard-locale.c lib/hash.c lib/hash-pjw.h \ - lib/hash-pjw.c lib/imaxtostr.c lib/inttostr.c lib/offtostr.c \ - lib/uinttostr.c lib/umaxtostr.c lib/linebuffer.h \ - lib/linebuffer.c lib/localcharset.h lib/localcharset.c \ - lib/malloca.c lib/math.c lib/mbchar.c lib/mbiter.h \ - lib/mbiter.c lib/mbslen.c lib/mbsstr.c lib/mbuiter.h \ - lib/mbuiter.c lib/minmax.h lib/progname.h lib/progname.c \ - lib/propername.h lib/propername.c lib/quotearg.c \ - lib/size_max.h lib/striconv.h lib/striconv.c lib/strnlen1.h \ - lib/strnlen1.c lib/trim.c lib/u64.c lib/unistd.c \ - $(am__append_2) $(am__append_3) $(am__append_4) \ + lib/getprogname.h lib/getprogname.c lib/gettext.h \ + lib/hard-locale.c lib/hash.c lib/hash-pjw.h lib/hash-pjw.c \ + lib/hash-pjw-bare.h lib/hash-pjw-bare.c lib/imaxtostr.c \ + lib/inttostr.c lib/offtostr.c lib/uinttostr.c lib/umaxtostr.c \ + lib/linebuffer.h lib/linebuffer.c lib/localcharset.h \ + lib/localcharset.c lib/malloca.c lib/math.c lib/mbchar.c \ + lib/mbiter.h lib/mbiter.c lib/mbslen.c lib/mbsstr.c \ + lib/mbuiter.h lib/mbuiter.c lib/minmax.h lib/progname.h \ + lib/progname.c lib/propername.h lib/propername.c \ + lib/quotearg.c lib/size_max.h lib/striconv.h lib/striconv.c \ + lib/strnlen1.h lib/strnlen1.c lib/trim.c lib/u64.c \ + lib/unistd.c $(am__append_2) $(am__append_3) $(am__append_4) \ lib/version-etc.h lib/version-etc.c lib/wctype-h.c \ lib/xmalloc.c lib/xalloc-die.c lib/xstriconv.h lib/xstriconv.c \ lib/xstrndup.h lib/xstrndup.c lib/xstrtol.c lib/xstrtoul.c \ lib/xstrtol-error.c lib/xstrtoumax.c lib_libdatamash_a_LIBADD = $(gl_LIBOBJS) lib_libdatamash_a_DEPENDENCIES = $(gl_LIBOBJS) -EXTRA_lib_libdatamash_a_SOURCES = lib/calloc.c lib/calloc.c \ - lib/stripslash.c lib/error.c lib/expl-table.c lib/expl.c \ - lib/fabsl.c lib/float.c lib/itold.c lib/floor.c lib/fpending.c \ - lib/frexp.c lib/frexp.c lib/frexpl.c lib/getopt.c \ - lib/getopt1.c lib/iconv.c lib/iconv_close.c lib/iconv_open.c \ - lib/anytostr.c lib/isblank.c lib/isnan.c lib/isnand.c \ - lib/isnan.c lib/isnanf.c lib/isnan.c lib/isnanl.c lib/isnan.c \ - lib/isnanl.c lib/iswblank.c lib/ldexpl.c lib/localeconv.c \ - lib/malloc.c lib/mbrtowc.c lib/mbsinit.c lib/mbsrtowcs-state.c \ - lib/mbsrtowcs.c lib/memchr.c lib/msvc-inval.c \ - lib/msvc-nothrow.c lib/random.c lib/random_r.c lib/realloc.c \ - lib/realloc.c lib/round.c lib/round.c lib/roundl.c \ - lib/signbitd.c lib/signbitf.c lib/signbitl.c lib/sqrtl.c \ - lib/strerror.c lib/strerror-override.c lib/strndup.c \ - lib/strnlen.c lib/strsep.c lib/strtol.c lib/strtoul.c \ - lib/strtoull.c lib/strtoimax.c lib/strtoumax.c lib/wcwidth.c +EXTRA_lib_libdatamash_a_SOURCES = lib/calloc.c lib/calloc.c lib/ceil.c \ + lib/ceil.c lib/ceill.c lib/stripslash.c lib/error.c \ + lib/expl-table.c lib/expl.c lib/fabsl.c lib/float.c \ + lib/itold.c lib/floor.c lib/floor.c lib/floorl.c \ + lib/fpending.c lib/frexp.c lib/frexp.c lib/frexpl.c \ + lib/getopt.c lib/getopt1.c lib/iconv.c lib/iconv_close.c \ + lib/iconv_open.c lib/anytostr.c lib/isblank.c lib/isfinite.c \ + lib/isinf.c lib/isnan.c lib/isnand.c lib/isnan.c lib/isnanf.c \ + lib/isnan.c lib/isnanl.c lib/isnan.c lib/isnanl.c \ + lib/iswblank.c lib/ldexpl.c lib/localeconv.c lib/malloc.c \ + lib/mbrtowc.c lib/mbsinit.c lib/mbsrtowcs-state.c \ + lib/mbsrtowcs.c lib/memchr.c lib/modf.c lib/modfl.c \ + lib/msvc-inval.c lib/msvc-nothrow.c lib/random.c \ + lib/random_r.c lib/realloc.c lib/realloc.c lib/round.c \ + lib/round.c lib/roundl.c lib/signbitd.c lib/signbitf.c \ + lib/signbitl.c lib/sqrtl.c lib/stpcpy.c lib/strerror.c \ + lib/strerror-override.c lib/strndup.c lib/strnlen.c \ + lib/strsep.c lib/strtol.c lib/strtoul.c lib/strtoull.c \ + lib/strtoimax.c lib/strtoumax.c lib/trunc.c lib/trunc.c \ + lib/truncl.c lib/wcwidth.c # Use this preprocessor expression to decide whether #include_next works. # Do not rely on a 'configure'-time test for this, since the expression # might appear in an installed header, which is used by some other compiler. HAVE_INCLUDE_NEXT = lib/(__GNUC__ lib/|| lib/60000000 lib/<= lib/__DECC_VER) GPERF = gperf +V_GPERF = $(V_GPERF_@AM_V@) +V_GPERF_ = $(V_GPERF_@AM_DEFAULT_V@) +V_GPERF_0 = @echo " GPERF " $@; charset_alias = $(DESTDIR)$(libdir)/charset.alias charset_tmp = $(DESTDIR)$(libdir)/charset.tmp @@ -1986,9 +2060,17 @@ UNUSED_PARAMETER_H = lib/unused-parameter.h WARN_ON_USE_H = lib/warn-on-use.h info_TEXINFOS = doc/datamash.texi + +# For the 'make html' target - generate a single HTML file +# and embed the CSS statements in it. +AM_MAKEINFOHTMLFLAGS = --no-split \ + --css-include=$(top_srcdir)/doc/datamash-texinfo.css + doc_datamash_TEXINFOS = \ doc/fdl.texi +cyclo_sources = ${top_srcdir}/src/*.[ch] +svweburl = "http://git.savannah.gnu.org/cgit/" gen_start_date = 2011-12-17 all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -2086,11 +2168,15 @@ lib/$(DEPDIR)/$(am__dirstamp) lib/exitfail.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) +lib/getprogname.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) lib/hard-locale.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) lib/hash.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) lib/hash-pjw.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) +lib/hash-pjw-bare.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) lib/imaxtostr.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) lib/inttostr.$(OBJEXT): lib/$(am__dirstamp) \ @@ -2174,6 +2260,8 @@ lib/$(DEPDIR)/$(am__dirstamp) lib/calloc.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) +lib/ceil.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/ceill.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) lib/error.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) lib/expl-table.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) @@ -2182,6 +2270,8 @@ lib/float.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) lib/itold.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) lib/floor.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/floorl.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) lib/fpending.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) lib/frexp.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) @@ -2200,6 +2290,9 @@ lib/$(DEPDIR)/$(am__dirstamp) lib/isblank.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) +lib/isfinite.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/isinf.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) lib/isnan.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) lib/isnand.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) @@ -2225,6 +2318,8 @@ lib/$(DEPDIR)/$(am__dirstamp) lib/memchr.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) +lib/modf.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/modfl.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) lib/msvc-inval.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) lib/msvc-nothrow.$(OBJEXT): lib/$(am__dirstamp) \ @@ -2245,6 +2340,8 @@ lib/signbitl.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) lib/sqrtl.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/stpcpy.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) lib/strerror.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) lib/strerror-override.$(OBJEXT): lib/$(am__dirstamp) \ @@ -2265,6 +2362,9 @@ lib/$(DEPDIR)/$(am__dirstamp) lib/strtoumax.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) +lib/trunc.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/truncl.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) lib/wcwidth.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) @@ -2328,9 +2428,15 @@ src/$(DEPDIR)/$(am__dirstamp) src/datamash-column-headers.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) +src/datamash-op-defs.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/datamash-op-scanner.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) +src/datamash-op-parser.$(OBJEXT): src/$(am__dirstamp) \ + src/$(DEPDIR)/$(am__dirstamp) src/datamash-field-ops.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) -src/datamash-strcnt.$(OBJEXT): src/$(am__dirstamp) \ +src/datamash-crosstab.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) src/datamash-datamash.$(OBJEXT): src/$(am__dirstamp) \ src/$(DEPDIR)/$(am__dirstamp) @@ -2358,6 +2464,8 @@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/c-strcasecmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/c-strncasecmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/calloc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/ceil.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/ceill.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/close-stream.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/closeout.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/dirname-lgpl.Po@am__quote@ @@ -2369,12 +2477,15 @@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fabsl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/float.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/floor.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/floorl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fpending.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/frexp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/frexpl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/getopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/getopt1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/getprogname.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/hard-locale.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/hash-pjw-bare.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/hash-pjw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/hash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/iconv.Po@am__quote@ @@ -2383,6 +2494,8 @@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/imaxtostr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/inttostr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/isblank.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/isfinite.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/isinf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/isnan.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/isnand.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/isnanf.Po@am__quote@ @@ -2407,6 +2520,8 @@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/mbuiter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/md5.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/memchr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/modf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/modfl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/msvc-inval.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/msvc-nothrow.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/offtostr.Po@am__quote@ @@ -2425,6 +2540,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/signbitf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/signbitl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/sqrtl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/stpcpy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strerror-override.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strerror.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/striconv.Po@am__quote@ @@ -2439,6 +2555,8 @@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strtoull.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strtoumax.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/trim.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/trunc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/truncl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/u64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/uinttostr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/umaxtostr.Po@am__quote@ @@ -2459,9 +2577,12 @@ @AMDEP_TRUE@@am__include@ @am__quote@lib/unistr/$(DEPDIR)/u8-uctomb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lib/uniwidth/$(DEPDIR)/width.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/datamash-column-headers.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/datamash-crosstab.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/datamash-datamash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/datamash-field-ops.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/datamash-strcnt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/datamash-op-defs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/datamash-op-parser.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/datamash-op-scanner.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/datamash-text-lines.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/datamash-text-options.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/datamash-utils.Po@am__quote@ @@ -2538,6 +2659,48 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(datamash_CFLAGS) $(CFLAGS) -c -o src/datamash-column-headers.obj `if test -f 'src/column-headers.c'; then $(CYGPATH_W) 'src/column-headers.c'; else $(CYGPATH_W) '$(srcdir)/src/column-headers.c'; fi` +src/datamash-op-defs.o: src/op-defs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(datamash_CFLAGS) $(CFLAGS) -MT src/datamash-op-defs.o -MD -MP -MF src/$(DEPDIR)/datamash-op-defs.Tpo -c -o src/datamash-op-defs.o `test -f 'src/op-defs.c' || echo '$(srcdir)/'`src/op-defs.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/datamash-op-defs.Tpo src/$(DEPDIR)/datamash-op-defs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/op-defs.c' object='src/datamash-op-defs.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(datamash_CFLAGS) $(CFLAGS) -c -o src/datamash-op-defs.o `test -f 'src/op-defs.c' || echo '$(srcdir)/'`src/op-defs.c + +src/datamash-op-defs.obj: src/op-defs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(datamash_CFLAGS) $(CFLAGS) -MT src/datamash-op-defs.obj -MD -MP -MF src/$(DEPDIR)/datamash-op-defs.Tpo -c -o src/datamash-op-defs.obj `if test -f 'src/op-defs.c'; then $(CYGPATH_W) 'src/op-defs.c'; else $(CYGPATH_W) '$(srcdir)/src/op-defs.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/datamash-op-defs.Tpo src/$(DEPDIR)/datamash-op-defs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/op-defs.c' object='src/datamash-op-defs.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(datamash_CFLAGS) $(CFLAGS) -c -o src/datamash-op-defs.obj `if test -f 'src/op-defs.c'; then $(CYGPATH_W) 'src/op-defs.c'; else $(CYGPATH_W) '$(srcdir)/src/op-defs.c'; fi` + +src/datamash-op-scanner.o: src/op-scanner.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(datamash_CFLAGS) $(CFLAGS) -MT src/datamash-op-scanner.o -MD -MP -MF src/$(DEPDIR)/datamash-op-scanner.Tpo -c -o src/datamash-op-scanner.o `test -f 'src/op-scanner.c' || echo '$(srcdir)/'`src/op-scanner.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/datamash-op-scanner.Tpo src/$(DEPDIR)/datamash-op-scanner.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/op-scanner.c' object='src/datamash-op-scanner.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(datamash_CFLAGS) $(CFLAGS) -c -o src/datamash-op-scanner.o `test -f 'src/op-scanner.c' || echo '$(srcdir)/'`src/op-scanner.c + +src/datamash-op-scanner.obj: src/op-scanner.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(datamash_CFLAGS) $(CFLAGS) -MT src/datamash-op-scanner.obj -MD -MP -MF src/$(DEPDIR)/datamash-op-scanner.Tpo -c -o src/datamash-op-scanner.obj `if test -f 'src/op-scanner.c'; then $(CYGPATH_W) 'src/op-scanner.c'; else $(CYGPATH_W) '$(srcdir)/src/op-scanner.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/datamash-op-scanner.Tpo src/$(DEPDIR)/datamash-op-scanner.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/op-scanner.c' object='src/datamash-op-scanner.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(datamash_CFLAGS) $(CFLAGS) -c -o src/datamash-op-scanner.obj `if test -f 'src/op-scanner.c'; then $(CYGPATH_W) 'src/op-scanner.c'; else $(CYGPATH_W) '$(srcdir)/src/op-scanner.c'; fi` + +src/datamash-op-parser.o: src/op-parser.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(datamash_CFLAGS) $(CFLAGS) -MT src/datamash-op-parser.o -MD -MP -MF src/$(DEPDIR)/datamash-op-parser.Tpo -c -o src/datamash-op-parser.o `test -f 'src/op-parser.c' || echo '$(srcdir)/'`src/op-parser.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/datamash-op-parser.Tpo src/$(DEPDIR)/datamash-op-parser.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/op-parser.c' object='src/datamash-op-parser.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(datamash_CFLAGS) $(CFLAGS) -c -o src/datamash-op-parser.o `test -f 'src/op-parser.c' || echo '$(srcdir)/'`src/op-parser.c + +src/datamash-op-parser.obj: src/op-parser.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(datamash_CFLAGS) $(CFLAGS) -MT src/datamash-op-parser.obj -MD -MP -MF src/$(DEPDIR)/datamash-op-parser.Tpo -c -o src/datamash-op-parser.obj `if test -f 'src/op-parser.c'; then $(CYGPATH_W) 'src/op-parser.c'; else $(CYGPATH_W) '$(srcdir)/src/op-parser.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/datamash-op-parser.Tpo src/$(DEPDIR)/datamash-op-parser.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/op-parser.c' object='src/datamash-op-parser.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(datamash_CFLAGS) $(CFLAGS) -c -o src/datamash-op-parser.obj `if test -f 'src/op-parser.c'; then $(CYGPATH_W) 'src/op-parser.c'; else $(CYGPATH_W) '$(srcdir)/src/op-parser.c'; fi` + src/datamash-field-ops.o: src/field-ops.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(datamash_CFLAGS) $(CFLAGS) -MT src/datamash-field-ops.o -MD -MP -MF src/$(DEPDIR)/datamash-field-ops.Tpo -c -o src/datamash-field-ops.o `test -f 'src/field-ops.c' || echo '$(srcdir)/'`src/field-ops.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/datamash-field-ops.Tpo src/$(DEPDIR)/datamash-field-ops.Po @@ -2552,19 +2715,19 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(datamash_CFLAGS) $(CFLAGS) -c -o src/datamash-field-ops.obj `if test -f 'src/field-ops.c'; then $(CYGPATH_W) 'src/field-ops.c'; else $(CYGPATH_W) '$(srcdir)/src/field-ops.c'; fi` -src/datamash-strcnt.o: src/strcnt.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(datamash_CFLAGS) $(CFLAGS) -MT src/datamash-strcnt.o -MD -MP -MF src/$(DEPDIR)/datamash-strcnt.Tpo -c -o src/datamash-strcnt.o `test -f 'src/strcnt.c' || echo '$(srcdir)/'`src/strcnt.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/datamash-strcnt.Tpo src/$(DEPDIR)/datamash-strcnt.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/strcnt.c' object='src/datamash-strcnt.o' libtool=no @AMDEPBACKSLASH@ +src/datamash-crosstab.o: src/crosstab.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(datamash_CFLAGS) $(CFLAGS) -MT src/datamash-crosstab.o -MD -MP -MF src/$(DEPDIR)/datamash-crosstab.Tpo -c -o src/datamash-crosstab.o `test -f 'src/crosstab.c' || echo '$(srcdir)/'`src/crosstab.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/datamash-crosstab.Tpo src/$(DEPDIR)/datamash-crosstab.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/crosstab.c' object='src/datamash-crosstab.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(datamash_CFLAGS) $(CFLAGS) -c -o src/datamash-strcnt.o `test -f 'src/strcnt.c' || echo '$(srcdir)/'`src/strcnt.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(datamash_CFLAGS) $(CFLAGS) -c -o src/datamash-crosstab.o `test -f 'src/crosstab.c' || echo '$(srcdir)/'`src/crosstab.c -src/datamash-strcnt.obj: src/strcnt.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(datamash_CFLAGS) $(CFLAGS) -MT src/datamash-strcnt.obj -MD -MP -MF src/$(DEPDIR)/datamash-strcnt.Tpo -c -o src/datamash-strcnt.obj `if test -f 'src/strcnt.c'; then $(CYGPATH_W) 'src/strcnt.c'; else $(CYGPATH_W) '$(srcdir)/src/strcnt.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/datamash-strcnt.Tpo src/$(DEPDIR)/datamash-strcnt.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/strcnt.c' object='src/datamash-strcnt.obj' libtool=no @AMDEPBACKSLASH@ +src/datamash-crosstab.obj: src/crosstab.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(datamash_CFLAGS) $(CFLAGS) -MT src/datamash-crosstab.obj -MD -MP -MF src/$(DEPDIR)/datamash-crosstab.Tpo -c -o src/datamash-crosstab.obj `if test -f 'src/crosstab.c'; then $(CYGPATH_W) 'src/crosstab.c'; else $(CYGPATH_W) '$(srcdir)/src/crosstab.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/$(DEPDIR)/datamash-crosstab.Tpo src/$(DEPDIR)/datamash-crosstab.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/crosstab.c' object='src/datamash-crosstab.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(datamash_CFLAGS) $(CFLAGS) -c -o src/datamash-strcnt.obj `if test -f 'src/strcnt.c'; then $(CYGPATH_W) 'src/strcnt.c'; else $(CYGPATH_W) '$(srcdir)/src/strcnt.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(datamash_CFLAGS) $(CFLAGS) -c -o src/datamash-crosstab.obj `if test -f 'src/crosstab.c'; then $(CYGPATH_W) 'src/crosstab.c'; else $(CYGPATH_W) '$(srcdir)/src/crosstab.c'; fi` src/datamash-datamash.o: src/datamash.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(datamash_CFLAGS) $(CFLAGS) -MT src/datamash-datamash.o -MD -MP -MF src/$(DEPDIR)/datamash-datamash.Tpo -c -o src/datamash-datamash.o `test -f 'src/datamash.c' || echo '$(srcdir)/'`src/datamash.c @@ -2782,6 +2945,27 @@ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) +install-dist_bashcompletionDATA: $(dist_bashcompletion_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_bashcompletion_DATA)'; test -n "$(bashcompletiondir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bashcompletiondir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bashcompletiondir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(bashcompletiondir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(bashcompletiondir)" || exit $$?; \ + done + +uninstall-dist_bashcompletionDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_bashcompletion_DATA)'; test -n "$(bashcompletiondir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(bashcompletiondir)'; $(am__uninstall_files_from_dir) install-dist_examplesDATA: $(dist_examples_DATA) @$(NORMAL_INSTALL) @list='$(dist_examples_DATA)'; test -n "$(examplesdir)" || list=; \ @@ -3279,7 +3463,7 @@ config.h all-local installdirs: installdirs-recursive installdirs-am: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(examplesdir)"; do \ + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(infodir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(bashcompletiondir)" "$(DESTDIR)$(examplesdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) @@ -3353,7 +3537,8 @@ info-am: $(INFO_DEPS) -install-data-am: install-dist_examplesDATA install-info-am install-man +install-data-am: install-dist_bashcompletionDATA \ + install-dist_examplesDATA install-info-am install-man install-dvi: install-dvi-recursive @@ -3493,9 +3678,10 @@ ps-am: $(PSS) -uninstall-am: uninstall-binPROGRAMS uninstall-dist_examplesDATA \ - uninstall-dvi-am uninstall-html-am uninstall-info-am \ - uninstall-local uninstall-man uninstall-pdf-am uninstall-ps-am +uninstall-am: uninstall-binPROGRAMS uninstall-dist_bashcompletionDATA \ + uninstall-dist_examplesDATA uninstall-dvi-am uninstall-html-am \ + uninstall-info-am uninstall-local uninstall-man \ + uninstall-pdf-am uninstall-ps-am uninstall-man: uninstall-man1 @@ -3512,10 +3698,11 @@ distclean-local distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ - install-data-am install-dist_examplesDATA install-dvi \ - install-dvi-am install-exec install-exec-am install-exec-local \ - install-html install-html-am install-info install-info-am \ - install-man install-man1 install-pdf install-pdf-am install-ps \ + install-data-am install-dist_bashcompletionDATA \ + install-dist_examplesDATA install-dvi install-dvi-am \ + install-exec install-exec-am install-exec-local install-html \ + install-html-am install-info install-info-am install-man \ + install-man1 install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-aminfo maintainer-clean-generic \ @@ -3523,9 +3710,10 @@ mostlyclean-compile mostlyclean-generic mostlyclean-local \ mostlyclean-vti pdf pdf-am ps ps-am recheck tags tags-am \ uninstall uninstall-am uninstall-binPROGRAMS \ - uninstall-dist_examplesDATA uninstall-dvi-am uninstall-html-am \ - uninstall-info-am uninstall-local uninstall-man uninstall-man1 \ - uninstall-pdf-am uninstall-ps-am + uninstall-dist_bashcompletionDATA uninstall-dist_examplesDATA \ + uninstall-dvi-am uninstall-html-am uninstall-info-am \ + uninstall-local uninstall-man uninstall-man1 uninstall-pdf-am \ + uninstall-ps-am @BUILD_FROM_GIT_TRUE@datamash.1: datamash $(top_srcdir)/man/datamash.x @@ -3713,19 +3901,19 @@ @GL_GENERATE_ICONV_H_FALSE@ rm -f $@ lib/iconv_open-aix.h: lib/iconv_open-aix.gperf - $(GPERF) -m 10 $(top_srcdir)/lib/iconv_open-aix.gperf > $(top_srcdir)/lib/iconv_open-aix.h-t + $(V_GPERF)$(GPERF) -m 10 $(top_srcdir)/lib/iconv_open-aix.gperf > $(top_srcdir)/lib/iconv_open-aix.h-t && \ mv $(top_srcdir)/lib/iconv_open-aix.h-t $(top_srcdir)/lib/iconv_open-aix.h lib/iconv_open-hpux.h: lib/iconv_open-hpux.gperf - $(GPERF) -m 10 $(top_srcdir)/lib/iconv_open-hpux.gperf > $(top_srcdir)/lib/iconv_open-hpux.h-t + $(V_GPERF)$(GPERF) -m 10 $(top_srcdir)/lib/iconv_open-hpux.gperf > $(top_srcdir)/lib/iconv_open-hpux.h-t && \ mv $(top_srcdir)/lib/iconv_open-hpux.h-t $(top_srcdir)/lib/iconv_open-hpux.h lib/iconv_open-irix.h: lib/iconv_open-irix.gperf - $(GPERF) -m 10 $(top_srcdir)/lib/iconv_open-irix.gperf > $(top_srcdir)/lib/iconv_open-irix.h-t + $(V_GPERF)$(GPERF) -m 10 $(top_srcdir)/lib/iconv_open-irix.gperf > $(top_srcdir)/lib/iconv_open-irix.h-t && \ mv $(top_srcdir)/lib/iconv_open-irix.h-t $(top_srcdir)/lib/iconv_open-irix.h lib/iconv_open-osf.h: lib/iconv_open-osf.gperf - $(GPERF) -m 10 $(top_srcdir)/lib/iconv_open-osf.gperf > $(top_srcdir)/lib/iconv_open-osf.h-t + $(V_GPERF)$(GPERF) -m 10 $(top_srcdir)/lib/iconv_open-osf.gperf > $(top_srcdir)/lib/iconv_open-osf.h-t && \ mv $(top_srcdir)/lib/iconv_open-osf.h-t $(top_srcdir)/lib/iconv_open-osf.h lib/iconv_open-solaris.h: lib/iconv_open-solaris.gperf - $(GPERF) -m 10 $(top_srcdir)/lib/iconv_open-solaris.gperf > $(top_srcdir)/lib/iconv_open-solaris.h-t + $(V_GPERF)$(GPERF) -m 10 $(top_srcdir)/lib/iconv_open-solaris.gperf > $(top_srcdir)/lib/iconv_open-solaris.h-t && \ mv $(top_srcdir)/lib/iconv_open-solaris.h-t $(top_srcdir)/lib/iconv_open-solaris.h # We need the following in order to create when the system @@ -3764,6 +3952,22 @@ } > $@-t && \ mv $@-t $@ +# We need the following in order to create when the system +# doesn't have one that is compatible with GNU. +@GL_GENERATE_LIMITS_H_TRUE@lib/limits.h: lib/limits.in.h $(top_builddir)/config.status +@GL_GENERATE_LIMITS_H_TRUE@ $(AM_V_GEN)rm -f $@-t $@ && \ +@GL_GENERATE_LIMITS_H_TRUE@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ +@GL_GENERATE_LIMITS_H_TRUE@ sed -e 's|@''GUARD_PREFIX''@|GL|g' \ +@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ +@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ +@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ +@GL_GENERATE_LIMITS_H_TRUE@ -e 's|@''NEXT_LIMITS_H''@|$(NEXT_LIMITS_H)|g' \ +@GL_GENERATE_LIMITS_H_TRUE@ < $(top_srcdir)/lib/limits.in.h; \ +@GL_GENERATE_LIMITS_H_TRUE@ } > $@-t && \ +@GL_GENERATE_LIMITS_H_TRUE@ mv $@-t $@ +@GL_GENERATE_LIMITS_H_FALSE@lib/limits.h: $(top_builddir)/config.status +@GL_GENERATE_LIMITS_H_FALSE@ rm -f $@ + # We need the following in order to install a simple file in $(libdir) # which is shared with other installed packages. We use a list of referencing # packages so that "make uninstall" will remove the file if and only if it @@ -4055,11 +4259,18 @@ -e 's|@''HAVE_DECL_TRUNCF''@|$(HAVE_DECL_TRUNCF)|g' \ -e 's|@''HAVE_DECL_TRUNCL''@|$(HAVE_DECL_TRUNCL)|g' \ | \ - sed -e 's|@''REPLACE_CBRTF''@|$(REPLACE_CBRTF)|g' \ + sed -e 's|@''REPLACE_ACOSF''@|$(REPLACE_ACOSF)|g' \ + -e 's|@''REPLACE_ASINF''@|$(REPLACE_ASINF)|g' \ + -e 's|@''REPLACE_ATANF''@|$(REPLACE_ATANF)|g' \ + -e 's|@''REPLACE_ATAN2F''@|$(REPLACE_ATAN2F)|g' \ + -e 's|@''REPLACE_CBRTF''@|$(REPLACE_CBRTF)|g' \ -e 's|@''REPLACE_CBRTL''@|$(REPLACE_CBRTL)|g' \ -e 's|@''REPLACE_CEIL''@|$(REPLACE_CEIL)|g' \ -e 's|@''REPLACE_CEILF''@|$(REPLACE_CEILF)|g' \ -e 's|@''REPLACE_CEILL''@|$(REPLACE_CEILL)|g' \ + -e 's|@''REPLACE_COSF''@|$(REPLACE_COSF)|g' \ + -e 's|@''REPLACE_COSHF''@|$(REPLACE_COSHF)|g' \ + -e 's|@''REPLACE_EXPF''@|$(REPLACE_EXPF)|g' \ -e 's|@''REPLACE_EXPM1''@|$(REPLACE_EXPM1)|g' \ -e 's|@''REPLACE_EXPM1F''@|$(REPLACE_EXPM1F)|g' \ -e 's|@''REPLACE_EXP2''@|$(REPLACE_EXP2)|g' \ @@ -4115,7 +4326,12 @@ -e 's|@''REPLACE_ROUNDL''@|$(REPLACE_ROUNDL)|g' \ -e 's|@''REPLACE_SIGNBIT''@|$(REPLACE_SIGNBIT)|g' \ -e 's|@''REPLACE_SIGNBIT_USING_GCC''@|$(REPLACE_SIGNBIT_USING_GCC)|g' \ + -e 's|@''REPLACE_SINF''@|$(REPLACE_SINF)|g' \ + -e 's|@''REPLACE_SINHF''@|$(REPLACE_SINHF)|g' \ + -e 's|@''REPLACE_SQRTF''@|$(REPLACE_SQRTF)|g' \ -e 's|@''REPLACE_SQRTL''@|$(REPLACE_SQRTL)|g' \ + -e 's|@''REPLACE_TANF''@|$(REPLACE_TANF)|g' \ + -e 's|@''REPLACE_TANHF''@|$(REPLACE_TANHF)|g' \ -e 's|@''REPLACE_TRUNC''@|$(REPLACE_TRUNC)|g' \ -e 's|@''REPLACE_TRUNCF''@|$(REPLACE_TRUNCF)|g' \ -e 's|@''REPLACE_TRUNCL''@|$(REPLACE_TRUNCL)|g' \ @@ -4228,6 +4444,7 @@ @GL_GENERATE_STDINT_H_TRUE@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_C99_STDINT_H''@/$(HAVE_C99_STDINT_H)/g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \ @@ -4249,6 +4466,7 @@ @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \ @GL_GENERATE_STDINT_H_TRUE@ -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \ +@GL_GENERATE_STDINT_H_TRUE@ -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \ @GL_GENERATE_STDINT_H_TRUE@ < $(top_srcdir)/lib/stdint.in.h; \ @GL_GENERATE_STDINT_H_TRUE@ } > $@-t && \ @GL_GENERATE_STDINT_H_TRUE@ mv $@-t $@ @@ -4433,6 +4651,7 @@ -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \ -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \ -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \ + -e 's|@''HAVE_QSORT_R''@|$(HAVE_QSORT_R)|g' \ -e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \ -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \ -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \ @@ -4664,7 +4883,6 @@ -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \ -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \ -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ - -e 's|@''HAVE_GETLOGIN''@|$(HAVE_GETLOGIN)|g' \ -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \ -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \ @@ -4686,6 +4904,7 @@ -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \ -e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \ -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \ + -e 's|@''HAVE_DECL_GETLOGIN''@|$(HAVE_DECL_GETLOGIN)|g' \ -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \ -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \ -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \ @@ -4766,6 +4985,7 @@ -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \ -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \ -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \ + -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \ -e 's/@''GNULIB_BTOWC''@/$(GNULIB_BTOWC)/g' \ -e 's/@''GNULIB_WCTOB''@/$(GNULIB_WCTOB)/g' \ -e 's/@''GNULIB_MBSINIT''@/$(GNULIB_MBSINIT)/g' \ @@ -4877,6 +5097,7 @@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \ + -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \ -e 's/@''GNULIB_ISWBLANK''@/$(GNULIB_ISWBLANK)/g' \ -e 's/@''GNULIB_WCTYPE''@/$(GNULIB_WCTYPE)/g' \ -e 's/@''GNULIB_ISWCTYPE''@/$(GNULIB_ISWCTYPE)/g' \ @@ -4908,6 +5129,21 @@ dist-hook: $(noinst_LIBRARIES) .PHONY: dist-hook +# Changes to the CSS should trigger a new HTML regeneration +$(top_builddir)/doc/datamash.html: $(top_srcdir)/doc/datamash-texinfo.css + +cyclo-$(PACKAGE).html: $(cyclo_sources) + $(PMCCABE) $(cyclo_sources) \ + | sort -nr \ + | $(AWK) -f ${top_srcdir}/build-aux/pmccabe2html \ + -v lang=html -v name="$(PACKAGE_NAME)" \ + -v vcurl="$(svweburl)/$(PACKAGE).git/tree/%FILENAME%" \ + -v url="http://www.gnu.org/software/$(PACKAGE)/" \ + -v css=${top_srcdir}/build-aux/pmccabe.css \ + -v cut_dir=${top_srcdir}/ \ + > $@-tmp + mv $@-tmp $@ + dist-hook: gen-ChangeLog $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version .PHONY: gen-ChangeLog diff -Nru datamash-1.0.7/man/datamash.x datamash-1.1.1/man/datamash.x --- datamash-1.0.7/man/datamash.x 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/man/datamash.x 2017-01-17 17:50:20.000000000 +0000 @@ -1,3 +1,5 @@ +." GNU Datamash - manual page +." Copyright (C) 2014-2017 Assaf Gordon [NAME] datamash - command-line calculations @@ -5,119 +7,190 @@ .PP .SH AVAILABLE OPERATIONS .PP -.SS File operations: + +.SS "Primary Operations" +Primary operations affect the way the file is processed. If used, the +primary operation must be listed first. Some operations require field +numbers (groupby, crosstab) while others do not (reverse,check,transpose). +If primary operation is not listed the entire file is processed - +either line-by-line (for 'per-line' operations) or all lines as one group +(for grouping operations). See Examples section below. +.PP + .TP "\w'\fBcountunique\fR'u+1n" +.B groupby X,Y,... op fld ... +group the file by given fields. Equivalent to option '\-g'. +For each group perform operation \fBop\fR on field \fBfld\fR. + +.TP +.B crosstab X,Y [op fld ...] +cross-tabulate a file by two fields (cross-tabulation is also known +as pivot tables). If no operation is specified, counts how many incidents +exist of X,Y. + +.TP .B transpose transpose rows, columns of the input file + .TP .B reverse reverse field order in each line + +.TP +.B check +verify the input file has same number of fields in all lines. +number of lines and fields are printed to STDOUT. Exits with non-zero code +and prints the offending line if there's a mismatch in the number of fields. .PP -.SS Line-Filtering operations: + + +.SS "Line-Filtering operations" + .TP "\w'\fBcountunique\fR'u+1n" .B rmdup remove lines with duplicated key value .PP -.SS Per-Line operations: + +.SS "Per-Line operations" + .TP "\w'\fBcountunique\fR'u+1n" .B base64 Encode the field as base64 + .TP .B debase64 Decode the field as base64, exit with error if invalid base64 string + .TP .B md5/sha1/sha256/sha512 Calculate md5/sha1/sha256/sha512 hash of the field value + .TP -.B reverse -reverse field order in each line +.B bin[:BUCKET-SIZE] +bin numeric values into buckets of size \fBBUCKET-SIZE\fR (defaults to 100). + +.TP +.B strbin[:BUCKET-SIZE] +hashes the input and returns a numeric integer value between zero and +\fBBUCKET-SIZE\fB (defaults to 10). + +.TP +.B round/floor/ceil/trunc/frac +numeric rounding operations. round (round half away from zero), +floor (round up), ceil (ceiling, round down), trunc (truncate, round towards +zero), frac (fraction, return fraction part of a decimal-point value). .PP -.SS Numeric Grouping operations + + +.SS "Numeric Grouping operations" + .TP "\w'\fBcountunique\fR'u+1n" .B sum sum the of values + .TP .B min minimum value + .TP .B max maximum value + .TP .B absmin minimum of the absolute values + .TP .B absmax maximum of the absolute values .PP -.SS Textual/Numeric Grouping operations + +.SS "Textual/Numeric Grouping operations" + .TP "\w'\fBcountunique\fR'u+1n" .B count count number of elements in the group + .TP .B first the first value of the group + .TP .B last the last value of the group + .TP .B rand one random value from the group + .TP .B unique comma-separated sorted list of unique values + .TP .B collapse comma-separated list of all input values + .TP .B countunique number of unique/distinct values .PP -.SS Statistical Grouping operations + + +.SS "Statistical Grouping operations" +A \fBp/s\fR prefix indicates the varient: \fBp\fRopulation or \fBs\fRample. +Typically, the \fBs\fRample variant is equivalent with \fBGNU R\fR's +internal functions (e.g datamash's \fBsstdev\fR operation is equivalent +to R's \fBsd()\fR function). +.PP + .TP "\w'\fBcountunique\fR'u+1n" .B mean mean of the values + .TP .B median median value + .TP .B q1 1st quartile value + .TP .B q3 3rd quartile value + .TP .B iqr inter-quartile range + .TP .B mode mode value (most common value) + .TP .B antimode anti-mode value (least common value) + .TP -.B pstdev -population standard deviation -.TP -.B sstdev -sample standard deviation -.TP -.B pvar -population variance +.B pstdev/sstdev +population/sample standard deviation + .TP -.B svar -sample variance +.B pvar/svar +population/sample variance + .TP .B mad median absolute deviation, scaled by constant 1.4826 for normal distributions + .TP .B madraw median absolute deviation, unscaled + .TP -.B sskew -skewness of the (sample) group -.TP -.B pskew -skewness of the (population) group +.B pskew/sskew +skewness of the group values x reported by 'sskew' and 'pskew' operations: .nf x > 0 - positively skewed / skewed right @@ -128,26 +201,35 @@ \-0.5 > x > \-1 - moderately skewed left \-1 > x - highly skewed left .fi + .TP -.B skurt -excess Kurtosis of the (sample) group -.TP -.B pkurt -excess Kurtosis of the (population) group -.TP -.B jarque -p-value of the Jarque-Beta test for normality +.B pkurt/skurt +excess Kurtosis of the group + .TP -.B dpo -p-value of the D'Agostino-Pearson Omnibus test for normality; - for 'jarque' and 'dpo' operations: +.B jarque/dpo +p-value of the Jarque-Beta (\fBjarque\fR) and D'Agostino-Pearson Omnibus +(\fBdpo\fR) tests for normality: null hypothesis is normality; low p-Values indicate non-normal data; high p-Values indicate null-hypothesis cannot be rejected. +.TP +.B pcov/scov [X:Y] +covariance of fields X and Y + +.TP +.B ppearson/spearson [X:Y] +Pearson product-moment correlation coefficient [Pearson's R] +of fields X and Y + + + [=EXAMPLES] -Print the sum and the mean of values from column 1: +.SS "Basic usage" + +Print the sum and the mean of values from field 1: .PP .nf .RS @@ -165,12 +247,18 @@ A 5 B 9 B 11 + $ \fBdatamash\fR \-g 1 sum 2 < example.txt A 15 B 20 + +$ \fBdatamash\fR groupby 1 sum 2 < example.txt +A 15 +B 20 .RE .fi .PP + Unsorted input must be sorted (with '\-s'): .PP .nf @@ -182,6 +270,7 @@ C 1 A 5 B 11 + $ \fBdatamash\fR \-s \-g1 sum 2 < example.txt A 15 B 20 @@ -189,6 +278,7 @@ .RE .fi .PP + Which is equivalent to: .PP .nf @@ -196,6 +286,10 @@ $ cat example.txt | sort \-k1,1 | \fBdatamash\fR \-g 1 sum 2 .RE .fi + + + +.SS "Header lines" .PP Use \fB\-h\fR \fB(\-\-headers)\fR if the input file has a header line: .PP @@ -211,9 +305,13 @@ # Calculate the mean and standard devian for each major $ \fBdatamash\fR \-\-sort \-\-headers \-\-group 2 mean 3 pstdev 3 < scores_h.txt + (or use short form) + $ \fBdatamash\fR \-sH \-g2 mean 3 pstdev 3 < scores_h.txt - (or use named columns) + + (or use named fields) + $ \fBdatamash\fR \-sH \-g Major mean Score pstdev Score < scores_h.txt GroupBy(Major) mean(Score) pstdev(Score) Arts 68.9 10.1 @@ -225,7 +323,59 @@ .RE .fi .PP -Reverse field order in each line: + + +.SS "Multiple fields" + +Use comma or dash to specify multiple fields. The following are equivalent: +.nf +.RS +$ seq 9 | paste \- \- \- +1 2 3 +4 5 6 +7 8 9 + +$ seq 9 | paste \- \- \- | datamash sum 1 sum 2 sum 3 +12 15 18 + +$ seq 9 | paste \- \- \- | datamash sum 1,2,3 +12 15 18 + +$ seq 9 | paste \- \- \- | datamash sum 1-3 +12 15 18 +.RE +.fi +.PP + + +.SS "Rounding" +The following demonstrate the different rounding operations: +.nf +.RS +.RE +.\" NOTE: The weird spacing/alignment is due to extract backslash +.\" characters. Modify with caution. +$ ( echo X ; seq \-1.25 0.25 1.25 ) \\ + | datamash \-\-full \-H round 1 ceil 1 floor 1 trunc 1 frac 1 + + X round(X) ceil(X) floor(X) trunc(X) frac(X) +\-1.25 \-1 \-1 \-2 \-1 \-0.25 +\-1.00 \-1 \-1 \-1 \-1 0 +\-0.75 \-1 0 \-1 0 \-0.75 +\-0.50 \-1 0 \-1 0 \-0.5 +\-0.25 0 0 \-1 0 \-0.25 + 0.00 0 0 0 0 0 + 0.25 0 1 0 0 0.25 + 0.50 1 1 0 0 0.5 + 0.75 1 1 0 0 0.75 + 1.00 1 1 1 1 0 + 1.25 1 2 1 1 0.25 +.fi +.PP + + + +.SS "Reversing fields" .PP .nf .RS @@ -236,7 +386,10 @@ .RE .fi .PP -Transpose rows, columns: + + + +.SS "Transposing a file" .PP .nf .RS @@ -246,7 +399,11 @@ .RE .fi .PP -Remove lines with duplicate key value from column 1 + + + +.SS "Removing Duplicated lines" +Remove lines with duplicate key value from field 1 (Unlike \fBfirst\fR,\fBlast\fR operations, \fBrmdup\fR is much faster and does not require sorting the file with \-s): .PP @@ -261,9 +418,10 @@ 2 ee.txt 3 ff.txt -# Remove lines with duplicated Sample-ID (column 1): +# Remove lines with duplicated Sample-ID (field 1): $ \fBdatamash\fR rmdup 1 < INPUT - (or used named column) + +# or use named field: $ \fBdatamash\fR \-H rmdup SampleID < INPUT SampleID File 2 cc.txt @@ -272,6 +430,9 @@ .RE .fi .PP + + +.SS "Checksums" Calculate the sha1 hash value of each TXT file, after calculating the sha1 value of each file's content: .PP @@ -281,6 +442,140 @@ .RE .fi .PP + + +.SS "Check file structure" +Check the structure of the input file (ensure all lines +have the same number of fields): +.PP +.nf +.RS +$ seq 10 | paste \- \- | datamash check && echo ok || echo fail +5 lines, 2 fields +ok + +$ seq 13 | paste \- \- \- | datamash check && echo ok || echo fail +line 4 (3 fields): + 10 11 12 +line 5 (2 fields): + 13 +datamash: check failed: line 5 has 2 fields (previous line had 3) +fail +.RE +.fi +.PP + + + +.SS "Cross-Tabulation" +Cross-tabulation compares the relationship between two fields. +Given the following input file: +.nf +.RS +$ cat input.txt +a x 3 +a y 7 +b x 21 +a x 40 +.RE +.fi +.PP +Show cross-tabulation between the first field (a/b) and the second field +(x/y) - counting how many times each pair appears (note: sorting is required): +.PP +.nf +.RS +$ \fBdatamash\fR \-s crosstab 1,2 < input.txt + x y +a 2 1 +b 1 N/A +.RE +.fi +.PP +An optional grouping operation can be used instead of counting: +.PP +.nf +.RS +.PP +$ \fBdatamash\fR \-s crosstab 1,2 sum 3 < input.txt + x y +a 43 7 +b 21 N/A + +$ \fBdatamash\fR \-s crosstab 1,2 unique 3 < input.txt + x y +a 3,40 7 +b 21 N/A +.RE +.fi +.PP + + +.SS "Binning numeric values" +Bin input values into buckets of size 5: +.PP +.nf +.RS +$ ( echo X ; seq \-10 2.5 10 ) \\ + | \fBdatamash\fR \-H \-\-full bin:5 1 + X bin(X) +\-10.0 \-15 + \-7.5 \-10 + \-5.0 \-10 + \-2.5 \-5 + 0.0 0 + 2.5 0 + 5.0 5 + 7.5 5 + 10.0 10 +.RE +.fi +.PP + + +.SS "Binning string values" +Hash any input value into a numeric integer. +A typical usage would be to split an input file +into N chunks, ensuring that all values of a certain key will +be stored in the same chunk: +.PP +.nf +.RS +$ cat input.txt +PatientA 10 +PatientB 11 +PatientC 12 +PatientA 14 +PatientC 15 + +.RE + +Each patient ID is hashed into a bin between 0 and 9 +and printed in the last field: + +.RS + +$ \fBdatamash\fR \-\-full strbin 1 < input.txt +PatientA 10 5 +PatientB 11 6 +PatientC 12 7 +PatientA 14 5 +PatientC 15 7 + +.RE + +Splitting the input into chunks can be done with awk: + +.RS + +$ cat input.txt \\ + | \fBdatamash\fR \-\-full strbin 1 \\ + | awk '{print > $NF ".txt"}' + +.RE +.fi +.PP + [ADDITIONAL INFORMATION] See .UR http://www.gnu.org/software/datamash diff -Nru datamash-1.0.7/NEWS datamash-1.1.1/NEWS --- datamash-1.0.7/NEWS 2015-06-22 00:25:12.000000000 +0000 +++ datamash-1.1.1/NEWS 2017-01-19 18:34:28.000000000 +0000 @@ -1,3 +1,32 @@ +* Noteworthy changes in release 1.1.1 (2017-01-19) [stable] + +** Bug fixes + + 'check' command correctly counts a trailing delimiter at end of lines. + + 'transpose' command correctly handles missing fields on the last line. + + +* Noteworthy changes in release 1.1.0 (2016-01-16) [stable] + +** New Features + + Bumped version to 1.1.0 to better comply to semver. + + New operations: + crosstab (cross-tabulation / pivot-tables), + check (verify tabular structure), + bin (bin numeric values) + strbin (bin strings values) + pearson correlation, + covariance, + rounding functions: round,floor,ceil,trunc,frac + +** Improvements + + Speed, Portability, Tests, Coverage improvements. + + * Noteworthy changes in release 1.0.7 (2015-06-29) [stable] ** New Features @@ -15,6 +44,7 @@ Speed, Portability, Coverage improvements. + * Noteworthy changes in release 1.0.6 (2014-07-29) [stable] ** New Features Binary files /tmp/tmp4U70c2/7esjCa0Q6b/datamash-1.0.7/po/da.gmo and /tmp/tmp4U70c2/Lx1O0FDBbS/datamash-1.1.1/po/da.gmo differ diff -Nru datamash-1.0.7/po/da.po datamash-1.1.1/po/da.po --- datamash-1.0.7/po/da.po 2015-06-17 23:45:11.000000000 +0000 +++ datamash-1.1.1/po/da.po 2017-01-19 18:51:35.000000000 +0000 @@ -1,20 +1,24 @@ # Danish translation datamash. -# Copyright (C) 2015 Free Software Foundation, Inc. +# Copyright (C) 2016 Free Software Foundation, Inc. # This file is distributed under the same license as the datamash package. -# Joe Hansen , 2015. +# Joe Hansen , 2015, 2016. +# +# [fld] -> [felt] # msgid "" msgstr "" -"Project-Id-Version: GNU datamash 1.0.6.54\n" +"Project-Id-Version: GNU datamash 1.0.7.58\n" "Report-Msgid-Bugs-To: bug-datamash@gnu.org\n" -"POT-Creation-Date: 2015-05-28 14:22-0400\n" -"PO-Revision-Date: 2015-06-07 18:00+0200\n" +"POT-Creation-Date: 2017-01-19 13:51-0500\n" +"PO-Revision-Date: 2016-01-10 18:00+0200\n" "Last-Translator: Joe Hansen \n" "Language-Team: Danish \n" "Language: da\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/closeout.c:112 msgid "write error" @@ -105,11 +109,11 @@ #. If you don't know what to put here, please see #. #. and use glyphs suitable for your language. -#: lib/quotearg.c:312 +#: lib/quotearg.c:354 msgid "`" msgstr "»" -#: lib/quotearg.c:313 +#: lib/quotearg.c:355 msgid "'" msgstr "«" @@ -133,14 +137,17 @@ #: lib/version-etc.c:86 msgid "" "\n" -"License GPLv3+: GNU GPL version 3 or later .\n" +"License GPLv3+: GNU GPL version 3 or later .\n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" "\n" msgstr "" "\n" -"Licens GPLv3+: GNU GPL version 3 eller senere .\n" -"Dette er et frit program: du kan frit ændre og videredistribuere programmet.\n" +"Licens GPLv3+: GNU GPL version 3 eller senere .\n" +"Dette er et frit program: du kan frit ændre og videredistribuere " +"programmet.\n" "Der er ingen GARANTI, inden for lovens udstrækning.\n" "\n" @@ -282,7 +289,8 @@ #: lib/version-etc.c:256 msgid "General help using GNU software: \n" -msgstr "Generel hjælp til brugen af GNU-programmer: \n" +msgstr "" +"Generel hjælp til brugen af GNU-programmer: \n" #: lib/xalloc-die.c:34 msgid "memory exhausted" @@ -304,71 +312,79 @@ msgstr "%s%s-argument »%s« er for stor" #. This is a proper name. See the gettext manual, section Names. -#: src/datamash.c:61 +#: src/datamash.c:64 msgid "Assaf Gordon" msgstr "Assaf Gordon" -#: src/datamash.c:161 src/field-ops.c:388 +#: src/datamash.c:151 src/datamash.c:467 #, c-format msgid "column name %s not found in input file" msgstr "kolonnenavnet %s blev ikke fundet i inddatafilen" -#: src/datamash.c:174 +#: src/datamash.c:164 #, c-format -msgid "Usage: %s [OPTION] op [col] [op col ...]\n" -msgstr "Brug: %s [TILVALG] op [col] [op col ...]\n" +msgid "Usage: %s [OPTION] op [fld] [op fld ...]\n" +msgstr "Brug: %s [TILVALG] op [felt] [op felt ...]\n" -#: src/datamash.c:177 +#: src/datamash.c:167 msgid "Performs numeric/string operations on input from stdin." msgstr "Udfører numerisk/streng-operationer på inddata fra standardind." -#: src/datamash.c:180 -msgid "'op' is the operation to perform;\n" -msgstr "»op« er operationen der skal udføres;\n" +#: src/datamash.c:170 +msgid "" +"'op' is the operation to perform. If a primary operation is used,\n" +"it must be listed first, optionally followed by other operations.\n" +msgstr "" +"»op« er operationen, der skal udføres. Hvis en primær operation bruges,\n" +"så skal den angives først, valgfrit fulgt af andre operationer.\n" -#: src/datamash.c:181 +#: src/datamash.c:173 msgid "" -"For grouping,per-line operations 'col' is the input field to use;\n" -"'col' can be a number (1=first field), or a column name when using\n" -"-H or --header-in options.\n" -msgstr "" -"For gruppering,per linje-operationer er »col« inddatafeltet;\n" -"»col« kan være et tal (1=første felt), eller et kolonnenavn når\n" -"tilvalgene -H eller --header-in anvendes.\n" +"'fld' is the input field to use. 'fld' can be a number (1=first field),\n" +"or a field name when using the -H or --header-in options.\n" +msgstr "" +"»felt« er inddatafeltet der skal bruges. »felt« kan være et tal (1=første\n" +"felt), eller et feltnavn når tilvalgene -H eller --header-in anvendes.\n" -#: src/datamash.c:187 -msgid "File operations:\n" -msgstr "Filoperationer:\n" +#: src/datamash.c:176 +msgid "" +"Multiple fields can be listed with a comma (e.g. 1,6,8). A range of\n" +"fields can be listed with a dash (e.g. 2-8). Use colons for operations\n" +"which require a pair of fields (e.g. 'pcov 2:6').\n" +msgstr "" +"Flere felter kan angives adskilt af komma (f.eks. 1,6,8). Et interval\n" +"af felter kan vises med en bindestreg (f.eks. 2-8). Brug kolon for\n" +"operationer som kræver et par af felter (f.eks. »pcov 2:6«).\n" + +#: src/datamash.c:181 +msgid "Primary operations:\n" +msgstr "Primære operationer:\n" -#: src/datamash.c:190 +#: src/datamash.c:184 msgid "Line-Filtering operations:\n" msgstr "Linjefiltreringsoperationer:\n" -#: src/datamash.c:193 +#: src/datamash.c:187 msgid "Per-Line operations:\n" msgstr "Per linje-operationer:\n" -#: src/datamash.c:196 +#: src/datamash.c:191 msgid "Numeric Grouping operations:\n" msgstr "Numerisk grupperingsoperationer:\n" -#: src/datamash.c:199 +#: src/datamash.c:194 msgid "Textual/Numeric Grouping operations:\n" msgstr "Tekstmæssig/numerisk grupperingsoperationer:\n" -#: src/datamash.c:203 +#: src/datamash.c:198 msgid "Statistical Grouping operations:\n" msgstr "Statistiske grupperingsoperationer:\n" -#: src/datamash.c:210 -msgid "Options:\n" -msgstr "Tilvalg:\n" - -#: src/datamash.c:211 +#: src/datamash.c:206 msgid "Grouping Options:\n" msgstr "Grupperingsindstillinger:\n" -#: src/datamash.c:212 +#: src/datamash.c:207 msgid "" " -f, --full print entire input line before op results\n" " (default: print only the grouped keys)\n" @@ -376,222 +392,362 @@ " -f, --full udskriv hel inddatalinje før op-resultater\n" " (standard: udskriv kun grupperede nøgler)\n" -#: src/datamash.c:216 -msgid " -g, --group=X[,Y,Z] group via fields X,[Y,Z]\n" -msgstr " -g, --group=X[,Y,Z] grupper via felter X,[Y,Z]\n" +#: src/datamash.c:211 +msgid "" +" -g, --group=X[,Y,Z] group via fields X,[Y,Z];\n" +" equivalent to primary operation 'groupby'\n" +msgstr "" +" -g, --group=X[,Y,Z] gruppér via felter X,[Y,Z];\n" +" svarer til primære operation »groupby«\n" -#: src/datamash.c:219 +#: src/datamash.c:215 msgid " --header-in first input line is column headers\n" -msgstr " --header-in første inddatalinje er kolonneteksthoveder\n" +msgstr "" +" --header-in første inddatalinje er kolonneteksthoveder\n" -#: src/datamash.c:222 +#: src/datamash.c:218 msgid " --header-out print column headers as first line\n" -msgstr " --header-out udskriv kolonneteksthoveder som første linje\n" +msgstr "" +" --header-out udskriv kolonneteksthoveder som første linje\n" -#: src/datamash.c:225 +#: src/datamash.c:221 msgid " -H, --headers same as '--header-in --header-out'\n" msgstr " -H, --headers samme som »--header-in --header-out«\n" -#: src/datamash.c:228 +#: src/datamash.c:224 msgid "" " -i, --ignore-case ignore upper/lower case when comparing text;\n" " this affects grouping, and string operations\n" msgstr "" -" -i, --ignore-case ignorer stor/små bogstaver når tekst sammenlignes;\n" -" dette påvirker gruppering, og strengoperationer\n" +" -i, --ignore-case ignorer stor/små bogstaver når tekst " +"sammenlignes;\n" +" dette påvirker gruppering, og " +"strengoperationer\n" -#: src/datamash.c:232 +#: src/datamash.c:228 msgid "" -" -s, --sort sort the input before grouping; this removes the\n" -" need to manually pipe the input through 'sort'\n" +" -s, --sort sort the input before grouping; this removes " +"the\n" +" need to manually pipe the input through " +"'sort'\n" msgstr "" " -s, --sort sorter inddataene før gruppering; dette fjerner\n" -" behovet for manuelt at sende inddataene igennem\n" +" behovet for manuelt at sende inddataene " +"igennem\n" " kanalen »sort«\n" -#: src/datamash.c:237 +#: src/datamash.c:233 msgid "File Operation Options:\n" msgstr "Tilvalg for filoperationer:\n" -#: src/datamash.c:238 +#: src/datamash.c:234 msgid " --no-strict allow lines with varying number of fields\n" -msgstr " --no-strict tillad linjer med varierende antal felter\n" +msgstr "" +" --no-strict tillad linjer med varierende antal felter\n" -#: src/datamash.c:241 +#: src/datamash.c:237 #, c-format msgid " --filler=X fill missing values with X (default %s)\n" -msgstr " --filler=X udfyld manglende værdier med X (standard %s)\n" +msgstr "" +" --filler=X udfyld manglende værdier med X (standard %s)\n" -#: src/datamash.c:246 +#: src/datamash.c:242 msgid "General Options:\n" msgstr "Generelle tilvalg:\n" -#: src/datamash.c:247 +#: src/datamash.c:243 msgid " -t, --field-separator=X use X instead of TAB as field delimiter\n" -msgstr " -t, --field-separator=X brug X i stedet for TABULATOR som feltafgrænser\n" +msgstr "" +" -t, --field-separator=X brug X i stedet for TABULATOR som feltafgrænser\n" -#: src/datamash.c:250 +#: src/datamash.c:246 msgid " --narm skip NA/NaN values\n" msgstr " --narm udelad NA/NaN-værdier\n" -#: src/datamash.c:253 +#: src/datamash.c:249 msgid "" " -W, --whitespace use whitespace (one or more spaces and/or tabs)\n" " for field delimiters\n" msgstr "" -" -W, --whitespace brug mellemrum (en eller flere rum og/eller tabulatorer)\n" +" -W, --whitespace brug mellemrum (en eller flere rum og/eller " +"tabulatorer)\n" " for feltafgrænsere\n" -#: src/datamash.c:257 +#: src/datamash.c:253 msgid " -z, --zero-terminated end lines with 0 byte, not newline\n" msgstr " -z, --zero-terminated afslut linjer med 0 byte, ikke nylinje\n" -#: src/datamash.c:266 +#: src/datamash.c:262 msgid "Examples:" msgstr "Eksempler:" -#: src/datamash.c:268 +#: src/datamash.c:264 msgid "Print the sum and the mean of values from column 1:" msgstr "Udskriv summen og middelværdierne fra kolonne 1:" -#: src/datamash.c:273 +#: src/datamash.c:269 msgid "Transpose input:" msgstr "Omdan inddata:" -#: src/datamash.c:280 +#: src/datamash.c:276 msgid "For detailed usage information and examples, see\n" msgstr "For detaljeret brugsinformation og eksempler, se\n" -#: src/datamash.c:282 +#: src/datamash.c:278 msgid "The manual and more examples are available at\n" msgstr "Manualen og flere eksempler er tilgængelige på\n" -#: src/datamash.c:291 +#: src/datamash.c:287 #, c-format -msgid "invalid input: field % requested, line % has only % fields" -msgstr "ugyldige inddata: der blev anmodt om feltet %, linje % har kun % felter" +msgid "" +"invalid input: field % requested, line % has only " +"% fields" +msgstr "" +"ugyldige inddata: der blev anmodt om feltet %, linje % har " +"kun % felter" -#: src/datamash.c:349 +#: src/datamash.c:357 #, c-format msgid "%s in line % field %: '%s'" msgstr "%s i linje % felt %: »%s«" -#: src/datamash.c:487 src/datamash.c:784 -#, c-format -msgid "-H or --header-in must be used with named columns" -msgstr "-H eller --header-in skal bruges med navngivne kolonner" - -#: src/datamash.c:588 +#: src/datamash.c:676 #, c-format msgid "" -"transpose input error: line % has % fields (previous lines had %);\n" +"transpose input error: line % has % fields (previous lines " +"had %);\n" "see --help to disable strict mode" msgstr "" -"omdan inddatafejl: linje % har % felter (tidligere linjer havde %);\n" +"omdan inddatafejl: linje % har % felter (forrige linje " +"havde %);\n" "se --help for at deaktivere strict-tilstand" -#: src/datamash.c:644 +#: src/datamash.c:733 #, c-format msgid "" -"reverse-field input error: line % has % fields (previous lines had %);\n" +"reverse-field input error: line % has % fields (previous " +"lines had %);\n" "see --help to disable strict mode" msgstr "" -"reverse-field-inddatafejl: linje % har % felter (tidligere linjer havde\n" +"reverse-field-inddatafejl: linje % har % felter (tidligere " +"linjer havde\n" "%);\n" "se --help for at deaktivere strict-tilstand" -#: src/datamash.c:820 +#: src/datamash.c:837 src/datamash.c:843 +#, c-format +msgid "" +"line % (% fields):\n" +" " +msgstr "" +"linje % (% felter):\n" +" " + +#: src/datamash.c:849 +#, c-format +msgid "" +"check failed: line % has % fields (previous line had " +"%)" +msgstr "" +"kontrol mislykkedes: linje % har % felter (tidligere " +"linjer havde %)" + +#: src/datamash.c:861 +#, c-format +msgid "% line" +msgid_plural "% lines" +msgstr[0] "% linje" +msgstr[1] "% linjer" + +#: src/datamash.c:864 +#, c-format +msgid "% field" +msgid_plural "% fields" +msgstr[0] "% felt" +msgstr[1] "% felter" + +#: src/datamash.c:965 #, c-format msgid "hash memory allocation error" msgstr "allokeringsfejl for hash-hukommelsen" -#: src/datamash.c:882 +#: src/datamash.c:1027 #, c-format msgid "sort command too-long (please report this bug)" -msgstr "sorteringskommandoen er for lang (rapporter venligst dette som en fejl)" +msgstr "" +"sorteringskommandoen er for lang (rapporter venligst dette som en fejl)" -#: src/datamash.c:888 +#: src/datamash.c:1033 #, c-format msgid "failed to run 'sort': popen failed" msgstr "kunne ikke køre »sort«: popen mislykkedes" -#: src/datamash.c:904 +#: src/datamash.c:1049 #, c-format msgid "read error" msgstr "læsefejl" -#: src/datamash.c:912 +#: src/datamash.c:1057 #, c-format msgid "read error (on close)" msgstr "læsefejl (ved lukning)" -#: src/datamash.c:939 -#, c-format -msgid "invalid empty grouping parameter" -msgstr "ugyldig tom grupperingsparameter" - -#: src/datamash.c:946 -#, c-format -msgid "invalid grouping parameter %s" -msgstr "ugyldig grupperingsparameter %s" - -#: src/datamash.c:1031 +#: src/datamash.c:1133 #, c-format msgid "the delimiter must be a single character" msgstr "afgrænseren skal være et enkelt tegn" -#: src/datamash.c:1067 +#: src/datamash.c:1170 #, c-format msgid "missing operation specifiers" msgstr "manglende operationspecifikationer" -#: src/field-ops.c:293 +#: src/datamash.c:1184 #, c-format -msgid "invalid empty column for operation %s" -msgstr "ugyldig tom kolonne for operation %s" +msgid "-H or --header-in must be used with named columns" +msgstr "-H eller --header-in skal bruges med navngivne kolonner" -#: src/field-ops.c:306 +#: src/field-ops.c:319 #, c-format -msgid "invalid column '%s' for operation %s" -msgstr "ugyldig kolonne »%s« for operation %s" +msgid "" +"input error for operation %s: fields %,% have different " +"number of items" +msgstr "" +"inddatafejl for operation %s: felterne %,% har forskelligt " +"antal elementer" -#: src/field-ops.c:985 -#, c-format -msgid "invalid operation '%s'" -msgstr "ugyldig operation »%s«" +#: src/field-ops.c:999 +msgid "invalid numeric value" +msgstr "ugyldig numerisk værdi" #: src/field-ops.c:1001 +msgid "invalid base64 value" +msgstr "ugyldig base64-værdi" + +#: src/op-parser.c:163 src/op-parser.c:177 src/op-parser.c:184 #, c-format -msgid "conflicting operation found: expecting %s operations, but found %s operation %s" -msgstr "operation i konflikt blev registreret: forventede %s operationer, men fandt %s operation %s" +msgid "too many parameters for operation %s" +msgstr "for mange parametre for operation %s" -#: src/field-ops.c:1009 +#: src/op-parser.c:174 #, c-format -msgid "missing field number after operation '%s'" -msgstr "manglende feltnummer efter operation »%s«" +msgid "strbin bucket size must not be zero" +msgstr "Spandstørrelse for strbin skal være forskellig fra nul" -#: src/field-ops.c:1029 +#: src/op-parser.c:205 src/op-parser.c:216 src/op-parser.c:472 #, c-format -msgid "extra operands after '%s'" -msgstr "ekstra operander efter »%s«" +msgid "missing field for operation %s" +msgstr "manglende felt efter operation %s" -#: src/field-ops.c:1094 -msgid "invalid numeric value" -msgstr "ugyldig numerisk værdi" +#: src/op-parser.c:211 src/op-parser.c:220 src/op-parser.c:275 +#: src/op-parser.c:508 +#, c-format +msgid "invalid field range for operation %s" +msgstr "ugyldigt feltinterval for operation %s" -#: src/field-ops.c:1096 -msgid "invalid base64 value" -msgstr "ugyldig base64-værdi" +#: src/op-parser.c:214 src/op-parser.c:224 src/op-parser.c:511 +#, c-format +msgid "invalid field pair for operation %s" +msgstr "ugyldigt feltpar for operation %s" + +#: src/op-parser.c:238 src/op-parser.c:486 +#, c-format +msgid "invalid field '%s' for operation %s" +msgstr "ugyldig felt »%s« for operation %s" + +#: src/op-parser.c:272 +#, c-format +msgid "field range for %s must be numeric" +msgstr "feltinterval for %s skal være numerisk" + +#: src/op-parser.c:332 +#, c-format +msgid "missing parameter for operation %s" +msgstr "manglende parameter for operation %s" + +#: src/op-parser.c:340 +#, c-format +msgid "invalid parameter %s for operation %s" +msgstr "ugyldig parameter %s for operation %s" + +#: src/op-parser.c:372 +#, c-format +msgid "operation %s requires field pairs" +msgstr "operation %s kræver feltpar" + +#: src/op-parser.c:375 +#, c-format +msgid "operation %s cannot use pair of fields" +msgstr "operation %s kan ikke bruge et par af felter" + +#: src/op-parser.c:415 +#, c-format +msgid "conflicting operation %s" +msgstr "modstridende operation %s" + +#: src/op-parser.c:418 src/op-parser.c:597 +#, c-format +msgid "invalid operation %s" +msgstr "ugyldig operation %s" + +#: src/op-parser.c:423 +#, c-format +msgid "" +"conflicting operation found: expecting %s operations, but found %s operation " +"%s" +msgstr "" +"operation i konflikt blev registreret: forventede %s operationer, men fandt " +"%s operation %s" + +#: src/op-parser.c:537 +#, c-format +msgid "crosstab requires exactly 2 fields, found %" +msgstr "crosstab kræver præcis 2 felter, fandt %" + +#: src/op-parser.c:550 +#, c-format +msgid "crosstab supports one operation, found %" +msgstr "crosstab understøtter netop en operation, fandt %" + +#: src/op-parser.c:559 +#, c-format +msgid "missing operation" +msgstr "manglende operation" + +#: src/op-parser.c:573 +#, c-format +msgid "extra operand %s" +msgstr "ekstra operand %s" + +#: src/op-parser.c:710 src/op-scanner.c:210 +#, c-format +msgid "missing script (among arguments)" +msgstr "manglende skript (blandt argumenter)" + +#: src/op-scanner.c:167 +#, c-format +msgid "invalid numeric value '%s'" +msgstr "ugyldig numerisk værdi »%s«" + +#: src/op-scanner.c:188 +#, c-format +msgid "invalid operand %s" +msgstr "ugyldig operand %s" + +#: src/op-scanner.c:244 +#, c-format +msgid "unknown token %d\n" +msgstr "ukendt symbol %d\n" -#: src/system.h:101 +#: src/system.h:133 msgid " --help display this help and exit\n" msgstr " --help vis denne hjælpetekst og afslut\n" -#: src/system.h:103 +#: src/system.h:135 msgid " --version output version information and exit\n" msgstr " --version vis versionsinformation og afslut\n" -#: src/system.h:108 +#: src/system.h:140 #, c-format msgid "Try '%s --help' for more information.\n" msgstr "Prøv »%s --help« for yderligere information.\n" diff -Nru datamash-1.0.7/po/datamash.pot datamash-1.1.1/po/datamash.pot --- datamash-1.0.7/po/datamash.pot 2015-06-22 00:27:33.000000000 +0000 +++ datamash-1.1.1/po/datamash.pot 2017-01-19 18:51:35.000000000 +0000 @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: GNU datamash 1.0.7\n" +"Project-Id-Version: GNU datamash 1.1.1\n" "Report-Msgid-Bugs-To: bug-datamash@gnu.org\n" -"POT-Creation-Date: 2015-06-21 20:27-0400\n" +"POT-Creation-Date: 2017-01-19 13:51-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -16,6 +16,7 @@ "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" #: lib/closeout.c:112 msgid "write error" @@ -106,11 +107,11 @@ #. If you don't know what to put here, please see #. #. and use glyphs suitable for your language. -#: lib/quotearg.c:312 +#: lib/quotearg.c:354 msgid "`" msgstr "" -#: lib/quotearg.c:313 +#: lib/quotearg.c:355 msgid "'" msgstr "" @@ -282,96 +283,102 @@ msgstr "" #. This is a proper name. See the gettext manual, section Names. -#: src/datamash.c:61 +#: src/datamash.c:64 msgid "Assaf Gordon" msgstr "" -#: src/datamash.c:161 src/field-ops.c:388 +#: src/datamash.c:151 src/datamash.c:467 #, c-format msgid "column name %s not found in input file" msgstr "" -#: src/datamash.c:174 +#: src/datamash.c:164 #, c-format -msgid "Usage: %s [OPTION] op [col] [op col ...]\n" +msgid "Usage: %s [OPTION] op [fld] [op fld ...]\n" msgstr "" -#: src/datamash.c:177 +#: src/datamash.c:167 msgid "Performs numeric/string operations on input from stdin." msgstr "" -#: src/datamash.c:180 -msgid "'op' is the operation to perform;\n" +#: src/datamash.c:170 +msgid "" +"'op' is the operation to perform. If a primary operation is used,\n" +"it must be listed first, optionally followed by other operations.\n" msgstr "" -#: src/datamash.c:181 +#: src/datamash.c:173 msgid "" -"For grouping,per-line operations 'col' is the input field to use;\n" -"'col' can be a number (1=first field), or a column name when using\n" -"-H or --header-in options.\n" +"'fld' is the input field to use. 'fld' can be a number (1=first field),\n" +"or a field name when using the -H or --header-in options.\n" msgstr "" -#: src/datamash.c:187 -msgid "File operations:\n" +#: src/datamash.c:176 +msgid "" +"Multiple fields can be listed with a comma (e.g. 1,6,8). A range of\n" +"fields can be listed with a dash (e.g. 2-8). Use colons for operations\n" +"which require a pair of fields (e.g. 'pcov 2:6').\n" +msgstr "" + +#: src/datamash.c:181 +msgid "Primary operations:\n" msgstr "" -#: src/datamash.c:190 +#: src/datamash.c:184 msgid "Line-Filtering operations:\n" msgstr "" -#: src/datamash.c:193 +#: src/datamash.c:187 msgid "Per-Line operations:\n" msgstr "" -#: src/datamash.c:196 +#: src/datamash.c:191 msgid "Numeric Grouping operations:\n" msgstr "" -#: src/datamash.c:199 +#: src/datamash.c:194 msgid "Textual/Numeric Grouping operations:\n" msgstr "" -#: src/datamash.c:203 +#: src/datamash.c:198 msgid "Statistical Grouping operations:\n" msgstr "" -#: src/datamash.c:210 -msgid "Options:\n" -msgstr "" - -#: src/datamash.c:211 +#: src/datamash.c:206 msgid "Grouping Options:\n" msgstr "" -#: src/datamash.c:212 +#: src/datamash.c:207 msgid "" " -f, --full print entire input line before op results\n" " (default: print only the grouped keys)\n" msgstr "" -#: src/datamash.c:216 -msgid " -g, --group=X[,Y,Z] group via fields X,[Y,Z]\n" +#: src/datamash.c:211 +msgid "" +" -g, --group=X[,Y,Z] group via fields X,[Y,Z];\n" +" equivalent to primary operation 'groupby'\n" msgstr "" -#: src/datamash.c:219 +#: src/datamash.c:215 msgid " --header-in first input line is column headers\n" msgstr "" -#: src/datamash.c:222 +#: src/datamash.c:218 msgid " --header-out print column headers as first line\n" msgstr "" -#: src/datamash.c:225 +#: src/datamash.c:221 msgid " -H, --headers same as '--header-in --header-out'\n" msgstr "" -#: src/datamash.c:228 +#: src/datamash.c:224 msgid "" " -i, --ignore-case ignore upper/lower case when comparing text;\n" " this affects grouping, and string operations\n" msgstr "" -#: src/datamash.c:232 +#: src/datamash.c:228 msgid "" " -s, --sort sort the input before grouping; this removes " "the\n" @@ -379,79 +386,74 @@ "'sort'\n" msgstr "" -#: src/datamash.c:237 +#: src/datamash.c:233 msgid "File Operation Options:\n" msgstr "" -#: src/datamash.c:238 +#: src/datamash.c:234 msgid " --no-strict allow lines with varying number of fields\n" msgstr "" -#: src/datamash.c:241 +#: src/datamash.c:237 #, c-format msgid " --filler=X fill missing values with X (default %s)\n" msgstr "" -#: src/datamash.c:246 +#: src/datamash.c:242 msgid "General Options:\n" msgstr "" -#: src/datamash.c:247 +#: src/datamash.c:243 msgid " -t, --field-separator=X use X instead of TAB as field delimiter\n" msgstr "" -#: src/datamash.c:250 +#: src/datamash.c:246 msgid " --narm skip NA/NaN values\n" msgstr "" -#: src/datamash.c:253 +#: src/datamash.c:249 msgid "" " -W, --whitespace use whitespace (one or more spaces and/or tabs)\n" " for field delimiters\n" msgstr "" -#: src/datamash.c:257 +#: src/datamash.c:253 msgid " -z, --zero-terminated end lines with 0 byte, not newline\n" msgstr "" -#: src/datamash.c:266 +#: src/datamash.c:262 msgid "Examples:" msgstr "" -#: src/datamash.c:268 +#: src/datamash.c:264 msgid "Print the sum and the mean of values from column 1:" msgstr "" -#: src/datamash.c:273 +#: src/datamash.c:269 msgid "Transpose input:" msgstr "" -#: src/datamash.c:280 +#: src/datamash.c:276 msgid "For detailed usage information and examples, see\n" msgstr "" -#: src/datamash.c:282 +#: src/datamash.c:278 msgid "The manual and more examples are available at\n" msgstr "" -#: src/datamash.c:291 +#: src/datamash.c:287 #, c-format msgid "" "invalid input: field % requested, line % has only " "% fields" msgstr "" -#: src/datamash.c:349 +#: src/datamash.c:357 #, c-format msgid "%s in line % field %: '%s'" msgstr "" -#: src/datamash.c:487 src/datamash.c:784 -#, c-format -msgid "-H or --header-in must be used with named columns" -msgstr "" - -#: src/datamash.c:588 +#: src/datamash.c:676 #, c-format msgid "" "transpose input error: line % has % fields (previous lines " @@ -459,7 +461,7 @@ "see --help to disable strict mode" msgstr "" -#: src/datamash.c:644 +#: src/datamash.c:733 #, c-format msgid "" "reverse-field input error: line % has % fields (previous " @@ -467,100 +469,211 @@ "see --help to disable strict mode" msgstr "" -#: src/datamash.c:820 +#: src/datamash.c:837 src/datamash.c:843 +#, c-format +msgid "" +"line % (% fields):\n" +" " +msgstr "" + +#: src/datamash.c:849 +#, c-format +msgid "" +"check failed: line % has % fields (previous line had " +"%)" +msgstr "" + +#: src/datamash.c:861 +#, c-format +msgid "% line" +msgid_plural "% lines" +msgstr[0] "" +msgstr[1] "" + +#: src/datamash.c:864 +#, c-format +msgid "% field" +msgid_plural "% fields" +msgstr[0] "" +msgstr[1] "" + +#: src/datamash.c:965 #, c-format msgid "hash memory allocation error" msgstr "" -#: src/datamash.c:882 +#: src/datamash.c:1027 #, c-format msgid "sort command too-long (please report this bug)" msgstr "" -#: src/datamash.c:888 +#: src/datamash.c:1033 #, c-format msgid "failed to run 'sort': popen failed" msgstr "" -#: src/datamash.c:904 +#: src/datamash.c:1049 #, c-format msgid "read error" msgstr "" -#: src/datamash.c:912 +#: src/datamash.c:1057 #, c-format msgid "read error (on close)" msgstr "" -#: src/datamash.c:939 +#: src/datamash.c:1133 #, c-format -msgid "invalid empty grouping parameter" +msgid "the delimiter must be a single character" msgstr "" -#: src/datamash.c:946 +#: src/datamash.c:1170 #, c-format -msgid "invalid grouping parameter %s" +msgid "missing operation specifiers" msgstr "" -#: src/datamash.c:1031 +#: src/datamash.c:1184 #, c-format -msgid "the delimiter must be a single character" +msgid "-H or --header-in must be used with named columns" msgstr "" -#: src/datamash.c:1067 +#: src/field-ops.c:319 #, c-format -msgid "missing operation specifiers" +msgid "" +"input error for operation %s: fields %,% have different " +"number of items" msgstr "" -#: src/field-ops.c:293 +#: src/field-ops.c:999 +msgid "invalid numeric value" +msgstr "" + +#: src/field-ops.c:1001 +msgid "invalid base64 value" +msgstr "" + +#: src/op-parser.c:163 src/op-parser.c:177 src/op-parser.c:184 #, c-format -msgid "invalid empty column for operation %s" +msgid "too many parameters for operation %s" msgstr "" -#: src/field-ops.c:306 +#: src/op-parser.c:174 #, c-format -msgid "invalid column '%s' for operation %s" +msgid "strbin bucket size must not be zero" msgstr "" -#: src/field-ops.c:985 +#: src/op-parser.c:205 src/op-parser.c:216 src/op-parser.c:472 #, c-format -msgid "invalid operation '%s'" +msgid "missing field for operation %s" msgstr "" -#: src/field-ops.c:1001 +#: src/op-parser.c:211 src/op-parser.c:220 src/op-parser.c:275 +#: src/op-parser.c:508 +#, c-format +msgid "invalid field range for operation %s" +msgstr "" + +#: src/op-parser.c:214 src/op-parser.c:224 src/op-parser.c:511 +#, c-format +msgid "invalid field pair for operation %s" +msgstr "" + +#: src/op-parser.c:238 src/op-parser.c:486 +#, c-format +msgid "invalid field '%s' for operation %s" +msgstr "" + +#: src/op-parser.c:272 +#, c-format +msgid "field range for %s must be numeric" +msgstr "" + +#: src/op-parser.c:332 +#, c-format +msgid "missing parameter for operation %s" +msgstr "" + +#: src/op-parser.c:340 +#, c-format +msgid "invalid parameter %s for operation %s" +msgstr "" + +#: src/op-parser.c:372 +#, c-format +msgid "operation %s requires field pairs" +msgstr "" + +#: src/op-parser.c:375 +#, c-format +msgid "operation %s cannot use pair of fields" +msgstr "" + +#: src/op-parser.c:415 +#, c-format +msgid "conflicting operation %s" +msgstr "" + +#: src/op-parser.c:418 src/op-parser.c:597 +#, c-format +msgid "invalid operation %s" +msgstr "" + +#: src/op-parser.c:423 #, c-format msgid "" "conflicting operation found: expecting %s operations, but found %s operation " "%s" msgstr "" -#: src/field-ops.c:1009 +#: src/op-parser.c:537 #, c-format -msgid "missing field number after operation '%s'" +msgid "crosstab requires exactly 2 fields, found %" msgstr "" -#: src/field-ops.c:1029 +#: src/op-parser.c:550 #, c-format -msgid "extra operands after '%s'" +msgid "crosstab supports one operation, found %" msgstr "" -#: src/field-ops.c:1094 -msgid "invalid numeric value" +#: src/op-parser.c:559 +#, c-format +msgid "missing operation" msgstr "" -#: src/field-ops.c:1096 -msgid "invalid base64 value" +#: src/op-parser.c:573 +#, c-format +msgid "extra operand %s" +msgstr "" + +#: src/op-parser.c:710 src/op-scanner.c:210 +#, c-format +msgid "missing script (among arguments)" +msgstr "" + +#: src/op-scanner.c:167 +#, c-format +msgid "invalid numeric value '%s'" +msgstr "" + +#: src/op-scanner.c:188 +#, c-format +msgid "invalid operand %s" +msgstr "" + +#: src/op-scanner.c:244 +#, c-format +msgid "unknown token %d\n" msgstr "" -#: src/system.h:101 +#: src/system.h:133 msgid " --help display this help and exit\n" msgstr "" -#: src/system.h:103 +#: src/system.h:135 msgid " --version output version information and exit\n" msgstr "" -#: src/system.h:108 +#: src/system.h:140 #, c-format msgid "Try '%s --help' for more information.\n" msgstr "" Binary files /tmp/tmp4U70c2/7esjCa0Q6b/datamash-1.0.7/po/de.gmo and /tmp/tmp4U70c2/Lx1O0FDBbS/datamash-1.1.1/po/de.gmo differ diff -Nru datamash-1.0.7/po/de.po datamash-1.1.1/po/de.po --- datamash-1.0.7/po/de.po 2015-06-17 23:45:11.000000000 +0000 +++ datamash-1.1.1/po/de.po 2017-01-19 18:51:35.000000000 +0000 @@ -1,22 +1,23 @@ # German translation of GNU datamash. # Copyright (C) 2014 Free Software Foundation, Inc. # This file is distributed under the same license as the datamash package. -# Mario Blättermann , 2014, 2015. +# Mario Blättermann , 2014, 2015, 2016. # msgid "" msgstr "" -"Project-Id-Version: GNU datamash 1.0.6.54\n" +"Project-Id-Version: GNU datamash 1.0.7.58\n" "Report-Msgid-Bugs-To: bug-datamash@gnu.org\n" -"POT-Creation-Date: 2015-05-28 14:22-0400\n" -"PO-Revision-Date: 2015-06-09 21:56+0100\n" +"POT-Creation-Date: 2017-01-19 13:51-0500\n" +"PO-Revision-Date: 2016-01-01 15:40+0100\n" "Last-Translator: Mario Blättermann \n" "Language-Team: German \n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Poedit 1.8\n" +"X-Generator: Poedit 1.8.5\n" #: lib/closeout.c:112 msgid "write error" @@ -107,11 +108,11 @@ #. If you don't know what to put here, please see #. #. and use glyphs suitable for your language. -#: lib/quotearg.c:312 +#: lib/quotearg.c:354 msgid "`" msgstr "»" -#: lib/quotearg.c:313 +#: lib/quotearg.c:355 msgid "'" msgstr "«" @@ -135,15 +136,18 @@ #: lib/version-etc.c:86 msgid "" "\n" -"License GPLv3+: GNU GPL version 3 or later .\n" +"License GPLv3+: GNU GPL version 3 or later .\n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" "\n" msgstr "" "\n" -"Lizenz GPLv3+: GNU GPL Version 3 oder neuer \n" -"Dies ist freie Software: Es ist Ihnen freigestellt, sie zu verändern und zu verbreiten.\n" -"Es gibt in dem gesetzlichen gegebenen Umfang KEINE GARANTIE.\n" +"Lizenz GPLv3+: GNU GPL Version 3 oder neuer \n" +"Dies ist freie Software: Es ist Ihnen freigestellt, sie zu verändern\n" +"und zu verbreiten. Es gibt in dem gesetzlichen gegebenen Umfang KEINE " +"GARANTIE.\n" "\n" #. TRANSLATORS: %s denotes an author name. @@ -304,322 +308,457 @@ msgstr "%s%s Argument »%s« zu groß" #. This is a proper name. See the gettext manual, section Names. -#: src/datamash.c:61 +#: src/datamash.c:64 msgid "Assaf Gordon" msgstr "Assaf Gordon" -#: src/datamash.c:161 src/field-ops.c:388 +#: src/datamash.c:151 src/datamash.c:467 #, c-format msgid "column name %s not found in input file" msgstr "Spaltenname %s wurde in der Eingabedatei nicht gefunden" -#: src/datamash.c:174 +#: src/datamash.c:164 #, c-format -msgid "Usage: %s [OPTION] op [col] [op col ...]\n" -msgstr "Aufruf: %s [OPTION] Op [Sp] [Op Sp …]\n" +msgid "Usage: %s [OPTION] op [fld] [op fld ...]\n" +msgstr "Aufruf: %s [OPTION] op [Feld] [op Feld …]\n" -#: src/datamash.c:177 +#: src/datamash.c:167 msgid "Performs numeric/string operations on input from stdin." -msgstr "Führt numerische bzw. Stringoperationen für Eingaben aus der Standardeingabe aus." +msgstr "" +"Führt numerische bzw. Stringoperationen für Eingaben aus der Standardeingabe " +"aus." -#: src/datamash.c:180 -msgid "'op' is the operation to perform;\n" -msgstr "»Op« ist die auszuführende Operation;\n" +#: src/datamash.c:170 +msgid "" +"'op' is the operation to perform. If a primary operation is used,\n" +"it must be listed first, optionally followed by other operations.\n" +msgstr "" +"»op« ist die auszuführende Operation. Wenn es eine primäre Operation ist, " +"muss\n" +"diese zuerst angegeben werden, gefolgt von anderen (optionalen) " +"Operationen.\n" -#: src/datamash.c:181 +#: src/datamash.c:173 msgid "" -"For grouping,per-line operations 'col' is the input field to use;\n" -"'col' can be a number (1=first field), or a column name when using\n" -"-H or --header-in options.\n" -msgstr "" -"Für Gruppierungs- und zeilenweise Operationen ist »col« das zu\n" -"verwendende Eingabefeld.\n" -"»col« kann dabei eine Zahl sein (1 = erstes Feld) oder ein Spaltenname,\n" -"wenn die Optionen -H oder --header-in angegeben werden.\n" +"'fld' is the input field to use. 'fld' can be a number (1=first field),\n" +"or a field name when using the -H or --header-in options.\n" +msgstr "" +"»Feld« ist das zu verwendende Eingabefeld. »Feld« kann eine Zahl sein\n" +"(1=erstes Feld), oder ein Feldname, wenn die Optionen -H oder --header-in\n" +"verwendet werden.\n" -#: src/datamash.c:187 -msgid "File operations:\n" -msgstr "Dateioperationen:\n" +#: src/datamash.c:176 +msgid "" +"Multiple fields can be listed with a comma (e.g. 1,6,8). A range of\n" +"fields can be listed with a dash (e.g. 2-8). Use colons for operations\n" +"which require a pair of fields (e.g. 'pcov 2:6').\n" +msgstr "" +"Mehrere Felder können durch Kommata getrennt werden (z.B. 1,6,8).\n" +"Ein Feldbereich kann mit Minuszeichen angegeben werden (z.B. 2-8).\n" +"Ein Doppelpunkt gibt Feldpaare an (z.B. »pcov 2:6«).\n" + +#: src/datamash.c:181 +msgid "Primary operations:\n" +msgstr "Primäre Operationen:\n" -#: src/datamash.c:190 +#: src/datamash.c:184 msgid "Line-Filtering operations:\n" msgstr "Operationen zur Zeilenfilterung:\n" -#: src/datamash.c:193 +#: src/datamash.c:187 msgid "Per-Line operations:\n" msgstr "Zeilenweise Operationen:\n" -#: src/datamash.c:196 +#: src/datamash.c:191 msgid "Numeric Grouping operations:\n" msgstr "Optionen zur numerischen Gruppierung:\n" -#: src/datamash.c:199 +#: src/datamash.c:194 msgid "Textual/Numeric Grouping operations:\n" msgstr "Optionen zur textuellen/numerischen Gruppierung:\n" -#: src/datamash.c:203 +#: src/datamash.c:198 msgid "Statistical Grouping operations:\n" msgstr "Optionen zur statistischen Gruppierung:\n" -#: src/datamash.c:210 -msgid "Options:\n" -msgstr "Optionen:\n" - -#: src/datamash.c:211 +#: src/datamash.c:206 msgid "Grouping Options:\n" msgstr "Gruppierungsoptionen:\n" -#: src/datamash.c:212 +#: src/datamash.c:207 msgid "" " -f, --full print entire input line before op results\n" " (default: print only the grouped keys)\n" msgstr "" -" -f, --full gibt die gesamte Eingabezeile vor den Operations-\n" +" -f, --full gibt die gesamte Eingabezeile vor den " +"Operations-\n" " ergebnissen aus (Voreinstellung: nur die\n" " gruppierten Schlüssel werden ausgegeben)\n" -#: src/datamash.c:216 -msgid " -g, --group=X[,Y,Z] group via fields X,[Y,Z]\n" -msgstr " -g, --group=X[,Y,Z] gruppiert nach Feldern X,[Y,Z]\n" +#: src/datamash.c:211 +msgid "" +" -g, --group=X[,Y,Z] group via fields X,[Y,Z];\n" +" equivalent to primary operation 'groupby'\n" +msgstr "" +" -g, --group=X[,Y,Z] gruppiert nach Feldern X,[Y,Z];\n" +" gleichbedeutend mit der primären Operation " +"»groupby«\n" -#: src/datamash.c:219 +#: src/datamash.c:215 msgid " --header-in first input line is column headers\n" -msgstr " --header-in erste Eingabezeile ist die Spaltenüberschrift\n" +msgstr "" +" --header-in erste Eingabezeile ist die Spaltenüberschrift\n" -#: src/datamash.c:222 +#: src/datamash.c:218 msgid " --header-out print column headers as first line\n" -msgstr " --header-out gibt Spaltenüberschriften als erste Zeile aus\n" +msgstr "" +" --header-out gibt Spaltenüberschriften als erste Zeile aus\n" -#: src/datamash.c:225 +#: src/datamash.c:221 msgid " -H, --headers same as '--header-in --header-out'\n" msgstr " -H, --headers gleich wie »--header-in --header-out«\n" -#: src/datamash.c:228 +#: src/datamash.c:224 msgid "" " -i, --ignore-case ignore upper/lower case when comparing text;\n" " this affects grouping, and string operations\n" msgstr "" -" -i, --ignore-case ignoriert Groß-/Kleinschreibung bei Textvergleichen;\n" -" dies ist für Gruppierungs- und Stringoperationen\n" +" -i, --ignore-case ignoriert Groß-/Kleinschreibung bei " +"Textvergleichen;\n" +" dies ist für Gruppierungs- und " +"Stringoperationen\n" " wirksam\n" -#: src/datamash.c:232 +#: src/datamash.c:228 msgid "" -" -s, --sort sort the input before grouping; this removes the\n" -" need to manually pipe the input through 'sort'\n" -msgstr "" -" -s, --sort sortiert die Eingabe vor der Gruppiernug; dadurch ist\n" -" das manuelle Bearbeiten der Eingabe mit »sort«\n" +" -s, --sort sort the input before grouping; this removes " +"the\n" +" need to manually pipe the input through " +"'sort'\n" +msgstr "" +" -s, --sort sortiert die Eingabe vor der Gruppierung; " +"dadurch\n" +" ist manuelles Bearbeiten der Eingabe mit " +"»sort«\n" " nicht mehr nötig\n" -#: src/datamash.c:237 +#: src/datamash.c:233 msgid "File Operation Options:\n" msgstr "Optionen für Dateioperationen:\n" -#: src/datamash.c:238 +#: src/datamash.c:234 msgid " --no-strict allow lines with varying number of fields\n" -msgstr " --no-strict erlaubt Zeilen mit unterschiedlicher Feldanzahl\n" +msgstr "" +" --no-strict erlaubt Zeilen mit unterschiedlicher Feldanzahl\n" -#: src/datamash.c:241 +#: src/datamash.c:237 #, c-format msgid " --filler=X fill missing values with X (default %s)\n" msgstr "" " --filler=X ersetzt fehlende Werte durch X\n" " (Voreinstellung ist %s)\n" -#: src/datamash.c:246 +#: src/datamash.c:242 msgid "General Options:\n" msgstr "Allgemeine Optionen:\n" -#: src/datamash.c:247 +#: src/datamash.c:243 msgid " -t, --field-separator=X use X instead of TAB as field delimiter\n" msgstr "" " -t, --field-separator=X verwendet X anstelle von Tabulatoren\n" " als Feldtrenner\n" -#: src/datamash.c:250 +#: src/datamash.c:246 msgid " --narm skip NA/NaN values\n" msgstr " --narm NA/NaN-Werte überspringen\n" -#: src/datamash.c:253 +#: src/datamash.c:249 msgid "" " -W, --whitespace use whitespace (one or more spaces and/or tabs)\n" " for field delimiters\n" msgstr "" -" -W, --whitespace verwendet Leerraum (eines oder mehrere Leerzeichen\n" +" -W, --whitespace verwendet Leerraum (eines oder mehrere " +"Leerzeichen\n" " und/oder Tabulatoren) für Feldtrenner\n" -#: src/datamash.c:257 +#: src/datamash.c:253 msgid " -z, --zero-terminated end lines with 0 byte, not newline\n" msgstr "" " -z, --zero-terminated beendet Zeilen mit einem Null-Byte, nicht\n" " mit einem Zeilenumbruch\n" -#: src/datamash.c:266 +#: src/datamash.c:262 msgid "Examples:" msgstr "Beispiele:" -#: src/datamash.c:268 +#: src/datamash.c:264 msgid "Print the sum and the mean of values from column 1:" msgstr "Die Summe und den Median der Werte aus Spalte 1 ausgeben:" -#: src/datamash.c:273 +#: src/datamash.c:269 msgid "Transpose input:" msgstr "Transponierte Eingabe:" -#: src/datamash.c:280 +#: src/datamash.c:276 msgid "For detailed usage information and examples, see\n" msgstr "" "Detaillierte Informationen zur Verwendung und Beispiele\n" "finden Sie unter\n" -#: src/datamash.c:282 +#: src/datamash.c:278 msgid "The manual and more examples are available at\n" msgstr "Das Handbuch und weitere Beispiele sind verfügbar auf\n" -#: src/datamash.c:291 +#: src/datamash.c:287 #, c-format -msgid "invalid input: field % requested, line % has only % fields" -msgstr "Ungültige Eingabe: Feld % angefragt, Zeile % hat aber nur % Felder" +msgid "" +"invalid input: field % requested, line % has only " +"% fields" +msgstr "" +"Ungültige Eingabe: Feld % angefragt, Zeile % hat aber nur " +"% Felder" -#: src/datamash.c:349 +#: src/datamash.c:357 #, c-format msgid "%s in line % field %: '%s'" msgstr "%s in Zeile %, Feld %: »%s«" -#: src/datamash.c:487 src/datamash.c:784 -#, c-format -msgid "-H or --header-in must be used with named columns" -msgstr "-H oder --header-in muss mit benannten Spalten verwendet werden" - -#: src/datamash.c:588 +#: src/datamash.c:676 #, c-format msgid "" -"transpose input error: line % has % fields (previous lines had %);\n" +"transpose input error: line % has % fields (previous lines " +"had %);\n" "see --help to disable strict mode" msgstr "" -"Fehler in transponierter Eingabe: Zeile % hat % Felder (vorherige Zeilen hatten % Felder);\n" +"Fehler in transponierter Eingabe: Zeile % hat % Felder " +"(vorherige Zeilen hatten % Felder);\n" "siehe --help für den strikten Modus" -#: src/datamash.c:644 +#: src/datamash.c:733 #, c-format msgid "" -"reverse-field input error: line % has % fields (previous lines had %);\n" +"reverse-field input error: line % has % fields (previous " +"lines had %);\n" "see --help to disable strict mode" msgstr "" -"Eingabefehler für umgekehrte Felder: Zeile % hat % Felder (vorherige\n" +"Eingabefehler für umgekehrte Felder: Zeile % hat % Felder " +"(vorherige\n" "Zeilen hatten %) Felder);\n" "siehe --help für den strikten Modus" -#: src/datamash.c:820 +#: src/datamash.c:837 src/datamash.c:843 +#, c-format +msgid "" +"line % (% fields):\n" +" " +msgstr "" +"Zeile % (% Felder):\n" +" " + +#: src/datamash.c:849 +#, c-format +msgid "" +"check failed: line % has % fields (previous line had " +"%)" +msgstr "" +"Überprüfung fehlgeschlagen: Zeile % hat % Felder (vorige " +"Zeile hatte %)" + +#: src/datamash.c:861 +#, c-format +msgid "% line" +msgid_plural "% lines" +msgstr[0] "% Zeile" +msgstr[1] "% Zeilen" + +#: src/datamash.c:864 +#, c-format +msgid "% field" +msgid_plural "% fields" +msgstr[0] "% Feld" +msgstr[1] "% Felder" + +#: src/datamash.c:965 #, c-format msgid "hash memory allocation error" msgstr "Speicherreservierung gescheitert" -#: src/datamash.c:882 +#: src/datamash.c:1027 #, c-format msgid "sort command too-long (please report this bug)" msgstr "Sortierbefehl ist zu lang (bitte melden Sie dies als Fehler)" -#: src/datamash.c:888 +#: src/datamash.c:1033 #, c-format msgid "failed to run 'sort': popen failed" -msgstr "sort kann nicht gestartet werden: »popen« fehlgeschlagen" +msgstr "»sort« kann nicht gestartet werden: »popen« fehlgeschlagen" -#: src/datamash.c:904 +#: src/datamash.c:1049 #, c-format msgid "read error" msgstr "Lesefehler" -#: src/datamash.c:912 +#: src/datamash.c:1057 #, c-format msgid "read error (on close)" msgstr "Lesefehler (beim Schließen)" -#: src/datamash.c:939 -#, c-format -msgid "invalid empty grouping parameter" -msgstr "Unzulässiger leerer Gruppierungsparameter" - -#: src/datamash.c:946 -#, c-format -msgid "invalid grouping parameter %s" -msgstr "Unzulässiger Gruppierungsparameter %s" - -#: src/datamash.c:1031 +#: src/datamash.c:1133 #, c-format msgid "the delimiter must be a single character" msgstr "Trennzeichen muss ein einzelnes Zeichen sein" -#: src/datamash.c:1067 +#: src/datamash.c:1170 #, c-format msgid "missing operation specifiers" msgstr "Operationsbezeichner fehlen" -#: src/field-ops.c:293 +#: src/datamash.c:1184 #, c-format -msgid "invalid empty column for operation %s" -msgstr "Ungültige leere Spalte für die Operation »%s«" +msgid "-H or --header-in must be used with named columns" +msgstr "-H oder --header-in muss mit benannten Spalten verwendet werden" -#: src/field-ops.c:306 +#: src/field-ops.c:319 #, c-format -msgid "invalid column '%s' for operation %s" -msgstr "Ungültige Spalte »%s« für die Operation %s" +msgid "" +"input error for operation %s: fields %,% have different " +"number of items" +msgstr "" +"Eingabefehler für Operation %s: Felder %,% haben " +"unterschiedliche Anzahl der Einträge" -#: src/field-ops.c:985 -#, c-format -msgid "invalid operation '%s'" -msgstr "Ungültige Operation »%s«" +#: src/field-ops.c:999 +msgid "invalid numeric value" +msgstr "Ungültiger numerischer Wert" #: src/field-ops.c:1001 +msgid "invalid base64 value" +msgstr "Ungültiger Base64-Wert" + +#: src/op-parser.c:163 src/op-parser.c:177 src/op-parser.c:184 #, c-format -msgid "conflicting operation found: expecting %s operations, but found %s operation %s" -msgstr "Widersprüchliche Operationen gefunden: %s Operationen wurden erwartet, aber %s Operationen %s gefunden" +msgid "too many parameters for operation %s" +msgstr "Zu viele Parameter für Operation %s" -#: src/field-ops.c:1009 +#: src/op-parser.c:174 #, c-format -msgid "missing field number after operation '%s'" -msgstr "Feldnummer nach der Operation »%s« fehlt" +msgid "strbin bucket size must not be zero" +msgstr "Strbin-Bucket-Größe darf nicht Null sein" -#: src/field-ops.c:1029 +#: src/op-parser.c:205 src/op-parser.c:216 src/op-parser.c:472 #, c-format -msgid "extra operands after '%s'" -msgstr "Zusätzliche Operanden nach »%s«" +msgid "missing field for operation %s" +msgstr "Feld für Operation %s fehlt" -#: src/field-ops.c:1094 -msgid "invalid numeric value" -msgstr "ungültiger numerischer Wert" +#: src/op-parser.c:211 src/op-parser.c:220 src/op-parser.c:275 +#: src/op-parser.c:508 +#, c-format +msgid "invalid field range for operation %s" +msgstr "Ungültiger Feldbereich für die Operation %s" -#: src/field-ops.c:1096 -msgid "invalid base64 value" -msgstr "ungültiger Base64-Wert" +#: src/op-parser.c:214 src/op-parser.c:224 src/op-parser.c:511 +#, c-format +msgid "invalid field pair for operation %s" +msgstr "Ungültiges Feldpaar für die Operation %s" + +#: src/op-parser.c:238 src/op-parser.c:486 +#, c-format +msgid "invalid field '%s' for operation %s" +msgstr "Ungültiges Feld »%s« für die Operation %s" + +#: src/op-parser.c:272 +#, c-format +msgid "field range for %s must be numeric" +msgstr "Feldbereich für %s muss numerisch sein" + +#: src/op-parser.c:332 +#, c-format +msgid "missing parameter for operation %s" +msgstr "Parameter für Operation %s fehlt" + +#: src/op-parser.c:340 +#, c-format +msgid "invalid parameter %s for operation %s" +msgstr "Ungültiger Parameter Spalte %s für Operation %s" + +#: src/op-parser.c:372 +#, c-format +msgid "operation %s requires field pairs" +msgstr "Option %s benötigt Feldpaare" + +#: src/op-parser.c:375 +#, c-format +msgid "operation %s cannot use pair of fields" +msgstr "Operation %s kann keine Feldpaare verarbeiten" + +#: src/op-parser.c:415 +#, c-format +msgid "conflicting operation %s" +msgstr "Operationskonflikt für %s" + +#: src/op-parser.c:418 src/op-parser.c:597 +#, c-format +msgid "invalid operation %s" +msgstr "Ungültige Operation %s" -#: src/system.h:101 +#: src/op-parser.c:423 +#, c-format +msgid "" +"conflicting operation found: expecting %s operations, but found %s operation " +"%s" +msgstr "" +"Widersprüchliche Operationen gefunden: %s Operationen wurden erwartet, aber " +"%s Operationen %s gefunden" + +#: src/op-parser.c:537 +#, c-format +msgid "crosstab requires exactly 2 fields, found %" +msgstr "Crosstab benötigt genau zwei Felder, % wurden gefunden" + +#: src/op-parser.c:550 +#, c-format +msgid "crosstab supports one operation, found %" +msgstr "Crosstab unterstützt eine Operation, % wurden gefunden" + +#: src/op-parser.c:559 +#, c-format +msgid "missing operation" +msgstr "Operation fehlt" + +#: src/op-parser.c:573 +#, c-format +msgid "extra operand %s" +msgstr "Zusätzlicher Operand %s" + +#: src/op-parser.c:710 src/op-scanner.c:210 +#, c-format +msgid "missing script (among arguments)" +msgstr "Fehlendes Skript (zwischen Argumenten)" + +#: src/op-scanner.c:167 +#, c-format +msgid "invalid numeric value '%s'" +msgstr "Ungültiger numerischer Wert »%s«" + +#: src/op-scanner.c:188 +#, c-format +msgid "invalid operand %s" +msgstr "Ungültiger Operand %s" + +#: src/op-scanner.c:244 +#, c-format +msgid "unknown token %d\n" +msgstr "Unbekannter Token %d\n" + +#: src/system.h:133 msgid " --help display this help and exit\n" msgstr " --help zeigt diese Hilfe an und beendet.\n" -#: src/system.h:103 +#: src/system.h:135 msgid " --version output version information and exit\n" msgstr " --version zeigt die Versionsinformation an und beendet.\n" -#: src/system.h:108 +#: src/system.h:140 #, c-format msgid "Try '%s --help' for more information.\n" msgstr "»%s --help« gibt weitere Informationen.\n" - -#~ msgid "For grouping operations 'col' is the input field to use." -#~ msgstr "Für die Gruppierungsoperationen ist »Sp« das zu verwendende Eingabefeld." - -#~ msgid " --debug print helpful debugging information\n" -#~ msgstr "" -#~ " --debug gibt hilfreiche Informationen zur\n" -#~ " Fehlerdiagnose aus\n" - -#~ msgid "invalid numeric input in line %zu field %zu: '%s'" -#~ msgstr "Ungültige numerische Eingabe in Zeile %zu, Feld %zu: »%s«" - -#~ msgid "invalid field value for grouping '%s'" -#~ msgstr "Ungültiger Feldwert für Gruppierung »%s«" - -#~ msgid "invalid field value (zero) for grouping" -#~ msgstr "Ungültiger Feldwert (Null) für Gruppierung" Binary files /tmp/tmp4U70c2/7esjCa0Q6b/datamash-1.0.7/po/eo.gmo and /tmp/tmp4U70c2/Lx1O0FDBbS/datamash-1.1.1/po/eo.gmo differ diff -Nru datamash-1.0.7/po/eo.po datamash-1.1.1/po/eo.po --- datamash-1.0.7/po/eo.po 2015-06-22 00:23:14.000000000 +0000 +++ datamash-1.1.1/po/eo.po 2017-01-19 18:51:35.000000000 +0000 @@ -1,21 +1,23 @@ # Esperanto translation # Copyright (C) 2015 Free Software Foundation, Inc. # This file is distributed under the same license as the datamash package. -# Felipe Castro , 2014, 2015. +# Felipe Castro , 2014, 2015, 2016. # msgid "" msgstr "" -"Project-Id-Version: GNU datamash 1.0.6.54\n" +"Project-Id-Version: GNU datamash 1.0.7.58\n" "Report-Msgid-Bugs-To: bug-datamash@gnu.org\n" -"POT-Creation-Date: 2015-05-28 14:22-0400\n" -"PO-Revision-Date: 2015-06-19 22:08-0300\n" +"POT-Creation-Date: 2017-01-19 13:51-0500\n" +"PO-Revision-Date: 2016-10-13 22:38-0300\n" "Last-Translator: Felipe Castro \n" "Language-Team: Esperanto \n" "Language: eo\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.7.7\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n" +"X-Generator: Poedit 1.5.4\n" "X-Poedit-SourceCharset: UTF-8\n" #: lib/closeout.c:112 @@ -107,11 +109,11 @@ #. If you don't know what to put here, please see #. #. and use glyphs suitable for your language. -#: lib/quotearg.c:312 +#: lib/quotearg.c:354 msgid "`" msgstr "‘" -#: lib/quotearg.c:313 +#: lib/quotearg.c:355 msgid "'" msgstr "’" @@ -135,14 +137,17 @@ #: lib/version-etc.c:86 msgid "" "\n" -"License GPLv3+: GNU GPL version 3 or later .\n" +"License GPLv3+: GNU GPL version 3 or later .\n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" "\n" msgstr "" "\n" -"Permeso GPLv3+: GNU GPL versio 3 aŭ posta .\n" -"Tio ĉi estas libera programaro: vi estas libera por ŝanĝi kaj redisdoni ĝin.\n" +"Permeso GPLv3+: GNU GPL versio 3 aŭ posta .\n" +"Tio ĉi estas libera programaro: vi estas libera por ŝanĝi kaj redisdoni " +"ĝin.\n" "Ekzistas NENIU GARANTIO, laŭ plej amplekse permesate de la leĝoj.\n" "\n" @@ -284,7 +289,8 @@ #: lib/version-etc.c:256 msgid "General help using GNU software: \n" -msgstr "Ĝenerala helpo por uzi programaron GNU: \n" +msgstr "" +"Ĝenerala helpo por uzi programaron GNU: \n" #: lib/xalloc-die.c:34 msgid "memory exhausted" @@ -306,296 +312,462 @@ msgstr "%s%s-argumento '%s' tro larĝas" #. This is a proper name. See the gettext manual, section Names. -#: src/datamash.c:61 +#: src/datamash.c:64 msgid "Assaf Gordon" msgstr "Assaf Gordon" -#: src/datamash.c:161 src/field-ops.c:388 +#: src/datamash.c:151 src/datamash.c:467 #, c-format msgid "column name %s not found in input file" msgstr "kolumna nomo %s ne estis trovata en enig-dosiero" -#: src/datamash.c:174 +#: src/datamash.c:164 #, c-format -msgid "Usage: %s [OPTION] op [col] [op col ...]\n" -msgstr "Uzmaniero: %s [MODIFILO] op [kol] [op kol ...]\n" +msgid "Usage: %s [OPTION] op [fld] [op fld ...]\n" +msgstr "Uzmaniero: %s [MODIFILO] op [kmp] [op kmp ...]\n" -#: src/datamash.c:177 +#: src/datamash.c:167 msgid "Performs numeric/string operations on input from stdin." msgstr "Faras numerajn/ĉenajn operaciojn sur la enigo el la ĉefenigujo." -#: src/datamash.c:180 -msgid "'op' is the operation to perform;\n" -msgstr "'op' estas la farota operacio;\n" +#: src/datamash.c:170 +msgid "" +"'op' is the operation to perform. If a primary operation is used,\n" +"it must be listed first, optionally followed by other operations.\n" +msgstr "" +"'op' estas la farota operacio. Se unua-ranga operacio estas uzata,\n" +"ĝi devas esti listata unue, nedevige sekvata de aliaj operacioj.\n" -#: src/datamash.c:181 +#: src/datamash.c:173 msgid "" -"For grouping,per-line operations 'col' is the input field to use;\n" -"'col' can be a number (1=first field), or a column name when using\n" -"-H or --header-in options.\n" -msgstr "" -"Por grupigaj,po-liniaj operacioj 'col' estas la uzenda enig-kampo;\n" -"'col' povas esti numero (1=unua kampo), aŭ kolumna nomo kiam\n" -"modifiloj -H aŭ --header-in estas uzataj.\n" +"'fld' is the input field to use. 'fld' can be a number (1=first field),\n" +"or a field name when using the -H or --header-in options.\n" +msgstr "" +"'kmp' estas la eniga kampo por uzi. 'kmp' povas esti numero (1=unua " +"kampo),\n" +"aŭ kamp-nomo dum uzo de modifiloj -H aŭ --header-in.\n" -#: src/datamash.c:187 -msgid "File operations:\n" -msgstr "Dosieraj operacioj:\n" +#: src/datamash.c:176 +msgid "" +"Multiple fields can be listed with a comma (e.g. 1,6,8). A range of\n" +"fields can be listed with a dash (e.g. 2-8). Use colons for operations\n" +"which require a pair of fields (e.g. 'pcov 2:6').\n" +msgstr "" +"Multopaj kampoj povas esti listataj per komo (ekz. 1,6,8). Limoj de\n" +"kampoj povas esti listataj per strekteto( ekz. 2-8). Uzu dupunktojn por\n" +"operacioj kiuj postulas paron da kampoj (ekz. 'pcov 2:6').\n" + +#: src/datamash.c:181 +msgid "Primary operations:\n" +msgstr "Unua-rangaj operacioj:\n" -#: src/datamash.c:190 +#: src/datamash.c:184 msgid "Line-Filtering operations:\n" msgstr "Lini-filtraj operacioj:\n" -#: src/datamash.c:193 +#: src/datamash.c:187 msgid "Per-Line operations:\n" msgstr "Po-liniaj operacioj:\n" -#: src/datamash.c:196 +#: src/datamash.c:191 msgid "Numeric Grouping operations:\n" msgstr "Numeraj grupigaj operacioj:\n" -#: src/datamash.c:199 +#: src/datamash.c:194 msgid "Textual/Numeric Grouping operations:\n" msgstr "Tekstaj/numeraj grupigaj operacioj:\n" -#: src/datamash.c:203 +#: src/datamash.c:198 msgid "Statistical Grouping operations:\n" msgstr "Statistikaj grupigaj operacioj:\n" -#: src/datamash.c:210 -msgid "Options:\n" -msgstr "Modifiloj:\n" - -#: src/datamash.c:211 +#: src/datamash.c:206 msgid "Grouping Options:\n" msgstr "Grupigaj modifiloj:\n" -#: src/datamash.c:212 +#: src/datamash.c:207 msgid "" " -f, --full print entire input line before op results\n" " (default: print only the grouped keys)\n" msgstr "" -" -f, --full montri la tutan enig-linion antaŭ ol op-rezultoj\n" +" -f, --full montri la tutan enig-linion antaŭ ol op-" +"rezultoj\n" " (apriore: montri nur la grupitajn ŝlosilojn)\n" -#: src/datamash.c:216 -msgid " -g, --group=X[,Y,Z] group via fields X,[Y,Z]\n" -msgstr " -g, --group=X[,Y,Z] grupigi laŭ kampoj X,[Y,Z]\n" +#: src/datamash.c:211 +msgid "" +" -g, --group=X[,Y,Z] group via fields X,[Y,Z];\n" +" equivalent to primary operation 'groupby'\n" +msgstr "" +" -g, --group=X[,Y,Z] grupigi laŭ kampoj X,[Y,Z];\n" +" ekvivalenta al unua-ranga operacio 'groupby'\n" -#: src/datamash.c:219 +#: src/datamash.c:215 msgid " --header-in first input line is column headers\n" msgstr " --header-in unua enig-linio estas la kolumnaj kapoj\n" -#: src/datamash.c:222 +#: src/datamash.c:218 msgid " --header-out print column headers as first line\n" -msgstr " --header-out montri kolumnajn kapojn kiel unuan linion\n" +msgstr "" +" --header-out montri kolumnajn kapojn kiel unuan linion\n" -#: src/datamash.c:225 +#: src/datamash.c:221 msgid " -H, --headers same as '--header-in --header-out'\n" msgstr " -H, --headers same ol '--header-in --header-out'\n" -#: src/datamash.c:228 +#: src/datamash.c:224 msgid "" " -i, --ignore-case ignore upper/lower case when comparing text;\n" " this affects grouping, and string operations\n" msgstr "" " -i, --ignore-case preteratenti usklecon dum komparo de teksto;\n" -" tio ĉi influas grupigon, kaj ĉenajn operaciojn\n" +" tio ĉi influas grupigon, kaj ĉenajn " +"operaciojn\n" -#: src/datamash.c:232 +#: src/datamash.c:228 msgid "" -" -s, --sort sort the input before grouping; this removes the\n" -" need to manually pipe the input through 'sort'\n" +" -s, --sort sort the input before grouping; this removes " +"the\n" +" need to manually pipe the input through " +"'sort'\n" msgstr "" -" -s, --sort ordigi la enigon antaŭ ol grupigi; tio ĉi forigas la\n" +" -s, --sort ordigi la enigon antaŭ ol grupigi; tio ĉi " +"forigas la\n" " neceson mem dukti la enigon tra 'sort'\n" -#: src/datamash.c:237 +#: src/datamash.c:233 msgid "File Operation Options:\n" msgstr "Dosier-operaciaj modifiloj:\n" -#: src/datamash.c:238 +#: src/datamash.c:234 msgid " --no-strict allow lines with varying number of fields\n" -msgstr " --no-strict permesas liniojn kun variebla nombro da kampoj\n" +msgstr "" +" --no-strict permesas liniojn kun variebla nombro da kampoj\n" -#: src/datamash.c:241 +#: src/datamash.c:237 #, c-format msgid " --filler=X fill missing values with X (default %s)\n" -msgstr " --filler=X kompletigas mankantajn valorojn per X (aprioras %s)\n" +msgstr "" +" --filler=X kompletigas mankantajn valorojn per X (aprioras " +"%s)\n" -#: src/datamash.c:246 +#: src/datamash.c:242 msgid "General Options:\n" msgstr "Ĝeneralaj modifiloj:\n" -#: src/datamash.c:247 +#: src/datamash.c:243 msgid " -t, --field-separator=X use X instead of TAB as field delimiter\n" msgstr " -t, --field-separator=X uzu X antataŭ TAB kiel kamp-disigilo\n" -#: src/datamash.c:250 +#: src/datamash.c:246 msgid " --narm skip NA/NaN values\n" msgstr " --narm pretersalti valorojn NA/NaN\n" -#: src/datamash.c:253 +#: src/datamash.c:249 msgid "" " -W, --whitespace use whitespace (one or more spaces and/or tabs)\n" " for field delimiters\n" msgstr "" -" -W, --whitespace uzu blankspacon (unu aŭ pli spacoj kaj/aŭ taboj)\n" +" -W, --whitespace uzu blankspacon (unu aŭ pli spacoj kaj/" +"aŭ taboj)\n" " por kamp-disigiloj\n" -#: src/datamash.c:257 +#: src/datamash.c:253 msgid " -z, --zero-terminated end lines with 0 byte, not newline\n" -msgstr " -z, --zero-terminated fini liniojn per la bajto 0, ne novlini-signo\n" +msgstr "" +" -z, --zero-terminated fini liniojn per la bajto 0, ne novlini-signo\n" -#: src/datamash.c:266 +#: src/datamash.c:262 msgid "Examples:" msgstr "Ekzemploj:" -#: src/datamash.c:268 +#: src/datamash.c:264 msgid "Print the sum and the mean of values from column 1:" msgstr "Montri la sumon kaj la meznombran valoron el kolumno 1:" -#: src/datamash.c:273 +#: src/datamash.c:269 msgid "Transpose input:" msgstr "Transponi la enigon:" -#: src/datamash.c:280 +#: src/datamash.c:276 msgid "For detailed usage information and examples, see\n" msgstr "Por detala uzmaniera informo kaj ekzemploj, konsultu\n" -#: src/datamash.c:282 +#: src/datamash.c:278 msgid "The manual and more examples are available at\n" msgstr "La gvidilo kaj pli ekzemploj disponeblas ĉe\n" -#: src/datamash.c:291 +#: src/datamash.c:287 #, c-format -msgid "invalid input: field % requested, line % has only % fields" -msgstr "malvalida enigo: kampo % postulata, linio % havas nur % kampojn" +msgid "" +"invalid input: field % requested, line % has only " +"% fields" +msgstr "" +"malvalida enigo: kampo % postulata, linio % havas nur " +"% kampojn" -#: src/datamash.c:349 +#: src/datamash.c:357 #, c-format msgid "%s in line % field %: '%s'" msgstr "%s en linio % kampo %: '%s'" -#: src/datamash.c:487 src/datamash.c:784 -#, c-format -msgid "-H or --header-in must be used with named columns" -msgstr "-H aŭ --header-in devas esti uzataj kun nomigitaj kolumnoj" - -#: src/datamash.c:588 +#: src/datamash.c:676 #, c-format msgid "" -"transpose input error: line % has % fields (previous lines had %);\n" +"transpose input error: line % has % fields (previous lines " +"had %);\n" "see --help to disable strict mode" msgstr "" -"transpona enig-eraro: linio % havas % kampojn (antaŭaj linioj havis %);\n" +"transpona enig-eraro: linio % havas % kampojn (antaŭaj " +"linioj havis %);\n" "konsultu --help por malebligi severan reĝimon" -#: src/datamash.c:644 +#: src/datamash.c:733 #, c-format msgid "" -"reverse-field input error: line % has % fields (previous lines had %);\n" +"reverse-field input error: line % has % fields (previous " +"lines had %);\n" "see --help to disable strict mode" msgstr "" -"renvers-kampa enig-eraro: linio % havas % kampojn (antaŭaj linioj havis %);\n" +"renvers-kampa enig-eraro: linio % havas % kampojn (antaŭaj " +"linioj havis %);\n" "konsultu --help por malebligi severan reĝimon" -#: src/datamash.c:820 +#: src/datamash.c:837 src/datamash.c:843 +#, c-format +msgid "" +"line % (% fields):\n" +" " +msgstr "" +"linio % (% kampoj):\n" +" " + +#: src/datamash.c:849 +#, c-format +msgid "" +"check failed: line % has % fields (previous line had " +"%)" +msgstr "" +"kontrolo malsukcesis: linio % havas % kampojn (antaŭa " +"linio havis %)" + +#: src/datamash.c:861 +#, c-format +msgid "% line" +msgid_plural "% lines" +msgstr[0] "% linio" +msgstr[1] "% linioj" + +#: src/datamash.c:864 +#, c-format +msgid "% field" +msgid_plural "% fields" +msgstr[0] "% kampo" +msgstr[1] "% kampoj" + +#: src/datamash.c:965 #, c-format msgid "hash memory allocation error" msgstr "eraro de rezervo por haket-memoro" -#: src/datamash.c:882 +#: src/datamash.c:1027 #, c-format msgid "sort command too-long (please report this bug)" msgstr "ordiga komando tro longas (bonvole raportu tiun ĉi program-mison)" -#: src/datamash.c:888 +#: src/datamash.c:1033 #, c-format msgid "failed to run 'sort': popen failed" msgstr "malsukcesis lanĉi 'sort': popen fiaskis" -#: src/datamash.c:904 +#: src/datamash.c:1049 #, c-format msgid "read error" msgstr "leg-eraro" -#: src/datamash.c:912 +#: src/datamash.c:1057 #, c-format msgid "read error (on close)" msgstr "leg-eraro (dum fermo)" -#: src/datamash.c:939 -#, c-format -msgid "invalid empty grouping parameter" -msgstr "malvalida malplena grupiga parametro" - -#: src/datamash.c:946 -#, c-format -msgid "invalid grouping parameter %s" -msgstr "malvalida grupiga parametro %s" - -#: src/datamash.c:1031 +#: src/datamash.c:1133 #, c-format msgid "the delimiter must be a single character" msgstr "la disigilo devas esti ununura signo" -#: src/datamash.c:1067 +#: src/datamash.c:1170 #, c-format msgid "missing operation specifiers" msgstr "mankas operaciaj indikiloj" -#: src/field-ops.c:293 +#: src/datamash.c:1184 +#, c-format +msgid "-H or --header-in must be used with named columns" +msgstr "-H aŭ --header-in devas esti uzataj kun nomigitaj kolumnoj" + +#: src/field-ops.c:319 #, c-format -msgid "invalid empty column for operation %s" -msgstr "malvalida malplena kolumno por la operacio %s" +msgid "" +"input error for operation %s: fields %,% have different " +"number of items" +msgstr "" +"eniga eraro por operacio %s: kampoj %,% havas malsamaj " +"numbro da eroj" + +#: src/field-ops.c:999 +msgid "invalid numeric value" +msgstr "malvalida cifera valoro" + +#: src/field-ops.c:1001 +msgid "invalid base64 value" +msgstr "malvalida valoro base64" -#: src/field-ops.c:306 +#: src/op-parser.c:163 src/op-parser.c:177 src/op-parser.c:184 #, c-format -msgid "invalid column '%s' for operation %s" -msgstr "malvalida kolumno '%s' por la operacio %s" +msgid "too many parameters for operation %s" +msgstr "tro multaj parametroj por la operacio %s" -#: src/field-ops.c:985 +#: src/op-parser.c:174 #, c-format -msgid "invalid operation '%s'" -msgstr "malvalida operacio '%s'" +msgid "strbin bucket size must not be zero" +msgstr "Grando de forgesujo 'strbin' ne devas esti nula" -#: src/field-ops.c:1001 +#: src/op-parser.c:205 src/op-parser.c:216 src/op-parser.c:472 #, c-format -msgid "conflicting operation found: expecting %s operations, but found %s operation %s" -msgstr "konfliktanta operacio estis trovata: ni atendis operaciojn %s, sed trovis %s operacio %s" +msgid "missing field for operation %s" +msgstr "mankas kampo por la operacio %s" -#: src/field-ops.c:1009 +#: src/op-parser.c:211 src/op-parser.c:220 src/op-parser.c:275 +#: src/op-parser.c:508 #, c-format -msgid "missing field number after operation '%s'" -msgstr "mankas kamp-numero post operacio '%s'" +msgid "invalid field range for operation %s" +msgstr "malvalidaj kamp-limoj por la operacio %s" -#: src/field-ops.c:1029 +#: src/op-parser.c:214 src/op-parser.c:224 src/op-parser.c:511 #, c-format -msgid "extra operands after '%s'" -msgstr "kromaj operandoj post '%s'" +msgid "invalid field pair for operation %s" +msgstr "malvalida paro da kampoj por la operacio %s" -#: src/field-ops.c:1094 -msgid "invalid numeric value" -msgstr "malvalida cifera valoro" +#: src/op-parser.c:238 src/op-parser.c:486 +#, c-format +msgid "invalid field '%s' for operation %s" +msgstr "malvalida kampo '%s' por la operacio %s" -#: src/field-ops.c:1096 -msgid "invalid base64 value" -msgstr "malvalida valoro base64" +#: src/op-parser.c:272 +#, c-format +msgid "field range for %s must be numeric" +msgstr "kampaj limoj por %s devas esti cifera" + +#: src/op-parser.c:332 +#, c-format +msgid "missing parameter for operation %s" +msgstr "mankas parametro por la operacio %s" + +#: src/op-parser.c:340 +#, c-format +msgid "invalid parameter %s for operation %s" +msgstr "malvalida parametro %s por la operacio %s" + +#: src/op-parser.c:372 +#, c-format +msgid "operation %s requires field pairs" +msgstr "operacio %s postulas paron da kampoj" + +#: src/op-parser.c:375 +#, c-format +msgid "operation %s cannot use pair of fields" +msgstr "operacio %s ne povas uzi paro da kampoj" + +#: src/op-parser.c:415 +#, c-format +msgid "conflicting operation %s" +msgstr "malakorda operacio %s" + +#: src/op-parser.c:418 src/op-parser.c:597 +#, c-format +msgid "invalid operation %s" +msgstr "malvalida operacio %s" + +#: src/op-parser.c:423 +#, c-format +msgid "" +"conflicting operation found: expecting %s operations, but found %s operation " +"%s" +msgstr "" +"konfliktanta operacio estis trovata: ni atendis operaciojn %s, sed trovis %s " +"operacio %s" + +#: src/op-parser.c:537 +#, c-format +msgid "crosstab requires exactly 2 fields, found %" +msgstr "'crosstab' postulas precize 2 kampojn, ni trovis %" -#: src/system.h:101 +#: src/op-parser.c:550 +#, c-format +msgid "crosstab supports one operation, found %" +msgstr "'crosstab' subtenas unu operacion, ni trovis %" + +#: src/op-parser.c:559 +#, c-format +msgid "missing operation" +msgstr "mankas operacion" + +#: src/op-parser.c:573 +#, c-format +msgid "extra operand %s" +msgstr "kroma operando %s" + +#: src/op-parser.c:710 src/op-scanner.c:210 +#, c-format +msgid "missing script (among arguments)" +msgstr "mankas skripto (inter argumentoj)" + +#: src/op-scanner.c:167 +#, c-format +msgid "invalid numeric value '%s'" +msgstr "malvalida cifera valoro '%s'" + +#: src/op-scanner.c:188 +#, c-format +msgid "invalid operand %s" +msgstr "malvalida operando %s" + +#: src/op-scanner.c:244 +#, c-format +msgid "unknown token %d\n" +msgstr "nekonata ĵetono %d\n" + +#: src/system.h:133 msgid " --help display this help and exit\n" msgstr " --help montri ĉi tiun helpon kaj eliri\n" -#: src/system.h:103 +#: src/system.h:135 msgid " --version output version information and exit\n" msgstr " --version eligi informon pri versio kaj eliri\n" -#: src/system.h:108 +#: src/system.h:140 #, c-format msgid "Try '%s --help' for more information.\n" msgstr "Provu '%s --help' por pli da informo.\n" +#~ msgid "'op' is the operation to perform;\n" +#~ msgstr "'op' estas la farota operacio;\n" + +#~ msgid "File operations:\n" +#~ msgstr "Dosieraj operacioj:\n" + +#~ msgid "Options:\n" +#~ msgstr "Modifiloj:\n" + +#~ msgid " -g, --group=X[,Y,Z] group via fields X,[Y,Z]\n" +#~ msgstr " -g, --group=X[,Y,Z] grupigi laŭ kampoj X,[Y,Z]\n" + +#~ msgid "invalid empty grouping parameter" +#~ msgstr "malvalida malplena grupiga parametro" + +#~ msgid "invalid grouping parameter %s" +#~ msgstr "malvalida grupiga parametro %s" + #~ msgid "For grouping operations 'col' is the input field to use." #~ msgstr "Por grupigi operaciojn, 'kol' estas la uzota enig-kampo." Binary files /tmp/tmp4U70c2/7esjCa0Q6b/datamash-1.0.7/po/fr.gmo and /tmp/tmp4U70c2/Lx1O0FDBbS/datamash-1.1.1/po/fr.gmo differ diff -Nru datamash-1.0.7/po/fr.po datamash-1.1.1/po/fr.po --- datamash-1.0.7/po/fr.po 2015-06-17 23:45:11.000000000 +0000 +++ datamash-1.1.1/po/fr.po 2017-01-19 18:51:35.000000000 +0000 @@ -1,20 +1,21 @@ # Messages français pour datamash -# Copyright (C) 2015 Free Software Foundation, Inc. +# Copyright (C) 2016 Free Software Foundation, Inc. # This file is distributed under the same license as the datamash package. # Frédéric Marchal , 2015. # msgid "" msgstr "" -"Project-Id-Version: GNU datamash 1.0.6.54\n" +"Project-Id-Version: GNU datamash 1.0.7.58\n" "Report-Msgid-Bugs-To: bug-datamash@gnu.org\n" -"POT-Creation-Date: 2015-05-28 14:22-0400\n" -"PO-Revision-Date: 2015-06-05 21:01+0200\n" +"POT-Creation-Date: 2017-01-19 13:51-0500\n" +"PO-Revision-Date: 2016-01-01 20:15+0100\n" "Last-Translator: Frédéric Marchal \n" "Language-Team: French \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: lib/closeout.c:112 @@ -106,11 +107,11 @@ #. If you don't know what to put here, please see #. #. and use glyphs suitable for your language. -#: lib/quotearg.c:312 +#: lib/quotearg.c:354 msgid "`" msgstr "« " -#: lib/quotearg.c:313 +#: lib/quotearg.c:355 msgid "'" msgstr " »" @@ -134,14 +135,17 @@ #: lib/version-etc.c:86 msgid "" "\n" -"License GPLv3+: GNU GPL version 3 or later .\n" +"License GPLv3+: GNU GPL version 3 or later .\n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" "\n" msgstr "" "\n" -"Licence GPLv3+: GNU GPL version 3 ou ultérieure .\n" -"Ceci est un logiciel libre: vous êtes libre de le modifier et de le redistribuer.\n" +"Licence GPLv3+: GNU GPL version 3 ou ultérieure .\n" +"Ceci est un logiciel libre: vous êtes libre de le modifier et de le " +"redistribuer.\n" "Il n'y a PAS de GARANTIE dans les limites permises par la loi.\n" #. TRANSLATORS: %s denotes an author name. @@ -285,7 +289,9 @@ #: lib/version-etc.c:256 msgid "General help using GNU software: \n" -msgstr "Aide générale sur l'utilisation des logiciels GNU: \n" +msgstr "" +"Aide générale sur l'utilisation des logiciels GNU: \n" #: lib/xalloc-die.c:34 msgid "memory exhausted" @@ -307,303 +313,489 @@ msgstr "argument de %s%s « %s » trop grand" #. This is a proper name. See the gettext manual, section Names. -#: src/datamash.c:61 +#: src/datamash.c:64 msgid "Assaf Gordon" msgstr "Assaf Gordon" -#: src/datamash.c:161 src/field-ops.c:388 +#: src/datamash.c:151 src/datamash.c:467 #, c-format msgid "column name %s not found in input file" msgstr "nom de colonne %s pas trouvé dans le fichier d'entrée" -#: src/datamash.c:174 +#: src/datamash.c:164 #, c-format -msgid "Usage: %s [OPTION] op [col] [op col ...]\n" -msgstr "Usage: %s [OPTION] op [col] [op col ...]\n" +msgid "Usage: %s [OPTION] op [fld] [op fld ...]\n" +msgstr "Usage: %s [OPTION] op [fld] [op col ...]\n" -#: src/datamash.c:177 +#: src/datamash.c:167 msgid "Performs numeric/string operations on input from stdin." -msgstr "Réalise des opérations numériques/textuelles sur des entrées provenant de stdin." +msgstr "" +"Réalise des opérations numériques/textuelles sur des entrées provenant de " +"stdin." -#: src/datamash.c:180 -msgid "'op' is the operation to perform;\n" -msgstr "« op » est l'opération à réaliser;\n" +#: src/datamash.c:170 +msgid "" +"'op' is the operation to perform. If a primary operation is used,\n" +"it must be listed first, optionally followed by other operations.\n" +msgstr "" +"« op » est l'opération à réaliser. Si une opération primaire est utilisée,\n" +"elle doit être listée en premier. Elle peut être suivie d'autres " +"opérations.\n" -#: src/datamash.c:181 +#: src/datamash.c:173 msgid "" -"For grouping,per-line operations 'col' is the input field to use;\n" -"'col' can be a number (1=first field), or a column name when using\n" -"-H or --header-in options.\n" -msgstr "" -"Pour les opérations de groupement par ligne, « col » est le champ\n" -"d'entrée à utiliser. « col » peut être un nombre (1=premier champ)\n" -"ou un nom de colonne lorsque les options -H ou --header-in sont\n" -"utilisées.\n" +"'fld' is the input field to use. 'fld' can be a number (1=first field),\n" +"or a field name when using the -H or --header-in options.\n" +msgstr "" +"« fld » est le champ d'entrée à utiliser. « fld » peut être un nombre " +"(1=premier champ),\n" +"ou un nom de champ lorsque les options -H ou --header-in sont utilisés.\n" -#: src/datamash.c:187 -msgid "File operations:\n" -msgstr "Opérations sur les fichiers:\n" +#: src/datamash.c:176 +msgid "" +"Multiple fields can be listed with a comma (e.g. 1,6,8). A range of\n" +"fields can be listed with a dash (e.g. 2-8). Use colons for operations\n" +"which require a pair of fields (e.g. 'pcov 2:6').\n" +msgstr "" +"Plusieurs champs peuvent être listés avec une virgule (par ex: 1,6,8). Une " +"plage\n" +"de champs peut être listée avec un tiret (par ex: 2-8). Utilisez un deux-" +"points\n" +"pour les opérations qui requièrent une paire de champs (par ex « pcov " +"2:6 »).\n" + +#: src/datamash.c:181 +msgid "Primary operations:\n" +msgstr "Opérations primaires:\n" -#: src/datamash.c:190 +#: src/datamash.c:184 msgid "Line-Filtering operations:\n" msgstr "Opérations de filtrage des lignes:\n" -#: src/datamash.c:193 +#: src/datamash.c:187 msgid "Per-Line operations:\n" msgstr "Opérations sur les lignes:\n" -#: src/datamash.c:196 +#: src/datamash.c:191 msgid "Numeric Grouping operations:\n" msgstr "Opérations de groupement numériques:\n" -#: src/datamash.c:199 +#: src/datamash.c:194 msgid "Textual/Numeric Grouping operations:\n" msgstr "Opérations de groupement Textuels/Numériques:\n" -#: src/datamash.c:203 +#: src/datamash.c:198 msgid "Statistical Grouping operations:\n" msgstr "Opérations de groupement statistiques:\n" -#: src/datamash.c:210 -msgid "Options:\n" -msgstr "Options:\n" - -#: src/datamash.c:211 +#: src/datamash.c:206 msgid "Grouping Options:\n" msgstr "Options de groupement:\n" -#: src/datamash.c:212 +#: src/datamash.c:207 msgid "" " -f, --full print entire input line before op results\n" " (default: print only the grouped keys)\n" msgstr "" -" -f, --full afficher la ligne d'entrée entière avant les résultats de op\n" -" (par défaut: afficher uniquement les clés groupées)\n" +" -f, --full afficher la ligne d'entrée entière avant les " +"résultats de op\n" +" (par défaut: afficher uniquement les clés " +"groupées)\n" -#: src/datamash.c:216 -msgid " -g, --group=X[,Y,Z] group via fields X,[Y,Z]\n" -msgstr " -g, --group=X[,Y,Z] grouper selon les champs X,[Y,Z]\n" +#: src/datamash.c:211 +msgid "" +" -g, --group=X[,Y,Z] group via fields X,[Y,Z];\n" +" equivalent to primary operation 'groupby'\n" +msgstr "" +" -g, --group=X[,Y,Z] groupe selon les champs X,[Y,Z];\n" +" équivalent à l'opération primaire « groupby »\n" -#: src/datamash.c:219 +#: src/datamash.c:215 msgid " --header-in first input line is column headers\n" -msgstr " --header-in la première ligne d'entrée est un en-tête de colonnes\n" +msgstr "" +" --header-in la première ligne d'entrée est un en-tête de " +"colonnes\n" -#: src/datamash.c:222 +#: src/datamash.c:218 msgid " --header-out print column headers as first line\n" -msgstr " --header-out afficher les en-têtes des colonnes en première ligne\n" +msgstr "" +" --header-out afficher les en-têtes des colonnes en première " +"ligne\n" -#: src/datamash.c:225 +#: src/datamash.c:221 msgid " -H, --headers same as '--header-in --header-out'\n" msgstr " -H, --headers identique à « --header-in --header-out »\n" -#: src/datamash.c:228 +#: src/datamash.c:224 msgid "" " -i, --ignore-case ignore upper/lower case when comparing text;\n" " this affects grouping, and string operations\n" msgstr "" -" -i, --ignore-case ignorer les majuscules/minuscules lors de la comparaison de textes;\n" -" ceci affecte le groupement et les opérations textuelles\n" +" -i, --ignore-case ignorer les majuscules/minuscules lors de la " +"comparaison de textes;\n" +" ceci affecte le groupement et les opérations " +"textuelles\n" -#: src/datamash.c:232 +#: src/datamash.c:228 msgid "" -" -s, --sort sort the input before grouping; this removes the\n" -" need to manually pipe the input through 'sort'\n" -msgstr "" -" -s, --sort trier les entrées avant de les grouper, ceci supprime\n" -" le besoin de pré-traiter manuellement les entrées avec\n" +" -s, --sort sort the input before grouping; this removes " +"the\n" +" need to manually pipe the input through " +"'sort'\n" +msgstr "" +" -s, --sort trier les entrées avant de les grouper, ceci " +"supprime\n" +" le besoin de pré-traiter manuellement les " +"entrées avec\n" " « sort »\n" -#: src/datamash.c:237 +#: src/datamash.c:233 msgid "File Operation Options:\n" msgstr "Options des opérations sur les fichiers:\n" -#: src/datamash.c:238 +#: src/datamash.c:234 msgid " --no-strict allow lines with varying number of fields\n" -msgstr " --no-strict accepter des lignes avec des nombres variables de champs\n" +msgstr "" +" --no-strict accepter des lignes avec des nombres variables " +"de champs\n" -#: src/datamash.c:241 +#: src/datamash.c:237 #, c-format msgid " --filler=X fill missing values with X (default %s)\n" -msgstr " --filler=X remplir les valeurs manquantes avec X (%s par défaut)\n" +msgstr "" +" --filler=X remplir les valeurs manquantes avec X (%s par " +"défaut)\n" -#: src/datamash.c:246 +#: src/datamash.c:242 msgid "General Options:\n" msgstr "Options générales:\n" -#: src/datamash.c:247 +#: src/datamash.c:243 msgid " -t, --field-separator=X use X instead of TAB as field delimiter\n" -msgstr " -t, --field-separator=X utiliser X au lieu de la tabulation comme délimiteur de champs\n" +msgstr "" +" -t, --field-separator=X utiliser X au lieu de la tabulation comme " +"délimiteur de champs\n" -#: src/datamash.c:250 +#: src/datamash.c:246 msgid " --narm skip NA/NaN values\n" msgstr " --narm passe outre les valeurs NA/NaN\n" -#: src/datamash.c:253 +#: src/datamash.c:249 msgid "" " -W, --whitespace use whitespace (one or more spaces and/or tabs)\n" " for field delimiters\n" msgstr "" -" -W, --whitespace utiliser des espaces (un ou plusieurs espaces ou tabulations)\n" +" -W, --whitespace utiliser des espaces (un ou plusieurs espaces ou " +"tabulations)\n" " comme délimiteurs de champs\n" -#: src/datamash.c:257 +#: src/datamash.c:253 msgid " -z, --zero-terminated end lines with 0 byte, not newline\n" -msgstr " -z, --zero-terminated terminer les lignes avec l'octet 0, pas un saut de ligne\n" +msgstr "" +" -z, --zero-terminated terminer les lignes avec l'octet 0, pas un saut " +"de ligne\n" -#: src/datamash.c:266 +#: src/datamash.c:262 msgid "Examples:" msgstr "Exemples:" -#: src/datamash.c:268 +#: src/datamash.c:264 msgid "Print the sum and the mean of values from column 1:" msgstr "Afficher la somme et la moyenne des valeurs de la colonne 1:" -#: src/datamash.c:273 +#: src/datamash.c:269 msgid "Transpose input:" msgstr "Transposer l'entrée:" -#: src/datamash.c:280 +#: src/datamash.c:276 msgid "For detailed usage information and examples, see\n" -msgstr "Pour des informations détaillées sur l'utilisation et des exemples, consultez\n" +msgstr "" +"Pour des informations détaillées sur l'utilisation et des exemples, " +"consultez\n" -#: src/datamash.c:282 +#: src/datamash.c:278 msgid "The manual and more examples are available at\n" msgstr "Le manuel et plus d'exemples sont disponibles sur\n" -#: src/datamash.c:291 +#: src/datamash.c:287 #, c-format -msgid "invalid input: field % requested, line % has only % fields" -msgstr "entrée invalide: champ % requis, ligne % a seulement % champs" +msgid "" +"invalid input: field % requested, line % has only " +"% fields" +msgstr "" +"entrée invalide: champ % requis, ligne % a seulement " +"% champs" -#: src/datamash.c:349 +#: src/datamash.c:357 #, c-format msgid "%s in line % field %: '%s'" msgstr "%s à la ligne % champ %: « %s »" -#: src/datamash.c:487 src/datamash.c:784 -#, c-format -msgid "-H or --header-in must be used with named columns" -msgstr "-H ou --header-in doit être utilisé avec des colonnes nommées" - -#: src/datamash.c:588 +#: src/datamash.c:676 #, c-format msgid "" -"transpose input error: line % has % fields (previous lines had %);\n" +"transpose input error: line % has % fields (previous lines " +"had %);\n" "see --help to disable strict mode" msgstr "" -"erreur de transposition d'entrée: la ligne % a % champs (les lignes précédentes en avaient %);\n" +"erreur de transposition d'entrée: la ligne % a % champs " +"(les lignes précédentes en avaient %);\n" "voyez --help pour désactiver le mode strict" -#: src/datamash.c:644 +#: src/datamash.c:733 #, c-format msgid "" -"reverse-field input error: line % has % fields (previous lines had %);\n" +"reverse-field input error: line % has % fields (previous " +"lines had %);\n" "see --help to disable strict mode" msgstr "" -"erreur d'inversion de champs d'entrée: la ligne % a % champs (les lignes précédentes en avaient %);\n" +"erreur d'inversion de champs d'entrée: la ligne % a % " +"champs (les lignes précédentes en avaient %);\n" "voyez --help pour désactiver le mode strict" -#: src/datamash.c:820 +#: src/datamash.c:837 src/datamash.c:843 +#, c-format +msgid "" +"line % (% fields):\n" +" " +msgstr "" +"ligne % (% champs):\n" +" " + +#: src/datamash.c:849 +#, c-format +msgid "" +"check failed: line % has % fields (previous line had " +"%)" +msgstr "" +"échec de vérification: ligne % a % champs (ligne " +"précédente avait %)" + +#: src/datamash.c:861 +#, c-format +msgid "% line" +msgid_plural "% lines" +msgstr[0] "% ligne" +msgstr[1] "% lignes" + +#: src/datamash.c:864 +#, c-format +msgid "% field" +msgid_plural "% fields" +msgstr[0] "% champ" +msgstr[1] "% champs" + +#: src/datamash.c:965 #, c-format msgid "hash memory allocation error" msgstr "erreur d'allocation de la mémoire de hachage" -#: src/datamash.c:882 +#: src/datamash.c:1027 #, c-format msgid "sort command too-long (please report this bug)" msgstr "commande tri trop longue (veuillez signaler ce bogue)" -#: src/datamash.c:888 +#: src/datamash.c:1033 #, c-format msgid "failed to run 'sort': popen failed" msgstr "échec à l'exécution de « sort »: popen a échoué" -#: src/datamash.c:904 +#: src/datamash.c:1049 #, c-format msgid "read error" msgstr "erreur de lecture" -#: src/datamash.c:912 +#: src/datamash.c:1057 #, c-format msgid "read error (on close)" msgstr "erreur de lecture (à la fermeture)" -#: src/datamash.c:939 -#, c-format -msgid "invalid empty grouping parameter" -msgstr "paramètre de groupement vide invalide" - -#: src/datamash.c:946 -#, c-format -msgid "invalid grouping parameter %s" -msgstr "paramètre de groupement %s invalide" - -#: src/datamash.c:1031 +#: src/datamash.c:1133 #, c-format msgid "the delimiter must be a single character" msgstr "le délimiteur doit être un caractère unique" -#: src/datamash.c:1067 +#: src/datamash.c:1170 #, c-format msgid "missing operation specifiers" msgstr "spécificateurs d'opération manquant" -#: src/field-ops.c:293 +#: src/datamash.c:1184 #, c-format -msgid "invalid empty column for operation %s" -msgstr "colonne vide invalide pour l'opération %s" +msgid "-H or --header-in must be used with named columns" +msgstr "-H ou --header-in doit être utilisé avec des colonnes nommées" -#: src/field-ops.c:306 +#: src/field-ops.c:319 #, c-format -msgid "invalid column '%s' for operation %s" -msgstr "colonne « %s » invalide pour l'opération %s" +msgid "" +"input error for operation %s: fields %,% have different " +"number of items" +msgstr "" +"erreur d'entrée pour l'opération %s: les champs %,% ont " +"des nombres différents d'éléments" -#: src/field-ops.c:985 -#, c-format -msgid "invalid operation '%s'" -msgstr "opération « %s » invalide" +#: src/field-ops.c:999 +msgid "invalid numeric value" +msgstr "valeur numérique invalide" #: src/field-ops.c:1001 +msgid "invalid base64 value" +msgstr "valeur base64 invalide" + +#: src/op-parser.c:163 src/op-parser.c:177 src/op-parser.c:184 #, c-format -msgid "conflicting operation found: expecting %s operations, but found %s operation %s" -msgstr "opération conflictuelle rencontrée: opérations « %s » attendues mais opération « %s » %s trouvée" +msgid "too many parameters for operation %s" +msgstr "trop de paramètres pour l'opération %s" -#: src/field-ops.c:1009 +#: src/op-parser.c:174 #, c-format -msgid "missing field number after operation '%s'" -msgstr "numéro de champ manquant après l'opération « %s »" +msgid "strbin bucket size must not be zero" +msgstr "la taille des godets strbin ne doit pas être zéro" -#: src/field-ops.c:1029 +#: src/op-parser.c:205 src/op-parser.c:216 src/op-parser.c:472 #, c-format -msgid "extra operands after '%s'" -msgstr "opérandes en trop après « %s »" +msgid "missing field for operation %s" +msgstr "champ manquant pour l'opération %s" -#: src/field-ops.c:1094 -msgid "invalid numeric value" -msgstr "valeur numérique invalide" +#: src/op-parser.c:211 src/op-parser.c:220 src/op-parser.c:275 +#: src/op-parser.c:508 +#, c-format +msgid "invalid field range for operation %s" +msgstr "plage de champs invalide pour l'opération %s" -#: src/field-ops.c:1096 -msgid "invalid base64 value" -msgstr "valeur base64 invalide" +#: src/op-parser.c:214 src/op-parser.c:224 src/op-parser.c:511 +#, c-format +msgid "invalid field pair for operation %s" +msgstr "paire de champs invalide pour l'opération %s" + +#: src/op-parser.c:238 src/op-parser.c:486 +#, c-format +msgid "invalid field '%s' for operation %s" +msgstr "champ « %s » invalide pour l'opération %s" + +#: src/op-parser.c:272 +#, c-format +msgid "field range for %s must be numeric" +msgstr "la plage de champs pour %s doit être numérique" + +#: src/op-parser.c:332 +#, c-format +msgid "missing parameter for operation %s" +msgstr "paramètre manquant pour l'opération %s" + +#: src/op-parser.c:340 +#, c-format +msgid "invalid parameter %s for operation %s" +msgstr "paramètre %s invalide pour l'opération %s" + +#: src/op-parser.c:372 +#, c-format +msgid "operation %s requires field pairs" +msgstr "l'opération %s requiert des paires de champs" + +#: src/op-parser.c:375 +#, c-format +msgid "operation %s cannot use pair of fields" +msgstr "l'opération %s ne peut pas utiliser de paire de champs" + +#: src/op-parser.c:415 +#, c-format +msgid "conflicting operation %s" +msgstr "opération %s conflictuelle" -#: src/system.h:101 +#: src/op-parser.c:418 src/op-parser.c:597 +#, c-format +msgid "invalid operation %s" +msgstr "opération %s invalide" + +#: src/op-parser.c:423 +#, c-format +msgid "" +"conflicting operation found: expecting %s operations, but found %s operation " +"%s" +msgstr "" +"opération conflictuelle rencontrée: opérations « %s » attendues mais " +"opération « %s » %s trouvée" + +#: src/op-parser.c:537 +#, c-format +msgid "crosstab requires exactly 2 fields, found %" +msgstr "crosstab requiert exactement 2 champs, % trouvés" + +#: src/op-parser.c:550 +#, c-format +msgid "crosstab supports one operation, found %" +msgstr "crosstab supporte une opération, % trouvée" + +#: src/op-parser.c:559 +#, c-format +msgid "missing operation" +msgstr "opération manquante" + +#: src/op-parser.c:573 +#, c-format +msgid "extra operand %s" +msgstr "opérande en trop après %s" + +#: src/op-parser.c:710 src/op-scanner.c:210 +#, c-format +msgid "missing script (among arguments)" +msgstr "script manquant (parmi les arguments)" + +#: src/op-scanner.c:167 +#, c-format +msgid "invalid numeric value '%s'" +msgstr "valeur numérique invalide « %s »" + +#: src/op-scanner.c:188 +#, c-format +msgid "invalid operand %s" +msgstr "opérande « %s » invalide" + +#: src/op-scanner.c:244 +#, c-format +msgid "unknown token %d\n" +msgstr "jeton %d inconnu\n" + +#: src/system.h:133 msgid " --help display this help and exit\n" msgstr " --help afficher cette aide et quitter\n" -#: src/system.h:103 +#: src/system.h:135 msgid " --version output version information and exit\n" msgstr " --version afficher les informations de version et quitter\n" -#: src/system.h:108 +#: src/system.h:140 #, c-format msgid "Try '%s --help' for more information.\n" msgstr "Essayez « %s --help » pour plus d'informations.\n" +#~ msgid "'op' is the operation to perform;\n" +#~ msgstr "« op » est l'opération à réaliser;\n" + +#~ msgid "File operations:\n" +#~ msgstr "Opérations sur les fichiers:\n" + +#~ msgid "Options:\n" +#~ msgstr "Options:\n" + +#~ msgid " -g, --group=X[,Y,Z] group via fields X,[Y,Z]\n" +#~ msgstr " -g, --group=X[,Y,Z] grouper selon les champs X,[Y,Z]\n" + +#~ msgid "invalid empty grouping parameter" +#~ msgstr "paramètre de groupement vide invalide" + +#~ msgid "invalid grouping parameter %s" +#~ msgstr "paramètre de groupement %s invalide" + #~ msgid "For grouping operations 'col' is the input field to use." -#~ msgstr "Pour les opérations de groupement, « col » est le champs d'entrée à utiliser." +#~ msgstr "" +#~ "Pour les opérations de groupement, « col » est le champs d'entrée à " +#~ "utiliser." #~ msgid " --debug print helpful debugging information\n" -#~ msgstr " --debug afficher des informations utiles au débogage\n" +#~ msgstr "" +#~ " --debug afficher des informations utiles au débogage\n" #~ msgid "invalid numeric input in line %zu field %zu: '%s'" #~ msgstr "entrée numérique invalide dans la ligne %zu champ %zu: « %s »" diff -Nru datamash-1.0.7/po/LINGUAS datamash-1.1.1/po/LINGUAS --- datamash-1.0.7/po/LINGUAS 2015-06-22 00:25:44.000000000 +0000 +++ datamash-1.1.1/po/LINGUAS 2017-01-19 19:33:20.000000000 +0000 @@ -2,8 +2,10 @@ de eo fr +nb nl pt_BR sr +sv uk vi diff -Nru datamash-1.0.7/po/Makefile.in.in datamash-1.1.1/po/Makefile.in.in --- datamash-1.0.7/po/Makefile.in.in 2015-06-22 00:26:22.000000000 +0000 +++ datamash-1.1.1/po/Makefile.in.in 2017-01-19 19:34:08.000000000 +0000 @@ -6,7 +6,7 @@ # notice and this notice are preserved. This file is offered as-is, # without any warranty. # -# Origin: gettext-0.19 +# Origin: gettext-0.19.8 GETTEXT_MACRO_VERSION = 0.19 PACKAGE = @PACKAGE@ @@ -43,6 +43,11 @@ MKDIR_P = @MKDIR_P@ mkdir_p = @mkdir_p@ +# When building gettext-tools, we prefer to use the built programs +# rather than installed programs. However, we can't do that when we +# are cross compiling. +CROSS_COMPILING = @CROSS_COMPILING@ + GMSGFMT_ = @GMSGFMT@ GMSGFMT_no = @GMSGFMT@ GMSGFMT_yes = @GMSGFMT_015@ @@ -195,6 +200,11 @@ ;; \ esac test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot-header; then \ + sed -e '1,/^#$$/d' < $(DOMAIN).po > $(DOMAIN).1po && \ + cat $(srcdir)/$(DOMAIN).pot-header $(DOMAIN).1po > $(DOMAIN).po; \ + rm -f $(DOMAIN).1po; \ + fi; \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ @@ -224,7 +234,7 @@ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \ cd $(srcdir) \ - && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + && { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ *) \ @@ -425,7 +435,7 @@ .nop.po-update: @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ - if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ + if test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH=`pwd`/../src:$$PATH; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ Binary files /tmp/tmp4U70c2/7esjCa0Q6b/datamash-1.0.7/po/nb.gmo and /tmp/tmp4U70c2/Lx1O0FDBbS/datamash-1.1.1/po/nb.gmo differ diff -Nru datamash-1.0.7/po/nb.po datamash-1.1.1/po/nb.po --- datamash-1.0.7/po/nb.po 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/po/nb.po 2017-01-19 18:51:35.000000000 +0000 @@ -0,0 +1,760 @@ +# Norwegian Bokmal translations for GNU datamash package. +# Copyright (C) 2015 Free Software Foundation, Inc. +# This file is distributed under the same license as the datamash package. +# Johnny A. Solbu , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU datamash 1.0.6.54\n" +"Report-Msgid-Bugs-To: bug-datamash@gnu.org\n" +"POT-Creation-Date: 2017-01-19 13:51-0500\n" +"PO-Revision-Date: 2015-07-11 09:36+0100\n" +"Last-Translator: Johnny A. Solbu \n" +"Language-Team: Norwegian Bokmaal \n" +"Language: nb\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 1.5.7\n" + +#: lib/closeout.c:112 +msgid "write error" +msgstr "skrivefeil" + +#: lib/error.c:191 +msgid "Unknown system error" +msgstr "Ukjent systemfeil" + +#: lib/getopt.c:575 lib/getopt.c:604 +#, c-format +msgid "%s: option '%s' is ambiguous; possibilities:" +msgstr "%s: valget «%s» er tvetydig; muligheter:" + +#: lib/getopt.c:619 +#, c-format +msgid "%s: option '%s' is ambiguous\n" +msgstr "%s: valget «%s» er flertydig\n" + +#: lib/getopt.c:654 lib/getopt.c:658 +#, c-format +msgid "%s: option '--%s' doesn't allow an argument\n" +msgstr "%s: valg «--%s» tillater ikke argument\n" + +#: lib/getopt.c:667 lib/getopt.c:672 +#, c-format +msgid "%s: option '%c%s' doesn't allow an argument\n" +msgstr "%s: valg «%c%s» tillater ikke et argument\n" + +#: lib/getopt.c:715 lib/getopt.c:734 +#, c-format +msgid "%s: option '--%s' requires an argument\n" +msgstr "%s: valg «--%s» behøver et argument\n" + +#: lib/getopt.c:772 lib/getopt.c:775 +#, c-format +msgid "%s: unrecognized option '--%s'\n" +msgstr "%s: ukjent valg «--%s»\n" + +#: lib/getopt.c:783 lib/getopt.c:786 +#, c-format +msgid "%s: unrecognized option '%c%s'\n" +msgstr "%s: ukjent valg «%c%s»\n" + +#: lib/getopt.c:835 lib/getopt.c:838 +#, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: ugyldig alternativ -- «%c»\n" + +#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136 +#, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: valget trenger et argument -- «%c»\n" + +#: lib/getopt.c:964 lib/getopt.c:980 +#, c-format +msgid "%s: option '-W %s' is ambiguous\n" +msgstr "%s: valget '-W %s' er tvetydig\n" + +#: lib/getopt.c:1004 lib/getopt.c:1022 +#, c-format +msgid "%s: option '-W %s' doesn't allow an argument\n" +msgstr "%s: valg «-W %s» tillater ikke et argument\n" + +#: lib/getopt.c:1043 lib/getopt.c:1061 +#, c-format +msgid "%s: option '-W %s' requires an argument\n" +msgstr "%s: valg «-W %s» trenger et argument\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. +#. and use glyphs suitable for your language. +#: lib/quotearg.c:354 +msgid "`" +msgstr "«" + +#: lib/quotearg.c:355 +msgid "'" +msgstr "»" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "Pakket av %s (%s)\n" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "Pakket av %s\n" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "©" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later .\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" +"\n" +"Lisens GPLv3+: GNU GPL versjon 3 eller senere \n" +"Dette er Fri programvare: du står fritt til å endre og redistribuere det.\n" +"Det er INGEN GARANTI, i den grad loven tillater det.\n" +"\n" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "Skrevet av %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "Skrevet av %s og %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "Skrevet av %s, %s og %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Skrevet av %s, %s, %s\n" +"og %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Skrevet av %s, %s, %s,\n" +"%s and %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"Skrevet av %s, %s, %s,\n" +"%s, %s og %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"Skrevet av %s, %s, %s,\n" +"%s, %s, %s og %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Skrevet av %s, %s, %s,\n" +"%s, %s, %s, %s\n" +"og %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Skrevet av %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s og %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"Skrevet av %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s og andre.\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" +"\n" +"Rapporter feil til: %s\n" +"Rapporter oversettelsesfeil til \n" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "Rapporter %s-feil til: %s\n" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "%s hjemmeside: <%s>\n" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: \n" +msgstr "%s hjemmeside: \n" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: \n" +msgstr "Generell hjelp med GNU-programvare: \n" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "minne oppbrukt" + +#: lib/xstrtol-error.c:63 +#, c-format +msgid "invalid %s%s argument '%s'" +msgstr "ugyldig %s%s-argument «%s»" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "ugyldig suffiks i %s%s-argument «%s»" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "%s%s-argument »%s« er for stort" + +#. This is a proper name. See the gettext manual, section Names. +#: src/datamash.c:64 +msgid "Assaf Gordon" +msgstr "Assaf Gordon" + +#: src/datamash.c:151 src/datamash.c:467 +#, c-format +msgid "column name %s not found in input file" +msgstr "kolonnenavnet %s ble ikke funnet i inndatafilen" + +#: src/datamash.c:164 +#, fuzzy, c-format +msgid "Usage: %s [OPTION] op [fld] [op fld ...]\n" +msgstr "Bruk: %s [VALG] op [col] [op col ...]\n" + +#: src/datamash.c:167 +msgid "Performs numeric/string operations on input from stdin." +msgstr "Utfører numerisk/strengoperasjoner på inndata fra standard inn." + +#: src/datamash.c:170 +msgid "" +"'op' is the operation to perform. If a primary operation is used,\n" +"it must be listed first, optionally followed by other operations.\n" +msgstr "" + +#: src/datamash.c:173 +#, fuzzy +msgid "" +"'fld' is the input field to use. 'fld' can be a number (1=first field),\n" +"or a field name when using the -H or --header-in options.\n" +msgstr "" +"For gruppering,per-linje-operasjoner er «col» inndatafeltet som skal " +"brukes;\n" +"«col» kan være et tall (1=første felt), eller et kolonnenavn når du bruker\n" +"-H eller --header-in.\n" + +#: src/datamash.c:176 +msgid "" +"Multiple fields can be listed with a comma (e.g. 1,6,8). A range of\n" +"fields can be listed with a dash (e.g. 2-8). Use colons for operations\n" +"which require a pair of fields (e.g. 'pcov 2:6').\n" +msgstr "" + +#: src/datamash.c:181 +#, fuzzy +msgid "Primary operations:\n" +msgstr "Per-linje-operasjoner:\n" + +#: src/datamash.c:184 +msgid "Line-Filtering operations:\n" +msgstr "Linjefiltreringsoperasjoner:\n" + +#: src/datamash.c:187 +msgid "Per-Line operations:\n" +msgstr "Per-linje-operasjoner:\n" + +#: src/datamash.c:191 +msgid "Numeric Grouping operations:\n" +msgstr "Numerisk grupperingsoperasjoner:\n" + +#: src/datamash.c:194 +msgid "Textual/Numeric Grouping operations:\n" +msgstr "Tekstlig/numerisk grupperingsoperasjoner:\n" + +#: src/datamash.c:198 +msgid "Statistical Grouping operations:\n" +msgstr "Statistisk grupperingsoperasjoner:\n" + +#: src/datamash.c:206 +msgid "Grouping Options:\n" +msgstr "grupperingsvalg:\n" + +#: src/datamash.c:207 +msgid "" +" -f, --full print entire input line before op results\n" +" (default: print only the grouped keys)\n" +msgstr "" +" -f, --full skriv ut hele linjeinngang før op resultater\n" +" (standard: skriv ut bare de grupperte " +"nøklene)\n" + +#: src/datamash.c:211 +msgid "" +" -g, --group=X[,Y,Z] group via fields X,[Y,Z];\n" +" equivalent to primary operation 'groupby'\n" +msgstr "" + +#: src/datamash.c:215 +msgid " --header-in first input line is column headers\n" +msgstr "" +" --header-in første inndatalinje er kolonnetopptekster\n" + +#: src/datamash.c:218 +msgid " --header-out print column headers as first line\n" +msgstr "" +" --header-out skriv ut kolonnetopptekster som første linje\n" + +#: src/datamash.c:221 +msgid " -H, --headers same as '--header-in --header-out'\n" +msgstr " -H, --headers samme som «--header-in --header-out»\n" + +#: src/datamash.c:224 +msgid "" +" -i, --ignore-case ignore upper/lower case when comparing text;\n" +" this affects grouping, and string operations\n" +msgstr "" +" -i, --ignore-case ignorer store/små bokstaver når du sammenligner " +"tekst;\n" +" dette påvirker gruppering og " +"strengoperasjoner\n" + +#: src/datamash.c:228 +msgid "" +" -s, --sort sort the input before grouping; this removes " +"the\n" +" need to manually pipe the input through " +"'sort'\n" +msgstr "" +" -s, --sort sortere inndata før gruppering; Dette fjerner \n" +" behovet for å manuellt omdirigere inndata " +"gjennom «sort»\n" + +#: src/datamash.c:233 +msgid "File Operation Options:\n" +msgstr "Filoperasjonsvalg:\n" + +#: src/datamash.c:234 +msgid " --no-strict allow lines with varying number of fields\n" +msgstr " --no-strict tillat linjer med varierende antall felt\n" + +#: src/datamash.c:237 +#, c-format +msgid " --filler=X fill missing values with X (default %s)\n" +msgstr "" +" --filler=X fyll manglende verdier med X (standard %s)\n" + +#: src/datamash.c:242 +msgid "General Options:\n" +msgstr "Generelle valg:\n" + +#: src/datamash.c:243 +msgid " -t, --field-separator=X use X instead of TAB as field delimiter\n" +msgstr " -t, --field-separator=X bruk X istedenfor TAB som feltskilletegn\n" + +#: src/datamash.c:246 +msgid " --narm skip NA/NaN values\n" +msgstr " --narm hopp over NA/NaN-verdier\n" + +#: src/datamash.c:249 +msgid "" +" -W, --whitespace use whitespace (one or more spaces and/or tabs)\n" +" for field delimiters\n" +msgstr "" +" -W, --whitespace bruk mellomrom (ett eller flere mellomrom og/" +"eller tabulatorer)\n" +" for feltskilletegn\n" + +#: src/datamash.c:253 +msgid " -z, --zero-terminated end lines with 0 byte, not newline\n" +msgstr "" +" -z, --zero-terminated avslutt linjer med 0 byte, ikke linjeskift\n" + +#: src/datamash.c:262 +msgid "Examples:" +msgstr "Eksempler:" + +#: src/datamash.c:264 +msgid "Print the sum and the mean of values from column 1:" +msgstr "Skriv ut summen og gjennomsnittet av verdiene fra kolonne 1:" + +#: src/datamash.c:269 +msgid "Transpose input:" +msgstr "Transponere inndata:" + +#: src/datamash.c:276 +msgid "For detailed usage information and examples, see\n" +msgstr "For detaljert bruksinformasjon og eksempler, se\n" + +#: src/datamash.c:278 +msgid "The manual and more examples are available at\n" +msgstr "Manualen og flere eksempler finnes på\n" + +#: src/datamash.c:287 +#, c-format +msgid "" +"invalid input: field % requested, line % has only " +"% fields" +msgstr "" +"ugyldig inngang: feltet % etterspurt, linje % har bare " +"% felt" + +#: src/datamash.c:357 +#, c-format +msgid "%s in line % field %: '%s'" +msgstr "%s i linje % felt %: «%s»" + +#: src/datamash.c:676 +#, c-format +msgid "" +"transpose input error: line % has % fields (previous lines " +"had %);\n" +"see --help to disable strict mode" +msgstr "" +"transponere inndatafeil: linje % har % felt (foregående " +"linjer hadde %);\n" +"se --help for å deaktivere streng modus" + +#: src/datamash.c:733 +#, c-format +msgid "" +"reverse-field input error: line % has % fields (previous " +"lines had %);\n" +"see --help to disable strict mode" +msgstr "" +"inndatafeil for omvendt-felt: linje % har % felter " +"(foregående linjer hadde %);\n" +"se --help for å deaktivere streng modus" + +#: src/datamash.c:837 src/datamash.c:843 +#, fuzzy, c-format +msgid "" +"line % (% fields):\n" +" " +msgstr "%s i linje % felt %: «%s»" + +#: src/datamash.c:849 +#, fuzzy, c-format +msgid "" +"check failed: line % has % fields (previous line had " +"%)" +msgstr "" +"transponere inndatafeil: linje % har % felt (foregående " +"linjer hadde %);\n" +"se --help for å deaktivere streng modus" + +#: src/datamash.c:861 +#, c-format +msgid "% line" +msgid_plural "% lines" +msgstr[0] "" +msgstr[1] "" + +#: src/datamash.c:864 +#, c-format +msgid "% field" +msgid_plural "% fields" +msgstr[0] "" +msgstr[1] "" + +#: src/datamash.c:965 +#, c-format +msgid "hash memory allocation error" +msgstr "hashminnetildelingsfeil" + +#: src/datamash.c:1027 +#, c-format +msgid "sort command too-long (please report this bug)" +msgstr "sort-kommandoen for lang (vennligst rapporter denne feilen)" + +#: src/datamash.c:1033 +#, c-format +msgid "failed to run 'sort': popen failed" +msgstr "mislyktes i å kjøre «sort»: popen feilet" + +#: src/datamash.c:1049 +#, c-format +msgid "read error" +msgstr "lesefeil" + +#: src/datamash.c:1057 +#, c-format +msgid "read error (on close)" +msgstr "lesefeil (ved lukking)" + +#: src/datamash.c:1133 +#, c-format +msgid "the delimiter must be a single character" +msgstr "skilletegnet må være et enkelt tegn" + +#: src/datamash.c:1170 +#, c-format +msgid "missing operation specifiers" +msgstr "manglende operasjonsangivelser" + +#: src/datamash.c:1184 +#, c-format +msgid "-H or --header-in must be used with named columns" +msgstr "-H or --header-in må brukes med navngitte kolonner" + +#: src/field-ops.c:319 +#, c-format +msgid "" +"input error for operation %s: fields %,% have different " +"number of items" +msgstr "" + +#: src/field-ops.c:999 +msgid "invalid numeric value" +msgstr "ugyldig numerisk verdi" + +#: src/field-ops.c:1001 +msgid "invalid base64 value" +msgstr "ugyldig base64-verdi" + +#: src/op-parser.c:163 src/op-parser.c:177 src/op-parser.c:184 +#, fuzzy, c-format +msgid "too many parameters for operation %s" +msgstr "ugyldig kolonne «%s» for operasjon %s" + +#: src/op-parser.c:174 +#, c-format +msgid "strbin bucket size must not be zero" +msgstr "" + +#: src/op-parser.c:205 src/op-parser.c:216 src/op-parser.c:472 +#, fuzzy, c-format +msgid "missing field for operation %s" +msgstr "manglende feltnummer etter operasjon '%s'" + +#: src/op-parser.c:211 src/op-parser.c:220 src/op-parser.c:275 +#: src/op-parser.c:508 +#, fuzzy, c-format +msgid "invalid field range for operation %s" +msgstr "ugyldig tom kolonne for operasjon %s" + +#: src/op-parser.c:214 src/op-parser.c:224 src/op-parser.c:511 +#, fuzzy, c-format +msgid "invalid field pair for operation %s" +msgstr "ugyldig kolonne «%s» for operasjon %s" + +#: src/op-parser.c:238 src/op-parser.c:486 +#, fuzzy, c-format +msgid "invalid field '%s' for operation %s" +msgstr "ugyldig kolonne «%s» for operasjon %s" + +#: src/op-parser.c:272 +#, c-format +msgid "field range for %s must be numeric" +msgstr "" + +#: src/op-parser.c:332 +#, fuzzy, c-format +msgid "missing parameter for operation %s" +msgstr "manglende feltnummer etter operasjon '%s'" + +#: src/op-parser.c:340 +#, fuzzy, c-format +msgid "invalid parameter %s for operation %s" +msgstr "ugyldig kolonne «%s» for operasjon %s" + +#: src/op-parser.c:372 +#, fuzzy, c-format +msgid "operation %s requires field pairs" +msgstr "%s: valg «--%s» behøver et argument\n" + +#: src/op-parser.c:375 +#, c-format +msgid "operation %s cannot use pair of fields" +msgstr "" + +#: src/op-parser.c:415 +#, fuzzy, c-format +msgid "conflicting operation %s" +msgstr "Ugyldig operasjon «%s»" + +#: src/op-parser.c:418 src/op-parser.c:597 +#, fuzzy, c-format +msgid "invalid operation %s" +msgstr "Ugyldig operasjon «%s»" + +#: src/op-parser.c:423 +#, c-format +msgid "" +"conflicting operation found: expecting %s operations, but found %s operation " +"%s" +msgstr "" +"motstridende operasjon funnet: forventer %s operasjoner, men fant %s " +"operasjon %s" + +#: src/op-parser.c:537 +#, c-format +msgid "crosstab requires exactly 2 fields, found %" +msgstr "" + +#: src/op-parser.c:550 +#, c-format +msgid "crosstab supports one operation, found %" +msgstr "" + +#: src/op-parser.c:559 +#, fuzzy, c-format +msgid "missing operation" +msgstr "manglende operasjonsangivelser" + +#: src/op-parser.c:573 +#, fuzzy, c-format +msgid "extra operand %s" +msgstr "ekstra operand-er etter «%s»" + +#: src/op-parser.c:710 src/op-scanner.c:210 +#, c-format +msgid "missing script (among arguments)" +msgstr "" + +#: src/op-scanner.c:167 +#, fuzzy, c-format +msgid "invalid numeric value '%s'" +msgstr "ugyldig numerisk verdi" + +#: src/op-scanner.c:188 +#, fuzzy, c-format +msgid "invalid operand %s" +msgstr "Ugyldig operasjon «%s»" + +#: src/op-scanner.c:244 +#, c-format +msgid "unknown token %d\n" +msgstr "" + +#: src/system.h:133 +msgid " --help display this help and exit\n" +msgstr " -h, --help vis denne hjelpen og avslutt\n" + +#: src/system.h:135 +msgid " --version output version information and exit\n" +msgstr " -v, --version skriv ut versjonsinformasjon og avslutt\n" + +#: src/system.h:140 +#, c-format +msgid "Try '%s --help' for more information.\n" +msgstr "Prøv «%s --help» for mer informasjon.\n" + +#~ msgid "'op' is the operation to perform;\n" +#~ msgstr "«op» er operasjonen som skal utføres;\n" + +#~ msgid "File operations:\n" +#~ msgstr "Filoperasjoner:\n" + +#~ msgid "Options:\n" +#~ msgstr "Valg:\n" + +#~ msgid " -g, --group=X[,Y,Z] group via fields X,[Y,Z]\n" +#~ msgstr " -g, --group=X[,Y,Z] gruppér via felt X,[Y,Z]\n" + +#~ msgid "invalid empty grouping parameter" +#~ msgstr "ugyldig tom grupperingsparameter" + +#~ msgid "invalid grouping parameter %s" +#~ msgstr "ugyldig grupperingsparameter %s" Binary files /tmp/tmp4U70c2/7esjCa0Q6b/datamash-1.0.7/po/nl.gmo and /tmp/tmp4U70c2/Lx1O0FDBbS/datamash-1.1.1/po/nl.gmo differ diff -Nru datamash-1.0.7/po/nl.po datamash-1.1.1/po/nl.po --- datamash-1.0.7/po/nl.po 2015-06-17 23:45:11.000000000 +0000 +++ datamash-1.1.1/po/nl.po 2017-01-19 18:51:35.000000000 +0000 @@ -1,22 +1,23 @@ # Dutch translations for GNU datamash. -# Copyright (C) 2015 Free Software Foundation, Inc. +# Copyright (C) 2016 Free Software Foundation, Inc. # This file is distributed under the same license as the datamash package. # # “Dat weet je soms toch niet.” # -# Benno Schulenberg , 2014, 2015. +# Benno Schulenberg , 2014, 2015, 2016. msgid "" msgstr "" -"Project-Id-Version: datamash-1.0.6.54\n" +"Project-Id-Version: datamash-1.0.7.58\n" "Report-Msgid-Bugs-To: bug-datamash@gnu.org\n" -"POT-Creation-Date: 2015-05-28 14:22-0400\n" -"PO-Revision-Date: 2015-06-05 12:44+0200\n" +"POT-Creation-Date: 2017-01-19 13:51-0500\n" +"PO-Revision-Date: 2016-08-09 19:49+0200\n" "Last-Translator: Benno Schulenberg \n" "Language-Team: Dutch \n" "Language: nl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" "X-Generator: Lokalize 1.0\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" @@ -109,11 +110,11 @@ #. If you don't know what to put here, please see #. #. and use glyphs suitable for your language. -#: lib/quotearg.c:312 +#: lib/quotearg.c:354 msgid "`" msgstr "‘" -#: lib/quotearg.c:313 +#: lib/quotearg.c:355 msgid "'" msgstr "’" @@ -137,14 +138,16 @@ #: lib/version-etc.c:86 msgid "" "\n" -"License GPLv3+: GNU GPL version 3 or later .\n" +"License GPLv3+: GNU GPL version 3 or later .\n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" "\n" msgstr "" "\n" "Dit is vrije software: u mag het vrijelijk wijzigen en verder verspreiden.\n" -"De precieze licentie is GPL-3+: GNU General Public License versie 3 of later.\n" +"De precieze licentie is GPL-3+: GNU General Public License versie 3 of " +"later.\n" "Zie http://gnu.org/licenses/gpl.html voor de volledige (Engelse) tekst.\n" "Deze software kent GEEN GARANTIE, voor zover de wet dit toestaat.\n" "\n" @@ -290,7 +293,8 @@ #: lib/version-etc.c:256 msgid "General help using GNU software: \n" -msgstr "Algemene hulp bij gebruik van GNU-software: \n" +msgstr "" +"Algemene hulp bij gebruik van GNU-software: \n" #: lib/xalloc-die.c:34 msgid "memory exhausted" @@ -312,137 +316,163 @@ msgstr "argument '%3$s' van %1$s%2$s is te groot" #. This is a proper name. See the gettext manual, section Names. -#: src/datamash.c:61 +#: src/datamash.c:64 msgid "Assaf Gordon" msgstr "Assaf Gordon" -#: src/datamash.c:161 src/field-ops.c:388 +#: src/datamash.c:151 src/datamash.c:467 #, c-format msgid "column name %s not found in input file" msgstr "kolomnaam %s niet gevonden in invoerbestand" -#: src/datamash.c:174 +#: src/datamash.c:164 #, c-format -msgid "Usage: %s [OPTION] op [col] [op col ...]\n" -msgstr "Gebruik: %s [OPTIE...] OPERATIE [KOLOM] [OPERATIE KOLOM ...]\n" +msgid "Usage: %s [OPTION] op [fld] [op fld ...]\n" +msgstr "Gebruik: %s [OPTIE...] OPERATIE [VELD] [OPERATIE VELD ...]\n" -#: src/datamash.c:177 +#: src/datamash.c:167 msgid "Performs numeric/string operations on input from stdin." -msgstr "Voert numerieke of tekenreeksoperaties uit op standaardinvoer." +msgstr "Voert numerieke of tekenreeksbewerkingen uit op standaardinvoer." -#: src/datamash.c:180 -msgid "'op' is the operation to perform;\n" -msgstr "OPERATIE is de uit te voeren bewerking.\n" +#: src/datamash.c:170 +msgid "" +"'op' is the operation to perform. If a primary operation is used,\n" +"it must be listed first, optionally followed by other operations.\n" +msgstr "" +"OPERATIE is de te verrichten bewerking. Een primaire bewerking moet\n" +"als eerste gegeven worden, eventueel gevolgd door andere bewerkingen.\n" -#: src/datamash.c:181 +#: src/datamash.c:173 msgid "" -"For grouping,per-line operations 'col' is the input field to use;\n" -"'col' can be a number (1=first field), or a column name when using\n" -"-H or --header-in options.\n" -msgstr "" -"Voor het groeperen van per-regel-operaties is KOLOM het te gebruiken invoerveld;\n" -"KOLOM kan een getal zijn (1 = eerste veld), of een kolomnaam wanneer optie '-H'\n" -"of '--header-in' gebruikt wordt.\n" +"'fld' is the input field to use. 'fld' can be a number (1=first field),\n" +"or a field name when using the -H or --header-in options.\n" +msgstr "" +"VELD is het te gebruiken invoerveld. VELD kan een getal zijn (1 = eerste " +"veld),\n" +"of een veldnaam wanneer optie '-H' of '--header-in' gebruikt wordt.\n" -#: src/datamash.c:187 -msgid "File operations:\n" -msgstr "Bestandsoperaties:\n" +#: src/datamash.c:176 +msgid "" +"Multiple fields can be listed with a comma (e.g. 1,6,8). A range of\n" +"fields can be listed with a dash (e.g. 2-8). Use colons for operations\n" +"which require a pair of fields (e.g. 'pcov 2:6').\n" +msgstr "" +"Meerdere velden kunnen gegeven worden gescheiden door een komma (bijv. " +"1,6,8);\n" +"een reeks velden met een streepje (bijv. 2-8). Gebruik een dubbelepunt " +"voor\n" +"bewerkingen die een veldenpaar vereisen (bijv. 'pcov 2:6').\n" + +#: src/datamash.c:181 +msgid "Primary operations:\n" +msgstr "Primaire bewerkingen:\n" -#: src/datamash.c:190 +#: src/datamash.c:184 msgid "Line-Filtering operations:\n" -msgstr "Regelfilteringsoperaties:\n" +msgstr "Regelfilterbewerkingen:\n" -#: src/datamash.c:193 +#: src/datamash.c:187 msgid "Per-Line operations:\n" -msgstr "Per-regel-operaties:\n" +msgstr "Per-regel-bewerkingen:\n" -#: src/datamash.c:196 +#: src/datamash.c:191 msgid "Numeric Grouping operations:\n" -msgstr "Numerieke groeperingsoperaties:\n" +msgstr "Numerieke groeperingsbewerkingen:\n" -#: src/datamash.c:199 +#: src/datamash.c:194 msgid "Textual/Numeric Grouping operations:\n" -msgstr "Tekstuele en numerieke groeperingsoperaties:\n" +msgstr "Tekstuele en numerieke groeperingsbewerkingen:\n" -#: src/datamash.c:203 +#: src/datamash.c:198 msgid "Statistical Grouping operations:\n" -msgstr "Statistische groeperingsoperaties:\n" +msgstr "Statistische groeperingsbewerkingen:\n" -#: src/datamash.c:210 -msgid "Options:\n" -msgstr "Opties:\n" - -#: src/datamash.c:211 +#: src/datamash.c:206 msgid "Grouping Options:\n" msgstr "Groeperingsopties:\n" -#: src/datamash.c:212 +#: src/datamash.c:207 msgid "" " -f, --full print entire input line before op results\n" " (default: print only the grouped keys)\n" msgstr "" -" -f, --full gehele invoerregel tonen vóór bewerkingsresultaten\n" +" -f, --full gehele invoerregel tonen vóór " +"bewerkingsresultaten\n" " (standaard alleen de gegroepeerde sleutels)\n" -#: src/datamash.c:216 -msgid " -g, --group=X[,Y,Z] group via fields X,[Y,Z]\n" -msgstr " -g, --group=X[,Y,Z] groeperen op de velden X,[Y,Z]\n" +#: src/datamash.c:211 +msgid "" +" -g, --group=X[,Y,Z] group via fields X,[Y,Z];\n" +" equivalent to primary operation 'groupby'\n" +msgstr "" +" -g, --group=X[,Y,Z] groeperen via de velden X,[Y,Z]; dit is\n" +" hetzelfde als primaire bewerking 'groupby'\n" -#: src/datamash.c:219 +#: src/datamash.c:215 msgid " --header-in first input line is column headers\n" msgstr " --header-in eerste invoerregel zijn kolomkoppen\n" -#: src/datamash.c:222 +#: src/datamash.c:218 msgid " --header-out print column headers as first line\n" msgstr " --header-out kolomkoppen weergeven als eerste regel\n" -#: src/datamash.c:225 +#: src/datamash.c:221 msgid " -H, --headers same as '--header-in --header-out'\n" msgstr " -H, --headers hetzelfde als '--header-in --header-out'\n" -#: src/datamash.c:228 +#: src/datamash.c:224 msgid "" " -i, --ignore-case ignore upper/lower case when comparing text;\n" " this affects grouping, and string operations\n" msgstr "" -" -i, --ignore-case verschil tussen hoofd- en kleine letters negeren\n" -" bij tekstvergelijkingen; dit is van invloed op\n" +" -i, --ignore-case verschil tussen hoofd- en kleine letters " +"negeren\n" +" bij tekstvergelijkingen; dit is van invloed " +"op\n" " groeperingen en tekenreeksbewerkingen\n" -#: src/datamash.c:232 +#: src/datamash.c:228 msgid "" -" -s, --sort sort the input before grouping; this removes the\n" -" need to manually pipe the input through 'sort'\n" +" -s, --sort sort the input before grouping; this removes " +"the\n" +" need to manually pipe the input through " +"'sort'\n" msgstr "" -" -s, --sort de invoer sorteren alvorens te groeperen; dit maakt\n" +" -s, --sort de invoer sorteren alvorens te groeperen; dit " +"maakt\n" " het handmatig door 'sort' sluizen overbodig\n" -#: src/datamash.c:237 +#: src/datamash.c:233 msgid "File Operation Options:\n" msgstr "Bestandsbewerkingsopties:\n" -#: src/datamash.c:238 +#: src/datamash.c:234 msgid " --no-strict allow lines with varying number of fields\n" -msgstr " --no-strict regels met een variërend aantal velden toestaan\n" +msgstr "" +" --no-strict regels met een variërend aantal velden toestaan\n" -#: src/datamash.c:241 +#: src/datamash.c:237 #, c-format msgid " --filler=X fill missing values with X (default %s)\n" -msgstr " --filler=WAARDE ontbrekende waarden opvullen met deze (standaard %s)\n" +msgstr "" +" --filler=WAARDE ontbrekende waarden opvullen met deze (standaard " +"%s)\n" -#: src/datamash.c:246 +#: src/datamash.c:242 msgid "General Options:\n" msgstr "Algemene opties:\n" -#: src/datamash.c:247 +#: src/datamash.c:243 msgid " -t, --field-separator=X use X instead of TAB as field delimiter\n" -msgstr " -t, --field-separator=X dit teken als veldscheider gebruiken i.p.v. tab\n" +msgstr "" +" -t, --field-separator=X dit teken als veldscheider gebruiken i.p.v. tab\n" -#: src/datamash.c:250 +#: src/datamash.c:246 msgid " --narm skip NA/NaN values\n" -msgstr " --narm NA/NaN-waarden overslaan\n" +msgstr "" +" --narm de waarden 'NA', 'N/A' en 'NaN' overslaan\n" -#: src/datamash.c:253 +#: src/datamash.c:249 msgid "" " -W, --whitespace use whitespace (one or more spaces and/or tabs)\n" " for field delimiters\n" @@ -450,166 +480,311 @@ " -W, --whitespace witruimte gebruiken om velden te scheiden\n" " (één of meer spaties en/of tabs) \n" -#: src/datamash.c:257 +#: src/datamash.c:253 msgid " -z, --zero-terminated end lines with 0 byte, not newline\n" -msgstr " -z, --zero-terminated regels afsluiten met 0-byte, niet met nieuweregel\n" +msgstr "" +" -z, --zero-terminated regels afsluiten met 0-byte, niet met " +"nieuweregel\n" -#: src/datamash.c:266 +#: src/datamash.c:262 msgid "Examples:" msgstr "Voorbeelden:" -#: src/datamash.c:268 +#: src/datamash.c:264 msgid "Print the sum and the mean of values from column 1:" msgstr "De som en het gemiddelde van de waarden in kolom 1 weergeven:" -#: src/datamash.c:273 +#: src/datamash.c:269 msgid "Transpose input:" msgstr "De invoer transponeren:" -#: src/datamash.c:280 +#: src/datamash.c:276 msgid "For detailed usage information and examples, see\n" msgstr "Voor gedetailleerde gebruiksinformatie en voorbeelden, zie\n" -#: src/datamash.c:282 +#: src/datamash.c:278 msgid "The manual and more examples are available at\n" msgstr "De handleiding en meer voorbeelden zijn beschikbaar op\n" -#: src/datamash.c:291 +#: src/datamash.c:287 #, c-format -msgid "invalid input: field % requested, line % has only % fields" -msgstr "ongeldige invoer: veld % werd gevraagd, maar regel % heeft slechts % velden" +msgid "" +"invalid input: field % requested, line % has only " +"% fields" +msgstr "" +"ongeldige invoer: veld % werd gevraagd, maar regel % heeft " +"slechts % velden" -#: src/datamash.c:349 +#: src/datamash.c:357 #, c-format msgid "%s in line % field %: '%s'" msgstr "%s in regel %, veld %: '%s'" -#: src/datamash.c:487 src/datamash.c:784 -#, c-format -msgid "-H or --header-in must be used with named columns" -msgstr "optie '-H' of '--header-in' moet samen met kolomnamen gebruikt worden" - -#: src/datamash.c:588 +#: src/datamash.c:676 #, c-format msgid "" -"transpose input error: line % has % fields (previous lines had %);\n" +"transpose input error: line % has % fields (previous lines " +"had %);\n" "see --help to disable strict mode" msgstr "" "transpositie-invoerfout: regel % heeft % velden\n" "(eerdere regels hadden er %);\n" "zie --help om strikte modus uit schakelen" -#: src/datamash.c:644 +#: src/datamash.c:733 #, c-format msgid "" -"reverse-field input error: line % has % fields (previous lines had %);\n" +"reverse-field input error: line % has % fields (previous " +"lines had %);\n" "see --help to disable strict mode" msgstr "" "veldomkerings-invoerfout: regel % heeft % velden\n" "(eerdere regels hadden er %);\n" "zie --help om strikte modus uit schakelen" -#: src/datamash.c:820 +#: src/datamash.c:837 src/datamash.c:843 +#, c-format +msgid "" +"line % (% fields):\n" +" " +msgstr "" +"regel % (% velden):\n" +" " + +#: src/datamash.c:849 +#, c-format +msgid "" +"check failed: line % has % fields (previous line had " +"%)" +msgstr "" +"controle is mislukt: regel % heeft % velden (eerdere " +"regels hadden er %)" + +#: src/datamash.c:861 +#, c-format +msgid "% line" +msgid_plural "% lines" +msgstr[0] "% regel" +msgstr[1] "% regels" + +#: src/datamash.c:864 +#, c-format +msgid "% field" +msgid_plural "% fields" +msgstr[0] "% veld" +msgstr[1] "% velden" + +#: src/datamash.c:965 #, c-format msgid "hash memory allocation error" msgstr "onvoldoende geheugen beschikbaar voor hash" -#: src/datamash.c:882 +#: src/datamash.c:1027 #, c-format msgid "sort command too-long (please report this bug)" msgstr "het sorteercommando is te lang (rapporteer deze **programmafout**)" -#: src/datamash.c:888 +#: src/datamash.c:1033 #, c-format msgid "failed to run 'sort': popen failed" msgstr "het aanroepen van 'sort' is mislukt: 'popen()' faalde" -#: src/datamash.c:904 +#: src/datamash.c:1049 #, c-format msgid "read error" msgstr "fout bij lezen" -#: src/datamash.c:912 +#: src/datamash.c:1057 #, c-format msgid "read error (on close)" msgstr "leesfout (bij sluiten)" -#: src/datamash.c:939 -#, c-format -msgid "invalid empty grouping parameter" -msgstr "ongeldige lege groeperingsparameter" - -#: src/datamash.c:946 -#, c-format -msgid "invalid grouping parameter %s" -msgstr "ongeldige groeperingsparameter %s" - -#: src/datamash.c:1031 +#: src/datamash.c:1133 #, c-format msgid "the delimiter must be a single character" msgstr "het scheidingsteken moet een enkel teken zijn" -#: src/datamash.c:1067 +#: src/datamash.c:1170 #, c-format msgid "missing operation specifiers" msgstr "ontbrekende bewerkingsaanduidingen" -#: src/field-ops.c:293 +#: src/datamash.c:1184 #, c-format -msgid "invalid empty column for operation %s" -msgstr "ongeldige lege kolom voor bewerking %s" +msgid "-H or --header-in must be used with named columns" +msgstr "optie '-H' of '--header-in' moet samen met kolomnamen gebruikt worden" -#: src/field-ops.c:306 +#: src/field-ops.c:319 #, c-format -msgid "invalid column '%s' for operation %s" -msgstr "ongeldige kolom '%s' voor bewerking %s" +msgid "" +"input error for operation %s: fields %,% have different " +"number of items" +msgstr "" +"invoerfout voor bewerking %s: velden %,% hebben een " +"verschillend aantal items" -#: src/field-ops.c:985 -#, c-format -msgid "invalid operation '%s'" -msgstr "ongeldige bewerking '%s'" +#: src/field-ops.c:999 +msgid "invalid numeric value" +msgstr "ongeldige numerieke waarde" #: src/field-ops.c:1001 +msgid "invalid base64 value" +msgstr "ongeldige base64-waarde" + +#: src/op-parser.c:163 src/op-parser.c:177 src/op-parser.c:184 #, c-format -msgid "conflicting operation found: expecting %s operations, but found %s operation %s" -msgstr "conflicterende operatie gevonden: er werden %s-operaties verwacht, maar %s-operatie %s werd gevonden" +msgid "too many parameters for operation %s" +msgstr "te veel parameters voor bewerking %s" -#: src/field-ops.c:1009 +#: src/op-parser.c:174 #, c-format -msgid "missing field number after operation '%s'" -msgstr "ontbrekend veldnummer na bewerking '%s'" +msgid "strbin bucket size must not be zero" +msgstr "de bucket-grootte voor 'strbin' mag niet nul zijn" -#: src/field-ops.c:1029 +#: src/op-parser.c:205 src/op-parser.c:216 src/op-parser.c:472 #, c-format -msgid "extra operands after '%s'" -msgstr "overtollige operanden na '%s'" +msgid "missing field for operation %s" +msgstr "ontbrekend veld voor bewerking %s" -#: src/field-ops.c:1094 -msgid "invalid numeric value" -msgstr "ongeldige numerieke waarde" +#: src/op-parser.c:211 src/op-parser.c:220 src/op-parser.c:275 +#: src/op-parser.c:508 +#, c-format +msgid "invalid field range for operation %s" +msgstr "ongeldig veldbereik voor bewerking %s" -#: src/field-ops.c:1096 -msgid "invalid base64 value" -msgstr "ongeldige base64-waarde" +#: src/op-parser.c:214 src/op-parser.c:224 src/op-parser.c:511 +#, c-format +msgid "invalid field pair for operation %s" +msgstr "ongeldig veldenpaar voor bewerking %s" + +#: src/op-parser.c:238 src/op-parser.c:486 +#, c-format +msgid "invalid field '%s' for operation %s" +msgstr "ongeldig veld '%s' voor bewerking %s" + +#: src/op-parser.c:272 +#, c-format +msgid "field range for %s must be numeric" +msgstr "veldbereik voor %s moet numeriek zijn" + +#: src/op-parser.c:332 +#, c-format +msgid "missing parameter for operation %s" +msgstr "ontbrekende parameter voor bewerking %s" + +#: src/op-parser.c:340 +#, c-format +msgid "invalid parameter %s for operation %s" +msgstr "ongeldige parameter %s voor bewerking %s" + +# FIXME: Does this require a single pair of fields? +# FIXME: Or does it require multiple pairs? +#: src/op-parser.c:372 +#, c-format +msgid "operation %s requires field pairs" +msgstr "bewerking %s vereist veldparen" + +#: src/op-parser.c:375 +#, c-format +msgid "operation %s cannot use pair of fields" +msgstr "bewerking %s staat geen veldparen toe" + +#: src/op-parser.c:415 +#, c-format +msgid "conflicting operation %s" +msgstr "conflicterende bewerking %s" + +#: src/op-parser.c:418 src/op-parser.c:597 +#, c-format +msgid "invalid operation %s" +msgstr "ongeldige bewerking %s" + +#: src/op-parser.c:423 +#, c-format +msgid "" +"conflicting operation found: expecting %s operations, but found %s operation " +"%s" +msgstr "" +"conflicterende bewerking gevonden: er werden %s-bewerkingen verwacht, maar " +"%s-bewerking %s werd gevonden" + +#: src/op-parser.c:537 +#, c-format +msgid "crosstab requires exactly 2 fields, found %" +msgstr "'crosstab' vereist precies 2 velden; % gevonden" -#: src/system.h:101 +#: src/op-parser.c:550 +#, c-format +msgid "crosstab supports one operation, found %" +msgstr "'crosstab' ondersteunt één bewerking; % gevonden" + +#: src/op-parser.c:559 +#, c-format +msgid "missing operation" +msgstr "ontbrekende bewerking" + +#: src/op-parser.c:573 +#, c-format +msgid "extra operand %s" +msgstr "overtollige operand %s" + +#: src/op-parser.c:710 src/op-scanner.c:210 +#, c-format +msgid "missing script (among arguments)" +msgstr "ontbrekend script (tussen argumenten)" + +#: src/op-scanner.c:167 +#, c-format +msgid "invalid numeric value '%s'" +msgstr "ongeldige numerieke waarde '%s'" + +#: src/op-scanner.c:188 +#, c-format +msgid "invalid operand %s" +msgstr "ongeldige operand %s" + +#: src/op-scanner.c:244 +#, c-format +msgid "unknown token %d\n" +msgstr "onbekend token %d\n" + +#: src/system.h:133 msgid " --help display this help and exit\n" msgstr " --help deze hulptekst tonen en stoppen\n" -#: src/system.h:103 +#: src/system.h:135 msgid " --version output version information and exit\n" msgstr " --version programmaversie tonen en stoppen\n" -#: src/system.h:108 +#: src/system.h:140 #, c-format msgid "Try '%s --help' for more information.\n" msgstr "Typ '%s --help' voor meer informatie.\n" +#~ msgid "'op' is the operation to perform;\n" +#~ msgstr "OPERATIE is de uit te voeren bewerking.\n" + +#~ msgid "File operations:\n" +#~ msgstr "Bestandsoperaties:\n" + +#~ msgid "Options:\n" +#~ msgstr "Opties:\n" + +#~ msgid " -g, --group=X[,Y,Z] group via fields X,[Y,Z]\n" +#~ msgstr " -g, --group=X[,Y,Z] groeperen op de velden X,[Y,Z]\n" + +#~ msgid "invalid empty grouping parameter" +#~ msgstr "ongeldige lege groeperingsparameter" + +#~ msgid "invalid grouping parameter %s" +#~ msgstr "ongeldige groeperingsparameter %s" + #~ msgid "For grouping operations 'col' is the input field to use." #~ msgstr "Voor groeperingsoperaties is KOLOM het te gebruiken invoerveld." #~ msgid " --debug print helpful debugging information\n" -#~ msgstr " --debug behulpzame foutopsporingsinformatie tonen\n" +#~ msgstr "" +#~ " --debug behulpzame foutopsporingsinformatie tonen\n" #~ msgid "invalid numeric input in line %zu field %zu: '%s'" #~ msgstr "ongeldige numerieke invoer op regel %zu, veld %zu: '%s'" diff -Nru datamash-1.0.7/po/POTFILES.in datamash-1.1.1/po/POTFILES.in --- datamash-1.0.7/po/POTFILES.in 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/po/POTFILES.in 2016-01-02 18:26:26.000000000 +0000 @@ -8,4 +8,6 @@ lib/xstrtol-error.c src/datamash.c src/field-ops.c +src/op-parser.c +src/op-scanner.c src/system.h Binary files /tmp/tmp4U70c2/7esjCa0Q6b/datamash-1.0.7/po/pt_BR.gmo and /tmp/tmp4U70c2/Lx1O0FDBbS/datamash-1.1.1/po/pt_BR.gmo differ diff -Nru datamash-1.0.7/po/pt_BR.po datamash-1.1.1/po/pt_BR.po --- datamash-1.0.7/po/pt_BR.po 2015-06-17 23:45:11.000000000 +0000 +++ datamash-1.1.1/po/pt_BR.po 2017-01-19 18:51:35.000000000 +0000 @@ -1,21 +1,23 @@ # Brazilian Portuguese translation for datamash. # Copyright (C) 2015 Free Software Foundation, Inc. # This file is distributed under the same license as the datamash package. -# Rafael Ferreira , 2014, 2015. +# Rafael Fontenelle , 2014, 2015. # msgid "" msgstr "" -"Project-Id-Version: GNU datamash 1.0.6.54\n" +"Project-Id-Version: GNU datamash 1.0.7.58\n" "Report-Msgid-Bugs-To: bug-datamash@gnu.org\n" -"POT-Creation-Date: 2015-05-28 14:22-0400\n" -"PO-Revision-Date: 2015-06-06 11:13-0300\n" -"Last-Translator: Rafael Ferreira \n" -"Language-Team: Brazilian Portuguese \n" +"POT-Creation-Date: 2017-01-19 13:51-0500\n" +"PO-Revision-Date: 2016-01-01 15:00-0200\n" +"Last-Translator: Rafael Fontenelle \n" +"Language-Team: Brazilian Portuguese \n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.8.1\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 1.8.6\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: lib/closeout.c:112 @@ -24,67 +26,67 @@ #: lib/error.c:191 msgid "Unknown system error" -msgstr "erro desconhecido de sistema" +msgstr "Erro desconhecido de sistema" #: lib/getopt.c:575 lib/getopt.c:604 #, c-format msgid "%s: option '%s' is ambiguous; possibilities:" -msgstr "%s: opção \"%s\" é ambígua; possibilidades:" +msgstr "%s: a opção '%s' é ambígua; possibilidades:" #: lib/getopt.c:619 #, c-format msgid "%s: option '%s' is ambiguous\n" -msgstr "%s: a opção \"%s\" é ambígua\n" +msgstr "%s: a opção '%s' é ambígua\n" #: lib/getopt.c:654 lib/getopt.c:658 #, c-format msgid "%s: option '--%s' doesn't allow an argument\n" -msgstr "%s: a opção \"%s\" não permite um argumento\n" +msgstr "%s: a opção '%s' não permite um argumento\n" #: lib/getopt.c:667 lib/getopt.c:672 #, c-format msgid "%s: option '%c%s' doesn't allow an argument\n" -msgstr "%s: a opção \"%c%s\" não permite um argumento\n" +msgstr "%s: a opção '%c%s' não permite um argumento\n" #: lib/getopt.c:715 lib/getopt.c:734 #, c-format msgid "%s: option '--%s' requires an argument\n" -msgstr "%s: a opção \"%s\" requer um argumento\n" +msgstr "%s: a opção '--%s' requer um argumento\n" #: lib/getopt.c:772 lib/getopt.c:775 #, c-format msgid "%s: unrecognized option '--%s'\n" -msgstr "%s: opção não reconhecida \"--%s\"\n" +msgstr "%s: opção não reconhecida '--%s'\n" #: lib/getopt.c:783 lib/getopt.c:786 #, c-format msgid "%s: unrecognized option '%c%s'\n" -msgstr "%s: opção não reconhecida \"%c%s\"\n" +msgstr "%s: opção não reconhecida '%c%s'\n" #: lib/getopt.c:835 lib/getopt.c:838 #, c-format msgid "%s: invalid option -- '%c'\n" -msgstr "%s: opção inválida -- \"%c\"\n" +msgstr "%s: opção inválida -- '%c'\n" #: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136 #, c-format msgid "%s: option requires an argument -- '%c'\n" -msgstr "%s: a opção requer um argumento -- \"%c\"\n" +msgstr "%s: a opção requer um argumento -- '%c'\n" #: lib/getopt.c:964 lib/getopt.c:980 #, c-format msgid "%s: option '-W %s' is ambiguous\n" -msgstr "%s: a opção \"-W %s\" é ambígua\n" +msgstr "%s: a opção '-W %s' é ambígua\n" #: lib/getopt.c:1004 lib/getopt.c:1022 #, c-format msgid "%s: option '-W %s' doesn't allow an argument\n" -msgstr "%s: a opção \"-W %s\" não permite um argumento\n" +msgstr "%s: a opção '-W %s' não permite um argumento\n" #: lib/getopt.c:1043 lib/getopt.c:1061 #, c-format msgid "%s: option '-W %s' requires an argument\n" -msgstr "%s: a opção \"-W %s\" requer um argumento\n" +msgstr "%s: a opção '-W %s' requer um argumento\n" #. TRANSLATORS: #. Get translations for open and closing quotation marks. @@ -107,11 +109,11 @@ #. If you don't know what to put here, please see #. #. and use glyphs suitable for your language. -#: lib/quotearg.c:312 +#: lib/quotearg.c:354 msgid "`" msgstr "\"" -#: lib/quotearg.c:313 +#: lib/quotearg.c:355 msgid "'" msgstr "\"" @@ -135,13 +137,15 @@ #: lib/version-etc.c:86 msgid "" "\n" -"License GPLv3+: GNU GPL version 3 or later .\n" +"License GPLv3+: GNU GPL version 3 or later .\n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" "\n" msgstr "" "\n" -"Licença GPLv3+: GNU GPL versão 3 ou posterior .\n" +"Licença GPLv3+: GNU GPL versão 3 ou superior .\n" "Esse é um software livre: você é livre para modificá-lo e redistribuí-lo.\n" "NÃO HÁ GARANTIA, na extensão permitida pela lei.\n" "\n" @@ -293,108 +297,123 @@ #: lib/xstrtol-error.c:63 #, c-format msgid "invalid %s%s argument '%s'" -msgstr "argumento inválido %s%s para \"%s\"" +msgstr "argumento inválido %s%s para '%s'" #: lib/xstrtol-error.c:68 #, c-format msgid "invalid suffix in %s%s argument '%s'" -msgstr "sufixo inválido em argumento %s%s \"%s\"" +msgstr "sufixo inválido em argumento %s%s '%s'" #: lib/xstrtol-error.c:72 #, c-format msgid "%s%s argument '%s' too large" -msgstr "argumento %s%s \"%s\" grande demais" +msgstr "argumento %s%s '%s' grande demais" #. This is a proper name. See the gettext manual, section Names. -#: src/datamash.c:61 +#: src/datamash.c:64 msgid "Assaf Gordon" msgstr "Assaf Gordon" -#: src/datamash.c:161 src/field-ops.c:388 +#: src/datamash.c:151 src/datamash.c:467 #, c-format msgid "column name %s not found in input file" msgstr "coluna de nome %s não encontrada no arquivo de entrada" -#: src/datamash.c:174 +#: src/datamash.c:164 #, c-format -msgid "Usage: %s [OPTION] op [col] [op col ...]\n" -msgstr "Uso: %s [OPÇÃO] op [col] [op col ...]\n" +msgid "Usage: %s [OPTION] op [fld] [op fld ...]\n" +msgstr "Uso: %s [OPÇÃO] op [fld] [op fld ...]\n" -#: src/datamash.c:177 +#: src/datamash.c:167 msgid "Performs numeric/string operations on input from stdin." msgstr "Realiza operações números/textuais em dados obtidos da entrada padrão." -#: src/datamash.c:180 -msgid "'op' is the operation to perform;\n" -msgstr "\"op\" é a operação a ser realizada;\n" +#: src/datamash.c:170 +msgid "" +"'op' is the operation to perform. If a primary operation is used,\n" +"it must be listed first, optionally followed by other operations.\n" +msgstr "" +"'op' é a operação a ser realizada. Se uma operação primária for usada,\n" +"ela deve ser listada primeiro, seguida opcionalmente por outras operações.\n" -#: src/datamash.c:181 +#: src/datamash.c:173 msgid "" -"For grouping,per-line operations 'col' is the input field to use;\n" -"'col' can be a number (1=first field), or a column name when using\n" -"-H or --header-in options.\n" -msgstr "" -"Para agrupamento, operações per-linha \"col\" é o campo para usar;\n" -"\"col\" pode ser número (1=primeiro campo), ou um nome de coluna ao usar\n" -"as opções -H ou --header-in.\n" +"'fld' is the input field to use. 'fld' can be a number (1=first field),\n" +"or a field name when using the -H or --header-in options.\n" +msgstr "" +"'fld' é o campo para usar; 'fld' pode ser um número (1=primeiro campo)\\n\n" +"ou um nome de campo ao usar as opções -H ou --header-in.\n" -#: src/datamash.c:187 -msgid "File operations:\n" -msgstr "Operações com arquivos:\n" +#: src/datamash.c:176 +msgid "" +"Multiple fields can be listed with a comma (e.g. 1,6,8). A range of\n" +"fields can be listed with a dash (e.g. 2-8). Use colons for operations\n" +"which require a pair of fields (e.g. 'pcov 2:6').\n" +msgstr "" +"Múltiplos campos podem ser listados com vírgulas (ex.: 1,6,8). Um intervalo\n" +"de campos podem ser listados com um traço (ex.: 2-8). Use dois-pontos para\n" +"operações quer requerem um par de campos (ex.: 'pcov 2:6').\n" -#: src/datamash.c:190 +#: src/datamash.c:181 +msgid "Primary operations:\n" +msgstr "Operações primárias:\n" + +#: src/datamash.c:184 msgid "Line-Filtering operations:\n" -msgstr "Operações de Line-Filtering:\n" +msgstr "Operações de filtragem de linha:\n" -#: src/datamash.c:193 +#: src/datamash.c:187 msgid "Per-Line operations:\n" -msgstr "Operações Per-Line:\n" +msgstr "Operações per-linha:\n" -#: src/datamash.c:196 +#: src/datamash.c:191 msgid "Numeric Grouping operations:\n" msgstr "Operações de argumento numérico:\n" -#: src/datamash.c:199 +#: src/datamash.c:194 msgid "Textual/Numeric Grouping operations:\n" msgstr "Operações de agrupamento numérico/textual:\n" -#: src/datamash.c:203 +#: src/datamash.c:198 msgid "Statistical Grouping operations:\n" msgstr "Operações de agrupamento estatístico:\n" -#: src/datamash.c:210 -msgid "Options:\n" -msgstr "Opções:\n" - -#: src/datamash.c:211 +#: src/datamash.c:206 msgid "Grouping Options:\n" msgstr "Opções de agrupamento:\n" -#: src/datamash.c:212 +#: src/datamash.c:207 msgid "" " -f, --full print entire input line before op results\n" " (default: print only the grouped keys)\n" msgstr "" -" -f, --full exibe toda linha de entrada antes da saída de op\n" +" -f, --full exibe toda linha de entrada antes da saída de " +"op\n" " (padrão: exibe apenas as chaves agrupadas)\n" -#: src/datamash.c:216 -msgid " -g, --group=X[,Y,Z] group via fields X,[Y,Z]\n" -msgstr " -g, --group=X[,Y,Z] agrupa via campos X,[Y,Z]\n" +#: src/datamash.c:211 +msgid "" +" -g, --group=X[,Y,Z] group via fields X,[Y,Z];\n" +" equivalent to primary operation 'groupby'\n" +msgstr "" +" -g, --group=X[,Y,Z] agrupa por campos X,[Y,Z];\n" +" equivalente a operação primária 'groupby'\n" -#: src/datamash.c:219 +#: src/datamash.c:215 msgid " --header-in first input line is column headers\n" -msgstr " --header-in primeira linha de entrada é coluna de cabeçalho\n" +msgstr "" +" --header-in primeira linha de entrada é coluna de cabeçalho\n" -#: src/datamash.c:222 +#: src/datamash.c:218 msgid " --header-out print column headers as first line\n" -msgstr " --header-out exibe cabeçalhos de coluna como primeira linha\n" +msgstr "" +" --header-out exibe cabeçalhos de coluna como primeira linha\n" -#: src/datamash.c:225 +#: src/datamash.c:221 msgid " -H, --headers same as '--header-in --header-out'\n" -msgstr " -H, --headers mesmo que \"--header-in --header-out\"\n" +msgstr " -H, --headers mesmo que '--header-in --header-out'\n" -#: src/datamash.c:228 +#: src/datamash.c:224 msgid "" " -i, --ignore-case ignore upper/lower case when comparing text;\n" " this affects grouping, and string operations\n" @@ -403,41 +422,46 @@ " comparar textos; isso afeta agrupamento e\n" " operações textuais\n" -#: src/datamash.c:232 +#: src/datamash.c:228 msgid "" -" -s, --sort sort the input before grouping; this removes the\n" -" need to manually pipe the input through 'sort'\n" +" -s, --sort sort the input before grouping; this removes " +"the\n" +" need to manually pipe the input through " +"'sort'\n" msgstr "" " -s, --sort ordena a entrada antes de agrupamento;\n" -" isso remove a necessidade de redirecionar \n" -" manualmente a entrada por meio de \"sort\"\n" +" isso remove a necessidade de redirecionar\n" +" manualmente a entrada por meio de 'sort'\n" -#: src/datamash.c:237 +#: src/datamash.c:233 msgid "File Operation Options:\n" msgstr "Opções de operações com arquivos:\n" -#: src/datamash.c:238 +#: src/datamash.c:234 msgid " --no-strict allow lines with varying number of fields\n" -msgstr " --no-strict permite linhas com número variável de campos\n" +msgstr "" +" --no-strict permite linhas com número variável de campos\n" -#: src/datamash.c:241 +#: src/datamash.c:237 #, c-format msgid " --filler=X fill missing values with X (default %s)\n" -msgstr " --filler=X preenche valores em falta com X (padrão %s)\n" +msgstr "" +" --filler=X preenche valores em falta com X (padrão %s)\n" -#: src/datamash.c:246 +#: src/datamash.c:242 msgid "General Options:\n" msgstr "Opções gerais:\n" -#: src/datamash.c:247 +#: src/datamash.c:243 msgid " -t, --field-separator=X use X instead of TAB as field delimiter\n" -msgstr " -t, --field-separator=X usa X ao invés de TAB como delimitador de campo\n" +msgstr "" +" -t, --field-separator=X usa X ao invés de TAB como delimitador de campo\n" -#: src/datamash.c:250 +#: src/datamash.c:246 msgid " --narm skip NA/NaN values\n" msgstr " --narm ignora valores NA/NaN\n" -#: src/datamash.c:253 +#: src/datamash.c:249 msgid "" " -W, --whitespace use whitespace (one or more spaces and/or tabs)\n" " for field delimiters\n" @@ -445,173 +469,318 @@ " -W, --whitespace usa espaço em branco (um ou mais espaços e/ou\n" " tabs) para delimitadores de campo\n" -#: src/datamash.c:257 +#: src/datamash.c:253 msgid " -z, --zero-terminated end lines with 0 byte, not newline\n" -msgstr " -z, --zero-terminated finaliza linhas com 0 bytes, não nova linha\n" +msgstr "" +" -z, --zero-terminated finaliza linhas com 0 bytes, não nova linha\n" -#: src/datamash.c:266 +#: src/datamash.c:262 msgid "Examples:" msgstr "Exemplos:" -#: src/datamash.c:268 +#: src/datamash.c:264 msgid "Print the sum and the mean of values from column 1:" msgstr "Exibe a soma e o significado de valores da coluna 1:" -#: src/datamash.c:273 +#: src/datamash.c:269 msgid "Transpose input:" msgstr "Entrada da transposição:" -#: src/datamash.c:280 +#: src/datamash.c:276 msgid "For detailed usage information and examples, see\n" msgstr "Para exemplos e informação detalhada de uso, veja\n" -#: src/datamash.c:282 +#: src/datamash.c:278 msgid "The manual and more examples are available at\n" msgstr "O manual e mais exemplos estão disponíveis em\n" -#: src/datamash.c:291 +#: src/datamash.c:287 #, c-format -msgid "invalid input: field % requested, line % has only % fields" -msgstr "entrada inválida: campo % requisitado, linha % tem apenas % campos" +msgid "" +"invalid input: field % requested, line % has only " +"% fields" +msgstr "" +"entrada inválida: campo % requisitado, linha % tem apenas " +"% campos" -#: src/datamash.c:349 +#: src/datamash.c:357 #, c-format msgid "%s in line % field %: '%s'" -msgstr "%s na linha % campo %: \"%s\"" - -#: src/datamash.c:487 src/datamash.c:784 -#, c-format -msgid "-H or --header-in must be used with named columns" -msgstr "-H ou --header-in devem ser usados com colunas nomeadas" +msgstr "%s na linha % campo %: '%s'" -#: src/datamash.c:588 +#: src/datamash.c:676 #, c-format msgid "" -"transpose input error: line % has % fields (previous lines had %);\n" +"transpose input error: line % has % fields (previous lines " +"had %);\n" "see --help to disable strict mode" msgstr "" -"Erro na entrada da transposição: a linha % tem % campos (linhas\n" +"Erro na entrada da transposição: a linha % tem % campos " +"(linhas\n" "anteriores tinham %); veja --help para desabilitar o modo estrito" -#: src/datamash.c:644 +#: src/datamash.c:733 #, c-format msgid "" -"reverse-field input error: line % has % fields (previous lines had %);\n" +"reverse-field input error: line % has % fields (previous " +"lines had %);\n" "see --help to disable strict mode" msgstr "" -"erro na entrada de campo-reverso: a linha % tem % campos (linhas\n" +"erro na entrada de campo-reverso: a linha % tem % campos " +"(linhas\n" "anteriores tinham %); veja --help para desabilitar o modo estrito" -#: src/datamash.c:820 +#: src/datamash.c:837 src/datamash.c:843 +#, c-format +msgid "" +"line % (% fields):\n" +" " +msgstr "" +"linha % (% campos):\n" +" " + +#: src/datamash.c:849 +#, c-format +msgid "" +"check failed: line % has % fields (previous line had " +"%)" +msgstr "" +"verificação falhou: a linha % tem % campos (linha anterior " +"tinham %)" + +#: src/datamash.c:861 +#, c-format +msgid "% line" +msgid_plural "% lines" +msgstr[0] "% linha" +msgstr[1] "% linhas" + +#: src/datamash.c:864 +#, c-format +msgid "% field" +msgid_plural "% fields" +msgstr[0] "% campo" +msgstr[1] "% campos" + +#: src/datamash.c:965 #, c-format msgid "hash memory allocation error" msgstr "erro de alocação de memória hash" -#: src/datamash.c:882 +#: src/datamash.c:1027 #, c-format msgid "sort command too-long (please report this bug)" msgstr "comando sort grande demais (por favor, relate esse erro)" -#: src/datamash.c:888 +#: src/datamash.c:1033 #, c-format msgid "failed to run 'sort': popen failed" -msgstr "falha ao executar \"sort\": popen falhou" +msgstr "falha ao executar 'sort': popen falhou" -#: src/datamash.c:904 +#: src/datamash.c:1049 #, c-format msgid "read error" msgstr "erro de leitura" -#: src/datamash.c:912 +#: src/datamash.c:1057 #, c-format msgid "read error (on close)" msgstr "erro de leitura (ao fechar)" -#: src/datamash.c:939 -#, c-format -msgid "invalid empty grouping parameter" -msgstr "parâmetro de agrupamento vazio inválido" - -#: src/datamash.c:946 -#, c-format -msgid "invalid grouping parameter %s" -msgstr "parâmetro de agrupamento inválido %s" - -#: src/datamash.c:1031 +#: src/datamash.c:1133 #, c-format msgid "the delimiter must be a single character" msgstr "o delimitador deve ser um caractere singular" -#: src/datamash.c:1067 +#: src/datamash.c:1170 #, c-format msgid "missing operation specifiers" msgstr "faltando especificadores de operação" -#: src/field-ops.c:293 +#: src/datamash.c:1184 #, c-format -msgid "invalid empty column for operation %s" -msgstr "coluna vazia inválida para operação %s" +msgid "-H or --header-in must be used with named columns" +msgstr "-H ou --header-in devem ser usados com colunas nomeadas" -#: src/field-ops.c:306 +#: src/field-ops.c:319 #, c-format -msgid "invalid column '%s' for operation %s" -msgstr "coluna inválida \"%s\" para operação %s" +msgid "" +"input error for operation %s: fields %,% have different " +"number of items" +msgstr "" +"erro de entrada para a operação %s: campos %,% tem número " +"diferente de itens" -#: src/field-ops.c:985 +#: src/field-ops.c:999 +msgid "invalid numeric value" +msgstr "valor numérico inválido" + +#: src/field-ops.c:1001 +msgid "invalid base64 value" +msgstr "valor base64 inválido" + +#: src/op-parser.c:163 src/op-parser.c:177 src/op-parser.c:184 +#, c-format +msgid "too many parameters for operation %s" +msgstr "número excessivo de parâmetros para a operação %s" + +#: src/op-parser.c:174 +#, c-format +msgid "strbin bucket size must not be zero" +msgstr "tamanho do balde (bucket) de strbin deve ser diferente de zero" + +#: src/op-parser.c:205 src/op-parser.c:216 src/op-parser.c:472 +#, c-format +msgid "missing field for operation %s" +msgstr "faltando campo para a operação %s" + +#: src/op-parser.c:211 src/op-parser.c:220 src/op-parser.c:275 +#: src/op-parser.c:508 +#, c-format +msgid "invalid field range for operation %s" +msgstr "intervalo de campos inválido para a operação %s" + +#: src/op-parser.c:214 src/op-parser.c:224 src/op-parser.c:511 +#, c-format +msgid "invalid field pair for operation %s" +msgstr "par de campos inválido para a operação %s" + +#: src/op-parser.c:238 src/op-parser.c:486 +#, c-format +msgid "invalid field '%s' for operation %s" +msgstr "'%s' de campo inválido para a operação %s" + +#: src/op-parser.c:272 +#, c-format +msgid "field range for %s must be numeric" +msgstr "intervalo de campos para %s deve ser numérico" + +#: src/op-parser.c:332 +#, c-format +msgid "missing parameter for operation %s" +msgstr "faltando parâmetro para a operação %s" + +#: src/op-parser.c:340 +#, c-format +msgid "invalid parameter %s for operation %s" +msgstr "parâmetro %s inválido para a operação %s" + +#: src/op-parser.c:372 +#, c-format +msgid "operation %s requires field pairs" +msgstr "a operação %s requer pares de campos" + +#: src/op-parser.c:375 #, c-format -msgid "invalid operation '%s'" -msgstr "operação inválida \"%s\"" +msgid "operation %s cannot use pair of fields" +msgstr "a operação %s não pode usar par de campos" + +#: src/op-parser.c:415 +#, c-format +msgid "conflicting operation %s" +msgstr "operação conflitante %s" + +#: src/op-parser.c:418 src/op-parser.c:597 +#, c-format +msgid "invalid operation %s" +msgstr "operação inválida %s" # primeira e segunda variáveis são modo, terceira é nome -#: src/field-ops.c:1001 +#: src/op-parser.c:423 #, c-format -msgid "conflicting operation found: expecting %s operations, but found %s operation %s" -msgstr "operação conflitante encontrada: esperava operações de %s, mas foi encontrada operação de %s de nome %s" +msgid "" +"conflicting operation found: expecting %s operations, but found %s operation " +"%s" +msgstr "" +"operação conflitante encontrada: esperava operações de %s, mas foi " +"encontrada operação de %s de nome %s" -#: src/field-ops.c:1009 +#: src/op-parser.c:537 #, c-format -msgid "missing field number after operation '%s'" -msgstr "faltando número do campo após operação \"%s\"" +msgid "crosstab requires exactly 2 fields, found %" +msgstr "crosstab requer exatamente 2 campos, encontrado(s) %" -#: src/field-ops.c:1029 +#: src/op-parser.c:550 #, c-format -msgid "extra operands after '%s'" -msgstr "operandos extra após \"%s\"" +msgid "crosstab supports one operation, found %" +msgstr "crosstab oferece suporte a apenas uma operação, encontradas %" -#: src/field-ops.c:1094 -msgid "invalid numeric value" -msgstr "valor numérico inválido" +#: src/op-parser.c:559 +#, c-format +msgid "missing operation" +msgstr "faltando a operação" -#: src/field-ops.c:1096 -msgid "invalid base64 value" -msgstr "valor base64 inválido" +#: src/op-parser.c:573 +#, c-format +msgid "extra operand %s" +msgstr "operando extra %s" + +#: src/op-parser.c:710 src/op-scanner.c:210 +#, c-format +msgid "missing script (among arguments)" +msgstr "faltando script (dentre argumentos)" + +#: src/op-scanner.c:167 +#, c-format +msgid "invalid numeric value '%s'" +msgstr "valor numérico inválido '%s'" + +#: src/op-scanner.c:188 +#, c-format +msgid "invalid operand %s" +msgstr "operação inválida %s" + +#: src/op-scanner.c:244 +#, c-format +msgid "unknown token %d\n" +msgstr "token desconhecido %d\n" # movi para frente para ajustar às demais mensagens do '--help' -- Rafael -#: src/system.h:101 +#: src/system.h:133 msgid " --help display this help and exit\n" msgstr " --help mostra esta ajuda e sai\n" # movi para frente para ajustar às demais mensagens do '--help' -- Rafael -#: src/system.h:103 +#: src/system.h:135 msgid " --version output version information and exit\n" msgstr " --version mostra informação da versão e sai\n" -#: src/system.h:108 +#: src/system.h:140 #, c-format msgid "Try '%s --help' for more information.\n" -msgstr "Tente \"%s --help\" para mais informações.\n" +msgstr "Tente '%s --help' para mais informações.\n" + +#~ msgid "'op' is the operation to perform;\n" +#~ msgstr "'op' é a operação a ser realizada;\n" + +#~ msgid "File operations:\n" +#~ msgstr "Operações com arquivos:\n" + +#~ msgid "Options:\n" +#~ msgstr "Opções:\n" + +#~ msgid " -g, --group=X[,Y,Z] group via fields X,[Y,Z]\n" +#~ msgstr " -g, --group=X[,Y,Z] agrupa via campos X,[Y,Z]\n" + +#~ msgid "invalid empty grouping parameter" +#~ msgstr "parâmetro de agrupamento vazio inválido" + +#~ msgid "invalid grouping parameter %s" +#~ msgstr "parâmetro de agrupamento inválido %s" #~ msgid "For grouping operations 'col' is the input field to use." -#~ msgstr "Para operações de agrupamento, \"col\" é o campo de entrada a usar." +#~ msgstr "Para operações de agrupamento, 'col' é o campo de entrada a usar." #~ msgid " --debug print helpful debugging information\n" -#~ msgstr " --debug exibe informação útil para ajudar na depuração\n" +#~ msgstr "" +#~ " --debug exibe informação útil para ajudar na " +#~ "depuração\n" #~ msgid "invalid numeric input in line %zu field %zu: '%s'" -#~ msgstr "entrada numérica inválida na linha %zu campo %zu: \"%s\"" +#~ msgstr "entrada numérica inválida na linha %zu campo %zu: '%s'" #~ msgid "invalid field value for grouping '%s'" -#~ msgstr "valor de campo inválido para agrupamento \"%s\"" +#~ msgstr "valor de campo inválido para agrupamento '%s'" #~ msgid "invalid field value (zero) for grouping" #~ msgstr "valor de campo inválido (zero) para agrupamento" Binary files /tmp/tmp4U70c2/7esjCa0Q6b/datamash-1.0.7/po/sr.gmo and /tmp/tmp4U70c2/Lx1O0FDBbS/datamash-1.1.1/po/sr.gmo differ diff -Nru datamash-1.0.7/po/sr.po datamash-1.1.1/po/sr.po --- datamash-1.0.7/po/sr.po 2015-06-17 23:49:31.000000000 +0000 +++ datamash-1.1.1/po/sr.po 2017-01-19 18:51:35.000000000 +0000 @@ -1,19 +1,20 @@ # Serbian translation for datamash. # Copyright (C) 2014 Free Software Foundation, Inc. # This file is distributed under the same license as the datamash package. -# Мирослав Николић , 2014. +# Мирослав Николић , 2014—2016. msgid "" msgstr "" -"Project-Id-Version: datamash-1.0.6\n" +"Project-Id-Version: datamash-1.0.7.58\n" "Report-Msgid-Bugs-To: bug-datamash@gnu.org\n" -"POT-Creation-Date: 2015-06-17 19:49-0400\n" -"PO-Revision-Date: 2014-09-14 19:58+0200\n" +"POT-Creation-Date: 2017-01-19 13:51-0500\n" +"PO-Revision-Date: 2016-03-05 09:11+0200\n" "Last-Translator: Мирослав Николић \n" "Language-Team: Serbian <(nothing)>\n" "Language: sr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" @@ -31,9 +32,9 @@ msgstr "%s: опција „%s“ је нејасна; могућности:" #: lib/getopt.c:619 -#, fuzzy, c-format +#, c-format msgid "%s: option '%s' is ambiguous\n" -msgstr "%s: опција „-W %s“ је нејасна\n" +msgstr "%s: опција „%s“ је нејасна\n" #: lib/getopt.c:654 lib/getopt.c:658 #, c-format @@ -106,11 +107,11 @@ #. If you don't know what to put here, please see #. #. and use glyphs suitable for your language. -#: lib/quotearg.c:312 +#: lib/quotearg.c:354 msgid "`" msgstr "„" -#: lib/quotearg.c:313 +#: lib/quotearg.c:355 msgid "'" msgstr "“" @@ -307,70 +308,79 @@ msgstr "%s%s аргумент „%s“ је превелик" #. This is a proper name. See the gettext manual, section Names. -#: src/datamash.c:61 +#: src/datamash.c:64 msgid "Assaf Gordon" msgstr "Асаф Гордон" -#: src/datamash.c:161 src/field-ops.c:388 +#: src/datamash.c:151 src/datamash.c:467 #, c-format msgid "column name %s not found in input file" -msgstr "" +msgstr "нисам нашао назив ступца „%s“ у улазној датотеци" -#: src/datamash.c:174 +#: src/datamash.c:164 #, c-format -msgid "Usage: %s [OPTION] op [col] [op col ...]\n" -msgstr "Употреба: %s [ОПЦИЈА] op [col] [op col ...]\n" +msgid "Usage: %s [OPTION] op [fld] [op fld ...]\n" +msgstr "Употреба: %s [ОПЦИЈА] op [fld] [op fld ...]\n" -#: src/datamash.c:177 +#: src/datamash.c:167 msgid "Performs numeric/string operations on input from stdin." msgstr "Обавите радње бројева/ниски на улазу из стандардног улаза." -#: src/datamash.c:180 -msgid "'op' is the operation to perform;\n" -msgstr "„op“ је операција за обављање;\n" +#: src/datamash.c:170 +msgid "" +"'op' is the operation to perform. If a primary operation is used,\n" +"it must be listed first, optionally followed by other operations.\n" +msgstr "" +"„op“ је радња за обављање. Ако се користи примарна радња,\n" +"мора бити наведена прва, за којом по избору следе друге радње.\n" -#: src/datamash.c:181 +#: src/datamash.c:173 msgid "" -"For grouping,per-line operations 'col' is the input field to use;\n" -"'col' can be a number (1=first field), or a column name when using\n" -"-H or --header-in options.\n" +"'fld' is the input field to use. 'fld' can be a number (1=first field),\n" +"or a field name when using the -H or --header-in options.\n" msgstr "" +"„fld“ је улазно поље за коришћење; „fld“ може бити број (1=прво поље),\n" +"или назив поља када се користе опције „-H“ или „--header-in“.\n" -#: src/datamash.c:187 -msgid "File operations:\n" -msgstr "Радње над датотекама:\n" +#: src/datamash.c:176 +msgid "" +"Multiple fields can be listed with a comma (e.g. 1,6,8). A range of\n" +"fields can be listed with a dash (e.g. 2-8). Use colons for operations\n" +"which require a pair of fields (e.g. 'pcov 2:6').\n" +msgstr "" +"Више поља може бити наведено зарезом (нпр. 1,6,8). Опсег поља\n" +"може бити наведен цртицом (нпр. 2-8). Користите двотачке за\n" +"радње које захтевају пар поља (нпр. „pcov 2:6“).\n" + +#: src/datamash.c:181 +msgid "Primary operations:\n" +msgstr "Примарне радње:\n" -#: src/datamash.c:190 -#, fuzzy +#: src/datamash.c:184 msgid "Line-Filtering operations:\n" -msgstr "Радње над датотекама:\n" +msgstr "Радње издвајања редова:\n" -#: src/datamash.c:193 -#, fuzzy +#: src/datamash.c:187 msgid "Per-Line operations:\n" -msgstr "Радње над датотекама:\n" +msgstr "Радње над редовима:\n" -#: src/datamash.c:196 +#: src/datamash.c:191 msgid "Numeric Grouping operations:\n" msgstr "Радње бројевног груписања:\n" -#: src/datamash.c:199 +#: src/datamash.c:194 msgid "Textual/Numeric Grouping operations:\n" msgstr "Радње текстуалног/бројевног груписања:\n" -#: src/datamash.c:203 +#: src/datamash.c:198 msgid "Statistical Grouping operations:\n" msgstr "Радње статистичког груписања:\n" -#: src/datamash.c:210 -msgid "Options:\n" -msgstr "Опције:\n" - -#: src/datamash.c:211 +#: src/datamash.c:206 msgid "Grouping Options:\n" msgstr "Опције груписања:\n" -#: src/datamash.c:212 +#: src/datamash.c:207 msgid "" " -f, --full print entire input line before op results\n" " (default: print only the grouped keys)\n" @@ -378,23 +388,27 @@ " -f, --full исписује читави улазни ред пре оп резултата\n" " (основно: исписује само груписане кључеве)\n" -#: src/datamash.c:216 -msgid " -g, --group=X[,Y,Z] group via fields X,[Y,Z]\n" -msgstr " -g, --group=X[,Y,Z] групише путем поља X,[Y,Z]\n" +#: src/datamash.c:211 +msgid "" +" -g, --group=X[,Y,Z] group via fields X,[Y,Z];\n" +" equivalent to primary operation 'groupby'\n" +msgstr "" +" -g, --group=X[,Y,Z] групише путем поља X,[Y,Z];\n" +" еквивалент примарној радњи „groupby“\n" -#: src/datamash.c:219 +#: src/datamash.c:215 msgid " --header-in first input line is column headers\n" -msgstr " --header-in први улазни ред јесу заглавља колоне\n" +msgstr " --header-in први улазни ред јесу заглавља ступца\n" -#: src/datamash.c:222 +#: src/datamash.c:218 msgid " --header-out print column headers as first line\n" msgstr " --header-out исписује заглавља ступца као први ред\n" -#: src/datamash.c:225 +#: src/datamash.c:221 msgid " -H, --headers same as '--header-in --header-out'\n" msgstr " -H, --headers исто као „--header-in --header-out“\n" -#: src/datamash.c:228 +#: src/datamash.c:224 msgid "" " -i, --ignore-case ignore upper/lower case when comparing text;\n" " this affects grouping, and string operations\n" @@ -402,7 +416,7 @@ " -i, --ignore-case занемарује велика/мала слова када пореди текст;\n" " ово утиче на груписање, и на радње ниске\n" -#: src/datamash.c:232 +#: src/datamash.c:228 msgid "" " -s, --sort sort the input before grouping; this removes " "the\n" @@ -412,36 +426,36 @@ " -s, --sort ређа улаз пре груписања; ово уклања потребу\n" " за ручним преспајањем улаза кроз „sort“\n" -#: src/datamash.c:237 +#: src/datamash.c:233 msgid "File Operation Options:\n" msgstr "Опције радње датотеке:\n" -#: src/datamash.c:238 +#: src/datamash.c:234 msgid " --no-strict allow lines with varying number of fields\n" msgstr "" " --no-strict допушта редове са променљивим бројем поља\n" -#: src/datamash.c:241 +#: src/datamash.c:237 #, c-format msgid " --filler=X fill missing values with X (default %s)\n" msgstr "" " --filler=X попуњава недостајуће вредности са X (основно " "%s)\n" -#: src/datamash.c:246 +#: src/datamash.c:242 msgid "General Options:\n" msgstr "Опште опције:\n" -#: src/datamash.c:247 +#: src/datamash.c:243 msgid " -t, --field-separator=X use X instead of TAB as field delimiter\n" msgstr "" " -t, --field-separator=X користи X уместо табулатора као граничника поља\n" -#: src/datamash.c:250 +#: src/datamash.c:246 msgid " --narm skip NA/NaN values\n" -msgstr "" +msgstr " --narm прескаче вредности „NA/NaN“\n" -#: src/datamash.c:253 +#: src/datamash.c:249 msgid "" " -W, --whitespace use whitespace (one or more spaces and/or tabs)\n" " for field delimiters\n" @@ -450,167 +464,301 @@ "табулаторе)\n" " за граничнике поља\n" -#: src/datamash.c:257 +#: src/datamash.c:253 msgid " -z, --zero-terminated end lines with 0 byte, not newline\n" msgstr " -z, --zero-terminated завршава редове 0 бајтом, не новим редом\n" -#: src/datamash.c:266 +#: src/datamash.c:262 msgid "Examples:" msgstr "Примери:" -#: src/datamash.c:268 +#: src/datamash.c:264 msgid "Print the sum and the mean of values from column 1:" msgstr "Исписује збир и средње вредности из 1. ступца:" -#: src/datamash.c:273 +#: src/datamash.c:269 msgid "Transpose input:" msgstr "Улаз премештања:" -#: src/datamash.c:280 +#: src/datamash.c:276 msgid "For detailed usage information and examples, see\n" msgstr "За више података о коришћењу и примере, видите\n" -#: src/datamash.c:282 +#: src/datamash.c:278 msgid "The manual and more examples are available at\n" msgstr "Приручник и још примера је доступно на\n" -#: src/datamash.c:291 -#, fuzzy, c-format +#: src/datamash.c:287 +#, c-format msgid "" "invalid input: field % requested, line % has only " "% fields" msgstr "" -"нема довољно улазних поља (затражено је %zu. поље, улаз има само %zu поља)" +"неисправан улаз: затражено је поље %, %. ред има само " +"% поља" -#: src/datamash.c:349 +#: src/datamash.c:357 #, c-format msgid "%s in line % field %: '%s'" -msgstr "" +msgstr "%s у %. реду поље %: „%s“" -#: src/datamash.c:487 src/datamash.c:784 +#: src/datamash.c:676 #, c-format -msgid "-H or --header-in must be used with named columns" -msgstr "" - -#: src/datamash.c:588 -#, fuzzy, c-format msgid "" "transpose input error: line % has % fields (previous lines " "had %);\n" "see --help to disable strict mode" msgstr "" -"грешка премештања улаза: %zu. ред има %zu поља (претходни ред има %zu);\n" +"грешка премештања улаза: %. ред има % поља (претходни ред " +"има %);\n" "видите „--help“ да искључите искључиви режим" -#: src/datamash.c:644 -#, fuzzy, c-format +#: src/datamash.c:733 +#, c-format msgid "" "reverse-field input error: line % has % fields (previous " "lines had %);\n" "see --help to disable strict mode" msgstr "" -"грешка преокретања поља улаза: %zu. ред има %zu поља (претходни ред има " -"%zu);\n" +"грешка преокретања поља улаза: %. ред има % поља " +"(претходни ред има %);\n" "видите „--help“ да искључите искључиви режим" -#: src/datamash.c:820 +#: src/datamash.c:837 src/datamash.c:843 #, c-format -msgid "hash memory allocation error" +msgid "" +"line % (% fields):\n" +" " +msgstr "" +"%. ред (поље %):\n" +" " + +#: src/datamash.c:849 +#, c-format +msgid "" +"check failed: line % has % fields (previous line had " +"%)" msgstr "" +"провера није успела: %. ред има % поља (претходни ред има " +"%)" + +#: src/datamash.c:861 +#, c-format +msgid "% line" +msgid_plural "% lines" +msgstr[0] "% ред" +msgstr[1] "% реда" +msgstr[2] "% редова" + +#: src/datamash.c:864 +#, c-format +msgid "% field" +msgid_plural "% fields" +msgstr[0] "% поље" +msgstr[1] "% поља" +msgstr[2] "% поља" -#: src/datamash.c:882 +#: src/datamash.c:965 +#, c-format +msgid "hash memory allocation error" +msgstr "грешка доделе хеш меморије" + +#: src/datamash.c:1027 #, c-format msgid "sort command too-long (please report this bug)" msgstr "наредба ређања је предуга (пријавите ову грешку)" -#: src/datamash.c:888 +#: src/datamash.c:1033 #, c-format msgid "failed to run 'sort': popen failed" msgstr "нисам успео да покренем „sort“: није успело „popen“" -#: src/datamash.c:904 +#: src/datamash.c:1049 #, c-format msgid "read error" msgstr "грешка читања" -#: src/datamash.c:912 +#: src/datamash.c:1057 #, c-format msgid "read error (on close)" msgstr "грешка читања (при затварању)" -#: src/datamash.c:939 -#, fuzzy, c-format -msgid "invalid empty grouping parameter" -msgstr "неисправан параметар груписања „%s“" - -#: src/datamash.c:946 -#, fuzzy, c-format -msgid "invalid grouping parameter %s" -msgstr "неисправан параметар груписања „%s“" - -#: src/datamash.c:1031 +#: src/datamash.c:1133 #, c-format msgid "the delimiter must be a single character" msgstr "граничник мора бити један знак" -#: src/datamash.c:1067 +#: src/datamash.c:1170 #, c-format msgid "missing operation specifiers" msgstr "недостају одредници радње" -#: src/field-ops.c:293 -#, fuzzy, c-format -msgid "invalid empty column for operation %s" -msgstr "неисправан стубац „%s“ за радњу „%s“" - -#: src/field-ops.c:306 -#, fuzzy, c-format -msgid "invalid column '%s' for operation %s" -msgstr "неисправан стубац „%s“ за радњу „%s“" +#: src/datamash.c:1184 +#, c-format +msgid "-H or --header-in must be used with named columns" +msgstr "„-H“ или „--header-in“ мора да се користи са именованим ступцима" -#: src/field-ops.c:985 +#: src/field-ops.c:319 #, c-format -msgid "invalid operation '%s'" -msgstr "неисправна радња „%s“" +msgid "" +"input error for operation %s: fields %,% have different " +"number of items" +msgstr "" +"улазна грешка за радњу „%s“: поља %,% имају различит број " +"ставки" + +#: src/field-ops.c:999 +msgid "invalid numeric value" +msgstr "неисправна бројевна вредност" #: src/field-ops.c:1001 +msgid "invalid base64 value" +msgstr "неисправна вредност основе64" + +#: src/op-parser.c:163 src/op-parser.c:177 src/op-parser.c:184 +#, c-format +msgid "too many parameters for operation %s" +msgstr "превише параметара за радњу „%s“" + +#: src/op-parser.c:174 +#, c-format +msgid "strbin bucket size must not be zero" +msgstr "величина ведра „strbin“ не сме бити нула" + +#: src/op-parser.c:205 src/op-parser.c:216 src/op-parser.c:472 +#, c-format +msgid "missing field for operation %s" +msgstr "недостаје поље за радњу „%s“" + +#: src/op-parser.c:211 src/op-parser.c:220 src/op-parser.c:275 +#: src/op-parser.c:508 +#, c-format +msgid "invalid field range for operation %s" +msgstr "неисправан опсег поља за радњу „%s“" + +#: src/op-parser.c:214 src/op-parser.c:224 src/op-parser.c:511 +#, c-format +msgid "invalid field pair for operation %s" +msgstr "неисправан пар поља за радњу „%s“" + +#: src/op-parser.c:238 src/op-parser.c:486 +#, c-format +msgid "invalid field '%s' for operation %s" +msgstr "неисправно поље „%s“ за радњу „%s“" + +#: src/op-parser.c:272 +#, c-format +msgid "field range for %s must be numeric" +msgstr "опсег поља за „%s“ мора бити бројни" + +#: src/op-parser.c:332 +#, c-format +msgid "missing parameter for operation %s" +msgstr "недостаје параметар за радњу „%s“" + +#: src/op-parser.c:340 +#, c-format +msgid "invalid parameter %s for operation %s" +msgstr "неисправан параметар „%s“ за радњу „%s“" + +#: src/op-parser.c:372 +#, c-format +msgid "operation %s requires field pairs" +msgstr "радња „%s“ захтева парове поља" + +#: src/op-parser.c:375 +#, c-format +msgid "operation %s cannot use pair of fields" +msgstr "радња „%s“ не може користити пар поља" + +#: src/op-parser.c:415 +#, c-format +msgid "conflicting operation %s" +msgstr "сукобљавајућа радња „%s“" + +#: src/op-parser.c:418 src/op-parser.c:597 +#, c-format +msgid "invalid operation %s" +msgstr "неисправна радња „%s“" + +#: src/op-parser.c:423 #, c-format msgid "" "conflicting operation found: expecting %s operations, but found %s operation " "%s" -msgstr "" +msgstr "нађох сукобљавајућу радњу: очекивах %s радње, али нађох %s радње %s" -#: src/field-ops.c:1009 +#: src/op-parser.c:537 #, c-format -msgid "missing field number after operation '%s'" -msgstr "недостаје број поља након радње „%s“" +msgid "crosstab requires exactly 2 fields, found %" +msgstr "„crosstab“ захтева тачно 2 поља, нађох %" -#: src/field-ops.c:1029 +#: src/op-parser.c:550 #, c-format -msgid "extra operands after '%s'" -msgstr "додатни операмд након „%s“" +msgid "crosstab supports one operation, found %" +msgstr "„crosstab“ подржава једну радњу, нађох %" -#: src/field-ops.c:1094 -msgid "invalid numeric value" -msgstr "" +#: src/op-parser.c:559 +#, c-format +msgid "missing operation" +msgstr "недостаје радња" -#: src/field-ops.c:1096 -msgid "invalid base64 value" -msgstr "" +#: src/op-parser.c:573 +#, c-format +msgid "extra operand %s" +msgstr "додатни операнд „%s“" + +#: src/op-parser.c:710 src/op-scanner.c:210 +#, c-format +msgid "missing script (among arguments)" +msgstr "недостаје скрипт (око аргумената)" -#: src/system.h:101 +#: src/op-scanner.c:167 +#, c-format +msgid "invalid numeric value '%s'" +msgstr "неисправна бројевна вредност „%s“" + +#: src/op-scanner.c:188 +#, c-format +msgid "invalid operand %s" +msgstr "неисправан операнд „%s“" + +#: src/op-scanner.c:244 +#, c-format +msgid "unknown token %d\n" +msgstr "непознат чинилац „%d“\n" + +#: src/system.h:133 msgid " --help display this help and exit\n" msgstr " --help приказује ову помоћ и излази\n" -#: src/system.h:103 +#: src/system.h:135 msgid " --version output version information and exit\n" msgstr " --version исписује податке о издању и излази\n" -#: src/system.h:108 +#: src/system.h:140 #, c-format msgid "Try '%s --help' for more information.\n" msgstr "Пробајте „%s --help“ за више података.\n" +#~ msgid "'op' is the operation to perform;\n" +#~ msgstr "„op“ је операција за обављање;\n" + +#~ msgid "File operations:\n" +#~ msgstr "Радње над датотекама:\n" + +#~ msgid "Options:\n" +#~ msgstr "Опције:\n" + +#~ msgid " -g, --group=X[,Y,Z] group via fields X,[Y,Z]\n" +#~ msgstr " -g, --group=X[,Y,Z] групише путем поља X,[Y,Z]\n" + +#~ msgid "invalid empty grouping parameter" +#~ msgstr "неисправан параметар празног груписања" + +#~ msgid "invalid grouping parameter %s" +#~ msgstr "неисправан параметар груписања „%s“" + #~ msgid "For grouping operations 'col' is the input field to use." #~ msgstr "За операције груписања „col“ је улазно поље за коришћење." Binary files /tmp/tmp4U70c2/7esjCa0Q6b/datamash-1.0.7/po/sv.gmo and /tmp/tmp4U70c2/Lx1O0FDBbS/datamash-1.1.1/po/sv.gmo differ diff -Nru datamash-1.0.7/po/sv.po datamash-1.1.1/po/sv.po --- datamash-1.0.7/po/sv.po 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/po/sv.po 2017-01-19 18:51:35.000000000 +0000 @@ -0,0 +1,773 @@ +# Swedish messages for datamash. +# Copyright © 2015, 2016 Free Software Foundation, Inc. +# This file is distributed under the same license as the datamash package. +# Translations from Coreutils: +# Peter Antman , 1997. +# Thomas Olsson , 1997. +# Daniel Resare 1999, 2000. +# Göran Uddeborg , 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015. +# +# Datamash translation: +# Anders Jonsson , 2015, 2016. +# +msgid "" +msgstr "" +"Project-Id-Version: datamash 1.0.7.58\n" +"Report-Msgid-Bugs-To: bug-datamash@gnu.org\n" +"POT-Creation-Date: 2017-01-19 13:51-0500\n" +"PO-Revision-Date: 2016-01-18 20:31+0100\n" +"Last-Translator: Anders Jonsson \n" +"Language-Team: Swedish \n" +"Language: sv\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 1.8.6\n" + +#: lib/closeout.c:112 +msgid "write error" +msgstr "skrivfel" + +#: lib/error.c:191 +msgid "Unknown system error" +msgstr "Okänt systemfel" + +#: lib/getopt.c:575 lib/getopt.c:604 +#, c-format +msgid "%s: option '%s' is ambiguous; possibilities:" +msgstr "%s: flaggan ”%s” är tvetydig; möjligheter:" + +#: lib/getopt.c:619 +#, c-format +msgid "%s: option '%s' is ambiguous\n" +msgstr "%s: flaggan ”%s” är tvetydig\n" + +#: lib/getopt.c:654 lib/getopt.c:658 +#, c-format +msgid "%s: option '--%s' doesn't allow an argument\n" +msgstr "%s: flaggan ”--%s” tar inget argument\n" + +#: lib/getopt.c:667 lib/getopt.c:672 +#, c-format +msgid "%s: option '%c%s' doesn't allow an argument\n" +msgstr "%s: flaggan ”%c%s” tar inget argument\n" + +#: lib/getopt.c:715 lib/getopt.c:734 +#, c-format +msgid "%s: option '--%s' requires an argument\n" +msgstr "%s: flaggan ”--%s” kräver ett argument\n" + +#: lib/getopt.c:772 lib/getopt.c:775 +#, c-format +msgid "%s: unrecognized option '--%s'\n" +msgstr "%s: okänd flagga ”--%s”\n" + +#: lib/getopt.c:783 lib/getopt.c:786 +#, c-format +msgid "%s: unrecognized option '%c%s'\n" +msgstr "%s: okänd flagga ”%c%s”\n" + +#: lib/getopt.c:835 lib/getopt.c:838 +#, c-format +msgid "%s: invalid option -- '%c'\n" +msgstr "%s: ogiltig flagga -- ”%c”\n" + +#: lib/getopt.c:891 lib/getopt.c:908 lib/getopt.c:1118 lib/getopt.c:1136 +#, c-format +msgid "%s: option requires an argument -- '%c'\n" +msgstr "%s: flaggan kräver ett argument -- ”%c”\n" + +#: lib/getopt.c:964 lib/getopt.c:980 +#, c-format +msgid "%s: option '-W %s' is ambiguous\n" +msgstr "%s: flaggan ”-W %s” är tvetydig\n" + +#: lib/getopt.c:1004 lib/getopt.c:1022 +#, c-format +msgid "%s: option '-W %s' doesn't allow an argument\n" +msgstr "%s: flaggan ”-W %s” tar inget argument\n" + +#: lib/getopt.c:1043 lib/getopt.c:1061 +#, c-format +msgid "%s: option '-W %s' requires an argument\n" +msgstr "%s: flaggan ”-W %s” kräver ett argument\n" + +#. TRANSLATORS: +#. Get translations for open and closing quotation marks. +#. The message catalog should translate "`" to a left +#. quotation mark suitable for the locale, and similarly for +#. "'". For example, a French Unicode local should translate +#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE +#. QUOTATION MARK), respectively. +#. +#. If the catalog has no translation, we will try to +#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and +#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK). If the +#. current locale is not Unicode, locale_quoting_style +#. will quote 'like this', and clocale_quoting_style will +#. quote "like this". You should always include translations +#. for "`" and "'" even if U+2018 and U+2019 are appropriate +#. for your locale. +#. +#. If you don't know what to put here, please see +#. +#. and use glyphs suitable for your language. +#: lib/quotearg.c:354 +msgid "`" +msgstr "”" + +#: lib/quotearg.c:355 +msgid "'" +msgstr "”" + +#: lib/version-etc.c:74 +#, c-format +msgid "Packaged by %s (%s)\n" +msgstr "Paketerad av %s (%s)\n" + +#: lib/version-etc.c:77 +#, c-format +msgid "Packaged by %s\n" +msgstr "Paketerad av %s\n" + +#. TRANSLATORS: Translate "(C)" to the copyright symbol +#. (C-in-a-circle), if this symbol is available in the user's +#. locale. Otherwise, do not translate "(C)"; leave it as-is. +#: lib/version-etc.c:84 +msgid "(C)" +msgstr "©" + +#: lib/version-etc.c:86 +msgid "" +"\n" +"License GPLv3+: GNU GPL version 3 or later .\n" +"This is free software: you are free to change and redistribute it.\n" +"There is NO WARRANTY, to the extent permitted by law.\n" +"\n" +msgstr "" +"\n" +"Licens GPLv3+: GNU GPL version 3 eller senare .\n" +"Detta är fri programvara: du får lov att ändra och vidaredistribuera den.\n" +"Det finns INGEN GARANTI, så långt lagen tillåter.\n" +"\n" + +#. TRANSLATORS: %s denotes an author name. +#: lib/version-etc.c:102 +#, c-format +msgid "Written by %s.\n" +msgstr "Skrivet av %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:106 +#, c-format +msgid "Written by %s and %s.\n" +msgstr "Skrivet av %s och %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#: lib/version-etc.c:110 +#, c-format +msgid "Written by %s, %s, and %s.\n" +msgstr "Skrivet av %s, %s och %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:117 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Skrivet av %s, %s, %s\n" +"och %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:124 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Skrivet av %s, %s, %s,\n" +"%s och %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:131 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, and %s.\n" +msgstr "" +"Skrivet av %s, %s, %s,\n" +"%s, %s och %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:139 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, and %s.\n" +msgstr "" +"Skrivet av %s, %s, %s,\n" +"%s, %s, %s och %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:147 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"and %s.\n" +msgstr "" +"Skrivet av %s, %s, %s,\n" +"%s, %s, %s, %s\n" +"och %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:156 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, and %s.\n" +msgstr "" +"Skrivet av %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s och %s.\n" + +#. TRANSLATORS: Each %s denotes an author name. +#. You can use line breaks, estimating that each author name occupies +#. ca. 16 screen columns and that a screen line has ca. 80 columns. +#: lib/version-etc.c:167 +#, c-format +msgid "" +"Written by %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s, and others.\n" +msgstr "" +"Skrivet av %s, %s, %s,\n" +"%s, %s, %s, %s,\n" +"%s, %s med flera.\n" + +#. TRANSLATORS: The placeholder indicates the bug-reporting address +#. for this package. Please add _another line_ saying +#. "Report translation bugs to <...>\n" with the address for translation +#. bugs (typically your translation team's web or email address). +#: lib/version-etc.c:245 +#, c-format +msgid "" +"\n" +"Report bugs to: %s\n" +msgstr "" +"\n" +"Rapportera fel till %s\n" +"Rapportera kommentarer om översättningen till \n" + +#: lib/version-etc.c:247 +#, c-format +msgid "Report %s bugs to: %s\n" +msgstr "" +"Rapportera fel i %s till %s\n" +"Rapportera kommentarer om översättningen till \n" + +#: lib/version-etc.c:251 +#, c-format +msgid "%s home page: <%s>\n" +msgstr "%s hemsida: <%s>\n" + +#: lib/version-etc.c:253 +#, c-format +msgid "%s home page: \n" +msgstr "%s hemsida: \n" + +#: lib/version-etc.c:256 +msgid "General help using GNU software: \n" +msgstr "" +"Allmän hjälp med att använda GNU-program: \n" + +#: lib/xalloc-die.c:34 +msgid "memory exhausted" +msgstr "minnet slut" + +#: lib/xstrtol-error.c:63 +#, c-format +msgid "invalid %s%s argument '%s'" +msgstr "felaktigt argument till %s%s: ”%s”" + +#: lib/xstrtol-error.c:68 +#, c-format +msgid "invalid suffix in %s%s argument '%s'" +msgstr "felaktigt suffix i argument till %s%s ”%s”" + +#: lib/xstrtol-error.c:72 +#, c-format +msgid "%s%s argument '%s' too large" +msgstr "argument ”%3$s” till %1$s%2$s är för stort" + +#. This is a proper name. See the gettext manual, section Names. +#: src/datamash.c:64 +msgid "Assaf Gordon" +msgstr "Assaf Gordon" + +#: src/datamash.c:151 src/datamash.c:467 +#, c-format +msgid "column name %s not found in input file" +msgstr "kolumnnamnet %s hittades inte i indatafil" + +#: src/datamash.c:164 +#, c-format +msgid "Usage: %s [OPTION] op [fld] [op fld ...]\n" +msgstr "Användning: %s [FLAGGA] åtg [flt] [åtg flt ...]\n" + +#: src/datamash.c:167 +msgid "Performs numeric/string operations on input from stdin." +msgstr "Utför numeriska åtgärder eller strängåtgärder på indata från stdin." + +#: src/datamash.c:170 +msgid "" +"'op' is the operation to perform. If a primary operation is used,\n" +"it must be listed first, optionally followed by other operations.\n" +msgstr "" +"”åtg” är åtgärden att utföra. Om en primär åtgärd används\n" +"måste den listas först, möjligen följd av andra åtgärder.\n" + +#: src/datamash.c:173 +msgid "" +"'fld' is the input field to use. 'fld' can be a number (1=first field),\n" +"or a field name when using the -H or --header-in options.\n" +msgstr "" +"”flt” är indatafältet att använda. ”flt” kan vara ett tal (1=första " +"fältet),\n" +"eller ett fältnamn då flaggorna -H eller --header-in används.\n" + +# Hyphen used in example rather than dash. +#: src/datamash.c:176 +msgid "" +"Multiple fields can be listed with a comma (e.g. 1,6,8). A range of\n" +"fields can be listed with a dash (e.g. 2-8). Use colons for operations\n" +"which require a pair of fields (e.g. 'pcov 2:6').\n" +msgstr "" +"Flera fält kan listas med ett komma (t.ex. 1,6,8). Ett intervall\n" +"av fält kan listas med ett tankstreck (t.ex. 2-8). Använd kolon för\n" +"åtgärder som kräver ett par av fält (t.ex. ”pcov 2:6”).\n" + +#: src/datamash.c:181 +msgid "Primary operations:\n" +msgstr "Primära åtgärder:\n" + +#: src/datamash.c:184 +msgid "Line-Filtering operations:\n" +msgstr "Radfiltreringsåtgärder:\n" + +#: src/datamash.c:187 +msgid "Per-Line operations:\n" +msgstr "Per rads-åtgärder:\n" + +#: src/datamash.c:191 +msgid "Numeric Grouping operations:\n" +msgstr "Numeriska grupperingsåtgärder:\n" + +#: src/datamash.c:194 +msgid "Textual/Numeric Grouping operations:\n" +msgstr "Textuella/numeriska grupperingsåtgärder:\n" + +#: src/datamash.c:198 +msgid "Statistical Grouping operations:\n" +msgstr "Statistiska grupperingsåtgärder:\n" + +#: src/datamash.c:206 +msgid "Grouping Options:\n" +msgstr "Grupperingsflaggor:\n" + +#: src/datamash.c:207 +msgid "" +" -f, --full print entire input line before op results\n" +" (default: print only the grouped keys)\n" +msgstr "" +" -f, --full skriv ut hela indataraden innan resultat av åtg\n" +" (standard: skriv ut endast de grupperade\n" +" nycklarna)\n" + +#: src/datamash.c:211 +msgid "" +" -g, --group=X[,Y,Z] group via fields X,[Y,Z];\n" +" equivalent to primary operation 'groupby'\n" +msgstr "" +" -g, --group=X[,Y,Z] gruppera via fälten X,[Y,Z];\n" +" likvärdig med den primära åtgärden ”groupby”\n" + +#: src/datamash.c:215 +msgid " --header-in first input line is column headers\n" +msgstr " --header-in första indatarad är kolumnrubriker\n" + +#: src/datamash.c:218 +msgid " --header-out print column headers as first line\n" +msgstr " --header-out skriv ut kolumnrubriker som första rad\n" + +#: src/datamash.c:221 +msgid " -H, --headers same as '--header-in --header-out'\n" +msgstr " -H, --headers samma som ”--header-in --header-out”\n" + +#: src/datamash.c:224 +msgid "" +" -i, --ignore-case ignore upper/lower case when comparing text;\n" +" this affects grouping, and string operations\n" +msgstr "" +" -i, --ignore-case ignorera skiftläge då text jämförs;\n" +" detta påverkar gruppering och strängåtgärder\n" + +#: src/datamash.c:228 +msgid "" +" -s, --sort sort the input before grouping; this removes " +"the\n" +" need to manually pipe the input through " +"'sort'\n" +msgstr "" +" -s, --sort sortera indata innan gruppering; detta tar bort\n" +" behovet av att manuellt skicka indata genom " +"”sort”\n" + +#: src/datamash.c:233 +msgid "File Operation Options:\n" +msgstr "Filåtgärdsflaggor:\n" + +#: src/datamash.c:234 +msgid " --no-strict allow lines with varying number of fields\n" +msgstr " --no-strict tillåt rader med varierande antal fält\n" + +#: src/datamash.c:237 +#, c-format +msgid " --filler=X fill missing values with X (default %s)\n" +msgstr "" +" --filler=X fyll i saknade värden med X (standard %s)\n" + +#: src/datamash.c:242 +msgid "General Options:\n" +msgstr "Allmänna flaggor:\n" + +#: src/datamash.c:243 +msgid " -t, --field-separator=X use X instead of TAB as field delimiter\n" +msgstr "" +" -t, --field-separator=X använd X istället för TAB som fältseparator\n" + +#: src/datamash.c:246 +msgid " --narm skip NA/NaN values\n" +msgstr " --narm hoppa över NA/NaN-värden\n" + +#: src/datamash.c:249 +msgid "" +" -W, --whitespace use whitespace (one or more spaces and/or tabs)\n" +" for field delimiters\n" +msgstr "" +" -W, --whitespace använd blanktecken (en eller flera mellanslag " +"eller\n" +" tabulatorer) som fältseparatorer\n" + +#: src/datamash.c:253 +msgid " -z, --zero-terminated end lines with 0 byte, not newline\n" +msgstr " -z, --zero-terminated avsluta rader med nollbyte, inte nyrad\n" + +#: src/datamash.c:262 +msgid "Examples:" +msgstr "Exempel:" + +#: src/datamash.c:264 +msgid "Print the sum and the mean of values from column 1:" +msgstr "Skriv summan och medelvärdet av värden från kolumn 1:" + +#: src/datamash.c:269 +msgid "Transpose input:" +msgstr "Transponera indata:" + +#: src/datamash.c:276 +msgid "For detailed usage information and examples, see\n" +msgstr "För utförlig användningsinformation och exempel, se\n" + +#: src/datamash.c:278 +msgid "The manual and more examples are available at\n" +msgstr "Handboken och fler exempel är tillgängliga på\n" + +#: src/datamash.c:287 +#, c-format +msgid "" +"invalid input: field % requested, line % has only " +"% fields" +msgstr "" +"ogiltigt indata: fält % begärdes, rad % har bara " +"% fält" + +#: src/datamash.c:357 +#, c-format +msgid "%s in line % field %: '%s'" +msgstr "%s i rad % fält %: ”%s”" + +#: src/datamash.c:676 +#, c-format +msgid "" +"transpose input error: line % has % fields (previous lines " +"had %);\n" +"see --help to disable strict mode" +msgstr "" +"indatafel för transpose: rad % har % fält (föregående " +"rader hade %);\n" +"se --help för att inaktivera strikt läge" + +#: src/datamash.c:733 +#, c-format +msgid "" +"reverse-field input error: line % has % fields (previous " +"lines had %);\n" +"see --help to disable strict mode" +msgstr "" +"indatafel för reverse-fält: rad % har % fält (föregående " +"rader hade %);\n" +"se --help för att inaktivera strikt läge" + +#: src/datamash.c:837 src/datamash.c:843 +#, c-format +msgid "" +"line % (% fields):\n" +" " +msgstr "" +"rad % (% fält):\n" +" " + +#: src/datamash.c:849 +#, c-format +msgid "" +"check failed: line % has % fields (previous line had " +"%)" +msgstr "" +"kontroll misslyckades: rad % har % fält (föregående rad " +"hade %)" + +#: src/datamash.c:861 +#, c-format +msgid "% line" +msgid_plural "% lines" +msgstr[0] "% rad" +msgstr[1] "% rader" + +#: src/datamash.c:864 +#, c-format +msgid "% field" +msgid_plural "% fields" +msgstr[0] "% fält" +msgstr[1] "% fält" + +#: src/datamash.c:965 +#, c-format +msgid "hash memory allocation error" +msgstr "minnesallokeringsfel för hash" + +#: src/datamash.c:1027 +#, c-format +msgid "sort command too-long (please report this bug)" +msgstr "sorteringskommando för långt (rapportera gärna detta fel)" + +#: src/datamash.c:1033 +#, c-format +msgid "failed to run 'sort': popen failed" +msgstr "misslyckades att köra ”sort”: popen misslyckades" + +#: src/datamash.c:1049 +#, c-format +msgid "read error" +msgstr "läsfel" + +#: src/datamash.c:1057 +#, c-format +msgid "read error (on close)" +msgstr "läsfel (vid stängning)" + +#: src/datamash.c:1133 +#, c-format +msgid "the delimiter must be a single character" +msgstr "avskiljaren måste vara endast ett tecken" + +#: src/datamash.c:1170 +#, c-format +msgid "missing operation specifiers" +msgstr "saknar åtgärdsbeskrivning" + +#: src/datamash.c:1184 +#, c-format +msgid "-H or --header-in must be used with named columns" +msgstr "-H eller --header-in måste användas med namngivna kolumner" + +#: src/field-ops.c:319 +#, c-format +msgid "" +"input error for operation %s: fields %,% have different " +"number of items" +msgstr "" +"indatafel för åtgärden %s: fälten %,% har olika antal " +"poster" + +#: src/field-ops.c:999 +msgid "invalid numeric value" +msgstr "ogiltigt numeriskt värde" + +#: src/field-ops.c:1001 +msgid "invalid base64 value" +msgstr "ogiltigt base64-värde" + +#: src/op-parser.c:163 src/op-parser.c:177 src/op-parser.c:184 +#, c-format +msgid "too many parameters for operation %s" +msgstr "för många parametrar för åtgärden %s" + +#: src/op-parser.c:174 +#, c-format +msgid "strbin bucket size must not be zero" +msgstr "strbin-hinkstorlek får inte vara noll" + +#: src/op-parser.c:205 src/op-parser.c:216 src/op-parser.c:472 +#, c-format +msgid "missing field for operation %s" +msgstr "saknar fält för åtgärden %s" + +#: src/op-parser.c:211 src/op-parser.c:220 src/op-parser.c:275 +#: src/op-parser.c:508 +#, c-format +msgid "invalid field range for operation %s" +msgstr "ogiltigt fältintervall för åtgärden %s" + +#: src/op-parser.c:214 src/op-parser.c:224 src/op-parser.c:511 +#, c-format +msgid "invalid field pair for operation %s" +msgstr "ogiltigt par av fält för åtgärden %s" + +#: src/op-parser.c:238 src/op-parser.c:486 +#, c-format +msgid "invalid field '%s' for operation %s" +msgstr "ogiltigt fält ”%s” för åtgärden %s" + +#: src/op-parser.c:272 +#, c-format +msgid "field range for %s must be numeric" +msgstr "fältintervall för %s måste vara numeriskt" + +#: src/op-parser.c:332 +#, c-format +msgid "missing parameter for operation %s" +msgstr "saknar parameter för åtgärden %s" + +#: src/op-parser.c:340 +#, c-format +msgid "invalid parameter %s for operation %s" +msgstr "ogiltig parameter %s för åtgärden %s" + +#: src/op-parser.c:372 +#, c-format +msgid "operation %s requires field pairs" +msgstr "åtgärden %s kräver par av fält" + +#: src/op-parser.c:375 +#, c-format +msgid "operation %s cannot use pair of fields" +msgstr "åtgärden %s kan inte använda par av fält" + +#: src/op-parser.c:415 +#, c-format +msgid "conflicting operation %s" +msgstr "motstridig åtgärd %s" + +#: src/op-parser.c:418 src/op-parser.c:597 +#, c-format +msgid "invalid operation %s" +msgstr "ogiltig åtgärd %s" + +#: src/op-parser.c:423 +#, c-format +msgid "" +"conflicting operation found: expecting %s operations, but found %s operation " +"%s" +msgstr "" +"motstridig åtgärd funnen: förväntar %s-åtgärder, men fann %s-åtgärden %s" + +#: src/op-parser.c:537 +#, c-format +msgid "crosstab requires exactly 2 fields, found %" +msgstr "crosstab kräver exakt 2 fält, hittade %" + +#: src/op-parser.c:550 +#, c-format +msgid "crosstab supports one operation, found %" +msgstr "crosstab stöder en åtgärd, hittade %" + +#: src/op-parser.c:559 +#, c-format +msgid "missing operation" +msgstr "saknar åtgärd" + +#: src/op-parser.c:573 +#, c-format +msgid "extra operand %s" +msgstr "extra operand %s" + +#: src/op-parser.c:710 src/op-scanner.c:210 +#, c-format +msgid "missing script (among arguments)" +msgstr "saknar skript (bland argument)" + +#: src/op-scanner.c:167 +#, c-format +msgid "invalid numeric value '%s'" +msgstr "ogiltigt numeriskt värde ”%s”" + +#: src/op-scanner.c:188 +#, c-format +msgid "invalid operand %s" +msgstr "ogiltig operand %s" + +#: src/op-scanner.c:244 +#, c-format +msgid "unknown token %d\n" +msgstr "okänd symbol %d\n" + +#: src/system.h:133 +msgid " --help display this help and exit\n" +msgstr " --help visa denna hjälptext och avsluta\n" + +#: src/system.h:135 +msgid " --version output version information and exit\n" +msgstr " --version visa versionsinformation och avsluta\n" + +#: src/system.h:140 +#, c-format +msgid "Try '%s --help' for more information.\n" +msgstr "Försök med ”%s --help” för mer information.\n" + +#~ msgid "'op' is the operation to perform;\n" +#~ msgstr "”åtg” är åtgärden att utföra;\n" + +#~ msgid "File operations:\n" +#~ msgstr "Filåtgärder:\n" + +#~ msgid "Options:\n" +#~ msgstr "Flaggor:\n" + +#~ msgid " -g, --group=X[,Y,Z] group via fields X,[Y,Z]\n" +#~ msgstr " -g, --group=X[,Y,Z] gruppera efter fälten X,[Y,Z]\n" + +#~ msgid "invalid empty grouping parameter" +#~ msgstr "ogiltig tom grupperingsparameter" + +#~ msgid "invalid grouping parameter %s" +#~ msgstr "ogiltig grupperingsparameter %s" Binary files /tmp/tmp4U70c2/7esjCa0Q6b/datamash-1.0.7/po/uk.gmo and /tmp/tmp4U70c2/Lx1O0FDBbS/datamash-1.1.1/po/uk.gmo differ diff -Nru datamash-1.0.7/po/uk.po datamash-1.1.1/po/uk.po --- datamash-1.0.7/po/uk.po 2015-06-17 23:45:11.000000000 +0000 +++ datamash-1.1.1/po/uk.po 2017-01-19 18:51:35.000000000 +0000 @@ -2,20 +2,22 @@ # Copyright (C) 2014 Free Software Foundation, Inc. # This file is distributed under the same license as the datamash package. # -# Yuri Chornoivan , 2014, 2015. +# Yuri Chornoivan , 2014, 2015, 2016. msgid "" msgstr "" -"Project-Id-Version: GNU datamash 1.0.6.54\n" +"Project-Id-Version: GNU datamash 1.0.7.58\n" "Report-Msgid-Bugs-To: bug-datamash@gnu.org\n" -"POT-Creation-Date: 2015-05-28 14:22-0400\n" -"PO-Revision-Date: 2015-06-05 12:15+0300\n" +"POT-Creation-Date: 2017-01-19 13:51-0500\n" +"PO-Revision-Date: 2016-01-01 17:55+0200\n" "Last-Translator: Yuri Chornoivan \n" "Language-Team: Ukrainian \n" "Language: uk\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=4; plural=n==1 ? 3 : n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=4; plural=n==1 ? 3 : n%10==1 && n%100!=11 ? 0 : n" +"%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" "X-Generator: Lokalize 1.5\n" #: lib/closeout.c:112 @@ -107,11 +109,11 @@ #. If you don't know what to put here, please see #. #. and use glyphs suitable for your language. -#: lib/quotearg.c:312 +#: lib/quotearg.c:354 msgid "`" msgstr "«" -#: lib/quotearg.c:313 +#: lib/quotearg.c:355 msgid "'" msgstr "»" @@ -135,15 +137,19 @@ #: lib/version-etc.c:86 msgid "" "\n" -"License GPLv3+: GNU GPL version 3 or later .\n" +"License GPLv3+: GNU GPL version 3 or later .\n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" "\n" msgstr "" "\n" -"Умови ліцензування викладено у GPLv3+: GNU GPL версії 3 або новішій, \n" -"Це вільне програмне забезпечення: ви можете вільно змінювати і поширювати його.\n" -"Вам не надається ЖОДНИХ ГАРАНТІЙ, окрім гарантій передбачених законодавством.\n" +"Умови ліцензування викладено у GPLv3+: GNU GPL версії 3 або новішій, \n" +"Це вільне програмне забезпечення: ви можете вільно змінювати і поширювати " +"його.\n" +"Вам не надається ЖОДНИХ ГАРАНТІЙ, окрім гарантій передбачених " +"законодавством.\n" #. TRANSLATORS: %s denotes an author name. #: lib/version-etc.c:102 @@ -283,7 +289,9 @@ #: lib/version-etc.c:256 msgid "General help using GNU software: \n" -msgstr "Загальна довідка щодо користування програмним забезпеченням GNU: \n" +msgstr "" +"Загальна довідка щодо користування програмним забезпеченням GNU: \n" #: lib/xalloc-die.c:34 msgid "memory exhausted" @@ -305,71 +313,81 @@ msgstr "%s%s, аргумент «%s» є занадто об'ємним" #. This is a proper name. See the gettext manual, section Names. -#: src/datamash.c:61 +#: src/datamash.c:64 msgid "Assaf Gordon" msgstr "Assaf Gordon" -#: src/datamash.c:161 src/field-ops.c:388 +#: src/datamash.c:151 src/datamash.c:467 #, c-format msgid "column name %s not found in input file" msgstr "у файлі вхідних даних не знайдено стовпчика із назвою %s" -#: src/datamash.c:174 +#: src/datamash.c:164 #, c-format -msgid "Usage: %s [OPTION] op [col] [op col ...]\n" -msgstr "Користування: %s [ПАРАМЕТР] дія [стовпчик] [дія стовпчик ...]\n" +msgid "Usage: %s [OPTION] op [fld] [op fld ...]\n" +msgstr "Користування: %s [ПАРАМЕТР] операція [поле] [операція поле ...]\n" -#: src/datamash.c:177 +#: src/datamash.c:167 msgid "Performs numeric/string operations on input from stdin." msgstr "Виконує числові дії або дії з рядками над вхідними даними зі stdin." -#: src/datamash.c:180 -msgid "'op' is the operation to perform;\n" -msgstr "«дія» - дія, яку слід виконати;\n" +#: src/datamash.c:170 +msgid "" +"'op' is the operation to perform. If a primary operation is used,\n" +"it must be listed first, optionally followed by other operations.\n" +msgstr "" +"«операція» — операція, яку слід виконати. Якщо використано основну " +"операцію,\n" +"вона має бути у списку першою, за нею може бути вказано інші операції.\n" -#: src/datamash.c:181 +#: src/datamash.c:173 msgid "" -"For grouping,per-line operations 'col' is the input field to use;\n" -"'col' can be a number (1=first field), or a column name when using\n" -"-H or --header-in options.\n" -msgstr "" -"Для дій grouping,per-line «col» є полем вхідних даних, яким слід скористатися;\n" -"«col» може бути числом (1=перше поле) або назвою стовпчика, якщо використано\n" -"параметр -H або --header-in.\n" +"'fld' is the input field to use. 'fld' can be a number (1=first field),\n" +"or a field name when using the -H or --header-in options.\n" +msgstr "" +"«поле» — поле вхідних даних, яке слід використати. Значенням «поля» може\n" +"бути число (1=перше поле) або назва поля, якщо використовуються параметри\n" +"-H або --header-in.\n" -#: src/datamash.c:187 -msgid "File operations:\n" -msgstr "Дії над файлами:\n" +#: src/datamash.c:176 +msgid "" +"Multiple fields can be listed with a comma (e.g. 1,6,8). A range of\n" +"fields can be listed with a dash (e.g. 2-8). Use colons for operations\n" +"which require a pair of fields (e.g. 'pcov 2:6').\n" +msgstr "" +"Декілька полів можна вказати, відокремивши записи комами (наприклад 1,6,8).\n" +"Діапазон полів можна вказати за допомогою дефіса (наприклад 2-8).\n" +"Пари полів слід вказувати за допомогою двокрапки (наприклад «pcov 2:6»).\n" -#: src/datamash.c:190 +#: src/datamash.c:181 +msgid "Primary operations:\n" +msgstr "Основні операції:\n" + +#: src/datamash.c:184 msgid "Line-Filtering operations:\n" msgstr "Дії з фільтрування рядків:\n" -#: src/datamash.c:193 +#: src/datamash.c:187 msgid "Per-Line operations:\n" msgstr "Дії над окремими рядками:\n" -#: src/datamash.c:196 +#: src/datamash.c:191 msgid "Numeric Grouping operations:\n" msgstr "Дії з числового групування:\n" -#: src/datamash.c:199 +#: src/datamash.c:194 msgid "Textual/Numeric Grouping operations:\n" msgstr "Дії з текстового або числового групування:\n" -#: src/datamash.c:203 +#: src/datamash.c:198 msgid "Statistical Grouping operations:\n" msgstr "Дії зі статистичного групування:\n" -#: src/datamash.c:210 -msgid "Options:\n" -msgstr "Параметри:\n" - -#: src/datamash.c:211 +#: src/datamash.c:206 msgid "Grouping Options:\n" msgstr "Дії з групування:\n" -#: src/datamash.c:212 +#: src/datamash.c:207 msgid "" " -f, --full print entire input line before op results\n" " (default: print only the grouped keys)\n" @@ -377,229 +395,403 @@ " -f, --full вивести рядок вхідних даних до результатів дії\n" " (типове: вивести лише згруповані дані)\n" -#: src/datamash.c:216 -msgid " -g, --group=X[,Y,Z] group via fields X,[Y,Z]\n" -msgstr " -g, --group=X[,Y,Z] групувати за полями X,[Y,Z]\n" +#: src/datamash.c:211 +msgid "" +" -g, --group=X[,Y,Z] group via fields X,[Y,Z];\n" +" equivalent to primary operation 'groupby'\n" +msgstr "" +" -g, --group=X[,Y,Z] групувати за полями X,[Y,Z];\n" +" рівнозначне основній операції «groupby»\n" -#: src/datamash.c:219 +#: src/datamash.c:215 msgid " --header-in first input line is column headers\n" -msgstr " --header-in перший рядок вхідних даних є рядком заголовків стовпчиків\n" +msgstr "" +" --header-in перший рядок вхідних даних є рядком заголовків " +"стовпчиків\n" -#: src/datamash.c:222 +#: src/datamash.c:218 msgid " --header-out print column headers as first line\n" -msgstr " --header-out вивести заголовки стовпчиків у першому рядку\n" +msgstr "" +" --header-out вивести заголовки стовпчиків у першому рядку\n" -#: src/datamash.c:225 +#: src/datamash.c:221 msgid " -H, --headers same as '--header-in --header-out'\n" msgstr " -H, --headers те саме, що і --header-in --header-out\n" -#: src/datamash.c:228 +#: src/datamash.c:224 msgid "" " -i, --ignore-case ignore upper/lower case when comparing text;\n" " this affects grouping, and string operations\n" msgstr "" -" -i, --ignore-case ігнорувати регістр під час порівняння текстових рядків;\n" -" це стосується дій з групування та дій над рядками\n" +" -i, --ignore-case ігнорувати регістр під час порівняння текстових " +"рядків;\n" +" це стосується дій з групування та дій над " +"рядками\n" -#: src/datamash.c:232 +#: src/datamash.c:228 msgid "" -" -s, --sort sort the input before grouping; this removes the\n" -" need to manually pipe the input through 'sort'\n" -msgstr "" -" -s, --sort упорядкувати вхідні дані перед групуванням; усуває\n" -" потребу у попередній обробці вхідних даних програмою sort\n" +" -s, --sort sort the input before grouping; this removes " +"the\n" +" need to manually pipe the input through " +"'sort'\n" +msgstr "" +" -s, --sort упорядкувати вхідні дані перед групуванням; " +"усуває\n" +" потребу у попередній обробці вхідних даних " +"програмою sort\n" -#: src/datamash.c:237 +#: src/datamash.c:233 msgid "File Operation Options:\n" msgstr "Параметри дій над файлами:\n" -#: src/datamash.c:238 +#: src/datamash.c:234 msgid " --no-strict allow lines with varying number of fields\n" -msgstr " --no-strict дозволяти рядки зі змінною кількістю полів\n" +msgstr "" +" --no-strict дозволяти рядки зі змінною кількістю полів\n" -#: src/datamash.c:241 +#: src/datamash.c:237 #, c-format msgid " --filler=X fill missing values with X (default %s)\n" -msgstr " --filler=X заповнити пропущені значення рядком X (типово %s)\n" +msgstr "" +" --filler=X заповнити пропущені значення рядком X (типово " +"%s)\n" -#: src/datamash.c:246 +#: src/datamash.c:242 msgid "General Options:\n" msgstr "Загальні параметри:\n" -#: src/datamash.c:247 +#: src/datamash.c:243 msgid " -t, --field-separator=X use X instead of TAB as field delimiter\n" -msgstr " -t, --field-separator=X використовувати роздільник полів X замість TAB\n" +msgstr "" +" -t, --field-separator=X використовувати роздільник полів X замість TAB\n" -#: src/datamash.c:250 +#: src/datamash.c:246 msgid " --narm skip NA/NaN values\n" msgstr " --narm пропускати значення NA/NaN\n" -#: src/datamash.c:253 +#: src/datamash.c:249 msgid "" " -W, --whitespace use whitespace (one or more spaces and/or tabs)\n" " for field delimiters\n" msgstr "" -" -W, --whitespace використовувати проміжок (один або декілька пробілів чи\n" +" -W, --whitespace використовувати проміжок (один або декілька " +"пробілів чи\n" " символів табуляцій) як роздільник полів\n" -#: src/datamash.c:257 +#: src/datamash.c:253 msgid " -z, --zero-terminated end lines with 0 byte, not newline\n" -msgstr " -z, --zero-terminated завершувати рядки нульовим байтом, а не символом нового рядка\n" +msgstr "" +" -z, --zero-terminated завершувати рядки нульовим байтом, а не символом " +"нового рядка\n" -#: src/datamash.c:266 +#: src/datamash.c:262 msgid "Examples:" msgstr "Приклади:" -#: src/datamash.c:268 +#: src/datamash.c:264 msgid "Print the sum and the mean of values from column 1:" msgstr "Вивести суму та середнє значення значень, починаючи зі стовпчика 1:" -#: src/datamash.c:273 +#: src/datamash.c:269 msgid "Transpose input:" msgstr "Транспонування вхідних даних:" -#: src/datamash.c:280 +#: src/datamash.c:276 msgid "For detailed usage information and examples, see\n" -msgstr "Щоб дізнатися більше про користування програмою та ознайомитися з прикладами, див.\n" +msgstr "" +"Щоб дізнатися більше про користування програмою та ознайомитися з " +"прикладами, див.\n" -#: src/datamash.c:282 +#: src/datamash.c:278 msgid "The manual and more examples are available at\n" msgstr "Підручник і додаткові приклади можна знайти на цій сторінці:\n" -#: src/datamash.c:291 +#: src/datamash.c:287 #, c-format -msgid "invalid input: field % requested, line % has only % fields" -msgstr "некоректні вхідні дані: потрібне поле %, але у рядку % лише % полів" +msgid "" +"invalid input: field % requested, line % has only " +"% fields" +msgstr "" +"некоректні вхідні дані: потрібне поле %, але у рядку % " +"лише % полів" -#: src/datamash.c:349 +#: src/datamash.c:357 #, c-format msgid "%s in line % field %: '%s'" msgstr "%s у рядку %, поле %: «%s»" -#: src/datamash.c:487 src/datamash.c:784 -#, c-format -msgid "-H or --header-in must be used with named columns" -msgstr "якщо стовпчики мають назви, слід використовувати -H або --header-in" - -#: src/datamash.c:588 +#: src/datamash.c:676 #, c-format msgid "" -"transpose input error: line % has % fields (previous lines had %);\n" +"transpose input error: line % has % fields (previous lines " +"had %);\n" "see --help to disable strict mode" msgstr "" -"помилка під час транспонування вхідних даних: у рядку % є % полів (у попередніх рядках було %);\n" +"помилка під час транспонування вхідних даних: у рядку % є " +"% полів (у попередніх рядках було %);\n" "див. --help, щоб дізнатися про те, як вимкнути строгий режим." -#: src/datamash.c:644 +#: src/datamash.c:733 #, c-format msgid "" -"reverse-field input error: line % has % fields (previous lines had %);\n" +"reverse-field input error: line % has % fields (previous " +"lines had %);\n" "see --help to disable strict mode" msgstr "" -"помилка обробки полів вхідних даних у зворотному порядку: у рядку % є % полів (у попередніх рядках було %);\n" +"помилка обробки полів вхідних даних у зворотному порядку: у рядку % " +"є % полів (у попередніх рядках було %);\n" "див. --help, щоб дізнатися про те, як вимкнути строгий режим." -#: src/datamash.c:820 +#: src/datamash.c:837 src/datamash.c:843 +#, c-format +msgid "" +"line % (% fields):\n" +" " +msgstr "" +"рядок % (% полів):\n" +" " + +#: src/datamash.c:849 +#, c-format +msgid "" +"check failed: line % has % fields (previous line had " +"%)" +msgstr "" +"перевірку не пройдено: у рядку % маємо % полів (у " +"попередньому рядку було %)" + +#: src/datamash.c:861 +#, c-format +msgid "% line" +msgid_plural "% lines" +msgstr[0] "% рядок" +msgstr[1] "% рядки" +msgstr[2] "% рядків" +msgstr[3] "% рядок" + +#: src/datamash.c:864 +#, c-format +msgid "% field" +msgid_plural "% fields" +msgstr[0] "% поле" +msgstr[1] "% поля" +msgstr[2] "% полів" +msgstr[3] "% поле" + +#: src/datamash.c:965 #, c-format msgid "hash memory allocation error" msgstr "помилка під час спроби отримання області пам’яті для хеш-сум" -#: src/datamash.c:882 +#: src/datamash.c:1027 #, c-format msgid "sort command too-long (please report this bug)" -msgstr "упорядковування за допомогою команди sort виконується надто довго (повідомте розробників про ваду)" +msgstr "" +"упорядковування за допомогою команди sort виконується надто довго (повідомте " +"розробників про ваду)" -#: src/datamash.c:888 +#: src/datamash.c:1033 #, c-format msgid "failed to run 'sort': popen failed" msgstr "не вдалося виконати «sort»: помилка popen" -#: src/datamash.c:904 +#: src/datamash.c:1049 #, c-format msgid "read error" msgstr "помилка під час читання" -#: src/datamash.c:912 +#: src/datamash.c:1057 #, c-format msgid "read error (on close)" msgstr "помилка під час читання (під час закриття)" -#: src/datamash.c:939 -#, c-format -msgid "invalid empty grouping parameter" -msgstr "некоректний порожній параметр групування" - -#: src/datamash.c:946 -#, c-format -msgid "invalid grouping parameter %s" -msgstr "некоректний параметр групування %s" - -#: src/datamash.c:1031 +#: src/datamash.c:1133 #, c-format msgid "the delimiter must be a single character" msgstr "розділювач повинен бути одним символом" -#: src/datamash.c:1067 +#: src/datamash.c:1170 #, c-format msgid "missing operation specifiers" msgstr "не вказано специфікаторів дій" -#: src/field-ops.c:293 +#: src/datamash.c:1184 +#, c-format +msgid "-H or --header-in must be used with named columns" +msgstr "якщо стовпчики мають назви, слід використовувати -H або --header-in" + +#: src/field-ops.c:319 #, c-format -msgid "invalid empty column for operation %s" -msgstr "некоректний порожній стовпчик для дії %s" +msgid "" +"input error for operation %s: fields %,% have different " +"number of items" +msgstr "" +"помилка у вхідних даних для операції %s: у полях %,% різна " +"кількість записів" -#: src/field-ops.c:306 +#: src/field-ops.c:999 +msgid "invalid numeric value" +msgstr "некоректне числове значення" + +#: src/field-ops.c:1001 +msgid "invalid base64 value" +msgstr "некоректне значення base64" + +#: src/op-parser.c:163 src/op-parser.c:177 src/op-parser.c:184 #, c-format -msgid "invalid column '%s' for operation %s" -msgstr "некоректний стовпчик, «%s», для дії %s" +msgid "too many parameters for operation %s" +msgstr "забагато параметрів для операції %s" -#: src/field-ops.c:985 +#: src/op-parser.c:174 #, c-format -msgid "invalid operation '%s'" -msgstr "некоректна дія, «%s»" +msgid "strbin bucket size must not be zero" +msgstr "розмір сегмента strbin має бути ненульовим" -#: src/field-ops.c:1001 +#: src/op-parser.c:205 src/op-parser.c:216 src/op-parser.c:472 #, c-format -msgid "conflicting operation found: expecting %s operations, but found %s operation %s" -msgstr "виявлено конфлікт операцій: мало бути %s операцій, але виявлено операцію %s %s" +msgid "missing field for operation %s" +msgstr "пропущено поле для операції %s" -#: src/field-ops.c:1009 +#: src/op-parser.c:211 src/op-parser.c:220 src/op-parser.c:275 +#: src/op-parser.c:508 #, c-format -msgid "missing field number after operation '%s'" -msgstr "після запису дії «%s» не вказано номера поля" +msgid "invalid field range for operation %s" +msgstr "некоректний діапазон полів для операції %s" -#: src/field-ops.c:1029 +#: src/op-parser.c:214 src/op-parser.c:224 src/op-parser.c:511 #, c-format -msgid "extra operands after '%s'" -msgstr "зайвий операнд після «%s»" +msgid "invalid field pair for operation %s" +msgstr "некоректна пара полів для операції %s" -#: src/field-ops.c:1094 -msgid "invalid numeric value" -msgstr "некоректне числове значення" +#: src/op-parser.c:238 src/op-parser.c:486 +#, c-format +msgid "invalid field '%s' for operation %s" +msgstr "некоректне поле, «%s», для операції %s" -#: src/field-ops.c:1096 -msgid "invalid base64 value" -msgstr "некоректне значення base64" +#: src/op-parser.c:272 +#, c-format +msgid "field range for %s must be numeric" +msgstr "діапазон полів для %s має бути числовим" + +#: src/op-parser.c:332 +#, c-format +msgid "missing parameter for operation %s" +msgstr "пропущено параметр для операції %s" + +#: src/op-parser.c:340 +#, c-format +msgid "invalid parameter %s for operation %s" +msgstr "некоректний параметр %s для операції %s" -#: src/system.h:101 +#: src/op-parser.c:372 +#, c-format +msgid "operation %s requires field pairs" +msgstr "для виконання операції %s слід вказати пари полів" + +#: src/op-parser.c:375 +#, c-format +msgid "operation %s cannot use pair of fields" +msgstr "у операції %s не можна використовувати пару полів" + +#: src/op-parser.c:415 +#, c-format +msgid "conflicting operation %s" +msgstr "конфлікт операції %s" + +#: src/op-parser.c:418 src/op-parser.c:597 +#, c-format +msgid "invalid operation %s" +msgstr "некоректна операція, %s" + +#: src/op-parser.c:423 +#, c-format +msgid "" +"conflicting operation found: expecting %s operations, but found %s operation " +"%s" +msgstr "" +"виявлено конфлікт операцій: мало бути %s операцій, але виявлено операцію %s " +"%s" + +#: src/op-parser.c:537 +#, c-format +msgid "crosstab requires exactly 2 fields, found %" +msgstr "для crosstab слід вказати точно 2 поля, вказано ж %" + +#: src/op-parser.c:550 +#, c-format +msgid "crosstab supports one operation, found %" +msgstr "" +"у crosstab передбачено підтримку лише однієї операції, вказано ж %" + +#: src/op-parser.c:559 +#, c-format +msgid "missing operation" +msgstr "пропущено операцію" + +#: src/op-parser.c:573 +#, c-format +msgid "extra operand %s" +msgstr "зайвий операнд %s" + +#: src/op-parser.c:710 src/op-scanner.c:210 +#, c-format +msgid "missing script (among arguments)" +msgstr "не вказано скрипт (серед аргументів)" + +#: src/op-scanner.c:167 +#, c-format +msgid "invalid numeric value '%s'" +msgstr "некоректне числове значення, «%s»" + +#: src/op-scanner.c:188 +#, c-format +msgid "invalid operand %s" +msgstr "некоректний операнд %s" + +#: src/op-scanner.c:244 +#, c-format +msgid "unknown token %d\n" +msgstr "невідомий ключ %d\n" + +#: src/system.h:133 msgid " --help display this help and exit\n" msgstr " --help показати цю довідку і вийти\n" -#: src/system.h:103 +#: src/system.h:135 msgid " --version output version information and exit\n" msgstr " --version показати інформацію щодо версії і вийти\n" -#: src/system.h:108 +#: src/system.h:140 #, c-format msgid "Try '%s --help' for more information.\n" msgstr "Віддайте команду «%s --help», щоб дізнатися більше.\n" +#~ msgid "'op' is the operation to perform;\n" +#~ msgstr "«дія» - дія, яку слід виконати;\n" + +#~ msgid "File operations:\n" +#~ msgstr "Дії над файлами:\n" + +#~ msgid "Options:\n" +#~ msgstr "Параметри:\n" + +#~ msgid " -g, --group=X[,Y,Z] group via fields X,[Y,Z]\n" +#~ msgstr " -g, --group=X[,Y,Z] групувати за полями X,[Y,Z]\n" + +#~ msgid "invalid empty grouping parameter" +#~ msgstr "некоректний порожній параметр групування" + +#~ msgid "invalid grouping parameter %s" +#~ msgstr "некоректний параметр групування %s" + #~ msgid "For grouping operations 'col' is the input field to use." -#~ msgstr "Для дій з групування «стовпчик» є полем вхідних даних, яке слід використати." +#~ msgstr "" +#~ "Для дій з групування «стовпчик» є полем вхідних даних, яке слід " +#~ "використати." #~ msgid " --debug print helpful debugging information\n" -#~ msgstr " --debug вивести корисну діагностичну інформацію\n" +#~ msgstr "" +#~ " --debug вивести корисну діагностичну інформацію\n" #~ msgid "invalid numeric input in line %zu field %zu: '%s'" #~ msgstr "некоректні вхідні числові дані у рядку %zu, поле %zu: «%s»" Binary files /tmp/tmp4U70c2/7esjCa0Q6b/datamash-1.0.7/po/vi.gmo and /tmp/tmp4U70c2/Lx1O0FDBbS/datamash-1.1.1/po/vi.gmo differ diff -Nru datamash-1.0.7/po/vi.po datamash-1.1.1/po/vi.po --- datamash-1.0.7/po/vi.po 2015-06-17 23:45:11.000000000 +0000 +++ datamash-1.1.1/po/vi.po 2017-01-19 18:51:35.000000000 +0000 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: datamash 1.0.6.54\n" "Report-Msgid-Bugs-To: bug-datamash@gnu.org\n" -"POT-Creation-Date: 2015-05-28 14:22-0400\n" +"POT-Creation-Date: 2017-01-19 13:51-0500\n" "PO-Revision-Date: 2015-06-06 15:26+0700\n" "Last-Translator: Trần Ngọc Quân \n" "Language-Team: Vietnamese \n" @@ -16,6 +16,7 @@ "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Gtranslator 2.91.7\n" @@ -108,11 +109,11 @@ #. If you don't know what to put here, please see #. #. and use glyphs suitable for your language. -#: lib/quotearg.c:312 +#: lib/quotearg.c:354 msgid "`" msgstr "“" -#: lib/quotearg.c:313 +#: lib/quotearg.c:355 msgid "'" msgstr "”" @@ -136,7 +137,8 @@ #: lib/version-etc.c:86 msgid "" "\n" -"License GPLv3+: GNU GPL version 3 or later .\n" +"License GPLv3+: GNU GPL version 3 or later .\n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" "\n" @@ -287,7 +289,8 @@ #: lib/version-etc.c:256 msgid "General help using GNU software: \n" -msgstr "Trợ giúp chung về sử dụng phần mềm GNU: \n" +msgstr "" +"Trợ giúp chung về sử dụng phần mềm GNU: \n" #: lib/xalloc-die.c:34 msgid "memory exhausted" @@ -309,71 +312,78 @@ msgstr "%s%s đối số “%s” quá lớn" #. This is a proper name. See the gettext manual, section Names. -#: src/datamash.c:61 +#: src/datamash.c:64 msgid "Assaf Gordon" msgstr "Assaf Gordon" -#: src/datamash.c:161 src/field-ops.c:388 +#: src/datamash.c:151 src/datamash.c:467 #, c-format msgid "column name %s not found in input file" msgstr "không tìm thấy cột tên %s trong tập tin đầu vào" -#: src/datamash.c:174 -#, c-format -msgid "Usage: %s [OPTION] op [col] [op col ...]\n" +#: src/datamash.c:164 +#, fuzzy, c-format +msgid "Usage: %s [OPTION] op [fld] [op fld ...]\n" msgstr "Cách dùng: %s [TÙY-CHỌN] op [cột] [op cột …]\n" -#: src/datamash.c:177 +#: src/datamash.c:167 msgid "Performs numeric/string operations on input from stdin." -msgstr "Thực hiện các thao tác với số/chuỗi trên đầu vào từ đầu vào tiêu chuẩn." +msgstr "" +"Thực hiện các thao tác với số/chuỗi trên đầu vào từ đầu vào tiêu chuẩn." -#: src/datamash.c:180 -msgid "'op' is the operation to perform;\n" -msgstr "“op” là thao tác cần thực hiện;\n" +#: src/datamash.c:170 +msgid "" +"'op' is the operation to perform. If a primary operation is used,\n" +"it must be listed first, optionally followed by other operations.\n" +msgstr "" -#: src/datamash.c:181 +#: src/datamash.c:173 +#, fuzzy msgid "" -"For grouping,per-line operations 'col' is the input field to use;\n" -"'col' can be a number (1=first field), or a column name when using\n" -"-H or --header-in options.\n" +"'fld' is the input field to use. 'fld' can be a number (1=first field),\n" +"or a field name when using the -H or --header-in options.\n" msgstr "" "Để nhóm,thao tác mỗi-dòng “cột” là các trường đầu vào muốn dùng;\n" "“cột” có thể là số (1=cột đầu tiên), hoặc tên cột khi sử dụng\n" "tùy chọn -H hoặc --header-in.\n" -#: src/datamash.c:187 -msgid "File operations:\n" -msgstr "Thao tác tập tin:\n" +#: src/datamash.c:176 +msgid "" +"Multiple fields can be listed with a comma (e.g. 1,6,8). A range of\n" +"fields can be listed with a dash (e.g. 2-8). Use colons for operations\n" +"which require a pair of fields (e.g. 'pcov 2:6').\n" +msgstr "" -#: src/datamash.c:190 +#: src/datamash.c:181 +#, fuzzy +msgid "Primary operations:\n" +msgstr "Thao tác trên-dòng:\n" + +#: src/datamash.c:184 msgid "Line-Filtering operations:\n" msgstr "Thao tác lọc-dòng:\n" -#: src/datamash.c:193 +#: src/datamash.c:187 msgid "Per-Line operations:\n" msgstr "Thao tác trên-dòng:\n" -#: src/datamash.c:196 +#: src/datamash.c:191 msgid "Numeric Grouping operations:\n" msgstr "Các thao tác nhóm số:\n" -#: src/datamash.c:199 +#: src/datamash.c:194 msgid "Textual/Numeric Grouping operations:\n" msgstr "Thao tác nhóm Số/Chữ:\n" -#: src/datamash.c:203 +#: src/datamash.c:198 msgid "Statistical Grouping operations:\n" msgstr "Thao tác nhóm thống kê:\n" -#: src/datamash.c:210 -msgid "Options:\n" -msgstr "Tùy chọn:\n" - -#: src/datamash.c:211 +#: src/datamash.c:206 msgid "Grouping Options:\n" msgstr "Tùy chọn nhóm:\n" -#: src/datamash.c:212 +#: src/datamash.c:207 msgid "" " -f, --full print entire input line before op results\n" " (default: print only the grouped keys)\n" @@ -381,25 +391,27 @@ " -f, --full in toàn bộ dòng đầu vào trước kết quả thao tác\n" " (mặc định: chỉ in các khóa được nhóm)\n" -#: src/datamash.c:216 -msgid " -g, --group=X[,Y,Z] group via fields X,[Y,Z]\n" -msgstr " -g, --group=X[,Y,Z] nhóm thông qua các trường X,[Y,Z]\n" +#: src/datamash.c:211 +msgid "" +" -g, --group=X[,Y,Z] group via fields X,[Y,Z];\n" +" equivalent to primary operation 'groupby'\n" +msgstr "" -#: src/datamash.c:219 +#: src/datamash.c:215 msgid " --header-in first input line is column headers\n" msgstr " --header-in dòng đầu vào đầu tiên là đầu cột\n" -#: src/datamash.c:222 +#: src/datamash.c:218 msgid " --header-out print column headers as first line\n" msgstr " --header-out in đầu cột cho dòng đầu tiên\n" -#: src/datamash.c:225 +#: src/datamash.c:221 msgid " -H, --headers same as '--header-in --header-out'\n" msgstr " -H, --headers giống với “--header-in --header-out”\n" # Ghi chú: # Thêm nút -#: src/datamash.c:228 +#: src/datamash.c:224 msgid "" " -i, --ignore-case ignore upper/lower case when comparing text;\n" " this affects grouping, and string operations\n" @@ -407,40 +419,47 @@ " -i, --ignore-case không phân biệt HOA/thường khi so sánh chữ;\n" " nó ảnh hưởng đến thao tác nhóm và chuỗi\n" -#: src/datamash.c:232 +#: src/datamash.c:228 msgid "" -" -s, --sort sort the input before grouping; this removes the\n" -" need to manually pipe the input through 'sort'\n" -msgstr "" -" -s, --sort sắp xếp đầu vào trước khi nhóm; lệnh này di chuyển đầu vào\n" -" cần đến đường ống một cách thủ công thông qua lệnh “sort”\n" +" -s, --sort sort the input before grouping; this removes " +"the\n" +" need to manually pipe the input through " +"'sort'\n" +msgstr "" +" -s, --sort sắp xếp đầu vào trước khi nhóm; lệnh này di " +"chuyển đầu vào\n" +" cần đến đường ống một cách thủ công thông qua " +"lệnh “sort”\n" -#: src/datamash.c:237 +#: src/datamash.c:233 msgid "File Operation Options:\n" msgstr "Tùy chọn thao tác tập tin:\n" -#: src/datamash.c:238 +#: src/datamash.c:234 msgid " --no-strict allow lines with varying number of fields\n" -msgstr " --no-strict cho phép các dòng với số lượng trường biến đổi\n" +msgstr "" +" --no-strict cho phép các dòng với số lượng trường biến đổi\n" -#: src/datamash.c:241 +#: src/datamash.c:237 #, c-format msgid " --filler=X fill missing values with X (default %s)\n" -msgstr " --filler=X điền đầy giá trị thiếu bằng X (mặc định %s)\n" +msgstr "" +" --filler=X điền đầy giá trị thiếu bằng X (mặc định %s)\n" -#: src/datamash.c:246 +#: src/datamash.c:242 msgid "General Options:\n" msgstr "Tùy chọn chung:\n" -#: src/datamash.c:247 +#: src/datamash.c:243 msgid " -t, --field-separator=X use X instead of TAB as field delimiter\n" -msgstr " -t, --field-separator=X dùng X thay vì TAB làm bộ phân tách trường\n" +msgstr "" +" -t, --field-separator=X dùng X thay vì TAB làm bộ phân tách trường\n" -#: src/datamash.c:250 +#: src/datamash.c:246 msgid " --narm skip NA/NaN values\n" msgstr " --narm bỏ qua các giá trị NA/NaN\n" -#: src/datamash.c:253 +#: src/datamash.c:249 msgid "" " -W, --whitespace use whitespace (one or more spaces and/or tabs)\n" " for field delimiters\n" @@ -448,159 +467,298 @@ " -W, --whitespace dùng khoảng trắng (một hoặc nhiều khoảng trắng\n" " hoặc/và tab) cho bộ phân tách trường\n" -#: src/datamash.c:257 +#: src/datamash.c:253 msgid " -z, --zero-terminated end lines with 0 byte, not newline\n" -msgstr " -z, --zero-terminated kết thúc dòng với byte 0, không phải ký tự dòng mới\n" +msgstr "" +" -z, --zero-terminated kết thúc dòng với byte 0, không phải ký tự dòng " +"mới\n" -#: src/datamash.c:266 +#: src/datamash.c:262 msgid "Examples:" msgstr "Ví dụ:" -#: src/datamash.c:268 +#: src/datamash.c:264 msgid "Print the sum and the mean of values from column 1:" msgstr "In tổng và giá trị trung bình từ cột 1:" -#: src/datamash.c:273 +#: src/datamash.c:269 msgid "Transpose input:" msgstr "Chuyển vị đầu vào:" -#: src/datamash.c:280 +#: src/datamash.c:276 msgid "For detailed usage information and examples, see\n" msgstr "Để có thông tin chi tiết về cách dùng và ví dụ, xem\n" -#: src/datamash.c:282 +#: src/datamash.c:278 msgid "The manual and more examples are available at\n" msgstr "Hướng dẫn sử dụng và nhiều ví dụ sẵn có tại\n" -#: src/datamash.c:291 +#: src/datamash.c:287 #, c-format -msgid "invalid input: field % requested, line % has only % fields" -msgstr "đầu vào không hợp lệ: đã yêu cầu trường %, dòng % chỉ có % trường" +msgid "" +"invalid input: field % requested, line % has only " +"% fields" +msgstr "" +"đầu vào không hợp lệ: đã yêu cầu trường %, dòng % chỉ có " +"% trường" -#: src/datamash.c:349 +#: src/datamash.c:357 #, c-format msgid "%s in line % field %: '%s'" msgstr "%s ở dòng % trường %: “%s”" -#: src/datamash.c:487 src/datamash.c:784 -#, c-format -msgid "-H or --header-in must be used with named columns" -msgstr "-H hay --header-in phải được dùng cùng với tên của cột" - -#: src/datamash.c:588 +#: src/datamash.c:676 #, c-format msgid "" -"transpose input error: line % has % fields (previous lines had %);\n" +"transpose input error: line % has % fields (previous lines " +"had %);\n" "see --help to disable strict mode" msgstr "" -"lỗi đầu vào hoán vị: dòng % có % trường (dòng trước đó có %);\n" +"lỗi đầu vào hoán vị: dòng % có % trường (dòng trước đó có " +"%);\n" "xem --help để tắt chế độ hạn chế" -#: src/datamash.c:644 +#: src/datamash.c:733 #, c-format msgid "" -"reverse-field input error: line % has % fields (previous lines had %);\n" +"reverse-field input error: line % has % fields (previous " +"lines had %);\n" "see --help to disable strict mode" msgstr "" -"lỗi đầu vào đảo ngược trường: dòng % có % trường (dòng trước đó có %);\n" +"lỗi đầu vào đảo ngược trường: dòng % có % trường (dòng " +"trước đó có %);\n" +"xem --help để tắt chế độ hạn chế" + +#: src/datamash.c:837 src/datamash.c:843 +#, fuzzy, c-format +msgid "" +"line % (% fields):\n" +" " +msgstr "%s ở dòng % trường %: “%s”" + +#: src/datamash.c:849 +#, fuzzy, c-format +msgid "" +"check failed: line % has % fields (previous line had " +"%)" +msgstr "" +"lỗi đầu vào hoán vị: dòng % có % trường (dòng trước đó có " +"%);\n" "xem --help để tắt chế độ hạn chế" -#: src/datamash.c:820 +#: src/datamash.c:861 +#, c-format +msgid "% line" +msgid_plural "% lines" +msgstr[0] "" + +#: src/datamash.c:864 +#, c-format +msgid "% field" +msgid_plural "% fields" +msgstr[0] "" + +#: src/datamash.c:965 #, c-format msgid "hash memory allocation error" msgstr "lỗi phân bổ bộ nhớ mã băm" -#: src/datamash.c:882 +#: src/datamash.c:1027 #, c-format msgid "sort command too-long (please report this bug)" msgstr "lệnh sort quá dài (vui lòng báo cáo đây là lỗi)" -#: src/datamash.c:888 +#: src/datamash.c:1033 #, c-format msgid "failed to run 'sort': popen failed" msgstr "gặp lỗi khi chạy “sort”: popen bị lỗi" -#: src/datamash.c:904 +#: src/datamash.c:1049 #, c-format msgid "read error" msgstr "lỗi đọc" -#: src/datamash.c:912 +#: src/datamash.c:1057 #, c-format msgid "read error (on close)" msgstr "lỗi đọc (khi đóng)" -#: src/datamash.c:939 -#, c-format -msgid "invalid empty grouping parameter" -msgstr "tham số nhóm trống rỗng không hợp lệ" - -#: src/datamash.c:946 -#, c-format -msgid "invalid grouping parameter %s" -msgstr "tham số nhóm không hợp lệ “%s”" - -#: src/datamash.c:1031 +#: src/datamash.c:1133 #, c-format msgid "the delimiter must be a single character" msgstr "dấu phân cách phải là một ký tự đơn" -#: src/datamash.c:1067 +#: src/datamash.c:1170 #, c-format msgid "missing operation specifiers" msgstr "thiếu bộ chỉ thị thao tác" -#: src/field-ops.c:293 +#: src/datamash.c:1184 +#, c-format +msgid "-H or --header-in must be used with named columns" +msgstr "-H hay --header-in phải được dùng cùng với tên của cột" + +#: src/field-ops.c:319 #, c-format -msgid "invalid empty column for operation %s" +msgid "" +"input error for operation %s: fields %,% have different " +"number of items" +msgstr "" + +#: src/field-ops.c:999 +msgid "invalid numeric value" +msgstr "giá trị số không hợp lệ" + +#: src/field-ops.c:1001 +msgid "invalid base64 value" +msgstr "giá trị base64 không hợp lệ" + +#: src/op-parser.c:163 src/op-parser.c:177 src/op-parser.c:184 +#, fuzzy, c-format +msgid "too many parameters for operation %s" +msgstr "cột “%s” không hợp lệ với thao tác %s" + +#: src/op-parser.c:174 +#, c-format +msgid "strbin bucket size must not be zero" +msgstr "" + +#: src/op-parser.c:205 src/op-parser.c:216 src/op-parser.c:472 +#, fuzzy, c-format +msgid "missing field for operation %s" +msgstr "thiếu số trường sau thao tác “%s”" + +#: src/op-parser.c:211 src/op-parser.c:220 src/op-parser.c:275 +#: src/op-parser.c:508 +#, fuzzy, c-format +msgid "invalid field range for operation %s" msgstr "cột trống không hợp lệ với thao tác %s" -#: src/field-ops.c:306 +#: src/op-parser.c:214 src/op-parser.c:224 src/op-parser.c:511 +#, fuzzy, c-format +msgid "invalid field pair for operation %s" +msgstr "cột “%s” không hợp lệ với thao tác %s" + +#: src/op-parser.c:238 src/op-parser.c:486 +#, fuzzy, c-format +msgid "invalid field '%s' for operation %s" +msgstr "cột “%s” không hợp lệ với thao tác %s" + +#: src/op-parser.c:272 #, c-format -msgid "invalid column '%s' for operation %s" +msgid "field range for %s must be numeric" +msgstr "" + +#: src/op-parser.c:332 +#, fuzzy, c-format +msgid "missing parameter for operation %s" +msgstr "thiếu số trường sau thao tác “%s”" + +#: src/op-parser.c:340 +#, fuzzy, c-format +msgid "invalid parameter %s for operation %s" msgstr "cột “%s” không hợp lệ với thao tác %s" -#: src/field-ops.c:985 +#: src/op-parser.c:372 +#, fuzzy, c-format +msgid "operation %s requires field pairs" +msgstr "%s: tùy chọn “--%s” cần một đối số\n" + +#: src/op-parser.c:375 #, c-format -msgid "invalid operation '%s'" +msgid "operation %s cannot use pair of fields" +msgstr "" + +#: src/op-parser.c:415 +#, fuzzy, c-format +msgid "conflicting operation %s" msgstr "thao tác không hợp lệ “%s”" -#: src/field-ops.c:1001 +#: src/op-parser.c:418 src/op-parser.c:597 +#, fuzzy, c-format +msgid "invalid operation %s" +msgstr "thao tác không hợp lệ “%s”" + +#: src/op-parser.c:423 #, c-format -msgid "conflicting operation found: expecting %s operations, but found %s operation %s" -msgstr "tìm thấy có xung đột thao tác: cần thao tác %s, nhưng lại nhận được %s thao tác %s" +msgid "" +"conflicting operation found: expecting %s operations, but found %s operation " +"%s" +msgstr "" +"tìm thấy có xung đột thao tác: cần thao tác %s, nhưng lại nhận được %s thao " +"tác %s" -#: src/field-ops.c:1009 +#: src/op-parser.c:537 #, c-format -msgid "missing field number after operation '%s'" -msgstr "thiếu số trường sau thao tác “%s”" +msgid "crosstab requires exactly 2 fields, found %" +msgstr "" -#: src/field-ops.c:1029 +#: src/op-parser.c:550 #, c-format -msgid "extra operands after '%s'" +msgid "crosstab supports one operation, found %" +msgstr "" + +#: src/op-parser.c:559 +#, fuzzy, c-format +msgid "missing operation" +msgstr "thiếu bộ chỉ thị thao tác" + +#: src/op-parser.c:573 +#, fuzzy, c-format +msgid "extra operand %s" msgstr "có thao tác thừa nằm sau “%s”" -#: src/field-ops.c:1094 -msgid "invalid numeric value" +#: src/op-parser.c:710 src/op-scanner.c:210 +#, c-format +msgid "missing script (among arguments)" +msgstr "" + +#: src/op-scanner.c:167 +#, fuzzy, c-format +msgid "invalid numeric value '%s'" msgstr "giá trị số không hợp lệ" -#: src/field-ops.c:1096 -msgid "invalid base64 value" -msgstr "giá trị base64 không hợp lệ" +#: src/op-scanner.c:188 +#, fuzzy, c-format +msgid "invalid operand %s" +msgstr "thao tác không hợp lệ “%s”" + +#: src/op-scanner.c:244 +#, c-format +msgid "unknown token %d\n" +msgstr "" -#: src/system.h:101 +#: src/system.h:133 msgid " --help display this help and exit\n" msgstr " --help hiển thị trợ giúp này rồi thoát\n" -#: src/system.h:103 +#: src/system.h:135 msgid " --version output version information and exit\n" msgstr " --version đưa ra thông tin phiên bản rồi thoát\n" -#: src/system.h:108 +#: src/system.h:140 #, c-format msgid "Try '%s --help' for more information.\n" msgstr "Hãy chạy lệnh “%s --help” để biết thêm thông tin.\n" +#~ msgid "'op' is the operation to perform;\n" +#~ msgstr "“op” là thao tác cần thực hiện;\n" + +#~ msgid "File operations:\n" +#~ msgstr "Thao tác tập tin:\n" + +#~ msgid "Options:\n" +#~ msgstr "Tùy chọn:\n" + +#~ msgid " -g, --group=X[,Y,Z] group via fields X,[Y,Z]\n" +#~ msgstr " -g, --group=X[,Y,Z] nhóm thông qua các trường X,[Y,Z]\n" + +#~ msgid "invalid empty grouping parameter" +#~ msgstr "tham số nhóm trống rỗng không hợp lệ" + +#~ msgid "invalid grouping parameter %s" +#~ msgstr "tham số nhóm không hợp lệ “%s”" + #, fuzzy #~ msgid " --debug print helpful debugging information\n" #~ msgstr " -d, --debug in nhiều thông tin để tìm sửa lỗi.\n" diff -Nru datamash-1.0.7/README datamash-1.1.1/README --- datamash-1.0.7/README 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/README 2017-01-17 17:50:20.000000000 +0000 @@ -84,7 +84,7 @@ Copyright and License ===================== -Copyright (C) 2013-2015 Assaf Gordon +Copyright (C) 2013-2017 Assaf Gordon License: GPL Version 3 (or later). diff -Nru datamash-1.0.7/src/column-headers.c datamash-1.1.1/src/column-headers.c --- datamash-1.0.7/src/column-headers.c 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/src/column-headers.c 2017-01-17 17:50:20.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2014-2015 Assaf Gordon. + Copyright (C) 2014-2017 Assaf Gordon. This file is part of GNU Datamash. @@ -24,6 +24,7 @@ #include #include #include +#include #include "system.h" #include "xalloc.h" @@ -92,7 +93,8 @@ if (!store_names) { str = xmalloc ( field_name_buf_size ); - ignore_value (snprintf (str, field_name_buf_size, "field-%zu",i)); + ignore_value (snprintf (str, field_name_buf_size, + "field-%"PRIuMAX,(uintmax_t)i)); } else { diff -Nru datamash-1.0.7/src/column-headers.h datamash-1.1.1/src/column-headers.h --- datamash-1.0.7/src/column-headers.h 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/src/column-headers.h 2017-01-17 17:50:20.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2014-2015 Assaf Gordon + Copyright (C) 2014-2017 Assaf Gordon This file is part of GNU Datamash. diff -Nru datamash-1.0.7/src/crosstab.c datamash-1.1.1/src/crosstab.c --- datamash-1.0.7/src/crosstab.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/src/crosstab.c 2017-01-17 17:50:20.000000000 +0000 @@ -0,0 +1,188 @@ +/* GNU Datamash - perform simple calculation on input data + + Copyright (C) 2013-2017 Assaf Gordon + + This file is part of GNU Datamash. + + GNU Datamash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + GNU Datamash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Datamash. If not, see . +*/ + +/* Written by Assaf Gordon */ +#include + +#include +#include +#include +#include + +#include "ignore-value.h" +#include "hash.h" +#include "hash-pjw.h" +#include "xalloc.h" + +#include "system.h" +#include "crosstab.h" +#include "utils.h" +#include "text-options.h" + + +static bool _GL_ATTRIBUTE_PURE +str_comparator (const void* a, const void* b) +{ + assert (a!=NULL && b!=NULL); /* LCOV_EXCL_LINE */ + if (a==b) + return true; + return (STREQ ((const char*)a, (const char*)b)); +} + +static size_t _GL_ATTRIBUTE_PURE +hash_crosstab_data_cell (void const *x, size_t tablesize) +{ + struct crosstab_datacell *dc = (struct crosstab_datacell*)x; + + const char *s; + size_t h = 0; +#define SIZE_BITS (sizeof (size_t) * CHAR_BIT) + + for (s = dc->row_name; *s; s++) + h = *s + ((h << 9) | (h >> (SIZE_BITS - 9))); + for (s = dc->col_name; *s; s++) + h = *s + ((h << 9) | (h >> (SIZE_BITS - 9))); + + return h % tablesize; +} + +static bool _GL_ATTRIBUTE_PURE +crosstab_datacell_comparator (const void* a, const void* b) +{ + assert (a!=NULL && b!=NULL); /* LCOV_EXCL_LINE */ + if (a==b) + return true; + const struct crosstab_datacell *da = (struct crosstab_datacell*)a; + const struct crosstab_datacell *db = (struct crosstab_datacell*)b; + return (STREQ (da->row_name, db->row_name) + && STREQ (da->col_name, db->col_name)); +} + + +struct crosstab_datacell* +new_datacell (const char* row, const char* col, const char* data) +{ + struct crosstab_datacell *dc = xmalloc (sizeof (struct crosstab_datacell)); + dc->row_name = row; + dc->col_name = col; + dc->data = data; + return dc; +} + +static void +crosstab_datacell_free (void *a) +{ + struct crosstab_datacell *dc = (struct crosstab_datacell*)a; + dc->row_name = NULL; + dc->col_name = NULL; + dc->data = NULL; + free (dc); +} + +/* Setup needed variables for the cross-tabulation */ +struct crosstab* +crosstab_init () +{ + struct crosstab *ct = XMALLOC (struct crosstab); + + ct->rows = hash_initialize (1000,NULL,hash_pjw,str_comparator,free); + ct->columns = hash_initialize (1000,NULL,hash_pjw,str_comparator,free); + ct->data = hash_initialize (1000,NULL,hash_crosstab_data_cell, + crosstab_datacell_comparator, + crosstab_datacell_free); + return ct; +} + +void +crosstab_free (struct crosstab* ct) +{ + assert (ct!=NULL); /* LCOV_EXCL_LINE */ + hash_free (ct->rows); + ct->rows = NULL; + hash_free (ct->columns); + ct->columns = NULL; + hash_free (ct->data); + ct->data = NULL; + free (ct); +} + +/* Add new cross-tabulation result */ +void +crosstab_add_result (struct crosstab* ct, + const char* row, const char* col, const char* data) +{ + const char* r = hash_lookup (ct->rows, row); + if (r==NULL) + r = hash_insert (ct->rows, xstrdup (row)); + + const char* c = hash_lookup (ct->columns, col); + if (c==NULL) + c = hash_insert (ct->columns, xstrdup (col)); + + struct crosstab_datacell *ctdc = new_datacell (r,c,xstrdup (data)); + ignore_value (hash_insert (ct->data, ctdc)); +} + + +/* Print table */ +void +crosstab_print (const struct crosstab* ct) +{ + const size_t n_rows = hash_get_n_entries (ct->rows); + char** rows_list = XNMALLOC (n_rows,char*); + hash_get_entries (ct->rows, (void**)rows_list, n_rows); + qsort (rows_list, n_rows, sizeof (char*), cmpstringp); + + const size_t n_cols = hash_get_n_entries (ct->columns); + char** cols_list = XNMALLOC (n_cols,char*); + hash_get_entries (ct->columns, (void**)cols_list, n_cols); + qsort (cols_list, n_cols, sizeof (char*), cmpstringp); + + /* Print columns */ + for (size_t c = 0; c < n_cols; ++c) + { + print_field_separator (); + fputs (cols_list[c], stdout); + } + print_line_separator (); + + /* Print rows */ + for (size_t r = 0; r < n_rows; ++r) + { + fputs (rows_list[r], stdout); + + for (size_t c = 0; c < n_cols; ++c) + { + struct crosstab_datacell curr; + curr.row_name = rows_list[r]; + curr.col_name = cols_list[c]; + + const struct crosstab_datacell *dc = hash_lookup (ct->data, &curr); + print_field_separator (); + fputs ((dc==NULL)?missing_field_filler:dc->data, stdout); + } + + print_line_separator (); + } +} +/* vim: set cinoptions=>4,n-2,{2,^-2,:2,=2,g0,h2,p5,t0,+2,(0,u0,w1,m1: */ +/* vim: set shiftwidth=2: */ +/* vim: set tabstop=8: */ +/* vim: set expandtab: */ diff -Nru datamash-1.0.7/src/crosstab.h datamash-1.1.1/src/crosstab.h --- datamash-1.0.7/src/crosstab.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/src/crosstab.h 2017-01-17 17:50:20.000000000 +0000 @@ -0,0 +1,55 @@ +/* GNU Datamash - perform simple calculation on input data + + Copyright (C) 2013-2017 Assaf Gordon + + This file is part of GNU Datamash. + + GNU Datamash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + GNU Datamash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Datamash. If not, see . +*/ + +/* Written by Assaf Gordon */ +#ifndef __CROSSTAB_H__ +#define __CROSSTAB_H__ + +struct crosstab +{ + Hash_table *rows; + Hash_table *columns; + Hash_table *data; +}; + +struct crosstab_datacell +{ + const char* row_name; + const char* col_name; + const char* data; +}; + +struct crosstab_data_cell* +crosstab_new_datacell (const char* row, const char* col, const char* data); + +struct crosstab* +crosstab_init (); + +void +crosstab_add_result (struct crosstab* ct, + const char* row, const char* col, const char* data); + +void +crosstab_print (); + +void +crosstab_free (struct crosstab* ct); + +#endif /* __CROSSTAB_H__ */ diff -Nru datamash-1.0.7/src/datamash.c datamash-1.1.1/src/datamash.c --- datamash-1.0.7/src/datamash.c 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/src/datamash.c 2017-01-17 17:50:20.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2015 Assaf Gordon + Copyright (C) 2013-2017 Assaf Gordon This file is part of GNU Datamash. @@ -34,6 +34,7 @@ #include "system.h" +#include "fpucw.h" #include "closeout.h" #include "hash.h" #include "hash-pjw.h" @@ -48,12 +49,14 @@ #include "xstrndup.h" #include "xalloc.h" -#include "strcnt.h" #include "text-options.h" #include "text-lines.h" #include "column-headers.h" +#include "op-defs.h" +#include "op-parser.h" #include "field-ops.h" #include "utils.h" +#include "crosstab.h" /* The official name of this program (e.g., no 'g' prefix). */ #define PROGRAM_NAME "datamash" @@ -78,35 +81,20 @@ /* If true, print the entire input line. Otherwise, print only the key fields */ static bool print_full_line = false; -struct group_column_t -{ - size_t col_number; /* 1 = first field */ - bool col_by_name; /* true if the user gave a column name */ - char* col_name; /* column name - to be converted to number after - header line is read */ -}; -static bool group_column_have_names = false; -static size_t num_group_columns = 0; -static struct group_column_t *group_columns = NULL; +/* processing mode, group fields, field operations */ +static struct datamash_ops *dm = NULL; static bool line_mode = false; /* if TRUE, handle each line as a group */ +static bool crosstab_mode = false; /* if TRUE, do cross-tabulation */ + +static struct crosstab* crosstab = NULL; + static bool pipe_through_sort = false; static FILE* input_stream = NULL; -/* if true, 'transpose' and 'reverse' require every line to have - the exact same number of fields. Otherwise, the program - will fail with non-zero exit code. */ -static bool strict = true; - -/* if 'strict' is false, lines with fewer-than-expected fields - will be filled with this value */ -static char* missing_field_filler = "N/A"; - -/* If true, N/A, NaN and empty cells in numeric operations will be silently - ignored instead of triggering an error. Akin to R's "na.rm=TRUE" option. */ -bool remove_na_values = false; - +/* Use large buffer for normal operation (will be reduced for testing) */ +static size_t rmdup_initial_size = (1024*1024); enum { @@ -116,7 +104,8 @@ REMOVE_NA_VALUES_OPTION, UNDOC_PRINT_INF_OPTION, UNDOC_PRINT_NAN_OPTION, - UNDOC_PRINT_PROGNAME_OPTION + UNDOC_PRINT_PROGNAME_OPTION, + UNDOC_RMDUP_TEST }; static char const short_options[] = "sfF:izg:t:HW"; @@ -142,25 +131,26 @@ {"-print-inf", no_argument, NULL, UNDOC_PRINT_INF_OPTION}, {"-print-nan", no_argument, NULL, UNDOC_PRINT_NAN_OPTION}, {"-print-progname", no_argument, NULL, UNDOC_PRINT_PROGNAME_OPTION}, + {"-rmdup-test", no_argument, NULL, UNDOC_RMDUP_TEST}, {NULL, 0, NULL, 0}, }; void group_columns_find_named_columns () { - for (size_t i = 0; i < num_group_columns; ++i) + for (size_t i = 0; i < dm->num_grps; ++i) { - struct group_column_t *p = &group_columns[i]; + struct group_column_t *p = &dm->grps[i]; - if (!p->col_by_name) + if (!p->by_name) continue; - p->col_number = get_input_field_number (p->col_name); - if (p->col_number == 0) + p->num = get_input_field_number (p->name); + if (p->num == 0) error (EXIT_FAILURE, 0, _("column name %s not found in input file"), - quote (p->col_name)); - p->col_by_name = false; + quote (p->name)); + p->by_name = false; } } @@ -171,27 +161,32 @@ emit_try_help (); else { - printf (_("Usage: %s [OPTION] op [col] [op col ...]\n"), + printf (_("Usage: %s [OPTION] op [fld] [op fld ...]\n"), program_name); fputs ("\n", stdout); fputs (_("Performs numeric/string operations on input from stdin."), stdout); fputs ("\n\n", stdout); - fputs (_("'op' is the operation to perform;\n"), stdout); fputs (_("\ -For grouping,per-line operations 'col' is the input field to use;\n\ -'col' can be a number (1=first field), or a column name when using\n\ --H or --header-in options.\n\ -"), stdout); +'op' is the operation to perform. If a primary operation is used,\n\ +it must be listed first, optionally followed by other operations.\n"), stdout); + fputs (_("\ +'fld' is the input field to use. 'fld' can be a number (1=first field),\n\ +or a field name when using the -H or --header-in options.\n"), stdout); + fputs (_("\ +Multiple fields can be listed with a comma (e.g. 1,6,8). A range of\n\ +fields can be listed with a dash (e.g. 2-8). Use colons for operations\n\ +which require a pair of fields (e.g. 'pcov 2:6').\n"), stdout); fputs ("\n\n", stdout); - fputs (_("File operations:\n"),stdout); - fputs (" transpose, reverse\n",stdout); + fputs (_("Primary operations:\n"),stdout); + fputs (" groupby, crosstab, transpose, reverse, check\n",stdout); fputs (_("Line-Filtering operations:\n"),stdout); fputs (" rmdup\n",stdout); fputs (_("Per-Line operations:\n"),stdout); - fputs (" base64, debase64, md5, sha1, sha256, sha512\n",stdout); + fputs (" base64, debase64, md5, sha1, sha256, sha512,\n", stdout); + fputs (" bin, strbin, round, floor, ceil, trunc, frac\n", stdout); fputs (_("Numeric Grouping operations:\n"),stdout); fputs (" sum, min, max, absmin, absmax\n",stdout); @@ -202,19 +197,20 @@ fputs (_("Statistical Grouping operations:\n"),stdout); fputs ("\ - mean, median, q1, q3, iqr, mode, antimode, pstdev, sstdev, pvar\n\ - svar, mad, madraw, pskew, sskew, pkurt, skurt, dpo, jarque\n\ + mean, median, q1, q3, iqr, mode, antimode, pstdev, sstdev, pvar,\n\ + svar, mad, madraw, pskew, sskew, pkurt, skurt, dpo, jarque,\n\ + scov, pcov, spearson, ppearson\n\ \n", stdout); fputs ("\n", stdout); - fputs (_("Options:\n"),stdout); fputs (_("Grouping Options:\n"),stdout); fputs (_("\ -f, --full print entire input line before op results\n\ (default: print only the grouped keys)\n\ "), stdout); fputs (_("\ - -g, --group=X[,Y,Z] group via fields X,[Y,Z]\n\ + -g, --group=X[,Y,Z] group via fields X,[Y,Z];\n\ + equivalent to primary operation 'groupby'\n\ "), stdout); fputs (_("\ --header-in first input line is column headers\n\ @@ -278,7 +274,7 @@ \n", program_name); fputs (_("For detailed usage information and examples, see\n"),stdout); - printf (" man %s\n", program_name); + printf (" man %s\n", PACKAGE_NAME); fputs (_("The manual and more examples are available at\n"), stdout); fputs (" " PACKAGE_URL "\n\n", stdout); } @@ -303,15 +299,27 @@ error_not_enough_fields (n, line_record_num_fields (lr)); } +static inline void +safe_line_record_get_fieldz (const struct line_record_t *lr, const size_t n, + char * /* out */ buf, size_t len) +{ + const char *p; + size_t l; + safe_line_record_get_field (lr, n, &p, &l); + l = MIN (len-1,l); + memcpy (buf, p, l); + buf[l] = 0; +} + /* returns TRUE if the lines are different, false if identical. * comparison is based on the specified keys */ /* copied from coreutils's src/uniq.c (in the key-spec branch) */ static bool different (const struct line_record_t* l1, const struct line_record_t* l2) { - for (size_t i = 0; i < num_group_columns; ++i) + for (size_t i = 0; i < dm->num_grps; ++i) { - const size_t col_num = group_columns[i].col_number; + const size_t col_num = dm->grps[i].num; const char *str1=NULL,*str2=NULL; size_t len1=0,len2=0; safe_line_record_get_field (l1, col_num, &str1, &len1); @@ -335,9 +343,9 @@ enum FIELD_OP_COLLECT_RESULT flocr; bool keep_line = false; - struct fieldop *op = field_ops; - while (op) + for (size_t i=0; inum_ops; ++i) { + struct fieldop *op = &dm->ops[i]; safe_line_record_get_field (line, op->field, &str, &len); flocr = field_op_collect (op, str, len); if (!field_op_ok (flocr)) @@ -351,8 +359,6 @@ (uintmax_t)line_number, (uintmax_t)op->field, tmp); } keep_line = keep_line || (flocr==FLOCR_OK_KEEP_LINE); - - op = op->next; } return keep_line; } @@ -377,9 +383,9 @@ } else { - for (size_t i = 0; i < num_group_columns; ++i) + for (size_t i = 0; i < dm->num_grps; ++i) { - const size_t col_num = group_columns[i].col_number; + const size_t col_num = dm->grps[i].num; safe_line_record_get_field (lb, col_num, &str, &len); ignore_value (fwrite (str,sizeof (char),len,stdout)); print_field_separator (); @@ -403,6 +409,7 @@ { if (print_full_line) { + /* Print the headers of all the input fields */ for (size_t n=1; n<=get_num_column_headers (); ++n) { fputs (get_input_field_name (n), stdout); @@ -411,9 +418,12 @@ } else { - for (size_t i = 0; i < num_group_columns; ++i) + /* print only the headers of the group-by fields, e.g + 'GroupBy (field-3)' (without input headers), or + 'GroupBy (NAME)' (with input headers) */ + for (size_t i = 0; i < dm->num_grps; ++i) { - const size_t col_num = group_columns[i].col_number; + const size_t col_num = dm->grps[i].num; if (col_num > get_num_column_headers ()) error_not_enough_fields (col_num, get_num_column_headers ()); printf ("GroupBy" "(%s)",get_input_field_name (col_num)); @@ -421,13 +431,21 @@ } } - for (struct fieldop *op = field_ops; op ; op=op->next) + /* add headers of the operations, e.g. + 'sum (field-3)' (without input headers), or + 'sum (NAME)' (with input headers) */ + for (size_t i=0; inum_ops; ++i) { + struct fieldop *op = &dm->ops[i]; + if (op->slave) + continue; + if (op->field > get_num_column_headers ()) error_not_enough_fields (op->field, get_num_column_headers ()); - printf ("%s" "(%s)",op->name, get_input_field_name (op->field)); + printf ("%s" "(%s)",get_field_operation_name (op->op), + get_input_field_name (op->field)); - if (op->next) + if (i != dm->num_ops-1) print_field_separator (); } @@ -435,6 +453,23 @@ print_line_separator (); } +void +field_op_find_named_columns () +{ + for (size_t i=0; inum_ops; ++i) + { + struct fieldop *p = &dm->ops[i]; + if (!p->field_by_name) + continue; + p->field = get_input_field_number (p->field_name); + if (p->field == 0) + error (EXIT_FAILURE, 0, + _("column name %s not found in input file"), + quote (p->field_name)); + p->field_by_name = false; + } +} + /* Process the input header line */ @@ -450,14 +485,78 @@ line_number++; /* If using named-columns, find the column numbers after reading the header line. */ - if (field_op_have_named_fields ()) - field_op_find_named_columns (); - if (group_column_have_names) - group_columns_find_named_columns (); + field_op_find_named_columns (); + group_columns_find_named_columns (); } line_record_free (&lr); } +void +summarize_field_ops () +{ + for (size_t i=0;inum_ops;++i) + { + struct fieldop *p = &dm->ops[i]; + if (p->slave) + continue; + + field_op_summarize (p); + fputs (p->out_buf, stdout); + + /* print field separator */ + if (i != dm->num_ops-1) + print_field_separator (); + } + + /* print end-of-line */ + print_line_separator (); +} + +void +reset_field_ops () +{ + for (size_t i=0;inum_ops;++i) + field_op_reset (&dm->ops[i]); +} + +/* Process a completed group of data lines + (all with the same 'group by' keys). */ +static void +process_group (const struct line_record_t* line) +{ + /* TODO: dynamically re-alloc if needed */ + char col_name[512]; + char row_name[512]; + + if (lines_in_group>0) + { + if (crosstab_mode) + { + /* cross-tabulation mode - save results in a matrix, print later */ + const size_t row_field = dm->grps[0].num; + safe_line_record_get_fieldz (line, row_field, + row_name, sizeof row_name); + + const size_t col_field = dm->grps[1].num; + safe_line_record_get_fieldz (line, col_field, + col_name, sizeof col_name); + + field_op_summarize (&dm->ops[0]); + const char* data = dm->ops[0].out_buf; + + crosstab_add_result (crosstab, row_name, col_name, data); + } + else + { + /* group-by/per-line mode - print results once available */ + print_input_line (line); + summarize_field_ops (); + } + } + lines_in_group = 0; + reset_field_ops (); +} + /* Process each line in the input. @@ -480,11 +579,7 @@ in 'open_input' - read it now */ if (input_header && line_number==0) process_input_header (input_stream); - /* If using named-columns, but no input header - abort */ - if ((field_op_have_named_fields () || group_column_have_names) - && !input_header) - error (EXIT_FAILURE, 0, - _("-H or --header-in must be used with named columns")); + /* If there is an input header line, and the user requested an output header line, and the input line was read successfully, print headers */ if (input_header && output_header && line_number==1) @@ -510,17 +605,14 @@ /* If no keys are given, the entire input is considered one group */ - if (num_group_columns || line_mode) + if (dm->num_grps || line_mode) { new_group = (group_first_line->lbuf.length == 0 || line_mode || different (thisline, group_first_line)); - if (new_group && lines_in_group>0) + if (new_group) { - print_input_line (group_first_line); - summarize_field_ops (); - reset_field_ops (); - lines_in_group = 0 ; + process_group (group_first_line); group_first_line->lbuf.length = 0; } } @@ -540,12 +632,7 @@ } /* summarize last group */ - if (lines_in_group) - { - print_input_line (group_first_line); - summarize_field_ops (); - reset_field_ops (); - } + process_group (group_first_line); line_record_free (&lb1); line_record_free (&lb2); @@ -561,6 +648,7 @@ size_t alloc_lines = 0; struct line_record_t *lines = NULL; + size_t max_num_fields = 0 ; size_t prev_num_fields = 0 ; /* Read all input lines - but instead of reusing line_record_t, @@ -592,11 +680,12 @@ (uintmax_t)prev_num_fields); prev_num_fields = num_fields; + max_num_fields = MAX (max_num_fields,num_fields); } /* Output all fields */ - for (size_t i = 1 ; i <= prev_num_fields ; ++i) + for (size_t i = 1 ; i <= max_num_fields ; ++i) { for (size_t j = 0; j < line_number; ++j) { @@ -621,7 +710,7 @@ } /* - Revers the fields in each line of the input file + Reverse the fields in each line of the input file */ static void reverse_fields_in_file () @@ -719,6 +808,68 @@ } /* + Read file, ensure it is in tabular format + (same number of fields in each line) + */ +static void +tabular_check_file () +{ + size_t prev_num_fields=0; + struct line_record_t lb1, lb2; + struct line_record_t *thisline, *prevline; + + thisline = &lb1; + prevline = &lb2; + + line_record_init (thisline); + line_record_init (prevline); + + while (true) + { + if (!line_record_fread (thisline, input_stream, eolchar)) + break; + line_number++; + + const size_t num_fields = line_record_num_fields (thisline); + + if (line_number>1 && num_fields != prev_num_fields) + { + fprintf (stderr, _("line %"PRIuMAX" (%"PRIuMAX" fields):\n "), + (uintmax_t)(line_number-1), (uintmax_t)prev_num_fields); + ignore_value (fwrite (line_record_buffer (prevline), + line_record_length (prevline), sizeof (char), + stderr)); + fputc ('\n', stderr); + fprintf (stderr, _("line %"PRIuMAX" (%"PRIuMAX" fields):\n "), + (uintmax_t)(line_number), (uintmax_t)num_fields); + ignore_value (fwrite (line_record_buffer (thisline), + line_record_length (thisline), sizeof (char), + stderr)); + fputc ('\n', stderr); + error (EXIT_FAILURE, 0, _("check failed: line " \ + "%"PRIuMAX" has %"PRIuMAX" fields (previous line had "\ + "%"PRIuMAX")"), + (uintmax_t)line_number, (uintmax_t)num_fields, + (uintmax_t)prev_num_fields); + } + prev_num_fields = num_fields; + + SWAP_LINES (prevline, thisline); + } + + /* Print summary */ + printf (ngettext ("%"PRIuMAX" line", "%"PRIuMAX" lines", + select_plural (line_number)), (uintmax_t)line_number); + fputs (", ", stdout); + printf (ngettext ("%"PRIuMAX" field", "%"PRIuMAX" fields", + select_plural (prev_num_fields)), (uintmax_t)prev_num_fields); + print_line_separator (); + + line_record_free (&lb1); + line_record_free (&lb2); +} + +/* Remove lines with duplicates keys from a file */ static void @@ -729,7 +880,7 @@ struct line_record_t lr; struct line_record_t *thisline; Hash_table *ht; - const size_t init_table_size = 100000; + const size_t init_table_size = rmdup_initial_size; char* keys_buffer = NULL; size_t keys_buffer_alloc = 0; @@ -739,20 +890,17 @@ size_t buffer_list_alloc = 0; size_t buffer_list_size = 0; - assert (field_ops != NULL); /* LCOV_EXCL_LINE */ - thisline = &lr; line_record_init (thisline); ht = hash_initialize (init_table_size, NULL, hash_pjw, hash_compare_strings, NULL); /* Allocate keys buffer */ - keys_buffer_alloc = 1000000 ; + keys_buffer_alloc = rmdup_initial_size ; keys_buffer = xmalloc ( keys_buffer_alloc ); /* List of allocated key-buffers */ - buffer_list_alloc = 1000 ; - buffer_list = xnmalloc (buffer_list_alloc, sizeof (char*)); + buffer_list = x2nrealloc (NULL, &buffer_list_alloc, sizeof (char*)); buffer_list[0] = keys_buffer; buffer_list_size = 1 ; @@ -764,10 +912,10 @@ /* If using named-columns, find the column numbers after reading the header line. */ - if (field_op_have_named_fields ()) + if (dm->header_required) { build_input_line_headers (&lr, true); - field_op_find_named_columns (); + group_columns_find_named_columns (); } if (output_header) @@ -779,10 +927,9 @@ } } } - if (!input_header && field_op_have_named_fields ()) - error (EXIT_FAILURE, 0, - _("-H or --header-in must be used with named columns")); - const size_t key_col = field_ops->field; + + assert (dm->num_grps==1); /* LCOV_EXCL_LINE */ + const size_t key_col = dm->grps[0].num; /* TODO: handle (output_header && !input_header) by generating dummy headers after the first line is read, and the number of fields is known. */ @@ -801,13 +948,11 @@ { keys_buffer = xmalloc ( keys_buffer_alloc ) ; next_key_pos = 0; + /* Add new key-buffer to the list */ - if (buffer_list_size >= buffer_list_alloc) - { - buffer_list_alloc += 1000 ; - buffer_list = xnrealloc (buffer_list, buffer_list_alloc, - sizeof (char*)); - } + if (buffer_list_size == buffer_list_alloc) + buffer_list = x2nrealloc (buffer_list, + &buffer_list_alloc, sizeof (char*)); buffer_list[buffer_list_size++] = keys_buffer; } char *next_key = keys_buffer+next_key_pos; @@ -840,7 +985,7 @@ static void open_input () { - if (pipe_through_sort && num_group_columns>0) + if (pipe_through_sort && dm->num_grps>0) { char tmp[INT_BUFSIZE_BOUND (size_t)*2+5]; char cmd[1024]; @@ -872,9 +1017,9 @@ snprintf (tmp,sizeof (tmp),"-t %c%c%c ",qc,in_tab,qc); strcat (cmd,tmp); } - for (size_t i = 0; i < num_group_columns; ++i) + for (size_t i = 0; i < dm->num_grps; ++i) { - const size_t col_num = group_columns[i].col_number; + const size_t col_num = dm->grps[i].num; snprintf (tmp,sizeof (tmp),"-k%"PRIuMAX",%"PRIuMAX" ", (uintmax_t)col_num,(uintmax_t)col_num); if (strlen (tmp)+strlen (cmd)+1 >= sizeof (cmd)) @@ -912,59 +1057,15 @@ error (EXIT_FAILURE, errno, _("read error (on close)")); } -static void -free_sort_keys () -{ - free (group_columns); -} - -/* Parse the "--group=X[,Y,Z]" parameter, populating 'keylist' */ -static void -parse_group_spec ( char* spec ) -{ - long int val; - size_t idx; - char *tok, *endptr; - - /* Count number of groups parameters, by number of commas */ - num_group_columns = strcnt (spec, ',')+1; - - /* Allocate the group_columns */ - group_columns = xnmalloc (num_group_columns, sizeof (struct group_column_t)); - - idx=0; - while ( (tok = strsep (&spec, ",")) != NULL) - { - if (strlen (tok) == 0) - error (EXIT_FAILURE, 0, _("invalid empty grouping parameter")); - errno = 0 ; - val = strtol (tok, &endptr, 10); - if (errno == 0 && endptr != tok && *endptr == 0) - { - /* If strtol succeeded, it's a valid number. */ - if (val<1) - error (EXIT_FAILURE, 0, _("invalid grouping parameter %s"), - quote (tok)); - group_columns[idx].col_number = val; - group_columns[idx].col_by_name = false; - group_columns[idx].col_name = NULL; - } - else - { - /* If strrol failed, assume it's a named column - resolve it later. */ - group_columns[idx].col_name = xstrdup (tok); - group_columns[idx].col_number = 0; - group_columns[idx].col_by_name = true; - group_column_have_names = true; - } - idx++; - } -} - int main (int argc, char* argv[]) { int optc; - enum operation_mode op_mode; + enum processing_mode premode = MODE_INVALID; + const char* premode_group_spec = NULL; + + DECL_LONG_DOUBLE_ROUNDING + BEGIN_LONG_DOUBLE_ROUNDING (); + set_program_name (argv[0]); setlocale (LC_ALL, ""); @@ -990,7 +1091,8 @@ break; case 'g': - parse_group_spec (optarg); + premode = MODE_GROUPBY; + premode_group_spec = optarg; break; case 'i': @@ -1039,12 +1141,8 @@ case UNDOC_PRINT_INF_OPTION: case UNDOC_PRINT_NAN_OPTION: - { - struct fieldop op; - op.op = (optc==UNDOC_PRINT_INF_OPTION)?OP_MAX:OP_MEAN; - op.res_type = NUMERIC_RESULT; - field_op_summarize_empty (&op); - } + field_op_print_empty_value ( (optc==UNDOC_PRINT_INF_OPTION) + ?OP_MAX:OP_MEAN ); exit (EXIT_SUCCESS); break; @@ -1053,6 +1151,10 @@ exit (EXIT_SUCCESS); break; + case UNDOC_RMDUP_TEST: + rmdup_initial_size = 1024; + break; + case_GETOPT_HELP_CHAR; case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS); @@ -1062,48 +1164,74 @@ } } + if (argc <= optind) { error (0, 0, _("missing operation specifiers")); usage (EXIT_FAILURE); } - op_mode = parse_operation_mode (argc, optind, argv); + /* The rest of the parameters are the operations */ + if (premode == MODE_INVALID) + dm = datamash_ops_parse (argc - optind, (const char**)argv+optind); + else + dm = datamash_ops_parse_premode (premode, premode_group_spec, + argc - optind, (const char**)argv+optind); + + /* If using named-columns, but no input header - abort */ + if (dm->header_required && !input_header) + error (EXIT_FAILURE, 0, + _("-H or --header-in must be used with named columns")); open_input (); - switch (op_mode) + switch (dm->mode) /* LCOV_EXCL_BR_LINE */ { - case LINE_MODE: + case MODE_PER_LINE: line_mode = true; /* fall through */ - case GROUPING_MODE: + case MODE_GROUPBY: process_file (); break; - case NOOP_MODE: + case MODE_NOOP: noop_file (); break; - case TRANSPOSE_MODE: + case MODE_TRANSPOSE: transpose_file (); break; - case REVERSE_FIELD_MODE: + case MODE_REVERSE: reverse_fields_in_file (); break; - case REMOVE_DUPS_MODE: + case MODE_REMOVE_DUPS: remove_dups_in_file (); break; - case UNKNOWN_MODE: + case MODE_CROSSTAB: + assert ( dm->num_grps== 2 ); /* LCOV_EXCL_LINE */ + assert ( dm->num_ops == 1 ); /* LCOV_EXCL_LINE */ + crosstab_mode = true; + crosstab = crosstab_init (); + process_file (); + crosstab_print (crosstab); + crosstab_free (crosstab); + break; + + case MODE_TABULAR_CHECK: + tabular_check_file (); + break; + + case MODE_INVALID: default: - internal_error ("op mode"); /* LCOV_EXCL_LINE */ + internal_error ("op mode"); /* LCOV_EXCL_LINE */ } - free_field_ops (); - free_sort_keys (); free_column_headers (); close_input (); + datamash_ops_free (dm); + + END_LONG_DOUBLE_ROUNDING (); return EXIT_SUCCESS; } diff -Nru datamash-1.0.7/src/field-ops.c datamash-1.1.1/src/field-ops.c --- datamash-1.0.7/src/field-ops.c 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/src/field-ops.c 2017-01-17 17:50:20.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2015 Assaf Gordon + Copyright (C) 2013-2017 Assaf Gordon This file is part of GNU Datamash. @@ -26,6 +26,8 @@ #include #include #include +#include +#include #include #include #include @@ -33,7 +35,6 @@ #include "error.h" #include "minmax.h" #include "linebuffer.h" -#include "quote.h" #include "system.h" #include "md5.h" #include "sha1.h" @@ -41,126 +42,122 @@ #include "sha512.h" #include "base64.h" #include "xalloc.h" +#include "hash-pjw-bare.h" #include "utils.h" #include "text-options.h" #include "text-lines.h" #include "column-headers.h" +#include "op-defs.h" #include "field-ops.h" -/* In the future: allow users to change this */ -int field_op_output_precision = 14 ; - -/* Should NA/NaN/empty values be silengtly ignored? */ -extern bool remove_na_values; - struct operation_data operations[] = { /* OP_COUNT */ - {"count", STRING_SCALAR, IGNORE_FIRST, GROUPING_MODE, NUMERIC_RESULT}, + {STRING_SCALAR, IGNORE_FIRST, NUMERIC_RESULT}, /* OP_SUM */ - {"sum", NUMERIC_SCALAR, IGNORE_FIRST, GROUPING_MODE, NUMERIC_RESULT}, + {NUMERIC_SCALAR, IGNORE_FIRST, NUMERIC_RESULT}, /* OP_MIN */ - {"min", NUMERIC_SCALAR, AUTO_SET_FIRST, GROUPING_MODE, NUMERIC_RESULT}, + {NUMERIC_SCALAR, AUTO_SET_FIRST, NUMERIC_RESULT}, /* OP_MAX */ - {"max", NUMERIC_SCALAR, AUTO_SET_FIRST, GROUPING_MODE, NUMERIC_RESULT}, + {NUMERIC_SCALAR, AUTO_SET_FIRST, NUMERIC_RESULT}, /* OP_ABSMIN */ - {"absmin", NUMERIC_SCALAR, AUTO_SET_FIRST, GROUPING_MODE, NUMERIC_RESULT}, + {NUMERIC_SCALAR, AUTO_SET_FIRST, NUMERIC_RESULT}, /* OP_ABSMAX */ - {"absmax", NUMERIC_SCALAR, AUTO_SET_FIRST, GROUPING_MODE, NUMERIC_RESULT}, + {NUMERIC_SCALAR, AUTO_SET_FIRST, NUMERIC_RESULT}, /* OP_FIRST */ - {"first", STRING_SCALAR, IGNORE_FIRST, GROUPING_MODE, STRING_RESULT}, + {STRING_SCALAR, IGNORE_FIRST, STRING_RESULT}, /* OP_LAST */ - {"last", STRING_SCALAR, IGNORE_FIRST, GROUPING_MODE, STRING_RESULT}, + {STRING_SCALAR, IGNORE_FIRST, STRING_RESULT}, /* OP_RAND */ - {"rand", STRING_SCALAR, IGNORE_FIRST, GROUPING_MODE, STRING_RESULT}, + {STRING_SCALAR, IGNORE_FIRST, STRING_RESULT}, /* OP_MEAN */ - {"mean", NUMERIC_SCALAR, IGNORE_FIRST, GROUPING_MODE, NUMERIC_RESULT}, + {NUMERIC_SCALAR, IGNORE_FIRST, NUMERIC_RESULT}, /* OP_MEDIAN */ - {"median", NUMERIC_VECTOR, IGNORE_FIRST, GROUPING_MODE, NUMERIC_RESULT}, + {NUMERIC_VECTOR, IGNORE_FIRST, NUMERIC_RESULT}, /* OP_QUARTILE_1 */ - {"q1", NUMERIC_VECTOR, IGNORE_FIRST, GROUPING_MODE, NUMERIC_RESULT}, + {NUMERIC_VECTOR, IGNORE_FIRST, NUMERIC_RESULT}, /* OP_QUARTILE_3 */ - {"q3", NUMERIC_VECTOR, IGNORE_FIRST, GROUPING_MODE, NUMERIC_RESULT}, + {NUMERIC_VECTOR, IGNORE_FIRST, NUMERIC_RESULT}, /* OP_IQR */ - {"iqr", NUMERIC_VECTOR, IGNORE_FIRST, GROUPING_MODE, NUMERIC_RESULT}, + {NUMERIC_VECTOR, IGNORE_FIRST, NUMERIC_RESULT}, /* OP_PSTDEV */ - {"pstdev", NUMERIC_VECTOR, IGNORE_FIRST, GROUPING_MODE, NUMERIC_RESULT}, + {NUMERIC_VECTOR, IGNORE_FIRST, NUMERIC_RESULT}, /* OP_SSTDEV */ - {"sstdev", NUMERIC_VECTOR, IGNORE_FIRST, GROUPING_MODE, NUMERIC_RESULT}, + {NUMERIC_VECTOR, IGNORE_FIRST, NUMERIC_RESULT}, /* OP_PVARIANCE */ - {"pvar", NUMERIC_VECTOR, IGNORE_FIRST, GROUPING_MODE, NUMERIC_RESULT}, + {NUMERIC_VECTOR, IGNORE_FIRST, NUMERIC_RESULT}, /* OP_SVARIANCE */ - {"svar", NUMERIC_VECTOR, IGNORE_FIRST, GROUPING_MODE, NUMERIC_RESULT}, + {NUMERIC_VECTOR, IGNORE_FIRST, NUMERIC_RESULT}, /* OP_MAD */ - {"mad", NUMERIC_VECTOR, IGNORE_FIRST, GROUPING_MODE, NUMERIC_RESULT}, + {NUMERIC_VECTOR, IGNORE_FIRST, NUMERIC_RESULT}, /* OP_MADRAW */ - {"madraw", NUMERIC_VECTOR, IGNORE_FIRST, GROUPING_MODE, NUMERIC_RESULT}, + {NUMERIC_VECTOR, IGNORE_FIRST, NUMERIC_RESULT}, /* OP_S_SKEWNESS */ - {"sskew", NUMERIC_VECTOR, IGNORE_FIRST, GROUPING_MODE, NUMERIC_RESULT}, + {NUMERIC_VECTOR, IGNORE_FIRST, NUMERIC_RESULT}, /* OP_P_SKEWNESS */ - {"pskew", NUMERIC_VECTOR, IGNORE_FIRST, GROUPING_MODE, NUMERIC_RESULT}, + {NUMERIC_VECTOR, IGNORE_FIRST, NUMERIC_RESULT}, /* OP_S_EXCESS_KURTOSIS */ - {"skurt", NUMERIC_VECTOR, IGNORE_FIRST, GROUPING_MODE, NUMERIC_RESULT}, + {NUMERIC_VECTOR, IGNORE_FIRST, NUMERIC_RESULT}, /* OP_P_EXCESS_KURTOSIS */ - {"pkurt", NUMERIC_VECTOR, IGNORE_FIRST, GROUPING_MODE, NUMERIC_RESULT}, + {NUMERIC_VECTOR, IGNORE_FIRST, NUMERIC_RESULT}, /* OP_JARQUE_BETA */ - {"jarque", NUMERIC_VECTOR, IGNORE_FIRST, GROUPING_MODE, NUMERIC_RESULT}, + {NUMERIC_VECTOR, IGNORE_FIRST, NUMERIC_RESULT}, /* OP_DP_OMNIBUS */ - {"dpo", NUMERIC_VECTOR, IGNORE_FIRST, GROUPING_MODE, NUMERIC_RESULT}, + {NUMERIC_VECTOR, IGNORE_FIRST, NUMERIC_RESULT}, /* OP_MODE */ - {"mode", NUMERIC_VECTOR, IGNORE_FIRST, GROUPING_MODE, NUMERIC_RESULT}, + {NUMERIC_VECTOR, IGNORE_FIRST, NUMERIC_RESULT}, /* OP_ANTIMODE */ - {"antimode",NUMERIC_VECTOR, IGNORE_FIRST, GROUPING_MODE, NUMERIC_RESULT}, + {NUMERIC_VECTOR, IGNORE_FIRST, NUMERIC_RESULT}, /* OP_UNIQUE */ - {"unique", STRING_VECTOR, IGNORE_FIRST, GROUPING_MODE, STRING_RESULT}, + {STRING_VECTOR, IGNORE_FIRST, STRING_RESULT}, /* OP_COLLAPSE */ - {"collapse",STRING_VECTOR, IGNORE_FIRST, GROUPING_MODE, STRING_RESULT}, + {STRING_VECTOR, IGNORE_FIRST, STRING_RESULT}, /* OP_COUNT_UNIQUE */ - {"countunique",STRING_VECTOR, IGNORE_FIRST, GROUPING_MODE, NUMERIC_RESULT}, - /* OP_TRANSPOSE */ - {"transpose",STRING_SCALAR, IGNORE_FIRST, TRANSPOSE_MODE, STRING_RESULT}, - /* OP_REVERSE */ - {"reverse", STRING_SCALAR, IGNORE_FIRST, REVERSE_FIELD_MODE, STRING_RESULT}, + {STRING_VECTOR, IGNORE_FIRST, NUMERIC_RESULT}, /* OP_BASE64 */ - {"base64", STRING_SCALAR, IGNORE_FIRST, LINE_MODE, STRING_RESULT}, + {STRING_SCALAR, IGNORE_FIRST, STRING_RESULT}, /* OP_DEBASE64 */ - {"debase64",STRING_SCALAR, IGNORE_FIRST, LINE_MODE, STRING_RESULT}, + {STRING_SCALAR, IGNORE_FIRST, STRING_RESULT}, /* OP_MD5 */ - {"md5", STRING_SCALAR, IGNORE_FIRST, LINE_MODE, STRING_RESULT}, + {STRING_SCALAR, IGNORE_FIRST, STRING_RESULT}, /* OP_SHA1 */ - {"sha1", STRING_SCALAR, IGNORE_FIRST, LINE_MODE, STRING_RESULT}, + {STRING_SCALAR, IGNORE_FIRST, STRING_RESULT}, /* OP_SHA256 */ - {"sha256", STRING_SCALAR, IGNORE_FIRST, LINE_MODE, STRING_RESULT}, + {STRING_SCALAR, IGNORE_FIRST, STRING_RESULT}, /* OP_SHA512 */ - {"sha512", STRING_SCALAR, IGNORE_FIRST, LINE_MODE, STRING_RESULT}, - /* OP_REMOVE_DUPS */ - {"rmdup", STRING_SCALAR, IGNORE_FIRST, REMOVE_DUPS_MODE, STRING_RESULT}, - /* OP_NOOP */ - {"noop", STRING_SCALAR, IGNORE_FIRST, NOOP_MODE, STRING_RESULT}, - {NULL, 0, 0, UNKNOWN_MODE, NUMERIC_RESULT} -}; - -const char* operation_mode_name[] = { - "(unknown)", /* UNKNOWN_MODE */ - "grouping", /* GROUPING_MODE */ - "transpose", /* TRANSPOSE_MODE */ - "line", /* REMOVE-DUPS MODE - shown as 'line' mode */ - "reverse", /* REVERSE_FIELD_MODE */ - "line", /* LINE_MODE */ - "no-op", /* NO-OP MODE - for testing */ + {STRING_SCALAR, IGNORE_FIRST, STRING_RESULT}, + /* OP_P_COVARIANCE */ + {NUMERIC_VECTOR, IGNORE_FIRST, NUMERIC_RESULT}, + /* OP_S_COVARIANCE */ + {NUMERIC_VECTOR, IGNORE_FIRST, NUMERIC_RESULT}, + /* OP_P_PEARSON_COR */ + {NUMERIC_VECTOR, IGNORE_FIRST, NUMERIC_RESULT}, + /* OP_S_PEARSON_COR */ + {NUMERIC_VECTOR, IGNORE_FIRST, NUMERIC_RESULT}, + /* OP_BIN_BUCKETS */ + {NUMERIC_SCALAR, IGNORE_FIRST, NUMERIC_RESULT}, + /* OP_STRBIN */ + {STRING_SCALAR, IGNORE_FIRST, NUMERIC_RESULT}, + /* OP_FLOOR */ + {NUMERIC_SCALAR, IGNORE_FIRST, NUMERIC_RESULT}, + /* OP_CEIL */ + {NUMERIC_SCALAR, IGNORE_FIRST, NUMERIC_RESULT}, + /* OP_ROUND */ + {NUMERIC_SCALAR, IGNORE_FIRST, NUMERIC_RESULT}, + /* OP_TRUNCATE */ + {NUMERIC_SCALAR, IGNORE_FIRST, NUMERIC_RESULT}, + /* OP_FRACTION */ + {NUMERIC_SCALAR, IGNORE_FIRST, NUMERIC_RESULT}, + {0, 0, NUMERIC_RESULT} }; -struct fieldop* field_ops = NULL; +//struct fieldop* field_ops = NULL; enum { VALUES_BATCH_INCREMENT = 1024 }; -/* The character used to separate collapsed/uniqued strings */ -static char collapse_separator = ','; - - /* Add a numeric value to the values vector, allocating memory as needed */ -void +static void field_op_add_value (struct fieldop *op, long double val) { if (op->num_values >= op->alloc_values) @@ -183,7 +180,8 @@ } } -void +/* stores the hexadecimal representation of 'buffer' in op->out_buf */ +static void field_op_to_hex ( struct fieldop* op, const char *buffer, const size_t inlen ) { static const char hex_digits[] = @@ -248,7 +246,7 @@ The returned pointer will have 'op->count+1' elements, pointing to 'op->count' strings + one last NULL. */ -const char ** +static const char ** field_op_get_string_ptrs ( struct fieldop *op, bool sort, bool sort_case_sensitive ) { @@ -276,119 +274,53 @@ } /* Sort the numeric values vector in a fieldop structure */ -void +static void field_op_sort_values (struct fieldop *op) { qsortfl (op->values, op->num_values); } -/* Converts a string to number (field number). - Exits with an error message (using 'op') on invalid field number. */ -static size_t -try_get_field_number (enum operation op, const char* field_str) -{ - long int val; - char *endptr; - if (strlen (field_str)==0) - error (EXIT_FAILURE, 0, _("invalid empty column for operation %s"), - quote (operations[op].name)); - - errno = 0 ; - val = strtol (field_str, &endptr, 10); - /* If conversion to a number failed, assume this is a named column, - which will require a header line - defer error detection for later, - after we read the first line of the file. */ - if (errno != 0 || endptr == field_str - || endptr == NULL || *endptr != 0) - return 0; - - if (val<1) - error (EXIT_FAILURE, 0, _("invalid column '%s' for operation %s"), - field_str,quote (operations[op].name)); - return (size_t)val; -} - - -/* Allocate a new fieldop, initialize it based on 'oper', - and add it to the linked-list of operations */ -struct fieldop * -new_field_op (enum operation oper, const char* field_name) +void +field_op_init (struct fieldop* /*out*/ op, + enum field_operation oper, + bool by_name, size_t num, const char* name) { - struct fieldop *op = XZALLOC (struct fieldop); + assert (op != NULL); /* LCOV_EXCL_LINE */ + memset (op, 0, sizeof *op); op->op = oper; op->acc_type = operations[oper].acc_type; op->res_type = operations[oper].res_type; - op->name = operations[oper].name; op->numeric = (op->acc_type == NUMERIC_SCALAR || op->acc_type == NUMERIC_VECTOR); op->auto_first = operations[oper].auto_first; + op->slave = false; + op->slave_op = NULL; - op->field = try_get_field_number (oper, field_name); - if (op->field == 0) - { - op->field_by_name = true; - op->field_name = xstrdup (field_name); - } - else - { - op->field_by_name = false; - op->field_name = NULL; - } + op->field = num; + op->field_by_name = by_name; + op->field_name = (by_name)?xstrdup (name):NULL; op->first = true; - op->value = 0; - op->count = 0; - - op->next = NULL; - if (op->res_type == STRING_RESULT) { op->out_buf_alloc = 1024; op->out_buf = xmalloc (op->out_buf_alloc); } - op->out_buf_used = 0 ; - - if (field_ops != NULL) - { - struct fieldop *p = field_ops; - while (p->next != NULL) - p = p->next; - p->next = op; - } - else - field_ops = op; - - return op; } -/* returns TRUE if any of the configured fields was using - a named column, therefore requiring a header line. */ -bool _GL_ATTRIBUTE_PURE -field_op_have_named_fields () -{ - for (struct fieldop *p = field_ops; p ; p=p->next) - { - if (p->field_by_name) - return true; - } - return false; -} - -void -field_op_find_named_columns () +/* Ensure this (master) fieldop has the same number of values as + as it's slave fieldop. */ +static void +verify_slave_num_values (const struct fieldop *op) { - for (struct fieldop *p = field_ops; p ; p=p->next) - { - if (!p->field_by_name) - continue; + assert (op && !op->slave && op->slave_op); /* LCOV_EXCL_LINE */ - p->field = get_input_field_number (p->field_name); - if (p->field == 0) - error (EXIT_FAILURE, 0, - _("column name %s not found in input file"), - quote (p->field_name)); - p->field_by_name = false; - } + if (op->num_values != op->slave_op->num_values) + error (EXIT_FAILURE, 0, _("input error for operation %s: \ +fields %"PRIuMAX",%"PRIuMAX" have different number of items"), + quote (get_field_operation_name (op->op)), + (uintmax_t)op->slave_op->field, + (uintmax_t)op->field); } /* Add a value (from input) to the current field operation. */ @@ -437,7 +369,7 @@ if (op->first && op->auto_first && op->numeric) op->value = num_value; - switch (op->op) + switch (op->op) /* LCOV_EXCL_BR_LINE */ { case OP_SUM: case OP_MEAN: @@ -547,6 +479,10 @@ case OP_DP_OMNIBUS: case OP_MODE: case OP_ANTIMODE: + case OP_P_COVARIANCE: + case OP_S_COVARIANCE: + case OP_P_PEARSON_COR: + case OP_S_PEARSON_COR: field_op_add_value (op, num_value); break; @@ -556,10 +492,46 @@ field_op_add_string (op, str, slen); break; - case OP_REVERSE: - case OP_TRANSPOSE: - case OP_REMOVE_DUPS: - case OP_NOOP: + case OP_BIN_BUCKETS: + { + const long double val = num_value / op->params.bin_bucket_size; + modfl (val, & op->value); + /* signbit will take care of negative-zero as well. */ + if (signbit (op->value)) + --op->value; + op->value *= op->params.bin_bucket_size; + } + break; + + case OP_STRBIN: + op->value = hash_pjw_bare (str,slen) % (op->params.strbin_bucket_size); + break; + + case OP_FLOOR: + op->value = pos_zero (floorl (num_value)); + break; + + case OP_CEIL: + op->value = pos_zero (ceill (num_value)); + break; + + case OP_ROUND: + op->value = pos_zero (roundl (num_value)); + break; + + case OP_TRUNCATE: + modfl (num_value, &op->value); + op->value = pos_zero (op->value); + break; + + case OP_FRACTION: + { + long double dummy; + op->value = pos_zero (modfl (num_value, &dummy)); + }; + break; + + case OP_INVALID: default: /* Should never happen */ internal_error ("bad op"); /* LCOV_EXCL_LINE */ @@ -570,9 +542,9 @@ return rc; } -/* Returns a nul-terimated string, composed of the unique values - of the input strings. The return string must be free'd. */ -void +/* creates a list of unique strings from op->str_buf . + results are stored in op->out_buf. */ +static void unique_value ( struct fieldop *op, bool case_sensitive ) { const char *last_str; @@ -654,12 +626,16 @@ buf[i] = collapse_separator ; } -void +/* stores in op->out_buf the result of the field operation + when there are no input values. + 'no values' can happen with '--narm' and input of all N/As. + The printed results are consistent as much as possible with R */ +static void field_op_summarize_empty (struct fieldop *op) { long double numeric_result = 0 ; - switch (op->op) + switch (op->op) /* LCOV_EXCL_BR_LINE */ { case OP_MEAN: case OP_S_SKEWNESS: @@ -680,6 +656,17 @@ case OP_SVARIANCE: case OP_MODE: case OP_ANTIMODE: + case OP_P_COVARIANCE: + case OP_S_COVARIANCE: + case OP_P_PEARSON_COR: + case OP_S_PEARSON_COR: + case OP_BIN_BUCKETS: + case OP_STRBIN: + case OP_FLOOR: + case OP_CEIL: + case OP_ROUND: + case OP_TRUNCATE: + case OP_FRACTION: numeric_result = nanl (""); break; @@ -718,20 +705,18 @@ strcpy (op->out_buf, ""); break; - - case OP_TRANSPOSE: /* not handled here */ - case OP_REVERSE: /* not handled here */ - case OP_REMOVE_DUPS: - case OP_NOOP: + case OP_INVALID: default: /* Should never happen */ internal_error ("bad op"); /* LCOV_EXCL_LINE */ } if (op->res_type==NUMERIC_RESULT) - printf ("%.*Lg", field_op_output_precision, numeric_result); - else - printf ("%s", op->out_buf); + { + field_op_reserve_out_buf (op, numeric_output_precision*2); + snprintf (op->out_buf, op->out_buf_alloc, + "%.*Lg", numeric_output_precision, numeric_result); + } } /* Prints to stdout the result of the field operation, @@ -745,9 +730,12 @@ /* In case of no values, each operation returns a specific result. 'no values' can happen with '--narm' and input of all N/As. */ if (op->count==0) - return field_op_summarize_empty (op); + { + field_op_summarize_empty (op); + return ; + } - switch (op->op) + switch (op->op) /* LCOV_EXCL_BR_LINE */ { case OP_MEAN: numeric_result = op->value / op->count; @@ -759,6 +747,13 @@ case OP_MAX: case OP_ABSMIN: case OP_ABSMAX: + case OP_BIN_BUCKETS: + case OP_STRBIN: + case OP_FLOOR: + case OP_CEIL: + case OP_ROUND: + case OP_TRUNCATE: + case OP_FRACTION: /* no summarization for these operations, just print the value */ numeric_result = op->value; break; @@ -849,6 +844,28 @@ op->num_values ); break; + case OP_P_COVARIANCE: + case OP_S_COVARIANCE: + assert (!op->slave); /* LCOV_EXCL_LINE */ + assert (op->slave_op); /* LCOV_EXCL_LINE */ + verify_slave_num_values (op); + numeric_result = covariance_value (op->values, op->slave_op->values, + op->num_values, + (op->op==OP_P_COVARIANCE)? + DF_POPULATION:DF_SAMPLE ); + break; + + case OP_P_PEARSON_COR: + case OP_S_PEARSON_COR: + assert (!op->slave); /* LCOV_EXCL_LINE */ + assert (op->slave_op); /* LCOV_EXCL_LINE */ + verify_slave_num_values (op); + numeric_result = pearson_corr_value (op->values, op->slave_op->values, + op->num_values, + (op->op==OP_P_PEARSON_COR)? + DF_POPULATION:DF_SAMPLE); + break; + case OP_MODE: case OP_ANTIMODE: field_op_sort_values (op); @@ -900,24 +917,23 @@ field_op_to_hex (op, tmpbuf, 64); break; - case OP_TRANSPOSE: /* not handled here */ - case OP_REVERSE: /* not handled here */ - case OP_REMOVE_DUPS: - case OP_NOOP: + case OP_INVALID: default: /* Should never happen */ internal_error ("bad op"); /* LCOV_EXCL_LINE */ } if (op->res_type==NUMERIC_RESULT) - printf ("%.*Lg", field_op_output_precision, numeric_result); - else - printf ("%s", op->out_buf); + { + field_op_reserve_out_buf (op, numeric_output_precision*2); + snprintf (op->out_buf, op->out_buf_alloc, + "%.*Lg", numeric_output_precision, numeric_result); + } } /* reset operation values for next group */ void -reset_field_op (struct fieldop *op) +field_op_reset (struct fieldop *op) { op->first = true; op->count = 0 ; @@ -928,18 +944,8 @@ /* note: op->str_buf and op->str_alloc are not free'd, and reused */ } -/* reset all field operations, for next group */ void -reset_field_ops () -{ - for (struct fieldop *p = field_ops; p ; p = p->next) - reset_field_op (p); -} - -/* Frees all memory associated with a field operation struct. - returns the 'next' field operation, or NULL */ -static void -free_field_op (struct fieldop *op) +field_op_free (struct fieldop* op) { free (op->values); op->num_values = 0 ; @@ -957,107 +963,6 @@ free (op->field_name); op->field_name = NULL; - - free (op); -} - -void -free_field_ops () -{ - struct fieldop *p = field_ops; - while (p) - { - struct fieldop *n = p->next; - free_field_op (p); - p = n; - } -} - -/* Given a string with operation name, returns the operation enum. - exits with an error message if the string is not a valid/known operation. */ -enum operation -get_operation (const char* keyword) -{ - for (size_t i = 0; operations[i].name ; i++) - if ( STREQ (operations[i].name, keyword) ) - return (enum operation)i; - - error (EXIT_FAILURE, 0, _("invalid operation '%s'"), keyword); - return 0; /* never reached LCOV_EXCL_LINE */ -} - -/* Extract the operation patterns from args START through ARGC - 1 of ARGV. */ -void -parse_operations (enum operation_mode mode, int argc, int start, char **argv) -{ - int i = start; /* Index into ARGV. */ - enum operation op; - - /* From here on, by default we assume it's a "groupby" operation */ - while ( i < argc ) - { - op = get_operation (argv[i]); - if (operations[op].mode != mode) - error (EXIT_FAILURE, 0, _("conflicting operation found: "\ - "expecting %s operations, but found %s operation %s"), - operation_mode_name[mode], - operation_mode_name[operations[op].mode], - quote (operations[op].name)); - - i++; - if ( i >= argc ) - error (EXIT_FAILURE, 0, _("missing field number after " \ - "operation '%s'"), argv[i-1] ); - new_field_op (op, argv[i]); - i++; - } -} - -enum operation_mode -parse_operation_mode (int argc, int start, char** argv) -{ - assert (start < argc); /* LCOV_EXCL_LINE */ - - const enum operation op = get_operation ( argv[start] ); - const enum operation_mode om = operations[op].mode; - switch (om) - { - case TRANSPOSE_MODE: - case REVERSE_FIELD_MODE: - case NOOP_MODE: - if ( start+1 < argc ) - error (EXIT_FAILURE, 0, _("extra operands after '%s'"), argv[start]); - break; - - case REMOVE_DUPS_MODE: - case LINE_MODE: - case GROUPING_MODE: - /* parse individual operations */ - parse_operations (om, argc, start, argv); - break; - - case UNKNOWN_MODE: - default: - internal_error ("unknown mode"); /* LCOV_EXCL_LINE */ - } - - return om; -} - -void -summarize_field_ops () -{ - for (struct fieldop *p = field_ops; p ; p=p->next) - { - field_op_summarize (p); - - /* print field separator */ - if (p->next) - print_field_separator (); - } - - /* print end-of-line */ - print_line_separator (); } /* long mix function, from: @@ -1088,17 +993,28 @@ const char* field_op_collect_result_name (const enum FIELD_OP_COLLECT_RESULT flocr) { - switch (flocr) + switch (flocr) /* LCOV_EXCL_BR_LINE */ { case FLOCR_INVALID_NUMBER: return _("invalid numeric value"); case FLOCR_INVALID_BASE64: return _("invalid base64 value"); - case FLOCR_OK: /* LCOV_EXCL_LINE */ - case FLOCR_OK_KEEP_LINE: /* LCOV_EXCL_LINE */ - case FLOCR_OK_SKIPPED: /* LCOV_EXCL_LINE */ - default: /* LCOV_EXCL_LINE */ - assert (false); /* LCOV_EXCL_LINE */ - return ""; /* LCOV_EXCL_LINE */ + case FLOCR_OK: + case FLOCR_OK_KEEP_LINE: + case FLOCR_OK_SKIPPED: + default: + internal_error ("op_collect_result_name"); /* LCOV_EXCL_LINE */ + return ""; /* LCOV_EXCL_LINE */ } } + +void +field_op_print_empty_value (enum field_operation mode) +{ + struct fieldop op; + memset (&op, 0, sizeof op); + op.op = mode; + op.res_type = NUMERIC_RESULT; + field_op_summarize_empty (&op); + fputs (op.out_buf, stdout); +} diff -Nru datamash-1.0.7/src/field-ops.h datamash-1.1.1/src/field-ops.h --- datamash-1.0.7/src/field-ops.h 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/src/field-ops.h 2017-01-17 17:50:20.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2015 Assaf Gordon + Copyright (C) 2013-2017 Assaf Gordon This file is part of GNU Datamash. @@ -26,52 +26,6 @@ Operations Module */ -enum operation -{ - OP_COUNT = 0, - OP_SUM, - OP_MIN, - OP_MAX, - OP_ABSMIN, - OP_ABSMAX, - OP_FIRST, - OP_LAST, - OP_RAND, - OP_MEAN, - OP_MEDIAN, - OP_QUARTILE_1, - OP_QUARTILE_3, - OP_IQR, /* Inter-quartile range */ - OP_PSTDEV, /* Population Standard Deviation */ - OP_SSTDEV, /* Sample Standard Deviation */ - OP_PVARIANCE, /* Population Variance */ - OP_SVARIANCE, /* Sample Variance */ - OP_MAD, /* MAD - Median Absolute Deviation, with adjustment constant of - 1.4826 for normal distribution */ - OP_MADRAW, /* MAD (same as above), with constant=1 */ - OP_S_SKEWNESS,/* Sample Skewness */ - OP_P_SKEWNESS,/* Population Skewness */ - OP_S_EXCESS_KURTOSIS, /* Sample Excess Kurtosis */ - OP_P_EXCESS_KURTOSIS, /* Population Excess Kurtosis */ - OP_JARQUE_BERA, /* Jarque-Bera test of normality */ - OP_DP_OMNIBUS, /* D'Agostino-Pearson omnibus test of normality */ - OP_MODE, - OP_ANTIMODE, - OP_UNIQUE, /* Collapse Unique string into comma separated values */ - OP_COLLAPSE, /* Collapse strings into comma separated values */ - OP_COUNT_UNIQUE, /* count number of unique values */ - OP_TRANSPOSE, /* transpose */ - OP_REVERSE, /* reverse fields in each line */ - OP_BASE64, /* Encode Field to Base64 */ - OP_DEBASE64, /* Decode Base64 field */ - OP_MD5, /* Calculate MD5 of a field */ - OP_SHA1, /* Calculate SHA1 of a field */ - OP_SHA256, /* Calculate SHA256 of a field */ - OP_SHA512, /* Calculate SHA512 of a field */ - OP_REMOVE_DUPS, /* Remove duplicated keys from a file */ - OP_NOOP /* Do nothing. Used for testing and profiling */ -}; - enum accumulation_type { NUMERIC_SCALAR = 0, @@ -92,17 +46,6 @@ IGNORE_FIRST = false }; -enum operation_mode -{ - UNKNOWN_MODE = 0, - GROUPING_MODE, - TRANSPOSE_MODE, - REMOVE_DUPS_MODE, - REVERSE_FIELD_MODE, - LINE_MODE, - NOOP_MODE -}; - enum FIELD_OP_COLLECT_RESULT { FLOCR_OK = 0, @@ -112,33 +55,27 @@ FLOCR_INVALID_BASE64 }; -#define field_op_ok(X) \ - (((X)==FLOCR_OK)||((X)==FLOCR_OK_KEEP_LINE)||((X)==FLOCR_OK_SKIPPED)) - -const char* -field_op_collect_result_name (const enum FIELD_OP_COLLECT_RESULT flocr); - struct operation_data { - const char* name; enum accumulation_type acc_type; enum operation_first_value auto_first; - enum operation_mode mode; enum operation_result_type res_type; }; -extern struct operation_data operations[]; - /* Operation on a field */ struct fieldop { /* operation 'class' information */ - enum operation op; + enum field_operation op; enum accumulation_type acc_type; enum operation_result_type res_type; - const char* name; bool numeric; bool auto_first; /* if true, automatically set 'value' if 'first' */ + bool master; /* if true, this field_op uses another as a slave */ + bool slave; /* if true, not used directly, but referenced by + another field_op */ + size_t slave_idx; + struct fieldop* slave_op; /* Instance information */ size_t field; /* field number. 1 = first field in input file. */ @@ -147,6 +84,10 @@ is loaded */ char* field_name; + union { + long double bin_bucket_size; + size_t strbin_bucket_size; + } params; /* Collected Data */ bool first; /* true if this is the first item in a new group */ @@ -166,38 +107,24 @@ size_t str_buf_used; /* number of bytes used in the buffer */ size_t str_buf_alloc; /* number of bytes allocated in the buffer */ - /* Output buffer for line operations (md5/sha1/256/512/base64) */ + /* Output buffer containing the final results of an operation, + set by 'summarize' functions. + also used for line operations (md5/sha1/256/512/base64). */ char *out_buf; size_t out_buf_used; size_t out_buf_alloc; - - struct fieldop *next; }; -extern struct fieldop* field_ops ; - -/* Add a numeric value to the values vector, allocating memory as needed */ -void field_op_add_value (struct fieldop *op, long double val); - -/* Returns an array of string-pointers (char*), - each pointing to a string in the string buffer - (added by field_op_add_string ). - - The returned pointer must be free'd. - - The returned pointer will have 'op->count+1' elements, - pointing to 'op->count' strings + one last NULL. -*/ -const char ** field_op_get_string_ptrs ( struct fieldop *op, - bool sort, bool sort_case_sensitive ); - -/* Sort the numeric values vector in a fieldop structure */ -void field_op_sort_values (struct fieldop *op); +/* Initializes a new field-op, using an *existing* (pre-allocated) struct. */ +void +field_op_init (struct fieldop* /*in-out*/ op, + enum field_operation oper, + bool by_name, size_t num, const char* name); -/* Allocate a new fieldop, initialize it based on 'oper', - and add it to the linked-list of operations */ -struct fieldop * -new_field_op (enum operation oper, const char* field_name); +/* Frees the internal structures in the field-op. + Does *not* free 'op' itself */ +void +field_op_free (struct fieldop* op); /* Add a value (from input) to the current field operation. 'str' does not need to be null-terminated. @@ -208,63 +135,29 @@ enum FIELD_OP_COLLECT_RESULT field_op_collect (struct fieldop *op, const char* str, size_t slen); +/* Evaluates to true/false depending if the value returned from + field_op_collect represents a successful operation. */ +#define field_op_ok(X) \ + (((X)==FLOCR_OK)||((X)==FLOCR_OK_KEEP_LINE)||((X)==FLOCR_OK_SKIPPED)) -/* creates a list of unique strings from op->str_buf . - results are stored in op->out_buf. */ -void -unique_value ( struct fieldop *op, bool case_sensitive ); +/* If field_op_ok returned false, this function will return a textual + error message of the error. The returned value is a static string, + do not free it. */ +const char* +field_op_collect_result_name (const enum FIELD_OP_COLLECT_RESULT flocr); -/* stores the hexadecimal representation of 'buffer' in op->out_buf */ -void -field_op_to_hex ( struct fieldop *op, const char *buffer, const size_t inlen ); -/* Prints to stdout the result of the field operation, - based on collected values */ +/* Called after all values in a group are collected in a field-op, + to perform any (optional) finalizing steps + (e.g. in OP_MEAN, calculate the mean). + Result will be stored in op->out_buf. */ void field_op_summarize (struct fieldop *op); -/* Prints to stdout the result of the field operation - when there are no input values. - 'no values' can happen with '--narm' and input of all N/As. - The printed results are consistent as much as possible with R */ -void -field_op_summarize_empty (struct fieldop *op); - -void -summarize_field_ops (); - -void -reset_field_ops (); - +/* resets internal variables, should be called when starting a new + group of values. */ void -free_field_ops (); - -/* -enum operation_mode -get_operation_mode (const char* keyword); -*/ -enum operation -get_operation (const char* keyword); - -/* Extract the operation patterns from args START through ARGC - 1 of ARGV. - Requires all operation to be of 'mode' - otherwise exits with an error. - */ -void -parse_operations (enum operation_mode mode, int argc, int start, char **argv); - -/* Extract the operation mode based on the first keyword. - Possible modes are: - transpose - reverse (reverse fields) - line mode - grouping - depending on the 'operation_mode' of the first operation keyword - found. - - In grouping/line modes, - calls 'parse_operations' to set the indivudual operaitons. */ -enum operation_mode -parse_operation_mode (int argc, int start, char** argv); +field_op_reset (struct fieldop *op); /* Output precision, to be used with "printf ("%.*Lg",)" */ extern int field_op_output_precision; @@ -273,16 +166,10 @@ void init_random (void); - -/* returns TRUE if any of the configured fields was using - a named column, therefore requiring a header line. */ -bool -field_op_have_named_fields (); - -/* Tries to find the column number for operations using - a named column (instead of a number) */ +/* Helper function to print to stdout the 'empty value' of a numeric + operation (e.g. what's printed by 'OP_MEAN' with empty input). + Used in some of the tests. */ void -field_op_find_named_columns (); - +field_op_print_empty_value (enum field_operation mode); #endif diff -Nru datamash-1.0.7/src/op-defs.c datamash-1.1.1/src/op-defs.c --- datamash-1.0.7/src/op-defs.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/src/op-defs.c 2017-01-17 17:50:20.000000000 +0000 @@ -0,0 +1,174 @@ +/* GNU Datamash - perform simple calculation on input data + + Copyright (C) 2013-2017 Assaf Gordon + + This file is part of GNU Datamash. + + GNU Datamash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + GNU Datamash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Datamash. If not, see . +*/ + +/* Written by Assaf Gordon */ +#include + +#include "system.h" + +#include "op-defs.h" + +struct field_operation_definition +{ + const char* name; + enum field_operation op; + enum processing_mode mode; /* The default mode implied by this operation */ +}; + +struct field_operation_definition field_operations[] = +{ + {"invalid", OP_INVALID, MODE_GROUPBY}, + {"count", OP_COUNT, MODE_GROUPBY}, + {"sum", OP_SUM, MODE_GROUPBY}, + {"min", OP_MIN, MODE_GROUPBY}, + {"max", OP_MAX, MODE_GROUPBY}, + {"absmin", OP_ABSMIN, MODE_GROUPBY}, + {"absmax", OP_ABSMAX, MODE_GROUPBY}, + {"first", OP_FIRST, MODE_GROUPBY}, + {"last", OP_LAST, MODE_GROUPBY}, + {"rand", OP_RAND, MODE_GROUPBY}, + {"mean", OP_MEAN, MODE_GROUPBY}, + {"median", OP_MEDIAN, MODE_GROUPBY}, + {"q1", OP_QUARTILE_1, MODE_GROUPBY}, + {"q3", OP_QUARTILE_3, MODE_GROUPBY}, + {"iqr", OP_IQR, MODE_GROUPBY}, + {"pstdev", OP_PSTDEV, MODE_GROUPBY}, + {"sstdev", OP_SSTDEV, MODE_GROUPBY}, + {"pvar", OP_PVARIANCE, MODE_GROUPBY}, + {"svar", OP_SVARIANCE, MODE_GROUPBY}, + {"mad", OP_MAD, MODE_GROUPBY}, + {"madraw", OP_MADRAW, MODE_GROUPBY}, + {"sskew", OP_S_SKEWNESS, MODE_GROUPBY}, + {"pskew", OP_P_SKEWNESS, MODE_GROUPBY}, + {"skurt", OP_S_EXCESS_KURTOSIS, MODE_GROUPBY}, + {"pkurt", OP_P_EXCESS_KURTOSIS, MODE_GROUPBY}, + {"jarque", OP_JARQUE_BERA, MODE_GROUPBY}, + {"dpo", OP_DP_OMNIBUS, MODE_GROUPBY}, + {"mode", OP_MODE, MODE_GROUPBY}, + {"antimode",OP_ANTIMODE,MODE_GROUPBY}, + {"unique", OP_UNIQUE, MODE_GROUPBY}, + {"collapse",OP_COLLAPSE,MODE_GROUPBY}, + {"countunique", OP_COUNT_UNIQUE, MODE_GROUPBY}, + {"base64", OP_BASE64, MODE_PER_LINE}, + {"debase64",OP_DEBASE64,MODE_PER_LINE}, + {"md5", OP_MD5, MODE_PER_LINE}, + {"sha1", OP_SHA1, MODE_PER_LINE}, + {"sha256", OP_SHA256, MODE_PER_LINE}, + {"sha512", OP_SHA512, MODE_PER_LINE}, + {"pcov", OP_P_COVARIANCE, MODE_GROUPBY}, + {"scov", OP_S_COVARIANCE, MODE_GROUPBY}, + {"ppearson",OP_P_PEARSON_COR, MODE_GROUPBY}, + {"spearson",OP_S_PEARSON_COR, MODE_GROUPBY}, + {"bin", OP_BIN_BUCKETS, MODE_PER_LINE}, + {"strbin", OP_STRBIN, MODE_PER_LINE}, + {"floor", OP_FLOOR, MODE_PER_LINE}, + {"ceil", OP_CEIL, MODE_PER_LINE}, + {"round", OP_ROUND, MODE_PER_LINE}, + {"trunc", OP_TRUNCATE, MODE_PER_LINE}, + {"frac", OP_FRACTION, MODE_PER_LINE}, + {NULL, OP_INVALID, MODE_INVALID} +}; + +struct processing_mode_definition +{ + const char* name; + enum processing_mode mode; +}; + +const struct processing_mode_definition processing_modes[] = +{ + {"invalid", MODE_INVALID}, + {"groupby", MODE_GROUPBY}, + {"grouping", MODE_GROUPBY}, + {"gb" , MODE_GROUPBY}, + {"transpose",MODE_TRANSPOSE}, + {"reverse", MODE_REVERSE}, + {"line", MODE_PER_LINE}, + {"dedup", MODE_REMOVE_DUPS}, + {"rmdup", MODE_REMOVE_DUPS}, + {"nop", MODE_NOOP}, + {"noop", MODE_NOOP}, + {"crosstab", MODE_CROSSTAB}, + {"ct", MODE_CROSSTAB}, + {"check", MODE_TABULAR_CHECK}, + {NULL, MODE_INVALID}, +}; + +enum field_operation +get_field_operation (const char* s, enum processing_mode* /*out*/ mode) +{ + const struct field_operation_definition* fod = field_operations; + while (fod->name) { + if (strcasecmp (fod->name, s)==0) + { + if (mode) + *mode = fod->mode; + return fod->op; + } + ++fod; + } + return OP_INVALID; +} + +const char* _GL_ATTRIBUTE_PURE +get_field_operation_name (enum field_operation op) +{ + const struct field_operation_definition* fod = field_operations; + while (fod->name) /* LCOV_EXCL_BR_LINE */ + { + if (fod->op == op) + return fod->name; + ++fod; + } + internal_error ("invalid op value"); /* LCOV_EXCL_LINE */ + return NULL; /* LCOV_EXCL_LINE */ +} + +enum processing_mode _GL_ATTRIBUTE_PURE +get_processing_mode (const char* s) +{ + const struct processing_mode_definition* pmd = processing_modes; + while (pmd->name) + { + if (strcasecmp (pmd->name, s)==0) + return pmd->mode; + ++pmd; + } + return MODE_INVALID; +} + +const char* _GL_ATTRIBUTE_PURE +get_processing_mode_name (enum processing_mode m) +{ + const struct processing_mode_definition* pmd = processing_modes; + while (pmd->name) /* LCOV_EXCL_BR_LINE */ + { + if (pmd->mode == m) + return pmd->name; + ++pmd; + } + internal_error ("invalid mode value"); /* LCOV_EXCL_LINE */ + return NULL; /* LCOV_EXCL_LINE */ +} + +/* vim: set cinoptions=>4,n-2,{2,^-2,:2,=2,g0,h2,p5,t0,+2,(0,u0,w1,m1: */ +/* vim: set shiftwidth=2: */ +/* vim: set tabstop=8: */ +/* vim: set expandtab: */ diff -Nru datamash-1.0.7/src/op-defs.h datamash-1.1.1/src/op-defs.h --- datamash-1.0.7/src/op-defs.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/src/op-defs.h 2017-01-17 17:50:20.000000000 +0000 @@ -0,0 +1,109 @@ +/* GNU Datamash - perform simple calculation on input data + + Copyright (C) 2013-2017 Assaf Gordon + + This file is part of GNU Datamash. + + GNU Datamash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + GNU Datamash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Datamash. If not, see . +*/ + +/* Written by Assaf Gordon */ +#ifndef __OPERATION_DEFINITONS_H__ +#define __OPERATION_DEFINITONS_H__ + +enum field_operation +{ + OP_INVALID = -1, + OP_COUNT = 0, + OP_SUM, + OP_MIN, + OP_MAX, + OP_ABSMIN, + OP_ABSMAX, + OP_FIRST, + OP_LAST, + OP_RAND, + OP_MEAN, + OP_MEDIAN, + OP_QUARTILE_1, + OP_QUARTILE_3, + OP_IQR, /* Inter-quartile range */ + OP_PSTDEV, /* Population Standard Deviation */ + OP_SSTDEV, /* Sample Standard Deviation */ + OP_PVARIANCE, /* Population Variance */ + OP_SVARIANCE, /* Sample Variance */ + OP_MAD, /* MAD - Median Absolute Deviation, with adjustment constant of + 1.4826 for normal distribution */ + OP_MADRAW, /* MAD (same as above), with constant=1 */ + OP_S_SKEWNESS,/* Sample Skewness */ + OP_P_SKEWNESS,/* Population Skewness */ + OP_S_EXCESS_KURTOSIS, /* Sample Excess Kurtosis */ + OP_P_EXCESS_KURTOSIS, /* Population Excess Kurtosis */ + OP_JARQUE_BERA, /* Jarque-Bera test of normality */ + OP_DP_OMNIBUS, /* D'Agostino-Pearson omnibus test of normality */ + OP_MODE, + OP_ANTIMODE, + OP_UNIQUE, /* Collapse Unique string into comma separated values */ + OP_COLLAPSE, /* Collapse strings into comma separated values */ + OP_COUNT_UNIQUE, /* count number of unique values */ + OP_BASE64, /* Encode Field to Base64 */ + OP_DEBASE64, /* Decode Base64 field */ + OP_MD5, /* Calculate MD5 of a field */ + OP_SHA1, /* Calculate SHA1 of a field */ + OP_SHA256, /* Calculate SHA256 of a field */ + OP_SHA512, /* Calculate SHA512 of a field */ + OP_P_COVARIANCE, /* Population Covariance */ + OP_S_COVARIANCE, /* Sample Covariance */ + OP_P_PEARSON_COR, /* Pearson Correlation Coefficient (population) */ + OP_S_PEARSON_COR, /* Pearson Correlation Coefficient (sample) */ + OP_BIN_BUCKETS, /* numeric binning operation */ + OP_STRBIN, /* String hash/binning */ + OP_FLOOR, /* Floor */ + OP_CEIL, /* Ceiling */ + OP_ROUND, /* Round */ + OP_TRUNCATE, /* Truncate */ + OP_FRACTION /* Fraction */ +}; + +enum processing_mode +{ + MODE_INVALID = -1, + MODE_GROUPBY = 0, /* Group By similar keys */ + MODE_TRANSPOSE, /* transpose */ + MODE_REVERSE, /* reverse fields in each line */ + MODE_PER_LINE, /* Operations on each line, no grouping */ + MODE_REMOVE_DUPS, /* Remove duplicated keys from a file */ + MODE_CROSSTAB, /* Cross tabulation (aka pivot tables) */ + MODE_TABULAR_CHECK, /* Verif the file has tabular format */ + MODE_NOOP /* Do nothing. Used for testing and profiling */ +}; + +/* Given a text string, returns the matching operation, or OP_INVALID. + if 'mode' is not NULL, stores the implied processing mode + (e.g. sum=>MODE_GROUPBY, md5=>MODE_PER_LINE). */ +enum field_operation +get_field_operation (const char* s, enum processing_mode* /*out*/ mode); + +const char* +get_field_operation_name (enum field_operation op); + +/* Given a text string, + returns the matching processing mode, or MODE_INVALID. */ +enum processing_mode +get_processing_mode (const char* s); + +const char* +get_processing_mode_name (enum processing_mode m); + +#endif diff -Nru datamash-1.0.7/src/op-parser.c datamash-1.1.1/src/op-parser.c --- datamash-1.0.7/src/op-parser.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/src/op-parser.c 2017-01-17 17:50:20.000000000 +0000 @@ -0,0 +1,722 @@ +/* GNU Datamash - perform simple calculation on input data + + Copyright (C) 2013-2017 Assaf Gordon + + This file is part of GNU Datamash. + + GNU Datamash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + GNU Datamash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Datamash. If not, see . +*/ + +/* Written by Assaf Gordon */ +#include +#include + +#include "system.h" + +#include "op-scanner.h" +#include "op-defs.h" +#include "op-parser.h" +#include "field-ops.h" + +static struct datamash_ops *dm = NULL; + +struct parser_field_t +{ + uintmax_t num; + bool by_name; + char* name; + bool range; + bool pair; +}; + +struct parser_param_t +{ + enum { + PARAM_INT, + PARAM_FLOAT + } type; + uintmax_t u; + long double f; +}; + +/* The currently parsed operation */ +static enum field_operation fop = OP_INVALID; + +/* The currently parsed fields */ +static struct parser_field_t *_fields; +static size_t _fields_alloc; +static size_t _fields_used; + +/* The currently parsed operation's parameters */ +static struct parser_param_t *_params; +static size_t _params_alloc; +static size_t _params_used; + + +static void +_alloc_ops () +{ + dm = XZALLOC (struct datamash_ops); + dm->mode = MODE_INVALID; + + _fields = NULL; + _fields_alloc = 0; + _fields_used = 0; + + _params = NULL; + _params_alloc = 0; + _params_used = 0; +} + +static void +reset_parsed_operation () +{ + fop = OP_INVALID; + + for (size_t i=0; i<_fields_used; ++i) + free (_fields[i].name); + + _fields_used = 0; + _params_used = 0; +} + +static struct parser_field_t* +alloc_next_field () +{ + if (_fields_used == _fields_alloc) + _fields = x2nrealloc (_fields, &_fields_alloc, + sizeof (struct parser_field_t)); + struct parser_field_t *p = &_fields[_fields_used++]; + memset (p, 0, sizeof (*p)); + return p; +} + +/* Evalutates to TRUE if operation X (=enum field_operation) + requires a paired field parameters (e.g. 1:2) */ +#define OP_NEED_PAIR_PARAMS(x) (((x)==OP_P_COVARIANCE)||\ + ((x)==OP_S_COVARIANCE)||\ + ((x)==OP_P_PEARSON_COR)||\ + ((x)==OP_S_PEARSON_COR)) + +#define ADD_NAMED_GROUP(name) (add_group_col (true,0,(name))) +#define ADD_NUMERIC_GROUP(num) (add_group_col (false,num,NULL)) +static void +add_group_col (bool by_name, size_t num, const char* name) +{ + if (dm->num_grps == dm->alloc_grps) + dm->grps = x2nrealloc (dm->grps, &dm->alloc_grps, sizeof *dm->grps); + struct group_column_t *p = &dm->grps[dm->num_grps++]; + + p->num = num; + p->name = NULL; + p->by_name = by_name; + if (by_name) + { + p->name = xstrdup (name); + dm->header_required = true; + } +} + +static struct fieldop * +add_op (enum field_operation op, const struct parser_field_t *f) +{ + if (dm->num_ops == dm->alloc_ops) + dm->ops = x2nrealloc (dm->ops, &dm->alloc_ops, sizeof *dm->ops); + struct fieldop *p = &dm->ops[dm->num_ops++]; + + if (f->by_name) + dm->header_required = true; + + #ifdef _STANDALONE_ + memset (p, 0, sizeof (struct fieldop)); + p->op = op; + p->field = f->num; + p->field_by_name = f->by_name; + p->field_name = f->name; + #else + field_op_init (p, op, f->by_name, f->num, f->name); + #endif + return p; +} + +static void +set_op_params (struct fieldop *op) +{ + if (op->op==OP_BIN_BUCKETS) + { + op->params.bin_bucket_size = 100; /* default bucket size */ + if (_params_used==1) + op->params.bin_bucket_size = _params[0].f; + /* TODO: in the future, accept offset as well? */ + if (_params_used>1) + error (EXIT_FAILURE, 0, _("too many parameters for operation %s"), + quote (get_field_operation_name (op->op))); + return; + } + + if (op->op==OP_STRBIN) + { + op->params.strbin_bucket_size = 10; /* default bucket size for strbin */ + if (_params_used==1) + op->params.strbin_bucket_size = _params[0].u; + if (op->params.strbin_bucket_size==0) + error (EXIT_FAILURE, 0, _("strbin bucket size must not be zero")); + /* TODO: in the future, accept offset as well? */ + if (_params_used>1) + error (EXIT_FAILURE, 0, _("too many parameters for operation %s"), + quote (get_field_operation_name (op->op))); + return; + } + + /* All other operations do not take parameters */ + if (_params_used>0) + error (EXIT_FAILURE, 0, _("too many parameters for operation %s"), + quote (get_field_operation_name (op->op))); +} + +static void +parse_simple_operation_column (struct parser_field_t /*OUTPUT*/ *p, + bool in_range, bool in_pair) +{ + assert (p); /* LCOV_EXCL_LINE */ + enum TOKEN tok = scanner_get_token (); + switch (tok) /* LCOV_EXCL_BR */ + { + case TOK_IDENTIFIER: + p->by_name = true; + p->name = xstrdup (scanner_identifier); + break; + + case TOK_WHITESPACE: + internal_error ("whitespace"); /* LCOV_EXCL_LINE */ + + case TOK_COMMA: + error (EXIT_FAILURE, 0, _("missing field for operation %s"), + quote (get_field_operation_name (fop))); + + case TOK_END: + /* informative error message depends on the context: */ + if (in_range) + error (EXIT_FAILURE, 0, _("invalid field range for operation %s"), + quote (get_field_operation_name (fop))); + if (in_pair) + error (EXIT_FAILURE, 0, _("invalid field pair for operation %s"), + quote (get_field_operation_name (fop))); + error (EXIT_FAILURE, 0, _("missing field for operation %s"), + quote (get_field_operation_name (fop))); + + case TOK_DASH: + error (EXIT_FAILURE, 0, _("invalid field range for operation %s"), + quote (get_field_operation_name (fop))); + + case TOK_COLONS: + error (EXIT_FAILURE, 0, _("invalid field pair for operation %s"), + quote (get_field_operation_name (fop))); + + case TOK_INTEGER: + /* Zero values will fall-thought to the error message below */ + if (scan_val_int>0) + { + p->by_name = false; + p->num = scan_val_int; + break; + } + + case TOK_FLOAT: + default: + error (EXIT_FAILURE, 0, _("invalid field '%s' for operation %s"), + scanner_identifier, + quote (get_field_operation_name (fop))); + } +} + +static void +parse_operation_column () +{ + struct parser_field_t *p = alloc_next_field (); + parse_simple_operation_column (p, false, false); + + if (scanner_peek_token () == TOK_COLONS) + { + scanner_get_token (); + + /* mark the previous field as pair, this will be the other field */ + p->pair = true; + + struct parser_field_t *q = alloc_next_field (); + parse_simple_operation_column (q, false, true); + } + + if (scanner_peek_token () == TOK_DASH) + { + scanner_get_token (); + + /* mark the previous field as range, this will be the 'to' field */ + p->range = true; + + struct parser_field_t *q = alloc_next_field (); + parse_simple_operation_column (q, true, false); + + if (p->by_name || q->by_name) + error (EXIT_FAILURE, 0, _("field range for %s must be numeric"), + quote (get_field_operation_name (fop))); + if (p->num >= q->num) + error (EXIT_FAILURE, 0, _("invalid field range for operation %s"), + quote (get_field_operation_name (fop))); + } +} + +static void +parse_operation_column_list () +{ + parse_operation_column (); + + enum TOKEN tok = scanner_peek_token (); + while (tok == TOK_COMMA) + { + scanner_get_token (); + parse_operation_column (); + tok = scanner_peek_token (); + } +} + +static void +parse_operation_params () +{ + /* currently, the only place we want to detect a whitespace, spearating + between operation's parameters and field numbers. + e.g.: + 'foo:10: 4' should not be treated as 'foo:10:4' (with two parameters). + instead, it should produce an error (missing second parameter), + and the '4' should be treated as the field number. + */ + scanner_keep_whitespace = true; + + enum TOKEN tok = scanner_peek_token (); + while (tok == TOK_COLONS) + { + scanner_get_token (); + tok = scanner_get_token (); + + if (_params_used == _params_alloc) + _params = x2nrealloc (_params, &_params_alloc, + sizeof (struct parser_param_t)); + struct parser_param_t *p = &_params[_params_used++]; + + switch (tok) + { + case TOK_INTEGER: + p->type = PARAM_INT; + p->u = scan_val_int; + p->f = scan_val_int; + break; + + case TOK_FLOAT: + p->type = PARAM_FLOAT; + p->f = scan_val_float; + break; + + case TOK_WHITESPACE: + case TOK_END: + error (EXIT_FAILURE, 0, _("missing parameter for operation %s"), + quote (get_field_operation_name (fop))); + + case TOK_COMMA: + case TOK_DASH: + case TOK_IDENTIFIER: + case TOK_COLONS: + default: + error (EXIT_FAILURE, 0, _("invalid parameter %s for operation %s"), + scanner_identifier, + quote (get_field_operation_name (fop))); + + } + + tok = scanner_peek_token (); + } + if (tok == TOK_WHITESPACE) + scanner_get_token (); + + scanner_keep_whitespace = false; +} + +static inline bool +compatible_operation_modes (enum processing_mode current, + enum processing_mode added) +{ + return ((current==MODE_CROSSTAB)&&(added==MODE_GROUPBY))|| + (current==added); +} + +static void +create_field_ops () +{ + for (size_t i=0; i<_fields_used; ++i) + { + const struct parser_field_t *f = &_fields[i]; + struct fieldop *op = add_op (fop, f); + set_op_params (op); + + if (OP_NEED_PAIR_PARAMS (fop) && !f->pair) + error (EXIT_FAILURE, 0, _("operation %s requires field pairs"), + quote (get_field_operation_name (fop))); + if (!OP_NEED_PAIR_PARAMS (fop) && f->pair) + error (EXIT_FAILURE, 0, _("operation %s cannot use pair of fields"), + quote (get_field_operation_name (fop))); + + if (f->range) + { + uintmax_t to = _fields[++i].num; + struct parser_field_t t = *f; + while (t.numpair) + { + op->slave = true; + + const struct parser_field_t *other_f = &_fields[++i]; + op = add_op (fop, other_f); + set_op_params (op); + op->master = true; + op->slave_idx = dm->num_ops-2; /* index of the prev op = slave op */ + } + } +} + +static void +parse_operation (enum processing_mode pm) +{ + reset_parsed_operation (); + + scanner_get_token (); + enum processing_mode pm2; + fop = get_field_operation (scanner_identifier, &pm2); + if (fop==OP_INVALID) + { + pm2 = get_processing_mode (scanner_identifier); + if (pm2 != MODE_INVALID) + error (EXIT_FAILURE,0, _("conflicting operation %s"), + quote (scanner_identifier)); + + error (EXIT_FAILURE,0, _("invalid operation %s"), + quote (scanner_identifier)); + } + + if (!compatible_operation_modes (pm,pm2)) + error (EXIT_FAILURE, 0, _("conflicting operation found: "\ + "expecting %s operations, but found %s operation %s"), + get_processing_mode_name (pm), + get_processing_mode_name (pm2), + quote (scanner_identifier)); + + parse_operation_params (); + + parse_operation_column_list (); + + create_field_ops (); +} + +static void +parse_operations (enum processing_mode pm) +{ + enum TOKEN tok = scanner_peek_token (); + while (tok != TOK_END) + { + parse_operation (pm); + tok = scanner_peek_token (); + } + + /* After adding all operations, see of there are master/slave ops + * that need resolving - caching their pointer instead of index */ + for (size_t i=0; inum_ops; ++i) + { + if (!dm->ops[i].master) + continue; + const size_t si = dm->ops[i].slave_idx; + assert (si<=dm->num_ops); /* LCOV_EXCL_LINE */ + dm->ops[i].slave_op = &dm->ops[si]; + } +} + +static void +parse_mode_column (enum processing_mode pm) +{ + enum TOKEN tok = scanner_get_token (); + switch (tok) /* LCOV_EXCL_BR */ + { + case TOK_IDENTIFIER: + ADD_NAMED_GROUP (scanner_identifier); + break; + + case TOK_WHITESPACE: + internal_error ("whitespace"); /* LCOV_EXCL_LINE */ + case TOK_COMMA: + case TOK_END: + error (EXIT_FAILURE, 0, _("missing field for operation %s"), + quote (get_processing_mode_name (pm))); + + case TOK_INTEGER: + if (scan_val_int>0) + { + ADD_NUMERIC_GROUP (scan_val_int); + break; + } + + case TOK_DASH: + case TOK_COLONS: + case TOK_FLOAT: + default: + error (EXIT_FAILURE, 0, _("invalid field '%s' for operation %s"), + scanner_identifier, + quote (get_processing_mode_name (pm))); + + } +} + +static void +parse_mode_column_list (enum processing_mode pm) +{ + parse_mode_column (pm); + + enum TOKEN tok = scanner_peek_token (); + while (tok == TOK_COMMA) + { + scanner_get_token (); + parse_mode_column (pm); + tok = scanner_peek_token (); + } + /* detect and warn about incorrect usage, + field specification for groups can't handle dashes or colons (for now) */ + if (tok == TOK_DASH) + error (EXIT_FAILURE, 0, _("invalid field range for operation %s"), + quote (get_processing_mode_name (pm))); + if (tok == TOK_COLONS) + error (EXIT_FAILURE, 0, _("invalid field pair for operation %s"), + quote (get_processing_mode_name (pm))); +} + +static void +parse_mode () +{ + scanner_get_token (); + enum processing_mode pm = get_processing_mode (scanner_identifier); + dm->mode = pm; + + switch (pm) /* LCOV_EXCL_BR_LINE */ + { + case MODE_TRANSPOSE: + case MODE_NOOP: + case MODE_REVERSE: + case MODE_TABULAR_CHECK: + break; + + case MODE_REMOVE_DUPS: + parse_mode_column_list (pm); + break; + + case MODE_CROSSTAB: + parse_mode_column_list (pm); + if (dm->num_grps!=2) + error (EXIT_FAILURE,0, _("crosstab requires exactly 2 fields, " \ + "found %"PRIuMAX), (uintmax_t)dm->num_grps); + + /* if the user didn't specify an operation, print counts */ + parse_operations (pm); + if (dm->num_ops==0) + { + const uintmax_t grp_col = dm->grps[0].num; + struct parser_field_t dummy = {grp_col,false,NULL,false,false}; + add_op (OP_COUNT, &dummy); + } + else if (dm->num_ops>1) + { + error (EXIT_FAILURE,0, _("crosstab supports one operation, " \ + "found %"PRIuMAX), (uintmax_t)dm->num_ops); + } + break; + + case MODE_GROUPBY: + parse_mode_column_list (pm); + parse_operations (pm); + if (dm->num_ops==0) + error (EXIT_FAILURE,0, _("missing operation")); + break; + + case MODE_PER_LINE: + internal_error ("line mode used directly"); /* LCOV_EXCL_LINE */ + break; + + case MODE_INVALID: + default: + internal_error ("wrong opmode"); /* LCOV_EXCL_LINE */ + break; + } + + if (scanner_peek_token ()!=TOK_END) + error (EXIT_FAILURE,0,_("extra operand %s"), quote (scanner_identifier)); +} + +static void +parse_mode_or_op () +{ + enum TOKEN tok = scanner_peek_token (); + assert ( tok != TOK_END ); /* LCOV_EXCL_LINE */ + + enum processing_mode pm = get_processing_mode (scanner_identifier); + if (pm != MODE_INVALID) + { + parse_mode (); + return ; + } + + enum field_operation fop = get_field_operation (scanner_identifier, &pm); + if (fop!=OP_INVALID) + { + dm->mode = pm; + parse_operations (pm); + return ; + } + + error (EXIT_FAILURE,0, _("invalid operation %s"), + quote (scanner_identifier)); +} + +struct datamash_ops* +datamash_ops_parse ( int argc, const char* argv[] ) +{ + _alloc_ops (); + scanner_set_input_from_argv (argc, argv); + parse_mode_or_op (); + scanner_free (); + return dm; +} + +struct datamash_ops* +datamash_ops_parse_premode ( enum processing_mode pm, + const char* grouping, + int argc, const char* argv[] ) +{ + _alloc_ops (); + assert (argc > 0); /* LCOV_EXCL_LINE */ + assert (pm == MODE_GROUPBY); /* LCOV_EXCL_LINE */ + dm->mode = pm; + scanner_set_input_from_argv (1, &grouping); + parse_mode_column_list (pm); + scanner_free (); + scanner_set_input_from_argv (argc, argv); + parse_operations (pm); + scanner_free (); + return dm; +} + +void +datamash_ops_free ( struct datamash_ops* p ) +{ + assert (p != NULL); /* LCOV_EXCL_LINE */ + for (size_t i=0; inum_grps; ++i) + free (p->grps[i].name); + free (p->grps); + p->grps = NULL; + + #ifndef _STANDALONE_ + for (size_t i=0; inum_ops; ++i) + field_op_free (&p->ops[i]); + #endif + + free (p->ops); + p->ops = NULL; + + free (_fields); + _fields = NULL; + _fields_alloc = 0; + _fields_used = 0; + + free (_params); + _params_alloc = 0; + _params_used = 0; + + free (p); +} + +#ifdef PARSER_TEST_MAIN +/* + Trivial parser tester. + To compile: + cc -D_STANDALONE_ -DPARSER_TEST_MAIN \ + -I. \ + -std=c99 -Wall -Wextra -Werror -g -O0 \ + -o dm-parser \ + op-parser.c op-scanner.c op-defs.c + Test: + ./dm-parser groupby 1,4 sum 4-5,foo +*/ + +void +datamash_ops_debug_print ( const struct datamash_ops* p ) +{ + assert (p != NULL ); + printf ("datamash_ops =\n processing_mode = %s\n header_required = %d\n", + get_processing_mode_name (p->mode), (int)p->header_required); + + if (p->num_grps==0) + puts (" no grouping specified"); + for (size_t i=0; inum_grps; ++i) + { + const struct group_column_t *tmp = &p->grps[i]; + if (tmp->by_name) + printf (" group-by named column '%s'\n",tmp->name); + else + printf (" group-by numeric column %zu\n",tmp->num); + } + + for (size_t i=0; inum_ops; ++i) + { + struct fieldop *o = &p->ops[i]; + if (o->field_by_name) + printf (" operation '%s' on named column '%s'", + get_field_operation_name (o->op), o->field_name); + else + printf (" operation '%s' on numeric column %zu", + get_field_operation_name (o->op), o->field); + if (o->master) + printf (" (master)"); + if (o->slave) + printf (" (slave)"); + printf ( "\n"); + } +} + +#define TESTMAIN main +int TESTMAIN (int argc, const char* argv[]) +{ + if (argc<2) + error (EXIT_FAILURE, 0, _("missing script (among arguments)")); + + struct datamash_ops *o = datamash_ops_parse (argc-1, argv+1); + datamash_ops_debug_print ( o ); + datamash_ops_free (o); + return 0; +} +#endif + +/* vim: set cinoptions=>4,n-2,{2,^-2,:2,=2,g0,h2,p5,t0,+2,(0,u0,w1,m1: */ +/* vim: set shiftwidth=2: */ +/* vim: set tabstop=2: */ +/* vim: set expandtab: */ diff -Nru datamash-1.0.7/src/op-parser.h datamash-1.1.1/src/op-parser.h --- datamash-1.0.7/src/op-parser.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/src/op-parser.h 2017-01-17 17:50:20.000000000 +0000 @@ -0,0 +1,81 @@ +/* GNU Datamash - perform simple calculation on input data + + Copyright (C) 2013-2017 Assaf Gordon + + This file is part of GNU Datamash. + + GNU Datamash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + GNU Datamash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Datamash. If not, see . +*/ + +/* Written by Assaf Gordon */ +#ifndef __OP_PARSER_H__ +#define __OP_PARSER_H__ + +struct group_column_t +{ + size_t num; /* 1 = first field */ + bool by_name; /* true if the user gave a column name */ + char* name; /* column name - to be converted to number after + header line is read */ +}; + +struct op_column_t +{ + size_t num; /* 1 = first field */ + bool by_name; /* true if the user gave a column name */ + char* name; /* column name - to be converted to number after + header line is read */ + enum field_operation op; +}; + +struct datamash_ops +{ + enum processing_mode mode; /* the processing mode */ + bool header_required; /* true if any of the fields (groups/operations) + used a named column instead of a number. */ + + struct group_column_t *grps; /* group-by columns */ + size_t num_grps; + size_t alloc_grps; + + struct fieldop *ops; /* field operations */ + size_t num_ops; + size_t alloc_ops; +}; + +/* Parse the operations, return new datamash_ops structure. + This function assumes new syntax: + 1. The first word is either a mode (e.g. transpose/groupby/reverse) + or an operation (e.g. sum/min/max) - implying a 'group-by' mode. + 2. The rest of the parameters are operations. */ +struct datamash_ops* +datamash_ops_parse ( int argc, const char* argv[] ); + +/* Parse the operations, return new datamash_ops structure. + This function assumes old syntax: + The user already specified "-g X,Y,Z" - the processing mode is known, + and the grouping text 'X,Y,Z' is known. + The function will only accept operations (e.g. sum/min/max). */ +struct datamash_ops* +datamash_ops_parse_premode ( enum processing_mode pm, + const char* grouping_spec, + int argc, const char* argv[] ); + +void +datamash_ops_debug_print ( const struct datamash_ops* p ); + +void +datamash_ops_free (struct datamash_ops *p); + +#endif diff -Nru datamash-1.0.7/src/op-scanner.c datamash-1.1.1/src/op-scanner.c --- datamash-1.0.7/src/op-scanner.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/src/op-scanner.c 2017-01-17 17:50:20.000000000 +0000 @@ -0,0 +1,255 @@ +/* GNU Datamash - perform simple calculation on input data + + Copyright (C) 2013-2017 Assaf Gordon + + This file is part of GNU Datamash. + + GNU Datamash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + GNU Datamash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Datamash. If not, see . +*/ + +/* Written by Assaf Gordon */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "system.h" + +#include "op-scanner.h" + +/* Used by other modules */ +uintmax_t scan_val_int; +long double scan_val_float; +char* scanner_identifier; +bool scanner_keep_whitespace = false; + +/* Internal */ +static char* scanner_input; +static char* scan_pos; +static size_t scanner_identifier_len; +static bool have_peek; +static enum TOKEN scan_peek; + +static inline void +set_identifier (const char* data, size_t n) +{ + if (n>=scanner_identifier_len) + { + scanner_identifier = xrealloc (scanner_identifier,n+1); + scanner_identifier_len = n+1; + } + memcpy (scanner_identifier, data, n); + scanner_identifier[n]=0; +} + +/* Concatante argv into one (space separated) string */ +void +scanner_set_input_from_argv (int argc, const char* argv[]) +{ + assert (scanner_input == NULL); /* LCOV_EXCL_LINE */ + + size_t len = 1; /* +1 for NUL */ + for (int i=0;i0) + p = stpcpy (p, " "); + p = stpcpy (p, argv[i]); + } +} + +void +scanner_free () +{ + free (scanner_identifier); + scanner_identifier = NULL; + scanner_identifier_len = 0; + + free (scanner_input); + scanner_input = NULL; + scan_pos = NULL; + have_peek = false; +} + +enum TOKEN +scanner_peek_token () +{ + if (have_peek) + return scan_peek; + + scan_peek = scanner_get_token (); + have_peek = true; + return scan_peek; +} + +enum TOKEN +scanner_get_token () +{ + char *pend; + + if (have_peek) + { + have_peek = false; + return scan_peek; + } + + assert (scan_pos != NULL); /* LCOV_EXCL_LINE */ + + if (*scan_pos == '\0') + return TOK_END; + + /* White space */ + if (c_isspace (*scan_pos)) + { + while ( c_isspace (*scan_pos) ) + ++scan_pos; + if (scanner_keep_whitespace) + { + if (*scan_pos == '\0') + return TOK_END; + return TOK_WHITESPACE; + } + } + + /* special characters */ + if (*scan_pos == ',') + { + ++scan_pos; + set_identifier (",", 1); + return TOK_COMMA; + } + if (*scan_pos == '-') + { + ++scan_pos; + set_identifier ("-", 1); + return TOK_DASH; + } + if (*scan_pos == ':') + { + ++scan_pos; + set_identifier (":", 1); + return TOK_COLONS; + } + + /* Integer or floating-point value */ + if (c_isdigit (*scan_pos)) + { + enum TOKEN rc = TOK_INTEGER; + errno = 0; + scan_val_int = strtol (scan_pos, &pend, 10); + + if (*pend == '.') + { + /* a floating-point value */ + scan_val_float = strtold (scan_pos, &pend); + rc = TOK_FLOAT; + } + if ((c_isalpha (*pend) || *pend=='_') || (errno == ERANGE)) + error (EXIT_FAILURE, 0, _("invalid numeric value '%s'"), + scan_pos); + + set_identifier (scan_pos, pend-scan_pos); + scan_pos = pend; + return rc; + } + + /* a valid identifier ( [a-z_][a-z0-9_]+ ) */ + if (c_isalpha (*scan_pos) || *scan_pos == '_') + { + size_t l=1; + char *v=scan_pos+1; + while ( c_isalpha (*v) || c_isdigit (*v) || *v=='_' ) + ++l, ++v; + + set_identifier (scan_pos, l); + scan_pos += l; + return TOK_IDENTIFIER; + } + + error (EXIT_FAILURE, 0, _("invalid operand %s"), quote (scan_pos)); + return TOK_END; +} + + +#ifdef SCANNER_TEST_MAIN +/* + Trivial scanner tester. + To compile: + cc -D_STANDALONE_ -DSCANNER_TEST_MAIN \ + -I. \ + -std=c99 -Wall -Wextra -Werror -g -O0 \ + -o dm-scanner ./src/op-scanner.c + Test: + ./dm-scanner groupby 1,2 sum 4-7 + ./dm-scanner ppearson 1:6 + ./dm-scanner foo bar 9.5f +*/ +#define TESTMAIN main +int TESTMAIN (int argc, const char* argv[]) +{ + if (argc<2) + error (EXIT_FAILURE, 0, _("missing script (among arguments)")); + + scanner_set_input_from_argv (argc-1, argv+1); + + enum TOKEN tok; + while ( (tok = scanner_get_token ()) != TOK_END ) + { + switch (tok) + { + case TOK_IDENTIFIER: + printf ("TOK_IDENTIFIER: '%s'\n", scanner_identifier); + break; + + case TOK_INTEGER: + printf ("TOK_INTEGER: %lu ('%s')\n", scan_val_int, scanner_identifier); + break; + + case TOK_FLOAT: + printf ("TOK_FLOAT: %Lf ('%s')\n", scan_val_float, scanner_identifier); + break; + + case TOK_COMMA: + printf ("TOK_COMMA\n"); + break; + + case TOK_DASH: + printf ("TOK_DASH\n"); + break; + + case TOK_COLONS: + printf ("TOK_COLONS\n"); + break; + + default: + error (EXIT_FAILURE, 0 ,_("unknown token %d\n"),tok); + } + } + + return 0; +} +#endif + +/* vim: set cinoptions=>4,n-2,{2,^-2,:2,=2,g0,h2,p5,t0,+2,(0,u0,w1,m1: */ +/* vim: set shiftwidth=2: */ +/* vim: set tabstop=2: */ +/* vim: set expandtab: */ diff -Nru datamash-1.0.7/src/op-scanner.h datamash-1.1.1/src/op-scanner.h --- datamash-1.0.7/src/op-scanner.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/src/op-scanner.h 2017-01-17 17:50:20.000000000 +0000 @@ -0,0 +1,58 @@ +/* GNU Datamash - perform simple calculation on input data + + Copyright (C) 2013-2017 Assaf Gordon + + This file is part of GNU Datamash. + + GNU Datamash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + GNU Datamash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Datamash. If not, see . +*/ + +/* Written by Assaf Gordon */ +#ifndef __OP_SCANNER_H__ +#define __OP_SCANNER_H__ + +enum TOKEN +{ + TOK_END=0, + TOK_IDENTIFIER, + TOK_INTEGER, + TOK_FLOAT, + TOK_COMMA, + TOK_DASH, + TOK_COLONS, + TOK_WHITESPACE +}; + +extern uintmax_t scan_val_int; +extern long double scan_val_float; +extern char* scanner_identifier; +extern bool scanner_keep_whitespace; + +/* Initialize the scanner from argc/argv pair. + note: argv should contain only the actual input: remove + any other program parameters (including progname/argv[0]) */ +void +scanner_set_input_from_argv (int argc, const char* argv[]); + +/* Free any data/memory associated with the scanner */ +void +scanner_free (); + +enum TOKEN +scanner_get_token (); + +enum TOKEN +scanner_peek_token (); + +#endif diff -Nru datamash-1.0.7/src/strcnt.c datamash-1.1.1/src/strcnt.c --- datamash-1.0.7/src/strcnt.c 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/src/strcnt.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,47 +0,0 @@ -/* GNU Datamash - perform simple calculation on input data - - Copyright (C) 2013-2015 Assaf Gordon - - This file is part of GNU Datamash. - - GNU Datamash is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - GNU Datamash is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNU Datamash. If not, see . -*/ -/* Written by Assaf Gordon */ -#ifndef __STRCNT_H__ -#define __STRCNT_H__ - -#include -#include - -/* -TODO: -See gnulib's strchrnul.c for possible optimizations. -*/ - -/* returns the number of times character C appears in - NUL-terminated string str. */ -size_t _GL_ATTRIBUTE_PURE -strcnt (const char* str, int c) -{ - size_t cnt = 0; - while ( *str != 0 ) - { - if ( *str == c ) - ++cnt; - ++str; - } - return cnt; -} - -#endif diff -Nru datamash-1.0.7/src/strcnt.h datamash-1.1.1/src/strcnt.h --- datamash-1.0.7/src/strcnt.h 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/src/strcnt.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -/* GNU Datamash - perform simple calculation on input data - - Copyright (C) 2013-2015 Assaf Gordon - - This file is part of GNU Datamash. - - GNU Datamash is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - GNU Datamash is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with GNU Datamash. If not, see . -*/ - -/* Written by Assaf Gordon */ -#ifndef __STRCNT_H__ -#define __STRCNT_H__ - -/* returns the number of times character C appears in - NUL-terminated string str. */ -size_t -strcnt (const char* str, int c); - -#endif diff -Nru datamash-1.0.7/src/system.h datamash-1.1.1/src/system.h --- datamash-1.0.7/src/system.h 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/src/system.h 2017-01-17 17:50:20.000000000 +0000 @@ -7,7 +7,7 @@ Copyright (C) 1989-2013 Free Software Foundation, Inc. Modifications for GNU Datamash are - Copyright (C) 2014-2015 Assaf Gordon + Copyright (C) 2014-2017 Assaf Gordon 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 @@ -22,29 +22,59 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#ifndef __DATAMASH__SYSTEM_H__ +#define __DATAMASH__SYSTEM_H__ -#ifndef CALC_SYSTEM_H -#define CALC_SYSTEM_H - -/* Assume ANSI C89 headers are available. */ +#include +#include +#include +#include #include +#include +#include +#include #include #include +#include #include - -/* Use POSIX headers. If they are not available, we use the substitute - provided by gnulib. */ -#include #include -#include -#include -#include -#include -#include +#ifdef _STANDALONE_ -/* Take care of NLS matters. */ +/* compiling 'standalone' (bypassing gnulib) - add (unsafe) stubs */ +# define quote(x) (x) +# define xrealloc(x,n) realloc (x,n) +# define xrealloc(x,n) realloc (x,n) +# define XCALLOC(n,t) calloc (n,sizeof (t)) +# define XZALLOC(t) calloc (1,sizeof (t)) +# define xstrdup(c) strdup (c) +static inline void* +x2nrealloc (void *p, size_t *pn, size_t s) +{ + size_t n = (*pn==0)?1000:( (*pn)*2 ); + if (!p) { n = 1000 ; } + *pn = n; + return realloc (p, n*s); +} +# define _(x) (x) +# define N_(x) (x) + +# include +# define error(x,y,z,...) errx(x,z,##__VA_ARGS__) +# define program_name "datamash" + +# define c_isalpha(c) isalpha((int)c) +# define c_isspace(c) isspace((int)c) +# define c_isdigit(c) isdigit((int)c) + +#else /* !_STANDALONE_ */ + +# include "xalloc.h" +# include "c-ctype.h" +# include "quote.h" +# include "error.h" +/* Take care of NLS matters. */ #include "gettext.h" #if ! ENABLE_NLS # undef textdomain @@ -56,10 +86,6 @@ #define _(msgid) gettext (msgid) #define N_(msgid) msgid -#define STREQ(a, b) (strcmp (a, b) == 0) -#define STREQ_LEN(a, b, n) (strncmp (a, b, n) == 0) -#define STRPREFIX(a, b) (strncmp(a, b, strlen (b)) == 0) - /* Define away proper_name (leaving proper_name_utf8, which affects far fewer programs), since it's not worth the cost of adding ~17KB to the x86_64 text size of every single program. This avoids a 40% @@ -69,6 +95,12 @@ #include "progname.h" +#endif /* !_STANDALONE_ */ + +#define STREQ(a, b) (strcmp (a, b) == 0) +#define STREQ_LEN(a, b, n) (strncmp (a, b, n) == 0) +#define STRPREFIX(a, b) (strncmp(a, b, strlen (b)) == 0) + #define case_GETOPT_VERSION_CHAR(Program_name, Authors) \ case GETOPT_VERSION_CHAR: \ version_etc (stdout, Program_name, PACKAGE_NAME, Version, Authors, \ @@ -157,4 +189,4 @@ #define __STR_LINE__ __STR__(__LINE__) #define internal_error(x) assert(!#x) -#endif /* CALC_SYSTEM_H */ +#endif /* __DATAMASH__SYSTEM_H__ */ diff -Nru datamash-1.0.7/src/text-lines.c datamash-1.1.1/src/text-lines.c --- datamash-1.0.7/src/text-lines.c 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/src/text-lines.c 2017-01-17 17:50:20.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2015 Assaf Gordon + Copyright (C) 2013-2017 Assaf Gordon This file is part of GNU Datamash. @@ -26,7 +26,9 @@ #include #include "system.h" +#ifndef MAX #include "minmax.h" +#endif #include "linebuffer.h" #include "xalloc.h" @@ -99,7 +101,7 @@ /* Move 'fptr' to point to the beginning of 'field' */ if (field_delim != TAB_WHITESPACE) { - while (posnum_fields = num_fields; + lr->num_fields = num_fields; } else { @@ -145,15 +147,12 @@ } /* Add new field */ - if (flen>0) - { - ++num_fields; - line_record_reserve_fields (lr, num_fields); - lr->num_fields = num_fields; - lr->fields[num_fields-1].buf = field_beg; - lr->fields[num_fields-1].len = flen; - } + line_record_reserve_fields (lr, num_fields); + lr->fields[num_fields].buf = field_beg; + lr->fields[num_fields].len = flen; + ++num_fields; } + lr->num_fields = num_fields; } } diff -Nru datamash-1.0.7/src/text-lines.h datamash-1.1.1/src/text-lines.h --- datamash-1.0.7/src/text-lines.h 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/src/text-lines.h 2017-01-17 17:50:20.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2015 Assaf Gordon + Copyright (C) 2013-2017 Assaf Gordon This file is part of GNU Datamash. diff -Nru datamash-1.0.7/src/text-options.c datamash-1.1.1/src/text-options.c --- datamash-1.0.7/src/text-options.c 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/src/text-options.c 2017-01-17 17:50:20.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2015 Assaf Gordon + Copyright (C) 2013-2017 Assaf Gordon This file is part of GNU Datamash. @@ -40,6 +40,25 @@ /* Global case-sensitivity option. Defaults to 'true' . */ bool case_sensitive = true; +/* In the future: allow users to change this */ +int numeric_output_precision = 14; + +/* The character used to separate collapsed/uniqued strings */ +/* In the future: allow users to change this */ +char collapse_separator = ','; + +/* Should NA/NaN/empty values be silengtly ignored? */ +bool remove_na_values = false; + +/* if true, 'transpose' and 'reverse' require every line to have + the exact same number of fields. Otherwise, the program + will fail with non-zero exit code. */ +bool strict = true; + +/* if 'strict' is false, lines with fewer-than-expected fields + will be filled with this value */ +char* missing_field_filler = "N/A"; + #define UCHAR_LIM (UCHAR_MAX + 1) bool blanks[UCHAR_LIM]; diff -Nru datamash-1.0.7/src/text-options.h datamash-1.1.1/src/text-options.h --- datamash-1.0.7/src/text-options.h 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/src/text-options.h 2017-01-17 17:50:20.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2015 Assaf Gordon + Copyright (C) 2013-2017 Assaf Gordon This file is part of GNU Datamash. @@ -42,6 +42,24 @@ /* Global case-sensitivity option. Defaults to 'true' . */ extern bool case_sensitive ; +/* precision used with printf "%.*Lg" */ +extern int numeric_output_precision; + +/* The character used to separate collapsed/uniqued strings */ +extern char collapse_separator; + +/* Should NA/NaN/empty values be silengtly ignored? */ +extern bool remove_na_values; + +/* if true, 'transpose' and 'reverse' require every line to have + the exact same number of fields. Otherwise, the program + will fail with non-zero exit code. */ +extern bool strict; + +/* if 'strict' is false, lines with fewer-than-expected fields + will be filled with this value */ +extern char* missing_field_filler; + #define UCHAR_LIM (UCHAR_MAX + 1) extern bool blanks[UCHAR_LIM]; diff -Nru datamash-1.0.7/src/utils.c datamash-1.1.1/src/utils.c --- datamash-1.0.7/src/utils.c 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/src/utils.c 2017-01-17 17:50:20.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2015 Assaf Gordon + Copyright (C) 2013-2017 Assaf Gordon This file is part of GNU Datamash. @@ -137,6 +137,64 @@ return variance; } +long double _GL_ATTRIBUTE_PURE +covariance_value ( const long double * const valuesA, + const long double * const valuesB, size_t n, int df ) +{ + long double sum=0; + long double meanA, meanB; + long double covariance; + + assert (df>=0); /* LCOV_EXCL_LINE */ + if ( (size_t)df == n ) + return nanl (""); + + meanA = arithmetic_mean_value (valuesA, n); + meanB = arithmetic_mean_value (valuesB, n); + + sum = 0 ; + for (size_t i = 0; i < n; i++) + sum += (valuesA[i] - meanA) * (valuesB[i] - meanB); + + covariance = sum / ( n - df ); + + return covariance; +} + +long double +pearson_corr_value ( const long double * const valuesA, + const long double * const valuesB, size_t n, int df) +{ + long double meanA, meanB, sumA=0, sumB=0, sumCo=0; + long double sdA, sdB; + long double covariance; + long double cor; + + assert (df>=0); /* LCOV_EXCL_LINE */ + if ( (size_t)df == n ) + return nanl (""); + + meanA = arithmetic_mean_value (valuesA, n); + meanB = arithmetic_mean_value (valuesB, n); + + for (size_t i = 0; i < n; i++) + { + const long double a = (valuesA[i] - meanA); + const long double b = (valuesB[i] - meanB); + sumA += a*a; + sumB += b*b; + sumCo += a*b; + } + + covariance = sumCo/(n-df); + sdA = sqrtl (sumA/(n-df)); + sdB = sqrtl (sumB/(n-df)); + + cor = covariance / ( sdA * sdB ); + return cor; +} + + long double stdev_value (const long double * const values, size_t n, int df) { diff -Nru datamash-1.0.7/src/utils.h datamash-1.1.1/src/utils.h --- datamash-1.0.7/src/utils.h 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/src/utils.h 2017-01-17 17:50:20.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2015 Assaf Gordon + Copyright (C) 2013-2017 Assaf Gordon This file is part of GNU Datamash. @@ -92,6 +92,21 @@ variance_value ( const long double * const values, size_t n, int df ); /* + Given an two array of doubles, return the covariance value. + 'df' is degrees-of-freedom. Use DF_POPULATION or DF_SAMPLE (see above). + */ +long double +covariance_value ( const long double * const valuesA, + const long double * const valuesB, size_t n, int df ); + +/* + Given an two array of doubles, return the Pearson correlation coefficient + */ +long double +pearson_corr_value ( const long double * const valuesA, + const long double * const valuesB, size_t n, int df); + +/* Given an array of doubles, return the standard-deviation value. 'df' is degrees-of-freedom. Use DF_POPULATION or DF_SAMPLE (see above). */ @@ -183,6 +198,29 @@ bool hash_compare_strings (void const *x, void const *y); +/* returns non-zero if the input is equavalent to + zero (or negative zero) */ +static inline bool +is_zero (const long double a) +{ + return !((a>0)-(a<0)); +} + +/* returns non-zero if the input is negative zero */ +static inline bool +is_signed_zero (const long double a) +{ + return signbit (a) && is_zero (a); +} + +/* if the input is negative-zero, returns positive zero. + otherwise, returns the input value. */ +static inline long double +pos_zero (const long double a) +{ + return is_signed_zero (a) ? 0 : a; +} + /* On some systems (e.g. Cygwin) nanl is not defined, and gnulib does not yet provide a replacment (though it does provide 'isnanl' replacement) */ diff -Nru datamash-1.0.7/.tarball-version datamash-1.1.1/.tarball-version --- datamash-1.0.7/.tarball-version 2015-06-22 00:27:46.000000000 +0000 +++ datamash-1.1.1/.tarball-version 2017-01-19 20:05:43.000000000 +0000 @@ -1 +1 @@ -1.0.7 +1.1.1 diff -Nru datamash-1.0.7/tests/datamash-check-tabular.pl datamash-1.1.1/tests/datamash-check-tabular.pl --- datamash-1.0.7/tests/datamash-check-tabular.pl 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/tests/datamash-check-tabular.pl 2017-01-17 17:50:20.000000000 +0000 @@ -0,0 +1,146 @@ +#!/usr/bin/env perl +=pod + Unit Tests for GNU Datamash - perform simple calculation on input data + Tests for 'transpose' and 'reverse' operation modes. + + + Copyright (C) 2013-2017 Assaf Gordon + + This file is part of GNU Datamash. + + GNU Datamash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + GNU Datamash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Datamash. If not, see . + + Written by Assaf Gordon. +=cut +use strict; +use warnings; +use List::Util qw/max/; +use Data::Dumper; + +# Until a better way comes along to auto-use Coreutils Perl modules +# as in the coreutils' autotools system. +use Coreutils; +use CuSkip; +use CuTmpdir qw(datamash); + +(my $program_name = $0) =~ s|.*/||; +my $prog_bin = 'datamash'; + +my $prog = `$prog_bin ---print-progname`; + +# Turn off localization of executable's output. +@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; + +my $in1=<<'EOF'; +a x 1 +b z 6 +c x 7 +EOF + +# missing field on second line +my $in2=<<'EOF'; +a x 1 +b z +c x 7 +EOF + +# Same as in2, with whitespace delimiters +my $in2_ws=<<"EOF"; +a x \t 1 + b \t z +c x 7 +EOF + +# second line has 2 tab characters, thus 3 fields +# (the last field is empty). +# version 1.1.0 and before rejected such input. +my $in3=<<"EOF"; +a x 1 +b z\t +c x 7 +EOF + +# Same as in3, with whitespace delimiters +my $in3_ws=<<"EOF"; +a x \t 1 +b \t z \t + c\t\t\tx \t 7 +EOF + + +# one line +my $in4=<<'EOF'; +a x 1 +EOF + +# one field +my $in5=<<'EOF'; +a +b +c +d +EOF + +# one field, with bad input (fourth line has 0 fields) +my $in6=<<'EOF'; +a +b +c + +e +EOF + +my @Tests = +( + ['c1', 'check', {IN_PIPE=>$in1}, {OUT=>"3 lines, 3 fields\n"}], + + ['c2', 'check', {IN_PIPE=>$in4}, {OUT=>"1 line, 3 fields\n"}], + ['c3', 'check', {IN_PIPE=>$in5}, {OUT=>"4 lines, 1 field\n"}], + ['c4', 'check', {IN_PIPE=>$in3}, {OUT=>"3 lines, 3 fields\n"}], + ['c5', '-W check', {IN_PIPE=>$in3_ws}, {OUT=>"3 lines, 3 fields\n"}], + + # Check bad input: + # The first four lines will be something like: + # 'line X has N fields:' + # ' [content of line X]' + # 'line Y has M fields:' + # ' [content of line Y]' + # The ERR_SUBSTR will remove these messages, as they are highly variable + # and dependant on the input. Then only the last line of error message + # is checked. + ['e1', 'check', {IN_PIPE=>$in2}, {EXIT=>1}, + {ERR_SUBST => 's/^(li| ).*$//'}, + {ERR => "\n\n\n\n$prog: check failed: line 2 has 2 fields " . + "(previous line had 3)\n"}], + ['e1ws', '-W check', {IN_PIPE=>$in2_ws}, {EXIT=>1}, + {ERR_SUBST => 's/^(li| ).*$//'}, + {ERR => "\n\n\n\n$prog: check failed: line 2 has 2 fields " . + "(previous line had 3)\n"}], + + ['e2', 'check', {IN_PIPE=>$in6}, {EXIT=>1}, + {ERR_SUBST => 's/^(li| ).*$//'}, + {ERR => "\n\n\n\n$prog: check failed: line 4 has 0 fields " . + "(previous line had 1)\n"}], + ['e2ws', '-W check', {IN_PIPE=>$in6}, {EXIT=>1}, + {ERR_SUBST => 's/^(li| ).*$//'}, + {ERR => "\n\n\n\n$prog: check failed: line 4 has 0 fields " . + "(previous line had 1)\n"}], + +); + +my $save_temps = $ENV{SAVE_TEMPS}; +my $verbose = $ENV{VERBOSE}; + +my $fail = run_tests ($program_name, $prog_bin, \@Tests, $save_temps, $verbose); +exit $fail; diff -Nru datamash-1.0.7/tests/datamash-crosstab.pl datamash-1.1.1/tests/datamash-crosstab.pl --- datamash-1.0.7/tests/datamash-crosstab.pl 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/tests/datamash-crosstab.pl 2017-01-17 17:50:20.000000000 +0000 @@ -0,0 +1,194 @@ +#!/usr/bin/env perl +=pod + Unit Tests for GNU Datamash - perform simple calculation on input data + Tests for 'transpose' and 'reverse' operation modes. + + + Copyright (C) 2013-2017 Assaf Gordon + + This file is part of GNU Datamash. + + GNU Datamash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + GNU Datamash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Datamash. If not, see . + + Written by Assaf Gordon. +=cut +use strict; +use warnings; +use List::Util qw/max/; +use Data::Dumper; + +# Until a better way comes along to auto-use Coreutils Perl modules +# as in the coreutils' autotools system. +use Coreutils; +use CuSkip; +use CuTmpdir qw(datamash); + +(my $program_name = $0) =~ s|.*/||; +my $prog_bin = 'datamash'; + +my $prog = `$prog_bin ---print-progname`; + +# Turn off localization of executable's output. +@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; + +my $in1=<<'EOF'; +a x 1 +a y 2 +a z 3 +b x 4 +b y 5 +b z 6 +c x 7 +c y 8 +c z 9 +EOF + +my $out1_first=<<'EOF'; + x y z +a 1 2 3 +b 4 5 6 +c 7 8 9 +EOF + +my $out1_count=<<'EOF'; + x y z +a 1 1 1 +b 1 1 1 +c 1 1 1 +EOF + +#unsorted input with duplicates +my $in2=<<'EOF'; +a x 1 +a y 2 +a x 3 +EOF + +# when using 'first' operation +my $out2_first=<<'EOF'; + x y +a 1 2 +EOF + +# when using 'last' operation without sorting the data +# this output is considered incorrect... +# TODO: perhaps warn the user about it (like join warns of unsorted input). +my $out2_last_unsorted=<<'EOF'; + x y +a 1 2 +EOF + +# when using 'last' operation with sorting the data, +# correct value is shown +my $out2_last_sorted=<<'EOF'; + x y +a 3 2 +EOF + +my $out2_count_unsorted=<<'EOF'; + x y +a 1 1 +EOF + +my $out2_count_sorted=<<'EOF'; + x y +a 2 1 +EOF + +# using 'sum' without sorting the data. +# this output is considered incorrect... +# TODO: perhaps warn the user about it (like join warns of unsorted input). +my $out2_sum_unsorted=<<'EOF'; + x y +a 1 2 +EOF + +# using 'sum' with sorting the data +my $out2_sum_sorted=<<'EOF'; + x y +a 4 2 +EOF + +#input with missing values (b/y is missing) +my $in3=<<'EOF'; +a x 1 +a y 2 +b x 3 +EOF + +# default filler is 'N/A' +my $out3_na=<<'EOF'; + x y +a 1 2 +b 3 N/A +EOF + +# custom filler 'XX' +my $out3_xx=<<'EOF'; + x y +a 1 2 +b 3 XX +EOF + +my @Tests = +( + ['c1','crosstab 1,2 first 3', {IN_PIPE=>$in1}, {OUT=>$out1_first}], + ['c2','ct 1,2 first 3', {IN_PIPE=>$in1}, {OUT=>$out1_first}], + ['c3','ct 1,2 count 1', {IN_PIPE=>$in1}, {OUT=>$out1_count}], + + # Default operation is count + ['c4','ct 1,2', {IN_PIPE=>$in1}, {OUT=>$out1_count}], + + # test unsorted input with duplicates + ['c10','ct 1,2 first 3', {IN_PIPE=>$in2}, {OUT=>$out2_first}], + + ['c11',' ct 1,2 last 3', {IN_PIPE=>$in2}, {OUT=>$out2_last_unsorted}], + ['c12','-s ct 1,2 last 3', {IN_PIPE=>$in2}, {OUT=>$out2_last_sorted}], + + ['c13',' ct 1,2 sum 3', {IN_PIPE=>$in2}, {OUT=>$out2_sum_unsorted}], + ['c14','-s ct 1,2 sum 3', {IN_PIPE=>$in2}, {OUT=>$out2_sum_sorted}], + + # test default operation (count) on unsorted data + ['c15',' ct 1,2 count 3', {IN_PIPE=>$in2}, {OUT=>$out2_count_unsorted}], + ['c16','-s ct 1,2 count 3', {IN_PIPE=>$in2}, {OUT=>$out2_count_sorted}], + + # Test missing values + ['c30','ct 1,2 first 3', {IN_PIPE=>$in3}, {OUT=>$out3_na}], + ['c31','--filler XX ct 1,2 first 3', {IN_PIPE=>$in3}, {OUT=>$out3_xx}], + + # Test wrong usage + ['e1', 'ct', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: missing field for operation 'crosstab'\n"}], + ['e2', 'ct 1', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: crosstab requires exactly 2 fields, found 1\n"}], + ['e3', 'ct 1,2,3,4', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: crosstab requires exactly 2 fields, found 4\n"}], + ['e4', 'ct 1,2 md5 4', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: conflicting operation found: expecting crosstab " . + "operations, but found line operation 'md5'\n"}], + ['e5', 'ct 1,2 sum 1,2', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: crosstab supports one operation, found 2\n"}], + ['e6', 'ct 1,2 min 2 max 2', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: crosstab supports one operation, found 2\n"}], + ['e7', 'ct 1:2', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: invalid field pair for operation 'crosstab'\n"}], + ['e8', 'ct 1-2', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: invalid field range for operation 'crosstab'\n"}], +); + +my $save_temps = $ENV{SAVE_TEMPS}; +my $verbose = $ENV{VERBOSE}; + +my $fail = run_tests ($program_name, $prog_bin, \@Tests, $save_temps, $verbose); +exit $fail; diff -Nru datamash-1.0.7/tests/datamash-error-msgs.pl datamash-1.1.1/tests/datamash-error-msgs.pl --- datamash-1.0.7/tests/datamash-error-msgs.pl 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/tests/datamash-error-msgs.pl 2017-01-17 17:50:20.000000000 +0000 @@ -0,0 +1,189 @@ +#!/usr/bin/env perl +=pod + Unit Tests for GNU Datamash - perform simple calculation on input data + + Copyright (C) 2013-2017 Assaf Gordon + + This file is part of GNU Datamash. + + GNU Datamash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + GNU Datamash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Datamash. If not, see . + + Written by Assaf Gordon. +=cut +use strict; +use warnings; + +# Until a better way comes along to auto-use Coreutils Perl modules +# as in the coreutils' autotools system. +use Coreutils; +use CuSkip; +use CuTmpdir qw(datamash); +use MIME::Base64 ; + +(my $program_name = $0) =~ s|.*/||; +my $prog_bin = 'datamash'; + +## Cross-Compiling portability hack: +## under qemu/binfmt, argv[0] (which is used to report errors) will contain +## the full path of the binary, if the binary is on the $PATH. +## So we try to detect what is the actual returned value of the program +## in case of an error. +my $prog = `$prog_bin ---print-progname`; +$prog = $prog_bin unless $prog; + +# TODO: add localization tests with "grouping" +# Turn off localization of executable's output. +@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; + +my @Tests = +( + # Invalid numeric value for column prasing should be treated as named column + ['e1', 'sum 1x', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: invalid numeric value '1x'\n"}], + + # Processing mode without operation + ['e2','groupby 1', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: missing operation\n"}], + + # invalid operation after valid mode + ['e3','groupby 1 foobar 2', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: invalid operation 'foobar'\n"}], + + # missing field number after processing mode + ['e4','groupby', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: missing field for operation 'groupby'\n"}], + + # Field range with invalid syntax + ['e20','sum 1-', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: invalid field range for operation 'sum'\n"}], + ['e21','sum 1-x', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: field range for 'sum' must be numeric\n"}], + ['e22','sum 4-2', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: invalid field range for operation 'sum'\n"}], + # zero in range + ['e23','sum 0-2', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: invalid field '0' for operation 'sum'\n"}], + ['e24','sum 1-0', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: invalid field '0' for operation 'sum'\n"}], + #Negative in range + ['e25','sum 1--5', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: invalid field range for operation 'sum'\n"}], + + # Test field pair syntaax + ['e41','pcov 1', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: operation 'pcov' requires field pairs\n"}], + ['e42','pcov 1:', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: invalid field pair for operation 'pcov'\n"}], + ['e43','pcov :', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: invalid field pair for operation 'pcov'\n"}], + ['e44','pcov :1', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: invalid field pair for operation 'pcov'\n"}], + ['e46','pcov hello:world', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: -H or --header-in must be used with named columns\n"}], + ['e47','sum 1:3', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: operation 'sum' cannot use pair of fields\n"}], + + # Test scanner edge-cases + # Floating point value + ['e60','sum 4.5', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: invalid field '4.5' for operation 'sum'\n"}], + ['e61','sum 4.', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: invalid field '4.' for operation 'sum'\n"}], + + # invalid numbers + ['e62','sum 4a', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: invalid numeric value '4a'\n"}], + ['e63','sum 4_', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: invalid numeric value '4_'\n"}], + # Overflow strtol + ['e64','sum 1234567890123456789012345678901234567', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: invalid numeric value " . + "'1234567890123456789012345678901234567'\n"}], + # Invalid charcters + ['e65','sum foo^bar', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: invalid operand '^bar'\n"}], + + # Empty columns + ['e66','sum 1,,', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: missing field for operation 'sum'\n"}], + + # Range with names instead of numbers + ['e67','sum foo-bar', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: field range for 'sum' must be numeric\n"}], + + # Invalid numeric value for column prasing should be treated as named column + ['e70', 'sum 1x', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: invalid numeric value '1x'\n"}], + + # Processing mode without operation + ['e71','groupby 1', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: missing operation\n"}], + + # invalid operation after valid mode + ['e72','groupby 1 foobar 2', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: invalid operation 'foobar'\n"}], + + # missing field number after processing mode + ['e73','groupby', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: missing field for operation 'groupby'\n"}], + + # Bin and optional parameters + ['e80','bin:10:30 1', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: too many parameters for operation 'bin'\n"}], + ['e81','bin: 1', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: missing parameter for operation 'bin'\n"}], + + # NOTE about the message: because the parser first parses parameters, + # then checks if the operation actually needs parameters, the + # error first complains about 'missing' because there are colons + # but no numeric values. + ['e82','sum: 1', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: missing parameter for operation 'sum'\n"}], + + ['e83','bin:10: 1', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: missing parameter for operation 'bin'\n"}], + + # These ensures the '1' is not accidentally parsed as the field number + ['e84','bin:10:1', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: missing field for operation 'bin'\n"}], + ['e85','bin:10, 1', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: missing field for operation 'bin'\n"}], + ['e86','bin:, 1', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: invalid parameter , for operation 'bin'\n"}], + ['e87','bin, 1', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: missing field for operation 'bin'\n"}], + ['e88','bin:- 1', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: invalid parameter - for operation 'bin'\n"}], + ['e89','sum:10 1', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: too many parameters for operation 'sum'\n"}], + + # Invalid field specifications for primary operations + ['e90', 'groupby 1:2', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: invalid field pair for operation 'groupby'\n"}], + ['e91', 'groupby 1-2', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: invalid field range for operation 'groupby'\n"}], + + # values for strbin operation + ['e92','strbin:- 1', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: invalid parameter - for operation 'strbin'\n"}], + ['e93','strbin:0 1', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: strbin bucket size must not be zero\n"}], + +); + +my $save_temps = $ENV{SAVE_TEMPS}; +my $verbose = $ENV{VERBOSE}; + +my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose); +exit $fail; diff -Nru datamash-1.0.7/tests/datamash-io-errors.sh datamash-1.1.1/tests/datamash-io-errors.sh --- datamash-1.0.7/tests/datamash-io-errors.sh 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/tests/datamash-io-errors.sh 2017-01-17 17:50:20.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # Unit Tests for GNU Datamash - I/O error simulation -# Copyright (C) 2014-2015 Assaf Gordon +# Copyright (C) 2014-2017 Assaf Gordon # # This file is part of GNU Datamash. # diff -Nru datamash-1.0.7/tests/datamash-md5.pl datamash-1.1.1/tests/datamash-md5.pl --- datamash-1.0.7/tests/datamash-md5.pl 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/tests/datamash-md5.pl 2017-01-17 17:50:20.000000000 +0000 @@ -2,7 +2,7 @@ =pod Unit Tests for GNU Datamash - tests md5 operations - Copyright (C) 2013-2015 Assaf Gordon + Copyright (C) 2013-2017 Assaf Gordon This file is part of GNU Datamash. diff -Nru datamash-1.0.7/tests/datamash-pair-tests.pl datamash-1.1.1/tests/datamash-pair-tests.pl --- datamash-1.0.7/tests/datamash-pair-tests.pl 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/tests/datamash-pair-tests.pl 2017-01-17 17:50:20.000000000 +0000 @@ -0,0 +1,203 @@ +#!/usr/bin/env perl +=pod + Unit Tests for GNU Datamash - perform simple calculation on input data + + Copyright (C) 2013-2017 Assaf Gordon + + This file is part of GNU Datamash. + + GNU Datamash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + GNU Datamash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Datamash. If not, see . + + Written by Assaf Gordon. +=cut +use strict; +use warnings; + +# Until a better way comes along to auto-use Coreutils Perl modules +# as in the coreutils' autotools system. +use Coreutils; +use CuSkip; +use CuTmpdir qw(datamash); +use MIME::Base64 ; + +(my $program_name = $0) =~ s|.*/||; +my $prog_bin = 'datamash'; + +## Cross-Compiling portability hack: +## under qemu/binfmt, argv[0] (which is used to report errors) will contain +## the full path of the binary, if the binary is on the $PATH. +## So we try to detect what is the actual returned value of the program +## in case of an error. +my $prog = `$prog_bin ---print-progname`; +$prog = $prog_bin unless $prog; + +# TODO: add localization tests with "grouping" +# Turn off localization of executable's output. +@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; + +## +## Portability hack: +## find the exact wording of 'nan' and inf (not-a-number). +## It's lower case in GNU/Linux,FreeBSD,OpenBSD, +## but is "NaN" on Illumos/OpenSolaris +my $nan = `$prog ---print-nan`; +die "test infrastructure failed: can't determine 'nan' string" unless $nan; +my $inf = `$prog ---print-inf`; +die "test infrastructure failed: can't determine 'inf' string" unless $inf; + +=pod +Equivalent R code + + pop.sd=function(x)(sqrt(var(x)*(length(x)-1)/length(x))) + smp.sd=sd + + # alternatively, use the built-in covariance function: + # smp.cov=cov + smp.cov <- function(x,y) { + stopifnot(identical(length(x), length(y))) + sum((x - mean(x)) * (y - mean(y))) / (length(x) - 1) + } + pop.cov <- function(x,y) { + stopifnot(identical(length(x), length(y))) + sum((x - mean(x)) * (y - mean(y))) / (length(x) ) + } + + # alternative, use the built-in covariance fuction: + # smp.pearsoncor=cor + smp.pearsoncor=function(x,y) { smp.cov(x,y)/ ( smp.sd(x)*smp.sd(y) ) } + pop.pearsoncor=function(x,y) { pop.cov(x,y)/ ( pop.sd(x)*pop.sd(y) ) } + + in1.x=c(-0.49,0.14,1.62,2.76,-0.46,3.28,-0.01,2.90,2.46,1.52) + in1.y=c(-0.21,-0.16,1.86,1.81,0.39,4.17,0.38,1.90,2.69,0.78) + + in2.x = c(1.599,-1.011,-1.687,5.070,6.944,7.934,2.134,5.150, + 10.197,11.427,10.379,14.867,11.399,13.479,18.328,16.573, + 17.804,18.694,16.690,21.805) + in2.y = seq(20) + +=cut + +my $in1=<<"EOF"; +-0.49 -0.21 +0.14 -0.16 +1.62 1.86 +2.76 1.81 +-0.46 0.39 +3.28 4.17 +-0.01 0.38 +2.90 1.90 +2.46 2.69 +1.52 0.78 +EOF + + +my $out1_scov=<<'EOF'; +1.802 +EOF + +my $out1_pcov=<<'EOF'; +1.622 +EOF + +my $out1_pcov_hdr=<<'EOF'; +pcov(field-2) +1.622 +EOF + +my $in2=<<'EOF'; +1.599 1 +-1.011 2 +-1.687 3 +5.070 4 +6.944 5 +7.934 6 +2.134 7 +5.150 8 +10.197 9 +11.427 10 +10.379 11 +14.867 12 +11.399 13 +13.479 14 +18.328 15 +16.573 16 +17.804 17 +18.694 18 +16.690 19 +21.805 20 +EOF + +my $out2_p=<<'EOF'; +0.944 +EOF + +my $out2_s=<<'EOF'; +0.944 +EOF + +my $in3=<<'EOF'; +1 2 +EOF + +my $in4=<<'EOF'; +NA NA +EOF + +my $in5=<<'EOF'; +1 2 +2 NA +3 6 +EOF + +my @Tests = +( + ['c1', 'scov 1:2', {IN_PIPE=>$in1}, {OUT=>$out1_scov}], + ['c2', 'pcov 1:2', {IN_PIPE=>$in1}, {OUT=>$out1_pcov}], + + # Pair with output headers - only one field and header should be printed + ['c3', '--header-out pcov 1:2', {IN_PIPE=>$in1}, {OUT=>$out1_pcov_hdr}], + + ['p1', 'ppearson 1:2', {IN_PIPE=>$in2}, {OUT=>$out2_p}], + ['p2', 'spearson 1:2', {IN_PIPE=>$in2}, {OUT=>$out2_s}], + + # Test operations on edge-cases of input (one items, no items, + # different number of items) + ['c4', 'scov 1:2', {IN_PIPE=>$in3}, {OUT=>"$nan\n"}], + ['p4', 'spearson 1:2', {IN_PIPE=>$in3}, {OUT=>"$nan\n"}], + + ['c5', '--narm scov 1:2', {IN_PIPE=>$in4}, {OUT=>"$nan\n"}], + ['p5', '--narm spearson 1:2', {IN_PIPE=>$in4}, {OUT=>"$nan\n"}], + + ['c6', '--narm scov 1:2', {IN_PIPE=>$in5}, {EXIT=>1}, + {ERR=>"$prog: input error for operation 'scov': " . + "fields 1,2 have different number of items\n"}], + ['p6', '--narm spearson 1:2', {IN_PIPE=>$in5}, {EXIT=>1}, + {ERR=>"$prog: input error for operation 'spearson': " . + "fields 1,2 have different number of items\n"}], +); + +my $save_temps = $ENV{SAVE_TEMPS}; +my $verbose = $ENV{VERBOSE}; + +## +## For each test, trim the resulting value to maximum three digits +## after the decimal point. +## +for my $t (@Tests) { + push @{$t}, {OUT_SUBST=>'s/^(-?\d+\.\d{1,3})\d*/\1/'}; +} + + +my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose); +exit $fail; diff -Nru datamash-1.0.7/tests/datamash-parser.pl datamash-1.1.1/tests/datamash-parser.pl --- datamash-1.0.7/tests/datamash-parser.pl 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/tests/datamash-parser.pl 2017-01-17 17:50:20.000000000 +0000 @@ -0,0 +1,199 @@ +#!/usr/bin/env perl +=pod + Unit Tests for GNU Datamash - perform simple calculation on input data + + Copyright (C) 2013-2017 Assaf Gordon + + This file is part of GNU Datamash. + + GNU Datamash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + GNU Datamash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Datamash. If not, see . + + Written by Assaf Gordon. +=cut +use strict; +use warnings; + +# Until a better way comes along to auto-use Coreutils Perl modules +# as in the coreutils' autotools system. +use Coreutils; +use CuSkip; +use CuTmpdir qw(datamash); +use MIME::Base64 ; + +(my $program_name = $0) =~ s|.*/||; +my $prog_bin = 'datamash'; + +## Cross-Compiling portability hack: +## under qemu/binfmt, argv[0] (which is used to report errors) will contain +## the full path of the binary, if the binary is on the $PATH. +## So we try to detect what is the actual returned value of the program +## in case of an error. +my $prog = `$prog_bin ---print-progname`; +$prog = $prog_bin unless $prog; + +# TODO: add localization tests with "grouping" +# Turn off localization of executable's output. +@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; + +my $in1=<<"EOF"; +A\t100\tx +A\t10\tx +B\t10\tx +B\t35\ty +EOF + +my $in2=<<"EOF"; +1 2 3 4 5 +6 7 8 9 10 +EOF + +my $out2=<<'EOF'; +7 9 11 13 15 +EOF + + +## NOTE: these tests check the parser behaviour, +## while ignoring the exact wording of the error messages. +## The 'datamash-error-msgs.pl' checks the exact message wording. +## (ERR_SUBST is used to discard the text of STDERR) +my @Tests = +( + # no explicit mode - 'sum' implies 'group by' without any columns - + # operate on entire file. + ['p1', 'sum 2', {IN_PIPE=>$in1}, {OUT=>"155\n"}], + + # 'old' syntax - with '-g' + ['p2', '-g 1 sum 2', {IN_PIPE=>$in1}, {OUT=>"A\t110\nB\t45\n"}], + + # 'new' syntax - without '-g' + ['p3', 'groupby 1 sum 2', {IN_PIPE=>$in1}, {OUT=>"A\t110\nB\t45\n"}], + ['p4', 'gb 1 sum 2', {IN_PIPE=>$in1}, {OUT=>"A\t110\nB\t45\n"}], + + # group by multiple columns + ['p5', 'gb 1,3 sum 2', {IN_PIPE=>$in1}, + {OUT=>"A\tx\t110\nB\tx\t10\nB\ty\t35\n"}], + # operate by multiple columns with comma + ['p6', 'gb 1 last 2,3', {IN_PIPE=>$in1}, + {OUT=>"A\t10\tx\nB\t35\ty\n"}], + + # many groupby columns, force the parser to allocate more array items + ['p7', 'gb 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23' . + ',24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,44,44' . + ',45,46,47,48,49,50 sum 2', {IN_PIPE=>""}, {OUT=>""}], + # many operator columns, force the parser to allocate more array items + ['p8', 'gb 1 sum 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22' . + ',23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,44,44' . + ',45,46,47,48,49,50', {IN_PIPE=>""}, {OUT=>""}], + + # Invalid numeric value for column prasing should be treated as named column + ['p9', 'sum 1x', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + + # Processing mode without operation + ['p10','groupby 1', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + + # invalid operation after valid mode + ['p11','groupby 1 foobar 2', {IN_PIPE=>""}, {EXIT=>1}, + {ERR_SUBST=>'s/.*//s'}], + + # missing field number after processing mode + ['p12','groupby', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + + # field range syntax + ['p20','sum 1-44', {IN_PIPE=>""}, {OUT=>""}], + + # compare results of equivalent syntaxes + ['p21','sum 1,2,3,4,5', {IN_PIPE=>$in2}, {OUT=>$out2}], + ['p22','sum 1-2,3-4,5', {IN_PIPE=>$in2}, {OUT=>$out2}], + ['p23','sum 1-2,3-5', {IN_PIPE=>$in2}, {OUT=>$out2}], + ['p24','sum 1-4,5', {IN_PIPE=>$in2}, {OUT=>$out2}], + ['p25','sum 1-5', {IN_PIPE=>$in2}, {OUT=>$out2}], + ['p26','sum 1 sum 2 sum 3 sum 4 sum 5', + {IN_PIPE=>$in2}, {OUT=>$out2}], + ['p27','sum 1,2 sum 3-5', + {IN_PIPE=>$in2}, {OUT=>$out2}], + + # Field range with invalid syntax + ['e20','sum 1-', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + ['e21','sum 1-x', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + ['e22','sum 4-2', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + # zero in range + ['e23','sum 0-2', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + ['e24','sum 1-0', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + #Negative in range + ['e25','sum 1--5', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + + # Test field pair syntaax + ['p40','pcov 1:2', {IN_PIPE=>""}, {OUT=>""}], + ['e41','pcov 1', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + ['e42','pcov 1:', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + ['e43','pcov :', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + ['e44','pcov :1', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + ['e46','pcov hello:world', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + ['e47','sum 1:3', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + + # Test scanner edge-cases + # Floating point value + ['e60','sum 4.5', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + + ['e61','sum 4.', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + + + # invalid numbers + ['e62','sum 4a', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + + ['e63','sum 4_', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + + # Overflow strtol + ['e64','sum 1234567890123456789012345678901234567', {IN_PIPE=>""}, {EXIT=>1}, + {ERR_SUBST=>'s/.*//s'}], + + # Invalid charcters + ['e65','sum foo^bar', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + + # Empty columns + ['e66','sum 1,,', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + + # Range with names instead of numbers + ['e67','sum foo-bar', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + + + # Valid identifiers with undersocres + ['s66','--header-in sum foo_bar', {IN_PIPE=>"foo_bar\n1\n"}, {OUT=>"1\n"}], + ['s67','--header-in sum _bar', {IN_PIPE=>"_bar\n1\n"}, {OUT=>"1\n"}], + + # Binning, and optional parameters + ['b1', 'bin 1', {IN_PIPE=>""}, {OUT=>""}], + ['b2', 'bin:10 1', {IN_PIPE=>""}, {OUT=>""}], + ['e70','bin:10:30 1', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + ['e71','bin: 1', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + ['e72','sum: 1', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + ['e73','bin:10: 1', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + ['e74','bin:10:1', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + ['e75','bin:10, 1', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + ['e76','bin:, 1', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + ['e77','bin, 1', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + ['e78','bin:- 1', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + ['e79','sum:10 1', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + + + # Field specifications for primary operations + ['e90', 'groupby 1:2', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + ['e91', 'groupby 1-2', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], +); + +my $save_temps = $ENV{SAVE_TEMPS}; +my $verbose = $ENV{VERBOSE}; + +my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose); +exit $fail; diff -Nru datamash-1.0.7/tests/datamash-rand.sh datamash-1.1.1/tests/datamash-rand.sh --- datamash-1.0.7/tests/datamash-rand.sh 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/tests/datamash-rand.sh 2017-01-17 17:50:20.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # Unit Tests for GNU Datamash - perform simple calculation on input data -# Copyright (C) 2014-2015 Assaf Gordon +# Copyright (C) 2014-2017 Assaf Gordon # # This file is part of GNU Datamash. # diff -Nru datamash-1.0.7/tests/datamash-sha.pl datamash-1.1.1/tests/datamash-sha.pl --- datamash-1.0.7/tests/datamash-sha.pl 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/tests/datamash-sha.pl 2017-01-17 17:50:20.000000000 +0000 @@ -2,7 +2,7 @@ =pod Unit Tests for GNU Datamash - tests sha1/256/5125 operations - Copyright (C) 2013-2015 Assaf Gordon + Copyright (C) 2013-2017 Assaf Gordon This file is part of GNU Datamash. diff -Nru datamash-1.0.7/tests/datamash-show-env.sh datamash-1.1.1/tests/datamash-show-env.sh --- datamash-1.0.7/tests/datamash-show-env.sh 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/tests/datamash-show-env.sh 2017-01-17 17:50:20.000000000 +0000 @@ -2,7 +2,7 @@ # Unit Tests for GNU Datamash - perform simple calculation on input data -# Copyright (C) 2014-2015 Assaf Gordon +# Copyright (C) 2014-2017 Assaf Gordon # # This file is part of GNU Datamash. # diff -Nru datamash-1.0.7/tests/datamash-sort-errors.sh datamash-1.1.1/tests/datamash-sort-errors.sh --- datamash-1.0.7/tests/datamash-sort-errors.sh 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/tests/datamash-sort-errors.sh 2017-01-17 17:50:20.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # Unit Tests for GNU Datamash - perform simple calculation on input data -# Copyright (C) 2014-2015 Assaf Gordon +# Copyright (C) 2014-2017 Assaf Gordon # # This file is part of GNU Datamash. # diff -Nru datamash-1.0.7/tests/datamash-sort-header.sh datamash-1.1.1/tests/datamash-sort-header.sh --- datamash-1.0.7/tests/datamash-sort-header.sh 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/tests/datamash-sort-header.sh 2017-01-17 17:50:20.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # Unit Tests for GNU Datamash - perform simple calculation on input data -# Copyright (C) 2014-2015 Assaf Gordon +# Copyright (C) 2014-2017 Assaf Gordon # # This file is part of GNU Datamash. # diff -Nru datamash-1.0.7/tests/datamash-stats.pl datamash-1.1.1/tests/datamash-stats.pl --- datamash-1.0.7/tests/datamash-stats.pl 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/tests/datamash-stats.pl 2017-01-17 17:50:20.000000000 +0000 @@ -2,7 +2,7 @@ =pod Unit Tests for GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2015 Assaf Gordon +# +# This file is part of GNU Datamash. +# +# GNU Datamash is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GNU Datamash is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Datamash. If not, see . +# +# Written by Assaf Gordon + +## +## This script tests the strbin (string binning/hashing) operator +## + +. "${test_dir=.}/init.sh"; path_prepend_ ./src + +fail=0 + +## Ensure seq,awk are useable +seq 10 >/dev/null 2>/dev/null \ + || skip_ "requires a working seq" + + +# Generate input +seq 1000 | sed 's/^/id-/' > in \ + || framework_failure_ "generating INPUT failed" + +# bin into 10 groups +datamash strbin 1 < in > out1 \ + || { warn_ "'datamash strbin 1' failed" ; fail=1 ; } + +# Check output values +sort -n -u < out1 > out2 || framework_failure_ "failed to sort out1" + + +# Default binning to 10 bins, accept only single digits +grep -q '^[^0-9]$' < out2 \ + && { warn_ "'datamash strbin 1' generated invalid output (out2):" ; + cat out2 >&2 ; + fail=1 ; } + +# Test binning into varying number of bins +for i in 5 10 100 300 ; +do + datamash strbin:$i 1 < in > out-$i \ + || { warn_ "'datamash strbin:$i 1' failed" ; fail=1 ; break ; } + + # Check output values + max=$(sort -n -u -r < out-$i | head -n1) + + test -n "$max" \ + || { warn_ "'datamash strbin:$i 1' failed - max output is empty" ; + fail=1 ; + break ; } + + test "$max" -gt 0 \ + || { warn_ "'datamash strbin:$i 1' failed - max value too small ($max)"; + fail=1 ; + break ; } + + test "$max" -lt "$i" \ + || { warn_ "'datamash strbin:$i 1' failed - max value too large ($max)"; + fail=1 ; + break ; } +done + + +# Same srting must result in the same bin, +# in the same run and in different runs. +# (the returned value, however, is machine-dependant) + +text="hello-42-world" +for i in 5 10 100 300 ; +do + bin1=$(printf "%s\n%s\n%s\n" "$text" "$text" "$text" \ + | datamash strbin:$i 1 | uniq) + bin2=$(printf "%s\n" "$text" \ + | datamash strbin:$i 1 | uniq) + + test -n "$bin1" \ + || { warn_ "'datamash strbin:$i 1' failed on text '$text' - empty"; + fail=1 ; + break ; } + + test "x$bin1" = "x$bin2" \ + || { warn_ "'datamash strbin:$i 1' failed on text '$text' - " \ + "bin1 ($bin1) doesn't match bin2 ($bin2)" ; + fail=1 ; + break ; } +done + + +Exit $fail diff -Nru datamash-1.0.7/tests/datamash-tests-2.pl datamash-1.1.1/tests/datamash-tests-2.pl --- datamash-1.0.7/tests/datamash-tests-2.pl 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/tests/datamash-tests-2.pl 2017-01-17 17:50:20.000000000 +0000 @@ -2,7 +2,7 @@ =pod Unit Tests for GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2015 Assaf Gordon + Copyright (C) 2013-2017 Assaf Gordon This file is part of GNU Datamash. @@ -171,6 +171,127 @@ NaN EOF +my $bin_in1=<<'EOF'; +0 +3 +7 +9 +10 +11 +15 +EOF + +# binning '$bin_in1' with default bucket-size=100 +my $bin_out1_100=<<'EOF'; +0 +0 +0 +0 +0 +0 +0 +EOF + +# binning '$bin_in1' with bucket-size=5 +my $bin_out1_5=<<'EOF'; +0 +0 +5 +5 +10 +10 +15 +EOF + +# binning '$bin_in1' with bucket-size=5.5 +my $bin_out1_5_5=<<'EOF'; +0 +0 +5.5 +5.5 +5.5 +11 +11 +EOF + +my $bin_in2=<<'EOF'; +-3 +-0.3 +0.3 +3 +103 +EOF + +my $bin_out2_100=<<'EOF'; +-100 +-100 +0 +0 +100 +EOF + +my $bin_out2_3=<<'EOF'; +-6 +-3 +0 +3 +102 +EOF + +my $round_in1=<<'EOF'; +X +-1.1 +-1.0 +-0.9 +-0.8 +-0.7 +-0.6 +-0.5 +-0.4 +-0.3 +-0.2 +-0.1 +0.0 +0.1 +0.2 +0.3 +0.4 +0.5 +0.6 +0.7 +0.8 +0.9 +1.0 +1.1 +EOF + +my $round_out1=<<'EOF'; +X round(X) floor(X) ceil(X) trunc(X) frac(X) +-1.1 -1 -2 -1 -1 -0.1 +-1.0 -1 -1 -1 -1 0 +-0.9 -1 -1 0 0 -0.9 +-0.8 -1 -1 0 0 -0.8 +-0.7 -1 -1 0 0 -0.7 +-0.6 -1 -1 0 0 -0.6 +-0.5 -1 -1 0 0 -0.5 +-0.4 0 -1 0 0 -0.4 +-0.3 0 -1 0 0 -0.3 +-0.2 0 -1 0 0 -0.2 +-0.1 0 -1 0 0 -0.1 +0.0 0 0 0 0 0 +0.1 0 0 1 0 0.1 +0.2 0 0 1 0 0.2 +0.3 0 0 1 0 0.3 +0.4 0 0 1 0 0.4 +0.5 1 0 1 0 0.5 +0.6 1 0 1 0 0.6 +0.7 1 0 1 0 0.7 +0.8 1 0 1 0 0.8 +0.9 1 0 1 0 0.9 +1.0 1 1 1 1 0 +1.1 1 1 2 1 0.1 +EOF + my @Tests = ( # Test 'min' + --full @@ -335,6 +456,18 @@ ['narm78', '--narm reverse', {IN_PIPE=>$na_all}, {OUT=>"NA\nNA\nNaN\n"}], ['narm79', '--narm transpose', {IN_PIPE=>$na_all}, {OUT=>"NA\tNA\tNaN\n"}], + + # Test binning + ['bin1', 'bin 1', {IN_PIPE=>$bin_in1}, {OUT=>$bin_out1_100}], + ['bin2', 'bin:5 1', {IN_PIPE=>$bin_in1}, {OUT=>$bin_out1_5}], + ['bin3', 'bin:5.5 1', {IN_PIPE=>$bin_in1}, {OUT=>$bin_out1_5_5}], + ['bin4', 'bin 1', {IN_PIPE=>$bin_in2}, {OUT=>$bin_out2_100}], + ['bin5', 'bin:3 1', {IN_PIPE=>$bin_in2}, {OUT=>$bin_out2_3}], + + # Test rounding functions + ['rnd1', '-H --full round 1 floor 1 ceil 1 trunc 1 frac 1', + {IN_PIPE=>$round_in1}, {OUT=>$round_out1}], + ); if ($have_stable_sort) { diff -Nru datamash-1.0.7/tests/datamash-tests.pl datamash-1.1.1/tests/datamash-tests.pl --- datamash-1.0.7/tests/datamash-tests.pl 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/tests/datamash-tests.pl 2017-01-17 17:50:20.000000000 +0000 @@ -2,7 +2,7 @@ =pod Unit Tests for GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2015 Assaf Gordon + Copyright (C) 2013-2017 Assaf Gordon This file is part of GNU Datamash. @@ -369,11 +369,9 @@ ['b22', 'rand 1', {IN_PIPE=>$in1}, {OUT => "\n"}, {OUT_SUBST=>'s/[0-9]+//'}], - - ## Some error checkings ['e1', 'sum', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: missing field number after operation 'sum'\n"}], + {ERR=>"$prog: missing field for operation 'sum'\n"}], ['e2', 'foobar', {IN_PIPE=>""}, {EXIT=>1}, {ERR=>"$prog: invalid operation 'foobar'\n"}], ['e3', '', {IN_PIPE=>""}, {EXIT=>1}, @@ -382,15 +380,15 @@ ['e4', 'sum 1' , {IN_PIPE=>"a\n"}, {EXIT=>1}, {ERR=>"$prog: invalid numeric value in line 1 field 1: 'a'\n"}], ['e5', '-g 4, sum 1' , {IN_PIPE=>"a\n"}, {EXIT=>1}, - {ERR=>"$prog: invalid empty grouping parameter\n"}], + {ERR=>"$prog: missing field for operation 'groupby'\n"}], ['e6', '-g 4,x sum 1' , {IN_PIPE=>"a\n"}, {EXIT=>1}, {ERR=>"$prog: -H or --header-in must be used with named columns\n"}], ['e7', '-g ,x sum 1' , {IN_PIPE=>"a\n"}, {EXIT=>1}, - {ERR=>"$prog: invalid empty grouping parameter\n"}], + {ERR=>"$prog: missing field for operation 'groupby'\n"}], ['e8', '-g 1,0 sum 1' , {IN_PIPE=>"a\n"}, {EXIT=>1}, - {ERR=>"$prog: invalid grouping parameter '0'\n"}], + {ERR=>"$prog: invalid field '0' for operation 'groupby'\n"}], ['e9', '-g 1X0 sum 1' , {IN_PIPE=>"a\n"}, {EXIT=>1}, - {ERR=>"$prog: -H or --header-in must be used with named columns\n"}], + {ERR=>"$prog: invalid numeric value '1X0'\n"}], ['e10', '-g 1 -t XX sum 1' , {IN_PIPE=>"a\n"}, {EXIT=>1}, {ERR=>"$prog: the delimiter must be a single character\n"}], ['e10.1', '-g 1 -t "" sum 1' , {IN_PIPE=>"a\n"}, {EXIT=>1}, @@ -419,21 +417,21 @@ ['e17', 'sum 1' , {IN_PIPE=>"1e-20000\n"}, {EXIT=>1}, {ERR=>"$prog: invalid numeric value in line 1 field 1: '1e-20000'\n"}], ['e18', 'sum 0' , {IN_PIPE=>"a"}, {EXIT=>1}, - {ERR=>"$prog: invalid column '0' for operation 'sum'\n"}], + {ERR=>"$prog: invalid field '0' for operation 'sum'\n"}], ['e19', '-- sum -2' , {IN_PIPE=>"a"}, {EXIT=>1}, - {ERR=>"$prog: invalid column '-2' for operation 'sum'\n"}], + {ERR=>"$prog: invalid field range for operation 'sum'\n"}], ['e21', 'sum ""' , {IN_PIPE=>"a"}, {EXIT=>1}, - {ERR=>"$prog: invalid empty column for operation 'sum'\n"}], + {ERR=>"$prog: missing field for operation 'sum'\n"}], ['e22', '-t" " -g 7 unique 1' , {IN_PIPE=>$in_hdr1}, {EXIT=>1}, {ERR=>"$prog: invalid input: field 7 requested, " . "line 2 has only 3 fields\n"}], ['e23', '-t" " -g -2 unique 1' , {IN_PIPE=>$in_hdr1}, {EXIT=>1}, - {ERR=>"$prog: invalid grouping parameter '-2'\n"}], + {ERR=>"$prog: invalid field '-' for operation 'groupby'\n"}], ['e24', '-t" " --header-out -g 5 count 1', {IN_PIPE=>$in_hdr1}, {EXIT=>1}, {ERR=>"$prog: invalid input: field 5 requested, " . "line 1 has only 3 fields\n"}], ['e25', '-g 1,,2 sum 1' , {IN_PIPE=>"a\n"}, {EXIT=>1}, - {ERR=>"$prog: invalid empty grouping parameter\n"}], + {ERR=>"$prog: missing field for operation 'groupby'\n"}], # No newline at the end of the lines ['nl1', 'sum 1', {IN_PIPE=>"99"}, {OUT=>"99\n"}], @@ -740,14 +738,13 @@ ## Mixing grouping,line,transpose/reverse operators should fail ['mixop1', 'sum 1 md5 2', {EXIT=>1}, - {ERR=>"$prog: conflicting operation found: expecting grouping operations," . + {ERR=>"$prog: conflicting operation found: expecting groupby operations," . " but found line operation 'md5'\n"}], ['mixop2', 'md5 1 sum 2', {EXIT=>1}, {ERR=>"$prog: conflicting operation found: expecting line operations," . - " but found grouping operation 'sum'\n"}], + " but found groupby operation 'sum'\n"}], ['mixop3', 'md5 1 transpose 2', {EXIT=>1}, - {ERR=>"$prog: conflicting operation found: expecting line operations," . - " but found transpose operation 'transpose'\n"}], + {ERR=>"$prog: conflicting operation 'transpose'\n"}], # Test large (and increasing) number of fields ['wide1', '-t" " -g 1 countunique 2', {IN_PIPE=>$in_wide1}, {OUT=>"A 1\n"}], diff -Nru datamash-1.0.7/tests/datamash-transpose.pl datamash-1.1.1/tests/datamash-transpose.pl --- datamash-1.0.7/tests/datamash-transpose.pl 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/tests/datamash-transpose.pl 2017-01-17 17:50:20.000000000 +0000 @@ -4,7 +4,7 @@ Tests for 'transpose' and 'reverse' operation modes. - Copyright (C) 2013-2015 Assaf Gordon + Copyright (C) 2013-2017 Assaf Gordon This file is part of GNU Datamash. @@ -135,6 +135,18 @@ EOF +# Transposing with missing value in the last line +# (bug in 1.1.0 would result in 'c' being silently dropped). +my $in_missing1=<<'EOF'; +a b c +1 2 +EOF +my $out_missing1=<<'EOF'; +a 1 +b 2 +c N/A +EOF + my @Tests = ( # Simple transpose and reverse @@ -180,9 +192,9 @@ # Extra operands ['tr9', 'transpose aaa', {IN_PIPE=>''}, {EXIT=>1}, - {ERR=>"$prog: extra operands after 'transpose'\n"}], + {ERR=>"$prog: extra operand 'aaa'\n"}], ['rev9', 'reverse aaa', {IN_PIPE=>''}, {EXIT=>1}, - {ERR=>"$prog: extra operands after 'reverse'\n"}], + {ERR=>"$prog: extra operand 'aaa'\n"}], # empty input ['tr10', 'transpose', {IN_PIPE=>""}, {OUT=>""}], @@ -201,6 +213,11 @@ # Generate a new header, assuming the first line is a NOT header line. ['rev-hdr6','-t: --header-out reverse', {IN_PIPE=>$in_hdr1}, {OUT=>"field-2:field-1\nY:X\na:1\nb:2\n"}], + + # bug uncovered by report in: + # http://lists.gnu.org/archive/html/bug-datamash/2016-09/msg00000.html + ['msg1', '--no-strict transpose', {IN_PIPE=>$in_missing1}, + {OUT=>$out_missing1}], ); my $save_temps = $ENV{SAVE_TEMPS}; diff -Nru datamash-1.0.7/tests/datamash-valgrind.sh datamash-1.1.1/tests/datamash-valgrind.sh --- datamash-1.0.7/tests/datamash-valgrind.sh 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/tests/datamash-valgrind.sh 2017-01-17 17:50:20.000000000 +0000 @@ -2,7 +2,7 @@ # Unit Tests for GNU Datamash - perform simple calculation on input data -# Copyright (C) 2014-2015 Assaf Gordon +# Copyright (C) 2014-2017 Assaf Gordon # # This file is part of GNU Datamash. # @@ -72,6 +72,7 @@ shuf 1M ; shuf 1M ; seq -w 999000 1001000 ) > 4M || framework_failure_ "failed to prepare '4M' file" +seq -w 1001000 > 1M1K || framework_failure_ "failed to prepare '1M1K' file" ## Prepare a file with very wide fields for i in $(seq 1 193 2000) $(seq 500 -7 100); @@ -146,8 +147,25 @@ ## Test remove-duplicates (using gnulib's hash) cat 4M | valgrind --track-origins=yes --leak-check=full \ --show-reachable=yes --error-exitcode=1 \ - datamash rmdup 1 > /dev/null || + datamash rmdup 1 > rmdup_1M_1.t || { warn_ "rmdup failed on 4M" ; fail=1 ; } +sort < rmdup_1M_1.t > rmdup_1M_1 \ + || framework_failure_ "failed to sort rmdup_1M_1.t" +cmp rmdup_1M_1 1M1K || + { warn_ "rmdup failed on 4M (output differences)" ; + fail=1 ; } + +## Test remove-duplicates (using gnulib's hash), +## with smaller memory buffers +cat 4M | valgrind --track-origins=yes --leak-check=full \ + --show-reachable=yes --error-exitcode=1 \ + datamash ---rmdup-test rmdup 1 > rmdup_1M_2.t || + { warn_ "rmdup failed on 4M (2)" ; fail=1 ; } +sort < rmdup_1M_2.t > rmdup_1M_2 \ + || framework_failure_ "failed to sort rmdup_1M_2.t" +cmp rmdup_1M_2 1M1K || + { warn_ "rmdup (2) failed on 4M (output differences)" ; + fail=1 ; } ## Test Base64 encode/decode cat wide | valgrind --track-origins=yes --leak-check=full \ @@ -159,6 +177,12 @@ datamash debase64 1 > wide_orig || { warn_ "debase64 failed on wide_base64" ; fail=1 ; } +## Test Covariance (and paired-columns) +cat in_4k_rows | valgrind --track-origins=yes --leak-check=full \ + --show-reachable=yes --error-exitcode=1 \ + datamash pcov 1:2 > /dev/null || + { warn_ "pcov 1:2 failed on in_4k_rows" ; fail=1 ; } + cmp wide wide_orig || { warn_ "base64 decoding failed (decoded output does not match original)"; fail=1 ; } diff -Nru datamash-1.0.7/tests/init.sh datamash-1.1.1/tests/init.sh --- datamash-1.0.7/tests/init.sh 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/tests/init.sh 2017-01-10 20:44:02.000000000 +0000 @@ -1,9 +1,6 @@ # source this file; set up for tests -# Copyright (C) 2009-2014 Free Software Foundation, Inc. - -# Modifications for GNU Datamash are -# Copyright (C) 2014-2015 Assaf Gordon +# Copyright (C) 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 General Public License as published by @@ -96,6 +93,27 @@ fatal_ () { warn_ "$ME_: hard error: $@"; Exit 99; } framework_failure_ () { warn_ "$ME_: set-up failure: $@"; Exit 99; } +# This is used to simplify checking of the return value +# which is useful when ensuring a command fails as desired. +# I.e., just doing `command ... &&fail=1` will not catch +# a segfault in command for example. With this helper you +# instead check an explicit exit code like +# returns_ 1 command ... || fail +returns_ () { + # Disable tracing so it doesn't interfere with stderr of the wrapped command + { set +x; } 2>/dev/null + + local exp_exit="$1" + shift + "$@" + test $? -eq $exp_exit && ret_=0 || ret_=1 + + if test "$VERBOSE" = yes && test "$gl_set_x_corrupts_stderr_" = false; then + set -x + fi + { return $ret_; } 2>/dev/null +} + # Sanitize this shell to POSIX mode, if possible. DUALCASE=1; export DUALCASE if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then @@ -132,6 +150,7 @@ # ? - not ok gl_shell_test_script_=' test $(echo y) = y || exit 1 +f_local_() { local v=1; }; f_local_ || exit 1 score_=10 if test "$VERBOSE" = yes; then test -n "$( (exec 3>&1; set -x; P=1 true 2>&3) 2> /dev/null)" && score_=9 @@ -308,7 +327,7 @@ fi } fi -elif ( cmp --version < /dev/null 2>&1 | grep GNU ) > /dev/null 2>&1; then +elif cmp -s /dev/null /dev/null 2>/dev/null; then compare_ () { cmp -s "$@"; } else compare_ () { cmp "$@"; } diff -Nru datamash-1.0.7/tests/no-perl datamash-1.1.1/tests/no-perl --- datamash-1.0.7/tests/no-perl 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/tests/no-perl 2017-01-17 17:50:20.000000000 +0000 @@ -2,7 +2,7 @@ # Unit Tests for GNU Datamash - stub for systems without Perl -# Copyright (C) 2014-2015 Assaf Gordon +# Copyright (C) 2014-2017 Assaf Gordon # # This file is part of GNU Datamash. # diff -Nru datamash-1.0.7/THANKS datamash-1.1.1/THANKS --- datamash-1.0.7/THANKS 2015-06-14 21:16:13.000000000 +0000 +++ datamash-1.1.1/THANKS 2017-01-17 17:50:20.000000000 +0000 @@ -1,6 +1,6 @@ Additional contributors to datamash. - Copyright (C) 2013-2015 Assaf Gordon + Copyright (C) 2013-2017 Assaf Gordon Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright diff -Nru datamash-1.0.7/TODO datamash-1.1.1/TODO --- datamash-1.0.7/TODO 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.1.1/TODO 2014-08-15 20:07:26.000000000 +0000 @@ -0,0 +1,4 @@ +Protect autosort with: + Autosort with ' delimiter + with NULL delimiter +test null delimiter