diff -Nru datamash-1.7/aclocal.m4 datamash-1.8/aclocal.m4 --- datamash-1.7/aclocal.m4 2020-04-23 17:33:55.000000000 +0000 +++ datamash-1.8/aclocal.m4 2022-05-28 02:54:10.000000000 +0000 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.1 -*- Autoconf -*- +# generated automatically by aclocal 1.16.5 -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,9 +20,9 @@ If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -dnl serial 11 (pkg-config-0.29) -dnl +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 12 (pkg-config-0.29.2) + dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson dnl @@ -63,7 +63,7 @@ dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], -[m4_define([PKG_MACROS_VERSION], [0.29]) +[m4_define([PKG_MACROS_VERSION], [0.29.2]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ @@ -164,7 +164,7 @@ AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no -AC_MSG_CHECKING([for $1]) +AC_MSG_CHECKING([for $2]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) @@ -174,11 +174,11 @@ See the pkg-config man page for more details.]) if test $pkg_failed = yes; then - AC_MSG_RESULT([no]) + AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` - else + else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs @@ -195,7 +195,7 @@ _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then - AC_MSG_RESULT([no]) + AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full @@ -296,7 +296,7 @@ AS_VAR_IF([$1], [""], [$5], [$4])dnl ])dnl PKG_CHECK_VAR -# Copyright (C) 2002-2018 Free Software Foundation, Inc. +# Copyright (C) 2002-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -311,7 +311,7 @@ [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.16.1], [], +m4_if([$1], [1.16.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -327,14 +327,14 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.16.1])dnl +[AM_AUTOMAKE_VERSION([1.16.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -386,7 +386,7 @@ # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -417,7 +417,7 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -608,7 +608,7 @@ # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -647,7 +647,9 @@ done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE="gmake" (or whatever is + necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi @@ -674,7 +676,7 @@ # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -702,6 +704,10 @@ # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl +m4_ifdef([_$0_ALREADY_INIT], + [m4_fatal([$0 expanded multiple times +]m4_defn([_$0_ALREADY_INIT]))], + [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl @@ -738,7 +744,7 @@ [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( - m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl @@ -790,6 +796,20 @@ [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi +AC_SUBST([CTAGS]) +if test -z "$ETAGS"; then + ETAGS=etags +fi +AC_SUBST([ETAGS]) +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi +AC_SUBST([CSCOPE]) + AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This @@ -871,7 +891,7 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -892,7 +912,7 @@ fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2018 Free Software Foundation, Inc. +# Copyright (C) 2003-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -913,7 +933,7 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -956,7 +976,7 @@ # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -977,12 +997,7 @@ [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac + MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then @@ -995,7 +1010,7 @@ # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1024,7 +1039,7 @@ AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1071,7 +1086,7 @@ # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1090,7 +1105,7 @@ # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1171,7 +1186,7 @@ rm -f conftest.file ]) -# Copyright (C) 2009-2018 Free Software Foundation, Inc. +# Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1231,7 +1246,7 @@ _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1259,7 +1274,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2018 Free Software Foundation, Inc. +# Copyright (C) 2006-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1278,7 +1293,7 @@ # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2018 Free Software Foundation, Inc. +# Copyright (C) 2004-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1414,6 +1429,7 @@ m4_include([m4/absolute-header.m4]) m4_include([m4/af_alg.m4]) m4_include([m4/alloca.m4]) +m4_include([m4/arpa_inet_h.m4]) m4_include([m4/assert.m4]) m4_include([m4/base64.m4]) m4_include([m4/byteswap.m4]) @@ -1421,11 +1437,12 @@ m4_include([m4/ceil.m4]) m4_include([m4/ceill.m4]) m4_include([m4/check-math-lib.m4]) +m4_include([m4/close.m4]) m4_include([m4/codeset.m4]) m4_include([m4/configmake.m4]) m4_include([m4/ctype.m4]) -m4_include([m4/dirname.m4]) m4_include([m4/double-slash-root.m4]) +m4_include([m4/dup2.m4]) m4_include([m4/eealloc.m4]) m4_include([m4/errno_h.m4]) m4_include([m4/error.m4]) @@ -1438,7 +1455,11 @@ m4_include([m4/extern-inline.m4]) m4_include([m4/fabs.m4]) m4_include([m4/fabsl.m4]) +m4_include([m4/fcntl-o.m4]) +m4_include([m4/fcntl.m4]) +m4_include([m4/fcntl_h.m4]) m4_include([m4/fflush.m4]) +m4_include([m4/flexmember.m4]) m4_include([m4/float_h.m4]) m4_include([m4/floor.m4]) m4_include([m4/floorl.m4]) @@ -1453,6 +1474,7 @@ m4_include([m4/fstat.m4]) m4_include([m4/ftell.m4]) m4_include([m4/ftello.m4]) +m4_include([m4/getdtablesize.m4]) m4_include([m4/getopt.m4]) m4_include([m4/getprogname.m4]) m4_include([m4/gettext.m4]) @@ -1464,11 +1486,14 @@ m4_include([m4/iconv_h.m4]) m4_include([m4/iconv_open.m4]) m4_include([m4/include_next.m4]) +m4_include([m4/inet_pton.m4]) m4_include([m4/inline.m4]) +m4_include([m4/intl-thread-locale.m4]) m4_include([m4/intlmacosx.m4]) +m4_include([m4/intmax_t.m4]) m4_include([m4/inttostr.m4]) -m4_include([m4/inttypes-pri.m4]) m4_include([m4/inttypes.m4]) +m4_include([m4/inttypes_h.m4]) m4_include([m4/isblank.m4]) m4_include([m4/isfinite.m4]) m4_include([m4/isinf.m4]) @@ -1478,7 +1503,9 @@ m4_include([m4/iswblank.m4]) m4_include([m4/iswdigit.m4]) m4_include([m4/iswxdigit.m4]) +m4_include([m4/langinfo_h.m4]) m4_include([m4/largefile.m4]) +m4_include([m4/lcmessage.m4]) m4_include([m4/ldexp.m4]) m4_include([m4/ldexpl.m4]) m4_include([m4/lib-ld.m4]) @@ -1492,6 +1519,8 @@ m4_include([m4/locale-zh.m4]) m4_include([m4/locale_h.m4]) m4_include([m4/localeconv.m4]) +m4_include([m4/localename.m4]) +m4_include([m4/lock.m4]) m4_include([m4/log.m4]) m4_include([m4/logl.m4]) m4_include([m4/lseek.m4]) @@ -1504,12 +1533,12 @@ m4_include([m4/mbrtowc.m4]) m4_include([m4/mbsinit.m4]) m4_include([m4/mbslen.m4]) -m4_include([m4/mbsrtowcs.m4]) m4_include([m4/mbstate_t.m4]) m4_include([m4/md5.m4]) m4_include([m4/memchr.m4]) m4_include([m4/minmax.m4]) m4_include([m4/mmap-anon.m4]) +m4_include([m4/mode_t.m4]) m4_include([m4/modf.m4]) m4_include([m4/modfl.m4]) m4_include([m4/msvc-inval.m4]) @@ -1520,55 +1549,77 @@ m4_include([m4/nocrash.m4]) m4_include([m4/non-recursive-gnulib-prefix-hack.m4]) m4_include([m4/off_t.m4]) +m4_include([m4/open-cloexec.m4]) +m4_include([m4/open-slash.m4]) +m4_include([m4/open.m4]) m4_include([m4/pathmax.m4]) +m4_include([m4/pclose.m4]) +m4_include([m4/pid_t.m4]) m4_include([m4/po.m4]) +m4_include([m4/popen.m4]) +m4_include([m4/printf.m4]) m4_include([m4/progtest.m4]) +m4_include([m4/pthread_rwlock_rdlock.m4]) m4_include([m4/quotearg.m4]) m4_include([m4/random.m4]) m4_include([m4/random_r.m4]) m4_include([m4/realloc.m4]) m4_include([m4/round.m4]) m4_include([m4/roundl.m4]) +m4_include([m4/setlocale.m4]) m4_include([m4/setlocale_null.m4]) m4_include([m4/sha1.m4]) m4_include([m4/sha256.m4]) m4_include([m4/sha512.m4]) m4_include([m4/signbit.m4]) m4_include([m4/size_max.m4]) +m4_include([m4/snprintf.m4]) m4_include([m4/socklen.m4]) +m4_include([m4/sockpfaf.m4]) m4_include([m4/sqrt.m4]) m4_include([m4/sqrtl.m4]) m4_include([m4/ssize_t.m4]) m4_include([m4/stat-time.m4]) +m4_include([m4/stat.m4]) m4_include([m4/std-gnu11.m4]) m4_include([m4/stdalign.m4]) m4_include([m4/stdarg.m4]) m4_include([m4/stdbool.m4]) m4_include([m4/stddef_h.m4]) m4_include([m4/stdint.m4]) +m4_include([m4/stdint_h.m4]) 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/strcase.m4]) +m4_include([m4/strdup.m4]) m4_include([m4/strerror.m4]) m4_include([m4/string_h.m4]) +m4_include([m4/strings_h.m4]) m4_include([m4/strndup.m4]) m4_include([m4/strnlen.m4]) m4_include([m4/strsep.m4]) +m4_include([m4/strtod.m4]) +m4_include([m4/strtold.m4]) +m4_include([m4/strtoll.m4]) m4_include([m4/strtoull.m4]) m4_include([m4/strtoumax.m4]) m4_include([m4/sys_socket_h.m4]) m4_include([m4/sys_stat_h.m4]) m4_include([m4/sys_types_h.m4]) m4_include([m4/sys_uio_h.m4]) +m4_include([m4/sys_wait_h.m4]) m4_include([m4/threadlib.m4]) m4_include([m4/time_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/vasnprintf.m4]) m4_include([m4/version-etc.m4]) m4_include([m4/visibility.m4]) +m4_include([m4/waitpid.m4]) m4_include([m4/warn-on-use.m4]) m4_include([m4/warnings.m4]) m4_include([m4/wchar_h.m4]) @@ -1577,6 +1628,7 @@ m4_include([m4/wcwidth.m4]) m4_include([m4/wint_t.m4]) m4_include([m4/xalloc.m4]) +m4_include([m4/xsize.m4]) m4_include([m4/xstrndup.m4]) m4_include([m4/xstrtol.m4]) m4_include([m4/zzgnulib.m4]) diff -Nru datamash-1.7/AUTHORS datamash-1.8/AUTHORS --- datamash-1.7/AUTHORS 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/AUTHORS 2022-06-01 21:08:00.000000000 +0000 @@ -1,12 +1,12 @@ -Authors of GNU datamash. +GNU Datamash was originally authored by Assaf Gordon . +It is currently maintained by Assaf Gordon and Tim Rice +, with assistance from Shawn Wagner and Erik Auerswald. - Copyright (C) 2013-2020 Assaf Gordon +In addition, the following have provided patches and/or Git commits to Datamash: - 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. + Barry Nisly + Benno Schulenberg + Jeroen Roovers + Yu Fu -The following contributions warranted legal paper exchanges with the -Free Software Foundation. See also the ChangeLog and THANKS files. - -(empty at the moment) +See also the THANKS file. diff -Nru datamash-1.7/build-aux/announce-gen datamash-1.8/build-aux/announce-gen --- datamash-1.7/build-aux/announce-gen 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/build-aux/announce-gen 2022-05-28 01:46:58.000000000 +0000 @@ -3,7 +3,7 @@ # Generate a release announcement message. -# Copyright (C) 2002-2020 Free Software Foundation, Inc. +# Copyright (C) 2002-2021 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,11 +31,11 @@ # are valid code in both sh and perl. When executed by sh, they re-execute # the script through the perl program found in $PATH. The '-x' option # is essential as well; without it, perl would re-execute the script -# through /bin/sh. When executed by perl, the next two lines are a no-op. +# through /bin/sh. When executed by perl, the next two lines are a no-op. eval 'exec perl -wSx "$0" "$@"' if 0; -my $VERSION = '2018-03-07 03:46'; # UTC +my $VERSION = '2020-05-10 16:13'; # 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 @@ -48,7 +48,7 @@ (my $ME = $0) =~ s|.*/||; my %valid_release_types = map {$_ => 1} qw (alpha beta stable); -my @archive_suffixes = ('tar.gz', 'tar.bz2', 'tar.lzma', 'tar.xz'); +my @archive_suffixes = qw (tar.gz tar.bz2 tar.lz tar.lzma tar.xz); my %digest_classes = ( 'md5' => (eval { require Digest::MD5; } and 'Digest::MD5'), @@ -371,8 +371,8 @@ } { - # Neutralize the locale, so that, for instance, "du" does not - # issue "1,2" instead of "1.2", what confuses our regexps. + # Use the C locale so that, for instance, "du" does not + # print "1,2" instead of "1.2", which would confuse our regexps. $ENV{LC_ALL} = "C"; my $mail_headers; diff -Nru datamash-1.7/build-aux/ar-lib datamash-1.8/build-aux/ar-lib --- datamash-1.7/build-aux/ar-lib 2017-02-21 18:45:42.000000000 +0000 +++ datamash-1.8/build-aux/ar-lib 1970-01-01 00:00:00.000000000 +0000 @@ -1,270 +0,0 @@ -#! /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 <. -# -# 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 -# . - -nl=' -' - -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent tools from complaining about whitespace usage. -IFS=" "" $nl" - -file_conv= - -# func_file_conv build_file lazy -# Convert a $build file to $host form and store it in $file -# Currently only supports Windows hosts. If the determined conversion -# type is listed in (the comma separated) LAZY, no conversion will -# take place. -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/,$2, in - *,$file_conv,*) - ;; - 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_cl_dashL linkdir -# Make cl look for libraries in LINKDIR -func_cl_dashL () -{ - func_file_conv "$1" - if test -z "$lib_path"; then - lib_path=$file - else - lib_path="$lib_path;$file" - fi - linker_opts="$linker_opts -LIBPATH:$file" -} - -# func_cl_dashl library -# Do a library search-path lookup for cl -func_cl_dashl () -{ - lib=$1 - found=no - save_IFS=$IFS - IFS=';' - for dir in $lib_path $LIB - do - IFS=$save_IFS - if $shared && test -f "$dir/$lib.dll.lib"; then - found=yes - lib=$dir/$lib.dll.lib - break - fi - if test -f "$dir/$lib.lib"; then - found=yes - lib=$dir/$lib.lib - break - fi - if test -f "$dir/lib$lib.a"; then - found=yes - lib=$dir/lib$lib.a - break - fi - done - IFS=$save_IFS - - if test "$found" != yes; then - lib=$lib.lib - fi -} - -# func_cl_wrapper cl arg... -# Adjust compile command to suit cl -func_cl_wrapper () -{ - # Assume a capable shell - lib_path= - shared=: - linker_opts= - for arg - do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as 'compile cc -o foo foo.c'. - eat=1 - case $2 in - *.o | *.[oO][bB][jJ]) - func_file_conv "$2" - set x "$@" -Fo"$file" - shift - ;; - *) - func_file_conv "$2" - set x "$@" -Fe"$file" - shift - ;; - esac - ;; - -I) - eat=1 - func_file_conv "$2" mingw - set x "$@" -I"$file" - shift - ;; - -I*) - func_file_conv "${1#-I}" mingw - set x "$@" -I"$file" - shift - ;; - -l) - eat=1 - func_cl_dashl "$2" - set x "$@" "$lib" - shift - ;; - -l*) - func_cl_dashl "${1#-l}" - set x "$@" "$lib" - shift - ;; - -L) - eat=1 - func_cl_dashL "$2" - ;; - -L*) - func_cl_dashL "${1#-L}" - ;; - -static) - shared=false - ;; - -Wl,*) - arg=${1#-Wl,} - save_ifs="$IFS"; IFS=',' - for flag in $arg; do - IFS="$save_ifs" - linker_opts="$linker_opts $flag" - done - IFS="$save_ifs" - ;; - -Xlinker) - eat=1 - linker_opts="$linker_opts $2" - ;; - -*) - set x "$@" "$1" - shift - ;; - *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) - func_file_conv "$1" - set x "$@" -Tp"$file" - shift - ;; - *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) - func_file_conv "$1" mingw - set x "$@" "$file" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift - done - if test -n "$linker_opts"; then - linker_opts="-link$linker_opts" - fi - exec "$@" $linker_opts - exit 1 -} - -eat= - -case $1 in - '') - echo "$0: No command. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: compile [--help] [--version] PROGRAM [ARGS] - -Wrapper for compilers which do not understand '-c -o'. -Remove '-o dest.o' from ARGS, run PROGRAM with the remaining -arguments, and rename the output as expected. - -If you are trying to build a whole package this is not the -right script to run: please start by reading the file 'INSTALL'. - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "compile $scriptversion" - exit $? - ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) - func_cl_wrapper "$@" # Doesn't return... - ;; -esac - -ofile= -cfile= - -for arg -do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as 'compile cc -o foo foo.c'. - # So we strip '-o arg' only if arg is an object. - eat=1 - case $2 in - *.o | *.obj) - ofile=$2 - ;; - *) - set x "$@" -o "$2" - shift - ;; - esac - ;; - *.c) - cfile=$1 - set x "$@" "$1" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift -done - -if test -z "$ofile" || test -z "$cfile"; then - # If no '-o' option was seen then we might have been invoked from a - # pattern rule where we don't need one. That is ok -- this is a - # normal compilation that the losing compiler can handle. If no - # '.c' file was seen then we are probably linking. That is also - # ok. - exec "$@" -fi - -# Name of file we expect compiler to create. -cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` - -# Create the lock directory. -# Note: use '[/\\:.-]' here to ensure that we don't use the same name -# that we are using for the .o file. Also, base the name on the expected -# object file name, since that is what matters with a parallel build. -lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d -while true; do - if mkdir "$lockdir" >/dev/null 2>&1; then - break - fi - sleep 1 -done -# FIXME: race condition here if user kills between mkdir and trap. -trap "rmdir '$lockdir'; exit 1" 1 2 15 - -# Run the compile. -"$@" -ret=$? - -if test -f "$cofile"; then - test "$cofile" = "$ofile" || mv "$cofile" "$ofile" -elif test -f "${cofile}bj"; then - test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" -fi - -rmdir "$lockdir" -exit $ret - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# 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-end: "; # UTC" -# End: diff -Nru datamash-1.7/build-aux/config.guess datamash-1.8/build-aux/config.guess --- datamash-1.7/build-aux/config.guess 2020-04-23 04:02:47.000000000 +0000 +++ datamash-1.8/build-aux/config.guess 2022-05-28 01:46:33.000000000 +0000 @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2020 Free Software Foundation, Inc. +# Copyright 1992-2021 Free Software Foundation, Inc. -timestamp='2020-01-01' +timestamp='2021-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 @@ -27,12 +27,12 @@ # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # # Please send patches to . -me=`echo "$0" | sed -e 's,.*/,,'` +me=$(echo "$0" | sed -e 's,.*/,,') usage="\ Usage: $0 [OPTION] @@ -50,7 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2020 Free Software Foundation, Inc. +Copyright 1992-2021 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." @@ -103,7 +103,7 @@ test "$tmp" && return 0 : "${TMPDIR=/tmp}" # shellcheck disable=SC2039 - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { tmp=$( (umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null) && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } @@ -131,16 +131,14 @@ PATH=$PATH:/.attbin ; export PATH fi -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +UNAME_MACHINE=$( (uname -m) 2>/dev/null) || UNAME_MACHINE=unknown +UNAME_RELEASE=$( (uname -r) 2>/dev/null) || UNAME_RELEASE=unknown +UNAME_SYSTEM=$( (uname -s) 2>/dev/null) || UNAME_SYSTEM=unknown +UNAME_VERSION=$( (uname -v) 2>/dev/null) || UNAME_VERSION=unknown case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu + LIBC=unknown set_cc_for_build cat <<-EOF > "$dummy.c" @@ -149,17 +147,29 @@ LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc - #else + #elif defined(__GLIBC__) LIBC=gnu + #else + #include + /* First heuristic to detect musl libc. */ + #ifdef __DEFINED_va_list + LIBC=musl + #endif #endif EOF - eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g')" - # If ldd exists, use it to detect musl libc. - if command -v ldd >/dev/null && \ - ldd --version 2>&1 | grep -q ^musl - then - LIBC=musl + # Second heuristic to detect musl libc. + if [ "$LIBC" = unknown ] && + command -v ldd >/dev/null && + ldd --version 2>&1 | grep -q ^musl; then + LIBC=musl + fi + + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + if [ "$LIBC" = unknown ]; then + LIBC=gnu fi ;; esac @@ -179,19 +189,20 @@ # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + UNAME_MACHINE_ARCH=$( (uname -p 2>/dev/null || \ "/sbin/$sysctl" 2>/dev/null || \ "/usr/sbin/$sysctl" 2>/dev/null || \ - echo unknown)` + echo unknown)) case "$UNAME_MACHINE_ARCH" in + aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) - arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` - endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + arch=$(echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,') + endian=$(echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p') machine="${arch}${endian}"-unknown ;; *) machine="$UNAME_MACHINE_ARCH"-unknown ;; @@ -222,7 +233,7 @@ case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' - abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` + abi=$(echo "$UNAME_MACHINE_ARCH" | sed -e "$expr") ;; esac # The OS release @@ -235,7 +246,7 @@ release='-gnu' ;; *) - release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` + release=$(echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2) ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: @@ -244,15 +255,15 @@ echo "$machine-${os}${release}${abi-}" exit ;; *:Bitrig:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + UNAME_MACHINE_ARCH=$(arch | sed 's/Bitrig.//') echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + UNAME_MACHINE_ARCH=$(arch | sed 's/OpenBSD.//') echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" exit ;; *:LibertyBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + UNAME_MACHINE_ARCH=$(arch | sed 's/^.*BSD\.//') echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" exit ;; *:MidnightBSD:*:*) @@ -288,17 +299,17 @@ alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $3}') ;; *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $4}') ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + 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 ;; @@ -336,7 +347,7 @@ # 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 @@ -370,7 +381,7 @@ exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then + if test "$( (/bin/universe) 2>/dev/null)" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd @@ -383,17 +394,17 @@ echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in + case $(/usr/bin/uname -p) in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) - echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" + echo "$UNAME_MACHINE"-ibm-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" exit ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + echo sparc-hal-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" + echo sparc-sun-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux"$UNAME_RELEASE" @@ -404,7 +415,7 @@ # 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 test "$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) | \ grep IS_64BIT_ARCH >/dev/null @@ -412,30 +423,30 @@ SUN_ARCH=x86_64 fi fi - echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + echo "$SUN_ARCH"-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + echo sparc-sun-solaris3"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" exit ;; sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in + case "$(/usr/bin/arch -k)" in Series*|S4*) - UNAME_RELEASE=`uname -v` + UNAME_RELEASE=$(uname -v) ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" + echo sparc-sun-sunos"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/')" exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + UNAME_RELEASE=$( (sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null) test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 - case "`/bin/arch`" in + case "$(/bin/arch)" in sun3) echo m68k-sun-sunos"$UNAME_RELEASE" ;; @@ -515,8 +526,8 @@ } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && - dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`"$dummy" "$dummyarg"` && + dummyarg=$(echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p') && + SYSTEM_NAME=$("$dummy" "$dummyarg") && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos"$UNAME_RELEASE" exit ;; @@ -543,11 +554,11 @@ exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] + UNAME_PROCESSOR=$(/usr/bin/uname -p) + if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then - if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ - [ "$TARGET_BINARY_INTERFACE"x = x ] + if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ + test "$TARGET_BINARY_INTERFACE"x = x then echo m88k-dg-dgux"$UNAME_RELEASE" else @@ -571,17 +582,17 @@ echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) - echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" + echo mips-sgi-irix"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/g')" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + exit ;; # Note that: echo "'$(uname -s)'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` + if test -x /usr/bin/oslevel ; then + IBM_REV=$(/usr/bin/oslevel) else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi @@ -601,7 +612,7 @@ exit(0); } EOF - if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") then echo "$SYSTEM_NAME" else @@ -614,15 +625,15 @@ fi exit ;; *:AIX:*:[4567]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + IBM_CPU_ID=$(/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }') if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi - if [ -x /usr/bin/lslpp ] ; then - IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | - awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + if test -x /usr/bin/lslpp ; then + IBM_REV=$(/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/) else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi @@ -650,14 +661,14 @@ echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') case "$UNAME_MACHINE" in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + if test -x /usr/bin/getconf; then + 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 @@ -669,7 +680,7 @@ esac ;; esac fi - if [ "$HP_ARCH" = "" ]; then + if test "$HP_ARCH" = ""; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" @@ -704,11 +715,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 test "$HP_ARCH" = hppa2.0w then set_cc_for_build @@ -732,7 +743,7 @@ echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) - HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) @@ -762,7 +773,7 @@ exit (0); } EOF - $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; @@ -782,7 +793,7 @@ echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then + if test -x /usr/sbin/sysversion ; then echo "$UNAME_MACHINE"-unknown-osf1mk else echo "$UNAME_MACHINE"-unknown-osf1 @@ -831,14 +842,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_REL=`echo "$UNAME_RELEASE" | 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:*:*) @@ -851,25 +862,25 @@ echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" exit ;; arm:FreeBSD:*:*) - UNAME_PROCESSOR=`uname -p` + UNAME_PROCESSOR=$(uname -p) set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi + echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabi else - echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf + echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabihf fi exit ;; *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` + UNAME_PROCESSOR=$(/usr/bin/uname -p) case "$UNAME_PROCESSOR" in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac - echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" + echo "$UNAME_PROCESSOR"-unknown-freebsd"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" exit ;; i*:CYGWIN*:*) echo "$UNAME_MACHINE"-pc-cygwin @@ -905,15 +916,15 @@ echo x86_64-pc-cygwin exit ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + echo powerpcle-unknown-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" exit ;; *:GNU:*:*) # the GNU system - echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" + echo "$(echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,')-unknown-$LIBC$(echo "$UNAME_RELEASE"|sed -e 's,/.*$,,')" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``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 ;; *:Minix:*:*) echo "$UNAME_MACHINE"-unknown-minix @@ -926,7 +937,7 @@ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in + case $(sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null) in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; @@ -985,6 +996,9 @@ k1om:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; + loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; m32r*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; @@ -1035,7 +1049,7 @@ #endif #endif EOF - eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`" + eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI')" test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) @@ -1055,7 +1069,7 @@ exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + case $(grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2) in PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; *) echo hppa-unknown-linux-"$LIBC" ;; @@ -1073,7 +1087,7 @@ ppcle:Linux:*:*) echo powerpcle-unknown-linux-"$LIBC" exit ;; - riscv32:Linux:*:* | riscv64:Linux:*:*) + riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) @@ -1095,7 +1109,17 @@ echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) - echo "$UNAME_MACHINE"-pc-linux-"$LIBC" + set_cc_for_build + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_X32 >/dev/null + then + LIBCABI="$LIBC"x32 + fi + fi + echo "$UNAME_MACHINE"-pc-linux-"$LIBCABI" exit ;; xtensa*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" @@ -1135,7 +1159,7 @@ echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; i*86:*:4.*:*) - UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` + UNAME_REL=$(echo "$UNAME_RELEASE" | sed 's/\/MP$//') if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else @@ -1144,7 +1168,7 @@ exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in + case $(/bin/uname -X | grep "^Machine") in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; @@ -1153,10 +1177,10 @@ exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + UNAME_REL=$( (/bin/uname -X|grep Release|sed -e 's/.*= //')) (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 @@ -1206,7 +1230,7 @@ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ @@ -1217,7 +1241,7 @@ NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ @@ -1250,7 +1274,7 @@ exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` + UNAME_MACHINE=$( (uname -p) 2>/dev/null) echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv @@ -1284,7 +1308,7 @@ echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then + if test -d /usr/nec; then echo mips-nec-sysv"$UNAME_RELEASE" else echo mips-unknown-sysv"$UNAME_RELEASE" @@ -1332,8 +1356,11 @@ *:Rhapsody:*:*) echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; + arm64:Darwin:*:*) + echo aarch64-apple-darwin"$UNAME_RELEASE" + exit ;; *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` + UNAME_PROCESSOR=$(uname -p) case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac @@ -1346,7 +1373,7 @@ else set_cc_for_build fi - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if test "$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) | \ grep IS_64BIT_ARCH >/dev/null @@ -1370,7 +1397,7 @@ echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` + UNAME_PROCESSOR=$(uname -p) if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc @@ -1438,10 +1465,10 @@ echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) - echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" + echo "$UNAME_MACHINE"-unknown-dragonfly"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" exit ;; *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` + UNAME_MACHINE=$( (uname -p) 2>/dev/null) case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; @@ -1451,7 +1478,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 @@ -1509,7 +1536,7 @@ #define __ARCHITECTURE__ "m68k" #endif int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + version=$( (hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null); if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else @@ -1601,7 +1628,7 @@ } EOF -$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` && +$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=$($dummy) && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. @@ -1626,9 +1653,15 @@ operating system you are using. If your script is old, overwrite *all* copies of config.guess and config.sub with the latest versions from: - https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess + https://git.savannah.gnu.org/cgit/config.git/plain/config.guess and - https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub + https://git.savannah.gnu.org/cgit/config.git/plain/config.sub +EOF + +year=$(echo $timestamp | sed 's,-.*,,') +# shellcheck disable=SC2003 +if test "$(expr "$(date +%Y)" - "$year")" -lt 3 ; then + cat >&2 </dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` +uname -m = $( (uname -m) 2>/dev/null || echo unknown) +uname -r = $( (uname -r) 2>/dev/null || echo unknown) +uname -s = $( (uname -s) 2>/dev/null || echo unknown) +uname -v = $( (uname -v) 2>/dev/null || echo unknown) + +/usr/bin/uname -p = $( (/usr/bin/uname -p) 2>/dev/null) +/bin/uname -X = $( (/bin/uname -X) 2>/dev/null) + +hostinfo = $( (hostinfo) 2>/dev/null) +/bin/universe = $( (/bin/universe) 2>/dev/null) +/usr/bin/arch -k = $( (/usr/bin/arch -k) 2>/dev/null) +/bin/arch = $( (/bin/arch) 2>/dev/null) +/usr/bin/oslevel = $( (/usr/bin/oslevel) 2>/dev/null) +/usr/convex/getsysinfo = $( (/usr/convex/getsysinfo) 2>/dev/null) UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF +fi exit 1 diff -Nru datamash-1.7/build-aux/config.rpath datamash-1.8/build-aux/config.rpath --- datamash-1.7/build-aux/config.rpath 2020-04-23 17:33:25.000000000 +0000 +++ datamash-1.8/build-aux/config.rpath 2022-05-28 01:46:58.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-2020 Free Software Foundation, Inc. +# Copyright 1996-2021 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # diff -Nru datamash-1.7/build-aux/config.sub datamash-1.8/build-aux/config.sub --- datamash-1.7/build-aux/config.sub 2020-04-23 04:02:47.000000000 +0000 +++ datamash-1.8/build-aux/config.sub 2022-05-28 01:46:33.000000000 +0000 @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2020 Free Software Foundation, Inc. +# Copyright 1992-2021 Free Software Foundation, Inc. -timestamp='2020-01-01' +timestamp='2021-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: -# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub +# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -50,7 +50,7 @@ # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. -me=`echo "$0" | sed -e 's,.*/,,'` +me=$(echo "$0" | sed -e 's,.*/,,') usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS @@ -67,7 +67,7 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2020 Free Software Foundation, Inc. +Copyright 1992-2021 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." @@ -124,28 +124,27 @@ ;; *-*-*-*) basic_machine=$field1-$field2 - os=$field3-$field4 + basic_os=$field3-$field4 ;; *-*-*) # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two # parts maybe_os=$field2-$field3 case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \ - | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \ + nto-qnx* | linux-* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ | storm-chaos* | os2-emx* | rtmk-nova*) basic_machine=$field1 - os=$maybe_os + basic_os=$maybe_os ;; android-linux) basic_machine=$field1-unknown - os=linux-android + basic_os=linux-android ;; *) basic_machine=$field1-$field2 - os=$field3 + basic_os=$field3 ;; esac ;; @@ -154,7 +153,7 @@ case $field1-$field2 in decstation-3100) basic_machine=mips-dec - os= + basic_os= ;; *-*) # Second component is usually, but not always the OS @@ -162,7 +161,7 @@ # Prevent following clause from handling this valid os sun*os*) basic_machine=$field1 - os=$field2 + basic_os=$field2 ;; # Manufacturers dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ @@ -175,11 +174,11 @@ | microblaze* | sim | cisco \ | oki | wec | wrs | winbond) basic_machine=$field1-$field2 - os= + basic_os= ;; *) basic_machine=$field1 - os=$field2 + basic_os=$field2 ;; esac ;; @@ -191,447 +190,451 @@ case $field1 in 386bsd) basic_machine=i386-pc - os=bsd + basic_os=bsd ;; a29khif) basic_machine=a29k-amd - os=udi + basic_os=udi ;; adobe68k) basic_machine=m68010-adobe - os=scout + basic_os=scout ;; alliant) basic_machine=fx80-alliant - os= + basic_os= ;; altos | altos3068) basic_machine=m68k-altos - os= + basic_os= ;; am29k) basic_machine=a29k-none - os=bsd + basic_os=bsd ;; amdahl) basic_machine=580-amdahl - os=sysv + basic_os=sysv ;; amiga) basic_machine=m68k-unknown - os= + basic_os= ;; amigaos | amigados) basic_machine=m68k-unknown - os=amigaos + basic_os=amigaos ;; amigaunix | amix) basic_machine=m68k-unknown - os=sysv4 + basic_os=sysv4 ;; apollo68) basic_machine=m68k-apollo - os=sysv + basic_os=sysv ;; apollo68bsd) basic_machine=m68k-apollo - os=bsd + basic_os=bsd ;; aros) basic_machine=i386-pc - os=aros + basic_os=aros ;; aux) basic_machine=m68k-apple - os=aux + basic_os=aux ;; balance) basic_machine=ns32k-sequent - os=dynix + basic_os=dynix ;; blackfin) basic_machine=bfin-unknown - os=linux + basic_os=linux ;; cegcc) basic_machine=arm-unknown - os=cegcc + basic_os=cegcc ;; convex-c1) basic_machine=c1-convex - os=bsd + basic_os=bsd ;; convex-c2) basic_machine=c2-convex - os=bsd + basic_os=bsd ;; convex-c32) basic_machine=c32-convex - os=bsd + basic_os=bsd ;; convex-c34) basic_machine=c34-convex - os=bsd + basic_os=bsd ;; convex-c38) basic_machine=c38-convex - os=bsd + basic_os=bsd ;; cray) basic_machine=j90-cray - os=unicos + basic_os=unicos ;; crds | unos) basic_machine=m68k-crds - os= + basic_os= ;; da30) basic_machine=m68k-da30 - os= + basic_os= ;; decstation | pmax | pmin | dec3100 | decstatn) basic_machine=mips-dec - os= + basic_os= ;; delta88) basic_machine=m88k-motorola - os=sysv3 + basic_os=sysv3 ;; dicos) basic_machine=i686-pc - os=dicos + basic_os=dicos ;; djgpp) basic_machine=i586-pc - os=msdosdjgpp + basic_os=msdosdjgpp ;; ebmon29k) basic_machine=a29k-amd - os=ebmon + basic_os=ebmon ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson - os=ose + basic_os=ose ;; gmicro) basic_machine=tron-gmicro - os=sysv + basic_os=sysv ;; go32) basic_machine=i386-pc - os=go32 + basic_os=go32 ;; h8300hms) basic_machine=h8300-hitachi - os=hms + basic_os=hms ;; h8300xray) basic_machine=h8300-hitachi - os=xray + basic_os=xray ;; h8500hms) basic_machine=h8500-hitachi - os=hms + basic_os=hms ;; harris) basic_machine=m88k-harris - os=sysv3 + basic_os=sysv3 ;; hp300 | hp300hpux) basic_machine=m68k-hp - os=hpux + basic_os=hpux ;; hp300bsd) basic_machine=m68k-hp - os=bsd + basic_os=bsd ;; hppaosf) basic_machine=hppa1.1-hp - os=osf + basic_os=osf ;; hppro) basic_machine=hppa1.1-hp - os=proelf + basic_os=proelf ;; i386mach) basic_machine=i386-mach - os=mach + basic_os=mach ;; isi68 | isi) basic_machine=m68k-isi - os=sysv + basic_os=sysv ;; m68knommu) basic_machine=m68k-unknown - os=linux + basic_os=linux ;; magnum | m3230) basic_machine=mips-mips - os=sysv + basic_os=sysv ;; merlin) basic_machine=ns32k-utek - os=sysv + basic_os=sysv ;; mingw64) basic_machine=x86_64-pc - os=mingw64 + basic_os=mingw64 ;; mingw32) basic_machine=i686-pc - os=mingw32 + basic_os=mingw32 ;; mingw32ce) basic_machine=arm-unknown - os=mingw32ce + basic_os=mingw32ce ;; monitor) basic_machine=m68k-rom68k - os=coff + basic_os=coff ;; morphos) basic_machine=powerpc-unknown - os=morphos + basic_os=morphos ;; moxiebox) basic_machine=moxie-unknown - os=moxiebox + basic_os=moxiebox ;; msdos) basic_machine=i386-pc - os=msdos + basic_os=msdos ;; msys) basic_machine=i686-pc - os=msys + basic_os=msys ;; mvs) basic_machine=i370-ibm - os=mvs + basic_os=mvs ;; nacl) basic_machine=le32-unknown - os=nacl + basic_os=nacl ;; ncr3000) basic_machine=i486-ncr - os=sysv4 + basic_os=sysv4 ;; netbsd386) basic_machine=i386-pc - os=netbsd + basic_os=netbsd ;; netwinder) basic_machine=armv4l-rebel - os=linux + basic_os=linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony - os=newsos + basic_os=newsos ;; news1000) basic_machine=m68030-sony - os=newsos + basic_os=newsos ;; necv70) basic_machine=v70-nec - os=sysv + basic_os=sysv ;; nh3000) basic_machine=m68k-harris - os=cxux + basic_os=cxux ;; nh[45]000) basic_machine=m88k-harris - os=cxux + basic_os=cxux ;; nindy960) basic_machine=i960-intel - os=nindy + basic_os=nindy ;; mon960) basic_machine=i960-intel - os=mon960 + basic_os=mon960 ;; nonstopux) basic_machine=mips-compaq - os=nonstopux + basic_os=nonstopux ;; os400) basic_machine=powerpc-ibm - os=os400 + basic_os=os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson - os=ose + basic_os=ose ;; os68k) basic_machine=m68k-none - os=os68k + basic_os=os68k ;; paragon) basic_machine=i860-intel - os=osf + basic_os=osf ;; parisc) basic_machine=hppa-unknown - os=linux + basic_os=linux + ;; + psp) + basic_machine=mipsallegrexel-sony + basic_os=psp ;; pw32) basic_machine=i586-unknown - os=pw32 + basic_os=pw32 ;; rdos | rdos64) basic_machine=x86_64-pc - os=rdos + basic_os=rdos ;; rdos32) basic_machine=i386-pc - os=rdos + basic_os=rdos ;; rom68k) basic_machine=m68k-rom68k - os=coff + basic_os=coff ;; sa29200) basic_machine=a29k-amd - os=udi + basic_os=udi ;; sei) basic_machine=mips-sei - os=seiux + basic_os=seiux ;; sequent) basic_machine=i386-sequent - os= + basic_os= ;; sps7) basic_machine=m68k-bull - os=sysv2 + basic_os=sysv2 ;; st2000) basic_machine=m68k-tandem - os= + basic_os= ;; stratus) basic_machine=i860-stratus - os=sysv4 + basic_os=sysv4 ;; sun2) basic_machine=m68000-sun - os= + basic_os= ;; sun2os3) basic_machine=m68000-sun - os=sunos3 + basic_os=sunos3 ;; sun2os4) basic_machine=m68000-sun - os=sunos4 + basic_os=sunos4 ;; sun3) basic_machine=m68k-sun - os= + basic_os= ;; sun3os3) basic_machine=m68k-sun - os=sunos3 + basic_os=sunos3 ;; sun3os4) basic_machine=m68k-sun - os=sunos4 + basic_os=sunos4 ;; sun4) basic_machine=sparc-sun - os= + basic_os= ;; sun4os3) basic_machine=sparc-sun - os=sunos3 + basic_os=sunos3 ;; sun4os4) basic_machine=sparc-sun - os=sunos4 + basic_os=sunos4 ;; sun4sol2) basic_machine=sparc-sun - os=solaris2 + basic_os=solaris2 ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun - os= + basic_os= ;; sv1) basic_machine=sv1-cray - os=unicos + basic_os=unicos ;; symmetry) basic_machine=i386-sequent - os=dynix + basic_os=dynix ;; t3e) basic_machine=alphaev5-cray - os=unicos + basic_os=unicos ;; t90) basic_machine=t90-cray - os=unicos + basic_os=unicos ;; toad1) basic_machine=pdp10-xkl - os=tops20 + basic_os=tops20 ;; tpf) basic_machine=s390x-ibm - os=tpf + basic_os=tpf ;; udi29k) basic_machine=a29k-amd - os=udi + basic_os=udi ;; ultra3) basic_machine=a29k-nyu - os=sym1 + basic_os=sym1 ;; v810 | necv810) basic_machine=v810-nec - os=none + basic_os=none ;; vaxv) basic_machine=vax-dec - os=sysv + basic_os=sysv ;; vms) basic_machine=vax-dec - os=vms + basic_os=vms ;; vsta) basic_machine=i386-pc - os=vsta + basic_os=vsta ;; vxworks960) basic_machine=i960-wrs - os=vxworks + basic_os=vxworks ;; vxworks68) basic_machine=m68k-wrs - os=vxworks + basic_os=vxworks ;; vxworks29k) basic_machine=a29k-wrs - os=vxworks + basic_os=vxworks ;; xbox) basic_machine=i686-pc - os=mingw32 + basic_os=mingw32 ;; ymp) basic_machine=ymp-cray - os=unicos + basic_os=unicos ;; *) basic_machine=$1 - os= + basic_os= ;; esac ;; @@ -683,17 +686,17 @@ bluegene*) cpu=powerpc vendor=ibm - os=cnk + basic_os=cnk ;; decsystem10* | dec10*) cpu=pdp10 vendor=dec - os=tops10 + basic_os=tops10 ;; decsystem20* | dec20*) cpu=pdp10 vendor=dec - os=tops20 + basic_os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) @@ -703,7 +706,7 @@ dpx2*) cpu=m68k vendor=bull - os=sysv3 + basic_os=sysv3 ;; encore | umax | mmax) cpu=ns32k @@ -712,7 +715,7 @@ elxsi) cpu=elxsi vendor=elxsi - os=${os:-bsd} + basic_os=${basic_os:-bsd} ;; fx2800) cpu=i860 @@ -725,7 +728,7 @@ h3050r* | hiux*) cpu=hppa1.1 vendor=hitachi - os=hiuxwe2 + basic_os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) cpu=hppa1.0 @@ -766,38 +769,38 @@ vendor=hp ;; i*86v32) - cpu=`echo "$1" | sed -e 's/86.*/86/'` + cpu=$(echo "$1" | sed -e 's/86.*/86/') vendor=pc - os=sysv32 + basic_os=sysv32 ;; i*86v4*) - cpu=`echo "$1" | sed -e 's/86.*/86/'` + cpu=$(echo "$1" | sed -e 's/86.*/86/') vendor=pc - os=sysv4 + basic_os=sysv4 ;; i*86v) - cpu=`echo "$1" | sed -e 's/86.*/86/'` + cpu=$(echo "$1" | sed -e 's/86.*/86/') vendor=pc - os=sysv + basic_os=sysv ;; i*86sol2) - cpu=`echo "$1" | sed -e 's/86.*/86/'` + cpu=$(echo "$1" | sed -e 's/86.*/86/') vendor=pc - os=solaris2 + basic_os=solaris2 ;; j90 | j90-cray) cpu=j90 vendor=cray - os=${os:-unicos} + basic_os=${basic_os:-unicos} ;; iris | iris4d) cpu=mips vendor=sgi - case $os in + case $basic_os in irix*) ;; *) - os=irix4 + basic_os=irix4 ;; esac ;; @@ -808,26 +811,26 @@ *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) cpu=m68k vendor=atari - os=mint + basic_os=mint ;; news-3600 | risc-news) cpu=mips vendor=sony - os=newsos + basic_os=newsos ;; next | m*-next) cpu=m68k vendor=next - case $os in + case $basic_os in openstep*) ;; nextstep*) ;; ns2*) - os=nextstep2 + basic_os=nextstep2 ;; *) - os=nextstep3 + basic_os=nextstep3 ;; esac ;; @@ -838,12 +841,12 @@ op50n-* | op60c-*) cpu=hppa1.1 vendor=oki - os=proelf + basic_os=proelf ;; pa-hitachi) cpu=hppa1.1 vendor=hitachi - os=hiuxwe2 + basic_os=hiuxwe2 ;; pbd) cpu=sparc @@ -880,12 +883,12 @@ sde) cpu=mipsisa32 vendor=sde - os=${os:-elf} + basic_os=${basic_os:-elf} ;; simso-wrs) cpu=sparclite vendor=wrs - os=vxworks + basic_os=vxworks ;; tower | tower-32) cpu=m68k @@ -902,7 +905,7 @@ w89k-*) cpu=hppa1.1 vendor=winbond - os=proelf + basic_os=proelf ;; none) cpu=none @@ -914,7 +917,7 @@ ;; leon-*|leon[3-9]-*) cpu=sparc - vendor=`echo "$basic_machine" | sed 's/-.*//'` + vendor=$(echo "$basic_machine" | sed 's/-.*//') ;; *-*) @@ -955,11 +958,11 @@ # some cases the only manufacturer, in others, it is the most popular. craynv-unknown) vendor=cray - os=${os:-unicosmp} + basic_os=${basic_os:-unicosmp} ;; c90-unknown | c90-cray) vendor=cray - os=${os:-unicos} + basic_os=${Basic_os:-unicos} ;; fx80-unknown) vendor=alliant @@ -1003,7 +1006,7 @@ dpx20-unknown | dpx20-bull) cpu=rs6000 vendor=bull - os=${os:-bosx} + basic_os=${basic_os:-bosx} ;; # Here we normalize CPU types irrespective of the vendor @@ -1012,7 +1015,7 @@ ;; blackfin-*) cpu=bfin - os=linux + basic_os=linux ;; c54x-*) cpu=tic54x @@ -1025,7 +1028,7 @@ ;; e500v[12]-*) cpu=powerpc - os=$os"spe" + basic_os=${basic_os}"spe" ;; mips3*-*) cpu=mips64 @@ -1035,7 +1038,7 @@ ;; m68knommu-*) cpu=m68k - os=linux + basic_os=linux ;; m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*) cpu=s12z @@ -1045,7 +1048,7 @@ ;; parisc-*) cpu=hppa - os=linux + basic_os=linux ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) cpu=i586 @@ -1081,7 +1084,7 @@ cpu=mipsisa64sb1el ;; sh5e[lb]-*) - cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'` + cpu=$(echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/') ;; spur-*) cpu=spur @@ -1099,13 +1102,16 @@ cpu=x86_64 ;; xscale-* | xscalee[bl]-*) - cpu=`echo "$cpu" | sed 's/^xscale/arm/'` + cpu=$(echo "$cpu" | sed 's/^xscale/arm/') + ;; + arm64-*) + cpu=aarch64 ;; # Recognize the canonical CPU Types that limit and/or modify the # company names they are paired with. cr16-*) - os=${os:-elf} + basic_os=${basic_os:-elf} ;; crisv32-* | etraxfs*-*) cpu=crisv32 @@ -1116,7 +1122,7 @@ vendor=axis ;; crx-*) - os=${os:-elf} + basic_os=${basic_os:-elf} ;; neo-tandem) cpu=neo @@ -1138,16 +1144,12 @@ cpu=nsx vendor=tandem ;; - s390-*) - cpu=s390 - vendor=ibm - ;; - s390x-*) - cpu=s390x - vendor=ibm + mipsallegrexel-sony) + cpu=mipsallegrexel + vendor=sony ;; tile*-*) - os=${os:-linux-gnu} + basic_os=${basic_os:-linux-gnu} ;; *) @@ -1164,7 +1166,7 @@ | am33_2.0 \ | amdgcn \ | arc | arceb \ - | arm | arm[lb]e | arme[lb] | armv* \ + | arm | arm[lb]e | arme[lb] | armv* \ | avr | avr32 \ | asmjs \ | ba \ @@ -1183,6 +1185,7 @@ | k1om \ | le32 | le64 \ | lm32 \ + | loongarch32 | loongarch64 | loongarchx32 \ | m32c | m32r | m32rle \ | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \ | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \ @@ -1227,8 +1230,9 @@ | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ | pru \ | pyramid \ - | riscv | riscv32 | riscv64 \ + | riscv | riscv32 | riscv32be | riscv64 | riscv64be \ | rl78 | romp | rs6000 | rx \ + | s390 | s390x \ | score \ | sh | shl \ | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \ @@ -1238,6 +1242,7 @@ | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \ | spu \ | tahoe \ + | thumbv7* \ | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \ | tron \ | ubicom32 \ @@ -1275,8 +1280,47 @@ # Decode manufacturer-specific aliases for certain operating systems. -if [ x$os != x ] +if test x$basic_os != x then + +# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just +# set os. +case $basic_os in + gnu/linux*) + kernel=linux + os=$(echo $basic_os | sed -e 's|gnu/linux|gnu|') + ;; + os2-emx) + kernel=os2 + os=$(echo $basic_os | sed -e 's|os2-emx|emx|') + ;; + nto-qnx*) + kernel=nto + os=$(echo $basic_os | sed -e 's|nto-qnx|qnx|') + ;; + *-*) + # shellcheck disable=SC2162 + IFS="-" read kernel os <&2 - exit 1 + # No normalization, but not necessarily accepted, that comes below. ;; esac + else # Here we handle the default operating systems that come with various machines. @@ -1528,6 +1499,7 @@ # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. +kernel= case $cpu-$vendor in score-*) os=elf @@ -1539,7 +1511,8 @@ os=riscix1.2 ;; arm*-rebel) - os=linux + kernel=linux + os=gnu ;; arm*-semi) os=aout @@ -1705,84 +1678,173 @@ os=none ;; esac + fi +# Now, validate our (potentially fixed-up) OS. +case $os in + # Sometimes we do "kernel-abi", so those need to count as OSes. + musl* | newlib* | uclibc*) + ;; + # Likewise for "kernel-libc" + eabi | eabihf | gnueabi | gnueabihf) + ;; + # Now accept the basic system types. + # The portable systems comes first. + # Each alternative MUST end in a * to match a version number. + gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ + | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ + | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ + | hiux* | abug | nacl* | netware* | windows* \ + | os9* | macos* | osx* | ios* \ + | mpw* | magic* | mmixware* | mon960* | lnews* \ + | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ + | aos* | aros* | cloudabi* | sortix* | twizzler* \ + | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ + | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ + | mirbsd* | netbsd* | dicos* | openedition* | ose* \ + | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \ + | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \ + | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ + | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ + | udi* | lites* | ieee* | go32* | aux* | hcos* \ + | chorusrdb* | cegcc* | glidix* \ + | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ + | midipix* | mingw32* | mingw64* | mint* \ + | uxpv* | beos* | mpeix* | udk* | moxiebox* \ + | interix* | uwin* | mks* | rhapsody* | darwin* \ + | openstep* | oskit* | conix* | pw32* | nonstopux* \ + | storm-chaos* | tops10* | tenex* | tops20* | its* \ + | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \ + | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \ + | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ + | skyos* | haiku* | rdos* | toppers* | drops* | es* \ + | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ + | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ + | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx*) + ;; + # This one is extra strict with allowed versions + sco3.2v2 | sco3.2v[4-9]* | sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + ;; + none) + ;; + *) + echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2 + exit 1 + ;; +esac + +# As a final step for OS-related things, validate the OS-kernel combination +# (given a valid OS), if there is a kernel. +case $kernel-$os in + linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* | linux-musl* | linux-uclibc* ) + ;; + uclinux-uclibc* ) + ;; + -dietlibc* | -newlib* | -musl* | -uclibc* ) + # These are just libc implementations, not actual OSes, and thus + # require a kernel. + echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 + exit 1 + ;; + kfreebsd*-gnu* | kopensolaris*-gnu*) + ;; + nto-qnx*) + ;; + os2-emx) + ;; + *-eabi* | *-gnueabi*) + ;; + -*) + # Blank kernel with real OS is always fine. + ;; + *-*) + echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 + exit 1 + ;; +esac + # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. case $vendor in unknown) - case $os in - riscix*) + case $cpu-$os in + *-riscix*) vendor=acorn ;; - sunos*) + *-sunos*) vendor=sun ;; - cnk*|-aix*) + *-cnk* | *-aix*) vendor=ibm ;; - beos*) + *-beos*) vendor=be ;; - hpux*) + *-hpux*) vendor=hp ;; - mpeix*) + *-mpeix*) vendor=hp ;; - hiux*) + *-hiux*) vendor=hitachi ;; - unos*) + *-unos*) vendor=crds ;; - dgux*) + *-dgux*) vendor=dg ;; - luna*) + *-luna*) vendor=omron ;; - genix*) + *-genix*) vendor=ns ;; - clix*) + *-clix*) vendor=intergraph ;; - mvs* | opened*) + *-mvs* | *-opened*) + vendor=ibm + ;; + *-os400*) vendor=ibm ;; - os400*) + s390-* | s390x-*) vendor=ibm ;; - ptx*) + *-ptx*) vendor=sequent ;; - tpf*) + *-tpf*) vendor=ibm ;; - vxsim* | vxworks* | windiss*) + *-vxsim* | *-vxworks* | *-windiss*) vendor=wrs ;; - aux*) + *-aux*) vendor=apple ;; - hms*) + *-hms*) vendor=hitachi ;; - mpw* | macos*) + *-mpw* | *-macos*) vendor=apple ;; - *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) + *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) vendor=atari ;; - vos*) + *-vos*) vendor=stratus ;; esac ;; esac -echo "$cpu-$vendor-$os" +echo "$cpu-$vendor-${kernel:+$kernel-}$os" exit # Local variables: diff -Nru datamash-1.7/build-aux/create_corrupted_file_system.sh datamash-1.8/build-aux/create_corrupted_file_system.sh --- datamash-1.7/build-aux/create_corrupted_file_system.sh 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/build-aux/create_corrupted_file_system.sh 2022-06-01 21:08:00.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (C) 2014-2020 Assaf Gordon +# Copyright (C) 2014-2021 Assaf Gordon # # datamash I/O error testing module # @@ -35,7 +35,7 @@ # Reset log echo > $LOG -## Ugly hack: Add common places were required programs might be. +## Ugly hack: Add common places where required programs might be. ## This script is run as a non-root user, so these directories ## might not be on the $PATH PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin @@ -83,7 +83,7 @@ ## Verify that the file system image has errors in it -## (otherwise we failed to simuate errors) +## (otherwise we failed to simulate errors) fsck.ext3 -nf $IMGFILE >$LOG 2>&1 && die "Failed to simulate bad file system (mkfs did not report errors)" diff -Nru datamash-1.7/build-aux/create_small_file_system.sh datamash-1.8/build-aux/create_small_file_system.sh --- datamash-1.7/build-aux/create_small_file_system.sh 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/build-aux/create_small_file_system.sh 2022-06-01 21:42:29.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (C) 2014-2020 Assaf Gordon +# Copyright (C) 2014-2021 Assaf Gordon # # datamash I/O error testing module # @@ -35,7 +35,7 @@ # Reset log echo > $LOG -## Ugly hack: Add common places were required programs might be. +## Ugly hack: Add common places where required programs might be. ## This script is run as a non-root user, so these directories ## might not be on the $PATH PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin @@ -48,7 +48,7 @@ ## Create a tiny ext3 file system image dd if=/dev/zero of=$IMGFILE bs=1k count=64 1>$LOG 2>&1 || die "dd failed" -yes | mkfs.ext3 -b ${BLOCK_SIZE} $IMGFILE 1>$LOG 2>&1 || +yes | mkfs.ext3 -T small -b ${BLOCK_SIZE} $IMGFILE 1>$LOG 2>&1 || die "mkfs.ext3 failed" echo " diff -Nru datamash-1.7/build-aux/do-release-commit-and-tag datamash-1.8/build-aux/do-release-commit-and-tag --- datamash-1.7/build-aux/do-release-commit-and-tag 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/build-aux/do-release-commit-and-tag 2022-05-28 01:46:58.000000000 +0000 @@ -7,7 +7,7 @@ # Note: this is a bash script (could be zsh or dash) -# Copyright (C) 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 2009-2021 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.7/build-aux/gendocs.sh datamash-1.8/build-aux/gendocs.sh --- datamash-1.7/build-aux/gendocs.sh 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/build-aux/gendocs.sh 2022-05-28 01:46: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=2020-01-01.00 +scriptversion=2021-01-01.00 -# Copyright 2003-2020 Free Software Foundation, Inc. +# Copyright 2003-2021 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 @@ -73,7 +73,7 @@ version="gendocs.sh $scriptversion -Copyright 2020 Free Software Foundation, Inc. +Copyright 2021 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." diff -Nru datamash-1.7/build-aux/gitlog-to-changelog datamash-1.8/build-aux/gitlog-to-changelog --- datamash-1.7/build-aux/gitlog-to-changelog 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/build-aux/gitlog-to-changelog 2022-05-28 01:46:58.000000000 +0000 @@ -3,7 +3,7 @@ # Convert git log output to ChangeLog format. -# Copyright (C) 2008-2020 Free Software Foundation, Inc. +# Copyright (C) 2008-2021 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,11 +31,11 @@ # are valid code in both sh and perl. When executed by sh, they re-execute # the script through the perl program found in $PATH. The '-x' option # is essential as well; without it, perl would re-execute the script -# through /bin/sh. When executed by perl, the next two lines are a no-op. +# through /bin/sh. When executed by perl, the next two lines are a no-op. eval 'exec perl -wSx "$0" "$@"' if 0; -my $VERSION = '2018-03-07 03:47'; # UTC +my $VERSION = '2020-04-04 15:07'; # 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 diff -Nru datamash-1.7/build-aux/git-version-gen datamash-1.8/build-aux/git-version-gen --- datamash-1.7/build-aux/git-version-gen 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/build-aux/git-version-gen 2022-07-09 05:15:30.000000000 +0000 @@ -1,8 +1,8 @@ #!/bin/sh # Print a version string. -scriptversion=2018-03-07.03; # UTC +scriptversion=2019-10-13.15; # UTC -# Copyright (C) 2007-2020 Free Software Foundation, Inc. +# Copyright (C) 2007-2021 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.7/build-aux/gnupload datamash-1.8/build-aux/gnupload --- datamash-1.7/build-aux/gnupload 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/build-aux/gnupload 2022-05-28 01:46:58.000000000 +0000 @@ -3,7 +3,7 @@ scriptversion=2018-05-19.18; # UTC -# Copyright (C) 2004-2020 Free Software Foundation, Inc. +# Copyright (C) 2004-2021 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.7/build-aux/gnu-web-doc-update datamash-1.8/build-aux/gnu-web-doc-update --- datamash-1.7/build-aux/gnu-web-doc-update 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/build-aux/gnu-web-doc-update 2022-05-28 01:46:58.000000000 +0000 @@ -4,7 +4,7 @@ VERSION=2018-03-07.03; # UTC -# Copyright (C) 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 2009-2021 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.7/build-aux/install-sh datamash-1.8/build-aux/install-sh --- datamash-1.7/build-aux/install-sh 2020-04-23 04:02:47.000000000 +0000 +++ datamash-1.8/build-aux/install-sh 2022-05-28 01:46:33.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2018-03-11.20; # UTC +scriptversion=2020-11-14.01; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -69,6 +69,11 @@ # Desired mode of installed file. mode=0755 +# Create dirs (including intermediate dirs) using mode 755. +# This is like GNU 'install' as of coreutils 8.32 (2020). +mkdir_umask=22 + +backupsuffix= chgrpcmd= chmodcmd=$chmodprog chowncmd= @@ -99,18 +104,28 @@ --version display version info and exit. -c (ignored) - -C install only if different (preserve the last data modification time) + -C install only if different (preserve data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. + -p pass -p to $cpprog. -s $stripprog installed files. + -S SUFFIX attempt to back up existing files, with suffix SUFFIX. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG + +By default, rm is invoked with -f; when overridden with RMPROG, +it's up to you to specify -f if you want it. + +If -S is not specified, no backups are attempted. + +Email bug reports to bug-automake@gnu.org. +Automake home page: https://www.gnu.org/software/automake/ " while test $# -ne 0; do @@ -137,8 +152,13 @@ -o) chowncmd="$chownprog $2" shift;; + -p) cpprog="$cpprog -p";; + -s) stripcmd=$stripprog;; + -S) backupsuffix="$2" + shift;; + -t) is_target_a_directory=always dst_arg=$2 @@ -255,6 +275,10 @@ dstdir=$dst test -d "$dstdir" dstdir_status=$? + # Don't chown directories that already exist. + if test $dstdir_status = 0; then + chowncmd="" + fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command @@ -301,22 +325,6 @@ if test $dstdir_status != 0; then case $posix_mkdir in '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then @@ -326,52 +334,49 @@ fi posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - # Note that $RANDOM variable is not portable (e.g. dash); Use it - # here however when possible just to lower collision chance. - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - - trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 - - # Because "mkdir -p" follows existing symlinks and we likely work - # directly in world-writeable /tmp, make sure that the '$tmpdir' - # directory is successfully created first before we actually test - # 'mkdir -p' feature. - if (umask $mkdir_umask && - $mkdirprog $mkdir_mode "$tmpdir" && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - test_tmpdir="$tmpdir/a" - ls_ld_tmpdir=`ls -ld "$test_tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null - fi - trap '' 0;; - esac;; + # The $RANDOM variable is not portable (e.g., dash). Use it + # here however when possible just to lower collision chance. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + + trap ' + ret=$? + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null + exit $ret + ' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p'. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; esac if @@ -382,7 +387,7 @@ then : else - # The umask is ridiculous, or mkdir does not conform to POSIX, + # mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. @@ -411,7 +416,7 @@ prefixes= else if $posix_mkdir; then - (umask=$mkdir_umask && + (umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 @@ -488,6 +493,13 @@ then rm -f "$dsttmp" else + # If $backupsuffix is set, and the file being installed + # already exists, attempt a backup. Don't worry if it fails, + # e.g., if mv doesn't support -f. + if test -n "$backupsuffix" && test -f "$dst"; then + $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null + fi + # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || @@ -502,9 +514,9 @@ # file should still install successfully. { test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || + $doit $rmcmd "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 diff -Nru datamash-1.7/build-aux/make_bin_dist.sh datamash-1.8/build-aux/make_bin_dist.sh --- datamash-1.7/build-aux/make_bin_dist.sh 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/build-aux/make_bin_dist.sh 2022-05-28 02:52:43.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/sh -## Copyright (C) 2014-2020 Assaf Gordon +## Copyright (C) 2014-2021 Assaf Gordon ## ## This file is part of GNU Datamash. ## diff -Nru datamash-1.7/build-aux/missing datamash-1.8/build-aux/missing --- datamash-1.7/build-aux/missing 2020-04-23 17:34:04.000000000 +0000 +++ datamash-1.8/build-aux/missing 2022-05-28 01:47:19.000000000 +0000 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify diff -Nru datamash-1.7/build-aux/pmccabe2html datamash-1.8/build-aux/pmccabe2html --- datamash-1.7/build-aux/pmccabe2html 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/build-aux/pmccabe2html 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ # pmccabe2html - AWK script to convert pmccabe output to html -*- awk -*- -# Copyright (C) 2007-2020 Free Software Foundation, Inc. +# Copyright (C) 2007-2021 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.7/build-aux/prefix-gnulib-mk datamash-1.8/build-aux/prefix-gnulib-mk --- datamash-1.7/build-aux/prefix-gnulib-mk 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/build-aux/prefix-gnulib-mk 2022-05-28 01:46:58.000000000 +0000 @@ -3,7 +3,7 @@ # Rewrite a gnulib.mk, adding prefixes to work with automake's subdir-objects. -# Copyright (C) 2012-2020 Free Software Foundation, Inc. +# Copyright (C) 2012-2021 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,11 +31,11 @@ # are valid code in both sh and perl. When executed by sh, they re-execute # the script through the perl program found in $PATH. The '-x' option # is essential as well; without it, perl would re-execute the script -# through /bin/sh. When executed by perl, the next two lines are a no-op. +# through /bin/sh. When executed by perl, the next two lines are a no-op. eval 'exec perl -wSx "$0" "$@"' if 0; -my $VERSION = '2012-01-21 17:13'; # UTC +my $VERSION = '2020-04-04 15:07'; # 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 diff -Nru datamash-1.7/build-aux/prerelease-checks.sh datamash-1.8/build-aux/prerelease-checks.sh --- datamash-1.7/build-aux/prerelease-checks.sh 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/build-aux/prerelease-checks.sh 2022-05-28 02:52:43.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/sh -## Copyright (C) 2014-2020 Assaf Gordon +## Copyright (C) 2014-2021 Assaf Gordon ## ## This file is part of GNU Datamash. ## diff -Nru datamash-1.7/build-aux/test-driver datamash-1.8/build-aux/test-driver --- datamash-1.7/build-aux/test-driver 2020-04-23 17:34:04.000000000 +0000 +++ datamash-1.8/build-aux/test-driver 2022-05-28 01:47:19.000000000 +0000 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 2011-2018 Free Software Foundation, Inc. +# Copyright (C) 2011-2021 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 @@ -42,11 +42,13 @@ { cat <$log_file 2>&1 +# Test script is run here. We create the file first, then append to it, +# to ameliorate tests themselves also writing to the log file. Our tests +# don't, but others can (automake bug#35762). +: >"$log_file" +"$@" >>"$log_file" 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then @@ -126,7 +131,7 @@ # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). -echo "$res $test_name (exit status: $estatus)" >>$log_file +echo "$res $test_name (exit status: $estatus)" >>"$log_file" # Report outcome to console. echo "${col}${res}${std}: $test_name" diff -Nru datamash-1.7/build-aux/texinfo.tex datamash-1.8/build-aux/texinfo.tex --- datamash-1.7/build-aux/texinfo.tex 2020-04-23 04:02:47.000000000 +0000 +++ datamash-1.8/build-aux/texinfo.tex 2022-05-28 01:46:33.000000000 +0000 @@ -3,9 +3,9 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2020-02-11.09} +\def\texinfoversion{2020-10-24.12} % -% Copyright 1985, 1986, 1988, 1990-2019 Free Software Foundation, Inc. +% Copyright 1985, 1986, 1988, 1990-2020 Free Software Foundation, Inc. % % This texinfo.tex file is free software: you can redistribute it and/or % modify it under the terms of the GNU General Public License as @@ -33,7 +33,7 @@ % The texinfo.tex in any given distribution could well be out % of date, so if that's what you're using, please check. % -% Send bug reports to bug-texinfo@gnu.org. Please include including a +% Send bug reports to bug-texinfo@gnu.org. Please include a % complete document in each bug report with which we can reproduce the % problem. Patches are, of course, greatly appreciated. % @@ -349,34 +349,19 @@ \ifodd\pageno \advance\hoffset by \bindingoffset \else \advance\hoffset by -\bindingoffset\fi % + \checkchapterpage + % % 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\the\savedtopmark\fi - \let\prevchaptername\thischaptername - \ifcase0\firstmark\fi - \let\curchaptername\thischaptername - % - \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \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 - % % 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\commonheadfootline{\let\hsize=\txipagewidth \texinfochars} % + \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi \global\setbox\headlinebox = \vbox{\commonheadfootline \makeheadline}% - % \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi \global\setbox\footlinebox = \vbox{\commonheadfootline \makefootline}% % @@ -423,6 +408,22 @@ \ifr@ggedbottom \kern-\dimen@ \vfil \fi} } +% Check if we are on the first page of a chapter. Used for printing headings. +\newif\ifchapterpage +\def\checkchapterpage{% + % Get the chapter that was current at the end of the last page + \ifcase1\the\savedtopmark\fi + \let\prevchaptername\thischaptername + % + \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi + \let\curchaptername\thischaptername + % + \ifx\curchaptername\prevchaptername + \chapterpagefalse + \else + \chapterpagetrue + \fi +} % Argument parsing @@ -1010,7 +1011,7 @@ \let\setfilename=\comment % @bye. -\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} +\outer\def\bye{\chappager\pagelabels\tracingstats=1\ptexend} \message{pdf,} @@ -1137,6 +1138,45 @@ \fi +% Output page labels information. +% See PDF reference v.1.7 p.594, section 8.3.1. +\ifpdf +\def\pagelabels{% + \def\title{0 << /P (T-) /S /D >>}% + \edef\roman{\the\romancount << /S /r >>}% + \edef\arabic{\the\arabiccount << /S /D >>}% + % + % Page label ranges must be increasing. Remove any duplicates. + % (There is a slight chance of this being wrong if e.g. there is + % a @contents but no @titlepage, etc.) + % + \ifnum\romancount=0 \def\roman{}\fi + \ifnum\arabiccount=0 \def\title{}% + \else + \ifnum\romancount=\arabiccount \def\roman{}\fi + \fi + % + \ifnum\romancount<\arabiccount + \pdfcatalog{/PageLabels << /Nums [\title \roman \arabic ] >> }\relax + \else + \pdfcatalog{/PageLabels << /Nums [\title \arabic \roman ] >> }\relax + \fi +} +\else + \let\pagelabels\relax +\fi + +\newcount\pagecount \pagecount=0 +\newcount\romancount \romancount=0 +\newcount\arabiccount \arabiccount=0 +\ifpdf + \let\ptxadvancepageno\advancepageno + \def\advancepageno{% + \ptxadvancepageno\global\advance\pagecount by 1 + } +\fi + + % PDF uses PostScript string constants for the names of xref targets, % for display in the outlines, and in other places. Thus, we have to % double any backslashes. Otherwise, a name like "\node" will be @@ -1427,7 +1467,13 @@ % subentries, which we calculated on our first read of the .toc above. % % We use the node names as the destinations. + % + % Currently we prefix the section name with the section number + % for chapter and appendix headings only in order to avoid too much + % horizontal space being required in the PDF viewer. \def\numchapentry##1##2##3##4{% + \dopdfoutline{##2 ##1}{count-\expnumber{chap##2}}{##3}{##4}}% + \def\unnchapentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}% \def\numsecentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}% @@ -1669,9 +1715,13 @@ % Therefore, we read toc only once. % % We use node names as destinations. + % + % Currently we prefix the section name with the section number + % for chapter and appendix headings only in order to avoid too much + % horizontal space being required in the PDF viewer. \def\partentry##1##2##3##4{}% ignore parts in the outlines \def\numchapentry##1##2##3##4{% - \dopdfoutline{##1}{1}{##3}{##4}}% + \dopdfoutline{##2 ##1}{1}{##3}{##4}}% \def\numsecentry##1##2##3##4{% \dopdfoutline{##1}{2}{##3}{##4}}% \def\numsubsecentry##1##2##3##4{% @@ -1683,7 +1733,8 @@ \let\appsecentry\numsecentry% \let\appsubsecentry\numsubsecentry% \let\appsubsubsecentry\numsubsubsecentry% - \let\unnchapentry\numchapentry% + \def\unnchapentry##1##2##3##4{% + \dopdfoutline{##1}{1}{##3}{##4}}% \let\unnsecentry\numsecentry% \let\unnsubsecentry\numsubsecentry% \let\unnsubsubsecentry\numsubsubsecentry% @@ -2496,7 +2547,7 @@ \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}} +\def\tt{\fam=\ttfam \setfontstyle{tt}}\def\ttstylename{tt} % Texinfo sort of supports the sans serif font style, which plain TeX does not. % So we set up a \sf. @@ -2987,10 +3038,18 @@ % arg (if given), and not the url (which is then just the link target). \newif\ifurefurlonlylink +% The default \pretolerance setting stops the penalty inserted in +% \urefallowbreak being a discouragement to line breaking. Set it to +% a negative value for this paragraph only. Hopefully this does not +% conflict with redefinitions of \par done elsewhere. +\def\nopretolerance{% +\pretolerance=-1 +\def\par{\endgraf\pretolerance=100 \let\par\endgraf}% +} + % The main macro is \urefbreak, which allows breaking at expected -% places within the url. (There used to be another version, which -% didn't support automatic breaking.) -\def\urefbreak{\begingroup \urefcatcodes \dourefbreak} +% places within the url. +\def\urefbreak{\nopretolerance \begingroup \urefcatcodes \dourefbreak} \let\uref=\urefbreak % \def\dourefbreak#1{\urefbreakfinish #1,,,\finish} @@ -3101,14 +3160,14 @@ % Allow a ragged right output to aid breaking long URL's. There can % be a break at the \allowbreak with no extra glue (if the existing stretch in -% the line is sufficent), a break at the \penalty100 with extra glue added +% the line is sufficient), a break at the \penalty with extra glue added % at the end of the line, or no break at all here. % Changing the value of the penalty and/or the amount of stretch affects how -% preferrable one choice is over the other. +% preferable one choice is over the other. \def\urefallowbreak{% - \allowbreak + \penalty0\relax \hskip 0pt plus 2 em\relax - \penalty300 + \penalty1000\relax \hskip 0pt plus -2 em\relax } @@ -3305,6 +3364,25 @@ \def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi} \def\finishsup#1{$\ptexsp{\hbox{\switchtolllsize #1}}$}% +% provide this command from LaTeX as it is very common +\def\frac#1#2{{{#1}\over{#2}}} + +% @displaymath. +% \globaldefs is needed to recognize the end lines in \tex and +% \end tex. Set \thisenv as @end displaymath is seen before @end tex. +{\obeylines +\globaldefs=1 +\envdef\displaymath{% +\tex +\def\thisenv{\displaymath}% +$$% +} + +\def\Edisplaymath{$$ +\def\thisenv{\tex}% +\end tex +}} + % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}. % Ignore unless FMTNAME == tex; then it is like @iftex and @tex, % except specified as a normal braced arg, so no newlines to worry about. @@ -3509,7 +3587,7 @@ % @pounds{} is a sterling sign, which Knuth put in the CM italic font. % -\def\pounds{{\it\$}} +\def\pounds{\ifmonospace{\ecfont\char"BF}\else{\it\$}\fi} % @euro{} comes from a separate font, depending on the current style. % We use the free feym* fonts from the eurosym package by Henrik @@ -3658,11 +3736,19 @@ \fi % Quotes. -\chardef\quotedblleft="5C -\chardef\quotedblright=`\" \chardef\quoteleft=`\` \chardef\quoteright=`\' +% only change font for tt for correct kerning and to avoid using +% \ecfont unless necessary. +\def\quotedblleft{% + \ifmonospace{\ecfont\char"10}\else{\char"5C}\fi +} + +\def\quotedblright{% + \ifmonospace{\ecfont\char"11}\else{\char`\"}\fi +} + \message{page headings,} @@ -3784,12 +3870,19 @@ \newtoks\evenheadline % headline on even pages \newtoks\oddheadline % headline on odd pages +\newtoks\evenchapheadline% headline on even pages with a new chapter +\newtoks\oddchapheadline % headline on odd pages with a new chapter \newtoks\evenfootline % footline on even pages \newtoks\oddfootline % footline on odd pages % Now make \makeheadline and \makefootline in Plain TeX use those variables -\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline - \else \the\evenheadline \fi}} +\headline={{\textfonts\rm + \ifchapterpage + \ifodd\pageno\the\oddchapheadline\else\the\evenchapheadline\fi + \else + \ifodd\pageno\the\oddheadline\else\the\evenheadline\fi + \fi}} + \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline \else \the\evenfootline \fi}\HEADINGShook} \let\HEADINGShook=\relax @@ -3805,12 +3898,14 @@ \def\evenheading{\parsearg\evenheadingxxx} \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish} \def\evenheadingyyy #1\|#2\|#3\|#4\finish{% -\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}} + \global\evenchapheadline=\evenheadline} \def\oddheading{\parsearg\oddheadingxxx} \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish} \def\oddheadingyyy #1\|#2\|#3\|#4\finish{% -\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}% + \global\oddchapheadline=\oddheadline} \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}% @@ -3877,37 +3972,34 @@ \parseargdef\headings{\csname HEADINGS#1\endcsname} \def\headingsoff{% non-global headings elimination - \evenheadline={\hfil}\evenfootline={\hfil}% - \oddheadline={\hfil}\oddfootline={\hfil}% + \evenheadline={\hfil}\evenfootline={\hfil}\evenchapheadline={\hfil}% + \oddheadline={\hfil}\oddfootline={\hfil}\oddchapheadline={\hfil}% } \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting \HEADINGSoff % it's the default % When we turn headings on, set the page number to 1. +\def\pageone{ + \global\pageno=1 + \global\arabiccount = \pagecount +} + % For double-sided printing, put current file name in lower left corner, % chapter name on inside top of right hand pages, document % title on inside top of left hand pages, and page numbers on outside top % edge of all pages. \def\HEADINGSdouble{% -\global\pageno=1 -\global\evenfootline={\hfil} -\global\oddfootline={\hfil} -\global\evenheadline={\line{\folio\hfil\thistitle}} -\global\oddheadline={\line{\thischapterheading\hfil\folio}} -\global\let\contentsalignmacro = \chapoddpage +\pageone +\HEADINGSdoublex } \let\contentsalignmacro = \chappager % For single-sided printing, chapter title goes across top left of page, % page number on top right. \def\HEADINGSsingle{% -\global\pageno=1 -\global\evenfootline={\hfil} -\global\oddfootline={\hfil} -\global\evenheadline={\line{\thischapterheading\hfil\folio}} -\global\oddheadline={\line{\thischapterheading\hfil\folio}} -\global\let\contentsalignmacro = \chappager +\pageone +\HEADINGSsinglex } \def\HEADINGSon{\HEADINGSdouble} @@ -3917,7 +4009,9 @@ \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} -\global\oddheadline={\line{\thischapterheading\hfil\folio}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\evenchapheadline={\line{\folio\hfil}} +\global\oddchapheadline={\line{\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } @@ -3925,8 +4019,22 @@ \def\HEADINGSsinglex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} -\global\evenheadline={\line{\thischapterheading\hfil\folio}} -\global\oddheadline={\line{\thischapterheading\hfil\folio}} +\global\evenheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\evenchapheadline={\line{\hfil\folio}} +\global\oddchapheadline={\line{\hfil\folio}} +\global\let\contentsalignmacro = \chappager +} + +% for @setchapternewpage off +\def\HEADINGSsinglechapoff{% +\pageone +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\evenchapheadline=\evenheadline +\global\oddchapheadline=\oddheadline \global\let\contentsalignmacro = \chappager } @@ -4841,7 +4949,7 @@ % like the previous two, but they put @code around the argument. \def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx} -\def\docodeindexxxx #1{\doind{\indexname}{\code{#1}}} +\def\docodeindexxxx #1{\docind{\indexname}{#1}} % Used for the aux, toc and index files to prevent expansion of Texinfo @@ -5117,64 +5225,66 @@ \let\lbracechar\{% \let\rbracechar\}% % + % + \let\do\indexnofontsdef + % % Non-English letters. - \def\AA{AA}% - \def\AE{AE}% - \def\DH{DZZ}% - \def\L{L}% - \def\OE{OE}% - \def\O{O}% - \def\TH{TH}% - \def\aa{aa}% - \def\ae{ae}% - \def\dh{dzz}% - \def\exclamdown{!}% - \def\l{l}% - \def\oe{oe}% - \def\ordf{a}% - \def\ordm{o}% - \def\o{o}% - \def\questiondown{?}% - \def\ss{ss}% - \def\th{th}% - % - \def\LaTeX{LaTeX}% - \def\TeX{TeX}% - % - % 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}% + \do\AA{AA}% + \do\AE{AE}% + \do\DH{DZZ}% + \do\L{L}% + \do\OE{OE}% + \do\O{O}% + \do\TH{TH}% + \do\aa{aa}% + \do\ae{ae}% + \do\dh{dzz}% + \do\exclamdown{!}% + \do\l{l}% + \do\oe{oe}% + \do\ordf{a}% + \do\ordm{o}% + \do\o{o}% + \do\questiondown{?}% + \do\ss{ss}% + \do\th{th}% + % + \do\LaTeX{LaTeX}% + \do\TeX{TeX}% + % + % Assorted special characters. + \do\atchar{@}% + \do\arrow{->}% + \do\bullet{bullet}% + \do\comma{,}% + \do\copyright{copyright}% + \do\dots{...}% + \do\enddots{...}% + \do\equiv{==}% + \do\error{error}% + \do\euro{euro}% + \do\expansion{==>}% + \do\geq{>=}% + \do\guillemetleft{<<}% + \do\guillemetright{>>}% + \do\guilsinglleft{<}% + \do\guilsinglright{>}% + \do\leq{<=}% + \do\lbracechar{\{}% + \do\minus{-}% + \do\point{.}% + \do\pounds{pounds}% + \do\print{-|}% + \do\quotedblbase{"}% + \do\quotedblleft{"}% + \do\quotedblright{"}% + \do\quoteleft{`}% + \do\quoteright{'}% + \do\quotesinglbase{,}% + \do\rbracechar{\}}% + \do\registeredsymbol{R}% + \do\result{=>}% + \do\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. @@ -5189,7 +5299,10 @@ \macrolist \let\value\indexnofontsvalue } -\def\defglyph#1#2{\def#1##1{#2}} % see above + +% Give the control sequence a definition that removes the {} that follows +% its use, e.g. @AA{} -> AA +\def\indexnofontsdef#1#2{\def#1##1{#2}}% @@ -5208,6 +5321,20 @@ \fi } +% Same as \doind, but for code indices +\def\docind#1#2{% + \iflinks + {% + % + \requireopenindexfile{#1}% + \edef\writeto{\csname#1indfile\endcsname}% + % + \def\indextext{#2}% + \safewhatsit\docindwrite + }% + \fi +} + % Check if an index file has been opened, and if not, open it. \def\requireopenindexfile#1{% \ifnum\csname #1indfile\endcsname=0 @@ -5274,6 +5401,9 @@ % trim spaces. \edef\trimmed{\segment}% \edef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}% + \ifincodeindex + \edef\trimmed{\noexpand\code{\trimmed}}% + \fi % \xdef\bracedtext{\bracedtext{\trimmed}}% % @@ -5339,7 +5469,12 @@ % Write the entry in \indextext to the index file. % -\def\doindwrite{% + +\newif\ifincodeindex +\def\doindwrite{\incodeindexfalse\doindwritex} +\def\docindwrite{\incodeindextrue\doindwritex} + +\def\doindwritex{% \maybemarginindex % \atdummies @@ -5559,7 +5694,11 @@ \else \begindoublecolumns \catcode`\\=0\relax - \catcode`\@=12\relax + % + % Make @ an escape character to give macros a chance to work. This + % should work because we (hopefully) don't otherwise use @ in index files. + %\catcode`\@=12\relax + \catcode`\@=0\relax \input \jobname.\indexname s \enddoublecolumns \fi @@ -6401,18 +6540,16 @@ \def\CHAPPAGoff{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chapbreak -\global\let\pagealignmacro=\chappager} +\global\def\HEADINGSon{\HEADINGSsinglechapoff}} \def\CHAPPAGon{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chappager -\global\let\pagealignmacro=\chappager \global\def\HEADINGSon{\HEADINGSsingle}} \def\CHAPPAGodd{% \global\let\contentsalignmacro = \chapoddpage \global\let\pchapsepmacro=\chapoddpage -\global\let\pagealignmacro=\chapoddpage \global\def\HEADINGSon{\HEADINGSdouble}} \CHAPPAGon @@ -6777,9 +6914,7 @@ % \def\startcontents#1{% % If @setchapternewpage on, and @headings double, the contents should - % start on an odd page, unlike chapters. Thus, we maintain - % \contentsalignmacro in parallel with \pagealignmacro. - % From: Torbjorn Granlund + % start on an odd page, unlike chapters. \contentsalignmacro \immediate\closeout\tocfile % @@ -6794,6 +6929,9 @@ % % Roman numerals for page numbers. \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi + \def\thistitle{}% no title in double-sided headings + % Record where the Roman numerals started. + \ifnum\romancount=0 \global\romancount=\pagecount \fi } % redefined for the two-volume lispref. We always output on @@ -6816,8 +6954,7 @@ \fi \closein 1 \endgroup - \lastnegativepageno = \pageno - \global\pageno = \savepageno + \contentsendroman } % And just the chapters. @@ -6852,10 +6989,20 @@ \vfill \eject \contentsalignmacro % in case @setchapternewpage odd is in effect \endgroup + \contentsendroman +} +\let\shortcontents = \summarycontents + +% Get ready to use Arabic numerals again +\def\contentsendroman{% \lastnegativepageno = \pageno \global\pageno = \savepageno + % + % If \romancount > \arabiccount, the contents are at the end of the + % document. Otherwise, advance where the Arabic numerals start for + % the page numbers. + \ifnum\romancount>\arabiccount\else\global\arabiccount=\pagecount\fi } -\let\shortcontents = \summarycontents % Typeset the label for a chapter or appendix for the short contents. % The arg is, e.g., `A' for an appendix, or `3' for a chapter. @@ -7444,13 +7591,9 @@ \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount % % We typeset each line of the verbatim in an \hbox, so we can handle -% tabs. The \global is in case the verbatim line starts with an accent, -% or some other command that starts with a begin-group. Otherwise, the -% entire \verbbox would disappear at the corresponding end-group, before -% it is typeset. Meanwhile, we can't have nested verbatim commands -% (can we?), so the \global won't be overwriting itself. +% tabs. \newbox\verbbox -\def\starttabbox{\global\setbox\verbbox=\hbox\bgroup} +\def\starttabbox{\setbox\verbbox=\hbox\bgroup} % \begingroup \catcode`\^^I=\active @@ -7461,7 +7604,8 @@ \divide\dimen\verbbox by\tabw \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw - \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox + \wd\verbbox=\dimen\verbbox + \leavevmode\box\verbbox \starttabbox }% } \endgroup @@ -7471,9 +7615,7 @@ \let\nonarrowing = t% \nonfillstart \tt % easiest (and conventionally used) font for verbatim - % The \leavevmode here is for blank lines. Otherwise, we would - % never \starttabbox and the \egroup would end verbatim mode. - \def\par{\leavevmode\egroup\box\verbbox\endgraf}% + \def\par{\egroup\leavevmode\box\verbbox\endgraf\starttabbox}% \tabexpand \setupmarkupstyle{verbatim}% % Respect line breaks, @@ -7481,7 +7623,6 @@ % make each space count. % Must do in this order: \obeylines \uncatcodespecials \sepspaces - \everypar{\starttabbox}% } % Do the @verb magic: verbatim text is quoted by unique @@ -7516,13 +7657,16 @@ % ignore everything up to the first ^^M, that's the newline at the end % of the @verbatim input line itself. Otherwise we get an extra blank % line in the output. - \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}% + \xdef\doverbatim#1^^M#2@end verbatim{% + \starttabbox#2\egroup\noexpand\end\gobble verbatim}% % We really want {...\end verbatim} in the body of the macro, but % without the active space; thus we have to use \xdef and \gobble. + % The \egroup ends the \verbbox started at the end of the last line in + % the block. \endgroup % \envdef\verbatim{% - \setupverbatim\doverbatim + \setnormaldispenv\setupverbatim\doverbatim } \let\Everbatim = \afterenvbreak @@ -7540,7 +7684,7 @@ \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}% \edef\tmp{\noexpand\input #1 } \expandafter - }\tmp + }\expandafter\starttabbox\tmp\egroup \afterenvbreak }% } @@ -10706,6 +10850,8 @@ \DeclareUnicodeCharacter{0233}{\=y}% \DeclareUnicodeCharacter{0237}{\dotless{j}}% % + \DeclareUnicodeCharacter{02BC}{'}% + % \DeclareUnicodeCharacter{02DB}{\ogonek{ }}% % % Greek letters upper case @@ -11340,6 +11486,18 @@ \globaldefs = 0 }} +\def\bsixpaper{{\globaldefs = 1 + \afourpaper + \internalpagesizes{140mm}{100mm}% + {-6.35mm}{-12.7mm}% + {\bindingoffset}{14pt}% + {176mm}{125mm}% + \let\SETdispenvsize=\smallword + \lispnarrowing = 0.2in + \globaldefs = 0 +}} + + % @pagesizes TEXTHEIGHT[,TEXTWIDTH] % Perhaps we should allow setting the margins, \topskip, \parskip, % and/or leading, also. Or perhaps we should compute them somehow. @@ -11353,12 +11511,12 @@ \setleading{\textleading}% % \dimen0 = #1\relax - \advance\dimen0 by \voffset - \advance\dimen0 by 1in % reference point for DVI is 1 inch from top of page + \advance\dimen0 by 2.5in % default 1in margin above heading line + % and 1.5in to include heading, footing and + % bottom margin % \dimen2 = \hsize - \advance\dimen2 by \normaloffset - \advance\dimen2 by 1in % reference point is 1 inch from left edge of page + \advance\dimen2 by 2in % default to 1 inch margin on each side % \internalpagesizes{#1}{\hsize}% {\voffset}{\normaloffset}% diff -Nru datamash-1.7/build-aux/update-copyright datamash-1.8/build-aux/update-copyright --- datamash-1.7/build-aux/update-copyright 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/build-aux/update-copyright 2022-05-28 01:46:58.000000000 +0000 @@ -3,7 +3,7 @@ # Update an FSF copyright year list to include the current year. -# Copyright (C) 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 2009-2021 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 @@ -133,11 +133,11 @@ # are valid code in both sh and perl. When executed by sh, they re-execute # the script through the perl program found in $PATH. The '-x' option # is essential as well; without it, perl would re-execute the script -# through /bin/sh. When executed by perl, the next two lines are a no-op. +# through /bin/sh. When executed by perl, the next two lines are a no-op. eval 'exec perl -wSx -0777 -pi "$0" "$@"' if 0; -my $VERSION = '2018-03-07.03:47'; # UTC +my $VERSION = '2020-04-04.15:07'; # 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 diff -Nru datamash-1.7/build-aux/useless-if-before-free datamash-1.8/build-aux/useless-if-before-free --- datamash-1.7/build-aux/useless-if-before-free 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/build-aux/useless-if-before-free 2022-05-28 01:46:58.000000000 +0000 @@ -4,7 +4,7 @@ # Detect instances of "if (p) free (p);". # Likewise "if (p != 0)", "if (0 != p)", or with NULL; and with braces. -# Copyright (C) 2008-2020 Free Software Foundation, Inc. +# Copyright (C) 2008-2021 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 @@ -32,11 +32,11 @@ # are valid code in both sh and perl. When executed by sh, they re-execute # the script through the perl program found in $PATH. The '-x' option # is essential as well; without it, perl would re-execute the script -# through /bin/sh. When executed by perl, the next two lines are a no-op. +# through /bin/sh. When executed by perl, the next two lines are a no-op. eval 'exec perl -wSx "$0" "$@"' if 0; -my $VERSION = '2018-03-07 03:47'; # UTC +my $VERSION = '2020-04-04 15:07'; # 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 diff -Nru datamash-1.7/build-aux/vc-list-files datamash-1.8/build-aux/vc-list-files --- datamash-1.7/build-aux/vc-list-files 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/build-aux/vc-list-files 2022-05-28 01:46:58.000000000 +0000 @@ -4,7 +4,7 @@ # Print a version string. scriptversion=2018-03-07.03; # UTC -# Copyright (C) 2006-2020 Free Software Foundation, Inc. +# Copyright (C) 2006-2021 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.7/cfg.mk datamash-1.8/cfg.mk --- datamash-1.7/cfg.mk 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/cfg.mk 2022-07-23 02:21:48.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2014-2020 Assaf Gordon +# Copyright (C) 2014-2021 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 @@ # Hash of the current/old NEWS file. # checked by 'sc_immutable_NEWS' rule. # updated by 'update-NEWS-hash' rule. -old_NEWS_hash = d41d8cd98f00b204e9800998ecf8427e +old_NEWS_hash = 172bdd20a78c5f43b5154e7856983cb9 update-copyright-env = \ env \ diff -Nru datamash-1.7/ChangeLog datamash-1.8/ChangeLog --- datamash-1.7/ChangeLog 2020-04-23 17:34:26.000000000 +0000 +++ datamash-1.8/ChangeLog 2022-07-23 02:01:26.000000000 +0000 @@ -1,8 +1,734 @@ -2020-04-23 Assaf Gordon +2022-07-23 Timothy Rice + + version 1.8 + * NEWS: Record release date. + +2022-07-17 Erik Auerswald + + datamash: tests: decimal point as field separator + * tests/datamash-tests-2.pl: Add a commented out test for the + "getnum" operation with a decimal point as field separator. + Adjust alignment of two existing commented out tests. + +2022-07-17 Erik Auerswald + + datamash: tests: commented out getnum i18n tests + The "getnum" operation is neither properly locale-aware nor does + it ignore the locale setting. As a result floating point numbers + are not extracted correctly unless the locale-specific decimal + separator is a period. + + * tests/datamash-i18n-de.pl: Add commented out getnum tests. + +2022-07-17 Erik Auerswald + + tests: numbers with two decimal points in input + * tests/datamash-error-msgs.pl: Add tests for error message when + a number with two decimal points is given as input data. + + tests: decimal separator as field separator + * tests/datamash-i18n-de.pl: Add tests using the locale's decimal + separator (a comma) as field separator. + * tests/datamash-tests-2.pl: Add tests using the locale's decimal + separator (a period) as field separator. + + tests: adjust commented out i18n test + * tests/datamash-i18n-de.pl: Use a unique ID to allow commenting + in without further adjustments. Align test definition fields. + + maint: regression test consolidation + * tests/datamash-tests-2.pl: Move regression tests to have them + next to each other in one group. + +2022-07-11 Timothy Rice + + datamash: tests: Add test for crosstab with header-in, no header-out + + datamash: tests: Rename c3 header-in test for pcov consistent with scov + + datamash: tests: Add more paired-param tests with header in/out + + docs: Note non-standard --header-out with crosstab + + docs: Remove sentence about groupby/crosstab not understanding header names. + +2022-07-09 Timothy Rice + + datamash: maint: Fix some indentation + + datamash: bugfix: Ensure rmdup respects --output-delimiter + Fixes bug reported by Dima Kogan. + + datamash: bugfix: Allow crosstab to be called by header field name. + Ensure `--header-in crosstab x,y` does not crash. + Fixes bug reported by Dima Kogan. + + datamash: maint: fix long line + + maint: ignore side effects of make syntax-check + + maint: Fix minor typo + + datamash: maint: Add debug helper macro WHEREAMI() + + tests: Add the test for pcov header in/out + + datamash: Print all operation columns in output header + Ensure `--header-out pcov x:y` shows `pcov(x,y)` in header. + Fixes bug reported by Dima Kogan. + +2022-07-05 Timothy Rice + + maint: Break long lines + + maint: Update version notices. + +2022-07-04 Erik Auerswald + + maint: align datamash binning tests + * tests/datamash-tests-2.pl: Align binning tests. + +2022-07-04 Erik Auerswald + + tests: more datamash binning tests + Floating point numbers as operation parameters can be specified + using scientific notation (e.g., 1.2e3 for 1200.0). + + * tests/datamash-tests-2.pl: Add scientific notation bin sizes. + +2022-07-04 Erik Auerswald + + tests: test parser corner cases + Add tests of corner cases regarding whitespace in the operation + parsing of GNU Datamash in order to avoid introducing unintended + changes of behavior. + + * tests/datamash-parser.pl: Add tests with additional whitespace. + +2022-07-03 Erik Auerswald + + tests: add more datamash parser tests + * tests/datamash-parser.pl: Additional testing of correct and + incorrect use of optional operation parameters. + +2022-07-03 Erik Auerswald + + maint: more unique test identifiers for datamash + Having unique test identifiers helps in locating the problems + with test failures. It seems as if the intention is to have + unique test identifiers, at least per tested binary. Fix a + case of duplicated test identifiers in the two test files + datamash-tests.pl and datamash-parser.pl for binning related + test cases. + + * tests/datamash-parser.pl: Rename test identifier 'b1' to '31' + and 'b2' to 'b32'. + +2022-06-26 Erik Auerswald + + tests: add third datamash i18n test case + Depending on tokenizer changes to support comma as decimal + separator, three comma separated fields might trigger a + problem that is avoided with two comma separated fields. + + * tests/datamash-i18n-de.pl: Add test case with three fields + separated with commas. + +2022-06-26 Erik Auerswald + + tests: avoid Perl warning in datamash-i18n-de.pl + The string comparison `$lc_de eq undef` results in up to two + warnings. If `$lc_de` is defined, the single warning + + Use of uninitialized value in string eq at + ./tests/datamash-i18n-de.pl line 39. + + is emitted. This is caused by comparing with `undef` in the + string equality test `eq`. + + If the locale `de_DE.utf8` is not found, `$lc_de` is undefined. + If `$lc_de` is undefined, two warnings are emitted: + + Use of uninitialized value $lc_de in string eq at + ./tests/datamash-i18n-de.pl line 39. + + Use of uninitialized value in string eq at + ./tests/datamash-i18n-de.pl line 39. + + Using `defined()` to test if `$lc_de` is defined avoids this. + + * tests/datamash-i18n-de.pl: Use defined() to check if a + variable is defined. + +2022-06-26 Erik Auerswald + + tests: add second datamash i18n test case + Supporting a comma as decimal separator for numeric arguments + to GNU Datamash operations risks confusing a comma separated + list of fields with a floating point number. + + * tests/datamash-i18n-de.pl: Add test case with a comma + separated list of field numbers. + +2022-06-25 Erik Auerswald + + maint: fix a typo in a comment + +2022-06-25 Timothy Rice + + maint: Remove incorrect comment about LC_NUMERIC + + maint: Skip German test if de_DE.utf8 locale not found + + Test decimal separator in de_DE.UTF-8 locale + +2022-06-25 Shawn Wagner + + src/decorate.c: Fix a NetBSD-specific seg fault. + +2022-06-24 Erik Auerswald + + datamash: re-write binning for negative numbers + Make the binning code more explicit regarding handling of + negative binning values: + + - changing a negative zero into a positive zero can only + be needed for negative values; + - if the fractional part of a negative value is zero: + - the number is the lower bound of the bucket interval, + - and the number could be a negative zero; + - if the fractional part of a negative value is non-zero: + - the number falls into the preceding bucket interval. + + When testing with both negative and non-negative numbers, + the new code was not slower. It even seemed to be a tiny + bit faster on average. + + * src/field-ops.c (field_op_collect): re-write binning code + for negative numbers. + +2022-06-23 Timothy Rice + + datamash: Fix binning of negative numbers. + +2022-06-18 Shawn Wagner + + Add framework for installing hooks into cloned git repositories. + Includes a pre-commit hook that runs make syntax-check + +2022-06-18 Timothy Rice + + maint: Convert sort+header tests from shell to perl + + maint: fix long lines + + maint: Make test indentation more consistent + + maint: fix long lines + +2022-06-17 Timothy Rice + + Rename deprecated tests + + Deprecate -f/--full for non-linewise operations + +2022-06-12 Erik Auerswald + + tests: add cheap I/O error test + The existing tests/datamash-io-errors.sh is marked as expensive + and requires two file system images prepared to provoke I/O + errors for GNU Datamash to detect and report. As a result it + is executed less frequently than most other tests. + + The new tests/datamash-io-errors-cheap.sh requires just the + availability of the special file "/dev/full" to immediately + provoke an I/O error on output. This test requires minimal + input data and is cheap to run. + + * Makefile.am (TESTS): Add new test file. + * tests/datamash-io-errors-cheap.sh: New file with one test. + +2022-06-07 Erik Auerswald + + datamash: fix segmentation fault + As reported by Catalin Patulea on bug-datamash@gnu.org in + , + GNU Datamash could crash with a segmentation fault if the + unique or countunique operations were used with input data + containing NUL bytes. + + The problem was that the field_op_get_string_ptrs() function + could create more pointers than it allocated memory for if + the input data contained NUL bytes. The solution is to add a + check to avoid writing past the end of the "ptrs" buffer. + + * NEWS: Mention bug fix. + * src/field-ops.c (field_op_get_string_ptrs): Do not write past + the end of the "ptrs" buffer. + * tests/datamash-tests-2.pl: Add tests to verify bug fix. + +2022-06-06 Erik Auerswald + + doc: mention ms and rms in --help and man page + The recent operations ms (mean square) and rms (root mean + square) are listed only in the texinfo manual. Add them + to both the 'datamash --help' output and the datamash(1) + man page. + + * src/datamash.c (usage): Add ms and rms to Statistical + Grouping operations. + * man/datamash.x: Likewise. + +2022-06-05 Erik Auerswald + + tests: more leading and trailing whitespace tests + * tests/datamash-tests.pl: Add tests with leading whitespace, + trailing whitespace, and both leading and trailing whitespace. + + tests: leading and trailing whitespace behavior + * tests/datamash-tests.pl: Add whitespace-only tests. + + doc: texinfo manual adjustments + * doc/datamash.texi: Mention that "cut" operation uses given field + ordering. Expand on leading and trailing whitespace description. + Ask for unified instead of context diff. + +2022-06-04 Erik Auerswald + + maint: fix "make syntax-check" errors + * .gitignore: Use "file system" instead of "filesystem". + * tests/datamash-tests-2.pl: Wrap lines longer than 80 characters. + + maint: fix typo in a comment + +2022-06-04 Timothy Rice + + Remove commented-out code + + Fix typo + + datamash: Align field_operations columns + It was difficult to visually group entries with the columns zig-zagging. + + datamash: Alias echo -> cut and unique -> uniq + +2022-06-03 Erik Auerswald + + tests: enable valgrind test to pass + The sub-test "custom-format" of the expensive test + datamash-valgrind.sh would always fail, because the + datamash was supposed to sum all input numbers, but + some of those are too big for 80-bit extended floating + point numbers as used on x86. Thus datamash would + emit an error message and return an exit code of 1. + That was interpreted as a test failure. + + * tests/datamash-valgrind.sh: Use different valgrind error + exit code to distinguish between valgrind detecting a + memory leak and datamash reporting an error. + +2022-06-02 Timothy Rice + + maint: Impose '-T small' for fullfs check + + maint: Ignore side-effects make check-expensive + +2022-06-01 Shawn Wagner + + Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/datamash + + Fix memory leaks in decorate + + Fix memory leaks with custom numeric precisions and formats + + Fix some memory leaks in crosstab code + + Fix a memory leak in parsing column names. + +2022-06-01 Erik Auerswald + + doc: fix a few typos + * HACKING.md: Fix typos. + * build-aux/create_corrupted_file_system.sh: Fix typos in comments. + * build-aux/create_small_file_system.sh: Fix typo in a comment. + +2022-05-31 Shawn + + Add bootstrap instructions for NetBSD and OpenBSD to HACKING.md + +2022-05-31 Erik Auerswald + + doc: fix typo and quoting in man page template + This is based on a Debian patch applied to GNU Datamash during + packaging. The Debian patch from Alejandro Garrido Mota + modifies the generated datamash man page. + The Debian patch can be found at: + https://sources.debian.org/src/datamash/1.7-2/debian/patches/fix-manpage.diff/ + + * man/datamash.x: Spelling fix varient->variant. Consistently + use ' instead of \' as single quote character. + +2022-05-30 Erik Auerswald + + doc: tweak help output and man pages + Mention the LC_NUMERIC environment variable in datamash --help + output and the generated man page. + + Add an "Options:" header line to the output of datamash --help + and decorate --help so that help2man detects the OPTIONS section. + + Use DESCRIPTION instead of OVERVIEW to add text from the man page + template to the DESCRIPTION section of the decorate(1) man page. + + Move the examples from the decorate(1) man page template into the + EXAMPLES section of the generated man page. + + * man/decorate.x: Rename OVERVIEW to DESCRIPTION. Move EXAMPLES. + * src/datamash.c (usage): Add "Options:" header and "Environment:" + section to help output. + * src/decorate.c (usage): Add "Options:" header to help output. + +2022-05-29 Erik Auerswald + + datamash: fix short option -c X + The short option -c X is documented as a short alternative to + --collapse-delimiter=X, but it is not accepted. Fix this. + + * src/datamash.c (short_options): Add "c:". + * tests/datamash-tests.pl: Test use of -c. + +2022-05-29 Erik Auerswald + + doc: leading and trailing whitespace with -W + With the -W, --whitespace option, datamash(1) ignores leading + whitespace, but not trailing whitespace. Trailing whitespace + results in an additional empty field at the end of the line. + This is different to field splitting in Awk, Bash, or Python. + + This behavior is tested for, but not documented. Thus mention + it in the texinfo documentation. + + * doc/datamash.texi: Add a senetence to the -W, --whitespace + option description. + +2022-05-29 Erik Auerswald + + doc: tweak NEWS entries for new features + There are new features for both datamash(1) and decorate(1). + Ensure that every new feature description mentions the program. + Additionally, move the new decorate(1) feature entry below the + new datamash(1) features to keep chronological order of entries. + + * NEWS: Always mention the changed program. Move new entry + below existing entries. + +2022-05-29 Erik Auerswald + + decorate: new conversions ipv6v4map and ipv6v4comp + The two new decorate(1) conversion methods ipv6v4map and + ipv6v4comp allow to sort on a field that may contain either + an IPv6 or an IPv4 address. + + IPv4 and IPv6 addresses can be seen as IP addresses. Logs from + a "dual-stack" application, e.g., a web server, may contain + either an IPv4 or IPv6 address at a given position in each line. + Thus if one wants to sort the log file on the IP address, + both IPv4 and IPv6 addresses need to be accepted as sort key + and sorted consistently. One approach is to transform one + address type into the other before sorting. IPv6 supports + the transformation of IPv4 addresses into IPv6 addresses. + + There are two common methods for accomodating IPv4 addresses in + IPv6: IPv4-Mapped addresses and the deprecated IPv4-Compatible + addresses. Both can be used to convert a given IPv4 address + to an IPv6 address. Both IPv4-Mapped and IPv4-Compatible IPv6 + address ranges are reserved by IANA and always represent IPv4 + addresses in a dual-stack enabled application. + + IPv4-Compatible addresses just add 96 leading zero bits to + the 32 bit IPv4 address to create a 128 bit IPv6 address. + This results in an ambiguity for the unspecified address + (all-zero in both IPv4 and IPv6) and the IPv6 localhost address + ::1 with the first host address of "this" network in IPv4 + (0.0.0.1). IPv4-Mapped addresses avoid this ambiguity. + + But since IPv4-Compatible IPv6 addresses can be seen as + treating the IP address (both version 4 and version 6) as + a specific way to represent an integer value I think it is + useful to support this transformation as well. + + Both conversions logically convert an IPv4 address to an IPv6 + address, but the code actually creates a textual representation + of an 128 bit integer from either an IPv4 or IPv6 address. + + Functionality like this was requested for sort(1) from GNU + Coreutils: + https://lists.gnu.org/archive/html/coreutils/2011-06/msg00078.html + https://lists.gnu.org/r/bug-coreutils/2015-06/msg00039.html + + It was rejected for sort(1) from GNU Coreutils: + https://www.gnu.org/software/coreutils/rejected_requests.html#sort + https://lists.gnu.org/r/bug-coreutils/2015-06/msg00041.html + + Thus it seems appropriate for decorate(1), complementing the + existing conversion methods for either IPv4 or IPv6 addresses, + but not both. + + * NEWS: Mention new decorate conversion methods. + * src/decorate-functions.c: Implement new conversion methods. + (decorate_ipv6_ipv4): New function. + (decorate_ipv6_ipv4_mapped): New function. + (decorate_ipv6_ipv4_compat): New function. + (builtin_conversions): Add new operations. + * tests/decorate-errors.pl, + tests/decorate-sort-tests.pl, + tests/decorate-tests.pl: Add tests for new conversion methodss. + +2022-05-29 Erik Auerswald + + doc: adjust short description in decorate man page + The decorate man page used the datamash short description. + Replace it with a short description of decorate. + + * man/decorate.x: Adjust short description. + +2022-05-29 Erik Auerswald + + maint: fix syntax-checks + * AUTHORS: Break line at 80 characters. + * THANKS: Break line at 80 characters. + + doc: mention -C, --skip-comments in texinfo manual + * doc/datamash.texi: Mention -C, --skip-comments + + doc: fix man page name in help output + * src/datamash.c: Use PROGRAM_NAME as man page name. + * src/decorate.c: Likewise. + +2022-05-29 Erik Auerswald + + doc: mention LC_NUMERIC in texinfo manual + The LC_NUMERIC environment variable affects both the decimal and + thousands separator used by GNU Datamash. + + * doc/datamash.texi: Mention LC_NUMERIC. + +2022-05-28 Erik Auerswald + + fix floor/ceil/up/down confusion in man page + * man/datamash.x: floor is down, ceil is up. + +2022-05-28 Timothy Rice + + Change tabs to spaces for consistency + + Update bug report address to bug-datamash + + Promote Erik to the 'members' area in AUTHORS (i.e. git push access.) + + Clean up trailing end-of-line whitespaces. + Partial revert of 9347234 which incorrectly deleted entire lines due to + poor choice of sed command. + + Clean up trailing end-of-line whitespaces. + +2022-05-27 Shawn Wagner + + Squashed commit of the following: + commit ee69c4d1c27e683d91163129ca1f5e43adf34243 + Author: Shawn Wagner + Date: Thu May 26 05:51:19 2022 -0700 + + Add tests for mean square and root mean square + + Also update the R code in the file used to verify results to include + newer operations. + + commit 2036f7259a371420c8a90b8af31187f77a044290 + Author: Shawn + Date: Fri Jun 19 15:38:07 2020 -0700 + + Add mean square/root mean square commands. + + doc/datamash.texi: Documentation + src/field-ops.c,src/op-defs.c,src/op-defs.h: New ms and rms commands. + +2022-05-27 Timothy Rice + + Expand AUTHORS and THANKS + +2022-05-18 Shawn Wagner + + Rebuild mr/.gitignore + +2022-05-18 Shawn + + Update bash completion module + contrib/bash-completion/datamash: Add new commands and options + +2022-05-18 Shawn Wagner + + Add -c/--collapse-delimiter argument + + Tweaks to satisfy make syntax-check + +2022-05-18 Shawn + + Squashed commit of the following: + commit 700e3ab38e19d5f53eb332ea11fa6001505fc026 + Author: Shawn Wagner + Date: Sat Jun 20 01:53:04 2020 -0700 + + Properly escape sort commands executed by sh + + Also removes the arbitrary 1024 character limit on sort command. + + * bootstrap.conf,Makefile.am: Add sh-quote gnulib module + * src/decorate.c: --print-sort-args quotes arguments when needed. + * src/datamash.c: Shell escape sort command used by popen(), get rid of + max length of it. + * tests/datamash-sort-errors.sh,tests/decorate-tests.sh: Handle new + output. + + commit ae84f5dddf6761d80cd08e441358ca23c96f13d6 + Author: Shawn Wagner + Date: Sat Jun 20 01:05:09 2020 -0700 + + Use an unstable sort with NetBSD /usr/bin/sort in decorate + + It's stable by default, unlike any other sort(1) I checked, so + when using it, pass an option to make it unstable to pass tests cases. + + * src/decorate.c: Pass -S to /usr/bin/sort on NetBSD + * tests/decorate-sort-tests.pl tests/decorate-tests.pl: Force using + /usr/bin/sort on NetBSD, and account for new output in test cases. + + commit 267c8974a5eed4844d9ee17e3f0aa9c45fe5d95f + Author: Shawn Wagner + Date: Fri Jun 19 23:14:53 2020 -0700 + + Add a --sort-cmd argument to datamash and decorate. + + Allows overriding the version of sort(1) found by configure. + + src/datamash.c,src/decorate.c: Add --sort-cmd argument. + tests/datamash-sort-errors.sh: Use it in tests designed to fail. + doc/datamash.texi: Document it. + + commit 82fb2366e500533f91171465c511ddc3e600a53b + Author: Shawn Wagner + Date: Fri Jun 19 23:00:39 2020 -0700 + + Make configure check for sort(1) + + First looks for gsort, then sort, so that non-GNU userland OSes with + GNU coreutils installed will prefer GNU sort. + + * configure.ac: test for gsort and sort + * src/datamash.c,src/decorate.c: Use the path to sort found by configure. + * src/datamash.c: Make it harder to overflow the sort command string. + * tests/decorate-tests.pl: Fix test cases for using full path to sort + +2022-05-18 Shawn Wagner + + Fix --help not including default value for --filler argument. + Patch from Erik Auerswald. + +2022-05-14 Shawn Wagner + + Some auditing of gnulib modules + Added some missing ones for things used by datamash, removed some + unused ones. + + Squashed commit of the following: + + commit ce8fd789a0d60f0592ec79567f84c09b05e2b4aa + Author: Shawn Wagner + Date: Sat May 14 05:43:05 2022 -0700 + + Update m4/ax_c_long_long.m4 from autoconf-archive latest + + commit d5cc572bc52d02169959361aca3f0e0823643d79 + Author: Shawn Wagner + Date: Sat May 14 05:34:48 2022 -0700 + + Update m4/.gitignore + + commit ef0ec5ca533067948800e3f8c10292b553cfb4eb + Author: Shawn + Date: Thu Apr 23 15:57:02 2020 -0700 + + Add missing gnulib modules used in decorate + + commit 67cbe0b3462dab739a3bd81a89e1e91b2d128519 + Author: Shawn + Date: Mon Apr 20 01:49:03 2020 -0700 + + Add missing gnulib modules + +2022-05-14 Shawn Wagner + + Typo in manpage -h -> -H + Patch by Erik Auerswald + + Fix spelling errors and other issues in texi documentation. + Patch from Erik Auerswald. + + Fix an incorrect format in a decorate(1) message. + Reported by Jiri Hladky, fixed by Erik Auerswald. + + Spelling fixes in documentation + +2021-01-06 Assaf Gordon + + maint: update copyright year + Run "make update-copyright" and then: + * gnulib: Update to latest. + * tests/init.sh, bootstrap: Update to latest from gnulib. + * m4/.gitignore: Add gnulib updates. + +2020-04-30 Shawn + + datamash: fix missing -z when calling sort(1) + When sorting NUL terminated lines, the needed -z option wasn't being + passed to sort(1), causing errors due to improperly sorted data. Fixed, + plus raises an error if the system sort(1) doesn't support -z. + + * NEWS: Mention bugfix. + * configure.ac: Test to see if sort(1) understands -z + * datamash.c (open_input): If "-z" and "-s" are used, add "-z" to the + sort(1) command line; Exit with an error if sort(1) does not support "-z". + +2020-04-30 Shawn + + datamash,decorate: use pledge(2) on OpenBSD to restrict capabilities + pledge is an OpenBSD specific mechanism for restricting what syscalls + a process can execute, or limiting how they behave. It's considered + polite on OpenBSD to limit a program to just the bare minimum it + needs to run. See https://man.openbsd.org/pledge.2 for details. + + * configure.ac: Add check for pledge(2). + * src/system.h (openbsd_pledge): New static function, calling pledge(2). + * src/datamash.c (main), src/decorate.c (main): Call new function on startup. + +2020-04-30 Shawn + + tests: use jot as seq on OpenBSD instead of skipping tests + * init.cfg(openbsd_seq_replacement_): New function. + Work around OpenBSD's lack of seq(1) using jot(1). + * tests/datamash-rand.sh, tests/datamash-sort-errors.sh, + tests/datamash-strbin.sh: Use new function. + + tests: handle getopt_long(3) differences on OpenBSD + * tests/datamash-error-msgs.pl, tests/decorate-errors.pl: Work around + OpenBSD's getopt_long(3) producing different error messages from GNU + version. + +2020-04-24 Assaf Gordon maint: update NEWS with version 1.7 and date -2020-04-23 Assaf Gordon +2020-04-24 Assaf Gordon decorate: new program (experimental) decorate(1) works in tandem with sort(1) to enable sorting by @@ -27,7 +753,7 @@ tests/decorate-tests.pl: New tests. * po/POTFILES.in: Add new .c files. -2020-04-23 Assaf Gordon +2020-04-24 Assaf Gordon maint: fix syntax-checks following sha256,geomean additions * src/datamash.c (usage), @@ -35,11 +761,11 @@ tests/datamash-stats.pl: Break line at 80 characters. * src/fields-ops.c: Fix space-before-parentheses. -2020-04-22 Assaf Gordon +2020-04-23 Assaf Gordon maint: update help2man -2020-04-22 Shawn +2020-04-23 Shawn datamash: new operations: geomean,harmmean They compute the geometric and harmonic means, thus adding support @@ -102,7 +828,7 @@ * src/field-ops.c: Implement operations. * tests/datamash-sha.pl: Add tests. -2020-02-23 Assaf Gordon +2020-02-24 Assaf Gordon doc: update NEWS with version 1.6 and date @@ -116,7 +842,7 @@ doc: mention getnum bugfix in NEWS * NEWS: Mention bugfix -2020-02-12 Assaf Gordon +2020-02-13 Assaf Gordon datamash: bug fix 'getnum' operation ignoring 8,9 chars Digits 8,9 were wrongly ignored on in default numeric format (decimal): @@ -129,7 +855,7 @@ pattern. * tests/datamash-tests-2.pl: Add tests to catch this error. -2020-01-01 Assaf Gordon +2020-01-02 Assaf Gordon maint: update copyright date to 2020 * all files: Run "make update-copyright". @@ -162,7 +888,7 @@ * doc/datamash.texi, man/datamash.x: Mention new operation. * tests/datamash-tests-2.pl: Add tests. -2019-08-26 Assaf Gordon +2019-08-27 Assaf Gordon datamash: new operation: getnum Extract numeric values from a string: @@ -196,7 +922,7 @@ * doc/datamash.texi, man/datamash.x: Mention new operation. * tests/datamash-tests-2.pl: Add tests. -2019-08-26 Assaf Gordon +2019-08-27 Assaf Gordon build: work-around automake 1.16 regression with non-gnu make Discussed in https://lists.gnu.org/r/automake/2019-08/msg00000.html @@ -206,11 +932,11 @@ * Makefile.am (LDADD): Remove $(top_builddir) from library path. -2019-08-26 Assaf Gordon +2019-08-27 Assaf Gordon gnulib: update to latest (gettext 0.20 fix) -2019-08-22 Assaf Gordon +2019-08-23 Assaf Gordon maint: don't syntax-check for trailing spaces on a unit test file @@ -218,7 +944,7 @@ maint: ignore space_before_parens syntax-check on STREQ_LEN -2019-08-22 Assaf Gordon +2019-08-23 Assaf Gordon datamash: new operations: extname, barename Extract the file extension, and the basename without the extension: @@ -240,7 +966,7 @@ * doc/datamash.texi, man/datamash.x: Mention new operation. * tests/datamash-tests-2.pl: Add tests. -2019-08-22 Assaf Gordon +2019-08-23 Assaf Gordon datamash: new operations: dirname, basename Similar to dirname(1) and basename(1), but operate on a file. @@ -256,7 +982,7 @@ * doc/datamash.texi, man/datamash.x: Mention new operation. * tests/datamash-tests-2.pl: Add tests. -2019-08-06 Assaf Gordon +2019-08-07 Assaf Gordon datamash: accept backslash-escaped characters in field names Suggested by Renato Alves in @@ -274,7 +1000,7 @@ allow backslashes. * tests/datamash-error-msgs.pl, tests/datamash-tests-2.pl: Add tests. -2019-08-06 Assaf Gordon +2019-08-07 Assaf Gordon datamash: fix mode/antimode incorrect results for negative values In version 1.4 and earlier, this resulted in incorrect values: @@ -289,7 +1015,7 @@ * tests/datamash-tests-2.pl: Add test. * NEWS: Mention fix. -2019-01-01 Assaf Gordon +2019-01-02 Assaf Gordon maint: update gnulib to latest * gnulib: Update to latest. @@ -298,23 +1024,23 @@ maint: update copyright date to 2019 * all files: Run "make update-copyright". -2018-12-22 Assaf Gordon +2018-12-23 Assaf Gordon doc: update release date for version 1.4 * NEWS: Update date. -2018-12-21 Assaf Gordon +2018-12-22 Assaf Gordon gnulib: update to latest -2018-12-14 Assaf Gordon +2018-12-15 Assaf Gordon maint: update .gitignore Following gnulib recent update. * m4/.gitignore: Update file list. -2018-12-14 Assaf Gordon +2018-12-15 Assaf Gordon build: update autoconf version requirements Require version 2.69 to bootstrap. @@ -329,7 +1055,7 @@ * configure.ac, bootstrap.conf: Require autoconf version 2.69 or later. -2018-12-13 Assaf Gordon +2018-12-14 Assaf Gordon build: add special CPPFLAGS for windows binaries FORCE_C_LOCALE: Force C/POSIX locale, instead of assuming it is @@ -340,7 +1066,7 @@ * src/datamash.c (main): Add preprocessor conditionals. -2018-12-07 Assaf Gordon +2018-12-08 Assaf Gordon datamash: new option -C/--skip-comments Suggested by Mark van Rossum in @@ -356,11 +1082,11 @@ * man/datamash.x: Add "skipping comment lines" section. * tests/datamash-tests-2.pl: Add new test cases. -2018-12-07 Assaf Gordon +2018-12-08 Assaf Gordon gnulib: update to latest -2018-08-21 Assaf Gordon +2018-08-22 Assaf Gordon doc: fix man-page typo Reported by Steve Ward in @@ -368,26 +1094,26 @@ * man/datamash.x: Fix missing formatting letter B. -2018-03-22 Assaf Gordon +2018-03-23 Assaf Gordon tests: disable --format="%a" test Valid output can differ (e.g. 0x8.000p-3 vs 0x1.000p+0). * tests/datamash-output-format.pl: Disable 'a1' test. -2018-03-22 Assaf Gordon +2018-03-23 Assaf Gordon tests: fix --format='%4000f' expected output Can be 1.000009... or 1.000008999, depending on representation. * tests/datamash-output-format.pl: Check only the first 5 digits. -2018-03-16 Assaf Gordon +2018-03-17 Assaf Gordon doc: update NEWS with new version and date * NEWS: Set version 1.3 and date. -2018-01-24 Assaf Gordon +2018-01-25 Assaf Gordon maint: fix syntax-check issues * doc/datamash-texinfo.css: Limit to 80 characters. @@ -395,7 +1121,7 @@ * src/double-format.c: Remove unused "ignore-value.h". * src/text-options.{c,h}: Space after parens. -2018-01-22 Assaf Gordon +2018-01-23 Assaf Gordon maint: change URLs from http to https * all files: Change to https URLs. @@ -411,7 +1137,7 @@ tests/datamash-output-format.pl: Test new option. * tests/datamash-valgrind.sh: Test large output buffer under valgrind. -2018-01-17 Assaf Gordon +2018-01-18 Assaf Gordon datamash: add -R/--round=N option Print numeric values with N decimal places. @@ -434,14 +1160,14 @@ * tests/datamash-output-format.pl: Test --round usage. * Makefile.am: Add new test file. -2018-01-03 Assaf Gordon +2018-01-04 Assaf Gordon maint: update copyright year to 2018 * all files: Update with 'make update-copyright'. gnulib: update to latest -2017-12-10 Assaf Gordon +2017-12-11 Assaf Gordon maint: add github ISSUE/PULL-REQUEST templates Encourage contributors to use bug-datamash@gnu.org instead of github. @@ -449,12 +1175,12 @@ * .github/ISSUE_TEMPLATE.txt, .github/PULL_REQUEST_TEMPLATE.txt: New files. -2017-11-14 Assaf Gordon +2017-11-15 Assaf Gordon gnulib: update to latest * m4/.gitignore: Automatically updated git newest gnulib bootstrap. -2017-11-14 Assaf Gordon +2017-11-15 Assaf Gordon datamash: new operation 'trimmean' To calculate 20% trimmed mean: @@ -479,13 +1205,13 @@ * tests/datamash-error-msgs.pl: Test 'trimmean' parameter error messages. * tests/datamash-stats.pl: Add tests, compare against R results. -2017-09-06 Assaf Gordon +2017-09-07 Assaf Gordon build: indicate which hash functions are used at end of ./configure * NEWS: Mention the change (and the link fix from previous commit). * configure.ac: Print 'internal' or 'external' based on $LIB_CRYPTO. -2017-09-06 Jeroen Roovers +2017-09-07 Jeroen Roovers build: link with external crypto libraries if needed Datamash uses gnulib's sha* modules, which allow linking with OpenSSL @@ -497,7 +1223,7 @@ * Makafile.am (datamash_LDADD): Add $(LIB_CRYPTO) -2017-09-05 Assaf Gordon +2017-09-06 Assaf Gordon datamash: new --output-delimiter=X option Suggested by Dave Myron in @@ -512,14 +1238,14 @@ * tests/datamash-tests-2.pl, tests/datamash-error-msgs.pl: Test new option. -2017-09-05 Yu Fu +2017-09-06 Yu Fu doc: fixed two typos Reported in: https://github.com/agordon/datamash/pull/2 . * examples/readme.md: Fixed transcribes -> transcribed. -2017-08-22 Assaf Gordon +2017-08-23 Assaf Gordon version 1.2 * NEWS: Record release date. @@ -547,7 +1273,7 @@ gnulib: update to latest -2017-08-20 Assaf Gordon +2017-08-21 Assaf Gordon tests: skip tests if paste(1) is not found On Alpine linux, paste(1) is not installed by default - skip instead @@ -557,13 +1283,13 @@ * tests/datamash-rand.sh, tests/datamash-sort-errors.sh: Skip if paste(1) is not found. -2017-08-20 Assaf Gordon +2017-08-21 Assaf Gordon tests: quote '^' in shell commands The '^' character has special meaning in older shells (e.g. OpenSolaris 10/sparc). Quote it to prevent test failures. -2017-08-20 Assaf Gordon +2017-08-21 Assaf Gordon tests: accept '-nan' under OpenBSD OpenBSD systems return '-nan' instead of 'nan' for two tests. @@ -571,7 +1297,7 @@ * tests/datamash-tests-2.pl (narm12,narm15): Discard '-' prefix. -2017-08-20 Assaf Gordon +2017-08-21 Assaf Gordon datamash: fix incorrect int size for percetiles On SunOS 5.11/i86pc, sizeof(size_t)==4 while sizeof(uintmax_t)==8. @@ -584,7 +1310,7 @@ * src/op-parser.c, src/datamash.c: use PRIuMAX for printf, and convert to uintmax_t. -2017-08-09 Assaf Gordon +2017-08-10 Assaf Gordon maint: improve bash-completion script installation (again) Reported by Bruno Haible in @@ -601,13 +1327,13 @@ * NEWS: Mention this. * README: Document this. -2017-08-07 Assaf Gordon +2017-08-08 Assaf Gordon bash-completion: add range,perc operations * contrib/bash-completion/datamash: Add range/perc (percentile) operations to list of suggested completions. -2017-06-07 Assaf Gordon +2017-06-08 Assaf Gordon datamash: add lines/fields option to 'check' operation Datamash will fail with non-zero exit code if the input does not @@ -640,22 +1366,22 @@ * man/datamash.x: Add 'check' examples. * doc/datamash.texi: Expand 'check' section. -2017-06-06 Assaf Gordon +2017-06-07 Assaf Gordon maint: mark more lines as LCOV_EXCL_LINE for more accurate coverage -2017-05-25 Assaf Gordon +2017-05-26 Assaf Gordon gnulib: update to latest -2017-05-25 Assaf Gordon +2017-05-26 Assaf Gordon datamash: free crosstab memory if LINT Detected by Covrity scan (CID 72245, 72246). * src/crosstab.c (print_crosstab): Call free() if lint is enabled. -2017-05-25 Assaf Gordon +2017-05-26 Assaf Gordon build: add lint option to configure script Usage: ./configure --enable-lint @@ -665,7 +1391,7 @@ * configure.ac: Add --enable-lint option. * HACKING: Mention this option. -2017-05-08 Assaf Gordon +2017-05-09 Assaf Gordon build: add src/die.h to source files list Omitted from previous commit v1.1.1-10-gedab279 @@ -673,7 +1399,7 @@ * Makefile.am (datamash_SOURCES): Add missing file. -2017-05-08 Assaf Gordon +2017-05-09 Assaf Gordon datamash: new operation 'range' Calculate the range of values in the group: @@ -696,7 +1422,7 @@ * tests/datamash-tests-2.pl: Test new operation with various inputs. * doc/datamash.texi, man/datamash.x: Mention new operation. -2017-05-08 Assaf Gordon +2017-05-09 Assaf Gordon build: add 'fallthrough' comments to supress gcc-7.1 warnings gcc-7.1 warns about: @@ -711,7 +1437,7 @@ * src/op-parser.c: Add explicit 'fallthrough' comment in two intentional fall through cases. -2017-05-08 Assaf Gordon +2017-05-09 Assaf Gordon datamash: use die() instead of error() Copied from GNU coreutils v8.25-79-g492dcb2, @@ -726,7 +1452,7 @@ src/field-ops.c, src/datamash.c: Changed 'error(EXIT_FAILURE,...)' to 'die(...)'. -2017-05-08 Assaf Gordon +2017-05-09 Assaf Gordon build: require pkg-config>=0.28 when building from git configure.ac uses the PKG_CHECK_VALUE macro from the pkg-config' pkg.m4 @@ -737,19 +1463,19 @@ * bootstrap.conf: Specify minimum version for pkg-config. -2017-05-02 Assaf Gordon +2017-05-03 Assaf Gordon build: remove bashcompdir from Makefile.am It is already defined in configure.ac (warning generated by autoreconf). * Makefile.am: Remove bashcompdir. -2017-04-18 Assaf Gordon +2017-04-19 Assaf Gordon doc: expand build instructions in README and HACKING.md Explain how to build from git. -2017-04-18 Assaf Gordon +2017-04-19 Assaf Gordon build: require 'pkg-config' when bootstrapping pkg-config is used to detect the bash-completion directory. @@ -759,11 +1485,11 @@ * bootstrap.conf: Add pkg-config requirement. -2017-04-05 Assaf Gordon +2017-04-06 Assaf Gordon gnulib: update to latest -2017-03-23 Barry Nisly +2017-03-24 Barry Nisly datamash: new operation 'perc' (percentiles) Usage: @@ -784,7 +1510,7 @@ * doc/datamash.texi, man/datamash.x: Mention new operation. * tests/datamash-error-msgs.pl: Test 'perc' parameter error messages. -2017-03-16 Assaf Gordon +2017-03-17 Assaf Gordon build: install bash-completion script by default (if possible) If the 'bash-completion' package is instaleld with pkg-config support, @@ -801,13 +1527,13 @@ autodetect bash-completion directory using pkg-config. * Makefile.am: Add bash-completion target (if enabled). -2017-03-16 Assaf Gordon +2017-03-17 Assaf Gordon maint: update .gitignore gnulib: update to latest -2017-01-19 Assaf Gordon +2017-01-20 Assaf Gordon maint: update bootstrap script to latest * bootstrap: Copy latest version from gnulib/build-aux/bootstrap. @@ -816,7 +1542,7 @@ gnulib: update to latest -2017-01-10 Assaf Gordon +2017-01-11 Assaf Gordon build: fix out-of-tree builds without dep-tracking Create src,lib,doc,tests subdirectories at the end of @@ -826,7 +1552,7 @@ * configure.ac: Call AS_MKDIR_P() to create subdirectories. -2017-01-10 Assaf Gordon +2017-01-11 Assaf Gordon maint: update copyright year to 2017 Automatic update with 'make update-copyright'. @@ -839,13 +1565,13 @@ maint: update gnulib to latest * m4/.gitignore: Ignore few more m4 files. -2016-09-22 Assaf Gordon +2016-09-23 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 +2016-09-23 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 @@ -862,7 +1588,7 @@ 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 +2016-09-23 Assaf Gordon datamash: 'transpose' bugfix (missing values in last line) Missing values in the last line would cause fields to be silently dropped: @@ -876,7 +1602,7 @@ 1 a 2 N/A -2016-01-16 Assaf Gordon +2016-01-17 Assaf Gordon maint: update date in NEWS * NEWS: update release version, metion version bump. @@ -884,7 +1610,7 @@ doc: add 'field delimiters' section to manual * doc/datamash.texi: add new 'field delimiters' section. -2016-01-02 Assaf Gordon +2016-01-03 Assaf Gordon maint: update gnulib to latest version * gnulib: update to latest version with copyright year adjusted @@ -893,7 +1619,7 @@ maint: update all copyright year number ranges -2015-12-31 Assaf Gordon +2016-01-01 Assaf Gordon maint: rename pmccabe makefile target name * Makefile.am: rename 'CYCLO_SOURCES' to 'cyclo_sources', to avoid @@ -920,7 +1646,7 @@ doc: update manual with new operations -2015-12-25 Benno Schulenberg +2015-12-26 Benno Schulenberg datamash: improve an error message @@ -930,13 +1656,13 @@ datamash: improve the punctuation and grammar of the usage text -2015-12-19 Assaf Gordon +2015-12-20 Assaf Gordon doc: update NEWS for upcoming version maint: update gnulib submodule to latest version -2015-12-17 Assaf Gordon +2015-12-18 Assaf Gordon datamash: new operation: strbin (binning strings to numeric value) hashes a text string into a number, returns values from 0 to #bins @@ -974,7 +1700,7 @@ tests/datanash-strbin: test new operation * Makefile.am: add new tests -2015-12-17 Assaf Gordon +2015-12-18 Assaf Gordon maint: use gnulib's pmccabe2html module Generate report with: @@ -984,7 +1710,7 @@ * Makefile.am: add new target * .gitignore: ignore generated html file -2015-11-12 Assaf Gordon +2015-11-13 Assaf Gordon maint: remove superfluous 'with' from doc's "invariant section" pointed by Debian/Ubuntu package maintainer (alejandro@debian.org). @@ -992,7 +1718,7 @@ * doc/datamash.texi: remove 'with' from 'invariant section' of GFDL to comply with official wording. -2015-07-13 Assaf Gordon +2015-07-14 Assaf Gordon build: prefer %PRIuMAX to %zu in printf %zu doesn't play well with mingw cross-compilers. @@ -1000,12 +1726,12 @@ * src/column-headers.c, src/op-parser.c: include , use %PRIuMAX instead of '%zu' in printf . -2015-07-13 Assaf Gordon +2015-07-14 Assaf Gordon build: add gnulib's stpcpy module (for mingw) * bootstrap.conf: add stpcpy. -2015-07-13 Assaf Gordon +2015-07-14 Assaf Gordon datamash: fail on invalid cov/pearson input Unequal number of items can occur if ignoring N/A values. @@ -1014,7 +1740,7 @@ items. * tests/datamash-pair-tests.pl: tests such inputs. -2015-07-13 Assaf Gordon +2015-07-14 Assaf Gordon datamash: fail on incorrect usage * src/op-parser.c: fail when primary operations are given fields @@ -1031,7 +1757,7 @@ * src/datamash.c: improve usage(), mention new operations, use 'field' instead of 'column'. -2015-07-13 Assaf Gordon +2015-07-14 Assaf Gordon new operations: round,floor,ceil,trunc,frac typical usage: @@ -1051,13 +1777,13 @@ * tests/datamash-tests-2.pl: add tests. * contrib/bash-completion/datamash: add new operations. -2015-07-13 Assaf Gordon +2015-07-14 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 +2015-07-14 Assaf Gordon new operation: bin (binning into buckets) typical usage (bin into buckets of size 5): @@ -1082,14 +1808,14 @@ * src/field-ops.c: implement binning operation. * tests/*.pl: add tests -2015-07-13 Assaf Gordon +2015-07-14 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 +2015-07-14 Assaf Gordon build: fix long-double precision under NetBSD Under NetBSD (and others?) default precision is set to 'double' @@ -1102,7 +1828,7 @@ * bootstrap.conf: add fpucw module. * src/datamash.c: force 'long double' precision. -2015-07-13 Assaf Gordon +2015-07-14 Assaf Gordon tests: add rmdup expensive tests * src/datamash.c: add undocumented option to reduce initial size of @@ -1113,7 +1839,7 @@ * tests/datamash-pair-tests.pl: tests pcov (taking two fields) with output headers (print 1 field, 1 header). -2015-07-13 Assaf Gordon +2015-07-14 Assaf Gordon refactor: create new scanner module Use proper tokenizing instead of relying on argc/argv 'tokens' with @@ -1132,7 +1858,7 @@ * Makefile.am: include new scanner. * po/POTFILES.in: include new scanner. -2015-06-25 Assaf Gordon +2015-06-26 Assaf Gordon build: move 'assert.h' to 'system.h' * src/op-defs.c: move 'assert.h' from here... @@ -1152,7 +1878,7 @@ * configure.ac: simplify printing of examples directory; print bash-completion directory. -2015-06-25 Assaf Gordon +2015-06-26 Assaf Gordon datamash: improve,install bash-completion script By default, script installed to program's datadir, e.g. @@ -1168,7 +1894,7 @@ * configure.ac: add option --with-bash-completion-dir * Makefile.am: install script. -2015-06-25 Assaf Gordon +2015-06-26 Assaf Gordon datamash: new operation: Pearson Correlation usage (calculate pearson (population) correlation coefficient on fields 1,2): @@ -1180,7 +1906,7 @@ * src/field-ops.c: handle new op. * tests/datamash-pair-tests.pl: add tests -2015-06-25 Assaf Gordon +2015-06-26 Assaf Gordon datamash: new operation: covariance usage (calculate population-covariance on fields 1,2): @@ -1198,12 +1924,12 @@ * tests/datamash-valgrind.sh: test covariance operation. * Makefile.am: include new tests. -2015-06-25 Assaf Gordon +2015-06-26 Assaf Gordon datamash: utils: add covariance implementation * src/utils.{c,h}: covariance_value() - new function. -2015-06-25 Assaf Gordon +2015-06-26 Assaf Gordon datamash: improve parser, allow field range allows: datamash sum 1-5,7-9 @@ -1211,7 +1937,7 @@ * src/op-parser.c: improve field parsing * tests/datamash-parser.pl: add new tests -2015-06-25 Assaf Gordon +2015-06-26 Assaf Gordon datamash: new feature: check reports back number of lines,fields - or exit with failure if the input @@ -1234,11 +1960,11 @@ * tests/datamash-check-tabular.pl: add tests. * Makefile.am: add new test file. -2015-06-25 Assaf Gordon +2015-06-26 Assaf Gordon maint: git-ignore more files -2015-06-25 Assaf Gordon +2015-06-26 Assaf Gordon datamash: new feature: crosstab usage: @@ -1251,14 +1977,14 @@ * tests/datamash-crosstab.pl - new tests. * Makefile.am - add new files. -2015-06-25 Assaf Gordon +2015-06-26 Assaf Gordon maint: add GL_ATTRIBUTE_PURE where needed maint: fix NEWS syntax-check * NEWS: add missing empty line. -2015-06-25 Assaf Gordon +2015-06-26 Assaf Gordon maint: add coverage hints 1. Add LCOV_EXCL_BR_LINE to skip few switch cases where the default case @@ -1267,7 +1993,7 @@ LCOV_EXCL_BR_LINE requires geninfo from lcov>=1.11 . -2015-06-25 Assaf Gordon +2015-06-26 Assaf Gordon maint: remove unused strcnt module @@ -1294,7 +2020,7 @@ * src/op-parser.{c,h}: the list of field-ops is handled here. * src/datamash.c: adapted as needed. -2015-06-25 Assaf Gordon +2015-06-26 Assaf Gordon refactor: create parsing module 1. Better handling of processing modes (e.g. group-by/transpose/reverse/rmdup) @@ -1311,7 +2037,7 @@ * src/datamash.c - adapt to new parsing module. * tests/*.pl - minor changes to error messages. -2015-06-25 Assaf Gordon +2015-06-26 Assaf Gordon refactor: extract group-processing to a function * src/datamash.c: @@ -1328,11 +2054,11 @@ * 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 +2015-06-22 Assaf Gordon maint: add NEWS about 1.0.7 features -2015-05-28 Assaf Gordon +2015-05-29 Assaf Gordon build: update gettext/autoconf/automake versions * bootstrap.conf: require gettext>=0.19.4, autoconf=>2.62, @@ -1340,7 +2066,7 @@ * configure.ac: require gettext=>=0.19.4 * po/ChangeLog: updated to mention gettext 0.19.4 by 'gettextize -f' -2015-05-27 Assaf Gordon +2015-05-28 Assaf Gordon maint: update gnulib to latest version. specifically, for mingw fixes: @@ -1348,7 +2074,7 @@ http://lists.gnu.org/archive/html/bug-gnulib/2015-05/msg00030.html http://lists.gnu.org/archive/html/bug-gnulib/2015-05/msg00031.html -2015-05-26 Assaf Gordon +2015-05-27 Assaf Gordon maint: improve printf portability, remove mingw hack * bootstrap.conf: use gnulib's inttypes,stdint,extensions modules. @@ -1362,7 +2088,7 @@ maint: avoid compiler warning about no-return. * src/fields-ops.c: add 'return' which should never be reached. -2015-05-19 Assaf Gordon +2015-05-20 Assaf Gordon tests: improve portability of perl Digest::MD5 On some systems (Centos7, Fedora21), Perl's Digest::MD5 is not installed @@ -1373,7 +2099,7 @@ * tests/datamash-tests{,-2}.pl: don't use Digest::MD5 by default. * Makefile.am: add the new test file -2015-05-18 Assaf Gordon +2015-05-19 Assaf Gordon maint: improve tests portability of inf/nan Depending on the OS/libc, printf(Not-a-number) can be @@ -1386,19 +2112,19 @@ * tests/datamash-{tests,tests-2,stats}.pl: use the undocumented option as the expected result string of various tests. -2015-01-17 A. Gordon +2015-01-18 A. Gordon build: update to lastest gnulib * gnulib: Update to latest * tests/init.sh: update from gnulib -2015-01-17 Benno Schulenberg +2015-01-18 Benno Schulenberg doc: fix some inconsistencies doc: do not mention the nonexistent options -h and -v -2015-01-17 A. Gordon +2015-01-18 A. Gordon maint: update copyright year to 2015 @@ -1406,7 +2132,7 @@ * bootstrap.conf: remove SKIP_PO * .gitignore: ignore fetched po/ files -2014-11-26 A. Gordon +2014-11-27 A. Gordon datamash: new option '--narm': ignore NA/NaN values Suggested by Brandon Invergo: @@ -1421,14 +2147,14 @@ * doc/datamash.texi: mention new option * tests/datamash-tests-2.pl: add tests for new option. -2014-10-05 A. Gordon +2014-10-06 A. Gordon maint: update syntax-check rule to allow digits * cfg.mk: change regex in 'sc_prohibit_test_backticks' rule to allow digits in file names of tests. Also remove two unrelated file names (left-overs from 'coreutils') -2014-10-05 A. Gordon +2014-10-06 A. Gordon datamash: keep correct lines with '--full' Discussed in https://github.com/agordon/datamash/issues/3 , @@ -1445,7 +2171,7 @@ * 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 +2014-10-06 A. Gordon maint: add 'static-analysis' make target Example: @@ -1459,7 +2185,7 @@ Use the two-step method to change code and re-analyze without re-runnning './configure' again. -2014-09-11 A. Gordon +2014-09-12 A. Gordon build: Enable build using Mingw cross-compilers * configure.ac: add flag and auto-detection for mingw @@ -1474,7 +2200,7 @@ * bootstrap.conf: add missing modules * m4/.gitignore: add files -2014-08-21 A. Gordon +2014-08-22 A. Gordon maint: expand HACKING.md file * HACKING.md: add notes. @@ -1518,11 +2244,11 @@ add new tests for this feature. * man/datamash.x: add named-columns examples. -2014-08-11 Assaf Gordon +2014-08-12 Assaf Gordon maint: improve 'syntax-check' -2014-08-08 A. Gordon +2014-08-09 A. Gordon maint: new 'coverage-expensive' target * cfg.mk: add 'coverage-expensive' target, for better coverage. @@ -1536,7 +2262,7 @@ repository. * build-aux/prerelease-checks.sh: use new script. -2014-08-08 Assaf Gordon +2014-08-09 Assaf Gordon tests: test more rmdup edge-cases @@ -1545,7 +2271,7 @@ print the output header line correctly. * tests/datamash-tests.pl: add tests for this edge case. -2014-08-08 A. Gordon +2014-08-09 A. Gordon datamash: improve header handling in rmdup/reverse * src/datamash.c: handle input/output header combinations. @@ -1563,7 +2289,7 @@ * tests/datamash-valgrind.sh: test base64 encoding/decoding on large input. -2014-08-08 Assaf Gordon +2014-08-09 Assaf Gordon maint: improve output of parallel-tests * Makefile.am, init.cfg: redirect stderr to file-descriptor 9, @@ -1578,13 +2304,13 @@ * bootstrap.conf: add gnulib's unlocked-io module, providing significant speed improvement with readlinebuffer_delim(). -2014-08-08 A. Gordon +2014-08-09 A. Gordon datamash: improve field-parsing code * src/text-lines.c: line_record_parse_fields(): revise code in case of single-character delimiter. -2014-08-08 A. Gordon +2014-08-09 A. Gordon datamash: new operations: rmdup, noop rmdup: remove lines based on duplicated keys. Similar to: @@ -1603,7 +2329,7 @@ * tests/datamash-valgrind.sh: test 'rmdup' operation with large input. * man/datamash.x: mention new operation, add example. -2014-08-08 A. Gordon +2014-08-09 A. Gordon maint: improve syntax-check * src/field-ops.c: replace tabs with spaces. @@ -1637,7 +2363,7 @@ * configure.ac: remove --enable-debug option. * src/*.c: remove #ifdef debug code. -2014-08-08 Assaf Gordon +2014-08-09 Assaf Gordon datamash: refactor field-splitting Instead of using gnulib's linebuffer directly, handle line-reading and @@ -1652,7 +2378,7 @@ * tests/datamash-tests.pl: adapt tests for new error messages. * tests/datamash-valgrind.sh: fix field delimiter in tests. -2014-08-07 Assaf Gordon +2014-08-08 Assaf Gordon maint: add 'default' case to prevent compiler warning @@ -1670,7 +2396,7 @@ field_op_to_hex(), unique_values(), count_unique_values(), collapse_values(), field_op_summarize(): use new output buffer. -2014-08-07 A. Gordon +2014-08-08 A. Gordon datamash: new line operations: md5/sha*, base64 Line-Operations work on each line on the file (no grouping by key). @@ -1692,7 +2418,7 @@ perl module Digest::SHA, this test might be skipped on systems with old Perl). * Makefile.am: add new test file. -2014-08-02 A. Gordon +2014-08-03 A. Gordon maint: fix wrong path in previous commit @@ -1701,7 +2427,7 @@ * Makefile.am: include script in distribution (without installing it) * .gitignore: ignore the binary executable only -2014-07-29 A. Gordon +2014-07-30 A. Gordon maint: update NEWS @@ -1721,7 +2447,7 @@ tests: mark valgrind test as 'expensive' -2014-07-26 A. Gordon +2014-07-27 A. Gordon tests: improve portability under qemu/binfmt When building with cross-compiling AND running (non-native) binary @@ -1744,7 +2470,7 @@ 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 +2014-07-27 A. Gordon maint: improve build-aux check scripts * renamed remote-make-check.sh => check-remote-make.sh @@ -1755,7 +2481,7 @@ 3) building from git with './bootstrap' 4) command-line options to set parameters to env/configure/make -2014-07-26 A. Gordon +2014-07-27 A. Gordon maint: improve debian-hardening build method * configure.ac: move option from './configure' to .. @@ -1766,7 +2492,7 @@ Now use: make deb-hard -2014-07-26 A. Gordon +2014-07-27 A. Gordon man page: improve hyphen vs minus characters * man/datamash.x: escape minus characters where needed, to distinguish between @@ -1782,7 +2508,7 @@ * build-aux/create_small_filesystem.sh: script to create small ext3 filesystem which can be filled easily. -2014-07-24 A. Gordon +2014-07-25 A. Gordon datamash: add 'internal_error' macro * src/system.h: define 'internal_error' macro. @@ -1796,7 +2522,7 @@ rom tarball, assume the manpage is already there, do not regenerate it, and do not clean it (with 'make clean'). -2014-07-22 Assaf Gordon +2014-07-23 Assaf Gordon datamash: new operations: transpose, reverse * src/datamash.c: new functions: transpose_file(), reverse_fields_in_file(). @@ -1810,12 +2536,12 @@ * tests/datamash-valgrind.sh - new tests * Makefile.am: include new tests -2014-07-17 A. Gordon +2014-07-18 A. Gordon datamash: fix typo in help screen * src/datamash.c: usage(): fix 'pto' => 'dpo' typo. -2014-07-16 A. Gordon +2014-07-17 A. Gordon build: fix configure's message of examples path * configure.ac: Report correct path of installed examples @@ -1850,7 +2576,7 @@ line up long options. Based on suggestion by Benno Schulenberg from the Translation Project. -2014-07-15 A. Gordon +2014-07-16 A. Gordon maint: update NEWS and README @@ -1864,7 +2590,7 @@ NOTE: Using customized help2man (see commit 33c75d), so don't use system's installed help2man. -2014-07-14 A. Gordon +2014-07-15 A. Gordon Expand manual page * man/datamash.x: expand manual page with content from old help screen. @@ -1880,7 +2606,7 @@ * man/help2man: Modify the EXAMPLES pattern detection to accept a single example. -2014-07-14 A. Gordon +2014-07-15 A. Gordon build: don't hard-code Perl path in scripts * man/help2man - Use "/usr/bin/env perl" instead of "/usr/bin/perl". @@ -1890,7 +2616,7 @@ Hard-coded Perl fails Hydra/NixOS builds (http://hydra.nixos.org/build/12516876), and is also generally bad form. -2014-07-05 A. Gordon +2014-07-06 A. Gordon GNU Datamash: remove files relating to external sites @@ -1898,25 +2624,25 @@ GNU Datamash: rename package -2014-05-19 A. Gordon +2014-05-20 A. Gordon maint: improve comments in tests -2014-05-12 A. Gordon +2014-05-13 A. Gordon maint: add 'texlive' package to Travis-CI maint: add 'texinfo' package to travis-CI -2014-05-12 A. Gordon +2014-05-13 A. Gordon doc: add texinfo documentation -2014-04-29 A. Gordon +2014-04-30 A. Gordon maint: update copyright/license in files -2014-04-18 A. Gordon +2014-04-19 A. Gordon maint: update 'git-log-fix' due to gnulib upgrade. @@ -1930,7 +2656,7 @@ maint: replace old bcopy/bzero calls with memmove/memset -2014-04-14 A. Gordon +2014-04-15 A. Gordon maint: add cygwin distribution packing script @@ -1949,7 +2675,7 @@ build: fix compilation on Cygwin (missing nanl/expl) -2014-04-11 A. Gordon +2014-04-12 A. Gordon maint: improve instructions in 'tag-new-version' script @@ -1974,7 +2700,7 @@ compute: fix typos -2014-04-10 A. Gordon +2014-04-11 A. Gordon maint: add script to build & check on remote machine @@ -1995,7 +2721,7 @@ tests: test mad/madraw with unsorted input -2014-04-09 A. Gordon +2014-04-10 A. Gordon tests: tests more sequences @@ -2015,7 +2741,7 @@ compute: new operation: rand -2014-04-08 A. Gordon +2014-04-09 A. Gordon build: add -Werror to ./src/ files. @@ -2023,13 +2749,13 @@ compute: new operations: first,last -2014-04-07 A. Gordon +2014-04-08 A. Gordon compute: set numeric output precision build: improve comment in configure.ac -2014-04-07 A. Gordon +2014-04-08 A. Gordon build: Use compiler warnings from gl_WARN_ADD Those were wrongly dropped when changed to non-recursive makefile. @@ -2037,7 +2763,7 @@ The new flags are used only with the 'compute' sources, but not with the gnulib sources. -2014-04-07 A. Gordon +2014-04-08 A. Gordon compute: detect invalid suffix in numeric input. @@ -2046,7 +2772,7 @@ compute: move numeric conversion into 'field-ops' module. -2014-03-21 A. Gordon +2014-03-22 A. Gordon build: add helper scripts to EXTRA_DIST @@ -2059,18 +2785,18 @@ build: include 'help2man' and use it. Not all systems have "help2man" installed. -2014-03-19 A. Gordon +2014-03-20 A. Gordon maint: add helper script to upload files to AWS S3 build: update helper scripts to new name -2014-03-18 A. Gordon +2014-03-19 A. Gordon RENAME: calc -> compute To avoid name conflicts with existing software. -2014-03-17 A. Gordon +2014-03-18 A. Gordon TravisCI - no need for GNU Sed 4.2.2 anymore. @@ -2082,7 +2808,7 @@ calc: sort+headers: don't use GNU sed. Implement unbuffered input to avoid GNU sed dependency. -2014-03-14 A. Gordon +2014-03-15 A. Gordon calc: fix 'make syntax-check' errors @@ -2091,7 +2817,7 @@ gitignore: ignore more files Automatically generated by gnulib -2014-03-13 A. Gordon +2014-03-14 A. Gordon Travis-CI: add 'make distcheck', disable encode binary No need to save the static binary from a Linux build - can be @@ -2108,7 +2834,7 @@ build: fix help2man issue on FreeBSD http://lists.gnu.org/archive/html/bug-hello/2014-03/msg00003.html -2014-03-12 A. Gordon +2014-03-13 A. Gordon Travis-CI: don't get git submodules. 'bootstrap' should do it. @@ -2126,7 +2852,7 @@ Switch to non-recursive Makefile -2014-03-10 A. Gordon +2014-03-11 A. Gordon Travis-CI: check coverage after successful build @@ -2152,11 +2878,11 @@ Avoids 'undefined reference' errors when compiling with coverage instrumentation. -2014-03-09 A. Gordon +2014-03-10 A. Gordon Travis: improve build, add scripts -2014-03-08 A. Gordon +2014-03-09 A. Gordon build: add 'make-bin' script to distribution @@ -2180,7 +2906,7 @@ tests: don't use valgrind on static binaries -2014-03-07 A. Gordon +2014-03-08 A. Gordon calc: new global case-sensitive option '-i' + tests @@ -2198,7 +2924,7 @@ examples: improve 'scores' example -2014-03-06 A. Gordon +2014-03-07 A. Gordon build: remove 'make distcheck' from Travis-CI. It fails for unclear reason. @@ -2228,7 +2954,7 @@ examples: add example files. -2014-03-05 A. Gordon +2014-03-06 A. Gordon tests: fix valgrind test for 'make distcheck' @@ -2236,7 +2962,7 @@ calc: fix memory problems -2014-03-04 A. Gordon +2014-03-05 A. Gordon examples: new sub-directory @@ -2244,11 +2970,11 @@ new operation: countunique -2014-03-03 A. Gordon +2014-03-04 A. Gordon tests: test single-line groups -2014-02-26 A. Gordon +2014-02-27 A. Gordon tests: check empty input @@ -2274,11 +3000,11 @@ Command-line processing and Help for 'headers' options. -2013-05-03 Assaf Gordon +2013-05-04 Assaf Gordon build: touch missing files -2013-04-26 Assaf Gordon +2013-04-27 Assaf Gordon build: use gl_WARN_ADD for compiler warnings @@ -2286,13 +3012,13 @@ -Wunused-parameter and -Wswitch-default will trigger warnings. change code to avoid them. -2013-04-25 Assaf Gordon +2013-04-26 Assaf Gordon Merge branch 'gitchangelog' build: add gnulib's gitlog-to-changelog -2013-04-11 Assaf Gordon +2013-04-12 Assaf Gordon calc: improve help message for help2man @@ -2302,7 +3028,7 @@ system.h: minor improvements -2013-04-09 Assaf Gordon +2013-04-10 Assaf Gordon calc: use gnulib closeout module Protect against write errors at the end of te program, @@ -2327,7 +3053,7 @@ add GPLv3+ text to source files -2013-04-08 Assaf Gordon +2013-04-09 Assaf Gordon some more comments @@ -2349,7 +3075,7 @@ calc: import key-compare form coreutils. -2013-04-05 Assaf Gordon +2013-04-06 Assaf Gordon calc: expand '--help' section @@ -2372,7 +3098,7 @@ calc: field extractiong works -2013-04-04 Assaf Gordon +2013-04-05 Assaf Gordon calc: re-factor, prepare for field support. @@ -2388,7 +3114,7 @@ calc: implement stdev/variance, other fixes. -2013-04-03 Assaf Gordon +2013-04-04 Assaf Gordon calc: first shot at multi-valued numeric (median) @@ -2396,7 +3122,7 @@ calc: add stub input reading -2013-04-02 Assaf Gordon +2013-04-03 Assaf Gordon calc: create field/op structures @@ -2406,7 +3132,7 @@ calc: process -z and --debug -2013-03-29 Assaf Gordon +2013-03-30 Assaf Gordon build system: fix auto generated version.c diff -Nru datamash-1.7/config.in datamash-1.8/config.in --- datamash-1.7/config.in 2020-04-23 17:34:02.000000000 +0000 +++ datamash-1.8/config.in 2022-05-28 02:54:29.000000000 +0000 @@ -18,12 +18,7 @@ /* Define to the number of bits in type 'wint_t'. */ #undef BITSIZEOF_WINT_T -/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP - systems. This function is required for `alloca.c' support on those systems. - */ -#undef CRAY_STACKSEG_END - -/* Define to 1 if using `alloca.c'. */ +/* Define to 1 if using 'alloca.c'. */ #undef C_ALLOCA /* Define as the bit index in the word where to find bit 0 of the exponent of @@ -46,6 +41,16 @@ language is requested. */ #undef ENABLE_NLS +/* Define this to 1 if F_DUPFD behavior does not match POSIX */ +#undef FCNTL_DUPFD_BUGGY + +/* Define to nothing if C supports flexible array members, and to 1 if it does + not. That way, with a declaration like 'struct s { int n; short + d[FLEXIBLE_ARRAY_MEMBER]; };', the struct hack can be used with pre-C99 + compilers. Use 'FLEXSIZEOF (struct s, d, N * sizeof (short))' to calculate + the size in bytes of such a struct containing an N-element array. */ +#undef FLEXIBLE_ARRAY_MEMBER + /* Define as the bit index in the word where to find bit 0 of the exponent of 'float'. */ #undef FLT_EXPBIT0_BIT @@ -94,6 +99,10 @@ #undef GNULIB_ISBLANK /* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module lock shall be considered present. */ +#undef GNULIB_LOCK + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending whether the gnulib module msvc-nothrow shall be considered present. */ #undef GNULIB_MSVC_NOTHROW @@ -110,6 +119,10 @@ #undef GNULIB_SCANF /* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module snprintf shall be considered present. */ +#undef GNULIB_SNPRINTF + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending whether the gnulib module strerror shall be considered present. */ #undef GNULIB_STRERROR @@ -122,12 +135,24 @@ /* Define to 1 when the gnulib module ceill should be tested. */ #undef GNULIB_TEST_CEILL +/* Define to 1 when the gnulib module cloexec should be tested. */ +#undef GNULIB_TEST_CLOEXEC + +/* Define to 1 when the gnulib module close should be tested. */ +#undef GNULIB_TEST_CLOSE + +/* Define to 1 when the gnulib module dup2 should be tested. */ +#undef GNULIB_TEST_DUP2 + /* Define to 1 when the gnulib module expl should be tested. */ #undef GNULIB_TEST_EXPL /* Define to 1 when the gnulib module fabsl should be tested. */ #undef GNULIB_TEST_FABSL +/* Define to 1 when the gnulib module fcntl should be tested. */ +#undef GNULIB_TEST_FCNTL + /* Define to 1 when the gnulib module fflush should be tested. */ #undef GNULIB_TEST_FFLUSH @@ -161,6 +186,9 @@ /* Define to 1 when the gnulib module ftello should be tested. */ #undef GNULIB_TEST_FTELLO +/* Define to 1 when the gnulib module getdtablesize should be tested. */ +#undef GNULIB_TEST_GETDTABLESIZE + /* Define to 1 when the gnulib module getopt-posix should be tested. */ #undef GNULIB_TEST_GETOPT_POSIX @@ -188,6 +216,9 @@ /* Define to 1 when the gnulib module localeconv should be tested. */ #undef GNULIB_TEST_LOCALECONV +/* Define to 1 when the gnulib module localename should be tested. */ +#undef GNULIB_TEST_LOCALENAME + /* Define to 1 when the gnulib module log should be tested. */ #undef GNULIB_TEST_LOG @@ -209,9 +240,6 @@ /* Define to 1 when the gnulib module mbslen should be tested. */ #undef GNULIB_TEST_MBSLEN -/* Define to 1 when the gnulib module mbsrtowcs should be tested. */ -#undef GNULIB_TEST_MBSRTOWCS - /* Define to 1 when the gnulib module mbsstr should be tested. */ #undef GNULIB_TEST_MBSSTR @@ -224,6 +252,15 @@ /* Define to 1 when the gnulib module modfl should be tested. */ #undef GNULIB_TEST_MODFL +/* Define to 1 when the gnulib module open should be tested. */ +#undef GNULIB_TEST_OPEN + +/* Define to 1 when the gnulib module pclose should be tested. */ +#undef GNULIB_TEST_PCLOSE + +/* Define to 1 when the gnulib module popen should be tested. */ +#undef GNULIB_TEST_POPEN + /* Define to 1 when the gnulib module random should be tested. */ #undef GNULIB_TEST_RANDOM @@ -239,18 +276,30 @@ /* Define to 1 when the gnulib module roundl should be tested. */ #undef GNULIB_TEST_ROUNDL +/* Define to 1 when the gnulib module setlocale should be tested. */ +#undef GNULIB_TEST_SETLOCALE + /* Define to 1 when the gnulib module setlocale_null should be tested. */ #undef GNULIB_TEST_SETLOCALE_NULL /* Define to 1 when the gnulib module signbit should be tested. */ #undef GNULIB_TEST_SIGNBIT +/* Define to 1 when the gnulib module snprintf should be tested. */ +#undef GNULIB_TEST_SNPRINTF + /* Define to 1 when the gnulib module sqrtl should be tested. */ #undef GNULIB_TEST_SQRTL +/* Define to 1 when the gnulib module stat should be tested. */ +#undef GNULIB_TEST_STAT + /* Define to 1 when the gnulib module stpcpy should be tested. */ #undef GNULIB_TEST_STPCPY +/* Define to 1 when the gnulib module strdup should be tested. */ +#undef GNULIB_TEST_STRDUP + /* Define to 1 when the gnulib module strerror should be tested. */ #undef GNULIB_TEST_STRERROR @@ -263,6 +312,15 @@ /* Define to 1 when the gnulib module strsep should be tested. */ #undef GNULIB_TEST_STRSEP +/* Define to 1 when the gnulib module strtod should be tested. */ +#undef GNULIB_TEST_STRTOD + +/* Define to 1 when the gnulib module strtold should be tested. */ +#undef GNULIB_TEST_STRTOLD + +/* Define to 1 when the gnulib module strtoll should be tested. */ +#undef GNULIB_TEST_STRTOLL + /* Define to 1 when the gnulib module strtoull should be tested. */ #undef GNULIB_TEST_STRTOULL @@ -272,6 +330,9 @@ /* Define to 1 when the gnulib module truncl should be tested. */ #undef GNULIB_TEST_TRUNCL +/* Define to 1 when the gnulib module waitpid should be tested. */ +#undef GNULIB_TEST_WAITPID + /* Define to 1 when the gnulib module wcwidth should be tested. */ #undef GNULIB_TEST_WCWIDTH @@ -283,6 +344,14 @@ whether the gnulib module unistr/u8-uctomb shall be considered present. */ #undef GNULIB_UNISTR_U8_UCTOMB +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module xalloc shall be considered present. */ +#undef GNULIB_XALLOC + +/* Define to a C preprocessor expression that evaluates to 1 or 0, depending + whether the gnulib module xalloc-die shall be considered present. */ +#undef GNULIB_XALLOC_DIE + /* Define to 1 if you have 'alloca' after including , a header that may be supplied by this distribution. */ #undef HAVE_ALLOCA @@ -291,6 +360,9 @@ */ #undef HAVE_ALLOCA_H +/* Define to 1 if you have the header file. */ +#undef HAVE_ARPA_INET_H + /* Define to 1 if you have the header file. */ #undef HAVE_BP_SYM_H @@ -358,6 +430,22 @@ don't. */ #undef HAVE_DECL_COPYSIGNL +/* Define to 1 if you have the declaration of `ecvt', and to 0 if you don't. + */ +#undef HAVE_DECL_ECVT + +/* Define to 1 if you have the declaration of `execvpe', and to 0 if you + don't. */ +#undef HAVE_DECL_EXECVPE + +/* Define to 1 if you have the declaration of `fcloseall', and to 0 if you + don't. */ +#undef HAVE_DECL_FCLOSEALL + +/* Define to 1 if you have the declaration of `fcvt', and to 0 if you don't. + */ +#undef HAVE_DECL_FCVT + /* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_FEOF_UNLOCKED @@ -406,6 +494,10 @@ you don't. */ #undef HAVE_DECL_FWRITE_UNLOCKED +/* Define to 1 if you have the declaration of `gcvt', and to 0 if you don't. + */ +#undef HAVE_DECL_GCVT + /* Define to 1 if you have the declaration of `getchar_unlocked', and to 0 if you don't. */ #undef HAVE_DECL_GETCHAR_UNLOCKED @@ -414,6 +506,14 @@ don't. */ #undef HAVE_DECL_GETC_UNLOCKED +/* Define to 1 if you have the declaration of `getdtablesize', and to 0 if you + don't. */ +#undef HAVE_DECL_GETDTABLESIZE + +/* Define to 1 if you have the declaration of `inet_pton', and to 0 if you + don't. */ +#undef HAVE_DECL_INET_PTON + /* Define to 1 if you have the declaration of `initstate', and to 0 if you don't. */ #undef HAVE_DECL_INITSTATE @@ -438,10 +538,6 @@ don't. */ #undef HAVE_DECL_MBSINIT -/* Define to 1 if you have the declaration of `mbsrtowcs', and to 0 if you - don't. */ -#undef HAVE_DECL_MBSRTOWCS - /* Define to 1 if you have the declaration of `program_invocation_name', and to 0 if you don't. */ #undef HAVE_DECL_PROGRAM_INVOCATION_NAME @@ -470,10 +566,22 @@ don't. */ #undef HAVE_DECL_SETSTATE +/* Define to 1 if you have the declaration of `snprintf', and to 0 if you + don't. */ +#undef HAVE_DECL_SNPRINTF + +/* Define to 1 if you have the declaration of `strdup', and to 0 if you don't. + */ +#undef HAVE_DECL_STRDUP + /* Define to 1 if you have the declaration of `strerror_r', and to 0 if you don't. */ #undef HAVE_DECL_STRERROR_R +/* Define to 1 if you have the declaration of `strncasecmp', and to 0 if you + don't. */ +#undef HAVE_DECL_STRNCASECMP + /* Define to 1 if you have the declaration of `strndup', and to 0 if you don't. */ #undef HAVE_DECL_STRNDUP @@ -502,6 +610,10 @@ */ #undef HAVE_DECL_TRUNCL +/* Define to 1 if you have the declaration of `wcsdup', and to 0 if you don't. + */ +#undef HAVE_DECL_WCSDUP + /* Define to 1 if you have the declaration of `wcwidth', and to 0 if you don't. */ #undef HAVE_DECL_WCWIDTH @@ -510,6 +622,10 @@ don't. */ #undef HAVE_DECL__FSEEKI64 +/* Define to 1 if you have the declaration of `_snprintf', and to 0 if you + don't. */ +#undef HAVE_DECL__SNPRINTF + /* Define to 1 if you have the declaration of `__argv', and to 0 if you don't. */ #undef HAVE_DECL___ARGV @@ -518,6 +634,16 @@ don't. */ #undef HAVE_DECL___FPENDING +/* Define to 1 if you have the `duplocale' function. */ +#undef HAVE_DUPLOCALE + +/* Define if the locale_t type contains insufficient information, as on + OpenBSD. */ +#undef HAVE_FAKE_LOCALES + +/* Define to 1 if you have the `fcntl' function. */ +#undef HAVE_FCNTL + /* Define to 1 if you have the header file. */ #undef HAVE_FEATURES_H @@ -527,6 +653,9 @@ /* Define to 1 if you have the `fpurge' function. */ #undef HAVE_FPURGE +/* Define to 1 if you have the `freelocale' function. */ +#undef HAVE_FREELOCALE + /* Define if the frexp() function is available and works. */ #undef HAVE_FREXP @@ -536,9 +665,15 @@ /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ #undef HAVE_FSEEKO +/* Define to 1 if you have the `getdtablesize' function. */ +#undef HAVE_GETDTABLESIZE + /* Define to 1 if you have the `getexecname' function. */ #undef HAVE_GETEXECNAME +/* Define to 1 if you have the `getlocalename_l' function. */ +#undef HAVE_GETLOCALENAME_L + /* Define to 1 if you have the header file. */ #undef HAVE_GETOPT_H @@ -557,6 +692,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_ICONV_H +/* Define to 1 if you have the `inet_pton' function. */ +#undef HAVE_INET_PTON + /* Define to 1 if you have the `initstate' function. */ #undef HAVE_INITSTATE @@ -565,9 +703,22 @@ */ #undef HAVE_INLINE +/* Define if you have the 'intmax_t' type in or . */ +#undef HAVE_INTMAX_T + /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H +/* Define if exists, doesn't clash with , and + declares uintmax_t. */ +#undef HAVE_INTTYPES_H_WITH_UINTMAX + +/* Define to 1 if defines AF_INET. */ +#undef HAVE_IPV4 + +/* Define to 1 if defines AF_INET6. */ +#undef HAVE_IPV6 + /* Define to 1 if you have the `isblank' function. */ #undef HAVE_ISBLANK @@ -589,9 +740,21 @@ /* Define if you have and nl_langinfo(CODESET). */ #undef HAVE_LANGINFO_CODESET +/* Define to 1 if you have the header file. */ +#undef HAVE_LANGINFO_H + +/* Define if your file defines LC_MESSAGES. */ +#undef HAVE_LC_MESSAGES + /* Define if the ldexpl() function is available. */ #undef HAVE_LDEXPL +/* Define if the ldexpl function is available in libc. */ +#undef HAVE_LDEXPL_IN_LIBC + +/* Define if the ldexp function is available in libc. */ +#undef HAVE_LDEXP_IN_LIBC + /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H @@ -601,6 +764,9 @@ /* Define to 1 if the system has the type 'long long int'. */ #undef HAVE_LONG_LONG_INT +/* Define to 1 if you have the `lstat' function. */ +#undef HAVE_LSTAT + /* Define if the 'malloc' function is POSIX compliant. */ #undef HAVE_MALLOC_POSIX @@ -620,15 +786,15 @@ /* Define to 1 if you have the `mbslen' function. */ #undef HAVE_MBSLEN -/* Define to 1 if you have the `mbsrtowcs' function. */ -#undef HAVE_MBSRTOWCS - /* Define to 1 if declares mbstate_t. */ #undef HAVE_MBSTATE_T /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H +/* Define to 1 if you have the header file. */ +#undef HAVE_MINIX_CONFIG_H + /* Define to 1 if defines the MIN and MAX macros. */ #undef HAVE_MINMAX_IN_LIMITS_H @@ -642,12 +808,28 @@ concept. */ #undef HAVE_MSVC_INVALID_PARAMETER_HANDLER +/* Define if the locale_t type does not contain the name of each locale + category. */ +#undef HAVE_NAMELESS_LOCALES + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETDB_H + /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H +/* Define to 1 if you have the `newlocale' function. */ +#undef HAVE_NEWLOCALE + +/* Define to 1 if you have the `nl_langinfo' function. */ +#undef HAVE_NL_LANGINFO + /* Define to 1 if libcrypto is used for MD5. */ #undef HAVE_OPENSSL_MD5 +/* Define to 1 if you have the header file. */ +#undef HAVE_OPENSSL_MD5_H + /* Define to 1 if libcrypto is used for SHA1. */ #undef HAVE_OPENSSL_SHA1 @@ -657,9 +839,31 @@ /* Define to 1 if libcrypto is used for SHA512. */ #undef HAVE_OPENSSL_SHA512 +/* Define to 1 if you have the header file. */ +#undef HAVE_OPENSSL_SHA_H + +/* Define to 1 if you have the `pclose' function. */ +#undef HAVE_PCLOSE + +/* Define to 1 if you have the `pledge' function. */ +#undef HAVE_PLEDGE + +/* Define to 1 if you have the `popen' function. */ +#undef HAVE_POPEN + /* Define if you have the header and the POSIX threads API. */ #undef HAVE_PTHREAD_API +/* Define if the defines PTHREAD_MUTEX_RECURSIVE. */ +#undef HAVE_PTHREAD_MUTEX_RECURSIVE + +/* Define if the POSIX multithreading library has read/write locks. */ +#undef HAVE_PTHREAD_RWLOCK + +/* Define if the 'pthread_rwlock_rdlock' function prefers a writer to a + reader. */ +#undef HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER + /* Define to 1 if you have the header file. */ #undef HAVE_RANDOM_H @@ -679,6 +883,12 @@ /* Define to 1 if the system has the type `sa_family_t'. */ #undef HAVE_SA_FAMILY_T +/* Define to 1 if you have the header file. */ +#undef HAVE_SDKDDKVER_H + +/* Define to 1 if you have the `setdtablesize' function. */ +#undef HAVE_SETDTABLESIZE + /* Define to 1 if you have the `setstate' function. */ #undef HAVE_SETSTATE @@ -694,12 +904,31 @@ /* Define to 1 if 'wint_t' is a signed integer type. */ #undef HAVE_SIGNED_WINT_T +/* Define to 1 if you have the `snprintf' function. */ +#undef HAVE_SNPRINTF + +/* Define if the return value of the snprintf function is the number of of + bytes (excluding the terminating NUL) that would have been produced if the + buffer had been large enough. */ +#undef HAVE_SNPRINTF_RETVAL_C99 + +/* Define if the string produced by the snprintf function is always NUL + terminated. */ +#undef HAVE_SNPRINTF_TRUNCATION_C99 + +/* Define if the locale_t type is as on Solaris 11.4. */ +#undef HAVE_SOLARIS114_LOCALES + /* Define to 1 if sort on this system supports -s for stable sorting */ #undef HAVE_STABLE_SORT /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H +/* Define if exists, doesn't clash with , and declares + uintmax_t. */ +#undef HAVE_STDINT_H_WITH_UINTMAX + /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_EXT_H @@ -709,6 +938,9 @@ /* Define to 1 if you have the `stpcpy' function. */ #undef HAVE_STPCPY +/* Define to 1 if you have the `strcasecmp' function. */ +#undef HAVE_STRCASECMP + /* Define to 1 if you have the `strerror_r' function. */ #undef HAVE_STRERROR_R @@ -718,12 +950,24 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H +/* Define to 1 if you have the `strncasecmp' function. */ +#undef HAVE_STRNCASECMP + /* Define to 1 if you have the `strndup' function. */ #undef HAVE_STRNDUP +/* Define to 1 if you have the `strnlen' function. */ +#undef HAVE_STRNLEN + /* Define to 1 if you have the `strsep' function. */ #undef HAVE_STRSEP +/* Define to 1 if you have the `strtold' function. */ +#undef HAVE_STRTOLD + +/* Define to 1 if you have the `strtoll' function. */ +#undef HAVE_STRTOLL + /* Define to 1 if you have the `strtoull' function. */ #undef HAVE_STRTOULL @@ -763,6 +1007,9 @@ /* Define to 1 if `st_birthtim.tv_nsec' is a member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC +/* Define to 1 if you have the `symlink' function. */ +#undef HAVE_SYMLINK + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_BITYPES_H @@ -778,6 +1025,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SINGLE_THREADED_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H @@ -793,6 +1043,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UIO_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_WAIT_H + +/* Define to 1 if you have the `thrd_create' function. */ +#undef HAVE_THRD_CREATE + /* Define to 1 if you have the header file. */ #undef HAVE_THREADS_H @@ -805,9 +1061,15 @@ /* Define to 1 if the system has the type 'unsigned long long int'. */ #undef HAVE_UNSIGNED_LONG_LONG_INT +/* Define to 1 if you have the `uselocale' function. */ +#undef HAVE_USELOCALE + /* Define if you have a global __progname variable */ #undef HAVE_VAR___PROGNAME +/* Define to 1 if you have the `vasnprintf' function. */ +#undef HAVE_VASNPRINTF + /* Define to 1 or 0, depending whether the compiler supports simple visibility declarations. */ #undef HAVE_VISIBILITY @@ -818,6 +1080,15 @@ /* Define if you have the 'wchar_t' type. */ #undef HAVE_WCHAR_T +/* Define to 1 if you have the `wcrtomb' function. */ +#undef HAVE_WCRTOMB + +/* Define to 1 if you have the `wcslen' function. */ +#undef HAVE_WCSLEN + +/* Define to 1 if you have the `wcsnlen' function. */ +#undef HAVE_WCSNLEN + /* Define to 1 if you have the header file. */ #undef HAVE_WCTYPE_H @@ -834,12 +1105,24 @@ /* Define if you have the 'wint_t' type. */ #undef HAVE_WINT_T +/* Define to 1 if O_NOATIME works. */ +#undef HAVE_WORKING_O_NOATIME + +/* Define to 1 if O_NOFOLLOW works. */ +#undef HAVE_WORKING_O_NOFOLLOW + +/* Define if the uselocale function exists any may safely be called. */ +#undef HAVE_WORKING_USELOCALE + /* Define to 1 if you have the header file. */ #undef HAVE_WS2TCPIP_H /* Define to 1 if you have the header file. */ #undef HAVE_XLOCALE_H +/* Define to 1 if sort on this system supports -z for NUL line delimiters */ +#undef HAVE_ZERO_SORT + /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL @@ -924,6 +1207,15 @@ /* Define to 1 if assertions should be disabled. */ #undef NDEBUG +/* Define to 1 to enable general improvements of setlocale. */ +#undef NEED_SETLOCALE_IMPROVED + +/* Define to 1 to enable a multithread-safety fix of setlocale. */ +#undef NEED_SETLOCALE_MTSAFE + +/* Define to 1 if open() fails to recognize a trailing slash. */ +#undef OPEN_TRAILING_SLASH_BUG + /* Name of package */ #undef PACKAGE @@ -954,8 +1246,9 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* Define if exists and defines unusable PRI* macros. */ -#undef PRI_MACROS_BROKEN +/* Define to the type that is the result of default argument promotions of + type mode_t. */ +#undef PROMOTED_MODE_T /* Define if the pthread_in_use() detection is hard. */ #undef PTHREAD_IN_USE_DETECTION_HARD @@ -964,9 +1257,16 @@ 'ptrdiff_t'. */ #undef PTRDIFF_T_SUFFIX +/* Define to 1 if stat needs help when passed a file name with a trailing + slash */ +#undef REPLACE_FUNC_STAT_FILE + /* Define to 1 if strerror(0) does not return a message implying success. */ #undef REPLACE_STRERROR_0 +/* Define if vasnprintf exists but is overridden by gnulib. */ +#undef REPLACE_VASNPRINTF + /* Define to 1 if setlocale (LC_ALL, NULL) is multithread-safe. */ #undef SETLOCALE_NULL_ALL_MTSAFE @@ -987,12 +1287,15 @@ 'size_t'. */ #undef SIZE_T_SUFFIX +/* Absolute path to sort command */ +#undef SORT_PATH + /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at runtime. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown */ + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if the `S_IS*' macros in do not work properly. */ @@ -1004,13 +1307,30 @@ /* Define to 1 if strerror_r returns char *. */ #undef STRERROR_R_CHAR_P +/* Define to 1 if strtold does not set errno upon underflow. */ +#undef STRTOLD_HAS_UNDERFLOW_BUG + /* Define to 1 if the type of the st_atim member of a struct stat is struct timespec. */ #undef TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC +/* Define if the combination of the ISO C and POSIX multithreading APIs can be + used. */ +#undef USE_ISOC_AND_POSIX_THREADS + +/* Define if the ISO C multithreading library can be used. */ +#undef USE_ISOC_THREADS + /* Define to 1 if you want to use the Linux kernel cryptographic API. */ #undef USE_LINUX_CRYPTO_API +/* Define if the POSIX multithreading library can be used. */ +#undef USE_POSIX_THREADS + +/* Define if references to the POSIX multithreading library should be made + weak. */ +#undef USE_POSIX_THREADS_WEAK + /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE @@ -1019,19 +1339,44 @@ #ifndef _DARWIN_C_SOURCE # undef _DARWIN_C_SOURCE #endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif -/* Enable NetBSD extensions on NetBSD. */ +/* Enable X/Open compliant socket functions that do not require linking + with -lxnet on HP-UX 11.11. */ +#ifndef _HPUX_ALT_XOPEN_SOCKET_API +# undef _HPUX_ALT_XOPEN_SOCKET_API +#endif +/* Identify the host operating system as Minix. + This macro does not affect the system headers' behavior. + A future release of Autoconf may stop defining this macro. */ +#ifndef _MINIX +# undef _MINIX +#endif +/* Enable general extensions on NetBSD. + Enable NetBSD compatibility extensions on Minix. */ #ifndef _NETBSD_SOURCE # undef _NETBSD_SOURCE #endif -/* Enable OpenBSD extensions on NetBSD. */ +/* Enable OpenBSD compatibility extensions on NetBSD. + Oddly enough, this does nothing on OpenBSD. */ #ifndef _OPENBSD_SOURCE # undef _OPENBSD_SOURCE #endif -/* Enable threading extensions on Solaris. */ +/* Define to 1 if needed for POSIX-compatible behavior. */ +#ifndef _POSIX_SOURCE +# undef _POSIX_SOURCE +#endif +/* Define to 2 if needed for POSIX-compatible behavior. */ +#ifndef _POSIX_1_SOURCE +# undef _POSIX_1_SOURCE +#endif +/* Enable POSIX-compatible threading on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif @@ -1067,21 +1412,11 @@ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif -/* Enable X/Open extensions if necessary. HP-UX 11.11 defines - mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of - whether compiling with -Ae or -D_HPUX_SOURCE=1. */ +/* Enable X/Open extensions. Define to 500 only if necessary + to make mbstate_t available. */ #ifndef _XOPEN_SOURCE # undef _XOPEN_SOURCE #endif -/* Enable X/Open compliant socket functions that do not require linking - with -lxnet on HP-UX 11.11. */ -#ifndef _HPUX_ALT_XOPEN_SOCKET_API -# undef _HPUX_ALT_XOPEN_SOCKET_API -#endif -/* Enable general extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# undef __EXTENSIONS__ -#endif /* Define to 1 if you want getc etc. to use unlocked I/O if available. @@ -1089,6 +1424,9 @@ safe for multithreaded apps. */ #undef USE_UNLOCKED_IO +/* Define if the native Windows multithreading API can be used. */ +#undef USE_WINDOWS_THREADS + /* Version number of package */ #undef VERSION @@ -1115,6 +1453,18 @@ /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS +/* True if the compiler says it groks GNU C version MAJOR.MINOR. */ +#if defined __GNUC__ && defined __GNUC_MINOR__ +# define _GL_GNUC_PREREQ(major, minor) \ + ((major) < __GNUC__ + ((minor) <= __GNUC_MINOR__)) +#else +# define _GL_GNUC_PREREQ(major, minor) 0 +#endif + + +/* Define to enable the declarations of ISO C 11 types and functions. */ +#undef _ISOC11_SOURCE + /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ #undef _LARGEFILE_SOURCE @@ -1124,12 +1474,6 @@ /* Define to 1 on Solaris. */ #undef _LCONV_C99 -/* Define to 1 if on MINIX. */ -#undef _MINIX - -/* Define to 1 to make NetBSD features available. MINIX 3 needs this. */ -#undef _NETBSD_SOURCE - /* The _Noreturn keyword of C11. */ #ifndef _Noreturn # if (defined __cplusplus \ @@ -1145,12 +1489,12 @@ # define _Noreturn [[noreturn]] # elif ((!defined __cplusplus || defined __clang__) \ && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \ - || 4 < __GNUC__ + (7 <= __GNUC_MINOR__) \ + || _GL_GNUC_PREREQ (4, 7) \ || (defined __apple_build_version__ \ ? 6000000 <= __apple_build_version__ \ : 3 < __clang_major__ + (5 <= __clang_minor__)))) /* _Noreturn works as-is. */ -# elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C +# elif _GL_GNUC_PREREQ (2, 8) || defined __clang__ || 0x5110 <= __SUNPRO_C # define _Noreturn __attribute__ ((__noreturn__)) # elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0) # define _Noreturn __declspec (noreturn) @@ -1160,17 +1504,10 @@ #endif -/* Define to 2 if the system does not provide POSIX.1 features except with - this defined. */ -#undef _POSIX_1_SOURCE - /* Define to 1 in order to get the POSIX compatible declarations of socket functions. */ #undef _POSIX_PII_SOCKET -/* Define to 1 if you need to in order for 'stat' and other things to work. */ -#undef _POSIX_SOURCE - /* For standard stat data types on VMS. */ #undef _USE_STD_STAT @@ -1211,6 +1548,216 @@ #define _GL_ASYNC_SAFE +/* Attributes. */ +#ifdef __has_attribute +# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__) +#else +# define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr +# define _GL_ATTR_alloc_size _GL_GNUC_PREREQ (4, 3) +# define _GL_ATTR_always_inline _GL_GNUC_PREREQ (3, 2) +# define _GL_ATTR_artificial _GL_GNUC_PREREQ (4, 3) +# define _GL_ATTR_cold _GL_GNUC_PREREQ (4, 3) +# define _GL_ATTR_const _GL_GNUC_PREREQ (2, 95) +# define _GL_ATTR_deprecated _GL_GNUC_PREREQ (3, 1) +# define _GL_ATTR_diagnose_if 0 +# define _GL_ATTR_error _GL_GNUC_PREREQ (4, 3) +# define _GL_ATTR_externally_visible _GL_GNUC_PREREQ (4, 1) +# define _GL_ATTR_fallthrough _GL_GNUC_PREREQ (7, 0) +# define _GL_ATTR_format _GL_GNUC_PREREQ (2, 7) +# define _GL_ATTR_leaf _GL_GNUC_PREREQ (4, 6) +# ifdef _ICC +# define _GL_ATTR_may_alias 0 +# else +# define _GL_ATTR_may_alias _GL_GNUC_PREREQ (3, 3) +# endif +# define _GL_ATTR_malloc _GL_GNUC_PREREQ (3, 0) +# define _GL_ATTR_noinline _GL_GNUC_PREREQ (3, 1) +# define _GL_ATTR_nonnull _GL_GNUC_PREREQ (3, 3) +# define _GL_ATTR_nonstring _GL_GNUC_PREREQ (8, 0) +# define _GL_ATTR_nothrow _GL_GNUC_PREREQ (3, 3) +# define _GL_ATTR_packed _GL_GNUC_PREREQ (2, 7) +# define _GL_ATTR_pure _GL_GNUC_PREREQ (2, 96) +# define _GL_ATTR_returns_nonnull _GL_GNUC_PREREQ (4, 9) +# define _GL_ATTR_sentinel _GL_GNUC_PREREQ (4, 0) +# define _GL_ATTR_unused _GL_GNUC_PREREQ (2, 7) +# define _GL_ATTR_warn_unused_result _GL_GNUC_PREREQ (3, 4) +#endif + + +#if _GL_HAS_ATTRIBUTE (alloc_size) +# define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args)) +#else +# define _GL_ATTRIBUTE_ALLOC_SIZE(args) +#endif + +#if _GL_HAS_ATTRIBUTE (always_inline) +# define _GL_ATTRIBUTE_ALWAYS_INLINE __attribute__ ((__always_inline__)) +#else +# define _GL_ATTRIBUTE_ALWAYS_INLINE +#endif + +#if _GL_HAS_ATTRIBUTE (artificial) +# define _GL_ATTRIBUTE_ARTIFICIAL __attribute__ ((__artificial__)) +#else +# define _GL_ATTRIBUTE_ARTIFICIAL +#endif + +/* Avoid __attribute__ ((cold)) on MinGW; see thread starting at + . + Also, Oracle Studio 12.6 requires 'cold' not '__cold__'. */ +#if _GL_HAS_ATTRIBUTE (cold) && !defined __MINGW32__ +# ifndef __SUNPRO_C +# define _GL_ATTRIBUTE_COLD __attribute__ ((__cold__)) +# else +# define _GL_ATTRIBUTE_COLD __attribute__ ((cold)) +# endif +#else +# define _GL_ATTRIBUTE_COLD +#endif + +#if _GL_HAS_ATTRIBUTE (const) +# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__)) +#else +# define _GL_ATTRIBUTE_CONST +#endif + +#if 201710L < __STDC_VERSION__ +# define _GL_ATTRIBUTE_DEPRECATED [[__deprecated__]] +#elif _GL_HAS_ATTRIBUTE (deprecated) +# define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__)) +#else +# define _GL_ATTRIBUTE_DEPRECATED +#endif + +#if _GL_HAS_ATTRIBUTE (error) +# define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__error__ (msg))) +# define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__warning__ (msg))) +#elif _GL_HAS_ATTRIBUTE (diagnose_if) +# define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__diagnose_if__ (1, msg, "error"))) +# define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__diagnose_if__ (1, msg, "warning"))) +#else +# define _GL_ATTRIBUTE_ERROR(msg) +# define _GL_ATTRIBUTE_WARNING(msg) +#endif + +#if _GL_HAS_ATTRIBUTE (externally_visible) +# define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE __attribute__ ((externally_visible)) +#else +# define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE +#endif + +/* FALLTHROUGH is special, because it always expands to something. */ +#if 201710L < __STDC_VERSION__ +# define _GL_ATTRIBUTE_FALLTHROUGH [[__fallthrough__]] +#elif _GL_HAS_ATTRIBUTE (fallthrough) +# define _GL_ATTRIBUTE_FALLTHROUGH __attribute__ ((__fallthrough__)) +#else +# define _GL_ATTRIBUTE_FALLTHROUGH ((void) 0) +#endif + +#if _GL_HAS_ATTRIBUTE (format) +# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) +#else +# define _GL_ATTRIBUTE_FORMAT(spec) +#endif + +#if _GL_HAS_ATTRIBUTE (leaf) +# define _GL_ATTRIBUTE_LEAF __attribute__ ((__leaf__)) +#else +# define _GL_ATTRIBUTE_LEAF +#endif + +/* Oracle Studio 12.6 mishandles may_alias despite __has_attribute OK. */ +#if _GL_HAS_ATTRIBUTE (may_alias) && !defined __SUNPRO_C +# define _GL_ATTRIBUTE_MAY_ALIAS __attribute__ ((__may_alias__)) +#else +# define _GL_ATTRIBUTE_MAY_ALIAS +#endif + +#if 201710L < __STDC_VERSION__ +# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]] +#elif _GL_HAS_ATTRIBUTE (unused) +# define _GL_ATTRIBUTE_MAYBE_UNUSED __attribute__ ((__unused__)) +#else +# define _GL_ATTRIBUTE_MAYBE_UNUSED +#endif +/* Earlier spellings of this macro. */ +#define _GL_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED +#define _UNUSED_PARAMETER_ _GL_ATTRIBUTE_MAYBE_UNUSED + +#if _GL_HAS_ATTRIBUTE (malloc) +# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__)) +#else +# define _GL_ATTRIBUTE_MALLOC +#endif + +#if 201710L < __STDC_VERSION__ +# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]] +#elif _GL_HAS_ATTRIBUTE (warn_unused_result) +# define _GL_ATTRIBUTE_NODISCARD __attribute__ ((__warn_unused_result__)) +#else +# define _GL_ATTRIBUTE_NODISCARD +#endif + +#if _GL_HAS_ATTRIBUTE (noinline) +# define _GL_ATTRIBUTE_NOINLINE __attribute__ ((__noinline__)) +#else +# define _GL_ATTRIBUTE_NOINLINE +#endif + +#if _GL_HAS_ATTRIBUTE (nonnull) +# define _GL_ATTRIBUTE_NONNULL(args) __attribute__ ((__nonnull__ args)) +#else +# define _GL_ATTRIBUTE_NONNULL(args) +#endif + +#if _GL_HAS_ATTRIBUTE (nonstring) +# define _GL_ATTRIBUTE_NONSTRING __attribute__ ((__nonstring__)) +#else +# define _GL_ATTRIBUTE_NONSTRING +#endif + +/* There is no _GL_ATTRIBUTE_NORETURN; use _Noreturn instead. */ + +#if _GL_HAS_ATTRIBUTE (nothrow) && !defined __cplusplus +# define _GL_ATTRIBUTE_NOTHROW __attribute__ ((__nothrow__)) +#else +# define _GL_ATTRIBUTE_NOTHROW +#endif + +#if _GL_HAS_ATTRIBUTE (packed) +# define _GL_ATTRIBUTE_PACKED __attribute__ ((__packed__)) +#else +# define _GL_ATTRIBUTE_PACKED +#endif + +#if _GL_HAS_ATTRIBUTE (pure) +# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +#else +# define _GL_ATTRIBUTE_PURE +#endif + +#if _GL_HAS_ATTRIBUTE (returns_nonnull) +# define _GL_ATTRIBUTE_RETURNS_NONNULL __attribute__ ((__returns_nonnull__)) +#else +# define _GL_ATTRIBUTE_RETURNS_NONNULL +#endif + +#if _GL_HAS_ATTRIBUTE (sentinel) +# define _GL_ATTRIBUTE_SENTINEL(pos) __attribute__ ((__sentinel__ pos)) +#else +# define _GL_ATTRIBUTE_SENTINEL(pos) +#endif + + +/* To support C++ as well as C, use _GL_UNUSED_LABEL with trailing ';'. */ +#if !defined __cplusplus || _GL_GNUC_PREREQ (4, 5) +# define _GL_UNUSED_LABEL _GL_ATTRIBUTE_MAYBE_UNUSED +#else +# define _GL_UNUSED_LABEL +#endif + + /* 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 @@ -1324,6 +1871,9 @@ #undef inline #endif +/* Define to long or long long if and don't define. */ +#undef intmax_t + /* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of earlier versions), but does not display it by setting __GNUC_STDC_INLINE__. @@ -1340,6 +1890,22 @@ /* Define to a type if does not define. */ #undef mbstate_t +/* _GL_CMP (n1, n2) performs a three-valued comparison on n1 vs. n2, where + n1 and n2 are expressions without side effects, that evaluate to real + numbers (excluding NaN). + It returns + 1 if n1 > n2 + 0 if n1 == n2 + -1 if n1 < n2 + The naïve code (n1 > n2 ? 1 : n1 < n2 ? -1 : 0) produces a conditional + jump with nearly all GCC versions up to GCC 10. + This variant (n1 < n2 ? -1 : n1 > n2) produces a conditional with many + GCC versions up to GCC 9. + The better code (n1 > n2) - (n1 < n2) from Hacker's Delight § 2-9 + avoids conditional jumps in all GCC versions >= 3.4. */ +#define _GL_CMP(n1, n2) (((n1) > (n2)) - ((n1) < (n2))) + + /* Define to `int' if does not define. */ #undef mode_t @@ -1349,12 +1915,16 @@ /* Define to `long int' if does not define. */ #undef off_t -/* Define to `int' if does not define. */ +/* Define as a signed integer type capable of holding a process identifier. */ #undef pid_t +/* Define as the type of the result of subtracting two pointers, if the system + doesn't define it. */ +#undef ptrdiff_t + /* Define to the equivalent of the C99 'restrict' keyword, or to nothing if this is not supported. Do not define if restrict is - supported directly. */ + supported only directly. */ #undef restrict /* Work around a bug in older versions of Sun C++, which did not #define __restrict__ or support _Restrict or __restrict__ @@ -1376,49 +1946,5 @@ /* Define as a signed type of the same size as size_t. */ #undef ssize_t -/* Define as a marker that can be attached to declarations that might not - be used. This helps to reduce warnings, such as from - GCC -Wunused-parameter. */ -#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) -# define _GL_UNUSED __attribute__ ((__unused__)) -#else -# define _GL_UNUSED -#endif -/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name - is a misnomer outside of parameter lists. */ -#define _UNUSED_PARAMETER_ _GL_UNUSED - -/* gcc supports the "unused" attribute on possibly unused labels, and - g++ has since version 4.5. Note to support C++ as well as C, - _GL_UNUSED_LABEL should be used with a trailing ; */ -#if !defined __cplusplus || __GNUC__ > 4 \ - || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) -# define _GL_UNUSED_LABEL _GL_UNUSED -#else -# define _GL_UNUSED_LABEL -#endif - -/* The __pure__ attribute was added in gcc 2.96. */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) -# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) -#else -# define _GL_ATTRIBUTE_PURE /* empty */ -#endif - -/* The __const__ attribute was added in gcc 2.95. */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) -# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__)) -#else -# define _GL_ATTRIBUTE_CONST /* empty */ -#endif - -/* The __malloc__ attribute was added in gcc 3. */ -#if 3 <= __GNUC__ -# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__)) -#else -# define _GL_ATTRIBUTE_MALLOC /* empty */ -#endif - - /* Define as a macro for copying va_list variables. */ #undef va_copy diff -Nru datamash-1.7/configure datamash-1.8/configure --- datamash-1.7/configure 2020-04-23 17:34:00.000000000 +0000 +++ datamash-1.8/configure 2022-07-23 02:00:36.000000000 +0000 @@ -1,8 +1,8 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for GNU datamash 1.7. +# Generated by GNU Autoconf 2.69 for GNU datamash 1.8-dirty. # -# Report bugs to . +# Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -267,7 +267,7 @@ $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and -$0: assafgordon@gmail.com about your system, including any +$0: bug-datamash@gnu.org about your system, including any $0: error possibly output before this message. Then install $0: a modern shell, or manually run the script under such a $0: shell if you do have one." @@ -580,12 +580,13 @@ # Identity of this package. PACKAGE_NAME='GNU datamash' PACKAGE_TARNAME='datamash' -PACKAGE_VERSION='1.7' -PACKAGE_STRING='GNU datamash 1.7' -PACKAGE_BUGREPORT='assafgordon@gmail.com' +PACKAGE_VERSION='1.8-dirty' +PACKAGE_STRING='GNU datamash 1.8-dirty' +PACKAGE_BUGREPORT='bug-datamash@gnu.org' PACKAGE_URL='https://www.gnu.org/software/datamash' ac_unique_file="src/datamash.c" +ac_header_list= # Factoring default headers for most tests. ac_includes_default="\ #include @@ -622,15 +623,16 @@ # include #endif" +gl_use_threads_default= +gl_use_winpthreads_default= gl_ceil_required=plain gl_ceill_required=plain -ac_header_list= +ac_func_list= with_openssl_default='no' LIB_CRYPTO= gl_roundl_required=plain gl_round_required=plain gl_floor_required=plain -ac_func_list= gl_getopt_required=POSIX gl_log_required=plain gl_modf_required=plain @@ -654,13 +656,12 @@ LIBOBJS POSUB INTLLIBS -INTL_MACOSX_LIBS XGETTEXT_EXTRA_OPTIONS -MSGMERGE_FOR_MSGFMT_OPTION MSGMERGE XGETTEXT_015 XGETTEXT GMSGFMT_015 +MSGFMT_015 GMSGFMT MSGFMT GETTEXT_MACRO_VERSION @@ -670,6 +671,7 @@ PERL BUILD_FROM_GIT_FALSE BUILD_FROM_GIT_TRUE +SORT_PATH ENABLE_BASH_COMPLETION_FALSE ENABLE_BASH_COMPLETION_TRUE bashcompdir @@ -681,7 +683,6 @@ LIBDATAMASH_LTLIBDEPS LIBDATAMASH_LIBDEPS gltests_WITNESS -HAVE_FEATURES_H NEXT_AS_FIRST_DIRECTIVE_WCHAR_H NEXT_WCHAR_H LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE @@ -696,6 +697,7 @@ HAVE_UNISTD_H NEXT_AS_FIRST_DIRECTIVE_UNISTD_H NEXT_UNISTD_H +TIME_H_DEFINES_TIME_UTC UNISTD_H_DEFINES_STRUCT_TIMESPEC PTHREAD_H_DEFINES_STRUCT_TIMESPEC SYS_TIME_H_DEFINES_STRUCT_TIMESPEC @@ -713,14 +715,16 @@ REPLACE_LOCALTIME_R REPLACE_CTIME HAVE_TIMEZONE_T -HAVE_TZSET +HAVE_TIMESPEC_GET HAVE_TIMEGM HAVE_STRPTIME HAVE_NANOSLEEP HAVE_DECL_LOCALTIME_R +GNULIB_MDA_TZSET GNULIB_TZSET GNULIB_TIME_RZ GNULIB_TIME_R +GNULIB_TIMESPEC_GET GNULIB_TIMEGM GNULIB_STRPTIME GNULIB_STRFTIME @@ -728,11 +732,21 @@ GNULIB_LOCALTIME GNULIB_MKTIME GNULIB_CTIME +NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H +NEXT_SYS_WAIT_H +GNULIB_WAITPID HAVE_SYS_UIO_H NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H NEXT_SYS_UIO_H +HAVE_STRINGS_H +NEXT_AS_FIRST_DIRECTIVE_STRINGS_H +NEXT_STRINGS_H NEXT_AS_FIRST_DIRECTIVE_STRING_H NEXT_STRING_H +HAVE_DECL_STRNCASECMP +HAVE_STRCASECMP +HAVE_FFS +GNULIB_FFS GL_GENERATE_STDNORETURN_H_FALSE GL_GENERATE_STDNORETURN_H_TRUE STDNORETURN_H @@ -754,6 +768,7 @@ STDALIGN_H SQRTL_LIBM SQRT_LIBM +LIB_SETLOCALE PMCCABE GL_GENERATE_NETINET_IN_H_FALSE GL_GENERATE_NETINET_IN_H_TRUE @@ -761,13 +776,13 @@ HAVE_NETINET_IN_H NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H NEXT_NETINET_IN_H -HAVE_MSVC_INVALID_PARAMETER_HANDLER TRUNCL_LIBM MODFL_LIBM TRUNC_LIBM MODF_LIBM UNDEFINE_STRTOK_R REPLACE_STRSIGNAL +REPLACE_STRERRORNAME_NP REPLACE_STRERROR_R REPLACE_STRERROR REPLACE_STRTOK_R @@ -781,8 +796,12 @@ REPLACE_STPNCPY REPLACE_MEMMEM REPLACE_MEMCHR +REPLACE_FFSLL HAVE_STRVERSCMP HAVE_DECL_STRSIGNAL +HAVE_SIGDESCR_NP +HAVE_SIGABBREV_NP +HAVE_STRERRORNAME_NP HAVE_DECL_STRERROR_R HAVE_DECL_STRTOK_R HAVE_STRCASESTR @@ -798,13 +817,17 @@ HAVE_DECL_MEMRCHR HAVE_MEMPCPY HAVE_DECL_MEMMEM -HAVE_MEMCHR HAVE_FFSLL HAVE_FFSL HAVE_EXPLICIT_BZERO +GNULIB_MDA_STRDUP +GNULIB_MDA_MEMCCPY HAVE_MBSLEN GNULIB_STRVERSCMP GNULIB_STRSIGNAL +GNULIB_SIGDESCR_NP +GNULIB_SIGABBREV_NP +GNULIB_STRERRORNAME_NP GNULIB_STRERROR_R GNULIB_STRERROR GNULIB_MBSTOK_R @@ -860,6 +883,7 @@ REPLACE_BTOWC REPLACE_MBSTATE_T HAVE_DECL_WCWIDTH +HAVE_DECL_WCSDUP HAVE_DECL_WCTOB HAVE_WCSFTIME HAVE_WCSWIDTH @@ -886,6 +910,7 @@ HAVE_WCSNLEN HAVE_WCSLEN HAVE_WMEMSET +HAVE_WMEMPCPY HAVE_WMEMMOVE HAVE_WMEMCPY HAVE_WMEMCMP @@ -899,6 +924,7 @@ HAVE_MBRTOWC HAVE_MBSINIT HAVE_BTOWC +GNULIB_MDA_WCSDUP GNULIB_WCSFTIME GNULIB_WCSWIDTH GNULIB_WCSTOK @@ -924,6 +950,7 @@ GNULIB_WCSNLEN GNULIB_WCSLEN GNULIB_WMEMSET +GNULIB_WMEMPCPY GNULIB_WMEMMOVE GNULIB_WMEMCPY GNULIB_WMEMCMP @@ -944,6 +971,12 @@ SED LOGL_LIBM LOG_LIBM +LTLIBMULTITHREAD +LIBMULTITHREAD +LTLIBTHREAD +LIBTHREAD +LIBSTDTHREAD +INTL_MACOSX_LIBS NEXT_AS_FIRST_DIRECTIVE_LOCALE_H NEXT_LOCALE_H HAVE_XLOCALE_H @@ -970,6 +1003,17 @@ GNULIB_SETLOCALE GNULIB_LOCALECONV LOCALCHARSET_TESTS_ENVIRONMENT +HAVE_LANGINFO_YESEXPR +HAVE_LANGINFO_ERA +HAVE_LANGINFO_ALTMON +HAVE_LANGINFO_T_FMT_AMPM +HAVE_LANGINFO_CODESET +HAVE_LANGINFO_H +NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H +NEXT_LANGINFO_H +REPLACE_NL_LANGINFO +HAVE_NL_LANGINFO +GNULIB_NL_LANGINFO LOCALE_ZH_CN LOCALE_FR_UTF8 LOCALE_JA @@ -1002,7 +1046,6 @@ UINT64_MAX_EQ_ULONG_MAX UINT32_MAX_LT_UINTMAX_MAX PRIPTR_PREFIX -PRI_MACROS_BROKEN INT64_MAX_EQ_LONG_MAX INT32_MAX_LT_INTMAX_MAX REPLACE_STRTOUMAX @@ -1048,6 +1091,7 @@ LIMITS_H NEXT_AS_FIRST_DIRECTIVE_LIMITS_H NEXT_LIMITS_H +INET_PTON_LIB NEXT_AS_FIRST_DIRECTIVE_ICONV_H NEXT_ICONV_H GL_GENERATE_ICONV_H_FALSE @@ -1080,7 +1124,9 @@ NEXT_SYS_STAT_H REPLACE_UTIMENSAT REPLACE_STAT +REPLACE_MKNODAT REPLACE_MKNOD +REPLACE_MKFIFOAT REPLACE_MKFIFO REPLACE_MKDIR REPLACE_LSTAT @@ -1096,9 +1142,13 @@ HAVE_MKDIRAT HAVE_LSTAT HAVE_LCHMOD +HAVE_GETUMASK HAVE_FUTIMENS HAVE_FSTATAT HAVE_FCHMODAT +GNULIB_MDA_UMASK +GNULIB_MDA_MKDIR +GNULIB_MDA_CHMOD GNULIB_OVERRIDES_STRUCT_STAT GNULIB_UTIMENSAT GNULIB_STAT @@ -1107,8 +1157,10 @@ GNULIB_MKFIFOAT GNULIB_MKFIFO GNULIB_MKDIRAT +GNULIB_MKDIR GNULIB_LSTAT GNULIB_LCHMOD +GNULIB_GETUMASK GNULIB_FUTIMENS GNULIB_FSTATAT GNULIB_FSTAT @@ -1175,6 +1227,13 @@ HAVE_DECL_FTELLO HAVE_DECL_FSEEKO HAVE_DECL_FPURGE +HAVE_DECL_FCLOSEALL +GNULIB_MDA_TEMPNAM +GNULIB_MDA_PUTW +GNULIB_MDA_GETW +GNULIB_MDA_FILENO +GNULIB_MDA_FDOPEN +GNULIB_MDA_FCLOSEALL GNULIB_VSPRINTF_POSIX GNULIB_VSNPRINTF GNULIB_VPRINTF_POSIX @@ -1228,6 +1287,21 @@ GNULIB_FDOPEN GNULIB_FCLOSE GNULIB_DPRINTF +NEXT_AS_FIRST_DIRECTIVE_FCNTL_H +NEXT_FCNTL_H +REPLACE_OPENAT +REPLACE_OPEN +REPLACE_FCNTL +REPLACE_CREAT +HAVE_OPENAT +HAVE_FCNTL +GNULIB_MDA_OPEN +GNULIB_MDA_CREAT +GNULIB_OPENAT +GNULIB_OPEN +GNULIB_NONBLOCKING +GNULIB_FCNTL +GNULIB_CREAT FABSL_LIBM FABS_LIBM EXPL_LIBM @@ -1254,9 +1328,36 @@ HAVE_ISBLANK GNULIB_ISBLANK LIB_CRYPTO +HAVE_SYS_SOCKET_H +NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H +NEXT_SYS_SOCKET_H +HAVE_ACCEPT4 +HAVE_SA_FAMILY_T +HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY +HAVE_STRUCT_SOCKADDR_STORAGE +GNULIB_ACCEPT4 +GNULIB_SHUTDOWN +GNULIB_SETSOCKOPT +GNULIB_SENDTO +GNULIB_RECVFROM +GNULIB_SEND +GNULIB_RECV +GNULIB_LISTEN +GNULIB_GETSOCKOPT +GNULIB_GETSOCKNAME +GNULIB_GETPEERNAME +GNULIB_BIND +GNULIB_ACCEPT +GNULIB_CONNECT +GNULIB_SOCKET +pkglibexecdir +runstatedir +lispdir HAVE_WINSOCK2_H +HAVE_MSVC_INVALID_PARAMETER_HANDLER UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS UNISTD_H_HAVE_WINSOCK2_H +UNISTD_H_HAVE_SYS_RANDOM_H REPLACE_WRITE REPLACE_USLEEP REPLACE_UNLINKAT @@ -1287,6 +1388,13 @@ REPLACE_FTRUNCATE REPLACE_FCHOWNAT REPLACE_FACCESSAT +REPLACE_EXECVPE +REPLACE_EXECVP +REPLACE_EXECVE +REPLACE_EXECV +REPLACE_EXECLP +REPLACE_EXECLE +REPLACE_EXECL REPLACE_DUP2 REPLACE_DUP REPLACE_CLOSE @@ -1304,6 +1412,7 @@ HAVE_DECL_GETDOMAINNAME HAVE_DECL_FDATASYNC HAVE_DECL_FCHDIR +HAVE_DECL_EXECVPE HAVE_DECL_ENVIRON HAVE_USLEEP HAVE_UNLINKAT @@ -1326,6 +1435,7 @@ HAVE_GETLOGIN HAVE_GETHOSTNAME HAVE_GETGROUPS +HAVE_GETENTROPY HAVE_GETDTABLESIZE HAVE_FTRUNCATE HAVE_FSYNC @@ -1333,11 +1443,32 @@ HAVE_FCHOWNAT HAVE_FCHDIR HAVE_FACCESSAT +HAVE_EXECVPE HAVE_EUIDACCESS HAVE_DUP3 -HAVE_DUP2 HAVE_COPY_FILE_RANGE HAVE_CHOWN +GNULIB_MDA_WRITE +GNULIB_MDA_UNLINK +GNULIB_MDA_SWAB +GNULIB_MDA_RMDIR +GNULIB_MDA_READ +GNULIB_MDA_LSEEK +GNULIB_MDA_ISATTY +GNULIB_MDA_GETPID +GNULIB_MDA_GETCWD +GNULIB_MDA_EXECVPE +GNULIB_MDA_EXECVP +GNULIB_MDA_EXECVE +GNULIB_MDA_EXECV +GNULIB_MDA_EXECLP +GNULIB_MDA_EXECLE +GNULIB_MDA_EXECL +GNULIB_MDA_DUP2 +GNULIB_MDA_DUP +GNULIB_MDA_CLOSE +GNULIB_MDA_CHDIR +GNULIB_MDA_ACCESS GNULIB_WRITE GNULIB_USLEEP GNULIB_UNLINKAT @@ -1372,6 +1503,7 @@ GNULIB_GETLOGIN GNULIB_GETHOSTNAME GNULIB_GETGROUPS +GNULIB_GETENTROPY GNULIB_GETDTABLESIZE GNULIB_GETDOMAINNAME GNULIB_GETCWD @@ -1381,6 +1513,13 @@ GNULIB_FCHOWNAT GNULIB_FCHDIR GNULIB_FACCESSAT +GNULIB_EXECVPE +GNULIB_EXECVP +GNULIB_EXECVE +GNULIB_EXECV +GNULIB_EXECLP +GNULIB_EXECLE +GNULIB_EXECL GNULIB_EUIDACCESS GNULIB_ENVIRON GNULIB_DUP3 @@ -1391,35 +1530,6 @@ GNULIB_CHOWN GNULIB_CHDIR GNULIB_ACCESS -HAVE_WS2TCPIP_H -HAVE_SYS_SOCKET_H -NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H -NEXT_SYS_SOCKET_H -PRAGMA_COLUMNS -PRAGMA_SYSTEM_HEADER -INCLUDE_NEXT_AS_FIRST_DIRECTIVE -INCLUDE_NEXT -HAVE_ACCEPT4 -HAVE_SA_FAMILY_T -HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY -HAVE_STRUCT_SOCKADDR_STORAGE -GNULIB_ACCEPT4 -GNULIB_SHUTDOWN -GNULIB_SETSOCKOPT -GNULIB_SENDTO -GNULIB_RECVFROM -GNULIB_SEND -GNULIB_RECV -GNULIB_LISTEN -GNULIB_GETSOCKOPT -GNULIB_GETSOCKNAME -GNULIB_GETPEERNAME -GNULIB_BIND -GNULIB_ACCEPT -GNULIB_CONNECT -GNULIB_SOCKET -pkglibexecdir -lispdir CEILL_LIBM HAVE_SAME_LONG_DOUBLE_AS_DOUBLE CEIL_LIBM @@ -1432,7 +1542,7 @@ REPLACE_SQRTF REPLACE_SINHF REPLACE_SINF -REPLACE_SIGNBIT_USING_GCC +REPLACE_SIGNBIT_USING_BUILTINS REPLACE_SIGNBIT REPLACE_ROUNDL REPLACE_ROUNDF @@ -1598,6 +1708,12 @@ HAVE_ASINF HAVE_ACOSL HAVE_ACOSF +GNULIB_MDA_YN +GNULIB_MDA_Y1 +GNULIB_MDA_Y0 +GNULIB_MDA_JN +GNULIB_MDA_J1 +GNULIB_MDA_J0 GNULIB_TRUNCL GNULIB_TRUNCF GNULIB_TRUNC @@ -1707,12 +1823,15 @@ REPLACE_PUTENV REPLACE_PTSNAME_R REPLACE_PTSNAME +REPLACE_POSIX_MEMALIGN REPLACE_MKSTEMP REPLACE_MBTOWC REPLACE_MALLOC REPLACE_INITSTATE +REPLACE_FREE REPLACE_CANONICALIZE_FILE_NAME REPLACE_CALLOC +REPLACE_ALIGNED_ALLOC HAVE_DECL_UNSETENV HAVE_UNLOCKPT HAVE_SYS_LOADAVG_H @@ -1736,6 +1855,7 @@ HAVE_PTSNAME_R HAVE_PTSNAME HAVE_POSIX_OPENPT +HAVE_POSIX_MEMALIGN HAVE_MKSTEMPS HAVE_MKSTEMP HAVE_MKOSTEMPS @@ -1747,9 +1867,18 @@ HAVE_GRANTPT HAVE_GETSUBOPT HAVE_DECL_GETLOADAVG +HAVE_DECL_GCVT +HAVE_DECL_FCVT +HAVE_DECL_ECVT HAVE_CANONICALIZE_FILE_NAME HAVE_ATOLL +HAVE_ALIGNED_ALLOC HAVE__EXIT +GNULIB_MDA_PUTENV +GNULIB_MDA_MKTEMP +GNULIB_MDA_GCVT +GNULIB_MDA_FCVT +GNULIB_MDA_ECVT GNULIB_WCTOMB GNULIB_UNSETENV GNULIB_UNLOCKPT @@ -1771,6 +1900,7 @@ GNULIB_PTSNAME_R GNULIB_PTSNAME GNULIB_POSIX_OPENPT +GNULIB_POSIX_MEMALIGN GNULIB_MKSTEMPS GNULIB_MKSTEMP GNULIB_MKOSTEMPS @@ -1781,13 +1911,30 @@ GNULIB_GRANTPT GNULIB_GETSUBOPT GNULIB_GETLOADAVG +GNULIB_FREE_POSIX GNULIB_CANONICALIZE_FILE_NAME GNULIB_CALLOC_POSIX GNULIB_ATOLL +GNULIB_ALIGNED_ALLOC GNULIB__EXIT GL_GENERATE_BYTESWAP_H_FALSE GL_GENERATE_BYTESWAP_H_TRUE BYTESWAP_H +HAVE_WS2TCPIP_H +HAVE_FEATURES_H +NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H +NEXT_ARPA_INET_H +PRAGMA_COLUMNS +PRAGMA_SYSTEM_HEADER +INCLUDE_NEXT_AS_FIRST_DIRECTIVE +INCLUDE_NEXT +HAVE_ARPA_INET_H +REPLACE_INET_PTON +REPLACE_INET_NTOP +HAVE_DECL_INET_PTON +HAVE_DECL_INET_NTOP +GNULIB_INET_PTON +GNULIB_INET_NTOP HAVE_ALLOCA_H GL_GENERATE_ALLOCA_H_FALSE GL_GENERATE_ALLOCA_H_TRUE @@ -1795,6 +1942,9 @@ ALLOCA GL_COND_LIBTOOL_FALSE GL_COND_LIBTOOL_TRUE +RANLIB +ARFLAGS +AR host_os host_vendor host_cpu @@ -1803,9 +1953,6 @@ build_vendor build_cpu build -RANLIB -ARFLAGS -AR EGREP GREP CPP @@ -1829,6 +1976,9 @@ AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V +CSCOPE +ETAGS +CTAGS am__untar am__tar AMTAR @@ -1871,7 +2021,6 @@ docdir oldincludedir includedir -runstatedir localstatedir sharedstatedir sysconfdir @@ -1898,6 +2047,7 @@ enable_silent_rules enable_dependency_tracking enable_largefile +enable_threads enable_cross_guesses enable_assert with_linux_crypto @@ -1965,7 +2115,6 @@ sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -2218,15 +2367,6 @@ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -2364,7 +2504,7 @@ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir + libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -2477,7 +2617,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.7 to adapt to many kinds of systems. +\`configure' configures GNU datamash 1.8-dirty to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -2517,7 +2657,6 @@ --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -2548,7 +2687,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of GNU datamash 1.7:";; + short | recursive ) echo "Configuration of GNU datamash 1.8-dirty:";; esac cat <<\_ACEOF @@ -2563,6 +2702,9 @@ --disable-dependency-tracking speeds up one-time build --disable-largefile omit support for large files + --enable-threads={isoc|posix|isoc+posix|windows} + specify multithreading API + --disable-threads build without multithread safety --enable-cross-guesses={conservative|risky} specify policy for cross-compilation guesses --disable-assert turn off assertions @@ -2615,7 +2757,7 @@ Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to . +Report bugs to . GNU datamash home page: . General help using GNU software: . _ACEOF @@ -2680,7 +2822,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -GNU datamash configure 1.7 +GNU datamash configure 1.8-dirty generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2769,96 +2911,36 @@ } # ac_fn_c_try_cpp -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes + eval "$3=yes" else - ac_header_compiler=no + eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## ------------------------------------ ## -## Report this to assafgordon@gmail.com ## -## ------------------------------------ ##" - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } -fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -} # ac_fn_c_check_header_mongrel +} # ac_fn_c_check_header_compile # ac_fn_c_try_run LINENO # ---------------------- @@ -2902,37 +2984,6 @@ } # ac_fn_c_try_run -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_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_header_compile - # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. @@ -3033,72 +3084,96 @@ } # ac_fn_c_check_type -# ac_fn_c_check_func LINENO FUNC VAR -# ---------------------------------- -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case declares $2. - For example, HP-UX 11i declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } -int -main () -{ -return $2 (); - ; - return 0; -} +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$3=yes" +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes else - eval "$3=no" + ac_header_preproc=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## ----------------------------------- ## +## Report this to bug-datamash@gnu.org ## +## ----------------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } +fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -} # ac_fn_c_check_func +} # ac_fn_c_check_header_mongrel # ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES # --------------------------------------------- @@ -3151,6 +3226,73 @@ } # ac_fn_c_check_decl +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext 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_func + # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- # Tries to find if the field MEMBER exists in type AGGR, after including @@ -3394,7 +3536,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.7, which was +It was created by GNU datamash $as_me 1.8-dirty, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3674,13 +3816,21 @@ >$cache_file fi +as_fn_append ac_header_list " wchar.h" +as_fn_append ac_header_list " minix/config.h" +as_fn_append ac_header_list " arpa/inet.h" +as_fn_append ac_header_list " features.h" as_fn_append ac_header_list " sys/socket.h" +as_fn_append ac_func_list " _set_invalid_parameter_handler" +as_fn_append ac_func_list " fcntl" as_fn_append ac_header_list " unistd.h" +as_fn_append ac_func_list " symlink" as_fn_append ac_header_list " stdio_ext.h" as_fn_append ac_func_list " fpurge" as_fn_append ac_func_list " __fpurge" as_fn_append ac_func_list " __freading" as_fn_append ac_header_list " sys/stat.h" +as_fn_append ac_func_list " getdtablesize" gl_getopt_required=GNU as_fn_append ac_header_list " getopt.h" as_fn_append ac_header_list " sys/cdefs.h" @@ -3688,31 +3838,42 @@ as_fn_append ac_func_list " getexecname" as_fn_append ac_header_list " threads.h" as_fn_append ac_header_list " iconv.h" +as_fn_append ac_header_list " netdb.h" +as_fn_append ac_header_list " netinet/in.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" +as_fn_append ac_header_list " sys/types.h" +as_fn_append ac_header_list " stdint.h" as_fn_append ac_func_list " isblank" as_fn_append ac_func_list " iswcntrl" as_fn_append ac_header_list " crtdefs.h" as_fn_append ac_header_list " wctype.h" as_fn_append ac_func_list " iswblank" +as_fn_append ac_header_list " langinfo.h" as_fn_append ac_header_list " xlocale.h" +as_fn_append ac_func_list " uselocale" +as_fn_append ac_func_list " newlocale" +as_fn_append ac_func_list " duplocale" +as_fn_append ac_func_list " freelocale" as_fn_append ac_header_list " math.h" as_fn_append ac_func_list " mbsinit" as_fn_append ac_func_list " mbrtowc" as_fn_append ac_func_list " mbslen" -as_fn_append ac_func_list " mbsrtowcs" as_fn_append ac_header_list " sys/mman.h" as_fn_append ac_func_list " mprotect" -as_fn_append ac_func_list " _set_invalid_parameter_handler" -as_fn_append ac_header_list " netinet/in.h" +as_fn_append ac_func_list " lstat" as_fn_append ac_header_list " sys/param.h" +as_fn_append ac_func_list " pclose" +as_fn_append ac_func_list " popen" +as_fn_append ac_func_list " snprintf" as_fn_append ac_header_list " sys/time.h" +as_fn_append ac_header_list " strings.h" as_fn_append ac_func_list " strndup" +as_fn_append ac_func_list " strtold" as_fn_append ac_func_list " strtoumax" as_fn_append ac_header_list " sys/uio.h" -as_fn_append ac_header_list " features.h" +as_fn_append ac_header_list " sys/wait.h" +as_fn_append ac_func_list " vasnprintf" as_fn_append ac_func_list " wcwidth" gt_needs="$gt_needs " # Check that the precious variables saved in the cache have kept the same @@ -3989,12 +4150,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac + MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then @@ -4299,7 +4455,7 @@ # Define the identity of the package. PACKAGE='datamash' - VERSION='1.7' + VERSION='1.8-dirty' cat >>confdefs.h <<_ACEOF @@ -4349,6 +4505,20 @@ +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi + +if test -z "$ETAGS"; then + ETAGS=etags +fi + +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi + + # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile @@ -6116,6 +6286,7 @@ # keep everything together. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : @@ -6376,28 +6547,28 @@ - ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" -if test "x$ac_cv_header_minix_config_h" = xyes; then : - MINIX=yes -else - MINIX= -fi - if test "$MINIX" = yes; then + 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 "#define _POSIX_SOURCE 1" >>confdefs.h +done -$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h -$as_echo "#define _MINIX 1" >>confdefs.h -$as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h - fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 @@ -6427,36 +6598,6 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } - test $ac_cv_safe_to_define___extensions__ = yes && - $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h - - $as_echo "#define _ALL_SOURCE 1" >>confdefs.h - - $as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h - - $as_echo "#define _GNU_SOURCE 1" >>confdefs.h - - $as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h - - $as_echo "#define _OPENBSD_SOURCE 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 $as_echo_n "checking whether _XOPEN_SOURCE should be defined... " >&6; } @@ -6464,7 +6605,8 @@ $as_echo_n "(cached) " >&6 else ac_cv_should_define__xopen_source=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test $ac_cv_header_wchar_h = yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -6483,9 +6625,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #define _XOPEN_SOURCE 500 - #include - mbstate_t x; + #define _XOPEN_SOURCE 500 + #include + mbstate_t x; int main () { @@ -6501,83 +6643,206 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 $as_echo "$ac_cv_should_define__xopen_source" >&6; } - test $ac_cv_should_define__xopen_source = yes && - $as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h + + $as_echo "#define _ALL_SOURCE 1" >>confdefs.h + + $as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h + + $as_echo "#define _GNU_SOURCE 1" >>confdefs.h $as_echo "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h + $as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h + + $as_echo "#define _OPENBSD_SOURCE 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 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 + if test $ac_cv_header_minix_config_h = yes; then : + MINIX=yes + $as_echo "#define _MINIX 1" >>confdefs.h - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h -#ifdef __ACK__ -Amsterdam -#endif + $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h -_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 + MINIX= fi -rm -f conftest* + if test $ac_cv_safe_to_define___extensions__ = yes; then : + $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h +fi + if test $ac_cv_should_define__xopen_source = yes; then : + $as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h 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 - : - fi +# 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 - 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 "$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 - 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 + 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 + +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 + + +{ $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 "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +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 +fi + +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 + + + + + + + case "$host_os" in + openbsd*) + +$as_echo "#define _ISOC11_SOURCE 1" >>confdefs.h + + ;; + esac + + + + + { $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 + + 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 +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 $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 + : + 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 @@ -6754,77 +7019,6 @@ fi -# 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_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 - -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 - - -{ $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 "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -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 -fi - -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 - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 @@ -6957,7 +7151,7 @@ We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -7003,7 +7197,7 @@ We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -7027,7 +7221,7 @@ We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -7072,7 +7266,7 @@ We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -7096,7 +7290,7 @@ We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -7132,6 +7326,72 @@ + + + + + + # Check whether --enable-threads was given. +if test "${enable_threads+set}" = set; then : + enableval=$enable_threads; gl_use_threads=$enableval +else + if test -n "$gl_use_threads_default"; then + gl_use_threads="$gl_use_threads_default" + else + case "$host_os" in + osf*) gl_use_threads=no ;; + cygwin*) + case `uname -r` in + 1.[0-5].*) gl_use_threads=no ;; + *) gl_use_threads=yes ;; + esac + ;; + mingw*) + case "$gl_use_winpthreads_default" in + yes) gl_use_threads=posix ;; + no) gl_use_threads=windows ;; + *) gl_use_threads=yes ;; + esac + ;; + *) gl_use_threads=yes ;; + esac + fi + +fi + + if test "$gl_use_threads" = yes \ + || test "$gl_use_threads" = isoc \ + || test "$gl_use_threads" = posix \ + || test "$gl_use_threads" = isoc+posix; then + # For using or : + + + if test -z "$gl_anythreadlib_early_done"; then + case "$host_os" in + osf*) + # On OSF/1, the compiler needs the flag -D_REENTRANT so that it + # groks . cc also understands the flag -pthread, but + # we don't use it because 1. gcc-2.95 doesn't understand -pthread, + # 2. putting a flag into CPPFLAGS that has an effect on the linker + # causes the AC_LINK_IFELSE test below to succeed unexpectedly, + # leading to wrong values of LIBTHREAD and LTLIBTHREAD. + CPPFLAGS="$CPPFLAGS -D_REENTRANT" + ;; + esac + # Some systems optimize for single-threaded programs by default, and + # need special flags to disable these optimizations. For example, the + # definition of 'errno' in . + case "$host_os" in + aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;; + solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;; + esac + gl_anythreadlib_early_done=done + fi + + fi + + + # Pre-early section. @@ -7140,9 +7400,12 @@ # Code from module absolute-header: # Code from module alloca-opt: # Code from module announce-gen: + # Code from module arpa_inet: # Code from module assert: # Code from module assure: + # Code from module attribute: # Code from module base64: + # Code from module basename-lgpl: # Code from module bitrotate: # Code from module byteswap: # Code from module c-ctype: @@ -7153,6 +7416,8 @@ # Code from module calloc-posix: # Code from module ceil: # Code from module ceill: + # Code from module cloexec: + # Code from module close: # Code from module close-stream: # Code from module closeout: # Code from module configmake: @@ -7169,8 +7434,8 @@ # 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 dup2: # Code from module errno: # Code from module error: # Code from module exitfail: @@ -7180,9 +7445,14 @@ # Code from module extern-inline: # Code from module fabs: # Code from module fabsl: + # Code from module fcntl: + # Code from module fcntl-h: + # Code from module fd-hook: # Code from module fdl: # Code from module fflush: + # Code from module filename: + # Code from module flexmember: # Code from module float: # Code from module floor: # Code from module floorl: @@ -7202,10 +7472,10 @@ # Code from module ftello: # Code from module gendocs: + # Code from module getdtablesize: # 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: @@ -7223,6 +7493,7 @@ # Code from module iconv_open: # Code from module ignore-value: # Code from module include_next: + # Code from module inet_pton: # Code from module inline: # Code from module intprops: # Code from module inttostr: @@ -7238,6 +7509,7 @@ # Code from module iswblank: # Code from module iswdigit: # Code from module iswxdigit: + # Code from module langinfo: # Code from module largefile: # Code from module ldexp: @@ -7248,6 +7520,8 @@ # Code from module localcharset: # Code from module locale: # Code from module localeconv: + # Code from module localename: + # Code from module lock: # Code from module log: # Code from module logl: # Code from module lseek: @@ -7260,7 +7534,6 @@ # 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: @@ -7273,8 +7546,11 @@ # Code from module netinet_in: # Code from module nocrash: # Code from module non-recursive-gnulib-prefix-hack: + # Code from module open: # Code from module pathmax: + # Code from module pclose: # Code from module pmccabe2html: + # Code from module popen: # Code from module progname: # Code from module propername: # Code from module quotearg: @@ -7286,7 +7562,9 @@ # Code from module realloc-posix: # Code from module round: # Code from module roundl: + # Code from module setlocale: # Code from module setlocale-null: + # Code from module sh-quote: # Code from module signbit: # Code from module size_max: # Code from module snippet/_Noreturn: @@ -7294,10 +7572,12 @@ # Code from module snippet/c++defs: # Code from module snippet/unused-parameter: # Code from module snippet/warn-on-use: + # Code from module snprintf: # Code from module socklen: # Code from module sqrt: # Code from module sqrtl: # Code from module ssize_t: + # Code from module stat: # Code from module stat-time: # Code from module std-gnu11: # Code from module stdalign: @@ -7312,21 +7592,33 @@ # Code from module stdlib: # Code from module stdnoreturn: # Code from module stpcpy: + # Code from module strcase: + # Code from module strdup-posix: # Code from module streq: # Code from module strerror: # Code from module strerror-override: # Code from module striconv: # Code from module string: + # Code from module strings: # Code from module strndup: # Code from module strnlen: # Code from module strnlen1: # Code from module strsep: + # Code from module strtod: + # Code from module strtold: + # Code from module strtoll: # Code from module strtoull: # Code from module strtoumax: # Code from module sys_socket: # Code from module sys_stat: # Code from module sys_types: # Code from module sys_uio: + # Code from module sys_wait: + # Code from module thread-optim: + # Code from module threadlib: + + + # Code from module time: # Code from module trim: # Code from module trunc: @@ -7342,16 +7634,23 @@ # Code from module unlocked-io: # Code from module update-copyright: # Code from module useless-if-before-free: + # Code from module vasnprintf: # Code from module vc-list-files: # Code from module verify: # Code from module version-etc: + # Code from module waitpid: # Code from module warnings: # Code from module wchar: # Code from module wctype-h: # Code from module wcwidth: + # Code from module windows-mutex: + # Code from module windows-once: + # Code from module windows-recmutex: + # Code from module windows-rwlock: # Code from module xalloc: # Code from module xalloc-die: # Code from module xalloc-oversized: + # Code from module xsize: # Code from module xstriconv: # Code from module xstrndup: # Code from module xstrtol: @@ -7364,6 +7663,8 @@ + + # Check whether --enable-cross-guesses was given. if test "${enable_cross_guesses+set}" = set; then : enableval=$enable_cross_guesses; if test "x$enableval" != xconservative && test "x$enableval" != xrisky; then @@ -7500,47 +7801,6 @@ $as_echo "#define C_ALLOCA 1" >>confdefs.h -{ $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 - 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 - - break -fi - - 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 : @@ -7588,14 +7848,170 @@ fi + + GNULIB_INET_NTOP=0; + GNULIB_INET_PTON=0; + HAVE_DECL_INET_NTOP=1; + HAVE_DECL_INET_PTON=1; + REPLACE_INET_NTOP=0; + REPLACE_INET_PTON=0; + + + + + + { $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 source code line length is unlimited" >&5 +$as_echo_n "checking whether source code line length is unlimited... " >&6; } +if ${gl_cv_source_line_length_unlimited+:} 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_source_line_length_unlimited=no +else + gl_cv_source_line_length_unlimited=yes +fi +rm -f conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_source_line_length_unlimited" >&5 +$as_echo "$gl_cv_source_line_length_unlimited" >&6; } + if test $gl_cv_source_line_length_unlimited = no; then + PRAGMA_COLUMNS="#pragma COLUMNS 10000" + else + PRAGMA_COLUMNS= + fi + + + + + + + if test $ac_cv_header_features_h = yes; then + HAVE_FEATURES_H=1 + else + HAVE_FEATURES_H=0 + fi + + + + + + if test $ac_cv_header_sys_socket_h = no; then + for ac_header in ws2tcpip.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default" +if test "x$ac_cv_header_ws2tcpip_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WS2TCPIP_H 1 +_ACEOF + +fi + +done + + 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 + # Put '__restrict__' first, to avoid problems with glibc and non-GCC; see: + # https://lists.gnu.org/archive/html/bug-autoconf/2016-02/msg00006.html + # Put 'restrict' last, because C++ lacks it. + for ac_kw in __restrict__ __restrict _Restrict restrict; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ typedef int *int_ptr; @@ -7638,9 +8054,11 @@ GNULIB__EXIT=0; + GNULIB_ALIGNED_ALLOC=0; GNULIB_ATOLL=0; GNULIB_CALLOC_POSIX=0; GNULIB_CANONICALIZE_FILE_NAME=0; + GNULIB_FREE_POSIX=0; GNULIB_GETLOADAVG=0; GNULIB_GETSUBOPT=0; GNULIB_GRANTPT=0; @@ -7651,6 +8069,7 @@ GNULIB_MKOSTEMPS=0; GNULIB_MKSTEMP=0; GNULIB_MKSTEMPS=0; + GNULIB_POSIX_MEMALIGN=0; GNULIB_POSIX_OPENPT=0; GNULIB_PTSNAME=0; GNULIB_PTSNAME_R=0; @@ -7672,9 +8091,18 @@ GNULIB_UNLOCKPT=0; GNULIB_UNSETENV=0; GNULIB_WCTOMB=0; + GNULIB_MDA_ECVT=1; + GNULIB_MDA_FCVT=1; + GNULIB_MDA_GCVT=1; + GNULIB_MDA_MKTEMP=1; + GNULIB_MDA_PUTENV=1; HAVE__EXIT=1; + HAVE_ALIGNED_ALLOC=1; HAVE_ATOLL=1; HAVE_CANONICALIZE_FILE_NAME=1; + HAVE_DECL_ECVT=1; + HAVE_DECL_FCVT=1; + HAVE_DECL_GCVT=1; HAVE_DECL_GETLOADAVG=1; HAVE_GETSUBOPT=1; HAVE_GRANTPT=1; @@ -7686,6 +8114,7 @@ HAVE_MKOSTEMPS=1; HAVE_MKSTEMP=1; HAVE_MKSTEMPS=1; + HAVE_POSIX_MEMALIGN=1; HAVE_POSIX_OPENPT=1; HAVE_PTSNAME=1; HAVE_PTSNAME_R=1; @@ -7709,12 +8138,15 @@ HAVE_SYS_LOADAVG_H=0; HAVE_UNLOCKPT=1; HAVE_DECL_UNSETENV=1; + REPLACE_ALIGNED_ALLOC=0; REPLACE_CALLOC=0; REPLACE_CANONICALIZE_FILE_NAME=0; + REPLACE_FREE=0; REPLACE_INITSTATE=0; REPLACE_MALLOC=0; REPLACE_MBTOWC=0; REPLACE_MKSTEMP=0; + REPLACE_POSIX_MEMALIGN=0; REPLACE_PTSNAME=0; REPLACE_PTSNAME_R=0; REPLACE_PUTENV=0; @@ -7858,6 +8290,12 @@ GNULIB_TRUNC=0; GNULIB_TRUNCF=0; GNULIB_TRUNCL=0; + GNULIB_MDA_J0=1; + GNULIB_MDA_J1=1; + GNULIB_MDA_JN=1; + GNULIB_MDA_Y0=1; + GNULIB_MDA_Y1=1; + GNULIB_MDA_YN=1; HAVE_ACOSF=1; HAVE_ACOSL=1; HAVE_ASINF=1; @@ -8023,7 +8461,7 @@ REPLACE_ROUNDF=0; REPLACE_ROUNDL=0; REPLACE_SIGNBIT=0; - REPLACE_SIGNBIT_USING_GCC=0; + REPLACE_SIGNBIT_USING_BUILTINS=0; REPLACE_SINF=0; REPLACE_SINHF=0; REPLACE_SQRTF=0; @@ -8077,177 +8515,6 @@ - GNULIB_SOCKET=0; - GNULIB_CONNECT=0; - GNULIB_ACCEPT=0; - GNULIB_BIND=0; - GNULIB_GETPEERNAME=0; - GNULIB_GETSOCKNAME=0; - GNULIB_GETSOCKOPT=0; - GNULIB_LISTEN=0; - GNULIB_RECV=0; - GNULIB_SEND=0; - GNULIB_RECVFROM=0; - GNULIB_SENDTO=0; - GNULIB_SETSOCKOPT=0; - GNULIB_SHUTDOWN=0; - GNULIB_ACCEPT4=0; - HAVE_STRUCT_SOCKADDR_STORAGE=1; - HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1; - - HAVE_SA_FAMILY_T=1; - HAVE_ACCEPT4=1; - - - - - 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 - - - - - if test $ac_cv_header_sys_socket_h = no; then - for ac_header in ws2tcpip.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default" -if test "x$ac_cv_header_ws2tcpip_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_WS2TCPIP_H 1 -_ACEOF - -fi - -done - - fi - - - - { $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 - - - GNULIB_ACCESS=0; GNULIB_CHDIR=0; GNULIB_CHOWN=0; @@ -8258,6 +8525,13 @@ GNULIB_DUP3=0; GNULIB_ENVIRON=0; GNULIB_EUIDACCESS=0; + GNULIB_EXECL=0; + GNULIB_EXECLE=0; + GNULIB_EXECLP=0; + GNULIB_EXECV=0; + GNULIB_EXECVE=0; + GNULIB_EXECVP=0; + GNULIB_EXECVPE=0; GNULIB_FACCESSAT=0; GNULIB_FCHDIR=0; GNULIB_FCHOWNAT=0; @@ -8267,6 +8541,7 @@ GNULIB_GETCWD=0; GNULIB_GETDOMAINNAME=0; GNULIB_GETDTABLESIZE=0; + GNULIB_GETENTROPY=0; GNULIB_GETGROUPS=0; GNULIB_GETHOSTNAME=0; GNULIB_GETLOGIN=0; @@ -8301,11 +8576,32 @@ GNULIB_UNLINKAT=0; GNULIB_USLEEP=0; GNULIB_WRITE=0; + GNULIB_MDA_ACCESS=1; + GNULIB_MDA_CHDIR=1; + GNULIB_MDA_CLOSE=1; + GNULIB_MDA_DUP=1; + GNULIB_MDA_DUP2=1; + GNULIB_MDA_EXECL=1; + GNULIB_MDA_EXECLE=1; + GNULIB_MDA_EXECLP=1; + GNULIB_MDA_EXECV=1; + GNULIB_MDA_EXECVE=1; + GNULIB_MDA_EXECVP=1; + GNULIB_MDA_EXECVPE=1; + GNULIB_MDA_GETCWD=1; + GNULIB_MDA_GETPID=1; + GNULIB_MDA_ISATTY=1; + GNULIB_MDA_LSEEK=1; + GNULIB_MDA_READ=1; + GNULIB_MDA_RMDIR=1; + GNULIB_MDA_SWAB=1; + GNULIB_MDA_UNLINK=1; + GNULIB_MDA_WRITE=1; HAVE_CHOWN=1; HAVE_COPY_FILE_RANGE=1; - HAVE_DUP2=1; HAVE_DUP3=1; HAVE_EUIDACCESS=1; + HAVE_EXECVPE=1; HAVE_FACCESSAT=1; HAVE_FCHDIR=1; HAVE_FCHOWNAT=1; @@ -8313,6 +8609,7 @@ HAVE_FSYNC=1; HAVE_FTRUNCATE=1; HAVE_GETDTABLESIZE=1; + HAVE_GETENTROPY=1; HAVE_GETGROUPS=1; HAVE_GETHOSTNAME=1; HAVE_GETLOGIN=1; @@ -8335,6 +8632,7 @@ HAVE_UNLINKAT=1; HAVE_USLEEP=1; HAVE_DECL_ENVIRON=1; + HAVE_DECL_EXECVPE=1; HAVE_DECL_FCHDIR=1; HAVE_DECL_FDATASYNC=1; HAVE_DECL_GETDOMAINNAME=1; @@ -8352,6 +8650,13 @@ REPLACE_CLOSE=0; REPLACE_DUP=0; REPLACE_DUP2=0; + REPLACE_EXECL=0; + REPLACE_EXECLE=0; + REPLACE_EXECLP=0; + REPLACE_EXECV=0; + REPLACE_EXECVE=0; + REPLACE_EXECVP=0; + REPLACE_EXECVPE=0; REPLACE_FACCESSAT=0; REPLACE_FCHOWNAT=0; REPLACE_FTRUNCATE=0; @@ -8382,6 +8687,7 @@ REPLACE_UNLINKAT=0; REPLACE_USLEEP=0; REPLACE_WRITE=0; + UNISTD_H_HAVE_SYS_RANDOM_H=0; UNISTD_H_HAVE_WINSOCK2_H=0; UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0; @@ -8389,6 +8695,57 @@ + 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 $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 + + + + GNULIB_SOCKET=0; + GNULIB_CONNECT=0; + GNULIB_ACCEPT=0; + GNULIB_BIND=0; + GNULIB_GETPEERNAME=0; + GNULIB_GETSOCKNAME=0; + GNULIB_GETSOCKOPT=0; + GNULIB_LISTEN=0; + GNULIB_RECV=0; + GNULIB_SEND=0; + GNULIB_RECVFROM=0; + GNULIB_SENDTO=0; + GNULIB_SETSOCKOPT=0; + GNULIB_SHUTDOWN=0; + GNULIB_ACCEPT4=0; + HAVE_STRUCT_SOCKADDR_STORAGE=1; + HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1; + + HAVE_SA_FAMILY_T=1; + HAVE_ACCEPT4=1; + + + + case "$host_os" in osf*) @@ -9021,48 +9378,60 @@ GNULIB_ISBLANK=0; HAVE_ISBLANK=1; - - - { $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 - - - - +gl_mda_defines=' +#if defined _WIN32 && !defined __CYGWIN__ +#define access _access +#define chdir _chdir +#define chmod _chmod +#define close _close +#define creat _creat +#define dup _dup +#define dup2 _dup2 +#define ecvt _ecvt +#define execl _execl +#define execle _execle +#define execlp _execlp +#define execv _execv +#define execve _execve +#define execvp _execvp +#define execvpe _execvpe +#define fcloseall _fcloseall +#define fcvt _fcvt +#define fdopen _fdopen +#define fileno _fileno +#define gcvt _gcvt +#define getcwd _getcwd +#define getpid _getpid +#define getw _getw +#define isatty _isatty +#define j0 _j0 +#define j1 _j1 +#define jn _jn +#define lfind _lfind +#define lsearch _lsearch +#define lseek _lseek +#define memccpy _memccpy +#define mkdir _mkdir +#define mktemp _mktemp +#define open _open +#define putenv _putenv +#define putw _putw +#define read _read +#define rmdir _rmdir +#define strdup _strdup +#define swab _swab +#define tempnam _tempnam +#define tzset _tzset +#define umask _umask +#define unlink _unlink +#define utime _utime +#define wcsdup _wcsdup +#define write _write +#define y0 _y0 +#define y1 _y1 +#define yn _yn +#endif +' @@ -9648,9 +10017,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - #if __GNUC__ >= 4 + #if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnanl - # define isnanl(x) __builtin_isnanl ((long double)(x)) + # define isnanl(x) __builtin_isnan ((long double)(x)) #elif defined isnan # undef isnanl # define isnanl(x) isnan ((long double)(x)) @@ -9689,9 +10058,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - #if __GNUC__ >= 4 + #if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnanl - # define isnanl(x) __builtin_isnanl ((long double)(x)) + # define isnanl(x) __builtin_isnan ((long double)(x)) #elif defined isnan # undef isnanl # define isnanl(x) isnan ((long double)(x)) @@ -9766,9 +10135,9 @@ #include #include #include -#if __GNUC__ >= 4 +#if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnanl -# define isnanl(x) __builtin_isnanl ((long double)(x)) +# define isnanl(x) __builtin_isnan ((long double)(x)) #elif defined isnan # undef isnanl # define isnanl(x) isnan ((long double)(x)) @@ -10006,7 +10375,7 @@ "C" #endif double round (double); -#ifdef _MSC_VER +#if defined _MSC_VER && !defined __clang__ # pragma fenv_access (off) #endif int main() @@ -10051,9 +10420,10 @@ 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 : + + exec 9>&6 6>/dev/null + + if ${gl_cv_func_floor_libm+:} false; then : $as_echo_n "(cached) " >&6 else @@ -10108,15 +10478,18 @@ fi - as_echo_n="$saved_as_echo_n" + + exec 6>&9 9>&- + 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 : + + exec 9>&6 6>/dev/null + + if ${gl_cv_func_ceil_libm+:} false; then : $as_echo_n "(cached) " >&6 else @@ -10171,7 +10544,9 @@ fi - as_echo_n="$saved_as_echo_n" + + exec 6>&9 9>&- + CEIL_LIBM="$gl_cv_func_ceil_libm" @@ -10287,9 +10662,10 @@ && test "$ac_cv_have_decl_ceill" = yes; then - saved_as_echo_n="$as_echo_n" - as_echo_n=':' - if ${gl_cv_func_floorl_libm+:} false; then : + + exec 9>&6 6>/dev/null + + if ${gl_cv_func_floorl_libm+:} false; then : $as_echo_n "(cached) " >&6 else @@ -10344,15 +10720,18 @@ fi - as_echo_n="$saved_as_echo_n" + + exec 6>&9 9>&- + 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 : + + exec 9>&6 6>/dev/null + + if ${gl_cv_func_ceill_libm+:} false; then : $as_echo_n "(cached) " >&6 else @@ -10407,7 +10786,9 @@ fi - as_echo_n="$saved_as_echo_n" + + exec 6>&9 9>&- + CEILL_LIBM="$gl_cv_func_ceill_libm" @@ -10691,6 +11072,231 @@ + GNULIB_CREAT=0; + GNULIB_FCNTL=0; + GNULIB_NONBLOCKING=0; + GNULIB_OPEN=0; + GNULIB_OPENAT=0; + GNULIB_MDA_CREAT=1; + GNULIB_MDA_OPEN=1; + HAVE_FCNTL=1; + HAVE_OPENAT=1; + REPLACE_CREAT=0; + REPLACE_FCNTL=0; + REPLACE_OPEN=0; + REPLACE_OPENAT=0; + + + + + + + + + + + + + { $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 : + case "$host_os" in + # Guess 'no' on native Windows. + mingw*) gl_cv_header_working_fcntl_h='no' ;; + *) gl_cv_header_working_fcntl_h=cross-compiling ;; + esac + +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 + + +$gl_mda_defines + + #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_run "$LINENO"; then : + gl_cv_header_working_fcntl_h=yes +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 +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 + + + 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 +_ACEOF + + + + 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 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #if defined _WIN64 && !defined __CYGWIN__ + LLP64 + #endif + +int +main () +{ + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_pid_type='int' +else + gl_pid_type='__int64' +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +cat >>confdefs.h <<_ACEOF +#define pid_t $gl_pid_type +_ACEOF + + +fi + + +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 + + GNULIB_DPRINTF=0; GNULIB_FCLOSE=0; GNULIB_FDOPEN=0; @@ -10744,7 +11350,14 @@ GNULIB_VPRINTF_POSIX=0; GNULIB_VSNPRINTF=0; GNULIB_VSPRINTF_POSIX=0; - HAVE_DECL_FPURGE=1; + GNULIB_MDA_FCLOSEALL=1; + GNULIB_MDA_FDOPEN=1; + GNULIB_MDA_FILENO=1; + GNULIB_MDA_GETW=1; + GNULIB_MDA_PUTW=1; + GNULIB_MDA_TEMPNAM=1; + HAVE_DECL_FCLOSEALL=1; + HAVE_DECL_FPURGE=1; HAVE_DECL_FSEEKO=1; HAVE_DECL_FTELLO=1; HAVE_DECL_GETDELIM=1; @@ -10799,10 +11412,9 @@ + exec 9>&6 6>/dev/null - saved_as_echo_n="$as_echo_n" - as_echo_n=':' - if ${gl_cv_func_floor_libm+:} false; then : + if ${gl_cv_func_floor_libm+:} false; then : $as_echo_n "(cached) " >&6 else @@ -10857,7 +11469,9 @@ fi - as_echo_n="$saved_as_echo_n" + + exec 6>&9 9>&- + FLOOR_LIBM="$gl_cv_func_floor_libm" @@ -10891,9 +11505,10 @@ if test "$ac_cv_have_decl_floorl" = yes; then - saved_as_echo_n="$as_echo_n" - as_echo_n=':' - if ${gl_cv_func_floorl_libm+:} false; then : + + exec 9>&6 6>/dev/null + + if ${gl_cv_func_floorl_libm+:} false; then : $as_echo_n "(cached) " >&6 else @@ -10948,7 +11563,9 @@ fi - as_echo_n="$saved_as_echo_n" + + exec 6>&9 9>&- + FLOORL_LIBM="$gl_cv_func_floorl_libm" @@ -10973,21 +11590,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 - - - - @@ -11343,6 +11945,7 @@ "C" #endif long double frexpl (long double, int *); +long double zero = 0.0L; int main() { int result = 0; @@ -11400,7 +12003,8 @@ } } /* Test on infinite numbers. */ - x = 1.0L / 0.0L; + /* The Microsoft MSVC 14 compiler chokes on the expression 1.0 / 0.0. */ + x = 1.0L / zero; { int exp; long double y = frexpl (x, &exp); @@ -11486,28 +12090,6 @@ -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 - -cat >>confdefs.h <<_ACEOF -#define pid_t int -_ACEOF - -fi - -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 - case "$host_os" in @@ -11771,6 +12353,9 @@ # include #endif + +$gl_mda_defines + int main () { @@ -11852,8 +12437,10 @@ GNULIB_FSTAT=0; GNULIB_FSTATAT=0; GNULIB_FUTIMENS=0; + GNULIB_GETUMASK=0; GNULIB_LCHMOD=0; GNULIB_LSTAT=0; + GNULIB_MKDIR=0; GNULIB_MKDIRAT=0; GNULIB_MKFIFO=0; GNULIB_MKFIFOAT=0; @@ -11862,9 +12449,13 @@ GNULIB_STAT=0; GNULIB_UTIMENSAT=0; GNULIB_OVERRIDES_STRUCT_STAT=0; + GNULIB_MDA_CHMOD=1; + GNULIB_MDA_MKDIR=1; + GNULIB_MDA_UMASK=1; HAVE_FCHMODAT=1; HAVE_FSTATAT=1; HAVE_FUTIMENS=1; + HAVE_GETUMASK=1; HAVE_LCHMOD=1; HAVE_LSTAT=1; HAVE_MKDIRAT=1; @@ -11880,7 +12471,9 @@ REPLACE_LSTAT=0; REPLACE_MKDIR=0; REPLACE_MKFIFO=0; + REPLACE_MKFIFOAT=0; REPLACE_MKNOD=0; + REPLACE_MKNODAT=0; REPLACE_STAT=0; REPLACE_UTIMENSAT=0; @@ -12042,6 +12635,25 @@ + + + case "$host_os" in + mingw*) + for ac_header in sdkddkver.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sdkddkver.h" "ac_cv_header_sdkddkver_h" "$ac_includes_default" +if test "x$ac_cv_header_sdkddkver_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SDKDDKVER_H 1 +_ACEOF + +fi + +done + + ;; + esac + ac_fn_c_check_decl "$LINENO" "ftello" "ac_cv_have_decl_ftello" "$ac_includes_default" if test "x$ac_cv_have_decl_ftello" = xyes; then : ac_have_decl=1 @@ -12210,6 +12822,19 @@ +ac_fn_c_check_decl "$LINENO" "getdtablesize" "ac_cv_have_decl_getdtablesize" "$ac_includes_default" +if test "x$ac_cv_have_decl_getdtablesize" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETDTABLESIZE $ac_have_decl +_ACEOF + + + @@ -12820,30 +13445,6 @@ - if test -z "$gl_anythreadlib_early_done"; then - case "$host_os" in - osf*) - # On OSF/1, the compiler needs the flag -D_REENTRANT so that it - # groks . cc also understands the flag -pthread, but - # we don't use it because 1. gcc-2.95 doesn't understand -pthread, - # 2. putting a flag into CPPFLAGS that has an effect on the linker - # causes the AC_LINK_IFELSE test below to succeed unexpectedly, - # leading to wrong values of LIBTHREAD and LTLIBTHREAD. - CPPFLAGS="$CPPFLAGS -D_REENTRANT" - ;; - esac - # Some systems optimize for single-threaded programs by default, and - # need special flags to disable these optimizations. For example, the - # definition of 'errno' in . - case "$host_os" in - aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;; - solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;; - esac - gl_anythreadlib_early_done=done - fi - - - if test -z "$gl_pthreadlib_body_done"; then @@ -13881,7 +14482,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_elf" >&5 $as_echo "$gl_cv_elf" >&6; } - if test $gl_cv_elf; then + if test $gl_cv_elf = yes; then # Extract the ELF class of a file (5th byte) in decimal. # Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header if od -A x < /dev/null >/dev/null 2>/dev/null; then @@ -13898,19 +14499,22 @@ echo } fi + # Use 'expr', not 'test', to compare the values of func_elfclass, because on + # Solaris 11 OpenIndiana and Solaris 11 OmniOS, the result is 001 or 002, + # not 1 or 2. case $HOST_CPU_C_ABI_32BIT in yes) # 32-bit ABI. acl_is_expected_elfclass () { - test "`func_elfclass | sed -e 's/[ ]//g'`" = 1 + expr "`func_elfclass | sed -e 's/[ ]//g'`" = 1 > /dev/null } ;; no) # 64-bit ABI. acl_is_expected_elfclass () { - test "`func_elfclass | sed -e 's/[ ]//g'`" = 2 + expr "`func_elfclass | sed -e 's/[ ]//g'`" = 2 > /dev/null } ;; *) @@ -14438,7 +15042,14 @@ fi ;; -l*) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + dep=`echo "X$dep" | sed -e 's/^X-l//'` + if test "X$dep" != Xc \ + || case $host_os in + linux* | gnu* | k*bsd*-gnu) false ;; + *) true ;; + esac; then + names_next_round="$names_next_round $dep" + fi ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` @@ -14634,8 +15245,9 @@ main () { int result = 0; - /* Test against AIX 5.1 bug: Failures are not distinguishable from successful - returns. */ + /* Test against AIX 5.1...7.2 bug: Failures are not distinguishable from + successful returns. This is even documented in + */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) @@ -14783,13 +15395,12 @@ if test "$am_cv_func_iconv" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5 -$as_echo_n "checking for iconv declaration... " >&6; } - if ${am_cv_proto_iconv+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iconv is compatible with its POSIX signature" >&5 +$as_echo_n "checking whether iconv is compatible with its POSIX signature... " >&6; } +if ${gl_cv_iconv_nonconst+:} 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 @@ -14798,11 +15409,7 @@ #ifdef __cplusplus "C" #endif -#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); -#else -size_t iconv(); -#endif int main () @@ -14813,35 +15420,129 @@ } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - am_cv_proto_iconv_arg1="" + gl_cv_iconv_nonconst=yes else - am_cv_proto_iconv_arg1="const" + gl_cv_iconv_nonconst=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" -fi - am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: - $am_cv_proto_iconv" >&5 -$as_echo " - $am_cv_proto_iconv" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_iconv_nonconst" >&5 +$as_echo "$gl_cv_iconv_nonconst" >&6; } else - am_cv_proto_iconv_arg1="" + gl_cv_iconv_nonconst=yes + fi + if test $gl_cv_iconv_nonconst = yes; then + iconv_arg1="" + else + iconv_arg1="const" fi cat >>confdefs.h <<_ACEOF -#define ICONV_CONST $am_cv_proto_iconv_arg1 +#define ICONV_CONST $iconv_arg1 _ACEOF - if test -n "$am_cv_proto_iconv_arg1"; then + if test $gl_cv_iconv_nonconst != yes; then ICONV_CONST="const" fi + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv4 sockets" >&5 +$as_echo_n "checking for IPv4 sockets... " >&6; } +if ${gl_cv_socket_ipv4+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_WINSOCK2_H +#include +#endif +int +main () +{ +int x = AF_INET; struct in_addr y; struct sockaddr_in z; + if (&x && &y && &z) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_socket_ipv4=yes +else + gl_cv_socket_ipv4=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv4" >&5 +$as_echo "$gl_cv_socket_ipv4" >&6; } + if test $gl_cv_socket_ipv4 = yes; then + +$as_echo "#define HAVE_IPV4 1" >>confdefs.h + + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPv6 sockets" >&5 +$as_echo_n "checking for IPv6 sockets... " >&6; } +if ${gl_cv_socket_ipv6+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_WINSOCK2_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#endif +int +main () +{ +int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z; + if (&x && &y && &z) return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_socket_ipv6=yes +else + gl_cv_socket_ipv6=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv6" >&5 +$as_echo "$gl_cv_socket_ipv6" >&6; } + if test $gl_cv_socket_ipv6 = yes; then + +$as_echo "#define HAVE_IPV6 1" >>confdefs.h + + fi + 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 : @@ -14990,14 +15691,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 @@ -15022,23 +15715,13 @@ $as_echo "#define HAVE_WINT_T 1" >>confdefs.h - { $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 "$as_me:${as_lineno-$LINENO}: checking whether wint_t is large enough" >&5 +$as_echo_n "checking whether wint_t is large enough... " >&6; } +if ${gl_cv_type_wint_t_large_enough+:} 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 -#endif #include int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1]; @@ -15051,15 +15734,15 @@ } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_type_wint_t_too_small=no + gl_cv_type_wint_t_large_enough=yes else - gl_cv_type_wint_t_too_small=yes + gl_cv_type_wint_t_large_enough=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_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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wint_t_large_enough" >&5 +$as_echo "$gl_cv_type_wint_t_large_enough" >&6; } + if test $gl_cv_type_wint_t_large_enough = no; then GNULIB_OVERRIDES_WINT_T=1 else GNULIB_OVERRIDES_WINT_T=0 @@ -15074,40 +15757,51 @@ - gl_cv_c_multiarch=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler produces multi-arch binaries" >&5 +$as_echo_n "checking whether the compiler produces multi-arch binaries... " >&6; } +if ${gl_cv_c_multiarch+:} false; then : + $as_echo_n "(cached) " >&6 +else + gl_cv_c_multiarch=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ - not a universal capable compiler - #endif - typedef int dummy; + not a universal capable compiler + #endif + typedef int dummy; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - arch= - prev= - for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do - if test -n "$prev"; then - case $word in - i?86 | x86_64 | ppc | ppc64) - if test -z "$arch" || test "$arch" = "$word"; then - arch="$word" - else - gl_cv_c_multiarch=yes - fi - ;; - esac - prev= - else - if test "x$word" = "x-arch"; then - prev=arch - fi - fi - done + arch= + prev= + for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do + if test -n "$prev"; then + case $word in + i?86 | x86_64 | ppc | ppc64 | arm | arm64) + if test -z "$arch" || test "$arch" = "$word"; then + arch="$word" + else + gl_cv_c_multiarch=yes + fi + ;; + esac + prev= + else + if test "x$word" = "x-arch"; then + prev=arch + fi + fi + done fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_multiarch" >&5 +$as_echo "$gl_cv_c_multiarch" >&6; } if test $gl_cv_c_multiarch = yes; then APPLE_UNIVERSAL_BUILD=1 else @@ -15135,14 +15829,16 @@ fi - if test $ac_cv_header_inttypes_h = yes; then + + if test $ac_cv_header_inttypes_h = yes; then HAVE_INTTYPES_H=1 else HAVE_INTTYPES_H=0 fi - if test $ac_cv_header_sys_types_h = yes; then + + if test $ac_cv_header_sys_types_h = yes; then HAVE_SYS_TYPES_H=1 else HAVE_SYS_TYPES_H=0 @@ -15255,13 +15951,9 @@ #endif - /* BSD/OS 4.0.1 has a bug: , and must be - included before . */ #include #include #if HAVE_WCHAR_H - # include - # include # include #endif @@ -15341,7 +16033,7 @@ /* 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__ \ +#elif (2 <= __GNUC__ || 4 <= __clang_major__ || defined __IBM__TYPEOF__ \ || (0x5110 <= __SUNPRO_C && !__STDC__)) extern size_t k; extern __typeof__ (SIZE_MAX) k; @@ -15435,13 +16127,9 @@ #include - /* BSD/OS 4.0.1 has a bug: , and must be - included before . */ #include #include #if HAVE_WCHAR_H - # include - # include # include #endif @@ -15525,12 +16213,12 @@ case "$gl_cv_header_working_stdint_h" in *yes) 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 "$as_me:${as_lineno-$LINENO}: checking whether stdint.h works without ISO C predefines" >&5 +$as_echo_n "checking whether stdint.h works without ISO C predefines... " >&6; } +if ${gl_cv_header_stdint_without_STDC_macros+:} false; then : $as_echo_n "(cached) " >&6 else - gl_cv_header_stdint_predates_cxx11_h=yes + gl_cv_header_stdint_without_STDC_macros=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -15539,13 +16227,9 @@ #include - /* BSD/OS 4.0.1 has a bug: , and must be - included before . */ #include #include #if HAVE_WCHAR_H - # include - # include # include #endif @@ -15562,14 +16246,15 @@ } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - gl_cv_header_stdint_predates_cxx11_h=no + gl_cv_header_stdint_without_STDC_macros=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_predates_cxx11_h" >&5 -$as_echo "$gl_cv_header_stdint_predates_cxx11_h" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_without_STDC_macros" >&5 +$as_echo "$gl_cv_header_stdint_without_STDC_macros" >&6; } - if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then + if test $gl_cv_header_stdint_without_STDC_macros = no; then $as_echo "#define __STDC_CONSTANT_MACROS 1" >>confdefs.h @@ -15593,13 +16278,9 @@ #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 @@ -15656,13 +16337,9 @@ $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " - /* BSD/OS 4.0.1 has a bug: , and must be - included before . */ #include #include #if HAVE_WCHAR_H - # include - # include # include #endif @@ -15701,13 +16378,9 @@ $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result" " - /* BSD/OS 4.0.1 has a bug: , and must be - included before . */ #include #include #if HAVE_WCHAR_H - # include - # include # include #endif @@ -15747,13 +16420,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - /* BSD/OS 4.0.1 has a bug: , and must be - included before . */ #include #include #if HAVE_WCHAR_H - # include - # include # include #endif @@ -15824,13 +16493,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - /* BSD/OS 4.0.1 has a bug: , and must be - included before . */ #include #include #if HAVE_WCHAR_H - # include - # include # include #endif @@ -15896,13 +16561,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - /* BSD/OS 4.0.1 has a bug: , and must be - included before . */ #include #include #if HAVE_WCHAR_H - # include - # include # include #endif @@ -15973,8 +16634,6 @@ - - GNULIB_IMAXABS=0; GNULIB_IMAXDIV=0; GNULIB_STRTOIMAX=0; @@ -15988,7 +16647,6 @@ REPLACE_STRTOUMAX=0; INT32_MAX_LT_INTMAX_MAX=1; INT64_MAX_EQ_LONG_MAX='defined _LP64'; - PRI_MACROS_BROKEN=0; PRIPTR_PREFIX=__PRIPTR_PREFIX; UINT32_MAX_LT_UINTMAX_MAX=1; UINT64_MAX_EQ_ULONG_MAX='defined _LP64'; @@ -16086,65 +16744,6 @@ - for ac_header in inttypes.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" -if test "x$ac_cv_header_inttypes_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_INTTYPES_H 1 -_ACEOF - -fi - -done - - if test $ac_cv_header_inttypes_h = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the inttypes.h PRIxNN macros are broken" >&5 -$as_echo_n "checking whether the inttypes.h PRIxNN macros are broken... " >&6; } -if ${gt_cv_inttypes_pri_broken+:} false; then : - $as_echo_n "(cached) " >&6 -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#ifdef PRId32 -char *p = PRId32; -#endif - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - gt_cv_inttypes_pri_broken=no -else - gt_cv_inttypes_pri_broken=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_inttypes_pri_broken" >&5 -$as_echo "$gt_cv_inttypes_pri_broken" >&6; } - fi - if test "$gt_cv_inttypes_pri_broken" = yes; then - -cat >>confdefs.h <<_ACEOF -#define PRI_MACROS_BROKEN 1 -_ACEOF - - PRI_MACROS_BROKEN=1 - else - PRI_MACROS_BROKEN=0 - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5 @@ -16765,13 +17364,6 @@ 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; } @@ -16828,14 +17420,7 @@ 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 + ac_fn_c_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "#include #if HAVE_WCTYPE_H # include #endif @@ -16871,14 +17456,7 @@ 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 #if HAVE_WCTYPE_H # include #endif @@ -16913,14 +17491,7 @@ 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 #include wctrans_t a; @@ -17547,6 +18118,13 @@ + GNULIB_NL_LANGINFO=0; + HAVE_NL_LANGINFO=1; + REPLACE_NL_LANGINFO=0; + + + + GNULIB_LOCALECONV=0; GNULIB_SETLOCALE=0; GNULIB_SETLOCALE_NULL=0; @@ -17603,6 +18181,9 @@ + + + STDDEF_H= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for good max_align_t" >&5 @@ -17614,10 +18195,17 @@ /* end confdefs.h. */ #include unsigned int s = sizeof (max_align_t); - #if defined __GNUC__ || defined __IBM__ALIGNOF__ + #if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__ int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1]; int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1]; #endif + typedef struct { char a; max_align_t b; } max_helper; + typedef struct { char a; long b; } long_helper; + typedef struct { char a; double b; } double_helper; + typedef struct { char a; long double b; } long_double_helper; + int check3[2 * (offsetof (long_helper, b) <= offsetof (max_helper, b)) - 1]; + int check4[2 * (offsetof (double_helper, b) <= offsetof (max_helper, b)) - 1]; + int check5[2 * (offsetof (long_double_helper, b) <= offsetof (max_helper, b)) - 1]; int main () @@ -17816,56 +18404,85 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LC_MESSAGES" >&5 +$as_echo_n "checking for LC_MESSAGES... " >&6; } +if ${gt_cv_val_LC_MESSAGES+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +return LC_MESSAGES + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gt_cv_val_LC_MESSAGES=yes +else + gt_cv_val_LC_MESSAGES=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: $gt_cv_val_LC_MESSAGES" >&5 +$as_echo "$gt_cv_val_LC_MESSAGES" >&6; } + if test $gt_cv_val_LC_MESSAGES = yes; then + +$as_echo "#define HAVE_LC_MESSAGES 1" >>confdefs.h + + fi + + + - LOG_LIBM="$POW_LIBM" - save_LIBS="$LIBS" - LIBS="$LIBS $LOG_LIBM" + if test $ac_cv_func_uselocale = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether log works" >&5 -$as_echo_n "checking whether log works... " >&6; } -if ${gl_cv_func_log_works+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether uselocale works" >&5 +$as_echo_n "checking whether uselocale works... " >&6; } +if ${gt_cv_func_uselocale_works+:} false; then : $as_echo_n "(cached) " >&6 else - - if test "$cross_compiling" = yes; then : - case "$host_os" in - osf*) gl_cv_func_log_works="guessing no" ;; - # Guess yes on native Windows. - mingw*) gl_cv_func_log_works="guessing yes" ;; - *) gl_cv_func_log_works="guessing yes" ;; - esac + if test "$cross_compiling" = yes; then : + # Guess no on AIX and z/OS, yes otherwise. + case "$host_os" in + aix* | openedition*) gt_cv_func_uselocale_works="guessing no" ;; + *) gt_cv_func_uselocale_works="guessing yes" ;; + esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -volatile double x; -double y; +#include +#if HAVE_XLOCALE_H +# include +#endif +locale_t loc1; int main () { - x = -0.0; - y = log (x); - if (!(y + y == y)) - return 1; + uselocale (NULL); + setlocale (LC_ALL, "en_US.UTF-8"); return 0; } - _ACEOF if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_log_works=yes + gt_cv_func_uselocale_works=yes else - gl_cv_func_log_works=no + gt_cv_func_uselocale_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -17873,390 +18490,1585 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_log_works" >&5 -$as_echo "$gl_cv_func_log_works" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_uselocale_works" >&5 +$as_echo "$gt_cv_func_uselocale_works" >&6; } + else + gt_cv_func_uselocale_works=no + fi + case "$gt_cv_func_uselocale_works" in + *yes) - LIBS="$save_LIBS" - case "$gl_cv_func_log_works" in - *yes) ;; - *) REPLACE_LOG=1 ;; +$as_echo "#define HAVE_WORKING_USELOCALE 1" >>confdefs.h + + ;; esac + case "$gt_cv_func_uselocale_works" in + *yes) -{ $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 "$as_me:${as_lineno-$LINENO}: checking for fake locale system (OpenBSD)" >&5 +$as_echo_n "checking for fake locale system (OpenBSD)... " >&6; } +if ${gt_cv_locale_fake+:} 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 - 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 + if test "$cross_compiling" = yes; then : + case "$host_os" in + openbsd*) gt_cv_locale_fake="guessing yes" ;; + *) gt_cv_locale_fake="guessing no" ;; + 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 + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#if HAVE_XLOCALE_H +# include +#endif +int main () +{ + locale_t loc1, loc2; + if (setlocale (LC_ALL, "de_DE.UTF-8") == NULL) return 1; + if (setlocale (LC_ALL, "fr_FR.UTF-8") == NULL) return 1; + loc1 = newlocale (LC_ALL_MASK, "de_DE.UTF-8", (locale_t)0); + loc2 = newlocale (LC_ALL_MASK, "fr_FR.UTF-8", (locale_t)0); + return !(loc1 == loc2); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gt_cv_locale_fake=yes +else + gt_cv_locale_fake=no +fi +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: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed - - - 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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fake" >&5 +$as_echo "$gt_cv_locale_fake" >&6; } + ;; + *) gt_cv_locale_fake=no ;; + esac + case "$gt_cv_locale_fake" in + *yes) -done +$as_echo "#define HAVE_FAKE_LOCALES 1" >>confdefs.h - { $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 : + ;; + esac + + case "$gt_cv_func_uselocale_works" in + *yes) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Solaris 11.4 locale system" >&5 +$as_echo_n "checking for Solaris 11.4 locale system... " >&6; } +if ${gt_cv_locale_solaris114+:} 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* | gnu* | *-musl* | freebsd* | netbsd* | openbsd* \ - | hpux* | solaris* | cygwin* | mingw*) - ac_cv_func_malloc_0_nonnull="guessing yes" ;; - # If we don't know, obey --enable-cross-guesses. - *) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;; - esac - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + solaris*) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#if defined STDC_HEADERS || defined HAVE_STDLIB_H - # include - #else - char *malloc (); - #endif + + #include + struct _LC_locale_t *x; + locale_t y; int main () { -char *p = malloc (0); - int result = !p; - free (p); - return result; +*y = x; ; return 0; } - _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_malloc_0_nonnull=yes +if ac_fn_c_try_compile "$LINENO"; then : + gt_cv_locale_solaris114=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 + gt_cv_locale_solaris114=no fi - +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + *) gt_cv_locale_solaris114=no ;; + esac 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; } - case "$ac_cv_func_malloc_0_nonnull" in - *yes) - gl_cv_func_malloc_0_nonnull=1 - ;; - *) - gl_cv_func_malloc_0_nonnull=0 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_solaris114" >&5 +$as_echo "$gt_cv_locale_solaris114" >&6; } ;; + *) gt_cv_locale_solaris114=no ;; esac + if test $gt_cv_locale_solaris114 = yes; then +$as_echo "#define HAVE_SOLARIS114_LOCALES 1" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull + fi + + case "$gt_cv_func_uselocale_works" in + *yes) + for ac_func in getlocalename_l +do : + ac_fn_c_check_func "$LINENO" "getlocalename_l" "ac_cv_func_getlocalename_l" +if test "x$ac_cv_func_getlocalename_l" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_GETLOCALENAME_L 1 _ACEOF +fi +done + + ;; + esac + gt_nameless_locales=no + case "$host_os" in + aix*) + gt_nameless_locales=yes +$as_echo "#define HAVE_NAMELESS_LOCALES 1" >>confdefs.h + ;; + esac - { $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 CFPreferencesCopyAppValue" >&5 +$as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; } +if ${gt_cv_func_CFPreferencesCopyAppValue+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + 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; +CFPreferencesCopyAppValue(NULL, NULL) ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_type_mbstate_t=yes +if ac_fn_c_try_link "$LINENO"; then : + gt_cv_func_CFPreferencesCopyAppValue=yes else - ac_cv_type_mbstate_t=no + gt_cv_func_CFPreferencesCopyAppValue=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 + LIBS="$gt_save_LIBS" 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 "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5 +$as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } + if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then -$as_echo "#define HAVE_MBSTATE_T 1" >>confdefs.h +$as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h - else + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyPreferredLanguages" >&5 +$as_echo_n "checking for CFLocaleCopyPreferredLanguages... " >&6; } +if ${gt_cv_func_CFLocaleCopyPreferredLanguages+:} false; then : + $as_echo_n "(cached) " >&6 +else + gt_save_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +CFLocaleCopyPreferredLanguages(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gt_cv_func_CFLocaleCopyPreferredLanguages=yes +else + gt_cv_func_CFLocaleCopyPreferredLanguages=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$gt_save_LIBS" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyPreferredLanguages" >&5 +$as_echo "$gt_cv_func_CFLocaleCopyPreferredLanguages" >&6; } + if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then -$as_echo "#define mbstate_t int" >>confdefs.h +$as_echo "#define HAVE_CFLOCALECOPYPREFERREDLANGUAGES 1" >>confdefs.h - fi + fi + INTL_MACOSX_LIBS= + if test $gt_cv_func_CFPreferencesCopyAppValue = yes \ + || test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then + INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" + 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; - GNULIB_WCSFTIME=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_WCSFTIME=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; - REPLACE_WCSFTIME=0; - REPLACE_WCSTOK=0; - GNULIB_EXPLICIT_BZERO=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_EXPLICIT_BZERO=1; - 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_STRCHRNUL=0; - REPLACE_STRDUP=0; - REPLACE_STRNCAT=0; - REPLACE_STRNDUP=0; - REPLACE_STRNLEN=0; - REPLACE_STRSTR=0; - REPLACE_STRCASESTR=0; - REPLACE_STRTOK_R=0; - REPLACE_STRERROR=0; - REPLACE_STRERROR_R=0; - REPLACE_STRSIGNAL=0; - UNDEFINE_STRTOK_R=0; + gl_threads_api=none + LIBTHREAD= + LTLIBTHREAD= + LIBMULTITHREAD= + LTLIBMULTITHREAD= + if test "$gl_use_threads" != no; then + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5 +$as_echo_n "checking whether imported symbols can be declared weak... " >&6; } +if ${gl_cv_have_weak+:} false; then : + $as_echo_n "(cached) " >&6 +else + gl_cv_have_weak=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern void xyzzy (); +#pragma weak xyzzy +int +main () +{ +xyzzy(); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_have_weak=maybe +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test $gl_cv_have_weak = maybe; then + if test "$cross_compiling" = yes; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __ELF__ + Extensible Linking Format + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Extensible Linking Format" >/dev/null 2>&1; then : + gl_cv_have_weak="guessing yes" +else + gl_cv_have_weak="guessing no" +fi +rm -f conftest* + + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#pragma weak fputs +int main () +{ + return (fputs == NULL); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_have_weak=yes +else + gl_cv_have_weak=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 + case " $LDFLAGS " in + *" -static "*) gl_cv_have_weak=no ;; + esac + case "$gl_cv_have_weak" in + *yes) + case "$host_os" in + freebsd* | dragonfly*) + : > conftest1.c + $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1 + cat < conftest2.c +#include +#pragma weak pthread_mutexattr_gettype +int main () +{ + return (pthread_mutexattr_gettype != NULL); +} +EOF + $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \ + || gl_cv_have_weak=no + rm -f conftest1.c libempty.so conftest2.c conftest + ;; + esac + ;; + esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5 +$as_echo "$gl_cv_have_weak" >&6; } + case "$gl_cv_have_weak" in + *yes) + +$as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h + + ;; + esac + + if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then + + : + fi + if test "$gl_use_threads" = isoc || test "$gl_use_threads" = isoc+posix; then + + gl_have_isoc_threads="$ac_cv_header_threads_h" + fi + if test "$gl_use_threads" = yes \ + || test "$gl_use_threads" = posix \ + || test "$gl_use_threads" = isoc+posix; then + + + if test -z "$gl_pthreadlib_body_done"; then + gl_pthread_api=no + LIBPTHREAD= + LIBPMULTITHREAD= + # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that + # it groks . It's added above, in gl_ANYTHREADLIB_EARLY. + ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" +if test "x$ac_cv_header_pthread_h" = xyes; then : + gl_have_pthread_h=yes +else + gl_have_pthread_h=no +fi + + + if test "$gl_have_pthread_h" = yes; then + # Other possible tests: + # -lpthreads (FSU threads, PCthreads) + # -lgthreads + # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist + # in libc. IRIX 6.5 has the first one in both libc and libpthread, but + # the second one only in libpthread, and lock.c needs it. + # + # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04 + # needs -pthread for some reason. See: + # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html + save_LIBS=$LIBS + for gl_pthread in '' '-pthread'; do + LIBS="$LIBS $gl_pthread" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + pthread_mutex_t m; + pthread_mutexattr_t ma; + +int +main () +{ +pthread_mutex_lock (&m); + pthread_mutexattr_init (&ma); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_pthread_api=yes + LIBPTHREAD=$gl_pthread + LIBPMULTITHREAD=$gl_pthread +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS=$save_LIBS + test $gl_pthread_api = yes && break + done + + # Test for libpthread by looking for pthread_kill. (Not pthread_self, + # since it is defined as a macro on OSF/1.) + if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then + # The program links fine without libpthread. But it may actually + # need to link with libpthread in order to create multiple threads. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 +$as_echo_n "checking for pthread_kill in -lpthread... " >&6; } +if ${ac_cv_lib_pthread_pthread_kill+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_kill (); +int +main () +{ +return pthread_kill (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pthread_pthread_kill=yes +else + ac_cv_lib_pthread_pthread_kill=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } +if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then : + LIBPMULTITHREAD=-lpthread + # On Solaris and HP-UX, most pthread functions exist also in libc. + # Therefore pthread_in_use() needs to actually try to create a + # thread: pthread_create from libc will fail, whereas + # pthread_create will actually create a thread. + # On Solaris 10 or newer, this test is no longer needed, because + # libc contains the fully functional pthread functions. + case "$host_os" in + solaris | solaris2.1-9 | solaris2.1-9.* | hpux*) + +$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h + + esac + +fi + + elif test $gl_pthread_api != yes; then + # Some library is needed. Try libpthread and libc_r. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 +$as_echo_n "checking for pthread_kill in -lpthread... " >&6; } +if ${ac_cv_lib_pthread_pthread_kill+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_kill (); +int +main () +{ +return pthread_kill (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pthread_pthread_kill=yes +else + ac_cv_lib_pthread_pthread_kill=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } +if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then : + gl_pthread_api=yes + LIBPTHREAD=-lpthread + LIBPMULTITHREAD=-lpthread +fi + + if test $gl_pthread_api != yes; then + # For FreeBSD 4. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5 +$as_echo_n "checking for pthread_kill in -lc_r... " >&6; } +if ${ac_cv_lib_c_r_pthread_kill+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc_r $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_kill (); +int +main () +{ +return pthread_kill (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_c_r_pthread_kill=yes +else + ac_cv_lib_c_r_pthread_kill=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5 +$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; } +if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then : + gl_pthread_api=yes + LIBPTHREAD=-lc_r + LIBPMULTITHREAD=-lc_r +fi + + fi + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5 +$as_echo_n "checking whether POSIX threads API is available... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5 +$as_echo "$gl_pthread_api" >&6; } + + + if test $gl_pthread_api = yes; then + +$as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h + + fi + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +sched_yield (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + LIB_SCHED_YIELD= + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5 +$as_echo_n "checking for sched_yield in -lrt... " >&6; } +if ${ac_cv_lib_rt_sched_yield+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lrt $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sched_yield (); +int +main () +{ +return sched_yield (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_rt_sched_yield=yes +else + ac_cv_lib_rt_sched_yield=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5 +$as_echo "$ac_cv_lib_rt_sched_yield" >&6; } +if test "x$ac_cv_lib_rt_sched_yield" = xyes; then : + LIB_SCHED_YIELD=-lrt +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5 +$as_echo_n "checking for sched_yield in -lposix4... " >&6; } +if ${ac_cv_lib_posix4_sched_yield+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lposix4 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sched_yield (); +int +main () +{ +return sched_yield (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_posix4_sched_yield=yes +else + ac_cv_lib_posix4_sched_yield=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5 +$as_echo "$ac_cv_lib_posix4_sched_yield" >&6; } +if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then : + LIB_SCHED_YIELD=-lposix4 +fi + +fi + + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + + gl_pthreadlib_body_done=done + fi + + LIBTHREAD=$LIBPTHREAD LTLIBTHREAD=$LIBPTHREAD + LIBMULTITHREAD=$LIBPMULTITHREAD LTLIBMULTITHREAD=$LIBPMULTITHREAD + if test $gl_pthread_api = yes; then + if test "$gl_use_threads" = isoc+posix && test "$gl_have_isoc_threads" = yes; then + gl_threads_api='isoc+posix' + +$as_echo "#define USE_ISOC_AND_POSIX_THREADS 1" >>confdefs.h + + LIBTHREAD= LTLIBTHREAD= + else + gl_threads_api=posix + +$as_echo "#define USE_POSIX_THREADS 1" >>confdefs.h + + if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then + if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then + +$as_echo "#define USE_POSIX_THREADS_WEAK 1" >>confdefs.h + + LIBTHREAD= LTLIBTHREAD= + else + case "$host_os" in + freebsd* | dragonfly*) + if test "x$LIBTHREAD" != "x$LIBMULTITHREAD"; then + +$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h + + fi + ;; + esac + fi + fi + fi + fi + fi + if test $gl_threads_api = none; then + if test "$gl_use_threads" = isoc && test "$gl_have_isoc_threads" = yes; then + + + + if test -z "$gl_stdthreadlib_body_done"; then + + + case "$host_os" in + mingw*) + LIBSTDTHREAD= + ;; + *) + + + if test -z "$gl_pthreadlib_body_done"; then + gl_pthread_api=no + LIBPTHREAD= + LIBPMULTITHREAD= + # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that + # it groks . It's added above, in gl_ANYTHREADLIB_EARLY. + ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" +if test "x$ac_cv_header_pthread_h" = xyes; then : + gl_have_pthread_h=yes +else + gl_have_pthread_h=no +fi + + + if test "$gl_have_pthread_h" = yes; then + # Other possible tests: + # -lpthreads (FSU threads, PCthreads) + # -lgthreads + # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist + # in libc. IRIX 6.5 has the first one in both libc and libpthread, but + # the second one only in libpthread, and lock.c needs it. + # + # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04 + # needs -pthread for some reason. See: + # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html + save_LIBS=$LIBS + for gl_pthread in '' '-pthread'; do + LIBS="$LIBS $gl_pthread" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + pthread_mutex_t m; + pthread_mutexattr_t ma; + +int +main () +{ +pthread_mutex_lock (&m); + pthread_mutexattr_init (&ma); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_pthread_api=yes + LIBPTHREAD=$gl_pthread + LIBPMULTITHREAD=$gl_pthread +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS=$save_LIBS + test $gl_pthread_api = yes && break + done + + # Test for libpthread by looking for pthread_kill. (Not pthread_self, + # since it is defined as a macro on OSF/1.) + if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then + # The program links fine without libpthread. But it may actually + # need to link with libpthread in order to create multiple threads. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 +$as_echo_n "checking for pthread_kill in -lpthread... " >&6; } +if ${ac_cv_lib_pthread_pthread_kill+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_kill (); +int +main () +{ +return pthread_kill (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pthread_pthread_kill=yes +else + ac_cv_lib_pthread_pthread_kill=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } +if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then : + LIBPMULTITHREAD=-lpthread + # On Solaris and HP-UX, most pthread functions exist also in libc. + # Therefore pthread_in_use() needs to actually try to create a + # thread: pthread_create from libc will fail, whereas + # pthread_create will actually create a thread. + # On Solaris 10 or newer, this test is no longer needed, because + # libc contains the fully functional pthread functions. + case "$host_os" in + solaris | solaris2.1-9 | solaris2.1-9.* | hpux*) + +$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h + + esac + +fi + + elif test $gl_pthread_api != yes; then + # Some library is needed. Try libpthread and libc_r. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5 +$as_echo_n "checking for pthread_kill in -lpthread... " >&6; } +if ${ac_cv_lib_pthread_pthread_kill+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_kill (); +int +main () +{ +return pthread_kill (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_pthread_pthread_kill=yes +else + ac_cv_lib_pthread_pthread_kill=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5 +$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; } +if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then : + gl_pthread_api=yes + LIBPTHREAD=-lpthread + LIBPMULTITHREAD=-lpthread +fi + + if test $gl_pthread_api != yes; then + # For FreeBSD 4. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5 +$as_echo_n "checking for pthread_kill in -lc_r... " >&6; } +if ${ac_cv_lib_c_r_pthread_kill+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc_r $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_kill (); +int +main () +{ +return pthread_kill (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_c_r_pthread_kill=yes +else + ac_cv_lib_c_r_pthread_kill=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5 +$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; } +if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then : + gl_pthread_api=yes + LIBPTHREAD=-lc_r + LIBPMULTITHREAD=-lc_r +fi + + fi + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5 +$as_echo_n "checking whether POSIX threads API is available... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5 +$as_echo "$gl_pthread_api" >&6; } + + + if test $gl_pthread_api = yes; then + +$as_echo "#define HAVE_PTHREAD_API 1" >>confdefs.h + + fi + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +sched_yield (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + LIB_SCHED_YIELD= + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5 +$as_echo_n "checking for sched_yield in -lrt... " >&6; } +if ${ac_cv_lib_rt_sched_yield+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lrt $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sched_yield (); +int +main () +{ +return sched_yield (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_rt_sched_yield=yes +else + ac_cv_lib_rt_sched_yield=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5 +$as_echo "$ac_cv_lib_rt_sched_yield" >&6; } +if test "x$ac_cv_lib_rt_sched_yield" = xyes; then : + LIB_SCHED_YIELD=-lrt +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5 +$as_echo_n "checking for sched_yield in -lposix4... " >&6; } +if ${ac_cv_lib_posix4_sched_yield+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lposix4 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sched_yield (); +int +main () +{ +return sched_yield (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_posix4_sched_yield=yes +else + ac_cv_lib_posix4_sched_yield=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5 +$as_echo "$ac_cv_lib_posix4_sched_yield" >&6; } +if test "x$ac_cv_lib_posix4_sched_yield" = xyes; then : + LIB_SCHED_YIELD=-lposix4 +fi + +fi + + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + + gl_pthreadlib_body_done=done + fi + + if test $ac_cv_header_threads_h = yes; then + for ac_func in thrd_create +do : + ac_fn_c_check_func "$LINENO" "thrd_create" "ac_cv_func_thrd_create" +if test "x$ac_cv_func_thrd_create" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_THRD_CREATE 1 +_ACEOF + +fi +done + + if test $ac_cv_func_thrd_create = yes; then + LIBSTDTHREAD= + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thrd_create in -lstdthreads" >&5 +$as_echo_n "checking for thrd_create in -lstdthreads... " >&6; } +if ${ac_cv_lib_stdthreads_thrd_create+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lstdthreads $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char thrd_create (); +int +main () +{ +return thrd_create (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_stdthreads_thrd_create=yes +else + ac_cv_lib_stdthreads_thrd_create=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_stdthreads_thrd_create" >&5 +$as_echo "$ac_cv_lib_stdthreads_thrd_create" >&6; } +if test "x$ac_cv_lib_stdthreads_thrd_create" = xyes; then : + + LIBSTDTHREAD='-lstdthreads -lpthread' + +else + + LIBSTDTHREAD="$LIBPMULTITHREAD" + +fi + + fi + else + LIBSTDTHREAD="$LIBPMULTITHREAD $LIB_SCHED_YIELD" + fi + ;; + esac + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ISO C threads API is available" >&5 +$as_echo_n "checking whether ISO C threads API is available... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_threads_h" >&5 +$as_echo "$ac_cv_header_threads_h" >&6; } + gl_stdthreadlib_body_done=done + fi + + LIBTHREAD=$LIBSTDTHREAD LTLIBTHREAD=$LIBSTDTHREAD + LIBMULTITHREAD=$LIBSTDTHREAD LTLIBMULTITHREAD=$LIBSTDTHREAD + gl_threads_api=isoc + +$as_echo "#define USE_ISOC_THREADS 1" >>confdefs.h + + fi + fi + if test $gl_threads_api = none; then + case "$gl_use_threads" in + yes | windows | win32) # The 'win32' is for backward compatibility. + if { case "$host_os" in + mingw*) true;; + *) false;; + esac + }; then + gl_threads_api=windows + +$as_echo "#define USE_WINDOWS_THREADS 1" >>confdefs.h + + fi + ;; + esac + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for multithread API to use" >&5 +$as_echo_n "checking for multithread API to use... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_threads_api" >&5 +$as_echo "$gl_threads_api" >&6; } + + + + + + + + + + + + + + + + + LOG_LIBM="$POW_LIBM" + + + + + save_LIBS="$LIBS" + LIBS="$LIBS $LOG_LIBM" + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether log works" >&5 +$as_echo_n "checking whether log works... " >&6; } +if ${gl_cv_func_log_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + case "$host_os" in + osf*) gl_cv_func_log_works="guessing no" ;; + # Guess yes on native Windows. + mingw*) gl_cv_func_log_works="guessing yes" ;; + *) gl_cv_func_log_works="guessing yes" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +volatile double x; +double y; +int main () +{ + x = -0.0; + y = log (x); + if (!(y + y == y)) + return 1; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_log_works=yes +else + gl_cv_func_log_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_log_works" >&5 +$as_echo "$gl_cv_func_log_works" >&6; } + + LIBS="$save_LIBS" + case "$gl_cv_func_log_works" in + *yes) ;; + *) REPLACE_LOG=1 ;; + esac + + + +{ $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 + 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 + +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}: 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* | gnu* | *-musl* | freebsd* | netbsd* | openbsd* \ + | hpux* | solaris* | cygwin* | mingw*) + ac_cv_func_malloc_0_nonnull="guessing yes" ;; + # If we don't know, obey --enable-cross-guesses. + *) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +char *p = malloc (0); + int result = !p; + free (p); + return result; + ; + 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 + + +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; } + case "$ac_cv_func_malloc_0_nonnull" in + *yes) + gl_cv_func_malloc_0_nonnull=1 + ;; + *) + gl_cv_func_malloc_0_nonnull=0 + ;; + esac + + +cat >>confdefs.h <<_ACEOF +#define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull +_ACEOF + + + + + + + { $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 + #include +int +main () +{ +mbstate_t x; return sizeof x; + ; + 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 + +$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_WMEMPCPY=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; + GNULIB_WCSFTIME=0; + GNULIB_MDA_WCSDUP=1; + 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_WMEMPCPY=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_WCSFTIME=1; + HAVE_DECL_WCTOB=1; + HAVE_DECL_WCSDUP=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; + REPLACE_WCSFTIME=0; + REPLACE_WCSTOK=0; + + + + + + + GNULIB_EXPLICIT_BZERO=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_STRERRORNAME_NP=0; + GNULIB_SIGABBREV_NP=0; + GNULIB_SIGDESCR_NP=0; + GNULIB_STRSIGNAL=0; + GNULIB_STRVERSCMP=0; + HAVE_MBSLEN=0; + GNULIB_MDA_MEMCCPY=1; + GNULIB_MDA_STRDUP=1; + HAVE_EXPLICIT_BZERO=1; + HAVE_FFSL=1; + HAVE_FFSLL=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_STRERRORNAME_NP=1; + HAVE_SIGABBREV_NP=1; + HAVE_SIGDESCR_NP=1; + HAVE_DECL_STRSIGNAL=1; + HAVE_STRVERSCMP=1; + REPLACE_FFSLL=0; + REPLACE_MEMCHR=0; + REPLACE_MEMMEM=0; + REPLACE_STPNCPY=0; + REPLACE_STRCHRNUL=0; + REPLACE_STRDUP=0; + REPLACE_STRNCAT=0; + REPLACE_STRNDUP=0; + REPLACE_STRNLEN=0; + REPLACE_STRSTR=0; + REPLACE_STRCASESTR=0; + REPLACE_STRTOK_R=0; + REPLACE_STRERROR=0; + REPLACE_STRERROR_R=0; + REPLACE_STRERRORNAME_NP=0; + REPLACE_STRSIGNAL=0; + UNDEFINE_STRTOK_R=0; @@ -18333,31 +20145,29 @@ - - if test $HAVE_MEMCHR = 1; then - # Detect platform-specific bugs in some versions of glibc: - # memchr should not dereference anything with length 0 - # https://bugzilla.redhat.com/show_bug.cgi?id=499689 - # memchr should not dereference overestimated length after a match - # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737 - # https://sourceware.org/bugzilla/show_bug.cgi?id=10162 - # memchr should cast the second argument to 'unsigned char'. - # This bug exists in Android 4.3. - # Assume that memchr works on platforms that lack mprotect. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memchr works" >&5 + # Detect platform-specific bugs in some versions of glibc: + # memchr should not dereference anything with length 0 + # https://bugzilla.redhat.com/show_bug.cgi?id=499689 + # memchr should not dereference overestimated length after a match + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737 + # https://sourceware.org/bugzilla/show_bug.cgi?id=10162 + # memchr should cast the second argument to 'unsigned char'. + # This bug exists in Android 4.3. + # 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 : case "$host_os" in - # Guess no on Android. - linux*-android*) gl_cv_func_memchr_works="guessing no" ;; - # Guess yes on native Windows. - mingw*) gl_cv_func_memchr_works="guessing yes" ;; - # If we don't know, obey --enable-cross-guesses. - *) gl_cv_func_memchr_works="$gl_cross_guess_normal" ;; - esac + # Guess no on Android. + linux*-android*) gl_cv_func_memchr_works="guessing no" ;; + # Guess yes on native Windows. + mingw*) gl_cv_func_memchr_works="guessing yes" ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_memchr_works="$gl_cross_guess_normal" ;; + esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18401,6 +20211,7 @@ #endif if (fence) { + /* Test against bugs on glibc systems. */ if (memchr (fence, 0, 0)) result |= 1; strcpy (fence - 9, "12345678"); @@ -18408,6 +20219,9 @@ result |= 2; if (memchr (fence - 1, 0, 3) != fence - 1) result |= 4; + /* Test against bug on AIX 7.2. */ + if (memchr (fence - 4, '6', 16) != fence - 4) + result |= 8; } /* Test against bug on Android 4.3. */ { @@ -18416,7 +20230,7 @@ input[1] = 'b'; input[2] = 'c'; if (memchr (input, 0x789abc00 | 'b', 3) != input + 1) - result |= 8; + result |= 16; } return result; @@ -18437,11 +20251,10 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memchr_works" >&5 $as_echo "$gl_cv_func_memchr_works" >&6; } - case "$gl_cv_func_memchr_works" in - *yes) ;; - *) REPLACE_MEMCHR=1 ;; - esac - fi + case "$gl_cv_func_memchr_works" in + *yes) ;; + *) REPLACE_MEMCHR=1 ;; + esac @@ -18731,43 +20544,223 @@ - if test $ac_cv_func__set_invalid_parameter_handler = yes; then - HAVE_MSVC_INVALID_PARAMETER_HANDLER=1 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for O_CLOEXEC" >&5 +$as_echo_n "checking for O_CLOEXEC... " >&6; } +if ${gl_cv_macro_O_CLOEXEC+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #ifndef O_CLOEXEC + choke me; + #endif + +int +main () +{ +return O_CLOEXEC; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_macro_O_CLOEXEC=yes +else + gl_cv_macro_O_CLOEXEC=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_macro_O_CLOEXEC" >&5 +$as_echo "$gl_cv_macro_O_CLOEXEC" >&6; } + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for promoted mode_t type" >&5 +$as_echo_n "checking for promoted mode_t type... " >&6; } +if ${gl_cv_promoted_mode_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1]; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_promoted_mode_t='int' +else + gl_cv_promoted_mode_t='mode_t' +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_promoted_mode_t" >&5 +$as_echo "$gl_cv_promoted_mode_t" >&6; } + +cat >>confdefs.h <<_ACEOF +#define PROMOTED_MODE_T $gl_cv_promoted_mode_t +_ACEOF + + + + + + + + +ac_fn_c_check_decl "$LINENO" "initstate" "ac_cv_have_decl_initstate" "$ac_includes_default" +if test "x$ac_cv_have_decl_initstate" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_INITSTATE $ac_have_decl +_ACEOF + +ac_fn_c_check_decl "$LINENO" "setstate" "ac_cv_have_decl_setstate" "$ac_includes_default" +if test "x$ac_cv_have_decl_setstate" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SETSTATE $ac_have_decl +_ACEOF + -$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 whether snprintf returns a byte count as in C99" >&5 +$as_echo_n "checking whether snprintf returns a byte count as in C99... " >&6; } +if ${gl_cv_func_snprintf_retval_c99+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + case "$host_os" in + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on musl systems. + *-musl*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_snprintf_retval_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";; + darwin*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on OpenBSD >= 3.9. + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) + gl_cv_func_snprintf_retval_c99="guessing no";; + openbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on Solaris >= 2.10. + solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";; + solaris*) gl_cv_func_printf_sizes_c99="guessing no";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_snprintf_retval_c99="guessing no";; + aix*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_snprintf_retval_c99="guessing no";; + netbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on Android. + linux*-android*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on MSVC, no on mingw. + mingw*) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef _MSC_VER + Known +#endif -ac_fn_c_check_decl "$LINENO" "initstate" "ac_cv_have_decl_initstate" "$ac_includes_default" -if test "x$ac_cv_have_decl_initstate" = xyes; then : - ac_have_decl=1 +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Known" >/dev/null 2>&1; then : + gl_cv_func_snprintf_retval_c99="guessing yes" else - ac_have_decl=0 + gl_cv_func_snprintf_retval_c99="guessing no" fi +rm -f conftest* -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_INITSTATE $ac_have_decl + ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_snprintf_retval_c99="$gl_cross_guess_normal";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +static char buf[100]; +int main () +{ + strcpy (buf, "ABCDEF"); + if (my_snprintf (buf, 3, "%d %d", 4567, 89) != 7) + return 1; + if (my_snprintf (buf, 0, "%d %d", 4567, 89) != 7) + return 2; + if (my_snprintf (NULL, 0, "%d %d", 4567, 89) != 7) + return 3; + return 0; +} _ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_snprintf_retval_c99=yes +else + gl_cv_func_snprintf_retval_c99=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi -ac_fn_c_check_decl "$LINENO" "setstate" "ac_cv_have_decl_setstate" "$ac_includes_default" -if test "x$ac_cv_have_decl_setstate" = xyes; then : + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_retval_c99" >&5 +$as_echo "$gl_cv_func_snprintf_retval_c99" >&6; } + +ac_fn_c_check_decl "$LINENO" "snprintf" "ac_cv_have_decl_snprintf" "$ac_includes_default" +if test "x$ac_cv_have_decl_snprintf" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_SETSTATE $ac_have_decl +#define HAVE_DECL_SNPRINTF $ac_have_decl _ACEOF @@ -18867,6 +20860,67 @@ fi +ac_fn_c_check_decl "$LINENO" "fcloseall" "ac_cv_have_decl_fcloseall" "$ac_includes_default" +if test "x$ac_cv_have_decl_fcloseall" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FCLOSEALL $ac_have_decl +_ACEOF + +ac_fn_c_check_decl "$LINENO" "ecvt" "ac_cv_have_decl_ecvt" "$ac_includes_default" +if test "x$ac_cv_have_decl_ecvt" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ECVT $ac_have_decl +_ACEOF + +ac_fn_c_check_decl "$LINENO" "fcvt" "ac_cv_have_decl_fcvt" "$ac_includes_default" +if test "x$ac_cv_have_decl_fcvt" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FCVT $ac_have_decl +_ACEOF + +ac_fn_c_check_decl "$LINENO" "gcvt" "ac_cv_have_decl_gcvt" "$ac_includes_default" +if test "x$ac_cv_have_decl_gcvt" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GCVT $ac_have_decl +_ACEOF + + + GNULIB_FFS=0; + HAVE_FFS=1; + HAVE_STRCASECMP=1; + HAVE_DECL_STRNCASECMP=1; + +ac_fn_c_check_decl "$LINENO" "strdup" "ac_cv_have_decl_strdup" "$ac_includes_default" +if test "x$ac_cv_have_decl_strdup" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRDUP $ac_have_decl +_ACEOF + REPLACE_STRERROR_0=0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror(0) succeeds" >&5 @@ -19011,6 +21065,100 @@ + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_strings_h='<'strings.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_strings_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_strings_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 'strings.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_strings_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_strings_h + gl_cv_next_strings_h='"'$gl_header'"' + else + gl_cv_next_strings_h='<'strings.h'>' + fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_strings_h" >&5 +$as_echo "$gl_cv_next_strings_h" >&6; } + fi + NEXT_STRINGS_H=$gl_cv_next_strings_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='<'strings.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_strings_h + fi + NEXT_AS_FIRST_DIRECTIVE_STRINGS_H=$gl_next_as_first_directive + + + + + if test $ac_cv_header_strings_h = yes; then + HAVE_STRINGS_H=1 + else + HAVE_STRINGS_H=0 + 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 @@ -19037,6 +21185,8 @@ + + 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 @@ -19053,6 +21203,11 @@ + GNULIB_WAITPID=0; + + + + GNULIB_CTIME=0; GNULIB_MKTIME=0; GNULIB_LOCALTIME=0; @@ -19060,14 +21215,16 @@ GNULIB_STRFTIME=0; GNULIB_STRPTIME=0; GNULIB_TIMEGM=0; + GNULIB_TIMESPEC_GET=0; GNULIB_TIME_R=0; GNULIB_TIME_RZ=0; GNULIB_TZSET=0; + GNULIB_MDA_TZSET=1; HAVE_DECL_LOCALTIME_R=1; HAVE_NANOSLEEP=1; HAVE_STRPTIME=1; HAVE_TIMEGM=1; - HAVE_TZSET=1; + HAVE_TIMESPEC_GET=1; HAVE_TIMEZONE_T=0; REPLACE_CTIME=GNULIB_PORTCHECK; REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; @@ -19290,6 +21447,50 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIME_UTC in " >&5 +$as_echo_n "checking for TIME_UTC in ... " >&6; } +if ${gl_cv_time_h_has_TIME_UTC+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +static int x = TIME_UTC; x++; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_time_h_has_TIME_UTC=yes +else + gl_cv_time_h_has_TIME_UTC=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_h_has_TIME_UTC" >&5 +$as_echo "$gl_cv_time_h_has_TIME_UTC" >&6; } + if test $gl_cv_time_h_has_TIME_UTC = yes; then + TIME_H_DEFINES_TIME_UTC=1 + else + TIME_H_DEFINES_TIME_UTC=0 + fi + + +ac_fn_c_check_decl "$LINENO" "execvpe" "ac_cv_have_decl_execvpe" "$ac_includes_default" +if test "x$ac_cv_have_decl_execvpe" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_EXECVPE $ac_have_decl +_ACEOF + @@ -19463,67 +21664,328 @@ _ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether uses 'inline' correctly" >&5 + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inttypes.h" >&5 +$as_echo_n "checking for inttypes.h... " >&6; } +if ${gl_cv_header_inttypes_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main () +{ +uintmax_t i = (uintmax_t) -1; return !i; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_inttypes_h=yes +else + gl_cv_header_inttypes_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_inttypes_h" >&5 +$as_echo "$gl_cv_header_inttypes_h" >&6; } + if test $gl_cv_header_inttypes_h = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_INTTYPES_H_WITH_UINTMAX 1 +_ACEOF + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint.h" >&5 +$as_echo_n "checking for stdint.h... " >&6; } +if ${gl_cv_header_stdint_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include +int +main () +{ +uintmax_t i = (uintmax_t) -1; return !i; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_stdint_h=yes +else + gl_cv_header_stdint_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_h" >&5 +$as_echo "$gl_cv_header_stdint_h" >&6; } + if test $gl_cv_header_stdint_h = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STDINT_H_WITH_UINTMAX 1 +_ACEOF + + fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for intmax_t" >&5 +$as_echo_n "checking for intmax_t... " >&6; } +if ${gt_cv_c_intmax_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_STDINT_H_WITH_UINTMAX +#include +#endif +#if HAVE_INTTYPES_H_WITH_UINTMAX +#include +#endif + +int +main () +{ +intmax_t x = -1; return !x; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gt_cv_c_intmax_t=yes +else + gt_cv_c_intmax_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_intmax_t" >&5 +$as_echo "$gt_cv_c_intmax_t" >&6; } + if test $gt_cv_c_intmax_t = yes; then + +$as_echo "#define HAVE_INTMAX_T 1" >>confdefs.h + + else + +cat >>confdefs.h <<_ACEOF +#define intmax_t long long +_ACEOF + + fi + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf truncates the result as in C99" >&5 +$as_echo_n "checking whether snprintf truncates the result as in C99... " >&6; } +if ${gl_cv_func_snprintf_truncation_c99+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on musl systems. + *-musl*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_snprintf_truncation_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_snprintf_truncation_c99="guessing no";; + darwin*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on OpenBSD >= 3.9. + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) + gl_cv_func_snprintf_truncation_c99="guessing no";; + openbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on Solaris >= 2.6. + solaris2.[0-5] | solaris2.[0-5].*) + gl_cv_func_snprintf_truncation_c99="guessing no";; + solaris*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_snprintf_truncation_c99="guessing no";; + aix*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on HP-UX >= 11. + hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";; + hpux*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on IRIX >= 6.5. + irix6.5) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on OSF/1 >= 5. + osf[3-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";; + osf*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_snprintf_truncation_c99="guessing no";; + netbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on Android. + linux*-android*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess no on native Windows. + mingw*) gl_cv_func_snprintf_truncation_c99="guessing no";; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_snprintf_truncation_c99="$gl_cross_guess_normal";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +static char buf[100]; +int main () +{ + strcpy (buf, "ABCDEF"); + my_snprintf (buf, 3, "%d %d", 4567, 89); + if (memcmp (buf, "45\0DEF", 6) != 0) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_snprintf_truncation_c99=yes +else + gl_cv_func_snprintf_truncation_c99=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_snprintf_truncation_c99" >&5 +$as_echo "$gl_cv_func_snprintf_truncation_c99" >&6; } + + + + + + for ac_func in snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb +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 + + ac_fn_c_check_decl "$LINENO" "_snprintf" "ac_cv_have_decl__snprintf" "#include +" +if test "x$ac_cv_have_decl__snprintf" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL__SNPRINTF $ac_have_decl +_ACEOF + + + + case "$gl_cv_func_snprintf_retval_c99" in + *yes) + +$as_echo "#define HAVE_SNPRINTF_RETVAL_C99 1" >>confdefs.h + + ;; + esac + + case "$gl_cv_func_snprintf_truncation_c99" in + *yes) + +$as_echo "#define HAVE_SNPRINTF_TRUNCATION_C99 1" >>confdefs.h + + ;; + esac + + + + { $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 + case "$host_os" in + *-gnu* | gnu*) + 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(); } + + #define wcstod renamed_wcstod + #include + extern int zero (void); + int main () { return zero(); } _ACEOF - save_ac_compile="$ac_compile" - ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/` - if echo '#include "conftest.c"' >conftest1.c && - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + save_ac_compile="$ac_compile" + ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/` + if echo '#include "conftest.c"' >conftest1.c \ + && { { 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 + 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; } + + #define wcstod renamed_wcstod + #include + int zero (void) { return 0; } _ACEOF - ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/` - if echo '#include "conftest.c"' >conftest2.c && - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/` + if echo '#include "conftest.c"' >conftest2.c \ + && { { 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 + 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 - fi - fi - ac_compile="$save_ac_compile" - rm -f conftest12.c conftest12.$ac_objext conftest$ac_exeext + ac_compile="$save_ac_compile" + rm -f conftest12.c conftest12.$ac_objext conftest$ac_exeext + ;; + esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5 @@ -19543,17 +22005,6 @@ - - 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='#' @@ -19619,24 +22070,134 @@ else ALLOCA_H= fi - else - ALLOCA_H=alloca.h + 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 + + + if test $ac_cv_working_alloca_h = yes; then + HAVE_ALLOCA_H=1 + else + HAVE_ALLOCA_H=0 + fi + + + + + + + if test $ac_cv_header_arpa_inet_h = yes; then + HAVE_ARPA_INET_H=1 + else + HAVE_ARPA_INET_H=0 + fi + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_arpa_inet_h='<'arpa/inet.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_arpa_inet_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_arpa_inet_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 'arpa/inet.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_arpa_inet_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_arpa_inet_h + gl_cv_next_arpa_inet_h='"'$gl_header'"' + else + gl_cv_next_arpa_inet_h='<'arpa/inet.h'>' + fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_arpa_inet_h" >&5 +$as_echo "$gl_cv_next_arpa_inet_h" >&6; } + fi + NEXT_ARPA_INET_H=$gl_cv_next_arpa_inet_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='<'arpa/inet.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_arpa_inet_h + fi + NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H=$gl_next_as_first_directive + + + + + + + + + + if test $ac_cv_header_sys_socket_h = yes; then + HAVE_WS2TCPIP_H=0 + else + if test $ac_cv_header_ws2tcpip_h = yes; then + HAVE_WS2TCPIP_H=1 + else + HAVE_WS2TCPIP_H=0 + fi 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 - if test $ac_cv_working_alloca_h = yes; then - HAVE_ALLOCA_H=1 - else - HAVE_ALLOCA_H=0 - fi + + + @@ -19702,18 +22263,13 @@ 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* | gnu*) ac_cv_func_calloc_0_nonnull="guessing yes" ;; - # Guess yes on musl systems. - *-musl*) ac_cv_func_calloc_0_nonnull="guessing yes" ;; - # Guess yes on native Windows. - mingw*) ac_cv_func_calloc_0_nonnull="guessing yes" ;; - # If we don't know, obey --enable-cross-guesses. - *) ac_cv_func_calloc_0_nonnull="$gl_cross_guess_normal" ;; - esac - + if test $cross_compiling != yes; then + ac_cv_func_calloc_0_nonnull=yes + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19722,22 +22278,18 @@ 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; + char * volatile p = calloc (0, 0); + if (!p) + result |= 1; + free (p); + return result; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_calloc_0_nonnull=yes + else ac_cv_func_calloc_0_nonnull=no fi @@ -19745,6 +22297,59 @@ conftest.$ac_objext conftest.beam conftest.$ac_ext fi + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +int result; + typedef struct { char c[8]; } S8; + size_t n = (size_t) -1 / sizeof (S8) + 2; + S8 * volatile s = calloc (n, sizeof (S8)); + if (s) + { + s[0].c[0] = 1; + if (s[n - 1].c[0]) + result = 0; + else + result = 2; + } + else + result = 3; + free (s); + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + 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 + + else + case "$host_os" in + # Guess yes on glibc systems. + *-gnu* | gnu*) ac_cv_func_calloc_0_nonnull="guessing yes" ;; + # Guess yes on musl systems. + *-musl*) ac_cv_func_calloc_0_nonnull="guessing yes" ;; + # Guess yes on native Windows. + mingw*) ac_cv_func_calloc_0_nonnull="guessing yes" ;; + # If we don't know, obey --enable-cross-guesses. + *) ac_cv_func_calloc_0_nonnull="$gl_cross_guess_normal" ;; + esac + 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; } @@ -19825,9 +22430,10 @@ - saved_as_echo_n="$as_echo_n" - as_echo_n=':' - if ${gl_cv_func_ceil_libm+:} false; then : + + exec 9>&6 6>/dev/null + + if ${gl_cv_func_ceil_libm+:} false; then : $as_echo_n "(cached) " >&6 else @@ -19882,7 +22488,9 @@ fi - as_echo_n="$saved_as_echo_n" + + exec 6>&9 9>&- + CEIL_LIBM="$gl_cv_func_ceil_libm" @@ -19944,9 +22552,10 @@ if test "$ac_cv_have_decl_ceill" = yes; then - saved_as_echo_n="$as_echo_n" - as_echo_n=':' - if ${gl_cv_func_ceill_libm+:} false; then : + + exec 9>&6 6>/dev/null + + if ${gl_cv_func_ceill_libm+:} false; then : $as_echo_n "(cached) " >&6 else @@ -20001,7 +22610,9 @@ fi - as_echo_n="$saved_as_echo_n" + + exec 6>&9 9>&- + CEILL_LIBM="$gl_cv_func_ceill_libm" @@ -20013,21 +22624,20 @@ 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 "$as_me:${as_lineno-$LINENO}: checking whether ceill() works" >&5 +$as_echo_n "checking whether ceill() works... " >&6; } +if ${gl_cv_func_ceill_works+:} false; then : $as_echo_n "(cached) " >&6 else - - save_LIBS="$LIBS" - LIBS="$CEILL_LIBM" - if test "$cross_compiling" = yes; then : + save_LIBS="$LIBS" + LIBS="$CEILL_LIBM" + if test "$cross_compiling" = yes; then : case "$host_os" in - openbsd*) gl_cv_func_ceill_buggy="guessing yes" ;; - # Guess no on native Windows. - mingw*) gl_cv_func_ceill_buggy="guessing no" ;; - *) gl_cv_func_ceill_buggy="guessing no" ;; - esac + openbsd*) gl_cv_func_ceill_works="guessing no" ;; + # Guess yes on native Windows. + mingw*) gl_cv_func_ceill_works="guessing yes" ;; + *) gl_cv_func_ceill_works="guessing yes" ;; + esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -20043,22 +22653,22 @@ } _ACEOF if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_ceill_buggy=no + gl_cv_func_ceill_works=yes else - gl_cv_func_ceill_buggy=yes + gl_cv_func_ceill_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" + 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 ;; +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ceill_works" >&5 +$as_echo "$gl_cv_func_ceill_works" >&6; } + case "$gl_cv_func_ceill_works" in + *yes) ;; + *) REPLACE_CEILL=1 ;; esac fi if test $HAVE_DECL_CEILL = 0 || test $REPLACE_CEILL = 1; then @@ -20100,6 +22710,80 @@ +$as_echo "#define GNULIB_TEST_CLOEXEC 1" >>confdefs.h + + + + + + + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_CLOSE=1 + fi + + + + + + + if test $ac_cv_header_sys_socket_h != yes; then + for ac_header in winsock2.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WINSOCK2_H 1 +_ACEOF + +fi + +done + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then + REPLACE_CLOSE=1 + fi + + + + if test $REPLACE_CLOSE = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS close.$ac_objext" + + fi + + + + + + GNULIB_CLOSE=1 + + + + + +$as_echo "#define GNULIB_TEST_CLOSE 1" >>confdefs.h + + + + + cat >>confdefs.h <<_ACEOF #define GNULIB_CLOSE_STREAM 1 _ACEOF @@ -20140,12 +22824,6 @@ fi - if test "xMD5" = xMD5; then - ALG_header=md5.h - else - ALG_header=sha.h - fi - if test "x$with_openssl" != xno; then if test "x$with_openssl" = xauto-gpl-compat; then @@ -20219,13 +22897,12 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_MD5" >&5 $as_echo "$ac_cv_lib_crypto_MD5" >&6; } if test "x$ac_cv_lib_crypto_MD5" = xyes; then : - for ac_header in openssl/$ALG_header + for ac_header in openssl/md5.h do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + ac_fn_c_check_header_mongrel "$LINENO" "openssl/md5.h" "ac_cv_header_openssl_md5_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_md5_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_OPENSSL_MD5_H 1 _ACEOF LIB_CRYPTO=-lcrypto @@ -20270,12 +22947,6 @@ fi - if test "xSHA1" = xMD5; then - ALG_header=md5.h - else - ALG_header=sha.h - fi - if test "x$with_openssl" != xno; then if test "x$with_openssl" = xauto-gpl-compat; then @@ -20349,13 +23020,12 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA1" >&5 $as_echo "$ac_cv_lib_crypto_SHA1" >&6; } if test "x$ac_cv_lib_crypto_SHA1" = xyes; then : - for ac_header in openssl/$ALG_header + for ac_header in openssl/sha.h do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + ac_fn_c_check_header_mongrel "$LINENO" "openssl/sha.h" "ac_cv_header_openssl_sha_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_sha_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_OPENSSL_SHA_H 1 _ACEOF LIB_CRYPTO=-lcrypto @@ -20400,12 +23070,6 @@ fi - if test "xSHA256" = xMD5; then - ALG_header=md5.h - else - ALG_header=sha.h - fi - if test "x$with_openssl" != xno; then if test "x$with_openssl" = xauto-gpl-compat; then @@ -20479,13 +23143,12 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA256" >&5 $as_echo "$ac_cv_lib_crypto_SHA256" >&6; } if test "x$ac_cv_lib_crypto_SHA256" = xyes; then : - for ac_header in openssl/$ALG_header + for ac_header in openssl/sha.h do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + ac_fn_c_check_header_mongrel "$LINENO" "openssl/sha.h" "ac_cv_header_openssl_sha_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_sha_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_OPENSSL_SHA_H 1 _ACEOF LIB_CRYPTO=-lcrypto @@ -20530,12 +23193,6 @@ fi - if test "xSHA512" = xMD5; then - ALG_header=md5.h - else - ALG_header=sha.h - fi - if test "x$with_openssl" != xno; then if test "x$with_openssl" = xauto-gpl-compat; then @@ -20609,13 +23266,12 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_SHA512" >&5 $as_echo "$ac_cv_lib_crypto_SHA512" >&6; } if test "x$ac_cv_lib_crypto_SHA512" = xyes; then : - for ac_header in openssl/$ALG_header + for ac_header in openssl/sha.h do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + ac_fn_c_check_header_mongrel "$LINENO" "openssl/sha.h" "ac_cv_header_openssl_sha_h" "$ac_includes_default" +if test "x$ac_cv_header_openssl_sha_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_OPENSSL_SHA_H 1 _ACEOF LIB_CRYPTO=-lcrypto @@ -20720,9 +23376,6 @@ - - - cat >>confdefs.h <<_ACEOF #define GNULIB_DIRNAME 1 _ACEOF @@ -20730,10 +23383,6 @@ - - - - { $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 : @@ -20773,6 +23422,160 @@ + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup2 works" >&5 +$as_echo_n "checking whether dup2 works... " >&6; } +if ${gl_cv_func_dup2_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + case "$host_os" in + mingw*) # on this platform, dup2 always returns 0 for success + gl_cv_func_dup2_works="guessing no" ;; + cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0 + gl_cv_func_dup2_works="guessing no" ;; + aix* | freebsd*) + # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE, + # not EBADF. + gl_cv_func_dup2_works="guessing no" ;; + haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC. + gl_cv_func_dup2_works="guessing no" ;; + *-android*) # implemented using dup3(), which fails if oldfd == newfd + gl_cv_func_dup2_works="guessing no" ;; + os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd. + gl_cv_func_dup2_works="guessing no" ;; + *) gl_cv_func_dup2_works="guessing yes" ;; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #include + #include + #include + #include + + +$gl_mda_defines + + #ifndef RLIM_SAVED_CUR + # define RLIM_SAVED_CUR RLIM_INFINITY + #endif + #ifndef RLIM_SAVED_MAX + # define RLIM_SAVED_MAX RLIM_INFINITY + #endif + +int +main () +{ +int result = 0; + int bad_fd = INT_MAX; + struct rlimit rlim; + if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 + && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX + && rlim.rlim_cur != RLIM_INFINITY + && rlim.rlim_cur != RLIM_SAVED_MAX + && rlim.rlim_cur != RLIM_SAVED_CUR) + bad_fd = rlim.rlim_cur; + #ifdef FD_CLOEXEC + if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1) + result |= 1; + #endif + if (dup2 (1, 1) != 1) + result |= 2; + #ifdef FD_CLOEXEC + if (fcntl (1, F_GETFD) != FD_CLOEXEC) + result |= 4; + #endif + close (0); + if (dup2 (0, 0) != -1) + result |= 8; + /* Many gnulib modules require POSIX conformance of EBADF. */ + if (dup2 (2, bad_fd) == -1 && errno != EBADF) + result |= 16; + /* Flush out some cygwin core dumps. */ + if (dup2 (2, -1) != -1 || errno != EBADF) + result |= 32; + dup2 (2, 255); + dup2 (2, 256); + /* On OS/2 kLIBC, dup2() does not work on a directory fd. */ + { + int fd = open (".", O_RDONLY); + if (fd == -1) + result |= 64; + else if (dup2 (fd, fd + 1) == -1) + result |= 128; + close (fd); + } + return result; + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_dup2_works=yes +else + gl_cv_func_dup2_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_dup2_works" >&5 +$as_echo "$gl_cv_func_dup2_works" >&6; } + case "$gl_cv_func_dup2_works" in + *yes) ;; + *) + REPLACE_DUP2=1 + for ac_func in setdtablesize +do : + ac_fn_c_check_func "$LINENO" "setdtablesize" "ac_cv_func_setdtablesize" +if test "x$ac_cv_func_setdtablesize" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SETDTABLESIZE 1 +_ACEOF + +fi +done + + ;; + esac + + + if test $REPLACE_DUP2 = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS dup2.$ac_objext" + + + fi + + + + + + GNULIB_DUP2=1 + + + + + +$as_echo "#define GNULIB_TEST_DUP2 1" >>confdefs.h + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5 $as_echo_n "checking for error_at_line... " >&6; } if ${ac_cv_lib_error_at_line+:} false; then : @@ -20916,62 +23719,6 @@ EXPL_LIBM=-lm fi fi - if test $gl_cv_func_expl_no_libm = yes \ - || test $gl_cv_func_expl_in_libm = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether expl() breaks with small values" >&5 -$as_echo_n "checking whether expl() breaks with small values... " >&6; } -if ${gl_cv_func_expl_buggy+:} false; then : - $as_echo_n "(cached) " >&6 -else - save_LIBS="$LIBS" - LIBS="$EXPL_LIBM" - if test "$cross_compiling" = yes; then : - case $host_os in - haiku* | openbsd*) - gl_cv_func_expl_buggy="guessing yes" ;; - # Guess no on native Windows. - mingw*) gl_cv_func_expl_buggy="guessing no" ;; - *) gl_cv_func_expl_buggy="guessing no" ;; - esac - -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -volatile long double x1 = -1.0; - volatile long double x2 = -0.8; - volatile long double x3 = -0.4; - return expl(x1) == 0.0 || isnan(expl(x1)) - || isnan(expl(x2)) || isnan(expl(x3)); - - ; - return 0; -} - -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_expl_buggy=no -else - gl_cv_func_expl_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 - - LIBS="$save_LIBS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_expl_buggy" >&5 -$as_echo "$gl_cv_func_expl_buggy" >&6; } - case "$gl_cv_func_expl_buggy" in - *yes) - gl_cv_func_expl_in_libm=no - gl_cv_func_expl_no_libm=no ;; - esac - fi if test $gl_cv_func_expl_no_libm = yes \ || test $gl_cv_func_expl_in_libm = yes; then ac_fn_c_check_decl "$LINENO" "expl" "ac_cv_have_decl_expl" "#include @@ -21052,7 +23799,23 @@ { long double (* volatile my_expl) (long double) = argc ? expl : dummy; int result = 0; - /* This test fails on NetBSD 8.0. */ + /* On Haiku 2017 the system's native expl() is just a stub: it returns 0.0 + and prints "__expl not implemented" for all arguments. */ + { + volatile long double x1 = -1.0; + if (expl (x1) == 0.0) + result |= 1; + } + /* On OpenBSD 5.4 the system's native expl() is buggy: + it returns 'nan' for small values. */ + { + volatile long double x1 = -1.0; + volatile long double x2 = -0.8; + volatile long double x3 = -0.4; + if (isnan (expl (x1)) || isnan (expl (x2)) || isnan (expl (x3))) + result |= 2; + } + /* This test fails on NetBSD 9.0. */ { const long double TWO_LDBL_MANT_DIG = /* 2^LDBL_MANT_DIG */ (long double) (1U << ((LDBL_MANT_DIG - 1) / 5)) @@ -21063,7 +23826,7 @@ long double x = 11.358L; long double err = (my_expl (x) * my_expl (- x) - 1.0L) * TWO_LDBL_MANT_DIG; if (!(err >= -100.0L && err <= 100.0L)) - result |= 1; + result |= 4; } return result; } @@ -21460,6 +24223,307 @@ + + if test $ac_cv_func_fcntl = no; then + + + + if test $ac_cv_func_fcntl = no; then + HAVE_FCNTL=0 + else + REPLACE_FCNTL=1 + fi + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl handles F_DUPFD correctly" >&5 +$as_echo_n "checking whether fcntl handles F_DUPFD correctly... " >&6; } +if ${gl_cv_func_fcntl_f_dupfd_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + case $host_os in + aix* | cygwin* | haiku*) + gl_cv_func_fcntl_f_dupfd_works="guessing no" ;; + *) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include + #include + #include + + +$gl_mda_defines + + #ifndef RLIM_SAVED_CUR + # define RLIM_SAVED_CUR RLIM_INFINITY + #endif + #ifndef RLIM_SAVED_MAX + # define RLIM_SAVED_MAX RLIM_INFINITY + #endif + +int +main () +{ +int result = 0; + int bad_fd = INT_MAX; + struct rlimit rlim; + if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 + && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX + && rlim.rlim_cur != RLIM_INFINITY + && rlim.rlim_cur != RLIM_SAVED_MAX + && rlim.rlim_cur != RLIM_SAVED_CUR) + bad_fd = rlim.rlim_cur; + if (fcntl (0, F_DUPFD, -1) != -1) result |= 1; + if (errno != EINVAL) result |= 2; + if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4; + if (errno != EINVAL) result |= 8; + /* On OS/2 kLIBC, F_DUPFD does not work on a directory fd */ + { + int fd; + fd = open (".", O_RDONLY); + if (fd == -1) + result |= 16; + else if (fcntl (fd, F_DUPFD, STDERR_FILENO + 1) == -1) + result |= 32; + + close (fd); + } + return result; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_fcntl_f_dupfd_works=yes +else + gl_cv_func_fcntl_f_dupfd_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_fcntl_f_dupfd_works" >&5 +$as_echo "$gl_cv_func_fcntl_f_dupfd_works" >&6; } + case $gl_cv_func_fcntl_f_dupfd_works in + *yes) ;; + *) + + + if test $ac_cv_func_fcntl = no; then + HAVE_FCNTL=0 + else + REPLACE_FCNTL=1 + fi + + +$as_echo "#define FCNTL_DUPFD_BUGGY 1" >>confdefs.h + ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl understands F_DUPFD_CLOEXEC" >&5 +$as_echo_n "checking whether fcntl understands F_DUPFD_CLOEXEC... " >&6; } +if ${gl_cv_func_fcntl_f_dupfd_cloexec+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + case "$host_os" in + # Guess no on NetBSD. + netbsd*) gl_cv_func_fcntl_f_dupfd_cloexec="guessing no" ;; + *) gl_cv_func_fcntl_f_dupfd_cloexec="$gl_cross_guess_normal" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + int main (int argc, char *argv[]) + { + if (argc == 1) + /* parent process */ + { + if (fcntl (1, F_DUPFD_CLOEXEC, 10) < 0) + return 1; + return execl ("./conftest", "./conftest", "child", NULL); + } + else + /* child process */ + return (fcntl (10, F_GETFL) < 0 ? 0 : 42); + } + + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __linux__ +/* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace + it to support the semantics on older kernels that failed with EINVAL. */ +choke me +#endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_func_fcntl_f_dupfd_cloexec=yes +else + gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +else + gl_cv_func_fcntl_f_dupfd_cloexec=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_fcntl_f_dupfd_cloexec" >&5 +$as_echo "$gl_cv_func_fcntl_f_dupfd_cloexec" >&6; } + case "$gl_cv_func_fcntl_f_dupfd_cloexec" in + *yes) ;; + *) + + + if test $ac_cv_func_fcntl = no; then + HAVE_FCNTL=0 + else + REPLACE_FCNTL=1 + fi + + ;; + esac + fi + + + if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS fcntl.$ac_objext" + + fi + + + + + + GNULIB_FCNTL=1 + + + + + +$as_echo "#define GNULIB_TEST_FCNTL 1" >>confdefs.h + + + + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_fcntl_h='<'fcntl.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_fcntl_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 'fcntl.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_fcntl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_fcntl_h + gl_cv_next_fcntl_h='"'$gl_header'"' + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fcntl_h" >&5 +$as_echo "$gl_cv_next_fcntl_h" >&6; } + fi + NEXT_FCNTL_H=$gl_cv_next_fcntl_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='<'fcntl.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_fcntl_h + fi + NEXT_AS_FIRST_DIRECTIVE_FCNTL_H=$gl_next_as_first_directive + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fflush works on input streams" >&5 $as_echo_n "checking whether fflush works on input streams... " >&6; } if ${gl_cv_func_fflush_stdin+:} false; then : @@ -21484,6 +24548,9 @@ # include #endif + +$gl_mda_defines + int main () { @@ -21594,6 +24661,53 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flexible array member" >&5 +$as_echo_n "checking for flexible array member... " >&6; } +if ${ac_cv_c_flexmember+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include + struct m { struct m *next, **list; char name[]; }; + struct s { struct s *p; struct m *m; int n; double d[]; }; +int +main () +{ +int m = getchar (); + size_t nbytes = offsetof (struct s, d) + m * sizeof (double); + nbytes += sizeof (struct s) - 1; + nbytes -= nbytes % sizeof (struct s); + struct s *p = malloc (nbytes); + p->p = p; + p->m = NULL; + p->d[0] = 0.0; + return p->d != (double *) NULL; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_flexmember=yes +else + ac_cv_c_flexmember=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5 +$as_echo "$ac_cv_c_flexmember" >&6; } + if test $ac_cv_c_flexmember = yes; then + +$as_echo "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h + + else + $as_echo "#define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h + + fi + + FLOAT_H= @@ -21940,6 +25054,7 @@ + ac_fn_c_check_decl "$LINENO" "fpurge" "ac_cv_have_decl_fpurge" "#include " if test "x$ac_cv_have_decl_fpurge" = xyes; then : @@ -21977,34 +25092,34 @@ main () { FILE *f = fopen ("conftest.txt", "w+"); - if (!f) - return 1; - if (fputc ('a', f) != 'a') - { fclose (f); return 2; } - rewind (f); - if (fgetc (f) != 'a') - { fclose (f); return 3; } - if (fgetc (f) != EOF) - { fclose (f); return 4; } - if (fpurge (f) != 0) - { fclose (f); return 5; } - if (putc ('b', f) != 'b') - { fclose (f); return 6; } - if (fclose (f) != 0) - return 7; - if ((f = fopen ("conftest.txt", "r")) == NULL) - return 8; - if (fgetc (f) != 'a') - { fclose (f); return 9; } - if (fgetc (f) != 'b') - { fclose (f); return 10; } - if (fgetc (f) != EOF) - { fclose (f); return 11; } - if (fclose (f) != 0) - return 12; - if (remove ("conftest.txt") != 0) - return 13; - return 0; + if (!f) + return 1; + if (fputc ('a', f) != 'a') + { fclose (f); return 2; } + rewind (f); + if (fgetc (f) != 'a') + { fclose (f); return 3; } + if (fgetc (f) != EOF) + { fclose (f); return 4; } + if (fpurge (f) != 0) + { fclose (f); return 5; } + if (putc ('b', f) != 'b') + { fclose (f); return 6; } + if (fclose (f) != 0) + return 7; + if ((f = fopen ("conftest.txt", "r")) == NULL) + return 8; + if (fgetc (f) != 'a') + { fclose (f); return 9; } + if (fgetc (f) != 'b') + { fclose (f); return 10; } + if (fgetc (f) != EOF) + { fclose (f); return 11; } + if (fclose (f) != 0) + return 12; + if (remove ("conftest.txt") != 0) + return 13; + return 0; ; return 0; @@ -22065,6 +25180,7 @@ + if test $gl_func_frexp != yes; then @@ -22233,6 +25349,9 @@ # include #endif + +$gl_mda_defines + int main () { @@ -22401,6 +25520,7 @@ esac + : fi @@ -22653,6 +25773,102 @@ + if test $ac_cv_func_getdtablesize = yes && + test $ac_cv_have_decl_getdtablesize = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getdtablesize works" >&5 +$as_echo_n "checking whether getdtablesize works... " >&6; } +if ${gl_cv_func_getdtablesize_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + case "$host_os" in + vms*) gl_cv_func_getdtablesize_works="no (limitation)" ;; + *) + if test "$cross_compiling" = yes; then : + case "$host_os" in + cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows + gl_cv_func_getdtablesize_works="guessing no" ;; + *) gl_cv_func_getdtablesize_works="guessing yes" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + + +$gl_mda_defines + + +int +main () +{ +int size = getdtablesize(); + if (dup2 (0, getdtablesize()) != -1) + return 1; + if (size != getdtablesize()) + return 2; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_getdtablesize_works=yes +else + gl_cv_func_getdtablesize_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 + + ;; + esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getdtablesize_works" >&5 +$as_echo "$gl_cv_func_getdtablesize_works" >&6; } + case "$gl_cv_func_getdtablesize_works" in + *yes | "no (limitation)") ;; + *) REPLACE_GETDTABLESIZE=1 ;; + esac + else + HAVE_GETDTABLESIZE=0 + fi + + if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS getdtablesize.$ac_objext" + + : + fi + + + + + + GNULIB_GETDTABLESIZE=1 + + + + + +$as_echo "#define GNULIB_TEST_GETDTABLESIZE 1" >>confdefs.h + + + + + + + + @@ -22814,7 +26030,6 @@ - # 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. @@ -22832,6 +26047,7 @@ + GNULIB_ICONV=1 @@ -23031,6 +26247,190 @@ fi + + + + + + HAVE_INET_PTON=1 + INET_PTON_LIB= + + + + + if test $ac_cv_header_sys_socket_h != yes; then + for ac_header in winsock2.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default" +if test "x$ac_cv_header_winsock2_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WINSOCK2_H 1 +_ACEOF + +fi + +done + + fi + if test "$ac_cv_header_winsock2_h" = yes; then + HAVE_WINSOCK2_H=1 + UNISTD_H_HAVE_WINSOCK2_H=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H=1 + else + HAVE_WINSOCK2_H=0 + fi + + + if test $HAVE_WINSOCK2_H = 1; then + REPLACE_INET_PTON=1 + ac_fn_c_check_decl "$LINENO" "inet_pton" "ac_cv_have_decl_inet_pton" "#include +" +if test "x$ac_cv_have_decl_inet_pton" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_INET_PTON $ac_have_decl +_ACEOF + + if test $ac_cv_have_decl_inet_pton = yes; then + INET_PTON_LIB="-lws2_32" + else + HAVE_DECL_INET_PTON=0 + fi + else + gl_save_LIBS=$LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_pton" >&5 +$as_echo_n "checking for library containing inet_pton... " >&6; } +if ${ac_cv_search_inet_pton+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char inet_pton (); +int +main () +{ +return inet_pton (); + ; + return 0; +} +_ACEOF +for ac_lib in '' nsl resolv network; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_inet_pton=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_inet_pton+:} false; then : + break +fi +done +if ${ac_cv_search_inet_pton+:} false; then : + +else + ac_cv_search_inet_pton=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_pton" >&5 +$as_echo "$ac_cv_search_inet_pton" >&6; } +ac_res=$ac_cv_search_inet_pton +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +else + for ac_func in inet_pton +do : + ac_fn_c_check_func "$LINENO" "inet_pton" "ac_cv_func_inet_pton" +if test "x$ac_cv_func_inet_pton" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_INET_PTON 1 +_ACEOF + +fi +done + + if test $ac_cv_func_inet_pton = no; then + HAVE_INET_PTON=0 + fi + +fi + + LIBS=$gl_save_LIBS + + if test "$ac_cv_search_inet_pton" != "no" \ + && test "$ac_cv_search_inet_pton" != "none required"; then + INET_PTON_LIB="$ac_cv_search_inet_pton" + fi + + + ac_fn_c_check_decl "$LINENO" "inet_pton" "ac_cv_have_decl_inet_pton" "#include + #if HAVE_NETDB_H + # include + #endif + +" +if test "x$ac_cv_have_decl_inet_pton" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_INET_PTON $ac_have_decl +_ACEOF + + if test $ac_cv_have_decl_inet_pton = no; then + HAVE_DECL_INET_PTON=0 + fi + fi + + + if test $HAVE_INET_PTON = 0 || test $REPLACE_INET_PTON = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS inet_pton.$ac_objext" + + + + + fi + + + + + + GNULIB_INET_PTON=1 + + + + + + { $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 : @@ -23082,11 +26482,30 @@ - - PRIPTR_PREFIX= if test -n "$STDINT_H"; then - PRIPTR_PREFIX='"l"' + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #ifdef _WIN64 + LLP64 + #endif + +int +main () +{ + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + PRIPTR_PREFIX='"l"' +else + PRIPTR_PREFIX='"ll"' +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else for glpfx in '' l ll I64; do case $glpfx in @@ -23848,7 +27267,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - #if __GNUC__ >= 4 + #if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnand # define isnand(x) __builtin_isnan ((double)(x)) #else @@ -23909,9 +27328,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - #if __GNUC__ >= 4 + #if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnanf - # define isnanf(x) __builtin_isnanf ((float)(x)) + # define isnanf(x) __builtin_isnan ((float)(x)) #elif defined isnan # undef isnanf # define isnanf(x) isnan ((float)(x)) @@ -23976,9 +27395,9 @@ /* end confdefs.h. */ #include -#if __GNUC__ >= 4 +#if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnanf -# define isnanf(x) __builtin_isnanf ((float)(x)) +# define isnanf(x) __builtin_isnan ((float)(x)) #elif defined isnan # undef isnanf # define isnanf(x) isnan ((float)(x)) @@ -24018,7 +27437,7 @@ m.value = NaN (); /* Set the bits below the exponent to 01111...111. */ m.word[0] &= -1U << FLT_EXPBIT0_BIT; - m.word[0] |= 1U << (FLT_EXPBIT0_BIT - 1) - 1; + m.word[0] |= (1U << (FLT_EXPBIT0_BIT - 1)) - 1; if (!isnanf (m.value)) result |= 4; } @@ -24192,9 +27611,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - #if __GNUC__ >= 4 + #if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnanl - # define isnanl(x) __builtin_isnanl ((long double)(x)) + # define isnanl(x) __builtin_isnan ((long double)(x)) #elif defined isnan # undef isnanl # define isnanl(x) isnan ((long double)(x)) @@ -24233,9 +27652,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - #if __GNUC__ >= 4 + #if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnanl - # define isnanl(x) __builtin_isnanl ((long double)(x)) + # define isnanl(x) __builtin_isnan ((long double)(x)) #elif defined isnan # undef isnanl # define isnanl(x) isnan ((long double)(x)) @@ -24310,9 +27729,9 @@ #include #include #include -#if __GNUC__ >= 4 +#if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnanl -# define isnanl(x) __builtin_isnanl ((long double)(x)) +# define isnanl(x) __builtin_isnan ((long double)(x)) #elif defined isnan # undef isnanl # define isnanl(x) isnan ((long double)(x)) @@ -24516,14 +27935,14 @@ memory_long_double; static unsigned int ored_words[NWORDS]; static unsigned int anded_words[NWORDS]; -static void add_to_ored_words (long double x) +static void add_to_ored_words (long double *x) { memory_long_double m; size_t i; /* Clear it first, in case sizeof (long double) < sizeof (memory_long_double). */ memset (&m, 0, sizeof (memory_long_double)); - m.value = x; + m.value = *x; for (i = 0; i < NWORDS; i++) { ored_words[i] |= m.word[i]; @@ -24532,17 +27951,15 @@ } int main () { + static long double samples[5] = { 0.25L, 0.5L, 1.0L, 2.0L, 4.0L }; 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.25L); - add_to_ored_words (0.5L); - add_to_ored_words (1.0L); - add_to_ored_words (2.0L); - add_to_ored_words (4.0L); + for (j = 0; j < 5; j++) + add_to_ored_words (&samples[j]); /* Remove bits that are common (e.g. if representation of the first mantissa bit is explicit). */ for (j = 0; j < NWORDS; j++) @@ -24632,9 +28049,9 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - #if __GNUC__ >= 4 + #if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnanl - # define isnanl(x) __builtin_isnanl ((long double)(x)) + # define isnanl(x) __builtin_isnan ((long double)(x)) #elif defined isnan # undef isnanl # define isnanl(x) isnan ((long double)(x)) @@ -24702,9 +28119,9 @@ #include #include #include -#if __GNUC__ >= 4 +#if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnanl -# define isnanl(x) __builtin_isnanl ((long double)(x)) +# define isnanl(x) __builtin_isnan ((long double)(x)) #elif defined isnan # undef isnanl # define isnanl(x) isnan ((long double)(x)) @@ -24905,14 +28322,14 @@ memory_long_double; static unsigned int ored_words[NWORDS]; static unsigned int anded_words[NWORDS]; -static void add_to_ored_words (long double x) +static void add_to_ored_words (long double *x) { memory_long_double m; size_t i; /* Clear it first, in case sizeof (long double) < sizeof (memory_long_double). */ memset (&m, 0, sizeof (memory_long_double)); - m.value = x; + m.value = *x; for (i = 0; i < NWORDS; i++) { ored_words[i] |= m.word[i]; @@ -24921,17 +28338,15 @@ } int main () { + static long double samples[5] = { 0.25L, 0.5L, 1.0L, 2.0L, 4.0L }; 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.25L); - add_to_ored_words (0.5L); - add_to_ored_words (1.0L); - add_to_ored_words (2.0L); - add_to_ored_words (4.0L); + for (j = 0; j < 5; j++) + add_to_ored_words (&samples[j]); /* Remove bits that are common (e.g. if representation of the first mantissa bit is explicit). */ for (j = 0; j < NWORDS; j++) @@ -25001,15 +28416,8 @@ ac_fn_c_check_decl "$LINENO" "iswblank" "ac_cv_have_decl_iswblank" " -/* 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 + #include + #include " if test "x$ac_cv_have_decl_iswblank" = xyes; then : @@ -25102,13 +28510,6 @@ #include #include #include -/* 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 @@ -25259,13 +28660,6 @@ #include #include #include -/* 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 @@ -25378,6 +28772,267 @@ + + + + + + + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_langinfo_h='<'langinfo.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_langinfo_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_langinfo_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 'langinfo.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_langinfo_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_langinfo_h + gl_cv_next_langinfo_h='"'$gl_header'"' + else + gl_cv_next_langinfo_h='<'langinfo.h'>' + fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_langinfo_h" >&5 +$as_echo "$gl_cv_next_langinfo_h" >&6; } + fi + NEXT_LANGINFO_H=$gl_cv_next_langinfo_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='<'langinfo.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_langinfo_h + fi + NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H=$gl_next_as_first_directive + + + + + + HAVE_LANGINFO_CODESET=0 + HAVE_LANGINFO_T_FMT_AMPM=0 + HAVE_LANGINFO_ALTMON=0 + HAVE_LANGINFO_ERA=0 + HAVE_LANGINFO_YESEXPR=0 + + if test $ac_cv_header_langinfo_h = yes; then + HAVE_LANGINFO_H=1 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines CODESET" >&5 +$as_echo_n "checking whether langinfo.h defines CODESET... " >&6; } +if ${gl_cv_header_langinfo_codeset+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int a = CODESET; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_langinfo_codeset=yes +else + gl_cv_header_langinfo_codeset=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_langinfo_codeset" >&5 +$as_echo "$gl_cv_header_langinfo_codeset" >&6; } + if test $gl_cv_header_langinfo_codeset = yes; then + HAVE_LANGINFO_CODESET=1 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines T_FMT_AMPM" >&5 +$as_echo_n "checking whether langinfo.h defines T_FMT_AMPM... " >&6; } +if ${gl_cv_header_langinfo_t_fmt_ampm+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int a = T_FMT_AMPM; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_langinfo_t_fmt_ampm=yes +else + gl_cv_header_langinfo_t_fmt_ampm=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_langinfo_t_fmt_ampm" >&5 +$as_echo "$gl_cv_header_langinfo_t_fmt_ampm" >&6; } + if test $gl_cv_header_langinfo_t_fmt_ampm = yes; then + HAVE_LANGINFO_T_FMT_AMPM=1 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines ALTMON_1" >&5 +$as_echo_n "checking whether langinfo.h defines ALTMON_1... " >&6; } +if ${gl_cv_header_langinfo_altmon+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int a = ALTMON_1; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_langinfo_altmon=yes +else + gl_cv_header_langinfo_altmon=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_langinfo_altmon" >&5 +$as_echo "$gl_cv_header_langinfo_altmon" >&6; } + if test $gl_cv_header_langinfo_altmon = yes; then + HAVE_LANGINFO_ALTMON=1 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines ERA" >&5 +$as_echo_n "checking whether langinfo.h defines ERA... " >&6; } +if ${gl_cv_header_langinfo_era+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int a = ERA; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_langinfo_era=yes +else + gl_cv_header_langinfo_era=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_langinfo_era" >&5 +$as_echo "$gl_cv_header_langinfo_era" >&6; } + if test $gl_cv_header_langinfo_era = yes; then + HAVE_LANGINFO_ERA=1 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines YESEXPR" >&5 +$as_echo_n "checking whether langinfo.h defines YESEXPR... " >&6; } +if ${gl_cv_header_langinfo_yesexpr+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int a = YESEXPR; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + gl_cv_header_langinfo_yesexpr=yes +else + gl_cv_header_langinfo_yesexpr=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_langinfo_yesexpr" >&5 +$as_echo "$gl_cv_header_langinfo_yesexpr" >&6; } + if test $gl_cv_header_langinfo_yesexpr = yes; then + HAVE_LANGINFO_YESEXPR=1 + fi + else + HAVE_LANGINFO_H=0 + fi + + + + + + + + + + + + + + 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 @@ -25805,32 +29460,81 @@ q }' - gl_cv_absolute_locale_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | - sed -n "$gl_absolute_header_sed"` + gl_cv_absolute_locale_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_locale_h + gl_cv_next_locale_h='"'$gl_header'"' + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_locale_h" >&5 +$as_echo "$gl_cv_next_locale_h" >&6; } + fi + NEXT_LOCALE_H=$gl_cv_next_locale_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='<'locale.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_locale_h + fi + NEXT_AS_FIRST_DIRECTIVE_LOCALE_H=$gl_next_as_first_directive + + + + + + + + + + + + + + if test $REPLACE_STRUCT_LCONV = 1; then + REPLACE_LOCALECONV=1 + fi + + if test $REPLACE_LOCALECONV = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS localeconv.$ac_objext" + + + ac_fn_c_check_member "$LINENO" "struct lconv" "decimal_point" "ac_cv_member_struct_lconv_decimal_point" "#include +" +if test "x$ac_cv_member_struct_lconv_decimal_point" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_LCONV_DECIMAL_POINT 1 +_ACEOF + + +fi + + + fi + - gl_header=$gl_cv_absolute_locale_h - gl_cv_next_locale_h='"'$gl_header'"' -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_locale_h" >&5 -$as_echo "$gl_cv_next_locale_h" >&6; } - fi - NEXT_LOCALE_H=$gl_cv_next_locale_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='<'locale.h'>' - else - # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' - gl_next_as_first_directive=$gl_cv_next_locale_h - fi - NEXT_AS_FIRST_DIRECTIVE_LOCALE_H=$gl_next_as_first_directive + GNULIB_LOCALECONV=1 +$as_echo "#define GNULIB_TEST_LOCALECONV 1" >>confdefs.h @@ -25839,48 +29543,269 @@ - if test $REPLACE_STRUCT_LCONV = 1; then - REPLACE_LOCALECONV=1 + + + if test $HAVE_LOCALE_T = 1; then + + gl_func_newlocale="$ac_cv_func_newlocale" + gl_func_duplocale="$ac_cv_func_duplocale" + gl_func_freelocale="$ac_cv_func_freelocale" + else + gl_func_newlocale=no + gl_func_duplocale=no + gl_func_freelocale=no + fi + if test $gl_func_newlocale != yes; then + HAVE_NEWLOCALE=0 + fi + if test $gl_func_duplocale != yes; then + HAVE_DUPLOCALE=0 + fi + if test $gl_func_freelocale != yes; then + HAVE_FREELOCALE=0 + fi + if test $gt_nameless_locales = yes; then + REPLACE_NEWLOCALE=1 + REPLACE_DUPLOCALE=1 + REPLACE_FREELOCALE=1 fi - if test $REPLACE_LOCALECONV = 1; then + GNULIB_LOCALENAME=1 - gl_LIBOBJS="$gl_LIBOBJS localeconv.$ac_objext" - ac_fn_c_check_member "$LINENO" "struct lconv" "decimal_point" "ac_cv_member_struct_lconv_decimal_point" "#include +$as_echo "#define GNULIB_TEST_LOCALENAME 1" >>confdefs.h + + + + + + if test "$gl_threads_api" = posix; then + # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the + # pthread_rwlock_* functions. + has_rwlock=false + ac_fn_c_check_type "$LINENO" "pthread_rwlock_t" "ac_cv_type_pthread_rwlock_t" "#include " -if test "x$ac_cv_member_struct_lconv_decimal_point" = xyes; then : +if test "x$ac_cv_type_pthread_rwlock_t" = xyes; then : + has_rwlock=true -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_LCONV_DECIMAL_POINT 1 -_ACEOF +$as_echo "#define HAVE_PTHREAD_RWLOCK 1" >>confdefs.h + +fi + + if $has_rwlock; then + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_rwlock_rdlock prefers a writer to a reader" >&5 +$as_echo_n "checking whether pthread_rwlock_rdlock prefers a writer to a reader... " >&6; } +if ${gl_cv_pthread_rwlock_rdlock_prefer_writer+:} false; then : + $as_echo_n "(cached) " >&6 +else + save_LIBS="$LIBS" + LIBS="$LIBS $LIBMULTITHREAD" + if test "$cross_compiling" = yes; then : + case "$host_os" in + # Guess no on glibc systems. + *-gnu* | gnu*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;; + # Guess no on musl systems. + *-musl*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;; + # Guess no on bionic systems. + *-android*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;; + # Guess yes on native Windows with the mingw-w64 winpthreads library. + # Guess no on native Windows with the gnulib windows-rwlock module. + mingw*) if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then + gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing yes" + else + gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" + fi + ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_pthread_rwlock_rdlock_prefer_writer="$gl_cross_guess_normal" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#include + +#define SUCCEED() exit (0) +#define FAILURE() exit (1) +#define UNEXPECTED(n) (exit (10 + (n))) + +/* The main thread creates the waiting writer and the requesting reader threads + in the default way; this guarantees that they have the same priority. + We can reuse the main thread as first reader thread. */ + +static pthread_rwlock_t lock; +static pthread_t reader1; +static pthread_t writer; +static pthread_t reader2; +static pthread_t timer; +/* Used to pass control from writer to reader2 and from reader2 to timer, + as in a relay race. + Passing control from one running thread to another running thread + is most likely faster than to create the second thread. */ +static pthread_mutex_t baton; + +static void * +timer_func (void *ignored) +{ + /* Step 13 (can be before or after step 12): + The timer thread takes the baton, then waits a moment to make sure + it can tell whether the second reader thread is blocked at step 12. */ + if (pthread_mutex_lock (&baton)) + UNEXPECTED (13); + usleep (100000); + /* By the time we get here, it's clear that the second reader thread is + blocked at step 12. This is the desired behaviour. */ + SUCCEED (); +} + +static void * +reader2_func (void *ignored) +{ + int err; + + /* Step 8 (can be before or after step 7): + The second reader thread takes the baton, then waits a moment to make sure + the writer thread has reached step 7. */ + if (pthread_mutex_lock (&baton)) + UNEXPECTED (8); + usleep (100000); + /* Step 9: The second reader thread requests the lock. */ + err = pthread_rwlock_tryrdlock (&lock); + if (err == 0) + FAILURE (); + else if (err != EBUSY) + UNEXPECTED (9); + /* Step 10: Launch a timer, to test whether the next call blocks. */ + if (pthread_create (&timer, NULL, timer_func, NULL)) + UNEXPECTED (10); + /* Step 11: Release the baton. */ + if (pthread_mutex_unlock (&baton)) + UNEXPECTED (11); + /* Step 12: The second reader thread requests the lock. */ + err = pthread_rwlock_rdlock (&lock); + if (err == 0) + FAILURE (); + else + UNEXPECTED (12); +} + +static void * +writer_func (void *ignored) +{ + /* Step 4: Take the baton, so that the second reader thread does not go ahead + too early. */ + if (pthread_mutex_lock (&baton)) + UNEXPECTED (4); + /* Step 5: Create the second reader thread. */ + if (pthread_create (&reader2, NULL, reader2_func, NULL)) + UNEXPECTED (5); + /* Step 6: Release the baton. */ + if (pthread_mutex_unlock (&baton)) + UNEXPECTED (6); + /* Step 7: The writer thread requests the lock. */ + if (pthread_rwlock_wrlock (&lock)) + UNEXPECTED (7); + return NULL; +} +int +main () +{ + reader1 = pthread_self (); + + /* Step 1: The main thread initializes the lock and the baton. */ + if (pthread_rwlock_init (&lock, NULL)) + UNEXPECTED (1); + if (pthread_mutex_init (&baton, NULL)) + UNEXPECTED (1); + /* Step 2: The main thread acquires the lock as a reader. */ + if (pthread_rwlock_rdlock (&lock)) + UNEXPECTED (2); + /* Step 3: Create the writer thread. */ + if (pthread_create (&writer, NULL, writer_func, NULL)) + UNEXPECTED (3); + /* Job done. Go to sleep. */ + for (;;) + { + sleep (1); + } +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_pthread_rwlock_rdlock_prefer_writer=yes +else + gl_cv_pthread_rwlock_rdlock_prefer_writer=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 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pthread_rwlock_rdlock_prefer_writer" >&5 +$as_echo "$gl_cv_pthread_rwlock_rdlock_prefer_writer" >&6; } + case "$gl_cv_pthread_rwlock_rdlock_prefer_writer" in + *yes) +$as_echo "#define HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER 1" >>confdefs.h + ;; + esac + fi + # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + #include +int +main () +{ - GNULIB_LOCALECONV=1 +#if __FreeBSD__ == 4 +error "No, in FreeBSD 4.0 recursive mutexes actually don't work." +#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \ + && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070) +error "No, in Mac OS X < 10.7 recursive mutexes actually don't work." +#else +int x = (int)PTHREAD_MUTEX_RECURSIVE; +return !x; +#endif + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : +$as_echo "#define HAVE_PTHREAD_MUTEX_RECURSIVE 1" >>confdefs.h +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + : -$as_echo "#define GNULIB_TEST_LOCALECONV 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define GNULIB_LOCK 1 +_ACEOF @@ -26084,7 +30009,7 @@ if (!(gy + gy == gy)) result |= 1; } - /* This test fails on NetBSD 8.0. */ + /* This test fails on NetBSD 9.0. */ { const long double TWO_LDBL_MANT_DIG = /* 2^LDBL_MANT_DIG */ (long double) (1U << ((LDBL_MANT_DIG - 1) / 5)) @@ -26206,6 +30131,9 @@ # include #endif + +$gl_mda_defines + int main () { @@ -26538,13 +30466,6 @@ #include #include -/* 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 main () { @@ -26581,13 +30502,6 @@ #include #include -/* 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 main () { @@ -26646,13 +30560,6 @@ #include #include #include -/* 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 main () { @@ -26706,14 +30613,7 @@ if test $ac_cv_func_mbrtowc = no; then HAVE_MBRTOWC=0 ac_fn_c_check_decl "$LINENO" "mbrtowc" "ac_cv_have_decl_mbrtowc" " -/* 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 " if test "x$ac_cv_have_decl_mbrtowc" = xyes; then : @@ -26758,13 +30658,6 @@ #include #include #include -/* 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 main () { @@ -26834,13 +30727,6 @@ #include #include -/* 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 main () { @@ -26902,13 +30788,6 @@ #include #include -/* 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 main () { @@ -27037,13 +30916,6 @@ #include #include -/* 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 main () { @@ -27098,13 +30970,6 @@ #include #include -/* 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 main () { @@ -27173,13 +31038,6 @@ #include #include -/* 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 main () { @@ -27670,13 +31528,6 @@ #include #include -/* 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 main () { @@ -27713,13 +31564,6 @@ #include #include -/* 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 main () { @@ -27778,13 +31622,6 @@ #include #include #include -/* 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 main () { @@ -27838,14 +31675,7 @@ if test $ac_cv_func_mbsinit = no; then HAVE_MBSINIT=0 ac_fn_c_check_decl "$LINENO" "mbsinit" "ac_cv_have_decl_mbsinit" " -/* 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 " if test "x$ac_cv_have_decl_mbsinit" = xyes; then : @@ -27859,429 +31689,20 @@ _ACEOF if test $ac_cv_have_decl_mbsinit = yes; then - REPLACE_MBSINIT=1 - fi - else - if test $REPLACE_MBSTATE_T = 1; then - REPLACE_MBSINIT=1 - else - case "$host_os" in - mingw*) REPLACE_MBSINIT=1 ;; - esac - fi - fi - - if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then - - - - - - - - - gl_LIBOBJS="$gl_LIBOBJS mbsinit.$ac_objext" - - - : - - fi - - - - - - GNULIB_MBSINIT=1 - - - - - -$as_echo "#define GNULIB_TEST_MBSINIT 1" >>confdefs.h - - - - - - - if test $ac_cv_func_mbslen = yes; then - HAVE_MBSLEN=1 - else - HAVE_MBSLEN=0 - fi - - - - - - - GNULIB_MBSLEN=1 - - - - - -$as_echo "#define GNULIB_TEST_MBSLEN 1" >>confdefs.h - - - - - - - - - - - - - - - if case "$host_os" in - mingw*) true ;; - *) test $ac_cv_func_mbsinit = yes ;; - esac \ - && test $ac_cv_func_mbrtowc = yes; then - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5 -$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; } -if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then : - $as_echo_n "(cached) " >&6 -else - - case "$host_os" in - # Guess no on AIX and OSF/1. - aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;; - # Guess yes otherwise. - *) gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;; - esac - if test $LOCALE_JA != none; then - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -/* 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 main () -{ - if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) - { - const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ - mbstate_t state; - wchar_t wc; - - memset (&state, '\0', sizeof (mbstate_t)); - if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) - if (mbsinit (&state)) - return 2; - } - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_mbrtowc_incomplete_state=yes -else - gl_cv_func_mbrtowc_incomplete_state=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - else - if test $LOCALE_FR_UTF8 != none; then - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -/* 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 main () -{ - if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) - { - const char input[] = "B\303\274\303\237er"; /* "Büßer" */ - mbstate_t state; - wchar_t wc; - - memset (&state, '\0', sizeof (mbstate_t)); - if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2)) - if (mbsinit (&state)) - return 2; - } - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_mbrtowc_incomplete_state=yes -else - gl_cv_func_mbrtowc_incomplete_state=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 - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5 -$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; } - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5 -$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; } -if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then : - $as_echo_n "(cached) " >&6 -else - - case "$host_os" in - # Guess no on Solaris 8. - solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;; - # Guess yes otherwise. - *) gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;; - esac - if test $LOCALE_ZH_CN != none; then - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -#include -/* 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 main () -{ - /* This fails on Solaris 8: - mbrtowc returns 2, and sets wc to 0x00F0. - mbtowc returns 4 (correct) and sets wc to 0x5EDC. */ - if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) - { - char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */ - mbstate_t state; - wchar_t wc; - - memset (&state, '\0', sizeof (mbstate_t)); - if (mbrtowc (&wc, input + 3, 6, &state) != 4 - && mbtowc (&wc, input + 3, 6) == 4) - return 2; - } - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_mbrtowc_sanitycheck=yes -else - gl_cv_func_mbrtowc_sanitycheck=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_mbrtowc_sanitycheck" >&5 -$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; } - - REPLACE_MBSTATE_T=0 - case "$gl_cv_func_mbrtowc_incomplete_state" in - *yes) ;; - *) REPLACE_MBSTATE_T=1 ;; - esac - case "$gl_cv_func_mbrtowc_sanitycheck" in - *yes) ;; - *) REPLACE_MBSTATE_T=1 ;; - esac - else - REPLACE_MBSTATE_T=1 - fi - - - - if test $ac_cv_func_mbsrtowcs = no; then - HAVE_MBSRTOWCS=0 - ac_fn_c_check_decl "$LINENO" "mbsrtowcs" "ac_cv_have_decl_mbsrtowcs" " -/* 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 test "x$ac_cv_have_decl_mbsrtowcs" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_MBSRTOWCS $ac_have_decl -_ACEOF - - if test $ac_cv_have_decl_mbsrtowcs = yes; then - REPLACE_MBSRTOWCS=1 - fi - else - if test $REPLACE_MBSTATE_T = 1; then - REPLACE_MBSRTOWCS=1 - else - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbsrtowcs works" >&5 -$as_echo_n "checking whether mbsrtowcs works... " >&6; } -if ${gl_cv_func_mbsrtowcs_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - - case "$host_os" in - # Guess no on HP-UX, Solaris, mingw. - hpux* | solaris* | mingw*) gl_cv_func_mbsrtowcs_works="guessing no" ;; - # Guess yes otherwise. - *) gl_cv_func_mbsrtowcs_works="guessing yes" ;; - esac - if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -/* 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 main () -{ - int result = 0; - /* Test whether the function supports a NULL destination argument. - This fails on native Windows. */ - if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) - { - const char input[] = "\337er"; - const char *src = input; - mbstate_t state; - - memset (&state, '\0', sizeof (mbstate_t)); - if (mbsrtowcs (NULL, &src, 1, &state) != 3 - || src != input) - result |= 1; - } - /* Test whether the function works when started with a conversion state - in non-initial state. This fails on HP-UX 11.11 and Solaris 10. */ - if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) - { - const char input[] = "B\303\274\303\237er"; - 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 |= 2; - } - } - if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) - { - const char input[] = "<\306\374\313\334\270\354>"; - mbstate_t state; - - memset (&state, '\0', sizeof (mbstate_t)); - if (mbrtowc (NULL, input + 3, 1, &state) == (size_t)(-2)) - if (!mbsinit (&state)) - { - const char *src = input + 4; - if (mbsrtowcs (NULL, &src, 10, &state) != 3) - result |= 4; - } - } - if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) - { - 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; -} -_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 ;; + REPLACE_MBSINIT=1 + fi + else + if test $REPLACE_MBSTATE_T = 1; then + REPLACE_MBSINIT=1 + else + case "$host_os" in + mingw*) REPLACE_MBSINIT=1 ;; esac fi fi - if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then + if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then + @@ -28289,35 +31710,48 @@ + gl_LIBOBJS="$gl_LIBOBJS mbsinit.$ac_objext" + - gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs.$ac_objext" + : + fi + GNULIB_MBSINIT=1 - gl_LIBOBJS="$gl_LIBOBJS mbsrtowcs-state.$ac_objext" - : +$as_echo "#define GNULIB_TEST_MBSINIT 1" >>confdefs.h + + + + + + if test $ac_cv_func_mbslen = yes; then + HAVE_MBSLEN=1 + else + HAVE_MBSLEN=0 fi - GNULIB_MBSRTOWCS=1 + + GNULIB_MBSLEN=1 -$as_echo "#define GNULIB_TEST_MBSRTOWCS 1" >>confdefs.h +$as_echo "#define GNULIB_TEST_MBSLEN 1" >>confdefs.h @@ -28341,7 +31775,7 @@ : - if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then + if test $REPLACE_MEMCHR = 1; then @@ -28849,6 +32283,163 @@ + case "$host_os" in + mingw* | pw*) + REPLACE_OPEN=1 + ;; + *) + + if test "$gl_cv_macro_O_CLOEXEC" != yes; then + REPLACE_OPEN=1 + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open recognizes a trailing slash" >&5 +$as_echo_n "checking whether open recognizes a trailing slash... " >&6; } +if ${gl_cv_func_open_slash+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Assume that if we have lstat, we can also check symlinks. + if test $ac_cv_func_lstat = yes; then + touch conftest.tmp + ln -s conftest.tmp conftest.lnk + fi + if test "$cross_compiling" = yes; then : + + case "$host_os" in + freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*) + gl_cv_func_open_slash="guessing no" ;; + *) + gl_cv_func_open_slash="guessing yes" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if HAVE_UNISTD_H +# include +#endif + + +$gl_mda_defines + +int main () +{ + int result = 0; +#if HAVE_LSTAT + if (open ("conftest.lnk/", O_RDONLY) != -1) + result |= 1; +#endif + if (open ("conftest.sl/", O_CREAT, 0600) >= 0) + result |= 2; + return result; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_open_slash=yes +else + gl_cv_func_open_slash=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.sl conftest.tmp conftest.lnk + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_slash" >&5 +$as_echo "$gl_cv_func_open_slash" >&6; } + case "$gl_cv_func_open_slash" in + *no) + +$as_echo "#define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h + + ;; + esac + + case "$gl_cv_func_open_slash" in + *no) + REPLACE_OPEN=1 + ;; + esac + ;; + esac + + + + if test $REPLACE_OPEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS open.$ac_objext" + + + + : + + fi + + + + + + GNULIB_OPEN=1 + + + + + +$as_echo "#define GNULIB_TEST_OPEN 1" >>confdefs.h + + + + + + + + + + if test $ac_cv_func_pclose = no; then + HAVE_PCLOSE=0 + fi + + if test $HAVE_PCLOSE = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS pclose.$ac_objext" + + + : + + fi + + + + + + GNULIB_PCLOSE=1 + + + + + +$as_echo "#define GNULIB_TEST_PCLOSE 1" >>confdefs.h + + + # 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 @@ -28890,6 +32481,98 @@ fi + + + + if test $ac_cv_func_popen = no; then + HAVE_POPEN=0 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether popen works with closed stdin" >&5 +$as_echo_n "checking whether popen works with closed stdin... " >&6; } +if ${gl_cv_func_popen_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + case "$host_os" in + # For now, only cygwin 1.5 or older is known to be broken. + cygwin*) gl_cv_func_popen_works="guessing no" ;; + # Guess yes on native Windows. + mingw*) gl_cv_func_popen_works="guessing yes" ;; + *) gl_cv_func_popen_works="guessing yes" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +int result = 0; + FILE *child; + fclose (stdin); + fclose (stdout); + child = popen ("echo a", "r"); + if (fgetc (child) != 'a') + result |= 1; + if (pclose (child) != 0) + result |= 2; + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_popen_works=yes +else + gl_cv_func_popen_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_popen_works" >&5 +$as_echo "$gl_cv_func_popen_works" >&6; } + case "$gl_cv_func_popen_works" in + *yes) ;; + *) REPLACE_POPEN=1 ;; + esac + fi + + if test $HAVE_POPEN = 0 || test $REPLACE_POPEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS popen.$ac_objext" + + + : + + fi + + + + + + GNULIB_POPEN=1 + + + + + +$as_echo "#define GNULIB_TEST_POPEN 1" >>confdefs.h + + + 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 : @@ -29125,19 +32808,7 @@ - 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 realloc" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 $as_echo_n "checking for GNU libc compatible realloc... " >&6; } if ${ac_cv_func_realloc_0_nonnull+:} false; then : $as_echo_n "(cached) " >&6 @@ -29155,11 +32826,7 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#if defined STDC_HEADERS || defined HAVE_STDLIB_H - # include - #else - char *realloc (); - #endif +#include int main () @@ -29364,7 +33031,7 @@ "C" #endif double round (double); -#ifdef _MSC_VER +#if defined _MSC_VER && !defined __clang__ # pragma fenv_access (off) #endif int main() @@ -29409,9 +33076,10 @@ 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 : + + exec 9>&6 6>/dev/null + + if ${gl_cv_func_floor_libm+:} false; then : $as_echo_n "(cached) " >&6 else @@ -29466,15 +33134,18 @@ fi - as_echo_n="$saved_as_echo_n" + + exec 6>&9 9>&- + 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 : + + exec 9>&6 6>/dev/null + + if ${gl_cv_func_ceil_libm+:} false; then : $as_echo_n "(cached) " >&6 else @@ -29529,7 +33200,9 @@ fi - as_echo_n="$saved_as_echo_n" + + exec 6>&9 9>&- + CEIL_LIBM="$gl_cv_func_ceil_libm" @@ -29672,9 +33345,10 @@ && test "$ac_cv_have_decl_ceill" = yes; then - saved_as_echo_n="$as_echo_n" - as_echo_n=':' - if ${gl_cv_func_floorl_libm+:} false; then : + + exec 9>&6 6>/dev/null + + if ${gl_cv_func_floorl_libm+:} false; then : $as_echo_n "(cached) " >&6 else @@ -29729,15 +33403,18 @@ fi - as_echo_n="$saved_as_echo_n" + + exec 6>&9 9>&- + 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 : + + exec 9>&6 6>/dev/null + + if ${gl_cv_func_ceill_libm+:} false; then : $as_echo_n "(cached) " >&6 else @@ -29792,7 +33469,9 @@ fi - as_echo_n="$saved_as_echo_n" + + exec 6>&9 9>&- + CEILL_LIBM="$gl_cv_func_ceill_libm" @@ -29851,6 +33530,119 @@ + NEED_SETLOCALE_IMPROVED=0 + case "$host_os" in + mingw*) NEED_SETLOCALE_IMPROVED=1 ;; + cygwin*) + case `uname -r` in + 1.5.*) NEED_SETLOCALE_IMPROVED=1 ;; + esac + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale supports the C locale" >&5 +$as_echo_n "checking whether setlocale supports the C locale... " >&6; } +if ${gl_cv_func_setlocale_works+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + case "$host_os" in + # Guess no on Android. + linux*-android*) gl_cv_func_setlocale_works="guessing no";; + # Guess yes otherwise. + *) gl_cv_func_setlocale_works="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +int main () +{ + return setlocale (LC_ALL, "C") == NULL; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_setlocale_works=yes +else + gl_cv_func_setlocale_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_setlocale_works" >&5 +$as_echo "$gl_cv_func_setlocale_works" >&6; } + case "$gl_cv_func_setlocale_works" in + *yes) ;; + *) NEED_SETLOCALE_IMPROVED=1 ;; + esac + ;; + esac + +cat >>confdefs.h <<_ACEOF +#define NEED_SETLOCALE_IMPROVED $NEED_SETLOCALE_IMPROVED +_ACEOF + + + NEED_SETLOCALE_MTSAFE=0 + if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then + NEED_SETLOCALE_MTSAFE=1 + fi + +cat >>confdefs.h <<_ACEOF +#define NEED_SETLOCALE_MTSAFE $NEED_SETLOCALE_MTSAFE +_ACEOF + + + if test $NEED_SETLOCALE_IMPROVED = 1 || test $NEED_SETLOCALE_MTSAFE = 1; then + REPLACE_SETLOCALE=1 + fi + + if test $NEED_SETLOCALE_MTSAFE = 1; then + LIB_SETLOCALE="$LIB_SETLOCALE_NULL" + else + LIB_SETLOCALE= + fi + + + if test $REPLACE_SETLOCALE = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS setlocale.$ac_objext" + + + : + + fi + + + + + + GNULIB_SETLOCALE=1 + + + + + +$as_echo "#define GNULIB_TEST_SETLOCALE 1" >>confdefs.h + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setlocale (LC_ALL, NULL) is multithread-safe" >&5 $as_echo_n "checking whether setlocale (LC_ALL, NULL) is multithread-safe... " >&6; } if ${gl_cv_func_setlocale_null_all_mtsafe+:} false; then : @@ -30158,6 +33950,7 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for signbit macro" >&5 $as_echo_n "checking for signbit macro... " >&6; } if ${gl_cv_func_signbit+:} false; then : @@ -30282,32 +34075,32 @@ $as_echo "$gl_cv_func_signbit" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for signbit compiler built-ins" >&5 $as_echo_n "checking for signbit compiler built-ins... " >&6; } -if ${gl_cv_func_signbit_gcc+:} false; then : +if ${gl_cv_func_signbit_builtins+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : case "$host_os" in # Guess yes on glibc systems. - *-gnu* | gnu*) gl_cv_func_signbit_gcc="guessing yes" ;; + *-gnu* | gnu*) gl_cv_func_signbit_builtins="guessing yes" ;; # Guess yes on musl systems. - *-musl*) gl_cv_func_signbit_gcc="guessing yes" ;; + *-musl*) gl_cv_func_signbit_builtins="guessing yes" ;; # Guess yes on mingw, no on MSVC. mingw*) if test -n "$GCC"; then - gl_cv_func_signbit_gcc="guessing yes" + gl_cv_func_signbit_builtins="guessing yes" else - gl_cv_func_signbit_gcc="guessing no" + gl_cv_func_signbit_builtins="guessing no" fi ;; # If we don't know, obey --enable-cross-guesses. - *) gl_cv_func_signbit_gcc="$gl_cross_guess_normal" ;; + *) gl_cv_func_signbit_builtins="$gl_cross_guess_normal" ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#if __GNUC__ >= 4 +#if (__GNUC__ >= 4) || (__clang_major__ >= 4) # define signbit(x) \ (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \ sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \ @@ -30392,9 +34185,9 @@ _ACEOF if ac_fn_c_try_run "$LINENO"; then : - gl_cv_func_signbit_gcc=yes + gl_cv_func_signbit_builtins=yes else - gl_cv_func_signbit_gcc=no + gl_cv_func_signbit_builtins=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -30402,11 +34195,11 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_signbit_gcc" >&5 -$as_echo "$gl_cv_func_signbit_gcc" >&6; } - case "$gl_cv_func_signbit_gcc" in +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_signbit_builtins" >&5 +$as_echo "$gl_cv_func_signbit_builtins" >&6; } + case "$gl_cv_func_signbit_builtins" in *yes) - REPLACE_SIGNBIT_USING_GCC=1 + REPLACE_SIGNBIT_USING_BUILTINS=1 ;; *) case "$gl_cv_func_signbit" in @@ -30954,89 +34747,279 @@ fi -done +done + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIZE_MAX" >&5 +$as_echo_n "checking for SIZE_MAX... " >&6; } +if ${gl_cv_size_max+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_cv_size_max=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if HAVE_STDINT_H +#include +#endif +#ifdef SIZE_MAX +Found it +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Found it" >/dev/null 2>&1; then : + gl_cv_size_max=yes +fi +rm -f conftest* + + if test $gl_cv_size_max != yes; then + if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) * CHAR_BIT - 1" "size_t_bits_minus_1" "#include +#include "; then : + +else + size_t_bits_minus_1= +fi + + if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) <= sizeof (unsigned int)" "fits_in_uint" "#include "; then : + +else + fits_in_uint= +fi + + if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then + if test $fits_in_uint = 1; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + extern size_t foo; + extern unsigned long foo; + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + fits_in_uint=0 +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $fits_in_uint = 1; then + gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)" + else + gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)" + fi + else + gl_cv_size_max='((size_t)~(size_t)0)' + fi + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_size_max" >&5 +$as_echo "$gl_cv_size_max" >&6; } + if test "$gl_cv_size_max" != yes; then + +cat >>confdefs.h <<_ACEOF +#define SIZE_MAX $gl_cv_size_max +_ACEOF + + fi + + + + + gl_cv_func_snprintf_usable=no + for ac_func in snprintf +do : + ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf" +if test "x$ac_cv_func_snprintf" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SNPRINTF 1 +_ACEOF + +fi +done + + if test $ac_cv_func_snprintf = yes; then + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf respects a size of 1" >&5 +$as_echo_n "checking whether snprintf respects a size of 1... " >&6; } +if ${gl_cv_func_snprintf_size1+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + case "$host_os" in + # Guess yes on Android. + linux*-android*) gl_cv_func_snprintf_size1="guessing yes" ;; + # Guess yes on native Windows. + mingw*) gl_cv_func_snprintf_size1="guessing yes" ;; + *) gl_cv_func_snprintf_size1="guessing yes" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +int main() +{ + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; + my_snprintf (buf, 1, "%d", 12345); + return buf[1] != 'E'; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_snprintf_size1=yes +else + gl_cv_func_snprintf_size1=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_snprintf_size1" >&5 +$as_echo "$gl_cv_func_snprintf_size1" >&6; } + + case "$gl_cv_func_snprintf_size1" in + *yes) + + case "$gl_cv_func_snprintf_retval_c99" in + *yes) + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports POSIX/XSI format strings with positions" >&5 +$as_echo_n "checking whether printf supports POSIX/XSI format strings with positions... " >&6; } +if ${gl_cv_func_printf_positions+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test "$cross_compiling" = yes; then : + + case "$host_os" in + netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*) + gl_cv_func_printf_positions="guessing no";; + beos*) gl_cv_func_printf_positions="guessing no";; + # Guess yes on Android. + linux*-android*) gl_cv_func_printf_positions="guessing yes";; + # Guess no on native Windows. + mingw* | pw*) gl_cv_func_printf_positions="guessing no";; + *) gl_cv_func_printf_positions="guessing yes";; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +/* The string "%2$d %1$d", with dollar characters protected from the shell's + dollar expansion (possibly an autoconf bug). */ +static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; +static char buf[100]; +int main () +{ + sprintf (buf, format, 33, 55); + return (strcmp (buf, "55 33") != 0); +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_printf_positions=yes +else + gl_cv_func_printf_positions=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_printf_positions" >&5 +$as_echo "$gl_cv_func_printf_positions" >&6; } + + case "$gl_cv_func_printf_positions" in + *yes) + gl_cv_func_snprintf_usable=yes + ;; + esac + ;; + esac + ;; + esac + fi + if test $gl_cv_func_snprintf_usable = no; then + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS snprintf.$ac_objext" + + if test $ac_cv_func_snprintf = yes; then + REPLACE_SNPRINTF=1 + else + + if test $ac_cv_have_decl_snprintf = yes; then + REPLACE_SNPRINTF=1 + fi + fi + : + + fi + + if test $ac_cv_have_decl_snprintf = no; then + HAVE_DECL_SNPRINTF=0 + fi + + + - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIZE_MAX" >&5 -$as_echo_n "checking for SIZE_MAX... " >&6; } -if ${gl_cv_size_max+:} false; then : - $as_echo_n "(cached) " >&6 -else - gl_cv_size_max= - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#if HAVE_STDINT_H -#include -#endif -#ifdef SIZE_MAX -Found it -#endif + GNULIB_SNPRINTF=1 -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "Found it" >/dev/null 2>&1; then : - gl_cv_size_max=yes -fi -rm -f conftest* - if test -z "$gl_cv_size_max"; then - if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) * CHAR_BIT - 1" "size_t_bits_minus_1" "#include -#include "; then : -else - size_t_bits_minus_1= -fi - if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) <= sizeof (unsigned int)" "fits_in_uint" "#include "; then : -else - fits_in_uint= -fi +$as_echo "#define GNULIB_TEST_SNPRINTF 1" >>confdefs.h - if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then - if test $fits_in_uint = 1; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - extern size_t foo; - extern unsigned long foo; -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - fits_in_uint=0 -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $fits_in_uint = 1; then - gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)" - else - gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)" - fi - else - gl_cv_size_max='((size_t)~(size_t)0)' - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_size_max" >&5 -$as_echo "$gl_cv_size_max" >&6; } - if test "$gl_cv_size_max" != yes; then cat >>confdefs.h <<_ACEOF -#define SIZE_MAX $gl_cv_size_max +#define GNULIB_SNPRINTF 1 _ACEOF - fi - ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" " /* is not needed according to POSIX, but the @@ -31376,6 +35359,130 @@ + case "$host_os" in + mingw*) + REPLACE_STAT=1 + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5 +$as_echo_n "checking whether stat handles trailing slashes on files... " >&6; } +if ${gl_cv_func_stat_file_slash+:} false; then : + $as_echo_n "(cached) " >&6 +else + touch conftest.tmp + # Assume that if we have lstat, we can also check symlinks. + if test $ac_cv_func_lstat = yes; then + ln -s conftest.tmp conftest.lnk + fi + if test "$cross_compiling" = yes; then : + case "$host_os" in + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_stat_file_slash="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_stat_file_slash="guessing yes" ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_stat_file_slash="$gl_cross_guess_normal" ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main () +{ +int result = 0; + struct stat st; + if (!stat ("conftest.tmp/", &st)) + result |= 1; +#if HAVE_LSTAT + if (!stat ("conftest.lnk/", &st)) + result |= 2; +#endif + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_stat_file_slash=yes +else + gl_cv_func_stat_file_slash=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.tmp conftest.lnk +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_file_slash" >&5 +$as_echo "$gl_cv_func_stat_file_slash" >&6; } + case $gl_cv_func_stat_file_slash in + *no) + REPLACE_STAT=1 + +$as_echo "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h +;; + esac + case $host_os in + solaris*) + REPLACE_FSTAT=1 ;; + esac + ;; + esac + + if test $REPLACE_STAT = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS stat.$ac_objext" + + case "$host_os" in + mingw*) + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS stat-w32.$ac_objext" + + ;; + esac + + + + : + + fi + + + + + + GNULIB_STAT=1 + + + + + +$as_echo "#define GNULIB_TEST_STAT 1" >>confdefs.h + + + + + + + ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.tv_nsec" "ac_cv_member_struct_stat_st_atim_tv_nsec" "#include #include " @@ -31710,9 +35817,10 @@ fi else - saved_as_echo_n="$as_echo_n" - as_echo_n=':' - if ${gl_cv_func___va_copy+:} false; then : + + exec 9>&6 6>/dev/null + + if ${gl_cv_func___va_copy+:} false; then : $as_echo_n "(cached) " >&6 else @@ -31739,7 +35847,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - as_echo_n="$saved_as_echo_n" + + exec 6>&9 9>&- + if test $gl_cv_func___va_copy = yes; then @@ -31804,6 +35914,9 @@ + + + STDDEF_H= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for good max_align_t" >&5 @@ -31815,10 +35928,17 @@ /* end confdefs.h. */ #include unsigned int s = sizeof (max_align_t); - #if defined __GNUC__ || defined __IBM__ALIGNOF__ + #if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__ int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1]; int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1]; #endif + typedef struct { char a; max_align_t b; } max_helper; + typedef struct { char a; long b; } long_helper; + typedef struct { char a; double b; } double_helper; + typedef struct { char a; long double b; } long_double_helper; + int check3[2 * (offsetof (long_helper, b) <= offsetof (max_helper, b)) - 1]; + int check4[2 * (offsetof (double_helper, b) <= offsetof (max_helper, b)) - 1]; + int check5[2 * (offsetof (long_double_helper, b) <= offsetof (max_helper, b)) - 1]; int main () @@ -32126,6 +36246,11 @@ + if test $ac_cv_have_decl_fcloseall = no; then + HAVE_DECL_FCLOSEALL=0 + fi + + @@ -32206,6 +36331,19 @@ + if test $ac_cv_have_decl_ecvt = no; then + HAVE_DECL_ECVT=0 + fi + + if test $ac_cv_have_decl_fcvt = no; then + HAVE_DECL_FCVT=0 + fi + + if test $ac_cv_have_decl_gcvt = no; then + HAVE_DECL_GCVT=0 + fi + + case "$host_os" in cygwin*) @@ -32221,6 +36359,9 @@ /* end confdefs.h. */ #include #include + #if defined _WIN32 && !defined __CYGWIN__ + # include + #endif /* Do not check for 'noreturn' after the return type. C11 allows it, but it's rarely done that way and circa-2012 bleeding-edge GCC rejects it when given @@ -32322,6 +36463,127 @@ + for ac_func in strcasecmp +do : + ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" +if test "x$ac_cv_func_strcasecmp" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRCASECMP 1 +_ACEOF + +fi +done + + if test $ac_cv_func_strcasecmp = no; then + HAVE_STRCASECMP=0 + fi + + + + for ac_func in strncasecmp +do : + ac_fn_c_check_func "$LINENO" "strncasecmp" "ac_cv_func_strncasecmp" +if test "x$ac_cv_func_strncasecmp" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRNCASECMP 1 +_ACEOF + +fi +done + + if test $ac_cv_func_strncasecmp = yes; then + HAVE_STRNCASECMP=1 + else + HAVE_STRNCASECMP=0 + fi + ac_fn_c_check_decl "$LINENO" "strncasecmp" "ac_cv_have_decl_strncasecmp" "$ac_includes_default" +if test "x$ac_cv_have_decl_strncasecmp" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRNCASECMP $ac_have_decl +_ACEOF + + if test $ac_cv_have_decl_strncasecmp = no; then + HAVE_DECL_STRNCASECMP=0 + fi + + + if test $HAVE_STRCASECMP = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strcasecmp.$ac_objext" + + + : + + fi + if test $HAVE_STRNCASECMP = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strncasecmp.$ac_objext" + + + : + + fi + + + + if test $gl_cv_func_malloc_posix != yes; then + REPLACE_STRDUP=1 + fi + + if test $ac_cv_have_decl_strdup = no; then + HAVE_DECL_STRDUP=0 + fi + + if test $REPLACE_STRDUP = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strdup.$ac_objext" + + : + fi + + + + + + GNULIB_STRDUP=1 + + + + + +$as_echo "#define GNULIB_TEST_STRDUP 1" >>confdefs.h + + + + + + if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then @@ -32465,6 +36727,9 @@ + + + if test $ac_cv_have_decl_strndup = no; then HAVE_DECL_STRNDUP=0 fi @@ -32528,11 +36793,331 @@ case $gl_cv_func_strndup_works in *no) REPLACE_STRNDUP=1 ;; esac - else - HAVE_STRNDUP=0 + else + HAVE_STRNDUP=0 + fi + + if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strndup.$ac_objext" + + fi + + + + + + GNULIB_STRNDUP=1 + + + + + +$as_echo "#define GNULIB_TEST_STRNDUP 1" >>confdefs.h + + + + + + + + + + if test $ac_cv_have_decl_strnlen = no; then + HAVE_DECL_STRNLEN=0 + else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5 +$as_echo_n "checking for working strnlen... " >&6; } +if ${ac_cv_func_strnlen_working+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + # Guess no on AIX systems, yes otherwise. + case "$host_os" in + aix*) ac_cv_func_strnlen_working=no;; + *) ac_cv_func_strnlen_working=yes;; + esac +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + +#define S "foobar" +#define S_LEN (sizeof S - 1) + + /* At least one implementation is buggy: that of AIX 4.3 would + give strnlen (S, 1) == 3. */ + + int i; + for (i = 0; i < S_LEN + 1; ++i) + { + int expected = i <= S_LEN ? i : S_LEN; + if (strnlen (S, i) != expected) + return 1; + } + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_strnlen_working=yes +else + ac_cv_func_strnlen_working=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_strnlen_working" >&5 +$as_echo "$ac_cv_func_strnlen_working" >&6; } +test $ac_cv_func_strnlen_working = no && : + + + if test $ac_cv_func_strnlen_working = no; then + REPLACE_STRNLEN=1 + fi + fi + + if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strnlen.$ac_objext" + + : + fi + + + + + + GNULIB_STRNLEN=1 + + + + + +$as_echo "#define GNULIB_TEST_STRNLEN 1" >>confdefs.h + + + + + + + + + + for ac_func in strsep +do : + ac_fn_c_check_func "$LINENO" "strsep" "ac_cv_func_strsep" +if test "x$ac_cv_func_strsep" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRSEP 1 +_ACEOF + +fi +done + + if test $ac_cv_func_strsep = no; then + HAVE_STRSEP=0 + fi + + if test $HAVE_STRSEP = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS strsep.$ac_objext" + + : + fi + + + + + + GNULIB_STRSEP=1 + + + + + +$as_echo "#define GNULIB_TEST_STRSEP 1" >>confdefs.h + + + + + + + if test $HAVE_STRTOD = 1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strtod obeys C99" >&5 +$as_echo_n "checking whether strtod obeys C99... " >&6; } +if ${gl_cv_func_strtod_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 +#ifdef __GNU_LIBRARY__ + #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8) || (__GLIBC__ > 2)) \ + && !defined __UCLIBC__ + Lucky user + #endif +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Lucky user" >/dev/null 2>&1; then : + gl_cv_func_strtod_works="guessing yes" +else + case "$host_os" in + # Guess yes on musl systems. + *-musl*) gl_cv_func_strtod_works="guessing yes" ;; + # Guess yes on native Windows. + mingw*) gl_cv_func_strtod_works="guessing yes" ;; + *) gl_cv_func_strtod_works="$gl_cross_guess_normal" ;; + esac + +fi +rm -f conftest* + + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +/* 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; +} + +int +main () +{ + + int result = 0; + { + /* In some old versions of Linux (2000 or before), strtod mis-parses + strings with leading '+'. */ + const char *string = " +69"; + char *term; + double value = strtod (string, &term); + if (value != 69 || term != (string + 4)) + result |= 1; + } + { + /* Under Solaris 2.4, strtod returns the wrong value for the + terminating character under some conditions. */ + const char *string = "NaN"; + char *term; + strtod (string, &term); + if (term != string && *(term - 1) == 0) + result |= 2; + } + { + /* Older glibc and Cygwin mis-parse "-0x". */ + const char *string = "-0x"; + char *term; + double value = strtod (string, &term); + double zero = 0.0; + if (1.0 / value != -1.0 / zero || term != (string + 2)) + result |= 4; + } + { + /* Many platforms do not parse hex floats. */ + const char *string = "0XaP+1"; + char *term; + double value = strtod (string, &term); + if (value != 20.0 || term != (string + 6)) + result |= 8; + } + { + /* Many platforms do not parse infinities. HP-UX 11.31 parses inf, + but mistakenly sets errno. */ + const char *string = "inf"; + char *term; + double value; + errno = 0; + value = strtod (string, &term); + if (value != HUGE_VAL || term != (string + 3) || errno) + result |= 16; + } + { + /* glibc 2.7 and cygwin 1.5.24 misparse "nan()". */ + const char *string = "nan()"; + char *term; + double value = strtod (string, &term); + if (numeric_equal (value, value) || term != (string + 5)) + result |= 32; + } + { + /* darwin 10.6.1 misparses "nan(". */ + const char *string = "nan("; + char *term; + double value = strtod (string, &term); + if (numeric_equal (value, value) || term != (string + 3)) + result |= 64; + } + return result; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + gl_cv_func_strtod_works=yes +else + gl_cv_func_strtod_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_strtod_works" >&5 +$as_echo "$gl_cv_func_strtod_works" >&6; } + case "$gl_cv_func_strtod_works" in + *yes) ;; + *) + REPLACE_STRTOD=1 + ;; + esac fi - if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then + if test $HAVE_STRTOD = 0 || test $REPLACE_STRTOD = 1; then @@ -32541,93 +37126,208 @@ - gl_LIBOBJS="$gl_LIBOBJS strndup.$ac_objext" + gl_LIBOBJS="$gl_LIBOBJS strtod.$ac_objext" + + + + if test $gl_cv_func_ldexp_no_libm = yes; then + +$as_echo "#define HAVE_LDEXP_IN_LIBC 1" >>confdefs.h fi + for ac_func in nl_langinfo +do : + ac_fn_c_check_func "$LINENO" "nl_langinfo" "ac_cv_func_nl_langinfo" +if test "x$ac_cv_func_nl_langinfo" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NL_LANGINFO 1 +_ACEOF +fi +done + fi - GNULIB_STRNDUP=1 + GNULIB_STRTOD=1 -$as_echo "#define GNULIB_TEST_STRNDUP 1" >>confdefs.h +$as_echo "#define GNULIB_TEST_STRTOD 1" >>confdefs.h - if test $ac_cv_have_decl_strnlen = no; then - HAVE_DECL_STRNLEN=0 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5 -$as_echo_n "checking for working strnlen... " >&6; } -if ${ac_cv_func_strnlen_working+:} false; then : + if test $ac_cv_func_strtold != yes; then + HAVE_STRTOLD=0 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strtold obeys POSIX" >&5 +$as_echo_n "checking whether strtold obeys POSIX... " >&6; } +if ${gl_cv_func_strtold_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : - # Guess no on AIX systems, yes otherwise. - case "$host_os" in - aix*) ac_cv_func_strnlen_working=no;; - *) ac_cv_func_strnlen_working=yes;; - esac + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef __GNU_LIBRARY__ + #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8) || (__GLIBC__ > 2)) \ + && !defined __UCLIBC__ + Lucky user + #endif +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "Lucky user" >/dev/null 2>&1; then : + gl_cv_func_strtold_works="guessing yes" +else + case "$host_os" in + # Guess yes on musl systems. + *-musl*) gl_cv_func_strtold_works="guessing yes" ;; + # Guess 'no (underflow problem)' on Cygwin. + cygwin*) gl_cv_func_strtold_works="guessing no (underflow problem)" ;; + *) gl_cv_func_strtold_works="$gl_cross_guess_normal" ;; + esac + +fi +rm -f conftest* + + else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default + +#include +#include +#include +/* 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; +} + int main () { -#define S "foobar" -#define S_LEN (sizeof S - 1) - - /* At least one implementation is buggy: that of AIX 4.3 would - give strnlen (S, 1) == 3. */ - - int i; - for (i = 0; i < S_LEN + 1; ++i) - { - int expected = i <= S_LEN ? i : S_LEN; - if (strnlen (S, i) != expected) - return 1; - } - return 0; + int result = 0; + { + /* Under Solaris 2.4, strtod returns the wrong value for the + terminating character under some conditions. */ + const char *string = "NaN"; + char *term; + strtold (string, &term); + if (term != string && *(term - 1) == 0) + result |= 1; + } + { + /* Older glibc and Cygwin mis-parse "-0x". */ + const char *string = "-0x"; + char *term; + long double value = strtold (string, &term); + long double zero = 0.0L; + if (1.0L / value != -1.0L / zero || term != (string + 2)) + result |= 2; + } + { + /* IRIX 6.5, mingw do not parse hex floats. */ + const char *string = "0XaP+1"; + char *term; + long double value = strtold (string, &term); + if (value != 20.0L || term != (string + 6)) + result |= 4; + } + { + /* IRIX 6.5 does not parse infinities. HP-UX 11.31/ia64 parses inf, + but mistakenly sets errno. */ + const char *string = "inf"; + char *term; + long double value; + errno = 0; + value = strtold (string, &term); + if (value != HUGE_VAL || term != (string + 3) || errno) + result |= 8; + } + { + /* glibc-2.3.2, IRIX 6.5, mingw, Haiku misparse "nan()". */ + const char *string = "nan()"; + char *term; + long double value = strtold (string, &term); + if (numeric_equal (value, value) || term != (string + 5)) + result |= 16; + } + { + /* Mac OS X 10.5, IRIX 6.5 misparse "nan(". */ + const char *string = "nan("; + char *term; + long double value = strtold (string, &term); + if (numeric_equal (value, value) || term != (string + 3)) + result |= 32; + } + { + /* In Cygwin 2.9, strtold does not set errno upon underflow. */ + const char *string = "1E-100000"; + char *term; + long double value; + errno = 0; + value = strtold (string, &term); + if (term != (string + 9) || (value == 0.0L && errno != ERANGE)) + result |= 64; + } + return result; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : - ac_cv_func_strnlen_working=yes + gl_cv_func_strtold_works=yes else - ac_cv_func_strnlen_working=no + if expr $? '>=' 64 >/dev/null; then + gl_cv_func_strtold_works="no (underflow problem)" + else + gl_cv_func_strtold_works=no + fi + 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_strnlen_working" >&5 -$as_echo "$ac_cv_func_strnlen_working" >&6; } -test $ac_cv_func_strnlen_working = no && : +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strtold_works" >&5 +$as_echo "$gl_cv_func_strtold_works" >&6; } + case "$gl_cv_func_strtold_works" in + *yes) ;; + *) + REPLACE_STRTOLD=1 + case "$gl_cv_func_strtold_works" in + *"no (underflow problem)") +$as_echo "#define STRTOLD_HAS_UNDERFLOW_BUG 1" >>confdefs.h - if test $ac_cv_func_strnlen_working = no; then - REPLACE_STRNLEN=1 - fi + ;; + esac + ;; + esac fi - if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then + if test $HAVE_STRTOLD = 0 || test $REPLACE_STRTOLD = 1; then @@ -32636,47 +37336,61 @@ - gl_LIBOBJS="$gl_LIBOBJS strnlen.$ac_objext" + gl_LIBOBJS="$gl_LIBOBJS strtold.$ac_objext" - : - fi + if test $gl_cv_func_ldexpl_no_libm = yes; then +$as_echo "#define HAVE_LDEXPL_IN_LIBC 1" >>confdefs.h + fi + for ac_func in nl_langinfo +do : + ac_fn_c_check_func "$LINENO" "nl_langinfo" "ac_cv_func_nl_langinfo" +if test "x$ac_cv_func_nl_langinfo" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NL_LANGINFO 1 +_ACEOF - GNULIB_STRNLEN=1 +fi +done + fi -$as_echo "#define GNULIB_TEST_STRNLEN 1" >>confdefs.h + GNULIB_STRTOLD=1 +$as_echo "#define GNULIB_TEST_STRTOLD 1" >>confdefs.h - for ac_func in strsep + + + + for ac_func in strtoll do : - ac_fn_c_check_func "$LINENO" "strsep" "ac_cv_func_strsep" -if test "x$ac_cv_func_strsep" = xyes; then : + ac_fn_c_check_func "$LINENO" "strtoll" "ac_cv_func_strtoll" +if test "x$ac_cv_func_strtoll" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_STRSEP 1 +#define HAVE_STRTOLL 1 _ACEOF fi done - if test $ac_cv_func_strsep = no; then - HAVE_STRSEP=0 + if test $ac_cv_func_strtoll = no; then + HAVE_STRTOLL=0 fi - if test $HAVE_STRSEP = 0; then + if test $HAVE_STRTOLL = 0; then @@ -32685,22 +37399,24 @@ - gl_LIBOBJS="$gl_LIBOBJS strsep.$ac_objext" + gl_LIBOBJS="$gl_LIBOBJS strtoll.$ac_objext" + + + : - : fi - GNULIB_STRSEP=1 + GNULIB_STRTOLL=1 -$as_echo "#define GNULIB_TEST_STRSEP 1" >>confdefs.h +$as_echo "#define GNULIB_TEST_STRTOLL 1" >>confdefs.h @@ -33014,6 +37730,108 @@ + + + + + + if test $gl_cv_have_include_next = yes; then + gl_cv_next_sys_wait_h='<'sys/wait.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_wait_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + + if test $ac_cv_header_sys_wait_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 'sys/wait.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_wait_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 | + sed -n "$gl_absolute_header_sed"` + + gl_header=$gl_cv_absolute_sys_wait_h + gl_cv_next_sys_wait_h='"'$gl_header'"' + else + gl_cv_next_sys_wait_h='<'sys/wait.h'>' + fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_wait_h" >&5 +$as_echo "$gl_cv_next_sys_wait_h" >&6; } + fi + NEXT_SYS_WAIT_H=$gl_cv_next_sys_wait_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/wait.h'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=$gl_cv_next_sys_wait_h + fi + NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H=$gl_next_as_first_directive + + + + + + + + + + + + + for ac_header in sys/single_threaded.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/single_threaded.h" "ac_cv_header_sys_single_threaded_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_single_threaded_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_SINGLE_THREADED_H 1 +_ACEOF + +fi + +done + + + + + + + + + ac_fn_c_check_decl "$LINENO" "trunc" "ac_cv_have_decl_trunc" "#include " if test "x$ac_cv_have_decl_trunc" = xyes; then : @@ -33371,6 +38189,11 @@ + if test $ac_cv_have_decl_execvpe = no; then + HAVE_DECL_EXECVPE=0 + fi + + if { test "$HAVE_LIBUNISTRING" != yes \ || { @@ -33574,6 +38397,84 @@ + + + if test $ac_cv_func_vasnprintf = no; then + + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS vasnprintf.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext" + + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext" + + if test $ac_cv_func_vasnprintf = yes; then + +$as_echo "#define REPLACE_VASNPRINTF 1" >>confdefs.h + + fi + + + + + + + + + + ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" +if test "x$ac_cv_type_ptrdiff_t" = xyes; then : + +else + +$as_echo "#define ptrdiff_t long" >>confdefs.h + + +fi + + + + + + + + fi + + # Check whether --with-packager was given. if test "${with_packager+set}" = set; then : withval=$with_packager; case $withval in @@ -33626,6 +38527,40 @@ + HAVE_WAITPID=1 + case $host_os in + mingw*) HAVE_WAITPID=0 ;; + esac + + if test $HAVE_WAITPID = 0; then + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS waitpid.$ac_objext" + + fi + + + + + + GNULIB_WAITPID=1 + + + + + +$as_echo "#define GNULIB_TEST_WAITPID 1" >>confdefs.h + + + + + @@ -33730,6 +38665,24 @@ + ac_fn_c_check_decl "$LINENO" "wcsdup" "ac_cv_have_decl_wcsdup" " + #include + +" +if test "x$ac_cv_have_decl_wcsdup" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_WCSDUP $ac_have_decl +_ACEOF + + if test $ac_cv_have_decl_wcsdup = no; then + HAVE_DECL_WCSDUP=0 + fi + @@ -33864,13 +38817,6 @@ 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; } @@ -33927,14 +38873,7 @@ 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 + ac_fn_c_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "#include #if HAVE_WCTYPE_H # include #endif @@ -33970,14 +38909,7 @@ 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 #if HAVE_WCTYPE_H # include #endif @@ -34012,14 +38944,7 @@ 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 #include wctrans_t a; @@ -34061,16 +38986,7 @@ ac_fn_c_check_decl "$LINENO" "wcwidth" "ac_cv_have_decl_wcwidth" " -/* AIX 3.2.5 declares wcwidth in . */ -#include -/* 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 " if test "x$ac_cv_have_decl_wcwidth" = xyes; then : @@ -34140,15 +39056,6 @@ /* end confdefs.h. */ #include -/* AIX 3.2.5 declares wcwidth in . */ -#include -/* 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_DECL_WCWIDTH extern @@ -34228,9 +39135,98 @@ + + case "$host_os" in + mingw*) + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS windows-mutex.$ac_objext" + + ;; + esac + + case "$host_os" in + mingw*) + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS windows-once.$ac_objext" + + ;; + esac + + case "$host_os" in + mingw*) + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS windows-recmutex.$ac_objext" + + ;; + esac + + case "$host_os" in + mingw*) + + + + + + + + + gl_LIBOBJS="$gl_LIBOBJS windows-rwlock.$ac_objext" + + ;; + esac : +cat >>confdefs.h <<_ACEOF +#define GNULIB_XALLOC 1 +_ACEOF + + + + +cat >>confdefs.h <<_ACEOF +#define GNULIB_XALLOC_DIE 1 +_ACEOF + + + + + for ac_header in stdint.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" +if test "x$ac_cv_header_stdint_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDINT_H 1 +_ACEOF + +fi + +done + + + + : @@ -34922,6 +39918,18 @@ fi +## Look for OpenBSD pledge(2) +for ac_func in pledge +do : + ac_fn_c_check_func "$LINENO" "pledge" "ac_cv_func_pledge" +if test "x$ac_cv_func_pledge" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_PLEDGE 1 +_ACEOF + +fi +done + ## Check for bash-completion using pkg-config ## ./configure --with-bash-completion-dir=[no|local|global|PATH] . @@ -35096,17 +40104,80 @@ +## Prefer gsort over sort to get GNU coreutils version on non-GNU +## userspace OSes if available. +for ac_prog in gsort sort +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_path_SORT_PATH+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $SORT_PATH in + [\\/]* | ?:[\\/]*) + ac_cv_path_SORT_PATH="$SORT_PATH" # 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_SORT_PATH="$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 + + ;; +esac +fi +SORT_PATH=$ac_cv_path_SORT_PATH +if test -n "$SORT_PATH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SORT_PATH" >&5 +$as_echo "$SORT_PATH" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$SORT_PATH" && break +done +test -n "$SORT_PATH" || SORT_PATH="as_fn_error $? "could not find a sort program" "$LINENO" 5" + + +cat >>confdefs.h <<_ACEOF +#define SORT_PATH "$SORT_PATH" +_ACEOF + + ## ## Check if the system's sort support "-s" (stable) sort. ## 'sort' from GNU Coreutils, FreeBSD, OpenBSD, Busybox support it. ## DilOS (illumos/opensolaris) does not. ## -if sort -s < /dev/null > /dev/null 2>/dev/null ; then +if ${SORT_PATH} -s < /dev/null > /dev/null 2>/dev/null ; then $as_echo "#define HAVE_STABLE_SORT 1" >>confdefs.h fi +## +## Check if the system's sort supports "-z" for NUL line delimiters +## +if ${SORT_PATH} -z < /dev/null > /dev/null 2>/dev/null ; then + +$as_echo "#define HAVE_ZERO_SORT 1" >>confdefs.h + +fi + ## Are we building from git checked-out sources? ## (if not, assume it's from a tarball) ## This is used in "Makefile.am" to avoid re-generating the manpage @@ -35191,7 +40262,7 @@ - GETTEXT_MACRO_VERSION=0.20 + GETTEXT_MACRO_VERSION=0.19 @@ -35306,7 +40377,12 @@ - case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; + *) MSGFMT_015=$MSGFMT ;; + esac + + case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac @@ -35458,15 +40534,7 @@ fi - if LC_ALL=C $MSGMERGE --help | grep ' --for-msgfmt ' >/dev/null; then - MSGMERGE_FOR_MSGFMT_OPTION='--for-msgfmt' - else - if LC_ALL=C $MSGMERGE --help | grep ' --no-fuzzy-matching ' >/dev/null; then - MSGMERGE_FOR_MSGFMT_OPTION='--no-fuzzy-matching --no-location --quiet' - else - MSGMERGE_FOR_MSGFMT_OPTION='--no-location --quiet' - fi - fi + test -n "$localedir" || localedir='${datadir}/locale' test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= @@ -35498,6 +40566,7 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5 $as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; } if ${gt_cv_func_CFPreferencesCopyAppValue+:} false; then : @@ -35618,21 +40687,16 @@ /* end confdefs.h. */ #include -#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +$gt_revision_test_code 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 + __GNU_GETTEXT_SYMBOL_EXPRESSION +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings ; return 0; @@ -35774,8 +40838,9 @@ main () { int result = 0; - /* Test against AIX 5.1 bug: Failures are not distinguishable from successful - returns. */ + /* Test against AIX 5.1...7.2 bug: Failures are not distinguishable from + successful returns. This is even documented in + */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) @@ -36355,7 +41420,14 @@ fi ;; -l*) - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + dep=`echo "X$dep" | sed -e 's/^X-l//'` + if test "X$dep" != Xc \ + || case $host_os in + linux* | gnu* | k*bsd*-gnu) false ;; + *) true ;; + esac; then + names_next_round="$names_next_round $dep" + fi ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` @@ -36419,25 +41491,20 @@ /* end confdefs.h. */ #include -#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +$gt_revision_test_code 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 + __GNU_GETTEXT_SYMBOL_EXPRESSION +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ; return 0; @@ -36456,25 +41523,20 @@ /* end confdefs.h. */ #include -#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +$gt_revision_test_code 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 + __GNU_GETTEXT_SYMBOL_EXPRESSION +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ; return 0; @@ -37301,7 +42363,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.7, which was +This file was extended by GNU datamash $as_me 1.8-dirty, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -37365,7 +42427,7 @@ Configuration commands: $config_commands -Report bugs to . +Report bugs to . GNU datamash home page: . General help using GNU software: ." @@ -37373,7 +42435,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.7 +GNU datamash config.status 1.8-dirty configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -37495,8 +42557,9 @@ AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" GNUmakefile=$GNUmakefile # Capture the value of obsolete ALL_LINGUAS because we need it to compute - # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. - OBSOLETE_ALL_LINGUAS="$ALL_LINGUAS" + # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it + # from automake < 1.5. + eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" @@ -38224,7 +43287,9 @@ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE=\"gmake\" (or whatever is + necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } @@ -38273,11 +43338,14 @@ if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi - ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` + ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assignment from automake < 1.5. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. - ALL_LINGUAS=$OBSOLETE_ALL_LINGUAS + # Hide the ALL_LINGUAS assignment from automake < 1.5. + eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) diff -Nru datamash-1.7/configure.ac datamash-1.8/configure.ac --- datamash-1.7/configure.ac 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/configure.ac 2022-05-28 02:52:43.000000000 +0000 @@ -1,4 +1,4 @@ -dnl Copyright (C) 2013-2020 Assaf Gordon +dnl Copyright (C) 2013-2021 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 @@ -10,7 +10,7 @@ AC_INIT([GNU datamash], [m4_esyscmd([build-aux/git-version-gen .tarball-version])], - [assafgordon@gmail.com], [], + [bug-datamash@gnu.org], [], [https://www.gnu.org/software/datamash]) dnl Must come before AM_INIT_AUTOMAKE. @@ -107,6 +107,8 @@ [Define to 1 if strtold does not work properly (e.g. in cygwin)]) fi +## Look for OpenBSD pledge(2) +AC_CHECK_FUNCS([pledge]) ## Check for bash-completion using pkg-config ## ./configure --with-bash-completion-dir=[no|local|global|PATH] . @@ -132,16 +134,31 @@ [test "x$with_bash_completion_dir" != "xno"]) +## Prefer gsort over sort to get GNU coreutils version on non-GNU +## userspace OSes if available. +AC_PATH_PROGS([SORT_PATH], [gsort sort], + [AC_MSG_ERROR([could not find a sort program])]) +AC_DEFINE_UNQUOTED([SORT_PATH], "$SORT_PATH", [Absolute path to sort command]) + ## ## Check if the system's sort support "-s" (stable) sort. ## 'sort' from GNU Coreutils, FreeBSD, OpenBSD, Busybox support it. ## DilOS (illumos/opensolaris) does not. ## -if sort -s < /dev/null > /dev/null 2>/dev/null ; then +if ${SORT_PATH} -s < /dev/null > /dev/null 2>/dev/null ; then AC_DEFINE([HAVE_STABLE_SORT],[1], [Define to 1 if sort on this system supports -s for stable sorting]) fi +## +## Check if the system's sort supports "-z" for NUL line delimiters +## +if ${SORT_PATH} -z < /dev/null > /dev/null 2>/dev/null ; then + AC_DEFINE([HAVE_ZERO_SORT],[1], + [Define to 1 if sort on this system supports -z + for NUL line delimiters]) +fi + ## Are we building from git checked-out sources? ## (if not, assume it's from a tarball) ## This is used in "Makefile.am" to avoid re-generating the manpage diff -Nru datamash-1.7/contrib/bash-completion/datamash datamash-1.8/contrib/bash-completion/datamash --- datamash-1.7/contrib/bash-completion/datamash 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/contrib/bash-completion/datamash 2022-06-02 21:44:41.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/bash # datamash bash-completion # -## Copyright (C) 2014-2020 Assaf Gordon +## Copyright (C) 2014-2021 Assaf Gordon ## ## This file is part of GNU Datamash. ## @@ -26,22 +26,24 @@ # or the regex will fail. local groupby_ops="sum min max absmin absmax range \ count first last rand \ -unique collapse countunique \ -mean trimmean median q1 q3 iqr perc mode antimode \ +unique uniq collapse countunique \ +mean geomean harmmean trimmean median q1 q3 iqr perc mode antimode \ pstdev sstdev pvar svar mad madraw \ pskew sskew pkurt skurt dpo jarque \ -pcov scov ppearson spearson strbin" +pcov scov ppearson spearson" local groupby_ops_re=${groupby_ops// /|} - local line_ops="base64 debase64 md5 sha1 sha256 sha512 \ -round floor ceil trunc frac bin dirname basename extname barename cut" + local line_ops="base64 debase64 md5 sha1 sha224 sha256 sha384 sha512 \ +round floor ceil trunc frac bin strbin dirname basename extname barename \ +getnum cut echo" local line_ops_re=${line_ops// /|} - local datamash_short_options="-C -f -g -H -i -s -t -W -z" + local datamash_short_options="-c -C -f -g -H -i -s -t -R -W -z" - local datamash_long_options="--full --group --header-in --header-out --headers - --ignore-case --sort --no-strict --filler --field-separator --whitespace - --zero-terminated --help --version --output-delimiter --skip-comments" + local datamash_long_options=" --skip-comments --full --group --header-in + --header-out --headers --ignore-case --sort --no-strict --filler --format + --field-separator --narm --output-delimiter --round --whitespace + --zero-terminated --collapse-delimiter --help --version" local all_ops_re="$modes_re|$groupby_ops_re|$line_ops_re" diff -Nru datamash-1.7/datamash.1 datamash-1.8/datamash.1 --- datamash-1.7/datamash.1 2020-04-23 17:34:22.000000000 +0000 +++ datamash-1.8/datamash.1 2022-07-23 02:00:59.000000000 +0000 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3. -.TH DATAMASH "1" "April 2020" "datamash 1.7" "User Commands" +.TH DATAMASH "1" "July 2022" "datamash 1.8-dirty" "User Commands" .SH NAME datamash - command-line calculations .SH SYNOPSIS @@ -35,9 +35,10 @@ .SS "Statistical Grouping operations:" .IP mean, geomean, harmmean, trimmean, median, q1, q3, iqr, perc, -mode, antimode, pstdev, sstdev, pvar, svar, mad, madraw, +mode, antimode, pstdev, sstdev, pvar, svar, ms, rms, mad, madraw, pskew, sskew, pkurt, skurt, dpo, jarque, scov, pcov, spearson, ppearson +.SH OPTIONS .SS "Grouping Options:" .TP \fB\-C\fR, \fB\-\-skip\-comments\fR @@ -47,6 +48,11 @@ \fB\-f\fR, \fB\-\-full\fR print entire input line before op results (default: print only the grouped keys) +.IP +This option is only sensible for linewise +operations. Other uses are deprecated and +will be removed in a future version of GNU +Datamash. .TP \fB\-g\fR, \fB\-\-group\fR=\fI\,X[\/\fR,Y,Z] group via fields X,[Y,Z]; @@ -68,13 +74,17 @@ \fB\-s\fR, \fB\-\-sort\fR sort the input before grouping; this removes the need to manually pipe the input through 'sort' +.TP +\fB\-c\fR, \fB\-\-collapse\-delimiter\fR=\fI\,X\/\fR +use X to separate elements in collapse and +unique lists (default: comma) .SS "File Operation Options:" .TP \fB\-\-no\-strict\fR allow lines with varying number of fields .TP \fB\-\-filler\fR=\fI\,X\/\fR -fill missing values with X (default %s) +fill missing values with X (default N/A) .SS "General Options:" .TP \fB\-t\fR, \fB\-\-field\-separator\fR=\fI\,X\/\fR @@ -101,23 +111,23 @@ \fB\-z\fR, \fB\-\-zero\-terminated\fR end lines with 0 byte, not newline .TP +\fB\-\-sort\-cmd=\fR/path/to/sort +Alternative sort(1) to use. +.TP \fB\-\-help\fR display this help and exit .TP \fB\-\-version\fR output version information and exit -.SH OPTIONS .PP .SH AVAILABLE OPERATIONS .PP .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. +primary operation must be listed first. 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" @@ -182,7 +192,7 @@ .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 +floor (round down), ceil (ceiling, round up), trunc (truncate, round towards zero), frac (fraction, return fraction part of a decimal-point value). .TP @@ -204,8 +214,9 @@ n/i/d/p/h/o (see examples below). .TP -.B cut +.B cut/echo copy input field to output field (similar to cut(1)). +The echo command is simply an alias to cut. .PP @@ -255,8 +266,9 @@ one random value from the group .TP -.B unique +.B unique/uniq comma-separated sorted list of unique values +The uniq command is simply an alias to unique. .TP .B collapse @@ -269,7 +281,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). @@ -294,6 +306,14 @@ to \fBmedian\fR). .TP +.B ms +mean square of the values + +.TP +.B rms +root mean square of the values + +.TP .B median median value @@ -437,7 +457,7 @@ .SS "Header lines" .PP -Use \fB\-h\fR \fB(\-\-headers)\fR if the input file has a header line: +Use \fB\-H\fR \fB(\-\-headers)\fR if the input file has a header line: .PP .nf .RS @@ -449,7 +469,7 @@ Christian Business 88 Derek Arts 60 -# Calculate the mean and standard devian for each major +# Calculate the mean and standard deviation for each major $ \fBdatamash\fR \-\-sort \-\-headers \-\-group 2 mean 3 pstdev 3 < scores_h.txt (or use short form) @@ -488,8 +508,8 @@ .SS "Skipping comment lines" -Use \fB\-C\fR \fB(\-\-skip\-comments)\fR to skip lines starting with \'#\' -or \'\;\' characters (and optional whitespace before them): +Use \fB\-C\fR \fB(\-\-skip\-comments)\fR to skip lines starting with '#' +or '\;' characters (and optional whitespace before them): .PP .nf .RS @@ -714,9 +734,9 @@ $ ( echo X ; seq \-10 2.5 10 ) \\ | \fBdatamash\fR \-H \-\-full bin:5 1 X bin(X) -\-10.0 \-15 +\-10.0 \-10 \-7.5 \-10 - \-5.0 \-10 + \-5.0 \-5 \-2.5 \-5 0.0 0 2.5 0 @@ -823,10 +843,14 @@ See .UR https://www.gnu.org/software/datamash GNU Datamash Website (https://www.gnu.org/software/datamash) +.SH ENVIRONMENT +.TP +LC_NUMERIC +decimal\-point character and thousands separator .SH AUTHOR -Written by Assaf Gordon. +Written by Assaf Gordon, Tim Rice, Shawn Wagner, Erik Auerswald. .SH COPYRIGHT -Copyright \(co 2020 Assaf Gordon +Copyright \(co 2022 Assaf Gordon and Tim Rice 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.7/debian/changelog datamash-1.8/debian/changelog --- datamash-1.7/debian/changelog 2021-02-19 17:03:04.000000000 +0000 +++ datamash-1.8/debian/changelog 2023-08-27 02:10:38.000000000 +0000 @@ -1,3 +1,10 @@ +datamash (1.8-1) unstable; urgency=medium + + * Team upload. + * New upstream release + + -- Dima Kogan Sat, 26 Aug 2023 19:10:38 -0700 + datamash (1.7-2) unstable; urgency=medium * Team upload. diff -Nru datamash-1.7/debian/copyright datamash-1.8/debian/copyright --- datamash-1.7/debian/copyright 2020-09-23 14:09:58.000000000 +0000 +++ datamash-1.8/debian/copyright 2023-08-17 21:57:36.000000000 +0000 @@ -2,14 +2,67 @@ Upstream-Name: datamash Source: https://savannah.gnu.org/projects/datamash Files: lib/iconv_open*.h + Makefile.in + aclocal.m4 Comment: Generated files Files: * -Copyright: 2013-2018 Assaf Gordon +Copyright: 2013-2021 Assaf Gordon License: GPL-3+ +Files: GNUmakefile + build-aux/announce-gen + build-aux/config.rpath + build-aux/config.sub + build-aux/depcomp + build-aux/do-release-commit-and-tag + build-aux/gendocs.sh + build-aux/git-version-gen + build-aux/gitlog-to-changelog + build-aux/gnu-web-doc-update + build-aux/gnupload + build-aux/mdate-sh + build-aux/missing + build-aux/pmccabe2html + build-aux/prefix-gnulib-mk + build-aux/test-driver + build-aux/texinfo.tex + build-aux/update-copyright + build-aux/useless-if-before-free + build-aux/vc-list-files + configure + init.cfg + lib/* + m4/* + maint.mk + po/da.po + po/de.po + po/eo.po + po/es.po + po/fr.po + po/nb.po + po/nl.po + po/pt_BR.po + po/uk.po + po/vi.po + src/die.h + src/double-format.c + src/key-compare.c + src/key-compare.h + src/system.h + tests/Coreutils.pm + tests/CuSkip.pm + tests/CuTmpdir.pm + tests/init.sh +Copyright: 1985-2023 Free Software Foundation, Inc +License: GPL-3+ + +Files: build-aux/install.sh +Copyright: 1994 X Consortium +License: MIT-X + Files: doc/datamash.* -Copyright: 2014 Assaf Gordon +Copyright: 2014-2021 Assaf Gordon License: GFDL-NIV-1.3 Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, @@ -20,6 +73,22 @@ On Debian systems, the complete text of the GNU Free Documentation License version 1.3 can be found in `/usr/share/common-licenses/GFDL-1.3'. +Files: datamash.1 +Copyright: 2022 Assaf Gordon and Tim Rice +License: GPL-3+ + +Files: src/utils.h + tests/datamash-i18n-de.pl + tests/datamash-sort-header.pl + tests/datamash-sort-header-deprecated.pl +Copyright: 2013-2021 Assaf Gordon + 2022 Tim Rice +License: GPL-3+ + +Files: tests/datamash-io-errors-cheap.sh +Copyright: 2022 Erik Auerswald +License: GPL-3+ + Files: debian/* Copyright: 2014-2018 Alejandro Garrido Mota License: GPL-3+ @@ -32,3 +101,26 @@ . On Debian systems, the complete text of the GNU General Public License version 3 can be found in `/usr/share/common-licenses/GPL-3'. + +License: MIT-X + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- + TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + . + Except as contained in this notice, the name of the X Consortium shall not + be used in advertising or otherwise to promote the sale, use or other deal- + ings in this Software without prior written authorization from the X Consor- + tium. diff -Nru datamash-1.7/debian/patches/fix-manpage.diff datamash-1.8/debian/patches/fix-manpage.diff --- datamash-1.7/debian/patches/fix-manpage.diff 2020-09-23 14:09:58.000000000 +0000 +++ datamash-1.8/debian/patches/fix-manpage.diff 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -From: Alejandro Garrido Mota -Date: Wed, 15 Mar 2017 14:44:02 +0000 -Subject: Fix manpage spelling and single quotes -Forwarded: no - -Index: datamash/datamash.1 -=================================================================== ---- datamash.orig/datamash.1 -+++ datamash/datamash.1 -@@ -269,7 +269,7 @@ number of unique/distinct values - - - .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). -@@ -488,8 +488,8 @@ $ datamash -H sum "FOO\\\\\-BAR" < input - - - .SS "Skipping comment lines" --Use \fB\-C\fR \fB(\-\-skip\-comments)\fR to skip lines starting with \'#\' --or \'\;\' characters (and optional whitespace before them): -+Use \fB\-C\fR \fB(\-\-skip\-comments)\fR to skip lines starting with '#' -+or '\;' characters (and optional whitespace before them): - .PP - .nf - .RS diff -Nru datamash-1.7/debian/patches/series datamash-1.8/debian/patches/series --- datamash-1.7/debian/patches/series 2020-09-23 14:09:58.000000000 +0000 +++ datamash-1.8/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -fix-manpage.diff diff -Nru datamash-1.7/decorate.1 datamash-1.8/decorate.1 --- datamash-1.7/decorate.1 2020-04-23 17:34:22.000000000 +0000 +++ datamash-1.8/decorate.1 2022-07-23 02:00:59.000000000 +0000 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3. -.TH DECORATE "1" "April 2020" "decorate 1.7" "User Commands" +.TH DECORATE "1" "July 2022" "decorate 1.8-dirty" "User Commands" .SH NAME -decorate - command-line calculations +decorate - convert fields of various formats .SH SYNOPSIS .B decorate [\fI\,OPTION\/\fR]... [\fI\,INPUT\/\fR] @@ -22,6 +22,20 @@ .PP Without \fB\-\-decorate\fR and \fB\-\-undecorate\fR: automatically decorates the input, runs sort(1) and undecorates the result; This is the easiest method to use. +The \fBdecorate\fR program allows sorting input according to various +ordering, e.g. IP addresses, roman numerals, etc. +It works in tandem with sort(1) to perform the actual sorting. + +The idea was suggested by +.UR https://lists.gnu.org/r/bug-coreutils/2015-06/msg00076.html +Pádraig Brady in https://lists.gnu.org/r/bug-coreutils/2015-06/msg00076.html: + +1. Decorate: convert the input to a sortable-format as additional fields +.br +2. Sort according to the inserted fields +.br +3. Undecorate: remove the inserted fields +.SH OPTIONS .SS "General Options:" .TP \fB\-\-decorate\fR @@ -55,13 +69,16 @@ \fB\-z\fR, \fB\-\-zero\-terminated\fR line delimiter is NUL, not newline .TP +\fB\-\-sort\-cmd=\fR/path/to/sort +Alternative sort(1) to use. +.TP \fB\-\-help\fR display this help and exit .TP \fB\-\-version\fR output version information and exit .PP -The following options are passed to sort(1) as\-is: +The following options are passed to sort as\-is (Most of them assume GNU sort): .HP \fB\-c\fR, \fB\-\-check\fR .HP @@ -100,23 +117,13 @@ .TP ipv4inet number\-and\-dots IPv4 addresses (incl. octal, hex values) +.TP +ipv6v4map +IPv6 and IPv4 (as IPv4\-Mapped IPv6) addresses +.TP +ipv6v4comp +IPv6 and IPv4 (as IPv4\-Compatible IPv6) addresses .SH EXAMPLES - -.SH OVERVIEW -The \fBdecorate\fR program allows sorting input according to various -ordering, e.g. IP addresses, roman numerals, etc. -It works in tandem with sort(1) to perform the actual sorting. - -The idea was suggested by -.UR https://lists.gnu.org/r/bug-coreutils/2015-06/msg00076.html -Pádraig Brady in https://lists.gnu.org/r/bug-coreutils/2015-06/msg00076.html: - -1. Decorate: convert the input to a sortable-format as additional fields -.br -2. Sort according to the inserted fields -.br -3. Undecorate: remove the inserted fields - Example of preparing to sort by roman numerals: .PP .nf @@ -170,9 +177,9 @@ .UR https://www.gnu.org/software/datamash GNU Datamash Website (https://www.gnu.org/software/datamash) .SH AUTHOR -Written by Assaf Gordon. +Written by Assaf Gordon, Shawn Wagner and Erik Auerswald. .SH COPYRIGHT -Copyright \(co 2020 Assaf Gordon +Copyright \(co 2022 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.7/doc/datamash.info datamash-1.8/doc/datamash.info --- datamash-1.7/doc/datamash.info 2020-04-23 17:34:26.000000000 +0000 +++ datamash-1.8/doc/datamash.info 2022-07-23 00:59:45.000000000 +0000 @@ -1,10 +1,10 @@ -This is datamash.info, produced by makeinfo version 6.5 from +This is datamash.info, produced by makeinfo version 6.8 from datamash.texi. -This manual is for GNU Datamash (version 1.7, 23 April 2020), which +This manual is for GNU Datamash (version 1.8, 10 July 2022), which provides command-line computations on input files. - Copyright (C) 2014-2020 Assaf Gordon. + Copyright (C) 2014-2021 Assaf Gordon. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, @@ -23,7 +23,7 @@ Datamash ******** -This manual is for GNU Datamash (version 1.7, 23 April 2020), which +This manual is for GNU Datamash (version 1.8, 10 July 2022), which provides command-line computations on input files. * Menu: @@ -82,7 +82,7 @@ 'datamash' has a rich set of statistical functions to quickly assess information in textual input files. An example of calculating basic -statistic (mean, 1st quartile, median, 3rd quarile, IQR, +statistic (mean, 1st quartile, median, 3rd quartile, IQR, sample-standard-deviation, and p-value of Jarque-Bera test for normal distribution: @@ -106,6 +106,9 @@ every group. If '--group' is not used, each operation is performed on all the values in the input file. + The 'LC_NUMERIC' locale specifies the decimal-point character and the +thousands separator. + 'datamash' supports the following operations: Primary operations: @@ -118,27 +121,35 @@ 'base64', 'debase64', 'md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'bin', 'strbin', 'round', 'floor', 'ceil', 'trunc', 'frac', 'dirname', 'basename', 'extname', 'barename', 'getnum', - 'cut' + 'cut', 'echo' Group-by Numeric operations: 'sum', 'min', 'max', 'absmin', 'absmax', 'range' Group-by Textual/Numeric operations: - 'count', 'first', 'last', 'rand', 'unique', 'collapse', + 'count', 'first', 'last', 'rand', 'unique', 'uniq', 'collapse', 'countunique' Group-by Statistical operations: - 'mean', 'mode', 'median', 'q1', 'q3', 'iqr', 'perc', 'antimode', - 'pstdev', 'sstdev', 'pvar', 'svar', 'mad', 'madraw', 'sskew', - 'pskew', 'skurt', 'pkurt', 'jarque', 'dpo', 'scov', 'pcov', - 'spearson', 'ppearson' + 'mean', 'geomean', 'harmmean', 'mode', 'median', 'q1', 'q3', 'iqr', + 'perc', 'antimode', 'pstdev', 'sstdev', 'pvar', 'svar', 'ms', + 'rms', 'mad', 'madraw', 'sskew', 'pskew', 'skurt', 'pkurt', + 'jarque', 'dpo', 'scov', 'pcov', 'spearson', 'ppearson' Grouping options: +'--skip-comments' +'-C' + Skip comment lines (starting with '#' or ';' and optional + whitespace). + '--full' '-f' Print entire input line before op results (default: print only the - grouped keys). + grouped keys). While using this option with non-linewise + operations was historically permitted, it never produced very + sensible output. Such usage has been deprecated, and in a future + release it will result in an error. '--group=X[,Y,X]' '-g X[,Y,X]' @@ -169,8 +180,8 @@ '--ignore-case' '-i' Ignore upper/lower case when comparing text for grouping, sorting, - and comparing unique values in the 'countunique' and 'unique' - operations. + and comparing unique values in the 'countunique' and 'unique' (or + 'uniq') operations. '--sort' '-s' @@ -183,6 +194,9 @@ $ cat FILE | sort -k1,1 | datamash --group 1 sum 1 $ cat FILE | datamash --sort --group 1 sum 1 +'--sort-cmd=PATH' + Use the given program to sort instead of the system 'sort' + File Operation options: '--no-strict' @@ -212,6 +226,12 @@ Use character X instead as output field delimiter. This option overrides '--field-separator'/'-t'/ '--whitespace'/'-W'. +'--collapse-delimiter=X' +'-c X' + + Use character X instead of comma to delimit items in a 'collapse' + or 'unique' (aka 'uniq') list. + '--round=N' '-R N' Round numeric output to N decimal places. @@ -219,9 +239,10 @@ '--whitespace' '-W' Use whitespace (one or more spaces and/or tabs) for field - delimiters. TAB character will be used as output field separator. - If '--output-delimiter' is also used, it will override the output - field delimiter. + delimiters. Leading whitespace is ignored, trailing whitespace + results in an empty field. TAB character will be used as output + field separator. If '--output-delimiter' is also used, it will + override the output field delimiter. '--zero-terminated' '-z' @@ -296,7 +317,11 @@ single letter option 'n/i/d/p/h/o' affecting the detected value. 'cut' - copy input field to output field (similar to 'cut(1)'). + copy input field to output field (similar to 'cut(1)'). When + the 'cut' operation is given a list of fields, the fields are + copied in the given order (in contrast to 'cut(1)'). + 'echo' + an alias for 'cut'. Group-by Numeric operations: @@ -325,8 +350,18 @@ one random value from the group 'unique' comma-separated sorted list of unique values + 'uniq' + an alias for 'unique'. + + '--collapse-delimiter' can be used to use a different + character than comma. + 'collapse' comma-separated list of all input values + + '--collapse-delimiter' can be used to use a different + character than comma. + 'countunique' number of unique/distinct values @@ -340,6 +375,10 @@ harmonic mean of the values 'trimmean' trimmed mean of the values + 'ms' + mean square of the values + 'rms' + root mean square of the values 'median' median value 'q1' @@ -406,7 +445,7 @@ * 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 +* Field Delimiters:: Tabs, Whitespace, other delimiters * Column Ranges:: Operating on multiple columns * Reverse and Transpose:: swapping and transposing rows, columns * Groupby on /etc/passwd:: Groupby, count, collapse @@ -446,7 +485,7 @@ Life-Sciences 12 Social-Sciences 15 - Similary, find the minimum and maximum score in each subject: + Similarly, find the minimum and maximum score in each subject: $ datamash --sort groupby 2 min 3 max 3 < scores.txt Arts 46 88 @@ -466,7 +505,7 @@ Life-Sciences 55.333 19.728 Social-Sciences 60.266 16.643 - Find the median, first, third quariles and the inter-quartile range + Find the median, first, third quartiles and the inter-quartile range in each subject: $ datamash --sort groupby 2 median 3 q1 3 q3 3 iqr 3 < scores.txt @@ -587,24 +626,28 @@  File: datamash.info, Node: Field Delimiters, Next: Column Ranges, Prev: Header Lines and Column Names, Up: Usage Examples -5.3 Field Delimiteres -===================== +5.3 Field Delimiters +==================== -'datamash' uses tabs (ascii character 0x09) as default field delimiters. +'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'): + By default, fields are separated by a single tab. Multiple tabs +denotes multiple fields (this is consistent with GNU coreutils' 'cut'): $ printf '1\t\t2\n' | datamash sum 3 2 $ printf '1\t\t2\n' | cut -f3 2 + Every tab separates two fields. A line starting with a tab thus +starts with an empty field, and a line ending with a tab ends with an +empty field. + Using '-W', one or more consecutive whitespace characters are treated as a single field delimiter: @@ -613,6 +656,12 @@ $ printf '1 \t 2\n' | datamash -W sum 3 datamash: invalid input: field 3 requested, line 1 has only 2 fields + With '-W', leading whitespace is ignored, but trailing whitespace is +significant. A line starting with one or more consecutive whitespace +characters followed by a non-whitespace character starts with a +non-empty field. A line ending with one or more consecutive whitespace +characters ends with an empty field. + Using '-t', a custom field delimiter character can be specified. Multiple consecutive delimiters are treated as multiple fields: @@ -729,7 +778,7 @@ 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). +disable this behavior (see section above for an example). Combining Reverse and Transpose ------------------------------- @@ -775,7 +824,7 @@ 'datamash' with the 'groupby' operation mode can be used to aggregate information. - Using this simuated '/etc/passwd' file as input: + Using this simulated '/etc/passwd' file as input: $ cat passwd root:x:0:0:root:/root:/bin/bash @@ -1008,6 +1057,15 @@ a 3,40 7 b 21 N/A + Note that using '--header-out' with crosstab prints a line showing +how to interpret the rows and columns, and what operation was used. + + $ datamash -s --header-in --header-out crosstab 1,2 < input.txt + GroupBy(a) GroupBy(x) count(a) + x y + a 1 1 + b 1 N/A +  File: datamash.info, Node: Rounding numbers, Next: Binning numbers, Prev: Crosstab, Up: Usage Examples @@ -1043,9 +1101,9 @@ $ ( echo X ; seq -10 2.5 10 ) \ | datamash -H --full bin:5 1 X bin(X) - -10.0 -15 + -10.0 -10 -7.5 -10 - -5.0 -10 + -5.0 -5 -2.5 -5 0.0 0 2.5 0 @@ -1162,7 +1220,7 @@ When in doubt whether something is needed or not, include it. It's better to include too much than to leave out something important. - Patches are welcome; if possible, please make them with 'diff -c' + Patches are welcome; if possible, please make them with 'diff -u' (*note Overview: (diff)Top.) and include 'ChangeLog' entries (*note (emacs)Change Log::). Please follow the existing coding style. @@ -1572,7 +1630,7 @@ the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See - . + . Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered @@ -1657,50 +1715,57 @@ [index] * Menu: -* --field-separator: Invoking datamash. (line 111) +* --collapse-delimiter: Invoking datamash. (line 138) +* --field-separator: Invoking datamash. (line 125) * --field-separator <1>: Groupby on /etc/passwd. (line 39) -* --filler: Invoking datamash. (line 101) +* --filler: Invoking datamash. (line 115) * --filler <1>: Reverse and Transpose. (line 45) -* --format: Invoking datamash. (line 107) -* --full: Invoking datamash. (line 47) -* --group: Invoking datamash. (line 52) -* --header-in: Invoking datamash. (line 59) +* --format: Invoking datamash. (line 121) +* --full: Invoking datamash. (line 55) +* --group: Invoking datamash. (line 63) +* --header-in: Invoking datamash. (line 70) * --header-in <1>: Header Lines and Column Names. (line 25) -* --header-out: Invoking datamash. (line 63) +* --header-out: Invoking datamash. (line 74) * --header-out <1>: Header Lines and Column Names. (line 6) -* --headers: Invoking datamash. (line 72) +* --header-out <2>: Crosstab. (line 43) +* --headers: Invoking datamash. (line 83) * --headers <1>: Header Lines and Column Names. (line 54) -* --help: Invoking datamash. (line 138) -* --ignore-case: Invoking datamash. (line 78) -* --narm: Invoking datamash. (line 116) -* --no-strict: Invoking datamash. (line 96) +* --help: Invoking datamash. (line 159) +* --ignore-case: Invoking datamash. (line 89) +* --narm: Invoking datamash. (line 130) +* --no-strict: Invoking datamash. (line 110) * --no-strict <1>: Reverse and Transpose. (line 40) -* --output-delimiter: Invoking datamash. (line 119) -* --round: Invoking datamash. (line 124) -* --sort: Invoking datamash. (line 84) -* --version: Invoking datamash. (line 142) -* --whitespace: Invoking datamash. (line 128) -* --zero-terminated: Invoking datamash. (line 135) -* -f: Invoking datamash. (line 47) -* -g: Invoking datamash. (line 52) -* -H: Invoking datamash. (line 72) +* --output-delimiter: Invoking datamash. (line 133) +* --round: Invoking datamash. (line 144) +* --skip-comments: Invoking datamash. (line 50) +* --sort: Invoking datamash. (line 95) +* --sort-cmd: Invoking datamash. (line 105) +* --version: Invoking datamash. (line 163) +* --whitespace: Invoking datamash. (line 148) +* --zero-terminated: Invoking datamash. (line 156) +* -C: Invoking datamash. (line 50) +* -c: Invoking datamash. (line 138) +* -f: Invoking datamash. (line 55) +* -g: Invoking datamash. (line 63) +* -H: Invoking datamash. (line 83) * -H <1>: Header Lines and Column Names. (line 54) -* -i: Invoking datamash. (line 78) -* -R: Invoking datamash. (line 124) -* -s: Invoking datamash. (line 84) -* -t: Invoking datamash. (line 111) -* -t <1>: Invoking datamash. (line 119) +* -header-out, crosstab and: Crosstab. (line 43) +* -i: Invoking datamash. (line 89) +* -R: Invoking datamash. (line 144) +* -s: Invoking datamash. (line 95) +* -t: Invoking datamash. (line 125) +* -t <1>: Invoking datamash. (line 133) * -t <2>: Groupby on /etc/passwd. (line 39) -* -W: Invoking datamash. (line 128) -* -z: Invoking datamash. (line 135) +* -W: Invoking datamash. (line 148) +* -z: Invoking datamash. (line 156) * /etc/passwd, examples: Groupby on /etc/passwd. (line 6) * bin: Binning numbers. (line 6) @@ -1727,6 +1792,7 @@ * count, crosstab and: Crosstab. (line 15) * cross tabulation: Crosstab. (line 6) * crosstab: Crosstab. (line 6) +* crosstab and -header-out: Crosstab. (line 43) * crosstab and sum: Crosstab. (line 29) * crosstab and unique: Crosstab. (line 36) * delimiters, tabs: Field Delimiters. (line 6) @@ -1770,7 +1836,7 @@ * groupby, and count: Groupby on /etc/passwd. (line 42) * grouping: Overview. (line 30) -* grouping <1>: Invoking datamash. (line 52) +* grouping <1>: Invoking datamash. (line 63) * header, examples: Header Lines and Column Names. (line 6) * header-in, examples: Header Lines and Column Names. @@ -1783,6 +1849,7 @@ * input validation, transpose: Reverse and Transpose. (line 23) * invoking: Invoking datamash. (line 6) +* LC_NUMERIC: Invoking datamash. (line 16) * line filtering operation: Available Operations. (line 21) * login shell, examples: Groupby on /etc/passwd. @@ -1797,21 +1864,21 @@ * numbers, extracting from a field: Extracting numeric values. (line 6) * numeric operations: Available Operations. - (line 64) + (line 68) * operations, line filtering: Available Operations. (line 21) * operations, numeric: Available Operations. - (line 64) + (line 68) * operations, per-line: Available Operations. (line 26) * operations, primary: Available Operations. (line 7) * operations, statistical: Available Operations. - (line 96) + (line 110) * operations, statistical <1>: Statistical Operations. (line 6) * operations, textual: Available Operations. - (line 79) + (line 83) * options: Invoking datamash. (line 6) * overview: Overview. (line 6) * patches, contributing: Reporting bugs. (line 26) @@ -1836,10 +1903,11 @@ * rounding numbers: Rounding numbers. (line 6) * shell scripts, check: Check. (line 88) * sorting: Overview. (line 30) -* sorting <1>: Invoking datamash. (line 84) -* standard devian, examples: Summary Statistics. (line 39) +* sorting <1>: Invoking datamash. (line 95) +* sorting <2>: Invoking datamash. (line 105) +* standard deviation, examples: Summary Statistics. (line 39) * Statistical operations: Available Operations. - (line 96) + (line 110) * statistical operations: Statistical Operations. (line 5) * statistics: Statistical Operations. @@ -1860,7 +1928,7 @@ * tac: Reverse and Transpose. (line 78) * Textual operations: Available Operations. - (line 79) + (line 83) * transpose: Reverse and Transpose. (line 9) * transpose, and reverse: Reverse and Transpose. @@ -1883,26 +1951,31 @@  Tag Table: -Node: Top750 -Node: Overview1405 -Node: Invoking datamash3295 -Node: Available Operations8049 -Node: Statistical Operations12158 -Node: Usage Examples12714 -Node: Summary Statistics13662 -Node: Header Lines and Column Names15736 -Node: Field Delimiters19139 -Node: Column Ranges20303 -Node: Reverse and Transpose21252 -Node: Groupby on /etc/passwd24120 -Node: Check27138 -Node: Crosstab30216 -Node: Rounding numbers31393 -Node: Binning numbers32421 -Node: Binning strings32882 -Node: Extracting numeric values33761 -Node: Reporting bugs34927 -Node: GNU Free Documentation License36210 -Node: Concept index61370 +Node: Top749 +Node: Overview1403 +Node: Invoking datamash3294 +Node: Available Operations8843 +Node: Statistical Operations13474 +Node: Usage Examples14030 +Node: Summary Statistics14977 +Node: Header Lines and Column Names17053 +Node: Field Delimiters20456 +Node: Column Ranges22082 +Node: Reverse and Transpose23031 +Node: Groupby on /etc/passwd25898 +Node: Check28917 +Node: Crosstab31995 +Node: Rounding numbers33470 +Node: Binning numbers34498 +Node: Binning strings34959 +Node: Extracting numeric values35838 +Node: Reporting bugs37004 +Node: GNU Free Documentation License38287 +Node: Concept index63447  End Tag Table + + +Local Variables: +coding: utf-8 +End: diff -Nru datamash-1.7/doc/datamash.texi datamash-1.8/doc/datamash.texi --- datamash-1.7/doc/datamash.texi 2020-04-23 04:02:11.000000000 +0000 +++ datamash-1.8/doc/datamash.texi 2022-07-10 20:57:04.000000000 +0000 @@ -9,13 +9,14 @@ @c Combine everything into one index (arbitrarily chosen to be the @c concept index). @syncodeindex op cp +@syncodeindex vr cp @c %**end of header @copying This manual is for GNU Datamash (version @value{VERSION}, @value{UPDATED}), which provides command-line computations on input files. -Copyright @copyright{} 2014-2020 Assaf Gordon. +Copyright @copyright{} 2014--2021 Assaf Gordon. @quotation Permission is granted to copy, distribute and/or modify this document @@ -124,7 +125,7 @@ @command{datamash} has a rich set of statistical functions to quickly assess information in textual input files. An example of calculating basic statistic -(mean, 1st quartile, median, 3rd quarile, IQR, sample-standard-deviation, +(mean, 1st quartile, median, 3rd quartile, IQR, sample-standard-deviation, and p-value of Jarque-Bera test for normal distribution: @cindex example, statistics @@ -157,6 +158,10 @@ on every group. If @option{--group} is not used, each operation is performed on all the values in the input file. +@vindex LC_NUMERIC +The @env{LC_NUMERIC} locale specifies the decimal-point character and the +thousands separator. + @exdent @command{datamash} supports the following operations: @table @asis @@ -172,21 +177,22 @@ @code{sha224}, @code{sha256}, @code{sha384}, @code{sha512}, @code{bin}, @code{strbin}, @code{round}, @code{floor}, @code{ceil}, @code{trunc}, @code{frac}, @code{dirname}, @code{basename}, @code{extname}, @code{barename}, -@code{getnum}, @code{cut} +@code{getnum}, @code{cut}, @code{echo} @item Group-by Numeric operations: @code{sum}, @code{min}, @code{max}, @code{absmin}, @code{absmax}, @code{range} @item Group-by Textual/Numeric operations: -@code{count}, @code{first}, @code{last}, @code{rand}, @code{unique}, +@code{count}, @code{first}, @code{last}, @code{rand}, +@code{unique}, @code{uniq}, @code{collapse}, @code{countunique} @item Group-by Statistical operations: -@code{mean}, @code{mode}, +@code{mean}, @code{geomean}, @code{harmmean}, @code{mode}, @code{median}, @code{q1}, @code{q3}, @code{iqr}, @code{perc}, @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{ms}, @code{rms}, @code{mad}, @code{madraw}, @code{sskew}, +@code{pskew}, @code{skurt}, @code{pkurt}, @code{jarque}, @code{dpo}, @code{scov}, @code{pcov}, @code{spearson}, @code{ppearson} @end table @@ -194,12 +200,21 @@ @exdent Grouping options: @table @option +@item --skip-comments +@itemx -C +@opindex --skip-comments +@opindex -C +Skip comment lines (starting with '#' or ';' and optional whitespace). + @item --full @itemx -f @opindex --full @opindex -f Print entire input line before op results (default: print only the grouped keys). +While using this option with non-linewise operations was historically permitted, +it never produced very sensible output. Such usage has been deprecated, and in a +future release it will result in an error. @item --group=@var{X[,Y,X]} @itemx -g @var{X[,Y,X]} @@ -238,7 +253,8 @@ @opindex --ignore-case @opindex -i Ignore upper/lower case when comparing text for grouping, sorting, and comparing -unique values in the @samp{countunique} and @samp{unique} operations. +unique values in the @samp{countunique} and @samp{unique} +(or @samp{uniq}) operations. @item --sort @itemx -s @@ -255,8 +271,14 @@ $ cat FILE | datamash --sort --group 1 sum 1 @end example +@item --sort-cmd=@var{PATH} +@opindex --sort-cmd +@cindex sorting +Use the given program to sort instead of the system @command{sort} + @end table + @exdent File Operation options: @table @option @@ -301,6 +323,14 @@ This option overrides @option{--field-separator}/@option{-t}/ @option{--whitespace}/@option{-W}. +@item --collapse-delimiter=@var{x} +@itemx -c @var{x} +@opindex --collapse-delimiter +@opindex -c + +Use character @var{X} instead of comma to delimit items in a +@samp{collapse} or @samp{unique} (aka @samp{uniq}) list. + @item --round=@var{N} @itemx -R @var{N} @opindex --round @@ -312,6 +342,7 @@ @opindex --whitespace @opindex -W Use whitespace (one or more spaces and/or tabs) for field delimiters. +Leading whitespace is ignored, trailing whitespace results in an empty field. TAB character will be used as output field separator. If @option{--output-delimiter} is also used, it will override the output field delimiter. @@ -403,6 +434,10 @@ letter option @samp{n/i/d/p/h/o} affecting the detected value. @item cut copy input field to output field (similar to @command{cut(1)}). +When the @code{cut} operation is given a list of fields, the fields are copied +in the given order (in contrast to @command{cut(1)}). +@item echo +an alias for @code{cut}. @end table @item Group-by Numeric operations: @@ -439,8 +474,18 @@ one random value from the group @item unique comma-separated sorted list of unique values +@item uniq +an alias for @code{unique}. + +@option{--collapse-delimiter} can be used to use a different character +than comma. + @item collapse comma-separated list of all input values + +@option{--collapse-delimiter} can be used to use a different character +than comma. + @item countunique number of unique/distinct values @end table @@ -458,6 +503,10 @@ harmonic mean of the values @item trimmean trimmed mean of the values +@item ms +mean square of the values +@item rms +root mean square of the values @item median median value @item q1 @@ -527,7 +576,7 @@ @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 +* Field Delimiters:: Tabs, Whitespace, other delimiters * Column Ranges:: Operating on multiple columns * Reverse and Transpose:: swapping and transposing rows, columns * Groupby on @file{/etc/passwd}:: Groupby, count, collapse @@ -576,7 +625,7 @@ @cindex max, examples @cindex examples, min @cindex examples, max -Similary, find the minimum and maximum score in each subject: +Similarly, find the minimum and maximum score in each subject: @example $ datamash --sort groupby 2 @option{min} 3 @option{max} 3 < scores.txt @@ -589,7 +638,7 @@ @end example @cindex mean, examples -@cindex standard devian, examples +@cindex standard deviation, examples @cindex examples, mean @cindex examples, standard deviation find the mean and (population) standard deviation in each subject: @@ -609,7 +658,7 @@ @cindex examples, median @cindex quartiles, examples @cindex examples, quartiles -Find the median, first, third quariles and the inter-quartile range in +Find the median, first, third quartiles and the inter-quartile range in each subject: @example @@ -766,22 +815,22 @@ @node Field Delimiters -@section Field Delimiteres +@section Field Delimiters @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 +@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 +By default, fields are separated by a single tab. Multiple tabs +denotes multiple fields (this is consistent with GNU coreutils' @command{cut}): @example @@ -791,6 +840,9 @@ 2 @end example +Every tab separates two fields. A line starting with a tab thus starts +with an empty field, and a line ending with a tab ends with an empty field. + Using @option{-W}, one or more consecutive whitespace characters are treated as a single field delimiter: @@ -801,6 +853,12 @@ datamash: invalid input: field 3 requested, line 1 has only 2 fields @end example +With @option{-W}, leading whitespace is ignored, but trailing whitespace +is significant. A line starting with one or more consecutive whitespace +characters followed by a non-whitespace character starts with a non-empty +field. A line ending with one or more consecutive whitespace characters +ends with an empty field. + Using @option{-t}, a custom field delimiter character can be specified. Multiple consecutive delimiters are treated as multiple fields: @@ -955,7 +1013,7 @@ @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 +@option{--no-strict} to disable this behavior (see section above for an example). @@ -1011,7 +1069,7 @@ @command{datamash} with the @option{groupby} operation mode can be used to aggregate information. -Using this simuated @file{/etc/passwd} file as input: +Using this simulated @file{/etc/passwd} file as input: @example $ cat passwd @@ -1297,6 +1355,19 @@ b 21 N/A @end example +@opindex --header-out +@cindex --header-out, crosstab and +@cindex crosstab and --header-out +Note that using @option{--header-out} with crosstab prints a line showing +how to interpret the rows and columns, and what operation was used. + +@example +$ datamash -s --header-in --header-out crosstab 1,2 < input.txt +GroupBy(a) GroupBy(x) count(a) + x y +a 1 1 +b 1 N/A +@end example @node Rounding numbers @section Rounding numbers @@ -1341,9 +1412,9 @@ $ ( echo X ; seq -10 2.5 10 ) \ | datamash -H --full bin:5 1 X bin(X) --10.0 -15 +-10.0 -10 -7.5 -10 - -5.0 -10 + -5.0 -5 -2.5 -5 0.0 0 2.5 0 @@ -1490,7 +1561,7 @@ @cindex patches, contributing Patches are welcome; if possible, please make them with @samp{@w{diff --c}} (@pxref{Top,, Overview, diff, Comparing and Merging Files}) and +-u}} (@pxref{Top,, Overview, diff, Comparing and Merging Files}) and include @file{ChangeLog} entries (@pxref{Change Log,,, emacs, The GNU Emacs Manual}). Please follow the existing coding style. diff -Nru datamash-1.7/doc/datamash-texinfo.css datamash-1.8/doc/datamash-texinfo.css --- datamash-1.7/doc/datamash-texinfo.css 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/doc/datamash-texinfo.css 2022-05-28 02:52:43.000000000 +0000 @@ -1,7 +1,7 @@ /* CSS for TexInfo/HTML files. -Copyright (C) 2015-2020 Assaf Gordon (assafgordon@gmail.com) +Copyright (C) 2015-2021 Assaf Gordon (assafgordon@gmail.com) License: GNU All Permissive License diff -Nru datamash-1.7/doc/fdl.texi datamash-1.8/doc/fdl.texi --- datamash-1.7/doc/fdl.texi 2019-08-24 02:53:30.000000000 +0000 +++ datamash-1.8/doc/fdl.texi 2022-05-28 01:46:58.000000000 +0000 @@ -414,7 +414,7 @@ of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See -@uref{https://www.gnu.org/copyleft/}. +@uref{https://www.gnu.org/licenses/}. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this diff -Nru datamash-1.7/doc/local.mk datamash-1.8/doc/local.mk --- datamash-1.7/doc/local.mk 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/doc/local.mk 2022-05-28 02:52:43.000000000 +0000 @@ -7,7 +7,7 @@ # Software Foundation, Inc. # Modifications for GNU Datamash are -# Copyright (C) 2014-2020 Assaf Gordon +# Copyright (C) 2014-2021 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.7/doc/stamp-vti datamash-1.8/doc/stamp-vti --- datamash-1.7/doc/stamp-vti 2020-04-23 17:34:10.000000000 +0000 +++ datamash-1.8/doc/stamp-vti 2022-07-23 02:00:57.000000000 +0000 @@ -1,4 +1,4 @@ -@set UPDATED 23 April 2020 -@set UPDATED-MONTH April 2020 -@set EDITION 1.7 -@set VERSION 1.7 +@set UPDATED 10 July 2022 +@set UPDATED-MONTH July 2022 +@set EDITION 1.8 +@set VERSION 1.8 diff -Nru datamash-1.7/doc/version.texi datamash-1.8/doc/version.texi --- datamash-1.7/doc/version.texi 2020-04-23 17:34:10.000000000 +0000 +++ datamash-1.8/doc/version.texi 2022-07-23 00:59:43.000000000 +0000 @@ -1,4 +1,4 @@ -@set UPDATED 23 April 2020 -@set UPDATED-MONTH April 2020 -@set EDITION 1.7 -@set VERSION 1.7 +@set UPDATED 10 July 2022 +@set UPDATED-MONTH July 2022 +@set EDITION 1.8 +@set VERSION 1.8 diff -Nru datamash-1.7/GNUmakefile datamash-1.8/GNUmakefile --- datamash-1.7/GNUmakefile 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/GNUmakefile 2022-07-20 20:36:01.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-2020 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2006-2021 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 @@ -104,7 +104,7 @@ abort-due-to-no-makefile: @echo There seems to be no Makefile in this directory. 1>&2 - @echo "You must run ./configure before running 'make'." 1>&2 + @echo "You must run ./configure before running '$(MAKE)'." 1>&2 @exit 1 endif diff -Nru datamash-1.7/init.cfg datamash-1.8/init.cfg --- datamash-1.7/init.cfg 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/init.cfg 2022-05-28 02:52:43.000000000 +0000 @@ -7,7 +7,7 @@ # Copyright (C) 2010-2014 Free Software Foundation, Inc. # Modifications for GNU Datamash are -# Copyright (C) 2014-2020 Assaf Gordon +# Copyright (C) 2014-2021 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 @@ -45,6 +45,21 @@ } +openbsd_seq_replacement_() +{ + ## Wrap jot on OpenBSD since it doesn't have seq + test "$(uname -s)" = OpenBSD || return + + seq() + { + if [ $# -eq 1 ]; then + jot "$1" + elif [ $# -eq 2 ]; then + jot - "$1" "$2" + fi + } +} + expensive_() { diff -Nru datamash-1.7/lib/af_alg.c datamash-1.8/lib/af_alg.c --- datamash-1.7/lib/af_alg.c 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/lib/af_alg.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* af_alg.c - Compute message digests from file streams and buffers. - Copyright (C) 2018-2020 Free Software Foundation, Inc. + Copyright (C) 2018-2021 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 diff -Nru datamash-1.7/lib/af_alg.h datamash-1.8/lib/af_alg.h --- datamash-1.7/lib/af_alg.h 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/lib/af_alg.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* af_alg.h - Compute message digests from file streams and buffers. - Copyright (C) 2018-2020 Free Software Foundation, Inc. + Copyright (C) 2018-2021 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 diff -Nru datamash-1.7/lib/alloca.in.h datamash-1.8/lib/alloca.in.h --- datamash-1.7/lib/alloca.in.h 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/lib/alloca.in.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* Memory allocation on the stack. - Copyright (C) 1995, 1999, 2001-2004, 2006-2020 Free Software Foundation, + Copyright (C) 1995, 1999, 2001-2004, 2006-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it @@ -35,13 +35,16 @@ */ #ifndef alloca -# ifdef __GNUC__ - /* Some version of mingw have an that causes trouble when - included after 'alloca' gets defined as a macro. As a workaround, include - this first and define 'alloca' as a macro afterwards. */ -# if (defined _WIN32 && ! defined __CYGWIN__) && @HAVE_ALLOCA_H@ -# include_next -# endif + /* Some version of mingw have an that causes trouble when + included after 'alloca' gets defined as a macro. As a workaround, + include this first and define 'alloca' as a macro afterwards + if needed. */ +# if defined __GNUC__ && (defined _WIN32 && ! defined __CYGWIN__) && @HAVE_ALLOCA_H@ +# include_next +# endif +#endif +#ifndef alloca +# if defined __GNUC__ || (__clang_major__ >= 4) # define alloca __builtin_alloca # elif defined _AIX # define alloca __alloca diff -Nru datamash-1.7/lib/anytostr.c datamash-1.8/lib/anytostr.c --- datamash-1.7/lib/anytostr.c 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/lib/anytostr.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* anytostr.c -- convert integers to printable strings - Copyright (C) 2001, 2006, 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2001, 2006, 2008-2021 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 @@ -32,7 +32,7 @@ INT_BUFSIZE_BOUND (INTTYPE) bytes long. Return the address of the printable string, which need not start at BUF. */ -char * __attribute_warn_unused_result__ +char * _GL_ATTRIBUTE_NODISCARD anytostr (inttype i, char *buf) { char *p = buf + INT_STRLEN_BOUND (inttype); diff -Nru datamash-1.7/lib/arg-nonnull.h datamash-1.8/lib/arg-nonnull.h --- datamash-1.7/lib/arg-nonnull.h 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/lib/arg-nonnull.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* A C macro for declaring that specific arguments must not be NULL. - Copyright (C) 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2009-2021 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 @@ -18,7 +18,7 @@ that the values passed as arguments n, ..., m must be non-NULL pointers. n = 1 stands for the first argument, n = 2 for the second argument etc. */ #ifndef _GL_ARG_NONNULL -# if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3 +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || defined __clang__ # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params)) # else # define _GL_ARG_NONNULL(params) diff -Nru datamash-1.7/lib/arpa_inet.in.h datamash-1.8/lib/arpa_inet.in.h --- datamash-1.7/lib/arpa_inet.in.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/arpa_inet.in.h 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,150 @@ +/* A GNU-like . + + Copyright (C) 2005-2006, 2008-2021 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@_ARPA_INET_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +#if @HAVE_FEATURES_H@ +# include /* for __GLIBC__ */ +#endif + +/* Gnulib's sys/socket.h is responsible for defining socklen_t (used below) and + for pulling in winsock2.h etc. under MinGW. + But avoid namespace pollution on glibc systems. */ +#ifndef __GLIBC__ +# include +#endif + +/* On NonStop Kernel, inet_ntop and inet_pton are declared in . + But avoid namespace pollution on glibc systems. */ +#if defined __TANDEM && !defined __GLIBC__ +# include +#endif + +#if @HAVE_ARPA_INET_H@ + +/* The include_next requires a split double-inclusion guard. */ +# @INCLUDE_NEXT@ @NEXT_ARPA_INET_H@ + +#endif + +#ifndef _@GUARD_PREFIX@_ARPA_INET_H +#define _@GUARD_PREFIX@_ARPA_INET_H + +/* Get all possible declarations of inet_ntop() and inet_pton(). */ +#if (@GNULIB_INET_NTOP@ || @GNULIB_INET_PTON@ || defined GNULIB_POSIXCHECK) \ + && @HAVE_WS2TCPIP_H@ +# include +#endif + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_ARG_NONNULL is copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + + +#if @GNULIB_INET_NTOP@ +/* Converts an internet address from internal format to a printable, + presentable format. + AF is an internet address family, such as AF_INET or AF_INET6. + SRC points to a 'struct in_addr' (for AF_INET) or 'struct in6_addr' + (for AF_INET6). + DST points to a buffer having room for CNT bytes. + The printable representation of the address (in numeric form, not + surrounded by [...], no reverse DNS is done) is placed in DST, and + DST is returned. If an error occurs, the return value is NULL and + errno is set. If CNT bytes are not sufficient to hold the result, + the return value is NULL and errno is set to ENOSPC. A good value + for CNT is 46. + + For more details, see the POSIX:2008 specification + . */ +# if @REPLACE_INET_NTOP@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef inet_ntop +# define inet_ntop rpl_inet_ntop +# endif +_GL_FUNCDECL_RPL (inet_ntop, const char *, + (int af, const void *restrict src, + char *restrict dst, socklen_t cnt) + _GL_ARG_NONNULL ((2, 3))); +_GL_CXXALIAS_RPL (inet_ntop, const char *, + (int af, const void *restrict src, + char *restrict dst, socklen_t cnt)); +# else +# if !@HAVE_DECL_INET_NTOP@ +_GL_FUNCDECL_SYS (inet_ntop, const char *, + (int af, const void *restrict src, + char *restrict dst, socklen_t cnt) + _GL_ARG_NONNULL ((2, 3))); +# endif +/* Need to cast, because on NonStop Kernel, the fourth parameter is + size_t cnt. */ +_GL_CXXALIAS_SYS_CAST (inet_ntop, const char *, + (int af, const void *restrict src, + char *restrict dst, socklen_t cnt)); +# endif +# if __GLIBC__ >= 2 +_GL_CXXALIASWARN (inet_ntop); +# endif +#elif defined GNULIB_POSIXCHECK +# undef inet_ntop +# if HAVE_RAW_DECL_INET_NTOP +_GL_WARN_ON_USE (inet_ntop, "inet_ntop is unportable - " + "use gnulib module inet_ntop for portability"); +# endif +#endif + +#if @GNULIB_INET_PTON@ +# if @REPLACE_INET_PTON@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef inet_pton +# define inet_pton rpl_inet_pton +# endif +_GL_FUNCDECL_RPL (inet_pton, int, + (int af, const char *restrict src, void *restrict dst) + _GL_ARG_NONNULL ((2, 3))); +_GL_CXXALIAS_RPL (inet_pton, int, + (int af, const char *restrict src, void *restrict dst)); +# else +# if !@HAVE_DECL_INET_PTON@ +_GL_FUNCDECL_SYS (inet_pton, int, + (int af, const char *restrict src, void *restrict dst) + _GL_ARG_NONNULL ((2, 3))); +# endif +_GL_CXXALIAS_SYS (inet_pton, int, + (int af, const char *restrict src, void *restrict dst)); +# endif +# if __GLIBC__ >= 2 +_GL_CXXALIASWARN (inet_pton); +# endif +#elif defined GNULIB_POSIXCHECK +# undef inet_pton +# if HAVE_RAW_DECL_INET_PTON +_GL_WARN_ON_USE (inet_pton, "inet_pton is unportable - " + "use gnulib module inet_pton for portability"); +# endif +#endif + + +#endif /* _@GUARD_PREFIX@_ARPA_INET_H */ +#endif /* _@GUARD_PREFIX@_ARPA_INET_H */ diff -Nru datamash-1.7/lib/asnprintf.c datamash-1.8/lib/asnprintf.c --- datamash-1.7/lib/asnprintf.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/asnprintf.c 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,34 @@ +/* Formatted output to strings. + Copyright (C) 1999, 2002, 2006, 2009-2021 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 . */ + +#include + +/* Specification. */ +#include "vasnprintf.h" + +#include + +char * +asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) +{ + va_list args; + char *result; + + va_start (args, format); + result = vasnprintf (resultbuf, lengthp, format, args); + va_end (args); + return result; +} diff -Nru datamash-1.7/lib/assure.h datamash-1.8/lib/assure.h --- datamash-1.7/lib/assure.h 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/lib/assure.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* Run-time assert-like macros. - Copyright (C) 2014-2020 Free Software Foundation, Inc. + Copyright (C) 2014-2021 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 @@ -21,12 +21,32 @@ #define _GL_ASSURE_H #include +#include "verify.h" + +/* Evaluate an assertion E that is guaranteed to be true. + If NDEBUG is not defined, abort the program if E is false. + If NDEBUG is defined, the compiler can assume E and behavior is + undefined if E is false, fails to evaluate, or has side effects. + + Unlike standard 'assert', this macro evaluates E even when NDEBUG + is defined, so as to catch typos, avoid some GCC warnings, and + improve performance when E is simple enough. + + Also see the documentation for 'assume' in verify.h. */ + +#ifdef NDEBUG +# define affirm(E) assume (E) +#else +# define affirm(E) assert (E) +#endif /* Check E's value at runtime, and report an error and abort if not. However, do nothing if NDEBUG is defined. - Unlike standard 'assert', this macro always compiles E even when NDEBUG - is defined, so as to catch typos and avoid some GCC warnings. */ + Unlike standard 'assert', this macro compiles E even when NDEBUG + is defined, so as to catch typos and avoid some GCC warnings. + Unlike 'affirm', it is OK for E to use hard-to-optimize features, + since E is not executed if NDEBUG is defined. */ #ifdef NDEBUG # define assure(E) ((void) (0 && (E))) diff -Nru datamash-1.7/lib/attribute.h datamash-1.8/lib/attribute.h --- datamash-1.7/lib/attribute.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/attribute.h 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,218 @@ +/* ATTRIBUTE_* macros for using attributes in GCC and similar compilers + + Copyright 2020-2021 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 Paul Eggert. */ + +/* Provide public ATTRIBUTE_* names for the private _GL_ATTRIBUTE_* + macros used within Gnulib. */ + +/* These attributes can be placed in two ways: + - At the start of a declaration (i.e. even before storage-class + specifiers!); then they apply to all entities that are declared + by the declaration. + - Immediately after the name of an entity being declared by the + declaration; then they apply to that entity only. */ + +#ifndef _GL_ATTRIBUTE_H +#define _GL_ATTRIBUTE_H + + +/* This file defines two types of attributes: + * C2X standard attributes. These have macro names that do not begin with + 'ATTRIBUTE_'. + * Selected GCC attributes; see: + https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html + https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html + https://gcc.gnu.org/onlinedocs/gcc/Common-Type-Attributes.html + These names begin with 'ATTRIBUTE_' to avoid name clashes. */ + + +/* =============== Attributes for specific kinds of functions =============== */ + +/* Attributes for functions that should not be used. */ + +/* Warn if the entity is used. */ +/* Applies to: + - function, variable, + - struct, union, struct/union member, + - enumeration, enumeration item, + - typedef, + in C++ also: namespace, class, template specialization. */ +#define DEPRECATED _GL_ATTRIBUTE_DEPRECATED + +/* If a function call is not optimized way, warn with MSG. */ +/* Applies to: functions. */ +#define ATTRIBUTE_WARNING(msg) _GL_ATTRIBUTE_WARNING (msg) + +/* If a function call is not optimized way, report an error with MSG. */ +/* Applies to: functions. */ +#define ATTRIBUTE_ERROR(msg) _GL_ATTRIBUTE_ERROR (msg) + + +/* Attributes for memory-allocating functions. */ + +/* The function returns a pointer to freshly allocated memory. */ +/* Applies to: functions. */ +#define ATTRIBUTE_MALLOC _GL_ATTRIBUTE_MALLOC + +/* ATTRIBUTE_ALLOC_SIZE ((N)) - The Nth argument of the function + is the size of the returned memory block. + ATTRIBUTE_ALLOC_SIZE ((M, N)) - Multiply the Mth and Nth arguments + to determine the size of the returned memory block. */ +/* Applies to: function, pointer to function, function types. */ +#define ATTRIBUTE_ALLOC_SIZE(args) _GL_ATTRIBUTE_ALLOC_SIZE (args) + + +/* Attributes for variadic functions. */ + +/* The variadic function expects a trailing NULL argument. + ATTRIBUTE_SENTINEL () - The last argument is NULL (requires C99). + ATTRIBUTE_SENTINEL ((N)) - The (N+1)st argument from the end is NULL. */ +/* Applies to: functions. */ +#define ATTRIBUTE_SENTINEL(pos) _GL_ATTRIBUTE_SENTINEL (pos) + + +/* ================== Attributes for compiler diagnostics ================== */ + +/* Attributes that help the compiler diagnose programmer mistakes. + Some of them may also help for some compiler optimizations. */ + +/* ATTRIBUTE_FORMAT ((ARCHETYPE, STRING-INDEX, FIRST-TO-CHECK)) - + The STRING-INDEXth function argument is a format string of style + ARCHETYPE, which is one of: + printf, gnu_printf + scanf, gnu_scanf, + strftime, gnu_strftime, + strfmon, + or the same thing prefixed and suffixed with '__'. + If FIRST-TO-CHECK is not 0, arguments starting at FIRST-TO_CHECK + are suitable for the format string. */ +/* Applies to: functions. */ +#define ATTRIBUTE_FORMAT(spec) _GL_ATTRIBUTE_FORMAT (spec) + +/* ATTRIBUTE_NONNULL ((N1, N2,...)) - Arguments N1, N2,... must not be NULL. + ATTRIBUTE_NONNULL () - All pointer arguments must not be null. */ +/* Applies to: functions. */ +#define ATTRIBUTE_NONNULL(args) _GL_ATTRIBUTE_NONNULL (args) + +/* The function's return value is a non-NULL pointer. */ +/* Applies to: functions. */ +#define ATTRIBUTE_RETURNS_NONNULL _GL_ATTRIBUTE_RETURNS_NONNULL + +/* Warn if the caller does not use the return value, + unless the caller uses something like ignore_value. */ +/* Applies to: function, enumeration, class. */ +#define NODISCARD _GL_ATTRIBUTE_NODISCARD + + +/* Attributes that disable false alarms when the compiler diagnoses + programmer "mistakes". */ + +/* Do not warn if the entity is not used. */ +/* Applies to: + - function, variable, + - struct, union, struct/union member, + - enumeration, enumeration item, + - typedef, + in C++ also: class. */ +#define MAYBE_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED + +/* The contents of a character array is not meant to be NUL-terminated. */ +/* Applies to: struct/union members and variables that are arrays of element + type '[[un]signed] char'. */ +#define ATTRIBUTE_NONSTRING _GL_ATTRIBUTE_NONSTRING + +/* Do not warn if control flow falls through to the immediately + following 'case' or 'default' label. */ +/* Applies to: Empty statement (;), inside a 'switch' statement. */ +#define FALLTHROUGH _GL_ATTRIBUTE_FALLTHROUGH + + +/* ================== Attributes for debugging information ================== */ + +/* Attributes regarding debugging information emitted by the compiler. */ + +/* Omit the function from stack traces when debugging. */ +/* Applies to: function. */ +#define ATTRIBUTE_ARTIFICIAL _GL_ATTRIBUTE_ARTIFICIAL + +/* Make the entity visible to debuggers etc., even with '-fwhole-program'. */ +/* Applies to: functions, variables. */ +#define ATTRIBUTE_EXTERNALLY_VISIBLE _GL_ATTRIBUTE_EXTERNALLY_VISIBLE + + +/* ========== Attributes that mainly direct compiler optimizations ========== */ + +/* The function does not throw exceptions. */ +/* Applies to: functions. */ +#define ATTRIBUTE_NOTHROW _GL_ATTRIBUTE_NOTHROW + +/* Do not inline the function. */ +/* Applies to: functions. */ +#define ATTRIBUTE_NOINLINE _GL_ATTRIBUTE_NOINLINE + +/* Always inline the function, and report an error if the compiler + cannot inline. */ +/* Applies to: function. */ +#define ATTRIBUTE_ALWAYS_INLINE _GL_ATTRIBUTE_ALWAYS_INLINE + +/* It is OK for a compiler to omit duplicate calls with the same arguments. + This attribute is safe for a function that neither depends on + nor affects observable state, and always returns exactly once - + e.g., does not loop forever, and does not call longjmp. + (This attribute is stricter than ATTRIBUTE_PURE.) */ +/* Applies to: functions. */ +#define ATTRIBUTE_CONST _GL_ATTRIBUTE_CONST + +/* It is OK for a compiler to omit duplicate calls with the same + arguments if observable state is not changed between calls. + This attribute is safe for a function that does not affect + observable state, and always returns exactly once. + (This attribute is looser than ATTRIBUTE_CONST.) */ +/* Applies to: functions. */ +#define ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE + +/* The function is rarely executed. */ +/* Applies to: functions. */ +#define ATTRIBUTE_COLD _GL_ATTRIBUTE_COLD + +/* If called from some other compilation unit, the function executes + code from that unit only by return or by exception handling, + letting the compiler optimize that unit more aggressively. */ +/* Applies to: functions. */ +#define ATTRIBUTE_LEAF _GL_ATTRIBUTE_LEAF + +/* For struct members: The member has the smallest possible alignment. + For struct, union, class: All members have the smallest possible alignment, + minimizing the memory required. */ +/* Applies to: struct members, struct, union, + in C++ also: class. */ +#define ATTRIBUTE_PACKED _GL_ATTRIBUTE_PACKED + + +/* ================ Attributes that make invalid code valid ================ */ + +/* Attributes that prevent fatal compiler optimizations for code that is not + fully ISO C compliant. */ + +/* Pointers to the type may point to the same storage as pointers to + other types, thus disabling strict aliasing optimization. */ +/* Applies to: types. */ +#define ATTRIBUTE_MAY_ALIAS _GL_ATTRIBUTE_MAY_ALIAS + + +#endif /* _GL_ATTRIBUTE_H */ diff -Nru datamash-1.7/lib/base64.c datamash-1.8/lib/base64.c --- datamash-1.7/lib/base64.c 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/lib/base64.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* base64.c -- Encode binary data using printable characters. - Copyright (C) 1999-2001, 2004-2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 1999-2001, 2004-2006, 2009-2021 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.7/lib/base64.h datamash-1.8/lib/base64.h --- datamash-1.7/lib/base64.h 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/lib/base64.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* base64.h -- Encode binary data using printable characters. - Copyright (C) 2004-2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2004-2006, 2009-2021 Free Software Foundation, Inc. Written by Simon Josefsson. This program is free software; you can redistribute it and/or modify diff -Nru datamash-1.7/lib/basename.c datamash-1.8/lib/basename.c --- datamash-1.7/lib/basename.c 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/lib/basename.c 2022-05-28 01:46: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-2020 Free Software + Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.7/lib/basename-lgpl.c datamash-1.8/lib/basename-lgpl.c --- datamash-1.7/lib/basename-lgpl.c 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/lib/basename-lgpl.c 2022-05-28 01:46: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-2020 Free Software + Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -18,20 +18,20 @@ #include -#include "dirname.h" +/* Specification. */ +#include "basename-lgpl.h" +#include #include -/* Return the address of the last file name component of NAME. If - NAME has no relative file name components because it is a file - system root, return the empty string. */ +#include "filename.h" char * last_component (char const *name) { char const *base = name + FILE_SYSTEM_PREFIX_LEN (name); char const *p; - bool saw_slash = false; + bool last_was_slash = false; while (ISSLASH (*base)) base++; @@ -39,21 +39,17 @@ for (p = base; *p; p++) { if (ISSLASH (*p)) - saw_slash = true; - else if (saw_slash) + last_was_slash = true; + else if (last_was_slash) { base = p; - saw_slash = false; + last_was_slash = false; } } return (char *) base; } -/* Return the length of the basename NAME. Typically NAME is the - value returned by base_name or last_component. Act like strlen - (NAME), except omit all trailing slashes. */ - size_t base_len (char const *name) { diff -Nru datamash-1.7/lib/basename-lgpl.h datamash-1.8/lib/basename-lgpl.h --- datamash-1.7/lib/basename-lgpl.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/basename-lgpl.h 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,78 @@ +/* Extract the last component (base name) of a file name. + + Copyright (C) 1998, 2001, 2003-2006, 2009-2021 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 _BASENAME_LGPL_H +#define _BASENAME_LGPL_H + +#include + +#ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT +# define DOUBLE_SLASH_IS_DISTINCT_ROOT 0 +#endif + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Return the address of the last file name component of FILENAME. + If FILENAME has some trailing slash(es), they are considered to be + part of the last component. + If FILENAME has no relative file name components because it is a file + system root, return the empty string. + Examples: + FILENAME RESULT + "foo.c" "foo.c" + "foo/bar.c" "bar.c" + "/foo/bar.c" "bar.c" + "foo/bar/" "bar/" + "foo/bar//" "bar//" + "/" "" + "//" "" + "" "" + The return value is a tail of the given FILENAME; do NOT free() it! */ + +/* This function was traditionally called 'basename', but we avoid this + function name because + * Various platforms have different functions in their libc. + In particular, the glibc basename(), defined in , does + not consider trailing slashes to be part of the component: + FILENAME RESULT + "foo/bar/" "" + "foo/bar//" "" + * The 'basename' command eliminates trailing slashes and for a root + produces a non-empty result: + FILENAME RESULT + "foo/bar/" "bar" + "foo/bar//" "bar" + "/" "/" + "//" "/" + */ +extern char *last_component (char const *filename) _GL_ATTRIBUTE_PURE; + +/* Return the length of the basename FILENAME. + Typically FILENAME is the value returned by base_name or last_component. + Act like strlen (FILENAME), except omit all trailing slashes. */ +extern size_t base_len (char const *filename) _GL_ATTRIBUTE_PURE; + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* _BASENAME_LGPL_H */ diff -Nru datamash-1.7/lib/bitrotate.h datamash-1.8/lib/bitrotate.h --- datamash-1.7/lib/bitrotate.h 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/lib/bitrotate.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* bitrotate.h - Rotate bits in integers - Copyright (C) 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2008-2021 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.7/lib/byteswap.in.h datamash-1.8/lib/byteswap.in.h --- datamash-1.7/lib/byteswap.in.h 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/lib/byteswap.in.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* byteswap.h - Byte swapping - Copyright (C) 2005, 2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2005, 2007, 2009-2021 Free Software Foundation, Inc. Written by Oskar Liljeblad , 2005. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.7/lib/calloc.c datamash-1.8/lib/calloc.c --- datamash-1.7/lib/calloc.c 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/lib/calloc.c 2022-05-28 01:46: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-2020 Free Software Foundation, Inc. + Copyright (C) 2004-2007, 2009-2021 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.7/lib/c-ctype.h datamash-1.8/lib/c-ctype.h --- datamash-1.7/lib/c-ctype.h 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/lib/c-ctype.h 2022-05-28 01:46:58.000000000 +0000 @@ -5,7 +5,7 @@ functions' behaviour depends on the current locale set via setlocale. - Copyright (C) 2000-2003, 2006, 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2000-2003, 2006, 2008-2021 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.7/lib/c++defs.h datamash-1.8/lib/c++defs.h --- datamash-1.7/lib/c++defs.h 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/lib/c++defs.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* C++ compatible function declaration macros. - Copyright (C) 2010-2020 Free Software Foundation, Inc. + Copyright (C) 2010-2021 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 @@ -146,6 +146,16 @@ _GL_EXTERN_C int _gl_cxxalias_dummy #endif +/* _GL_CXXALIAS_MDA (func, rettype, parameters); + is to be used when func is a Microsoft deprecated alias, on native Windows. + It declares a C++ alias called GNULIB_NAMESPACE::func + that redirects to _func, if GNULIB_NAMESPACE is defined. + Example: + _GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...)); + */ +#define _GL_CXXALIAS_MDA(func,rettype,parameters) \ + _GL_CXXALIAS_RPL_1 (func, _##func, rettype, parameters) + /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters); is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters); except that the C function rpl_func may have a slightly different @@ -171,6 +181,14 @@ _GL_EXTERN_C int _gl_cxxalias_dummy #endif +/* _GL_CXXALIAS_MDA_CAST (func, rettype, parameters); + is like _GL_CXXALIAS_MDA (func, rettype, parameters); + except that the C function func may have a slightly different declaration. + A cast is used to silence the "invalid conversion" error that would + otherwise occur. */ +#define _GL_CXXALIAS_MDA_CAST(func,rettype,parameters) \ + _GL_CXXALIAS_RPL_CAST_1 (func, _##func, rettype, parameters) + /* _GL_CXXALIAS_SYS (func, rettype, parameters); declares a C++ alias called GNULIB_NAMESPACE::func that redirects to the system provided function func, if GNULIB_NAMESPACE @@ -268,7 +286,7 @@ _GL_CXXALIASWARN_2 (func, namespace) /* To work around GCC bug , we enable the warning only when not optimizing. */ -# if !__OPTIMIZE__ +# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__) # define _GL_CXXALIASWARN_2(func,namespace) \ _GL_WARN_ON_USE (func, \ "The symbol ::" #func " refers to the system function. " \ @@ -296,9 +314,9 @@ _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace) /* To work around GCC bug , we enable the warning only when not optimizing. */ -# if !__OPTIMIZE__ +# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__) # define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \ - _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \ + _GL_WARN_ON_USE_CXX (func, rettype, rettype, parameters_and_attributes, \ "The symbol ::" #func " refers to the system function. " \ "Use " #namespace "::" #func " instead.") # else diff -Nru datamash-1.7/lib/cdefs.h datamash-1.8/lib/cdefs.h --- datamash-1.7/lib/cdefs.h 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/lib/cdefs.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (C) 1992-2020 Free Software Foundation, Inc. +/* Copyright (C) 1992-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -25,7 +25,7 @@ /* The GNU libc does not support any K&R compilers or the traditional mode of ISO C compilers anymore. Check for some of the combinations not - anymore supported. */ + supported anymore. */ #if defined __GNUC__ && !defined __STDC__ # error "You need a ISO C conforming compiler to use the glibc headers" #endif @@ -34,7 +34,34 @@ #undef __P #undef __PMT -#ifdef __GNUC__ +/* Compilers that are not clang may object to + #if defined __clang__ && __has_attribute(...) + even though they do not need to evaluate the right-hand side of the &&. */ +#if defined __clang__ && defined __has_attribute +# define __glibc_clang_has_attribute(name) __has_attribute (name) +#else +# define __glibc_clang_has_attribute(name) 0 +#endif + +/* Compilers that are not clang may object to + #if defined __clang__ && __has_builtin(...) + even though they do not need to evaluate the right-hand side of the &&. */ +#if defined __clang__ && defined __has_builtin +# define __glibc_clang_has_builtin(name) __has_builtin (name) +#else +# define __glibc_clang_has_builtin(name) 0 +#endif + +/* Compilers that are not clang may object to + #if defined __clang__ && __has_extension(...) + even though they do not need to evaluate the right-hand side of the &&. */ +#if defined __clang__ && defined __has_extension +# define __glibc_clang_has_extension(ext) __has_extension (ext) +#else +# define __glibc_clang_has_extension(ext) 0 +#endif + +#if defined __GNUC__ || defined __clang__ /* All functions, except those with callbacks or those that synchronize memory, are leaf functions. */ @@ -47,21 +74,26 @@ # endif /* GCC can always grok prototypes. For C++ programs we add throw() - to help it optimize the function calls. But this works only with - gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions + to help it optimize the function calls. But this only works with + gcc 2.8.x and egcs. For gcc 3.4 and up we even mark C functions as non-throwing using a function attribute since programs can use the -fexceptions options for C code as well. */ -# if !defined __cplusplus && __GNUC_PREREQ (3, 3) +# if !defined __cplusplus \ + && (__GNUC_PREREQ (3, 4) || __glibc_clang_has_attribute (__nothrow__)) # define __THROW __attribute__ ((__nothrow__ __LEAF)) # define __THROWNL __attribute__ ((__nothrow__)) # define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct # define __NTHNL(fct) __attribute__ ((__nothrow__)) fct # else -# if defined __cplusplus && __GNUC_PREREQ (2,8) -# define __THROW throw () -# define __THROWNL throw () -# define __NTH(fct) __LEAF_ATTR fct throw () -# define __NTHNL(fct) fct throw () +# if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major >= 4) +# if __cplusplus >= 201103L +# define __THROW noexcept (true) +# else +# define __THROW throw () +# endif +# define __THROWNL __THROW +# define __NTH(fct) __LEAF_ATTR fct __THROW +# define __NTHNL(fct) fct __THROW # else # define __THROW # define __THROWNL @@ -70,7 +102,7 @@ # endif # endif -#else /* Not GCC. */ +#else /* Not GCC or clang. */ # if (defined __cplusplus \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)) @@ -83,16 +115,7 @@ # define __THROWNL # define __NTH(fct) fct -#endif /* GCC. */ - -/* Compilers that are not clang may object to - #if defined __clang__ && __has_extension(...) - even though they do not need to evaluate the right-hand side of the &&. */ -#if defined __clang__ && defined __has_extension -# define __glibc_clang_has_extension(ext) __has_extension (ext) -#else -# define __glibc_clang_has_extension(ext) 0 -#endif +#endif /* GCC || clang. */ /* These two macros are not used in glibc anymore. They are kept here only because some other projects expect the macros to be defined. */ @@ -123,14 +146,20 @@ #define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) #define __bos0(ptr) __builtin_object_size (ptr, 0) +/* Use __builtin_dynamic_object_size at _FORTIFY_SOURCE=3 when available. */ +#if __USE_FORTIFY_LEVEL == 3 && __glibc_clang_prereq (9, 0) +# define __glibc_objsize0(__o) __builtin_dynamic_object_size (__o, 0) +# define __glibc_objsize(__o) __builtin_dynamic_object_size (__o, 1) +#else +# define __glibc_objsize0(__o) __bos0 (__o) +# define __glibc_objsize(__o) __bos (__o) +#endif + #if __GNUC_PREREQ (4,3) -# define __warndecl(name, msg) \ - extern void name (void) __attribute__((__warning__ (msg))) # define __warnattr(msg) __attribute__((__warning__ (msg))) # define __errordecl(name, msg) \ extern void name (void) __attribute__((__error__ (msg))) #else -# define __warndecl(name, msg) extern void name (void) # define __warnattr(msg) # define __errordecl(name, msg) extern void name (void) #endif @@ -142,8 +171,8 @@ #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L && !defined __HP_cc # define __flexarr [] # define __glibc_c99_flexarr_available 1 -#elif __GNUC_PREREQ (2,97) -/* GCC 2.97 supports C99 flexible array members as an extension, +#elif __GNUC_PREREQ (2,97) || defined __clang__ +/* GCC 2.97 and clang support C99 flexible array members as an extension, even when in C89 mode or compiling C++ (any version). */ # define __flexarr [] # define __glibc_c99_flexarr_available 1 @@ -169,7 +198,7 @@ Example: int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */ -#if defined __GNUC__ && __GNUC__ >= 2 +#if (defined __GNUC__ && __GNUC__ >= 2) || (__clang_major__ >= 4) # define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) # ifdef __cplusplus @@ -194,17 +223,17 @@ */ #endif -/* GCC has various useful declarations that can be made with the - `__attribute__' syntax. All of the ways we use this do fine if - they are omitted for compilers that don't understand it. */ -#if !defined __GNUC__ || __GNUC__ < 2 +/* GCC and clang have various useful declarations that can be made with + the '__attribute__' syntax. All of the ways we use this do fine if + they are omitted for compilers that don't understand it. */ +#if !(defined __GNUC__ || defined __clang__) # define __attribute__(xyz) /* Ignore */ #endif /* At some point during the gcc 2.96 development the `malloc' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ -#if __GNUC_PREREQ (2,96) +#if __GNUC_PREREQ (2,96) || __glibc_clang_has_attribute (__malloc__) # define __attribute_malloc__ __attribute__ ((__malloc__)) #else # define __attribute_malloc__ /* Ignore */ @@ -222,14 +251,14 @@ /* At some point during the gcc 2.96 development the `pure' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ -#if __GNUC_PREREQ (2,96) +#if __GNUC_PREREQ (2,96) || __glibc_clang_has_attribute (__pure__) # define __attribute_pure__ __attribute__ ((__pure__)) #else # define __attribute_pure__ /* Ignore */ #endif /* This declaration tells the compiler that the value is constant. */ -#if __GNUC_PREREQ (2,5) +#if __GNUC_PREREQ (2,5) || __glibc_clang_has_attribute (__const__) # define __attribute_const__ __attribute__ ((__const__)) #else # define __attribute_const__ /* Ignore */ @@ -238,7 +267,7 @@ /* At some point during the gcc 3.1 development the `used' attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ -#if __GNUC_PREREQ (3,1) +#if __GNUC_PREREQ (3,1) || __glibc_clang_has_attribute (__used__) # define __attribute_used__ __attribute__ ((__used__)) # define __attribute_noinline__ __attribute__ ((__noinline__)) #else @@ -247,7 +276,7 @@ #endif /* Since version 3.2, gcc allows marking deprecated functions. */ -#if __GNUC_PREREQ (3,2) +#if __GNUC_PREREQ (3,2) || __glibc_clang_has_attribute (__deprecated__) # define __attribute_deprecated__ __attribute__ ((__deprecated__)) #else # define __attribute_deprecated__ /* Ignore */ @@ -256,8 +285,8 @@ /* Since version 4.5, gcc also allows one to specify the message printed when a deprecated function is used. clang claims to be gcc 4.2, but may also support this feature. */ -#if __GNUC_PREREQ (4,5) || \ - __glibc_clang_has_extension (__attribute_deprecated_with_message__) +#if __GNUC_PREREQ (4,5) \ + || __glibc_clang_has_extension (__attribute_deprecated_with_message__) # define __attribute_deprecated_msg__(msg) \ __attribute__ ((__deprecated__ (msg))) #else @@ -270,7 +299,7 @@ If several `format_arg' attributes are given for the same function, in gcc-3.0 and older, all but the last one are ignored. In newer gccs, all designated arguments are considered. */ -#if __GNUC_PREREQ (2,8) +#if __GNUC_PREREQ (2,8) || __glibc_clang_has_attribute (__format_arg__) # define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x))) #else # define __attribute_format_arg__(x) /* Ignore */ @@ -280,7 +309,7 @@ attribute for functions was introduced. We don't want to use it unconditionally (although this would be possible) since it generates warnings. */ -#if __GNUC_PREREQ (2,97) +#if __GNUC_PREREQ (2,97) || __glibc_clang_has_attribute (__format__) # define __attribute_format_strfmon__(a,b) \ __attribute__ ((__format__ (__strfmon__, a, b))) #else @@ -291,7 +320,7 @@ must not be NULL. Do not define __nonnull if it is already defined, for portability when this file is used in Gnulib. */ #ifndef __nonnull -# if __GNUC_PREREQ (3,3) +# if __GNUC_PREREQ (3,3) || __glibc_clang_has_attribute (__nonnull__) # define __nonnull(params) __attribute__ ((__nonnull__ params)) # else # define __nonnull(params) @@ -300,7 +329,7 @@ /* If fortification mode, we warn about unused results of certain function calls which can lead to problems. */ -#if __GNUC_PREREQ (3,4) +#if __GNUC_PREREQ (3,4) || __glibc_clang_has_attribute (__warn_unused_result__) # define __attribute_warn_unused_result__ \ __attribute__ ((__warn_unused_result__)) # if defined __USE_FORTIFY_LEVEL && __USE_FORTIFY_LEVEL > 0 @@ -314,7 +343,7 @@ #endif /* Forces a function to be always inlined. */ -#if __GNUC_PREREQ (3,2) +#if __GNUC_PREREQ (3,2) || __glibc_clang_has_attribute (__always_inline__) /* The Linux kernel defines __always_inline in stddef.h (283d7573), and it conflicts with this definition. Therefore undefine it first to allow either header to be included first. */ @@ -327,7 +356,7 @@ /* Associate error messages with the source location of the call site rather than with the source location inside the function. */ -#if __GNUC_PREREQ (4,3) +#if __GNUC_PREREQ (4,3) || __glibc_clang_has_attribute (__artificial__) # define __attribute_artificial__ __attribute__ ((__artificial__)) #else # define __attribute_artificial__ /* Ignore */ @@ -370,12 +399,14 @@ run in pedantic mode if the uses are carefully marked using the `__extension__' keyword. But this is not generally available before version 2.8. */ -#if !__GNUC_PREREQ (2,8) +#if !(__GNUC_PREREQ (2,8) || defined __clang__) # define __extension__ /* Ignore */ #endif -/* __restrict is known in EGCS 1.2 and above. */ -#if !__GNUC_PREREQ (2,92) +/* __restrict is known in EGCS 1.2 and above, and in clang. + It works also in C++ mode (outside of arrays), but only when spelled + as '__restrict', not 'restrict'. */ +#if !(__GNUC_PREREQ (2,92) || __clang_major__ >= 3) # if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L # define __restrict restrict # else @@ -385,8 +416,9 @@ /* ISO C99 also allows to declare arrays as non-overlapping. The syntax is array_name[restrict] - GCC 3.1 supports this. */ -#if __GNUC_PREREQ (3,1) && !defined __GNUG__ + GCC 3.1 and clang support this. + This syntax is not usable in C++ mode. */ +#if (__GNUC_PREREQ (3,1) || __clang_major__ >= 3) && !defined __cplusplus # define __restrict_arr __restrict #else # ifdef __GNUC__ @@ -401,7 +433,7 @@ # endif #endif -#if __GNUC__ >= 3 +#if (__GNUC__ >= 3) || __glibc_clang_has_builtin (__builtin_expect) # define __glibc_unlikely(cond) __builtin_expect ((cond), 0) # define __glibc_likely(cond) __builtin_expect ((cond), 1) #else @@ -417,7 +449,8 @@ #if (!defined _Noreturn \ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ - && !__GNUC_PREREQ (4,7)) + && !(__GNUC_PREREQ (4,7) \ + || (3 < __clang_major__ + (5 <= __clang_minor__)))) # if __GNUC_PREREQ (2,8) # define _Noreturn __attribute__ ((__noreturn__)) # else @@ -434,9 +467,20 @@ # define __attribute_nonstring__ #endif +/* Undefine (also defined in libc-symbols.h). */ +#undef __attribute_copy__ +#if __GNUC_PREREQ (9, 0) +/* Copies attributes from the declaration or type referenced by + the argument. */ +# define __attribute_copy__(arg) __attribute__ ((__copy__ (arg))) +#else +# define __attribute_copy__(arg) +#endif + #if (!defined _Static_assert && !defined __cplusplus \ && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \ - && (!__GNUC_PREREQ (4, 6) || defined __STRICT_ANSI__)) + && (!(__GNUC_PREREQ (4, 6) || __clang_major__ >= 4) \ + || defined __STRICT_ANSI__)) # define _Static_assert(expr, diagnostic) \ extern int (*__Static_assert_function (void)) \ [!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })] @@ -449,7 +493,37 @@ # include #endif -#if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH +#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1 +# ifdef __REDIRECT + +/* Alias name defined automatically. */ +# define __LDBL_REDIR(name, proto) ... unused__ldbl_redir +# define __LDBL_REDIR_DECL(name) \ + extern __typeof (name) name __asm (__ASMNAME ("__" #name "ieee128")); + +/* Alias name defined automatically, with leading underscores. */ +# define __LDBL_REDIR2_DECL(name) \ + extern __typeof (__##name) __##name \ + __asm (__ASMNAME ("__" #name "ieee128")); + +/* Alias name defined manually. */ +# define __LDBL_REDIR1(name, proto, alias) ... unused__ldbl_redir1 +# define __LDBL_REDIR1_DECL(name, alias) \ + extern __typeof (name) name __asm (__ASMNAME (#alias)); + +# define __LDBL_REDIR1_NTH(name, proto, alias) \ + __REDIRECT_NTH (name, proto, alias) +# define __REDIRECT_NTH_LDBL(name, proto, alias) \ + __LDBL_REDIR1_NTH (name, proto, __##alias##ieee128) + +/* Unused. */ +# define __REDIRECT_LDBL(name, proto, alias) ... unused__redirect_ldbl +# define __LDBL_REDIR_NTH(name, proto) ... unused__ldbl_redir_nth + +# else +_Static_assert (0, "IEEE 128-bits long double requires redirection on this platform"); +# endif +#elif defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH # define __LDBL_COMPAT 1 # ifdef __REDIRECT # define __LDBL_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias) @@ -458,6 +532,8 @@ # define __LDBL_REDIR1_NTH(name, proto, alias) __REDIRECT_NTH (name, proto, alias) # define __LDBL_REDIR_NTH(name, proto) \ __LDBL_REDIR1_NTH (name, proto, __nldbl_##name) +# define __LDBL_REDIR2_DECL(name) \ + extern __typeof (__##name) __##name __asm (__ASMNAME ("__nldbl___" #name)); # define __LDBL_REDIR1_DECL(name, alias) \ extern __typeof (name) name __asm (__ASMNAME (#alias)); # define __LDBL_REDIR_DECL(name) \ @@ -468,11 +544,13 @@ __LDBL_REDIR1_NTH (name, proto, __nldbl_##alias) # endif #endif -#if !defined __LDBL_COMPAT || !defined __REDIRECT +#if (!defined __LDBL_COMPAT && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0) \ + || !defined __REDIRECT # define __LDBL_REDIR1(name, proto, alias) name proto # define __LDBL_REDIR(name, proto) name proto # define __LDBL_REDIR1_NTH(name, proto, alias) name proto __THROW # define __LDBL_REDIR_NTH(name, proto) name proto __THROW +# define __LDBL_REDIR2_DECL(name) # define __LDBL_REDIR_DECL(name) # ifdef __REDIRECT # define __REDIRECT_LDBL(name, proto, alias) __REDIRECT (name, proto, alias) @@ -511,4 +589,23 @@ # define __HAVE_GENERIC_SELECTION 0 #endif +#if __GNUC_PREREQ (10, 0) +/* Designates a 1-based positional argument ref-index of pointer type + that can be used to access size-index elements of the pointed-to + array according to access mode, or at least one element when + size-index is not provided: + access (access-mode, [, ]) */ +#define __attr_access(x) __attribute__ ((__access__ x)) +#else +# define __attr_access(x) +#endif + +/* Specify that a function such as setjmp or vfork may return + twice. */ +#if __GNUC_PREREQ (4, 1) +# define __attribute_returns_twice__ __attribute__ ((__returns_twice__)) +#else +# define __attribute_returns_twice__ /* Ignore. */ +#endif + #endif /* sys/cdefs.h */ diff -Nru datamash-1.7/lib/ceil.c datamash-1.8/lib/ceil.c --- datamash-1.7/lib/ceil.c 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/lib/ceil.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Round towards positive infinity. - Copyright (C) 2007, 2010-2020 Free Software Foundation, Inc. + Copyright (C) 2007, 2010-2021 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 @@ -56,7 +56,7 @@ /* MSVC with option -fp:strict refuses to compile constant initializers that contain floating-point operations. Pacify this compiler. */ -#ifdef _MSC_VER +#if defined _MSC_VER && !defined __clang__ # pragma fenv_access (off) #endif diff -Nru datamash-1.7/lib/ceill.c datamash-1.8/lib/ceill.c --- datamash-1.7/lib/ceill.c 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/lib/ceill.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Round towards positive infinity. - Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2021 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.7/lib/cloexec.c datamash-1.8/lib/cloexec.c --- datamash-1.7/lib/cloexec.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/cloexec.c 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,83 @@ +/* cloexec.c - set or clear the close-on-exec descriptor flag + + Copyright (C) 1991, 2004-2006, 2009-2021 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 . + + The code is taken from glibc/manual/llio.texi */ + +#include + +#include "cloexec.h" + +#include +#include +#include + +/* Set the 'FD_CLOEXEC' flag of DESC if VALUE is true, + or clear the flag if VALUE is false. + Return 0 on success, or -1 on error with 'errno' set. + + Note that on MingW, this function does NOT protect DESC from being + inherited into spawned children. Instead, either use dup_cloexec + followed by closing the original DESC, or use interfaces such as + open or pipe2 that accept flags like O_CLOEXEC to create DESC + non-inheritable in the first place. */ + +int +set_cloexec_flag (int desc, bool value) +{ +#ifdef F_SETFD + + int flags = fcntl (desc, F_GETFD, 0); + + if (0 <= flags) + { + int newflags = (value ? flags | FD_CLOEXEC : flags & ~FD_CLOEXEC); + + if (flags == newflags + || fcntl (desc, F_SETFD, newflags) != -1) + return 0; + } + + return -1; + +#else /* !F_SETFD */ + + /* Use dup2 to reject invalid file descriptors; the cloexec flag + will be unaffected. */ + if (desc < 0) + { + errno = EBADF; + return -1; + } + if (dup2 (desc, desc) < 0) + /* errno is EBADF here. */ + return -1; + + /* There is nothing we can do on this kind of platform. Punt. */ + return 0; +#endif /* !F_SETFD */ +} + + +/* Duplicates a file handle FD, while marking the copy to be closed + prior to exec or spawn. Returns -1 and sets errno if FD could not + be duplicated. */ + +int +dup_cloexec (int fd) +{ + return fcntl (fd, F_DUPFD_CLOEXEC, 0); +} diff -Nru datamash-1.7/lib/cloexec.h datamash-1.8/lib/cloexec.h --- datamash-1.7/lib/cloexec.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/cloexec.h 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,38 @@ +/* cloexec.c - set or clear the close-on-exec descriptor flag + + Copyright (C) 2004, 2009-2021 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 + +/* Set the 'FD_CLOEXEC' flag of DESC if VALUE is true, + or clear the flag if VALUE is false. + Return 0 on success, or -1 on error with 'errno' set. + + Note that on MingW, this function does NOT protect DESC from being + inherited into spawned children. Instead, either use dup_cloexec + followed by closing the original DESC, or use interfaces such as + open or pipe2 that accept flags like O_CLOEXEC to create DESC + non-inheritable in the first place. */ + +int set_cloexec_flag (int desc, bool value); + +/* Duplicates a file handle FD, while marking the copy to be closed + prior to exec or spawn. Returns -1 and sets errno if FD could not + be duplicated. */ + +int dup_cloexec (int fd); diff -Nru datamash-1.7/lib/close.c datamash-1.8/lib/close.c --- datamash-1.7/lib/close.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/close.c 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,75 @@ +/* close replacement. + Copyright (C) 2008-2021 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 + +#include + +#include "fd-hook.h" +#if HAVE_MSVC_INVALID_PARAMETER_HANDLER +# include "msvc-inval.h" +#endif + +#undef close + +#if defined _WIN32 && !defined __CYGWIN__ +# if HAVE_MSVC_INVALID_PARAMETER_HANDLER +static int +close_nothrow (int fd) +{ + int result; + + TRY_MSVC_INVAL + { + result = _close (fd); + } + CATCH_MSVC_INVAL + { + result = -1; + errno = EBADF; + } + DONE_MSVC_INVAL; + + return result; +} +# else +# define close_nothrow _close +# endif +#else +# define close_nothrow close +#endif + +/* Override close() to call into other gnulib modules. */ + +int +rpl_close (int fd) +{ +#if WINDOWS_SOCKETS + int retval = execute_all_close_hooks (close_nothrow, fd); +#else + int retval = close_nothrow (fd); +#endif + +#if REPLACE_FCHDIR + if (retval >= 0) + _gl_unregister_fd (fd); +#endif + + return retval; +} diff -Nru datamash-1.7/lib/closeout.c datamash-1.8/lib/closeout.c --- datamash-1.7/lib/closeout.c 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/lib/closeout.c 2022-05-28 01:46:58.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-2020 Free Software Foundation, + Copyright (C) 1998-2002, 2004, 2006, 2008-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.7/lib/closeout.h datamash-1.8/lib/closeout.h --- datamash-1.7/lib/closeout.h 2020-04-23 04:03:30.000000000 +0000 +++ datamash-1.8/lib/closeout.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* Close standard output and standard error. - Copyright (C) 1998, 2000, 2003-2004, 2006, 2008-2020 Free Software + Copyright (C) 1998, 2000, 2003-2004, 2006, 2008-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.7/lib/close-stream.c datamash-1.8/lib/close-stream.c --- datamash-1.7/lib/close-stream.c 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/lib/close-stream.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* Close a stream, with nicer error checking than fclose's. - Copyright (C) 1998-2002, 2004, 2006-2020 Free Software Foundation, Inc. + Copyright (C) 1998-2002, 2004, 2006-2021 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.7/lib/c-strcasecmp.c datamash-1.8/lib/c-strcasecmp.c --- datamash-1.7/lib/c-strcasecmp.c 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/lib/c-strcasecmp.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* c-strcasecmp.c -- case insensitive string comparator in C locale - Copyright (C) 1998-1999, 2005-2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 1998-1999, 2005-2006, 2009-2021 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,5 +52,5 @@ /* On machines where 'char' and 'int' are types of the same size, the difference of two 'unsigned char' values - including the sign bit - doesn't fit in an 'int'. */ - return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0); + return _GL_CMP (c1, c2); } diff -Nru datamash-1.7/lib/c-strcaseeq.h datamash-1.8/lib/c-strcaseeq.h --- datamash-1.7/lib/c-strcaseeq.h 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/lib/c-strcaseeq.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Optimized case-insensitive string comparison in C locale. - Copyright (C) 2001-2002, 2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2007, 2009-2021 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 @@ -27,7 +27,7 @@ /* Help GCC to generate good code for string comparisons with immediate strings. */ -#if defined (__GNUC__) && defined (__OPTIMIZE__) +#if (defined __GNUC__ || defined __clang__) && defined __OPTIMIZE__ /* Case insensitive comparison of ASCII characters. */ # if C_CTYPE_ASCII diff -Nru datamash-1.7/lib/c-strcase.h datamash-1.8/lib/c-strcase.h --- datamash-1.7/lib/c-strcase.h 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/lib/c-strcase.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Case-insensitive string comparison functions in C locale. - Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2020 Free Software + Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify diff -Nru datamash-1.7/lib/c-strncasecmp.c datamash-1.8/lib/c-strncasecmp.c --- datamash-1.7/lib/c-strncasecmp.c 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/lib/c-strncasecmp.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* c-strncasecmp.c -- case insensitive string comparator in C locale - Copyright (C) 1998-1999, 2005-2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 1998-1999, 2005-2006, 2009-2021 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,5 +52,5 @@ /* On machines where 'char' and 'int' are types of the same size, the difference of two 'unsigned char' values - including the sign bit - doesn't fit in an 'int'. */ - return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0); + return _GL_CMP (c1, c2); } diff -Nru datamash-1.7/lib/ctype.in.h datamash-1.8/lib/ctype.in.h --- datamash-1.7/lib/ctype.in.h 2020-04-23 04:03:30.000000000 +0000 +++ datamash-1.8/lib/ctype.in.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* A substitute for ISO C99 , for platforms on which it is incomplete. - Copyright (C) 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2009-2021 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.7/lib/dirname.c datamash-1.8/lib/dirname.c --- datamash-1.7/lib/dirname.c 2020-04-23 04:03:30.000000000 +0000 +++ datamash-1.8/lib/dirname.c 2022-05-28 01:46:58.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-2020 Free Software + Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.7/lib/dirname.h datamash-1.8/lib/dirname.h --- datamash-1.7/lib/dirname.h 2020-04-23 04:03:30.000000000 +0000 +++ datamash-1.8/lib/dirname.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* Take file names apart into directory and base names. - Copyright (C) 1998, 2001, 2003-2006, 2009-2020 Free Software Foundation, + Copyright (C) 1998, 2001, 2003-2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -21,16 +21,13 @@ # include # include -# include "dosname.h" +# include "filename.h" +# include "basename-lgpl.h" # ifndef DIRECTORY_SEPARATOR # define DIRECTORY_SEPARATOR '/' # endif -# ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT -# define DOUBLE_SLASH_IS_DISTINCT_ROOT 0 -# endif - #ifdef __cplusplus extern "C" { #endif @@ -41,9 +38,7 @@ # endif char *mdir_name (char const *file); -size_t base_len (char const *file) _GL_ATTRIBUTE_PURE; size_t dir_len (char const *file) _GL_ATTRIBUTE_PURE; -char *last_component (char const *file) _GL_ATTRIBUTE_PURE; bool strip_trailing_slashes (char *file); diff -Nru datamash-1.7/lib/dirname-lgpl.c datamash-1.8/lib/dirname-lgpl.c --- datamash-1.7/lib/dirname-lgpl.c 2020-04-23 04:03:30.000000000 +0000 +++ datamash-1.8/lib/dirname-lgpl.c 2022-05-28 01:46:58.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-2020 Free Software + Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.7/lib/dosname.h datamash-1.8/lib/dosname.h --- datamash-1.7/lib/dosname.h 2020-04-23 04:03:30.000000000 +0000 +++ datamash-1.8/lib/dosname.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -/* File names on MS-DOS/Windows systems. - - Copyright (C) 2000-2001, 2004-2006, 2009-2020 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 . - - From Paul Eggert and Jim Meyering. */ - -#ifndef _DOSNAME_H -#define _DOSNAME_H - -#if (defined _WIN32 || defined __CYGWIN__ \ - || defined __EMX__ || defined __MSDOS__ || defined __DJGPP__) - /* This internal macro assumes ASCII, but all hosts that support drive - letters use ASCII. */ -# define _IS_DRIVE_LETTER(C) (((unsigned int) (C) | ('a' - 'A')) - 'a' \ - <= 'z' - 'a') -# define FILE_SYSTEM_PREFIX_LEN(Filename) \ - (_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':' ? 2 : 0) -# ifndef __CYGWIN__ -# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 1 -# endif -# define ISSLASH(C) ((C) == '/' || (C) == '\\') -#else -# define FILE_SYSTEM_PREFIX_LEN(Filename) 0 -# define ISSLASH(C) ((C) == '/') -#endif - -#ifndef FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE -# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0 -#endif - -#if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE -# define IS_ABSOLUTE_FILE_NAME(F) ISSLASH ((F)[FILE_SYSTEM_PREFIX_LEN (F)]) -# else -# define IS_ABSOLUTE_FILE_NAME(F) \ - (ISSLASH ((F)[0]) || FILE_SYSTEM_PREFIX_LEN (F) != 0) -#endif -#define IS_RELATIVE_FILE_NAME(F) (! IS_ABSOLUTE_FILE_NAME (F)) - -#endif /* DOSNAME_H_ */ diff -Nru datamash-1.7/lib/dup2.c datamash-1.8/lib/dup2.c --- datamash-1.7/lib/dup2.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/dup2.c 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,189 @@ +/* Duplicate an open file descriptor to a specified file descriptor. + + Copyright (C) 1999, 2004-2007, 2009-2021 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 Paul Eggert */ + +#include + +/* Specification. */ +#include + +#include +#include + +#undef dup2 + +#if defined _WIN32 && ! defined __CYGWIN__ + +/* Get declarations of the native Windows API functions. */ +# define WIN32_LEAN_AND_MEAN +# include + +# if HAVE_MSVC_INVALID_PARAMETER_HANDLER +# include "msvc-inval.h" +# endif + +/* Get _get_osfhandle. */ +# if GNULIB_MSVC_NOTHROW +# include "msvc-nothrow.h" +# else +# include +# endif + +# if HAVE_MSVC_INVALID_PARAMETER_HANDLER +static int +dup2_nothrow (int fd, int desired_fd) +{ + int result; + + TRY_MSVC_INVAL + { + result = _dup2 (fd, desired_fd); + } + CATCH_MSVC_INVAL + { + errno = EBADF; + result = -1; + } + DONE_MSVC_INVAL; + + return result; +} +# else +# define dup2_nothrow _dup2 +# endif + +static int +ms_windows_dup2 (int fd, int desired_fd) +{ + int result; + + /* If fd is closed, mingw hangs on dup2 (fd, fd). If fd is open, + dup2 (fd, fd) returns 0, but all further attempts to use fd in + future dup2 calls will hang. */ + if (fd == desired_fd) + { + if ((HANDLE) _get_osfhandle (fd) == INVALID_HANDLE_VALUE) + { + errno = EBADF; + return -1; + } + return fd; + } + + /* Wine 1.0.1 return 0 when desired_fd is negative but not -1: + https://bugs.winehq.org/show_bug.cgi?id=21289 */ + if (desired_fd < 0) + { + errno = EBADF; + return -1; + } + + result = dup2_nothrow (fd, desired_fd); + + if (result == 0) + result = desired_fd; + + return result; +} + +# define dup2 ms_windows_dup2 + +#elif defined __KLIBC__ + +# include + +static int +klibc_dup2dirfd (int fd, int desired_fd) +{ + int tempfd; + int dupfd; + + tempfd = open ("NUL", O_RDONLY); + if (tempfd == -1) + return -1; + + if (tempfd == desired_fd) + { + close (tempfd); + + char path[_MAX_PATH]; + if (__libc_Back_ioFHToPath (fd, path, sizeof (path))) + return -1; + + return open(path, O_RDONLY); + } + + dupfd = klibc_dup2dirfd (fd, desired_fd); + + close (tempfd); + + return dupfd; +} + +static int +klibc_dup2 (int fd, int desired_fd) +{ + int dupfd; + struct stat sbuf; + + dupfd = dup2 (fd, desired_fd); + if (dupfd == -1 && errno == ENOTSUP \ + && !fstat (fd, &sbuf) && S_ISDIR (sbuf.st_mode)) + { + close (desired_fd); + + return klibc_dup2dirfd (fd, desired_fd); + } + + return dupfd; +} + +# define dup2 klibc_dup2 +#endif + +int +rpl_dup2 (int fd, int desired_fd) +{ + int result; + +#ifdef F_GETFL + /* On Linux kernels 2.6.26-2.6.29, dup2 (fd, fd) returns -EBADF. + On Cygwin 1.5.x, dup2 (1, 1) returns 0. + On Cygwin 1.7.17, dup2 (1, -1) dumps core. + On Cygwin 1.7.25, dup2 (1, 256) can dump core. + On Haiku, dup2 (fd, fd) mistakenly clears FD_CLOEXEC. */ +# if HAVE_SETDTABLESIZE + setdtablesize (desired_fd + 1); +# endif + if (desired_fd < 0) + fd = desired_fd; + if (fd == desired_fd) + return fcntl (fd, F_GETFL) == -1 ? -1 : fd; +#endif + + result = dup2 (fd, desired_fd); + + /* Correct an errno value on FreeBSD 6.1 and Cygwin 1.5.x. */ + if (result == -1 && errno == EMFILE) + errno = EBADF; +#if REPLACE_FCHDIR + if (fd != desired_fd && result != -1) + result = _gl_register_dup (fd, result); +#endif + return result; +} diff -Nru datamash-1.7/lib/errno.in.h datamash-1.8/lib/errno.in.h --- datamash-1.7/lib/errno.in.h 2020-04-23 04:03:30.000000000 +0000 +++ datamash-1.8/lib/errno.in.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* A POSIX-like . - Copyright (C) 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2008-2021 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.7/lib/error.c datamash-1.8/lib/error.c --- datamash-1.7/lib/error.c 2020-04-23 04:03:31.000000000 +0000 +++ datamash-1.8/lib/error.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Error handler for noninteractive utilities - Copyright (C) 1990-1998, 2000-2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 1990-1998, 2000-2007, 2009-2021 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 @@ -40,7 +40,7 @@ # include # define mbsrtowcs __mbsrtowcs # define USE_UNLOCKED_IO 0 -# define _GL_ATTRIBUTE_FORMAT_PRINTF(a, b) +# define _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(a, b) # define _GL_ARG_NONNULL(a) #else # include "getprogname.h" @@ -202,7 +202,7 @@ #endif } -static void _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0) _GL_ARG_NONNULL ((3)) +static void _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0) _GL_ARG_NONNULL ((3)) error_tail (int status, int errnum, const char *message, va_list args) { #if _LIBC diff -Nru datamash-1.7/lib/error.h datamash-1.8/lib/error.h --- datamash-1.7/lib/error.h 2020-04-23 04:03:32.000000000 +0000 +++ datamash-1.8/lib/error.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Declaration for error-reporting function - Copyright (C) 1995-1997, 2003, 2006, 2008-2020 Free Software Foundation, + Copyright (C) 1995-1997, 2003, 2006, 2008-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -19,27 +19,8 @@ #ifndef _ERROR_H #define _ERROR_H 1 -/* The __attribute__ feature is available in gcc versions 2.5 and later. - The __-protected variants of the attributes 'format' and 'printf' are - accepted by gcc versions 2.6.4 (effectively 2.7) and later. - We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because - gnulib and libintl do '#define printf __printf__' when they override - the 'printf' function. */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) -# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) -#else -# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */ -#endif - -/* On mingw, the flavor of printf depends on whether the extensions module - * is in use; the check for determines the witness macro. */ -#ifndef _GL_ATTRIBUTE_SPEC_PRINTF -# if GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU -# define _GL_ATTRIBUTE_SPEC_PRINTF __gnu_printf__ -# else -# define _GL_ATTRIBUTE_SPEC_PRINTF __printf__ -# endif -#endif +/* Get _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM. */ +#include #ifdef __cplusplus extern "C" { @@ -50,11 +31,21 @@ If STATUS is nonzero, terminate the program with 'exit (STATUS)'. */ extern void error (int __status, int __errnum, const char *__format, ...) - _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF, 3, 4)); +#if GNULIB_VFPRINTF_POSIX + _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 4)) +#else + _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM, 3, 4)) +#endif + ; extern void error_at_line (int __status, int __errnum, const char *__fname, unsigned int __lineno, const char *__format, ...) - _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF, 5, 6)); +#if GNULIB_VFPRINTF_POSIX + _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 5, 6)) +#else + _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM, 5, 6)) +#endif + ; /* If NULL, error will flush stdout, then print on stderr the program name, a colon and a space. Otherwise, error will call this diff -Nru datamash-1.7/lib/exitfail.c datamash-1.8/lib/exitfail.c --- datamash-1.7/lib/exitfail.c 2020-04-23 04:03:32.000000000 +0000 +++ datamash-1.8/lib/exitfail.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* Failure exit status - Copyright (C) 2002-2003, 2005-2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2005-2007, 2009-2021 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.7/lib/exitfail.h datamash-1.8/lib/exitfail.h --- datamash-1.7/lib/exitfail.h 2020-04-23 04:03:32.000000000 +0000 +++ datamash-1.8/lib/exitfail.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* Failure exit status - Copyright (C) 2002, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2002, 2009-2021 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.7/lib/expl.c datamash-1.8/lib/expl.c --- datamash-1.7/lib/expl.c 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/expl.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Exponential function. - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 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.7/lib/expl-table.c datamash-1.8/lib/expl-table.c --- datamash-1.7/lib/expl-table.c 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/expl-table.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Exponential function. - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 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.7/lib/fabsl.c datamash-1.8/lib/fabsl.c --- datamash-1.7/lib/fabsl.c 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/fabsl.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Absolute value. - Copyright (C) 2012-2020 Free Software Foundation, Inc. + Copyright (C) 2012-2021 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.7/lib/fcntl.c datamash-1.8/lib/fcntl.c --- datamash-1.7/lib/fcntl.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/fcntl.c 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,629 @@ +/* Provide file descriptor control. + + Copyright (C) 2009-2021 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 Eric Blake . */ + +#include + +/* Specification. */ +#include + +#include +#include +#include +#include +#include + +#ifdef __KLIBC__ +# define INCL_DOS +# include +#endif + +#if defined _WIN32 && ! defined __CYGWIN__ +/* Get declarations of the native Windows API functions. */ +# define WIN32_LEAN_AND_MEAN +# include + +/* Get _get_osfhandle. */ +# if GNULIB_MSVC_NOTHROW +# include "msvc-nothrow.h" +# else +# include +# endif + +/* Upper bound on getdtablesize(). See lib/getdtablesize.c. */ +# define OPEN_MAX_MAX 0x10000 + +/* Duplicate OLDFD into the first available slot of at least NEWFD, + which must be positive, with FLAGS determining whether the duplicate + will be inheritable. */ +static int +dupfd (int oldfd, int newfd, int flags) +{ + /* Mingw has no way to create an arbitrary fd. Iterate until all + file descriptors less than newfd are filled up. */ + HANDLE curr_process = GetCurrentProcess (); + HANDLE old_handle = (HANDLE) _get_osfhandle (oldfd); + unsigned char fds_to_close[OPEN_MAX_MAX / CHAR_BIT]; + unsigned int fds_to_close_bound = 0; + int result; + BOOL inherit = flags & O_CLOEXEC ? FALSE : TRUE; + int mode; + + if (newfd < 0 || getdtablesize () <= newfd) + { + errno = EINVAL; + return -1; + } + if (old_handle == INVALID_HANDLE_VALUE + || (mode = _setmode (oldfd, O_BINARY)) == -1) + { + /* oldfd is not open, or is an unassigned standard file + descriptor. */ + errno = EBADF; + return -1; + } + _setmode (oldfd, mode); + flags |= mode; + + for (;;) + { + HANDLE new_handle; + int duplicated_fd; + unsigned int index; + + if (!DuplicateHandle (curr_process, /* SourceProcessHandle */ + old_handle, /* SourceHandle */ + curr_process, /* TargetProcessHandle */ + (PHANDLE) &new_handle, /* TargetHandle */ + (DWORD) 0, /* DesiredAccess */ + inherit, /* InheritHandle */ + DUPLICATE_SAME_ACCESS)) /* Options */ + { + switch (GetLastError ()) + { + case ERROR_TOO_MANY_OPEN_FILES: + errno = EMFILE; + break; + case ERROR_INVALID_HANDLE: + case ERROR_INVALID_TARGET_HANDLE: + case ERROR_DIRECT_ACCESS_HANDLE: + errno = EBADF; + break; + case ERROR_INVALID_PARAMETER: + case ERROR_INVALID_FUNCTION: + case ERROR_INVALID_ACCESS: + errno = EINVAL; + break; + default: + errno = EACCES; + break; + } + result = -1; + break; + } + duplicated_fd = _open_osfhandle ((intptr_t) new_handle, flags); + if (duplicated_fd < 0) + { + CloseHandle (new_handle); + result = -1; + break; + } + if (newfd <= duplicated_fd) + { + result = duplicated_fd; + break; + } + + /* Set the bit duplicated_fd in fds_to_close[]. */ + index = (unsigned int) duplicated_fd / CHAR_BIT; + if (fds_to_close_bound <= index) + { + if (sizeof fds_to_close <= index) + /* Need to increase OPEN_MAX_MAX. */ + abort (); + memset (fds_to_close + fds_to_close_bound, '\0', + index + 1 - fds_to_close_bound); + fds_to_close_bound = index + 1; + } + fds_to_close[index] |= 1 << ((unsigned int) duplicated_fd % CHAR_BIT); + } + + /* Close the previous fds that turned out to be too small. */ + { + int saved_errno = errno; + unsigned int duplicated_fd; + + for (duplicated_fd = 0; + duplicated_fd < fds_to_close_bound * CHAR_BIT; + duplicated_fd++) + if ((fds_to_close[duplicated_fd / CHAR_BIT] + >> (duplicated_fd % CHAR_BIT)) + & 1) + close (duplicated_fd); + + errno = saved_errno; + } + +# if REPLACE_FCHDIR + if (0 <= result) + result = _gl_register_dup (oldfd, result); +# endif + return result; +} +#endif /* W32 */ + +/* Forward declarations, because we '#undef fcntl' in the middle of this + compilation unit. */ +/* Our implementation of fcntl (fd, F_DUPFD, target). */ +static int rpl_fcntl_DUPFD (int fd, int target); +/* Our implementation of fcntl (fd, F_DUPFD_CLOEXEC, target). */ +static int rpl_fcntl_DUPFD_CLOEXEC (int fd, int target); +#ifdef __KLIBC__ +/* Adds support for fcntl on directories. */ +static int klibc_fcntl (int fd, int action, /* arg */...); +#endif + + +/* Perform the specified ACTION on the file descriptor FD, possibly + using the argument ARG further described below. This replacement + handles the following actions, and forwards all others on to the + native fcntl. An unrecognized ACTION returns -1 with errno set to + EINVAL. + + F_DUPFD - duplicate FD, with int ARG being the minimum target fd. + If successful, return the duplicate, which will be inheritable; + otherwise return -1 and set errno. + + F_DUPFD_CLOEXEC - duplicate FD, with int ARG being the minimum + target fd. If successful, return the duplicate, which will not be + inheritable; otherwise return -1 and set errno. + + F_GETFD - ARG need not be present. If successful, return a + non-negative value containing the descriptor flags of FD (only + FD_CLOEXEC is portable, but other flags may be present); otherwise + return -1 and set errno. */ + +int +fcntl (int fd, int action, /* arg */...) +#undef fcntl +#ifdef __KLIBC__ +# define fcntl klibc_fcntl +#endif +{ + va_list arg; + int result = -1; + va_start (arg, action); + switch (action) + { + case F_DUPFD: + { + int target = va_arg (arg, int); + result = rpl_fcntl_DUPFD (fd, target); + break; + } + + case F_DUPFD_CLOEXEC: + { + int target = va_arg (arg, int); + result = rpl_fcntl_DUPFD_CLOEXEC (fd, target); + break; + } + +#if !HAVE_FCNTL + case F_GETFD: + { +# if defined _WIN32 && ! defined __CYGWIN__ + HANDLE handle = (HANDLE) _get_osfhandle (fd); + DWORD flags; + if (handle == INVALID_HANDLE_VALUE + || GetHandleInformation (handle, &flags) == 0) + errno = EBADF; + else + result = (flags & HANDLE_FLAG_INHERIT) ? 0 : FD_CLOEXEC; +# else /* !W32 */ + /* Use dup2 to reject invalid file descriptors. No way to + access this information, so punt. */ + if (0 <= dup2 (fd, fd)) + result = 0; +# endif /* !W32 */ + break; + } /* F_GETFD */ +#endif /* !HAVE_FCNTL */ + + /* Implementing F_SETFD on mingw is not trivial - there is no + API for changing the O_NOINHERIT bit on an fd, and merely + changing the HANDLE_FLAG_INHERIT bit on the underlying handle + can lead to odd state. It may be possible by duplicating the + handle, using _open_osfhandle with the right flags, then + using dup2 to move the duplicate onto the original, but that + is not supported for now. */ + + default: + { +#if HAVE_FCNTL + switch (action) + { + #ifdef F_BARRIERFSYNC /* macOS */ + case F_BARRIERFSYNC: + #endif + #ifdef F_CHKCLEAN /* macOS */ + case F_CHKCLEAN: + #endif + #ifdef F_CLOSEM /* NetBSD, HP-UX */ + case F_CLOSEM: + #endif + #ifdef F_FLUSH_DATA /* macOS */ + case F_FLUSH_DATA: + #endif + #ifdef F_FREEZE_FS /* macOS */ + case F_FREEZE_FS: + #endif + #ifdef F_FULLFSYNC /* macOS */ + case F_FULLFSYNC: + #endif + #ifdef F_GETCONFINED /* macOS */ + case F_GETCONFINED: + #endif + #ifdef F_GETDEFAULTPROTLEVEL /* macOS */ + case F_GETDEFAULTPROTLEVEL: + #endif + #ifdef F_GETFD /* POSIX */ + case F_GETFD: + #endif + #ifdef F_GETFL /* POSIX */ + case F_GETFL: + #endif + #ifdef F_GETLEASE /* Linux */ + case F_GETLEASE: + #endif + #ifdef F_GETNOSIGPIPE /* macOS */ + case F_GETNOSIGPIPE: + #endif + #ifdef F_GETOWN /* POSIX */ + case F_GETOWN: + #endif + #ifdef F_GETPIPE_SZ /* Linux */ + case F_GETPIPE_SZ: + #endif + #ifdef F_GETPROTECTIONCLASS /* macOS */ + case F_GETPROTECTIONCLASS: + #endif + #ifdef F_GETPROTECTIONLEVEL /* macOS */ + case F_GETPROTECTIONLEVEL: + #endif + #ifdef F_GET_SEALS /* Linux */ + case F_GET_SEALS: + #endif + #ifdef F_GETSIG /* Linux */ + case F_GETSIG: + #endif + #ifdef F_MAXFD /* NetBSD */ + case F_MAXFD: + #endif + #ifdef F_RECYCLE /* macOS */ + case F_RECYCLE: + #endif + #ifdef F_SETFIFOENH /* HP-UX */ + case F_SETFIFOENH: + #endif + #ifdef F_THAW_FS /* macOS */ + case F_THAW_FS: + #endif + /* These actions take no argument. */ + result = fcntl (fd, action); + break; + + #ifdef F_ADD_SEALS /* Linux */ + case F_ADD_SEALS: + #endif + #ifdef F_BADFD /* Solaris */ + case F_BADFD: + #endif + #ifdef F_CHECK_OPENEVT /* macOS */ + case F_CHECK_OPENEVT: + #endif + #ifdef F_DUP2FD /* FreeBSD, AIX, Solaris */ + case F_DUP2FD: + #endif + #ifdef F_DUP2FD_CLOEXEC /* FreeBSD, Solaris */ + case F_DUP2FD_CLOEXEC: + #endif + #ifdef F_DUP2FD_CLOFORK /* Solaris */ + case F_DUP2FD_CLOFORK: + #endif + #ifdef F_DUPFD /* POSIX */ + case F_DUPFD: + #endif + #ifdef F_DUPFD_CLOEXEC /* POSIX */ + case F_DUPFD_CLOEXEC: + #endif + #ifdef F_DUPFD_CLOFORK /* Solaris */ + case F_DUPFD_CLOFORK: + #endif + #ifdef F_GETXFL /* Solaris */ + case F_GETXFL: + #endif + #ifdef F_GLOBAL_NOCACHE /* macOS */ + case F_GLOBAL_NOCACHE: + #endif + #ifdef F_MAKECOMPRESSED /* macOS */ + case F_MAKECOMPRESSED: + #endif + #ifdef F_MOVEDATAEXTENTS /* macOS */ + case F_MOVEDATAEXTENTS: + #endif + #ifdef F_NOCACHE /* macOS */ + case F_NOCACHE: + #endif + #ifdef F_NODIRECT /* macOS */ + case F_NODIRECT: + #endif + #ifdef F_NOTIFY /* Linux */ + case F_NOTIFY: + #endif + #ifdef F_OPLKACK /* IRIX */ + case F_OPLKACK: + #endif + #ifdef F_OPLKREG /* IRIX */ + case F_OPLKREG: + #endif + #ifdef F_RDAHEAD /* macOS */ + case F_RDAHEAD: + #endif + #ifdef F_SETBACKINGSTORE /* macOS */ + case F_SETBACKINGSTORE: + #endif + #ifdef F_SETCONFINED /* macOS */ + case F_SETCONFINED: + #endif + #ifdef F_SETFD /* POSIX */ + case F_SETFD: + #endif + #ifdef F_SETFL /* POSIX */ + case F_SETFL: + #endif + #ifdef F_SETLEASE /* Linux */ + case F_SETLEASE: + #endif + #ifdef F_SETNOSIGPIPE /* macOS */ + case F_SETNOSIGPIPE: + #endif + #ifdef F_SETOWN /* POSIX */ + case F_SETOWN: + #endif + #ifdef F_SETPIPE_SZ /* Linux */ + case F_SETPIPE_SZ: + #endif + #ifdef F_SETPROTECTIONCLASS /* macOS */ + case F_SETPROTECTIONCLASS: + #endif + #ifdef F_SETSIG /* Linux */ + case F_SETSIG: + #endif + #ifdef F_SINGLE_WRITER /* macOS */ + case F_SINGLE_WRITER: + #endif + /* These actions take an 'int' argument. */ + { + int x = va_arg (arg, int); + result = fcntl (fd, action, x); + } + break; + + default: + /* Other actions take a pointer argument. */ + { + void *p = va_arg (arg, void *); + result = fcntl (fd, action, p); + } + break; + } +#else + errno = EINVAL; +#endif + break; + } + } + va_end (arg); + return result; +} + +static int +rpl_fcntl_DUPFD (int fd, int target) +{ + int result; +#if !HAVE_FCNTL + result = dupfd (fd, target, 0); +#elif FCNTL_DUPFD_BUGGY || REPLACE_FCHDIR + /* Detect invalid target; needed for cygwin 1.5.x. */ + if (target < 0 || getdtablesize () <= target) + { + result = -1; + errno = EINVAL; + } + else + { + /* Haiku alpha 2 loses fd flags on original. */ + int flags = fcntl (fd, F_GETFD); + if (flags < 0) + result = -1; + else + { + result = fcntl (fd, F_DUPFD, target); + if (0 <= result && fcntl (fd, F_SETFD, flags) == -1) + { + int saved_errno = errno; + close (result); + result = -1; + errno = saved_errno; + } +# if REPLACE_FCHDIR + if (0 <= result) + result = _gl_register_dup (fd, result); +# endif + } + } +#else + result = fcntl (fd, F_DUPFD, target); +#endif + return result; +} + +static int +rpl_fcntl_DUPFD_CLOEXEC (int fd, int target) +{ + int result; +#if !HAVE_FCNTL + result = dupfd (fd, target, O_CLOEXEC); +#else /* HAVE_FCNTL */ +# if defined __NetBSD__ || defined __HAIKU__ + /* On NetBSD 9.0, the system fcntl (fd, F_DUPFD_CLOEXEC, target) + has only the same effect as fcntl (fd, F_DUPFD, target). */ + /* On Haiku, the system fcntl (fd, F_DUPFD_CLOEXEC, target) sets + the FD_CLOEXEC flag on fd, not on target. Therefore avoid the + system fcntl in this case. */ +# define have_dupfd_cloexec -1 +# else + /* Try the system call first, if the headers claim it exists + (that is, if GNULIB_defined_F_DUPFD_CLOEXEC is 0), since we + may be running with a glibc that has the macro but with an + older kernel that does not support it. Cache the + information on whether the system call really works, but + avoid caching failure if the corresponding F_DUPFD fails + for any reason. 0 = unknown, 1 = yes, -1 = no. */ + static int have_dupfd_cloexec = GNULIB_defined_F_DUPFD_CLOEXEC ? -1 : 0; + if (0 <= have_dupfd_cloexec) + { + result = fcntl (fd, F_DUPFD_CLOEXEC, target); + if (0 <= result || errno != EINVAL) + { + have_dupfd_cloexec = 1; +# if REPLACE_FCHDIR + if (0 <= result) + result = _gl_register_dup (fd, result); +# endif + } + else + { + result = rpl_fcntl_DUPFD (fd, target); + if (result >= 0) + have_dupfd_cloexec = -1; + } + } + else +# endif + result = rpl_fcntl_DUPFD (fd, target); + if (0 <= result && have_dupfd_cloexec == -1) + { + int flags = fcntl (result, F_GETFD); + if (flags < 0 || fcntl (result, F_SETFD, flags | FD_CLOEXEC) == -1) + { + int saved_errno = errno; + close (result); + errno = saved_errno; + result = -1; + } + } +#endif /* HAVE_FCNTL */ + return result; +} + +#undef fcntl + +#ifdef __KLIBC__ + +static int +klibc_fcntl (int fd, int action, /* arg */...) +{ + va_list arg_ptr; + int arg; + struct stat sbuf; + int result; + + va_start (arg_ptr, action); + arg = va_arg (arg_ptr, int); + result = fcntl (fd, action, arg); + /* EPERM for F_DUPFD, ENOTSUP for others */ + if (result == -1 && (errno == EPERM || errno == ENOTSUP) + && !fstat (fd, &sbuf) && S_ISDIR (sbuf.st_mode)) + { + ULONG ulMode; + + switch (action) + { + case F_DUPFD: + /* Find available fd */ + while (fcntl (arg, F_GETFL) != -1 || errno != EBADF) + arg++; + + result = dup2 (fd, arg); + break; + + /* Using underlying APIs is right ? */ + case F_GETFD: + if (DosQueryFHState (fd, &ulMode)) + break; + + result = (ulMode & OPEN_FLAGS_NOINHERIT) ? FD_CLOEXEC : 0; + break; + + case F_SETFD: + if (arg & ~FD_CLOEXEC) + break; + + if (DosQueryFHState (fd, &ulMode)) + break; + + if (arg & FD_CLOEXEC) + ulMode |= OPEN_FLAGS_NOINHERIT; + else + ulMode &= ~OPEN_FLAGS_NOINHERIT; + + /* Filter supported flags. */ + ulMode &= (OPEN_FLAGS_WRITE_THROUGH | OPEN_FLAGS_FAIL_ON_ERROR + | OPEN_FLAGS_NO_CACHE | OPEN_FLAGS_NOINHERIT); + + if (DosSetFHState (fd, ulMode)) + break; + + result = 0; + break; + + case F_GETFL: + result = 0; + break; + + case F_SETFL: + if (arg != 0) + break; + + result = 0; + break; + + default: + errno = EINVAL; + break; + } + } + + va_end (arg_ptr); + + return result; +} + +#endif diff -Nru datamash-1.7/lib/fcntl.in.h datamash-1.8/lib/fcntl.in.h --- datamash-1.7/lib/fcntl.in.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/fcntl.in.h 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,441 @@ +/* Like , but with non-working flags defined to 0. + + Copyright (C) 2006-2021 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 Paul Eggert */ + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +#if defined __need_system_fcntl_h +/* Special invocation convention. */ + +/* Needed before . + May also define off_t to a 64-bit type on native Windows. */ +#include +/* On some systems other than glibc, is a prerequisite of + . On glibc systems, we would like to avoid namespace pollution. + But on glibc systems, includes inside an + extern "C" { ... } block, which leads to errors in C++ mode with the + overridden from gnulib. These errors are known to be gone + with g++ version >= 4.3. */ +#if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && (defined __ICC || !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))) +# include +#endif +#@INCLUDE_NEXT@ @NEXT_FCNTL_H@ + +/* Native Windows platforms declare open(), creat() in . */ +#if (@GNULIB_CREAT@ || @GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \ + && (defined _WIN32 && ! defined __CYGWIN__) +# include +#endif + +#else +/* Normal invocation convention. */ + +#ifndef _@GUARD_PREFIX@_FCNTL_H + +/* Needed before . + May also define off_t to a 64-bit type on native Windows. */ +#include +/* On some systems other than glibc, is a prerequisite of + . On glibc systems, we would like to avoid namespace pollution. + But on glibc systems, includes inside an + extern "C" { ... } block, which leads to errors in C++ mode with the + overridden from gnulib. These errors are known to be gone + with g++ version >= 4.3. */ +#if !(defined __GLIBC__ || defined __UCLIBC__) || (defined __cplusplus && defined GNULIB_NAMESPACE && (defined __ICC || !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))) +# include +#endif +/* The include_next requires a split double-inclusion guard. */ +#@INCLUDE_NEXT@ @NEXT_FCNTL_H@ + +/* Native Windows platforms declare open(), creat() in . */ +#if (@GNULIB_CREAT@ || @GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \ + && (defined _WIN32 && ! defined __CYGWIN__) +# include +#endif + +#ifndef _@GUARD_PREFIX@_FCNTL_H +#define _@GUARD_PREFIX@_FCNTL_H + +#ifndef __GLIBC__ /* Avoid namespace pollution on glibc systems. */ +# include +#endif + + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_ARG_NONNULL is copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + + +/* Declare overridden functions. */ + +#if @GNULIB_CREAT@ +# if @REPLACE_CREAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef creat +# define creat rpl_creat +# endif +_GL_FUNCDECL_RPL (creat, int, (const char *filename, mode_t mode) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (creat, int, (const char *filename, mode_t mode)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef creat +# define creat _creat +# endif +_GL_CXXALIAS_MDA (creat, int, (const char *filename, mode_t mode)); +# else +_GL_CXXALIAS_SYS (creat, int, (const char *filename, mode_t mode)); +# endif +_GL_CXXALIASWARN (creat); +#elif defined GNULIB_POSIXCHECK +# undef creat +/* Assume creat is always declared. */ +_GL_WARN_ON_USE (creat, "creat is not always POSIX compliant - " + "use gnulib module creat for portability"); +#elif @GNULIB_MDA_CREAT@ +/* On native Windows, map 'creat' to '_creat', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::creat always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef creat +# define creat _creat +# endif +/* Need to cast, because in mingw the last argument is 'int mode'. */ +_GL_CXXALIAS_MDA_CAST (creat, int, (const char *filename, mode_t mode)); +# else +_GL_CXXALIAS_SYS (creat, int, (const char *filename, mode_t mode)); +# endif +_GL_CXXALIASWARN (creat); +#endif + +#if @GNULIB_FCNTL@ +# if @REPLACE_FCNTL@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fcntl +# define fcntl rpl_fcntl +# endif +_GL_FUNCDECL_RPL (fcntl, int, (int fd, int action, ...)); +_GL_CXXALIAS_RPL (fcntl, int, (int fd, int action, ...)); +# if !GNULIB_defined_rpl_fcntl +# define GNULIB_defined_rpl_fcntl 1 +# endif +# else +# if !@HAVE_FCNTL@ +_GL_FUNCDECL_SYS (fcntl, int, (int fd, int action, ...)); +# if !GNULIB_defined_fcntl +# define GNULIB_defined_fcntl 1 +# endif +# endif +_GL_CXXALIAS_SYS (fcntl, int, (int fd, int action, ...)); +# endif +_GL_CXXALIASWARN (fcntl); +#elif defined GNULIB_POSIXCHECK +# undef fcntl +# if HAVE_RAW_DECL_FCNTL +_GL_WARN_ON_USE (fcntl, "fcntl is not always POSIX compliant - " + "use gnulib module fcntl for portability"); +# endif +#endif + +#if @GNULIB_OPEN@ +# if @REPLACE_OPEN@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef open +# define open rpl_open +# endif +_GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef open +# define open _open +# endif +_GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...)); +# else +_GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...)); +# endif +/* On HP-UX 11, in C++ mode, open() is defined as an inline function with a + default argument. _GL_CXXALIASWARN does not work in this case. */ +# if !defined __hpux +_GL_CXXALIASWARN (open); +# endif +#elif defined GNULIB_POSIXCHECK +# undef open +/* Assume open is always declared. */ +_GL_WARN_ON_USE (open, "open is not always POSIX compliant - " + "use gnulib module open for portability"); +#elif @GNULIB_MDA_OPEN@ +/* On native Windows, map 'open' to '_open', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::open always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef open +# define open _open +# endif +_GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...)); +# else +_GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...)); +# endif +# if !defined __hpux +_GL_CXXALIASWARN (open); +# endif +#endif + +#if @GNULIB_OPENAT@ +# if @REPLACE_OPENAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef openat +# define openat rpl_openat +# endif +_GL_FUNCDECL_RPL (openat, int, + (int fd, char const *file, int flags, /* mode_t mode */ ...) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (openat, int, + (int fd, char const *file, int flags, /* mode_t mode */ ...)); +# else +# if !@HAVE_OPENAT@ +_GL_FUNCDECL_SYS (openat, int, + (int fd, char const *file, int flags, /* mode_t mode */ ...) + _GL_ARG_NONNULL ((2))); +# endif +_GL_CXXALIAS_SYS (openat, int, + (int fd, char const *file, int flags, /* mode_t mode */ ...)); +# endif +_GL_CXXALIASWARN (openat); +#elif defined GNULIB_POSIXCHECK +# undef openat +# if HAVE_RAW_DECL_OPENAT +_GL_WARN_ON_USE (openat, "openat is not portable - " + "use gnulib module openat for portability"); +# endif +#endif + + +/* Fix up the FD_* macros, only known to be missing on mingw. */ + +#ifndef FD_CLOEXEC +# define FD_CLOEXEC 1 +#endif + +/* Fix up the supported F_* macros. Intentionally leave other F_* + macros undefined. Only known to be missing on mingw. */ + +#ifndef F_DUPFD_CLOEXEC +# define F_DUPFD_CLOEXEC 0x40000000 +/* Witness variable: 1 if gnulib defined F_DUPFD_CLOEXEC, 0 otherwise. */ +# define GNULIB_defined_F_DUPFD_CLOEXEC 1 +#else +# define GNULIB_defined_F_DUPFD_CLOEXEC 0 +#endif + +#ifndef F_DUPFD +# define F_DUPFD 1 +#endif + +#ifndef F_GETFD +# define F_GETFD 2 +#endif + +/* Fix up the O_* macros. */ + +/* AIX 7.1 with XL C 12.1 defines O_CLOEXEC, O_NOFOLLOW, and O_TTY_INIT + to values outside 'int' range, so omit these misdefinitions. + But avoid namespace pollution on non-AIX systems. */ +#ifdef _AIX +# include +# if defined O_CLOEXEC && ! (INT_MIN <= O_CLOEXEC && O_CLOEXEC <= INT_MAX) +# undef O_CLOEXEC +# endif +# if defined O_NOFOLLOW && ! (INT_MIN <= O_NOFOLLOW && O_NOFOLLOW <= INT_MAX) +# undef O_NOFOLLOW +# endif +# if defined O_TTY_INIT && ! (INT_MIN <= O_TTY_INIT && O_TTY_INIT <= INT_MAX) +# undef O_TTY_INIT +# endif +#endif + +#if !defined O_DIRECT && defined O_DIRECTIO +/* Tru64 spells it 'O_DIRECTIO'. */ +# define O_DIRECT O_DIRECTIO +#endif + +#if !defined O_CLOEXEC && defined O_NOINHERIT +/* Mingw spells it 'O_NOINHERIT'. */ +# define O_CLOEXEC O_NOINHERIT +#endif + +#ifndef O_CLOEXEC +# define O_CLOEXEC 0x40000000 /* Try to not collide with system O_* flags. */ +# define GNULIB_defined_O_CLOEXEC 1 +#else +# define GNULIB_defined_O_CLOEXEC 0 +#endif + +#ifndef O_DIRECT +# define O_DIRECT 0 +#endif + +#ifndef O_DIRECTORY +# define O_DIRECTORY 0 +#endif + +#ifndef O_DSYNC +# define O_DSYNC 0 +#endif + +#ifndef O_EXEC +# define O_EXEC O_RDONLY /* This is often close enough in older systems. */ +#endif + +#ifndef O_IGNORE_CTTY +# define O_IGNORE_CTTY 0 +#endif + +#ifndef O_NDELAY +# define O_NDELAY 0 +#endif + +#ifndef O_NOATIME +# define O_NOATIME 0 +#endif + +#ifndef O_NONBLOCK +# define O_NONBLOCK O_NDELAY +#endif + +/* If the gnulib module 'nonblocking' is in use, guarantee a working non-zero + value of O_NONBLOCK. Otherwise, O_NONBLOCK is defined (above) to O_NDELAY + or to 0 as fallback. */ +#if @GNULIB_NONBLOCKING@ +# if O_NONBLOCK +# define GNULIB_defined_O_NONBLOCK 0 +# else +# define GNULIB_defined_O_NONBLOCK 1 +# undef O_NONBLOCK +# define O_NONBLOCK 0x40000000 +# endif +#endif + +#ifndef O_NOCTTY +# define O_NOCTTY 0 +#endif + +#ifndef O_NOFOLLOW +# define O_NOFOLLOW 0 +#endif + +#ifndef O_NOLINK +# define O_NOLINK 0 +#endif + +#ifndef O_NOLINKS +# define O_NOLINKS 0 +#endif + +#ifndef O_NOTRANS +# define O_NOTRANS 0 +#endif + +#ifndef O_RSYNC +# define O_RSYNC 0 +#endif + +#ifndef O_SEARCH +# define O_SEARCH O_RDONLY /* This is often close enough in older systems. */ +#endif + +#ifndef O_SYNC +# define O_SYNC 0 +#endif + +#ifndef O_TTY_INIT +# define O_TTY_INIT 0 +#endif + +#if ~O_ACCMODE & (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH) +# undef O_ACCMODE +# define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR | O_EXEC | O_SEARCH) +#endif + +/* For systems that distinguish between text and binary I/O. + O_BINARY is usually declared in fcntl.h */ +#if !defined O_BINARY && defined _O_BINARY + /* For MSC-compatible compilers. */ +# define O_BINARY _O_BINARY +# define O_TEXT _O_TEXT +#endif + +#if defined __BEOS__ || defined __HAIKU__ + /* BeOS 5 and Haiku have O_BINARY and O_TEXT, but they have no effect. */ +# undef O_BINARY +# undef O_TEXT +#endif + +#ifndef O_BINARY +# define O_BINARY 0 +# define O_TEXT 0 +#endif + +/* Fix up the AT_* macros. */ + +/* Work around a bug in Solaris 9 and 10: AT_FDCWD is positive. Its + value exceeds INT_MAX, so its use as an int doesn't conform to the + C standard, and GCC and Sun C complain in some cases. If the bug + is present, undef AT_FDCWD here, so it can be redefined below. */ +#if 0 < AT_FDCWD && AT_FDCWD == 0xffd19553 +# undef AT_FDCWD +#endif + +/* Use the same bit pattern as Solaris 9, but with the proper + signedness. The bit pattern is important, in case this actually is + Solaris with the above workaround. */ +#ifndef AT_FDCWD +# define AT_FDCWD (-3041965) +#endif + +/* Use the same values as Solaris 9. This shouldn't matter, but + there's no real reason to differ. */ +#ifndef AT_SYMLINK_NOFOLLOW +# define AT_SYMLINK_NOFOLLOW 4096 +#endif + +#ifndef AT_REMOVEDIR +# define AT_REMOVEDIR 1 +#endif + +/* Solaris 9 lacks these two, so just pick unique values. */ +#ifndef AT_SYMLINK_FOLLOW +# define AT_SYMLINK_FOLLOW 2 +#endif + +#ifndef AT_EACCESS +# define AT_EACCESS 4 +#endif + + +#endif /* _@GUARD_PREFIX@_FCNTL_H */ +#endif /* _@GUARD_PREFIX@_FCNTL_H */ +#endif diff -Nru datamash-1.7/lib/fd-hook.c datamash-1.8/lib/fd-hook.c --- datamash-1.7/lib/fd-hook.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/fd-hook.c 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,116 @@ +/* Hook for making file descriptor functions close(), ioctl() extensible. + Copyright (C) 2009-2021 Free Software Foundation, Inc. + Written by Bruno Haible , 2009. + + 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 "fd-hook.h" + +#include + +/* Currently, this entire code is only needed for the handling of sockets + on native Windows platforms. */ +#if WINDOWS_SOCKETS + +/* The first and last link in the doubly linked list. + Initially the list is empty. */ +static struct fd_hook anchor = { &anchor, &anchor, NULL, NULL }; + +int +execute_close_hooks (const struct fd_hook *remaining_list, gl_close_fn primary, + int fd) +{ + if (remaining_list == &anchor) + /* End of list reached. */ + return primary (fd); + else + return remaining_list->private_close_fn (remaining_list->private_next, + primary, fd); +} + +int +execute_all_close_hooks (gl_close_fn primary, int fd) +{ + return execute_close_hooks (anchor.private_next, primary, fd); +} + +int +execute_ioctl_hooks (const struct fd_hook *remaining_list, gl_ioctl_fn primary, + int fd, int request, void *arg) +{ + if (remaining_list == &anchor) + /* End of list reached. */ + return primary (fd, request, arg); + else + return remaining_list->private_ioctl_fn (remaining_list->private_next, + primary, fd, request, arg); +} + +int +execute_all_ioctl_hooks (gl_ioctl_fn primary, + int fd, int request, void *arg) +{ + return execute_ioctl_hooks (anchor.private_next, primary, fd, request, arg); +} + +void +register_fd_hook (close_hook_fn close_hook, ioctl_hook_fn ioctl_hook, struct fd_hook *link) +{ + if (close_hook == NULL) + close_hook = execute_close_hooks; + if (ioctl_hook == NULL) + ioctl_hook = execute_ioctl_hooks; + + if (link->private_next == NULL && link->private_prev == NULL) + { + /* Add the link to the doubly linked list. */ + link->private_next = anchor.private_next; + link->private_prev = &anchor; + link->private_close_fn = close_hook; + link->private_ioctl_fn = ioctl_hook; + anchor.private_next->private_prev = link; + anchor.private_next = link; + } + else + { + /* The link is already in use. */ + if (link->private_close_fn != close_hook + || link->private_ioctl_fn != ioctl_hook) + abort (); + } +} + +void +unregister_fd_hook (struct fd_hook *link) +{ + struct fd_hook *next = link->private_next; + struct fd_hook *prev = link->private_prev; + + if (next != NULL && prev != NULL) + { + /* The link is in use. Remove it from the doubly linked list. */ + prev->private_next = next; + next->private_prev = prev; + /* Clear the link, to mark it unused. */ + link->private_next = NULL; + link->private_prev = NULL; + link->private_close_fn = NULL; + link->private_ioctl_fn = NULL; + } +} + +#endif diff -Nru datamash-1.7/lib/fd-hook.h datamash-1.8/lib/fd-hook.h --- datamash-1.7/lib/fd-hook.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/fd-hook.h 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,119 @@ +/* Hook for making file descriptor functions close(), ioctl() extensible. + Copyright (C) 2009-2021 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 FD_HOOK_H +#define FD_HOOK_H + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Currently, this entire code is only needed for the handling of sockets + on native Windows platforms. */ +#if WINDOWS_SOCKETS + + +/* Type of function that closes FD. */ +typedef int (*gl_close_fn) (int fd); + +/* Type of function that applies a control request to FD. */ +typedef int (*gl_ioctl_fn) (int fd, int request, void *arg); + +/* An element of the list of file descriptor hooks. + In CLOS (Common Lisp Object System) speak, it consists of an "around" + method for the close() function and an "around" method for the ioctl() + function. + The fields of this structure are considered private. */ +struct fd_hook +{ + /* Doubly linked list. */ + struct fd_hook *private_next; + struct fd_hook *private_prev; + /* Function that treats the types of FD that it knows about and calls + execute_close_hooks (REMAINING_LIST, PRIMARY, FD) as a fallback. */ + int (*private_close_fn) (const struct fd_hook *remaining_list, + gl_close_fn primary, + int fd); + /* Function that treats the types of FD that it knows about and calls + execute_ioctl_hooks (REMAINING_LIST, PRIMARY, FD, REQUEST, ARG) as a + fallback. */ + int (*private_ioctl_fn) (const struct fd_hook *remaining_list, + gl_ioctl_fn primary, + int fd, int request, void *arg); +}; + +/* This type of function closes FD, applying special knowledge for the FD + types it knows about, and calls + execute_close_hooks (REMAINING_LIST, PRIMARY, FD) + for the other FD types. + In CLOS speak, REMAINING_LIST is the remaining list of "around" methods, + and PRIMARY is the "primary" method for close(). */ +typedef int (*close_hook_fn) (const struct fd_hook *remaining_list, + gl_close_fn primary, + int fd); + +/* Execute the close hooks in REMAINING_LIST, with PRIMARY as "primary" method. + Return 0 or -1, like close() would do. */ +extern int execute_close_hooks (const struct fd_hook *remaining_list, + gl_close_fn primary, + int fd); + +/* Execute all close hooks, with PRIMARY as "primary" method. + Return 0 or -1, like close() would do. */ +extern int execute_all_close_hooks (gl_close_fn primary, int fd); + +/* This type of function applies a control request to FD, applying special + knowledge for the FD types it knows about, and calls + execute_ioctl_hooks (REMAINING_LIST, PRIMARY, FD, REQUEST, ARG) + for the other FD types. + In CLOS speak, REMAINING_LIST is the remaining list of "around" methods, + and PRIMARY is the "primary" method for ioctl(). */ +typedef int (*ioctl_hook_fn) (const struct fd_hook *remaining_list, + gl_ioctl_fn primary, + int fd, int request, void *arg); + +/* Execute the ioctl hooks in REMAINING_LIST, with PRIMARY as "primary" method. + Return 0 or -1, like ioctl() would do. */ +extern int execute_ioctl_hooks (const struct fd_hook *remaining_list, + gl_ioctl_fn primary, + int fd, int request, void *arg); + +/* Execute all ioctl hooks, with PRIMARY as "primary" method. + Return 0 or -1, like ioctl() would do. */ +extern int execute_all_ioctl_hooks (gl_ioctl_fn primary, + int fd, int request, void *arg); + +/* Add a function pair to the list of file descriptor hooks. + CLOSE_HOOK and IOCTL_HOOK may be NULL, indicating no change. + The LINK variable points to a piece of memory which is guaranteed to be + accessible until the corresponding call to unregister_fd_hook. */ +extern void register_fd_hook (close_hook_fn close_hook, ioctl_hook_fn ioctl_hook, + struct fd_hook *link); + +/* Removes a hook from the list of file descriptor hooks. */ +extern void unregister_fd_hook (struct fd_hook *link); + + +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* FD_HOOK_H */ diff -Nru datamash-1.7/lib/fflush.c datamash-1.8/lib/fflush.c --- datamash-1.7/lib/fflush.c 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/fflush.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* fflush.c -- allow flushing input streams - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 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 @@ -64,7 +64,7 @@ fp->_ungetc_count = 0; fp->_rcount = - fp->_rcount; } -# elif defined _IOERR /* Minix, AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel, OpenVMS */ +# elif defined _IOERR /* Minix, AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */ /* Nothing to do. */ # else /* other implementations */ fseeko (fp, 0, SEEK_CUR); diff -Nru datamash-1.7/lib/filename.h datamash-1.8/lib/filename.h --- datamash-1.7/lib/filename.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/filename.h 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,112 @@ +/* Basic filename support macros. + Copyright (C) 2001-2004, 2007-2021 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library 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. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with the GNU C Library; if not, see + . */ + +/* From Paul Eggert and Jim Meyering. */ + +#ifndef _FILENAME_H +#define _FILENAME_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Filename support. + ISSLASH(C) tests whether C is a directory separator + character. + HAS_DEVICE(Filename) tests whether Filename contains a device + specification. + FILE_SYSTEM_PREFIX_LEN(Filename) length of the device specification + at the beginning of Filename, + index of the part consisting of + alternating components and slashes. + FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE + 1 when a non-empty device specification + can be followed by an empty or relative + part, + 0 when a non-empty device specification + must be followed by a slash, + 0 when device specification don't exist. + IS_ABSOLUTE_FILE_NAME(Filename) + tests whether Filename is independent of + any notion of "current directory". + IS_RELATIVE_FILE_NAME(Filename) + tests whether Filename may be concatenated + to a directory filename. + Note: On native Windows, OS/2, DOS, "c:" is neither an absolute nor a + relative file name! + IS_FILE_NAME_WITH_DIR(Filename) tests whether Filename contains a device + or directory specification. + */ +#if defined _WIN32 || defined __CYGWIN__ \ + || defined __EMX__ || defined __MSDOS__ || defined __DJGPP__ + /* Native Windows, Cygwin, OS/2, DOS */ +# define ISSLASH(C) ((C) == '/' || (C) == '\\') + /* Internal macro: Tests whether a character is a drive letter. */ +# define _IS_DRIVE_LETTER(C) \ + (((C) >= 'A' && (C) <= 'Z') || ((C) >= 'a' && (C) <= 'z')) + /* Help the compiler optimizing it. This assumes ASCII. */ +# undef _IS_DRIVE_LETTER +# define _IS_DRIVE_LETTER(C) \ + (((unsigned int) (C) | ('a' - 'A')) - 'a' <= 'z' - 'a') +# define HAS_DEVICE(Filename) \ + (_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':') +# define FILE_SYSTEM_PREFIX_LEN(Filename) (HAS_DEVICE (Filename) ? 2 : 0) +# ifdef __CYGWIN__ +# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0 +# else + /* On native Windows, OS/2, DOS, the system has the notion of a + "current directory" on each drive. */ +# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 1 +# endif +# if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE +# define IS_ABSOLUTE_FILE_NAME(Filename) \ + ISSLASH ((Filename)[FILE_SYSTEM_PREFIX_LEN (Filename)]) +# else +# define IS_ABSOLUTE_FILE_NAME(Filename) \ + (ISSLASH ((Filename)[0]) || HAS_DEVICE (Filename)) +# endif +# define IS_RELATIVE_FILE_NAME(Filename) \ + (! (ISSLASH ((Filename)[0]) || HAS_DEVICE (Filename))) +# define IS_FILE_NAME_WITH_DIR(Filename) \ + (strchr ((Filename), '/') != NULL || strchr ((Filename), '\\') != NULL \ + || HAS_DEVICE (Filename)) +#else + /* Unix */ +# define ISSLASH(C) ((C) == '/') +# define HAS_DEVICE(Filename) ((void) (Filename), 0) +# define FILE_SYSTEM_PREFIX_LEN(Filename) ((void) (Filename), 0) +# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0 +# define IS_ABSOLUTE_FILE_NAME(Filename) ISSLASH ((Filename)[0]) +# define IS_RELATIVE_FILE_NAME(Filename) (! ISSLASH ((Filename)[0])) +# define IS_FILE_NAME_WITH_DIR(Filename) (strchr ((Filename), '/') != NULL) +#endif + +/* Deprecated macros. For backward compatibility with old users of the + 'filename' module. */ +#define IS_ABSOLUTE_PATH IS_ABSOLUTE_FILE_NAME +#define IS_PATH_WITH_DIR IS_FILE_NAME_WITH_DIR + + +#ifdef __cplusplus +} +#endif + +#endif /* _FILENAME_H */ diff -Nru datamash-1.7/lib/flexmember.h datamash-1.8/lib/flexmember.h --- datamash-1.7/lib/flexmember.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/flexmember.h 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,60 @@ +/* Sizes of structs with flexible array members. + + Copyright 2016-2021 Free Software Foundation, Inc. + + This file is part of the GNU C Library. + + The GNU C Library 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. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with the GNU C Library; if not, see + . + + Written by Paul Eggert. */ + +#include + +/* Nonzero multiple of alignment of TYPE, suitable for FLEXSIZEOF below. + On older platforms without _Alignof, use a pessimistic bound that is + safe in practice even if FLEXIBLE_ARRAY_MEMBER is 1. + On newer platforms, use _Alignof to get a tighter bound. */ + +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 +# define FLEXALIGNOF(type) (sizeof (type) & ~ (sizeof (type) - 1)) +#else +# define FLEXALIGNOF(type) _Alignof (type) +#endif + +/* Yield a properly aligned upper bound on the size of a struct of + type TYPE with a flexible array member named MEMBER that is + followed by N bytes of other data. The result is suitable as an + argument to malloc. For example: + + struct s { int n; char d[FLEXIBLE_ARRAY_MEMBER]; }; + struct s *p = malloc (FLEXSIZEOF (struct s, d, n * sizeof (char))); + + FLEXSIZEOF (TYPE, MEMBER, N) is not simply (sizeof (TYPE) + N), + since FLEXIBLE_ARRAY_MEMBER may be 1 on pre-C11 platforms. Nor is + it simply (offsetof (TYPE, MEMBER) + N), as that might yield a size + that causes malloc to yield a pointer that is not properly aligned + for TYPE; for example, if sizeof (int) == alignof (int) == 4, + malloc (offsetof (struct s, d) + 3 * sizeof (char)) is equivalent + to malloc (7) and might yield a pointer that is not a multiple of 4 + (which means the pointer is not properly aligned for struct s), + whereas malloc (FLEXSIZEOF (struct s, d, 3 * sizeof (char))) is + equivalent to malloc (8) and must yield a pointer that is a + multiple of 4. + + Yield a value less than N if and only if arithmetic overflow occurs. */ + +#define FLEXSIZEOF(type, member, n) \ + ((offsetof (type, member) + FLEXALIGNOF (type) - 1 + (n)) \ + & ~ (FLEXALIGNOF (type) - 1)) diff -Nru datamash-1.7/lib/float.c datamash-1.8/lib/float.c --- datamash-1.7/lib/float.c 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/float.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Auxiliary definitions for . - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 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.7/lib/float+.h datamash-1.8/lib/float+.h --- datamash-1.7/lib/float+.h 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/float+.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Supplemental information about the floating-point formats. - Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2021 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.7/lib/float.in.h datamash-1.8/lib/float.in.h --- datamash-1.7/lib/float.in.h 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/float.in.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* A correct . - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 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,14 @@ extern const long double LDBL_MAX; Unfortunately, this is not a constant expression. */ +# if !GNULIB_defined_long_double_union union gl_long_double_union { struct { unsigned int lo; unsigned int hi; unsigned int exponent; } xd; long double ld; }; +# define GNULIB_defined_long_double_union 1 +# endif extern const union gl_long_double_union gl_LDBL_MAX; # define LDBL_MAX (gl_LDBL_MAX.ld) /* Minimum e such that 10^e is in the range of normalized numbers. */ @@ -146,11 +149,14 @@ Unfortunately, this is not a constant expression, and the latter expression does not work well when GCC is optimizing.. */ +# if !GNULIB_defined_long_double_union union gl_long_double_union { struct { double hi; double lo; } dd; long double ld; }; +# define GNULIB_defined_long_double_union 1 +# endif extern const union gl_long_double_union gl_LDBL_MAX; # define LDBL_MAX (gl_LDBL_MAX.ld) #endif diff -Nru datamash-1.7/lib/floor.c datamash-1.8/lib/floor.c --- datamash-1.7/lib/floor.c 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/floor.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Round towards negative infinity. - Copyright (C) 2007, 2010-2020 Free Software Foundation, Inc. + Copyright (C) 2007, 2010-2021 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 @@ -44,7 +44,7 @@ /* MSVC with option -fp:strict refuses to compile constant initializers that contain floating-point operations. Pacify this compiler. */ -#ifdef _MSC_VER +#if defined _MSC_VER && !defined __clang__ # pragma fenv_access (off) #endif diff -Nru datamash-1.7/lib/floorl.c datamash-1.8/lib/floorl.c --- datamash-1.7/lib/floorl.c 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/floorl.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Round towards negative infinity. - Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2021 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.7/lib/fpending.c datamash-1.8/lib/fpending.c --- datamash-1.7/lib/fpending.c 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/fpending.c 2022-05-28 01:46:58.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-2020 Free Software Foundation, + Copyright (C) 2000, 2004, 2006-2007, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -25,7 +25,8 @@ #include "stdio-impl.h" /* This file is not used on systems that already have the __fpending function, - namely glibc >= 2.2, Solaris >= 7, Android API >= 23. */ + namely glibc >= 2.2, Solaris >= 7, UnixWare >= 7.1.4.MP4, Cygwin >= 1.7.34, + Android API >= 23. */ /* Return the number of pending (aka buffered, unflushed) bytes on the stream, FP, that is open for writing. */ @@ -39,13 +40,13 @@ /* 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 */ + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin < 1.7.34, 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, OpenVMS */ +#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */ return (fp_->_ptr ? fp_->_ptr - fp_->_base : 0); #elif defined __UCLIBC__ /* uClibc */ return (fp->__modeflags & __FLAG_WRITING ? fp->__bufpos - fp->__bufstart : 0); diff -Nru datamash-1.7/lib/fpending.h datamash-1.8/lib/fpending.h --- datamash-1.7/lib/fpending.h 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/fpending.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* Declare __fpending. - Copyright (C) 2000, 2003, 2005-2006, 2009-2020 Free Software Foundation, + Copyright (C) 2000, 2003, 2005-2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.7/lib/fpucw.h datamash-1.8/lib/fpucw.h --- datamash-1.7/lib/fpucw.h 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/fpucw.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Manipulating the FPU control word. -*- coding: utf-8 -*- - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 Free Software Foundation, Inc. Written by Bruno Haible , 2007. This program is free software: you can redistribute it and/or modify @@ -61,8 +61,8 @@ 'long double' safe operation precision */ -/* Inline assembler like this works only with GNU C. */ -#if (defined __i386__ || defined __x86_64__) && defined __GNUC__ +/* Inline assembler like this works only with GNU C and clang. */ +#if (defined __i386__ || defined __x86_64__) && (defined __GNUC__ || defined __clang__) typedef unsigned short fpucw_t; /* glibc calls this fpu_control_t */ diff -Nru datamash-1.7/lib/fpurge.c datamash-1.8/lib/fpurge.c --- datamash-1.7/lib/fpurge.c 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/fpurge.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Flushing buffers of a FILE stream. - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 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,8 +19,10 @@ /* Specification. */ #include -#if HAVE___FPURGE /* glibc >= 2.2, Haiku, Solaris >= 7, Android API >= 23 */ -# include +#if HAVE___FPURGE /* glibc >= 2.2, Haiku, Solaris >= 7, UnixWare >= 7.1.4.MP4, Cygwin >= 1.7.10, Android API >= 23, musl libc */ +# if HAVE_STDIO_EXT_H +# include +# endif #endif #include @@ -29,13 +31,13 @@ int fpurge (FILE *fp) { -#if HAVE___FPURGE /* glibc >= 2.2, Haiku, Solaris >= 7, Android API >= 23, musl libc */ +#if HAVE___FPURGE /* glibc >= 2.2, Haiku, Solaris >= 7, UnixWare >= 7.1.4.MP4, Cygwin >= 1.7.10, Android API >= 23, musl libc */ __fpurge (fp); /* The __fpurge function does not have a return value. */ return 0; -#elif HAVE_FPURGE /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin 1.7 */ +#elif HAVE_FPURGE /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin >= 1.7 */ /* Call the system's fpurge function. */ # undef fpurge @@ -99,7 +101,7 @@ if (fp->_ptr != NULL) fp->_count = 0; return 0; -# elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel, OpenVMS */ +# elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */ fp_->_ptr = fp_->_base; if (fp_->_ptr != NULL) fp_->_cnt = 0; diff -Nru datamash-1.7/lib/freading.c datamash-1.8/lib/freading.c --- datamash-1.7/lib/freading.c 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/freading.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Retrieve information about a FILE stream. - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 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 @@ -37,13 +37,13 @@ || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0 && fp->_IO_read_base != NULL)); # elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ - /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */ + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin < 1.7.34, Minix 3, Android */ return (fp_->_flags & __SRD) != 0; # elif defined __EMX__ /* emx+gcc */ return (fp->_flags & _IOREAD) != 0; # elif defined __minix /* Minix */ return (fp->_flags & _IOREADING) != 0; -# elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel, OpenVMS */ +# elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */ # if defined __sun /* Solaris */ return (fp_->_flag & _IOREAD) != 0 && (fp_->_flag & _IOWRT) == 0; # else diff -Nru datamash-1.7/lib/freading.h datamash-1.8/lib/freading.h --- datamash-1.7/lib/freading.h 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/freading.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Retrieve information about a FILE stream. - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 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 @@ -33,9 +33,11 @@ STREAM must not be wide-character oriented. */ #if HAVE___FREADING && (!defined __GLIBC__ || defined __UCLIBC__ || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7)) -/* Solaris >= 7, Android API >= 29, not glibc >= 2.2, but glibc >= 2.7, or musl libc */ +/* Solaris >= 7, UnixWare >= 7.1.4.MP4, Cygwin >= 1.7.34, Android API >= 29, not glibc >= 2.2, but glibc >= 2.7, or musl libc */ -# include +# if HAVE_STDIO_EXT_H +# include +# endif # define freading(stream) (__freading (stream) != 0) #else diff -Nru datamash-1.7/lib/frexp.c datamash-1.8/lib/frexp.c --- datamash-1.7/lib/frexp.c 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/frexp.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Split a double into fraction and mantissa. - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 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.7/lib/frexpl.c datamash-1.8/lib/frexpl.c --- datamash-1.7/lib/frexpl.c 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/frexpl.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Split a 'long double' into fraction and mantissa. - Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2021 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.7/lib/fseek.c datamash-1.8/lib/fseek.c --- datamash-1.7/lib/fseek.c 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/fseek.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* An fseek() function that, together with fflush(), is POSIX compliant. - Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2021 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.7/lib/fseeko.c datamash-1.8/lib/fseeko.c --- datamash-1.7/lib/fseeko.c 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/fseeko.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* An fseeko() function that, together with fflush(), is POSIX compliant. - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 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,7 +81,7 @@ #elif defined __minix /* Minix */ if (fp_->_ptr == fp_->_buf && (fp_->_ptr == NULL || fp_->_count == 0)) -#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel, OpenVMS */ +#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */ if (fp_->_ptr == fp_->_base && (fp_->_ptr == NULL || fp_->_cnt == 0)) #elif defined __UCLIBC__ /* uClibc */ @@ -152,7 +152,7 @@ fp_->_flags &= ~__SEOF; #elif defined __EMX__ /* emx+gcc */ fp->_flags &= ~_IOEOF; -#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel, OpenVMS */ +#elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */ fp_->_flag &= ~_IOEOF; #elif defined __MINT__ /* Atari FreeMiNT */ fp->__offset = pos; diff -Nru datamash-1.7/lib/fstat.c datamash-1.8/lib/fstat.c --- datamash-1.7/lib/fstat.c 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/fstat.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* fstat() replacement. - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 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.7/lib/ftell.c datamash-1.8/lib/ftell.c --- datamash-1.7/lib/ftell.c 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/ftell.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* An ftell() function that works around platform bugs. - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 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.7/lib/ftello.c datamash-1.8/lib/ftello.c --- datamash-1.7/lib/ftello.c 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/ftello.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* An ftello() function that works around platform bugs. - Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2021 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.7/lib/getdtablesize.c datamash-1.8/lib/getdtablesize.c --- datamash-1.7/lib/getdtablesize.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/getdtablesize.c 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,124 @@ +/* getdtablesize() function: Return maximum possible file descriptor value + 1. + Copyright (C) 2008-2021 Free Software Foundation, Inc. + Written by Bruno Haible , 2008. + + 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 defined _WIN32 && ! defined __CYGWIN__ + +# include + +# if HAVE_MSVC_INVALID_PARAMETER_HANDLER +# include "msvc-inval.h" +# endif + +# if HAVE_MSVC_INVALID_PARAMETER_HANDLER +static int +_setmaxstdio_nothrow (int newmax) +{ + int result; + + TRY_MSVC_INVAL + { + result = _setmaxstdio (newmax); + } + CATCH_MSVC_INVAL + { + result = -1; + } + DONE_MSVC_INVAL; + + return result; +} +# else +# define _setmaxstdio_nothrow _setmaxstdio +# endif + +/* Cache for the previous getdtablesize () result. Safe to cache because + Windows also lacks setrlimit. */ +static int dtablesize; + +int +getdtablesize (void) +{ + if (dtablesize == 0) + { + /* We are looking for the number N such that the valid file descriptors + are 0..N-1. It can be obtained through a loop as follows: + { + int fd; + for (fd = 3; fd < 65536; fd++) + if (dup2 (0, fd) == -1) + break; + return fd; + } + On Windows XP, the result is 2048. + The drawback of this loop is that it allocates memory for a libc + internal array that is never freed. + + The number N can also be obtained as the upper bound for + _getmaxstdio (). _getmaxstdio () returns the maximum number of open + FILE objects. The sanity check in _setmaxstdio reveals the maximum + number of file descriptors. This too allocates memory, but it is + freed when we call _setmaxstdio with the original value. */ + int orig_max_stdio = _getmaxstdio (); + unsigned int bound; + for (bound = 0x10000; _setmaxstdio_nothrow (bound) < 0; bound = bound / 2) + ; + _setmaxstdio_nothrow (orig_max_stdio); + dtablesize = bound; + } + return dtablesize; +} + +#else + +# include +# include + +# ifndef RLIM_SAVED_CUR +# define RLIM_SAVED_CUR RLIM_INFINITY +# endif +# ifndef RLIM_SAVED_MAX +# define RLIM_SAVED_MAX RLIM_INFINITY +# endif + +# ifdef __CYGWIN__ + /* Cygwin 1.7.25 auto-increases the RLIMIT_NOFILE soft limit until it + hits the compile-time constant hard limit of 3200. We might as + well just report the hard limit. */ +# define rlim_cur rlim_max +# endif + +int +getdtablesize (void) +{ + struct rlimit lim; + + if (getrlimit (RLIMIT_NOFILE, &lim) == 0 + && 0 <= lim.rlim_cur && lim.rlim_cur <= INT_MAX + && lim.rlim_cur != RLIM_INFINITY + && lim.rlim_cur != RLIM_SAVED_CUR + && lim.rlim_cur != RLIM_SAVED_MAX) + return lim.rlim_cur; + + return INT_MAX; +} + +#endif diff -Nru datamash-1.7/lib/getopt1.c datamash-1.8/lib/getopt1.c --- datamash-1.7/lib/getopt1.c 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/getopt1.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* getopt_long and getopt_long_only entry points for GNU getopt. - Copyright (C) 1987-2020 Free Software Foundation, Inc. + Copyright (C) 1987-2021 Free Software Foundation, Inc. This file is part of the GNU C Library and is also part of gnulib. Patches to this file should be submitted to both projects. diff -Nru datamash-1.7/lib/getopt.c datamash-1.8/lib/getopt.c --- datamash-1.7/lib/getopt.c 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/getopt.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Getopt for GNU. - Copyright (C) 1987-2020 Free Software Foundation, Inc. + Copyright (C) 1987-2021 Free Software Foundation, Inc. This file is part of the GNU C Library and is also part of gnulib. Patches to this file should be submitted to both projects. diff -Nru datamash-1.7/lib/getopt-cdefs.in.h datamash-1.8/lib/getopt-cdefs.in.h --- datamash-1.7/lib/getopt-cdefs.in.h 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/getopt-cdefs.in.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* getopt-on-non-glibc compatibility macros. - Copyright (C) 1989-2020 Free Software Foundation, Inc. + Copyright (C) 1989-2021 Free Software Foundation, Inc. This file is part of gnulib. Unlike most of the getopt implementation, it is NOT shared with the GNU C Library. @@ -57,7 +57,7 @@ #endif #ifndef __THROW -# if defined __cplusplus && __GNUC_PREREQ (2,8) +# if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major__ >= 4) # define __THROW throw () # else # define __THROW diff -Nru datamash-1.7/lib/getopt-core.h datamash-1.8/lib/getopt-core.h --- datamash-1.7/lib/getopt-core.h 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/getopt-core.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Declarations for getopt (basic, portable features only). - Copyright (C) 1989-2020 Free Software Foundation, Inc. + Copyright (C) 1989-2021 Free Software Foundation, Inc. This file is part of the GNU C Library and is also part of gnulib. Patches to this file should be submitted to both projects. diff -Nru datamash-1.7/lib/getopt-ext.h datamash-1.8/lib/getopt-ext.h --- datamash-1.7/lib/getopt-ext.h 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/getopt-ext.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Declarations for getopt (GNU extensions). - Copyright (C) 1989-2020 Free Software Foundation, Inc. + Copyright (C) 1989-2021 Free Software Foundation, Inc. This file is part of the GNU C Library and is also part of gnulib. Patches to this file should be submitted to both projects. diff -Nru datamash-1.7/lib/getopt.in.h datamash-1.8/lib/getopt.in.h --- datamash-1.7/lib/getopt.in.h 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/getopt.in.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Declarations for getopt. - Copyright (C) 1989-2020 Free Software Foundation, Inc. + Copyright (C) 1989-2021 Free Software Foundation, Inc. This file is part of gnulib. Unlike most of the getopt implementation, it is NOT shared with the GNU C Library, which supplies a different version of diff -Nru datamash-1.7/lib/getopt_int.h datamash-1.8/lib/getopt_int.h --- datamash-1.7/lib/getopt_int.h 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/getopt_int.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Internal declarations for getopt. - Copyright (C) 1989-2020 Free Software Foundation, Inc. + Copyright (C) 1989-2021 Free Software Foundation, Inc. This file is part of the GNU C Library and is also part of gnulib. Patches to this file should be submitted to both projects. diff -Nru datamash-1.7/lib/getopt-pfx-core.h datamash-1.8/lib/getopt-pfx-core.h --- datamash-1.7/lib/getopt-pfx-core.h 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/getopt-pfx-core.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* getopt (basic, portable features) gnulib wrapper header. - Copyright (C) 1989-2020 Free Software Foundation, Inc. + Copyright (C) 1989-2021 Free Software Foundation, Inc. This file is part of gnulib. Unlike most of the getopt implementation, it is NOT shared with the GNU C Library. @@ -48,6 +48,14 @@ # define optind __GETOPT_ID (optind) # define optopt __GETOPT_ID (optopt) +/* Work around a a problem on macOS, which declares getopt with a + trailing __DARWIN_ALIAS(getopt) that would expand to something like + __asm("_" "rpl_getopt" "$UNIX2003") were it not for the following + hack to suppress the macOS declaration . */ +# ifdef __APPLE__ +# define _GETOPT +# endif + /* The system's getopt.h may have already included getopt-core.h to declare the unprefixed identifiers. Undef _GETOPT_CORE_H so that getopt-core.h declares them with prefixes. */ diff -Nru datamash-1.7/lib/getopt-pfx-ext.h datamash-1.8/lib/getopt-pfx-ext.h --- datamash-1.7/lib/getopt-pfx-ext.h 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/getopt-pfx-ext.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* getopt (GNU extensions) gnulib wrapper header. - Copyright (C) 1989-2020 Free Software Foundation, Inc. + Copyright (C) 1989-2021 Free Software Foundation, Inc. This file is part of gnulib. Unlike most of the getopt implementation, it is NOT shared with the GNU C Library. diff -Nru datamash-1.7/lib/getprogname.c datamash-1.8/lib/getprogname.c --- datamash-1.7/lib/getprogname.c 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/getprogname.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Program name management. - Copyright (C) 2016-2020 Free Software Foundation, Inc. + Copyright (C) 2016-2021 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 @@ -51,7 +51,13 @@ # include #endif -#include "dirname.h" +#if defined __SCO_VERSION__ || defined __sysv5__ +# include +# include +# include +#endif + +#include "basename-lgpl.h" #ifndef HAVE_GETPROGNAME /* not Mac OS X, FreeBSD, NetBSD, OpenBSD >= 5.4, Cygwin */ char const * @@ -223,7 +229,7 @@ int fd; sprintf (filename, "/proc/pinfo/%d", (int) getpid ()); - fd = open (filename, O_RDONLY); + fd = open (filename, O_RDONLY | O_CLOEXEC); if (0 <= fd) { prpsinfo_t buf; @@ -245,6 +251,38 @@ } } return NULL; +# elif defined __SCO_VERSION__ || defined __sysv5__ /* SCO OpenServer6/UnixWare */ + char buf[80]; + int fd; + sprintf (buf, "/proc/%d/cmdline", getpid()); + fd = open (buf, O_RDONLY); + if (0 <= fd) + { + size_t n = read (fd, buf, 79); + if (n > 0) + { + buf[n] = '\0'; /* Guarantee null-termination */ + char *progname; + progname = strrchr (buf, '/'); + if (progname) + { + progname = progname + 1; /* Skip the '/' */ + } + else + { + progname = buf; + } + char *ret; + ret = malloc (strlen (progname) + 1); + if (ret) + { + strcpy (ret, progname); + return ret; + } + } + close (fd); + } + return "?"; # else # error "getprogname module not ported to this OS" # endif diff -Nru datamash-1.7/lib/getprogname.h datamash-1.8/lib/getprogname.h --- datamash-1.7/lib/getprogname.h 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/getprogname.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Program name management. - Copyright (C) 2016-2020 Free Software Foundation, Inc. + Copyright (C) 2016-2021 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.7/lib/gettext.h datamash-1.8/lib/gettext.h --- datamash-1.7/lib/gettext.h 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/gettext.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Convenience header for conditional use of GNU . - Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2020 Free Software + Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify diff -Nru datamash-1.7/lib/gl_openssl.h datamash-1.8/lib/gl_openssl.h --- datamash-1.7/lib/gl_openssl.h 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/gl_openssl.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* Wrap openssl crypto hash routines in gnulib interface. -*- coding: utf-8 -*- - Copyright (C) 2013-2020 Free Software Foundation, Inc. + Copyright (C) 2013-2021 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.7/lib/glthread/lock.c datamash-1.8/lib/glthread/lock.c --- datamash-1.7/lib/glthread/lock.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/glthread/lock.c 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,749 @@ +/* Locking in multithreaded situations. + Copyright (C) 2005-2021 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 Bruno Haible , 2005. + Based on GCC's gthr-posix.h, gthr-posix95.h. */ + +#include + +#include "glthread/lock.h" + +/* ========================================================================= */ + +#if USE_ISOC_THREADS || USE_ISOC_AND_POSIX_THREADS + +/* -------------------------- gl_lock_t datatype -------------------------- */ + +int +glthread_lock_init (gl_lock_t *lock) +{ + if (mtx_init (&lock->mutex, mtx_plain) != thrd_success) + return ENOMEM; + lock->init_needed = 0; + return 0; +} + +int +glthread_lock_lock (gl_lock_t *lock) +{ + if (lock->init_needed) + call_once (&lock->init_once, lock->init_func); + if (mtx_lock (&lock->mutex) != thrd_success) + return EAGAIN; + return 0; +} + +int +glthread_lock_unlock (gl_lock_t *lock) +{ + if (lock->init_needed) + call_once (&lock->init_once, lock->init_func); + if (mtx_unlock (&lock->mutex) != thrd_success) + return EINVAL; + return 0; +} + +int +glthread_lock_destroy (gl_lock_t *lock) +{ + if (lock->init_needed) + call_once (&lock->init_once, lock->init_func); + mtx_destroy (&lock->mutex); + return 0; +} + +/* ------------------------- gl_rwlock_t datatype ------------------------- */ + +int +glthread_rwlock_init (gl_rwlock_t *lock) +{ + if (mtx_init (&lock->lock, mtx_plain) != thrd_success + || cnd_init (&lock->waiting_readers) != thrd_success + || cnd_init (&lock->waiting_writers) != thrd_success) + return ENOMEM; + lock->waiting_writers_count = 0; + lock->runcount = 0; + lock->init_needed = 0; + return 0; +} + +int +glthread_rwlock_rdlock (gl_rwlock_t *lock) +{ + if (lock->init_needed) + call_once (&lock->init_once, lock->init_func); + if (mtx_lock (&lock->lock) != thrd_success) + return EAGAIN; + /* Test whether only readers are currently running, and whether the runcount + field will not overflow, and whether no writer is waiting. The latter + condition is because POSIX recommends that "write locks shall take + precedence over read locks", to avoid "writer starvation". */ + while (!(lock->runcount + 1 > 0 && lock->waiting_writers_count == 0)) + { + /* This thread has to wait for a while. Enqueue it among the + waiting_readers. */ + if (cnd_wait (&lock->waiting_readers, &lock->lock) != thrd_success) + { + mtx_unlock (&lock->lock); + return EINVAL; + } + } + lock->runcount++; + if (mtx_unlock (&lock->lock) != thrd_success) + return EINVAL; + return 0; +} + +int +glthread_rwlock_wrlock (gl_rwlock_t *lock) +{ + if (lock->init_needed) + call_once (&lock->init_once, lock->init_func); + if (mtx_lock (&lock->lock) != thrd_success) + return EAGAIN; + /* Test whether no readers or writers are currently running. */ + while (!(lock->runcount == 0)) + { + /* This thread has to wait for a while. Enqueue it among the + waiting_writers. */ + lock->waiting_writers_count++; + if (cnd_wait (&lock->waiting_writers, &lock->lock) != thrd_success) + { + lock->waiting_writers_count--; + mtx_unlock (&lock->lock); + return EINVAL; + } + lock->waiting_writers_count--; + } + lock->runcount--; /* runcount becomes -1 */ + if (mtx_unlock (&lock->lock) != thrd_success) + return EINVAL; + return 0; +} + +int +glthread_rwlock_unlock (gl_rwlock_t *lock) +{ + if (lock->init_needed) + call_once (&lock->init_once, lock->init_func); + if (mtx_lock (&lock->lock) != thrd_success) + return EAGAIN; + if (lock->runcount < 0) + { + /* Drop a writer lock. */ + if (!(lock->runcount == -1)) + { + mtx_unlock (&lock->lock); + return EINVAL; + } + lock->runcount = 0; + } + else + { + /* Drop a reader lock. */ + if (!(lock->runcount > 0)) + { + mtx_unlock (&lock->lock); + return EINVAL; + } + lock->runcount--; + } + if (lock->runcount == 0) + { + /* POSIX recommends that "write locks shall take precedence over read + locks", to avoid "writer starvation". */ + if (lock->waiting_writers_count > 0) + { + /* Wake up one of the waiting writers. */ + if (cnd_signal (&lock->waiting_writers) != thrd_success) + { + mtx_unlock (&lock->lock); + return EINVAL; + } + } + else + { + /* Wake up all waiting readers. */ + if (cnd_broadcast (&lock->waiting_readers) != thrd_success) + { + mtx_unlock (&lock->lock); + return EINVAL; + } + } + } + if (mtx_unlock (&lock->lock) != thrd_success) + return EINVAL; + return 0; +} + +int +glthread_rwlock_destroy (gl_rwlock_t *lock) +{ + if (lock->init_needed) + call_once (&lock->init_once, lock->init_func); + mtx_destroy (&lock->lock); + cnd_destroy (&lock->waiting_readers); + cnd_destroy (&lock->waiting_writers); + return 0; +} + +/* --------------------- gl_recursive_lock_t datatype --------------------- */ + +int +glthread_recursive_lock_init (gl_recursive_lock_t *lock) +{ + if (mtx_init (&lock->mutex, mtx_plain | mtx_recursive) != thrd_success) + return ENOMEM; + lock->init_needed = 0; + return 0; +} + +int +glthread_recursive_lock_lock (gl_recursive_lock_t *lock) +{ + if (lock->init_needed) + call_once (&lock->init_once, lock->init_func); + if (mtx_lock (&lock->mutex) != thrd_success) + return EAGAIN; + return 0; +} + +int +glthread_recursive_lock_unlock (gl_recursive_lock_t *lock) +{ + if (lock->init_needed) + call_once (&lock->init_once, lock->init_func); + if (mtx_unlock (&lock->mutex) != thrd_success) + return EINVAL; + return 0; +} + +int +glthread_recursive_lock_destroy (gl_recursive_lock_t *lock) +{ + if (lock->init_needed) + call_once (&lock->init_once, lock->init_func); + mtx_destroy (&lock->mutex); + return 0; +} + +/* -------------------------- gl_once_t datatype -------------------------- */ + +#endif + +/* ========================================================================= */ + +#if USE_POSIX_THREADS + +/* -------------------------- gl_lock_t datatype -------------------------- */ + +/* ------------------------- gl_rwlock_t datatype ------------------------- */ + +# if HAVE_PTHREAD_RWLOCK && (HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER || (defined PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP && (__GNU_LIBRARY__ > 1))) + +# if defined PTHREAD_RWLOCK_INITIALIZER || defined PTHREAD_RWLOCK_INITIALIZER_NP + +# if !HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER + /* glibc with bug https://sourceware.org/bugzilla/show_bug.cgi?id=13701 */ + +int +glthread_rwlock_init_for_glibc (pthread_rwlock_t *lock) +{ + pthread_rwlockattr_t attributes; + int err; + + err = pthread_rwlockattr_init (&attributes); + if (err != 0) + return err; + /* Note: PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP is the only value that + causes the writer to be preferred. PTHREAD_RWLOCK_PREFER_WRITER_NP does not + do this; see + http://man7.org/linux/man-pages/man3/pthread_rwlockattr_setkind_np.3.html */ + err = pthread_rwlockattr_setkind_np (&attributes, + PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP); + if (err == 0) + err = pthread_rwlock_init(lock, &attributes); + /* pthread_rwlockattr_destroy always returns 0. It cannot influence the + return value. */ + pthread_rwlockattr_destroy (&attributes); + return err; +} + +# endif +# else + +int +glthread_rwlock_init_multithreaded (gl_rwlock_t *lock) +{ + int err; + + err = pthread_rwlock_init (&lock->rwlock, NULL); + if (err != 0) + return err; + lock->initialized = 1; + return 0; +} + +int +glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock) +{ + if (!lock->initialized) + { + int err; + + err = pthread_mutex_lock (&lock->guard); + if (err != 0) + return err; + if (!lock->initialized) + { + err = glthread_rwlock_init_multithreaded (lock); + if (err != 0) + { + pthread_mutex_unlock (&lock->guard); + return err; + } + } + err = pthread_mutex_unlock (&lock->guard); + if (err != 0) + return err; + } + return pthread_rwlock_rdlock (&lock->rwlock); +} + +int +glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock) +{ + if (!lock->initialized) + { + int err; + + err = pthread_mutex_lock (&lock->guard); + if (err != 0) + return err; + if (!lock->initialized) + { + err = glthread_rwlock_init_multithreaded (lock); + if (err != 0) + { + pthread_mutex_unlock (&lock->guard); + return err; + } + } + err = pthread_mutex_unlock (&lock->guard); + if (err != 0) + return err; + } + return pthread_rwlock_wrlock (&lock->rwlock); +} + +int +glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock) +{ + if (!lock->initialized) + return EINVAL; + return pthread_rwlock_unlock (&lock->rwlock); +} + +int +glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock) +{ + int err; + + if (!lock->initialized) + return EINVAL; + err = pthread_rwlock_destroy (&lock->rwlock); + if (err != 0) + return err; + lock->initialized = 0; + return 0; +} + +# endif + +# else + +int +glthread_rwlock_init_multithreaded (gl_rwlock_t *lock) +{ + int err; + + err = pthread_mutex_init (&lock->lock, NULL); + if (err != 0) + return err; + err = pthread_cond_init (&lock->waiting_readers, NULL); + if (err != 0) + return err; + err = pthread_cond_init (&lock->waiting_writers, NULL); + if (err != 0) + return err; + lock->waiting_writers_count = 0; + lock->runcount = 0; + return 0; +} + +int +glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock) +{ + int err; + + err = pthread_mutex_lock (&lock->lock); + if (err != 0) + return err; + /* Test whether only readers are currently running, and whether the runcount + field will not overflow, and whether no writer is waiting. The latter + condition is because POSIX recommends that "write locks shall take + precedence over read locks", to avoid "writer starvation". */ + while (!(lock->runcount + 1 > 0 && lock->waiting_writers_count == 0)) + { + /* This thread has to wait for a while. Enqueue it among the + waiting_readers. */ + err = pthread_cond_wait (&lock->waiting_readers, &lock->lock); + if (err != 0) + { + pthread_mutex_unlock (&lock->lock); + return err; + } + } + lock->runcount++; + return pthread_mutex_unlock (&lock->lock); +} + +int +glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock) +{ + int err; + + err = pthread_mutex_lock (&lock->lock); + if (err != 0) + return err; + /* Test whether no readers or writers are currently running. */ + while (!(lock->runcount == 0)) + { + /* This thread has to wait for a while. Enqueue it among the + waiting_writers. */ + lock->waiting_writers_count++; + err = pthread_cond_wait (&lock->waiting_writers, &lock->lock); + if (err != 0) + { + lock->waiting_writers_count--; + pthread_mutex_unlock (&lock->lock); + return err; + } + lock->waiting_writers_count--; + } + lock->runcount--; /* runcount becomes -1 */ + return pthread_mutex_unlock (&lock->lock); +} + +int +glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock) +{ + int err; + + err = pthread_mutex_lock (&lock->lock); + if (err != 0) + return err; + if (lock->runcount < 0) + { + /* Drop a writer lock. */ + if (!(lock->runcount == -1)) + { + pthread_mutex_unlock (&lock->lock); + return EINVAL; + } + lock->runcount = 0; + } + else + { + /* Drop a reader lock. */ + if (!(lock->runcount > 0)) + { + pthread_mutex_unlock (&lock->lock); + return EINVAL; + } + lock->runcount--; + } + if (lock->runcount == 0) + { + /* POSIX recommends that "write locks shall take precedence over read + locks", to avoid "writer starvation". */ + if (lock->waiting_writers_count > 0) + { + /* Wake up one of the waiting writers. */ + err = pthread_cond_signal (&lock->waiting_writers); + if (err != 0) + { + pthread_mutex_unlock (&lock->lock); + return err; + } + } + else + { + /* Wake up all waiting readers. */ + err = pthread_cond_broadcast (&lock->waiting_readers); + if (err != 0) + { + pthread_mutex_unlock (&lock->lock); + return err; + } + } + } + return pthread_mutex_unlock (&lock->lock); +} + +int +glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock) +{ + int err; + + err = pthread_mutex_destroy (&lock->lock); + if (err != 0) + return err; + err = pthread_cond_destroy (&lock->waiting_readers); + if (err != 0) + return err; + err = pthread_cond_destroy (&lock->waiting_writers); + if (err != 0) + return err; + return 0; +} + +# endif + +/* --------------------- gl_recursive_lock_t datatype --------------------- */ + +# if HAVE_PTHREAD_MUTEX_RECURSIVE + +# if defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER || defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP + +int +glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock) +{ + pthread_mutexattr_t attributes; + int err; + + err = pthread_mutexattr_init (&attributes); + if (err != 0) + return err; + err = pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE); + if (err != 0) + { + pthread_mutexattr_destroy (&attributes); + return err; + } + err = pthread_mutex_init (lock, &attributes); + if (err != 0) + { + pthread_mutexattr_destroy (&attributes); + return err; + } + err = pthread_mutexattr_destroy (&attributes); + if (err != 0) + return err; + return 0; +} + +# else + +int +glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock) +{ + pthread_mutexattr_t attributes; + int err; + + err = pthread_mutexattr_init (&attributes); + if (err != 0) + return err; + err = pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE); + if (err != 0) + { + pthread_mutexattr_destroy (&attributes); + return err; + } + err = pthread_mutex_init (&lock->recmutex, &attributes); + if (err != 0) + { + pthread_mutexattr_destroy (&attributes); + return err; + } + err = pthread_mutexattr_destroy (&attributes); + if (err != 0) + return err; + lock->initialized = 1; + return 0; +} + +int +glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock) +{ + if (!lock->initialized) + { + int err; + + err = pthread_mutex_lock (&lock->guard); + if (err != 0) + return err; + if (!lock->initialized) + { + err = glthread_recursive_lock_init_multithreaded (lock); + if (err != 0) + { + pthread_mutex_unlock (&lock->guard); + return err; + } + } + err = pthread_mutex_unlock (&lock->guard); + if (err != 0) + return err; + } + return pthread_mutex_lock (&lock->recmutex); +} + +int +glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock) +{ + if (!lock->initialized) + return EINVAL; + return pthread_mutex_unlock (&lock->recmutex); +} + +int +glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock) +{ + int err; + + if (!lock->initialized) + return EINVAL; + err = pthread_mutex_destroy (&lock->recmutex); + if (err != 0) + return err; + lock->initialized = 0; + return 0; +} + +# endif + +# else + +int +glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock) +{ + int err; + + err = pthread_mutex_init (&lock->mutex, NULL); + if (err != 0) + return err; + lock->owner = (pthread_t) 0; + lock->depth = 0; + return 0; +} + +int +glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock) +{ + pthread_t self = pthread_self (); + if (lock->owner != self) + { + int err; + + err = pthread_mutex_lock (&lock->mutex); + if (err != 0) + return err; + lock->owner = self; + } + if (++(lock->depth) == 0) /* wraparound? */ + { + lock->depth--; + return EAGAIN; + } + return 0; +} + +int +glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock) +{ + if (lock->owner != pthread_self ()) + return EPERM; + if (lock->depth == 0) + return EINVAL; + if (--(lock->depth) == 0) + { + lock->owner = (pthread_t) 0; + return pthread_mutex_unlock (&lock->mutex); + } + else + return 0; +} + +int +glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock) +{ + if (lock->owner != (pthread_t) 0) + return EBUSY; + return pthread_mutex_destroy (&lock->mutex); +} + +# endif + +/* -------------------------- gl_once_t datatype -------------------------- */ + +static const pthread_once_t fresh_once = PTHREAD_ONCE_INIT; + +int +glthread_once_singlethreaded (pthread_once_t *once_control) +{ + /* We don't know whether pthread_once_t is an integer type, a floating-point + type, a pointer type, or a structure type. */ + char *firstbyte = (char *)once_control; + if (*firstbyte == *(const char *)&fresh_once) + { + /* First time use of once_control. Invert the first byte. */ + *firstbyte = ~ *(const char *)&fresh_once; + return 1; + } + else + return 0; +} + +# if !(PTHREAD_IN_USE_DETECTION_HARD || USE_POSIX_THREADS_WEAK) + +int +glthread_once_multithreaded (pthread_once_t *once_control, + void (*init_function) (void)) +{ + int err = pthread_once (once_control, init_function); + if (err == ENOSYS) + { + /* This happens on FreeBSD 11: The pthread_once function in libc returns + ENOSYS. */ + if (glthread_once_singlethreaded (once_control)) + init_function (); + return 0; + } + return err; +} + +# endif + +#endif + +/* ========================================================================= */ + +#if USE_WINDOWS_THREADS + +#endif + +/* ========================================================================= */ diff -Nru datamash-1.7/lib/glthread/lock.h datamash-1.8/lib/glthread/lock.h --- datamash-1.7/lib/glthread/lock.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/glthread/lock.h 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,789 @@ +/* Locking in multithreaded situations. + Copyright (C) 2005-2021 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 Bruno Haible , 2005. + Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-win32.h. */ + +/* This file contains locking primitives for use with a given thread library. + It does not contain primitives for creating threads or for other + synchronization primitives. + + Normal (non-recursive) locks: + Type: gl_lock_t + Declaration: gl_lock_define(extern, name) + Initializer: gl_lock_define_initialized(, name) + Initialization: gl_lock_init (name); + Taking the lock: gl_lock_lock (name); + Releasing the lock: gl_lock_unlock (name); + De-initialization: gl_lock_destroy (name); + Equivalent functions with control of error handling: + Initialization: err = glthread_lock_init (&name); + Taking the lock: err = glthread_lock_lock (&name); + Releasing the lock: err = glthread_lock_unlock (&name); + De-initialization: err = glthread_lock_destroy (&name); + + Read-Write (non-recursive) locks: + Type: gl_rwlock_t + Declaration: gl_rwlock_define(extern, name) + Initializer: gl_rwlock_define_initialized(, name) + Initialization: gl_rwlock_init (name); + Taking the lock: gl_rwlock_rdlock (name); + gl_rwlock_wrlock (name); + Releasing the lock: gl_rwlock_unlock (name); + De-initialization: gl_rwlock_destroy (name); + Equivalent functions with control of error handling: + Initialization: err = glthread_rwlock_init (&name); + Taking the lock: err = glthread_rwlock_rdlock (&name); + err = glthread_rwlock_wrlock (&name); + Releasing the lock: err = glthread_rwlock_unlock (&name); + De-initialization: err = glthread_rwlock_destroy (&name); + + Recursive locks: + Type: gl_recursive_lock_t + Declaration: gl_recursive_lock_define(extern, name) + Initializer: gl_recursive_lock_define_initialized(, name) + Initialization: gl_recursive_lock_init (name); + Taking the lock: gl_recursive_lock_lock (name); + Releasing the lock: gl_recursive_lock_unlock (name); + De-initialization: gl_recursive_lock_destroy (name); + Equivalent functions with control of error handling: + Initialization: err = glthread_recursive_lock_init (&name); + Taking the lock: err = glthread_recursive_lock_lock (&name); + Releasing the lock: err = glthread_recursive_lock_unlock (&name); + De-initialization: err = glthread_recursive_lock_destroy (&name); + + Once-only execution: + Type: gl_once_t + Initializer: gl_once_define(extern, name) + Execution: gl_once (name, initfunction); + Equivalent functions with control of error handling: + Execution: err = glthread_once (&name, initfunction); +*/ + + +#ifndef _LOCK_H +#define _LOCK_H + +#include +#include + +#if !defined c11_threads_in_use +# if HAVE_THREADS_H && USE_POSIX_THREADS_WEAK +# include +# pragma weak thrd_exit +# define c11_threads_in_use() (thrd_exit != NULL) +# else +# define c11_threads_in_use() 0 +# endif +#endif + +/* ========================================================================= */ + +#if USE_ISOC_THREADS || USE_ISOC_AND_POSIX_THREADS + +/* Use the ISO C threads library. */ + +# include + +# ifdef __cplusplus +extern "C" { +# endif + +/* -------------------------- gl_lock_t datatype -------------------------- */ + +typedef struct + { + int volatile init_needed; + once_flag init_once; + void (*init_func) (void); + mtx_t mutex; + } + gl_lock_t; +# define gl_lock_define(STORAGECLASS, NAME) \ + STORAGECLASS gl_lock_t NAME; +# define gl_lock_define_initialized(STORAGECLASS, NAME) \ + static void _atomic_init_##NAME (void); \ + STORAGECLASS gl_lock_t NAME = \ + { 1, ONCE_FLAG_INIT, _atomic_init_##NAME }; \ + static void _atomic_init_##NAME (void) \ + { \ + if (glthread_lock_init (&(NAME))) \ + abort (); \ + } +extern int glthread_lock_init (gl_lock_t *lock); +extern int glthread_lock_lock (gl_lock_t *lock); +extern int glthread_lock_unlock (gl_lock_t *lock); +extern int glthread_lock_destroy (gl_lock_t *lock); + +/* ------------------------- gl_rwlock_t datatype ------------------------- */ + +typedef struct + { + int volatile init_needed; + once_flag init_once; + void (*init_func) (void); + mtx_t lock; /* protects the remaining fields */ + cnd_t waiting_readers; /* waiting readers */ + cnd_t waiting_writers; /* waiting writers */ + unsigned int waiting_writers_count; /* number of waiting writers */ + int runcount; /* number of readers running, or -1 when a writer runs */ + } + gl_rwlock_t; +# define gl_rwlock_define(STORAGECLASS, NAME) \ + STORAGECLASS gl_rwlock_t NAME; +# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \ + static void _atomic_init_##NAME (void); \ + STORAGECLASS gl_rwlock_t NAME = \ + { 1, ONCE_FLAG_INIT, _atomic_init_##NAME }; \ + static void _atomic_init_##NAME (void) \ + { \ + if (glthread_rwlock_init (&(NAME))) \ + abort (); \ + } +extern int glthread_rwlock_init (gl_rwlock_t *lock); +extern int glthread_rwlock_rdlock (gl_rwlock_t *lock); +extern int glthread_rwlock_wrlock (gl_rwlock_t *lock); +extern int glthread_rwlock_unlock (gl_rwlock_t *lock); +extern int glthread_rwlock_destroy (gl_rwlock_t *lock); + +/* --------------------- gl_recursive_lock_t datatype --------------------- */ + +typedef struct + { + int volatile init_needed; + once_flag init_once; + void (*init_func) (void); + mtx_t mutex; + } + gl_recursive_lock_t; +# define gl_recursive_lock_define(STORAGECLASS, NAME) \ + STORAGECLASS gl_recursive_lock_t NAME; +# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \ + static void _atomic_init_##NAME (void); \ + STORAGECLASS gl_recursive_lock_t NAME = \ + { 1, ONCE_FLAG_INIT, _atomic_init_##NAME }; \ + static void _atomic_init_##NAME (void) \ + { \ + if (glthread_recursive_lock_init (&(NAME))) \ + abort (); \ + } +extern int glthread_recursive_lock_init (gl_recursive_lock_t *lock); +extern int glthread_recursive_lock_lock (gl_recursive_lock_t *lock); +extern int glthread_recursive_lock_unlock (gl_recursive_lock_t *lock); +extern int glthread_recursive_lock_destroy (gl_recursive_lock_t *lock); + +/* -------------------------- gl_once_t datatype -------------------------- */ + +typedef once_flag gl_once_t; +# define gl_once_define(STORAGECLASS, NAME) \ + STORAGECLASS once_flag NAME = ONCE_FLAG_INIT; +# define glthread_once(ONCE_CONTROL, INITFUNCTION) \ + (call_once (ONCE_CONTROL, INITFUNCTION), 0) + +# ifdef __cplusplus +} +# endif + +#endif + +/* ========================================================================= */ + +#if USE_POSIX_THREADS + +/* Use the POSIX threads library. */ + +# include + +# ifdef __cplusplus +extern "C" { +# endif + +# if PTHREAD_IN_USE_DETECTION_HARD + +/* The pthread_in_use() detection needs to be done at runtime. */ +# define pthread_in_use() \ + glthread_in_use () +extern int glthread_in_use (void); + +# endif + +# if USE_POSIX_THREADS_WEAK + +/* Use weak references to the POSIX threads library. */ + +/* Weak references avoid dragging in external libraries if the other parts + of the program don't use them. Here we use them, because we don't want + every program that uses libintl to depend on libpthread. This assumes + that libpthread would not be loaded after libintl; i.e. if libintl is + loaded first, by an executable that does not depend on libpthread, and + then a module is dynamically loaded that depends on libpthread, libintl + will not be multithread-safe. */ + +/* The way to test at runtime whether libpthread is present is to test + whether a function pointer's value, such as &pthread_mutex_init, is + non-NULL. However, some versions of GCC have a bug through which, in + PIC mode, &foo != NULL always evaluates to true if there is a direct + call to foo(...) in the same function. To avoid this, we test the + address of a function in libpthread that we don't use. */ + +# pragma weak pthread_mutex_init +# pragma weak pthread_mutex_lock +# pragma weak pthread_mutex_unlock +# pragma weak pthread_mutex_destroy +# pragma weak pthread_rwlock_init +# pragma weak pthread_rwlock_rdlock +# pragma weak pthread_rwlock_wrlock +# pragma weak pthread_rwlock_unlock +# pragma weak pthread_rwlock_destroy +# pragma weak pthread_once +# pragma weak pthread_cond_init +# pragma weak pthread_cond_wait +# pragma weak pthread_cond_signal +# pragma weak pthread_cond_broadcast +# pragma weak pthread_cond_destroy +# pragma weak pthread_mutexattr_init +# pragma weak pthread_mutexattr_settype +# pragma weak pthread_mutexattr_destroy +# pragma weak pthread_rwlockattr_init +# if __GNU_LIBRARY__ > 1 +# pragma weak pthread_rwlockattr_setkind_np +# endif +# pragma weak pthread_rwlockattr_destroy +# ifndef pthread_self +# pragma weak pthread_self +# endif + +# if !PTHREAD_IN_USE_DETECTION_HARD + /* Considering all platforms with USE_POSIX_THREADS_WEAK, only few symbols + can be used to determine whether libpthread is in use. These are: + pthread_mutexattr_gettype + pthread_rwlockattr_destroy + pthread_rwlockattr_init + */ +# pragma weak pthread_mutexattr_gettype +# define pthread_in_use() \ + (pthread_mutexattr_gettype != NULL || c11_threads_in_use ()) +# endif + +# else + +# if !PTHREAD_IN_USE_DETECTION_HARD +# define pthread_in_use() 1 +# endif + +# endif + +/* -------------------------- gl_lock_t datatype -------------------------- */ + +typedef pthread_mutex_t gl_lock_t; +# define gl_lock_define(STORAGECLASS, NAME) \ + STORAGECLASS pthread_mutex_t NAME; +# define gl_lock_define_initialized(STORAGECLASS, NAME) \ + STORAGECLASS pthread_mutex_t NAME = gl_lock_initializer; +# define gl_lock_initializer \ + PTHREAD_MUTEX_INITIALIZER +# define glthread_lock_init(LOCK) \ + (pthread_in_use () ? pthread_mutex_init (LOCK, NULL) : 0) +# define glthread_lock_lock(LOCK) \ + (pthread_in_use () ? pthread_mutex_lock (LOCK) : 0) +# define glthread_lock_unlock(LOCK) \ + (pthread_in_use () ? pthread_mutex_unlock (LOCK) : 0) +# define glthread_lock_destroy(LOCK) \ + (pthread_in_use () ? pthread_mutex_destroy (LOCK) : 0) + +/* ------------------------- gl_rwlock_t datatype ------------------------- */ + +# if HAVE_PTHREAD_RWLOCK && (HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER || (defined PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP && (__GNU_LIBRARY__ > 1))) + +# if defined PTHREAD_RWLOCK_INITIALIZER || defined PTHREAD_RWLOCK_INITIALIZER_NP + +typedef pthread_rwlock_t gl_rwlock_t; +# define gl_rwlock_define(STORAGECLASS, NAME) \ + STORAGECLASS pthread_rwlock_t NAME; +# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \ + STORAGECLASS pthread_rwlock_t NAME = gl_rwlock_initializer; +# if HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER +# if defined PTHREAD_RWLOCK_INITIALIZER +# define gl_rwlock_initializer \ + PTHREAD_RWLOCK_INITIALIZER +# else +# define gl_rwlock_initializer \ + PTHREAD_RWLOCK_INITIALIZER_NP +# endif +# define glthread_rwlock_init(LOCK) \ + (pthread_in_use () ? pthread_rwlock_init (LOCK, NULL) : 0) +# else /* glibc with bug https://sourceware.org/bugzilla/show_bug.cgi?id=13701 */ +# define gl_rwlock_initializer \ + PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP +# define glthread_rwlock_init(LOCK) \ + (pthread_in_use () ? glthread_rwlock_init_for_glibc (LOCK) : 0) +extern int glthread_rwlock_init_for_glibc (pthread_rwlock_t *lock); +# endif +# define glthread_rwlock_rdlock(LOCK) \ + (pthread_in_use () ? pthread_rwlock_rdlock (LOCK) : 0) +# define glthread_rwlock_wrlock(LOCK) \ + (pthread_in_use () ? pthread_rwlock_wrlock (LOCK) : 0) +# define glthread_rwlock_unlock(LOCK) \ + (pthread_in_use () ? pthread_rwlock_unlock (LOCK) : 0) +# define glthread_rwlock_destroy(LOCK) \ + (pthread_in_use () ? pthread_rwlock_destroy (LOCK) : 0) + +# else + +typedef struct + { + int initialized; + pthread_mutex_t guard; /* protects the initialization */ + pthread_rwlock_t rwlock; /* read-write lock */ + } + gl_rwlock_t; +# define gl_rwlock_define(STORAGECLASS, NAME) \ + STORAGECLASS gl_rwlock_t NAME; +# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \ + STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer; +# define gl_rwlock_initializer \ + { 0, PTHREAD_MUTEX_INITIALIZER } +# define glthread_rwlock_init(LOCK) \ + (pthread_in_use () ? glthread_rwlock_init_multithreaded (LOCK) : 0) +# define glthread_rwlock_rdlock(LOCK) \ + (pthread_in_use () ? glthread_rwlock_rdlock_multithreaded (LOCK) : 0) +# define glthread_rwlock_wrlock(LOCK) \ + (pthread_in_use () ? glthread_rwlock_wrlock_multithreaded (LOCK) : 0) +# define glthread_rwlock_unlock(LOCK) \ + (pthread_in_use () ? glthread_rwlock_unlock_multithreaded (LOCK) : 0) +# define glthread_rwlock_destroy(LOCK) \ + (pthread_in_use () ? glthread_rwlock_destroy_multithreaded (LOCK) : 0) +extern int glthread_rwlock_init_multithreaded (gl_rwlock_t *lock); +extern int glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock); +extern int glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock); +extern int glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock); +extern int glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock); + +# endif + +# else + +typedef struct + { + pthread_mutex_t lock; /* protects the remaining fields */ + pthread_cond_t waiting_readers; /* waiting readers */ + pthread_cond_t waiting_writers; /* waiting writers */ + unsigned int waiting_writers_count; /* number of waiting writers */ + int runcount; /* number of readers running, or -1 when a writer runs */ + } + gl_rwlock_t; +# define gl_rwlock_define(STORAGECLASS, NAME) \ + STORAGECLASS gl_rwlock_t NAME; +# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \ + STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer; +# define gl_rwlock_initializer \ + { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, PTHREAD_COND_INITIALIZER, 0, 0 } +# define glthread_rwlock_init(LOCK) \ + (pthread_in_use () ? glthread_rwlock_init_multithreaded (LOCK) : 0) +# define glthread_rwlock_rdlock(LOCK) \ + (pthread_in_use () ? glthread_rwlock_rdlock_multithreaded (LOCK) : 0) +# define glthread_rwlock_wrlock(LOCK) \ + (pthread_in_use () ? glthread_rwlock_wrlock_multithreaded (LOCK) : 0) +# define glthread_rwlock_unlock(LOCK) \ + (pthread_in_use () ? glthread_rwlock_unlock_multithreaded (LOCK) : 0) +# define glthread_rwlock_destroy(LOCK) \ + (pthread_in_use () ? glthread_rwlock_destroy_multithreaded (LOCK) : 0) +extern int glthread_rwlock_init_multithreaded (gl_rwlock_t *lock); +extern int glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock); +extern int glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock); +extern int glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock); +extern int glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock); + +# endif + +/* --------------------- gl_recursive_lock_t datatype --------------------- */ + +# if HAVE_PTHREAD_MUTEX_RECURSIVE + +# if defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER || defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP + +typedef pthread_mutex_t gl_recursive_lock_t; +# define gl_recursive_lock_define(STORAGECLASS, NAME) \ + STORAGECLASS pthread_mutex_t NAME; +# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \ + STORAGECLASS pthread_mutex_t NAME = gl_recursive_lock_initializer; +# ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER +# define gl_recursive_lock_initializer \ + PTHREAD_RECURSIVE_MUTEX_INITIALIZER +# else +# define gl_recursive_lock_initializer \ + PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP +# endif +# define glthread_recursive_lock_init(LOCK) \ + (pthread_in_use () ? glthread_recursive_lock_init_multithreaded (LOCK) : 0) +# define glthread_recursive_lock_lock(LOCK) \ + (pthread_in_use () ? pthread_mutex_lock (LOCK) : 0) +# define glthread_recursive_lock_unlock(LOCK) \ + (pthread_in_use () ? pthread_mutex_unlock (LOCK) : 0) +# define glthread_recursive_lock_destroy(LOCK) \ + (pthread_in_use () ? pthread_mutex_destroy (LOCK) : 0) +extern int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock); + +# else + +typedef struct + { + pthread_mutex_t recmutex; /* recursive mutex */ + pthread_mutex_t guard; /* protects the initialization */ + int initialized; + } + gl_recursive_lock_t; +# define gl_recursive_lock_define(STORAGECLASS, NAME) \ + STORAGECLASS gl_recursive_lock_t NAME; +# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \ + STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer; +# define gl_recursive_lock_initializer \ + { PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, 0 } +# define glthread_recursive_lock_init(LOCK) \ + (pthread_in_use () ? glthread_recursive_lock_init_multithreaded (LOCK) : 0) +# define glthread_recursive_lock_lock(LOCK) \ + (pthread_in_use () ? glthread_recursive_lock_lock_multithreaded (LOCK) : 0) +# define glthread_recursive_lock_unlock(LOCK) \ + (pthread_in_use () ? glthread_recursive_lock_unlock_multithreaded (LOCK) : 0) +# define glthread_recursive_lock_destroy(LOCK) \ + (pthread_in_use () ? glthread_recursive_lock_destroy_multithreaded (LOCK) : 0) +extern int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock); +extern int glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock); +extern int glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock); +extern int glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock); + +# endif + +# else + +/* Old versions of POSIX threads on Solaris did not have recursive locks. + We have to implement them ourselves. */ + +typedef struct + { + pthread_mutex_t mutex; + pthread_t owner; + unsigned long depth; + } + gl_recursive_lock_t; +# define gl_recursive_lock_define(STORAGECLASS, NAME) \ + STORAGECLASS gl_recursive_lock_t NAME; +# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \ + STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer; +# define gl_recursive_lock_initializer \ + { PTHREAD_MUTEX_INITIALIZER, (pthread_t) 0, 0 } +# define glthread_recursive_lock_init(LOCK) \ + (pthread_in_use () ? glthread_recursive_lock_init_multithreaded (LOCK) : 0) +# define glthread_recursive_lock_lock(LOCK) \ + (pthread_in_use () ? glthread_recursive_lock_lock_multithreaded (LOCK) : 0) +# define glthread_recursive_lock_unlock(LOCK) \ + (pthread_in_use () ? glthread_recursive_lock_unlock_multithreaded (LOCK) : 0) +# define glthread_recursive_lock_destroy(LOCK) \ + (pthread_in_use () ? glthread_recursive_lock_destroy_multithreaded (LOCK) : 0) +extern int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock); +extern int glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock); +extern int glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock); +extern int glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock); + +# endif + +/* -------------------------- gl_once_t datatype -------------------------- */ + +typedef pthread_once_t gl_once_t; +# define gl_once_define(STORAGECLASS, NAME) \ + STORAGECLASS pthread_once_t NAME = PTHREAD_ONCE_INIT; +# if PTHREAD_IN_USE_DETECTION_HARD || USE_POSIX_THREADS_WEAK +# define glthread_once(ONCE_CONTROL, INITFUNCTION) \ + (pthread_in_use () \ + ? pthread_once (ONCE_CONTROL, INITFUNCTION) \ + : (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) : 0)) +# else +# define glthread_once(ONCE_CONTROL, INITFUNCTION) \ + (pthread_in_use () \ + ? glthread_once_multithreaded (ONCE_CONTROL, INITFUNCTION) \ + : (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) : 0)) +extern int glthread_once_multithreaded (pthread_once_t *once_control, + void (*init_function) (void)); +# endif +extern int glthread_once_singlethreaded (pthread_once_t *once_control); + +# ifdef __cplusplus +} +# endif + +#endif + +/* ========================================================================= */ + +#if USE_WINDOWS_THREADS + +# define WIN32_LEAN_AND_MEAN /* avoid including junk */ +# include + +# include "windows-mutex.h" +# include "windows-rwlock.h" +# include "windows-recmutex.h" +# include "windows-once.h" + +# ifdef __cplusplus +extern "C" { +# endif + +/* We can use CRITICAL_SECTION directly, rather than the native Windows Event, + Mutex, Semaphore types, because + - we need only to synchronize inside a single process (address space), + not inter-process locking, + - we don't need to support trylock operations. (TryEnterCriticalSection + does not work on Windows 95/98/ME. Packages that need trylock usually + define their own mutex type.) */ + +/* There is no way to statically initialize a CRITICAL_SECTION. It needs + to be done lazily, once only. For this we need spinlocks. */ + +/* -------------------------- gl_lock_t datatype -------------------------- */ + +typedef glwthread_mutex_t gl_lock_t; +# define gl_lock_define(STORAGECLASS, NAME) \ + STORAGECLASS gl_lock_t NAME; +# define gl_lock_define_initialized(STORAGECLASS, NAME) \ + STORAGECLASS gl_lock_t NAME = gl_lock_initializer; +# define gl_lock_initializer \ + GLWTHREAD_MUTEX_INIT +# define glthread_lock_init(LOCK) \ + (glwthread_mutex_init (LOCK), 0) +# define glthread_lock_lock(LOCK) \ + glwthread_mutex_lock (LOCK) +# define glthread_lock_unlock(LOCK) \ + glwthread_mutex_unlock (LOCK) +# define glthread_lock_destroy(LOCK) \ + glwthread_mutex_destroy (LOCK) + +/* ------------------------- gl_rwlock_t datatype ------------------------- */ + +typedef glwthread_rwlock_t gl_rwlock_t; +# define gl_rwlock_define(STORAGECLASS, NAME) \ + STORAGECLASS gl_rwlock_t NAME; +# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \ + STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer; +# define gl_rwlock_initializer \ + GLWTHREAD_RWLOCK_INIT +# define glthread_rwlock_init(LOCK) \ + (glwthread_rwlock_init (LOCK), 0) +# define glthread_rwlock_rdlock(LOCK) \ + glwthread_rwlock_rdlock (LOCK) +# define glthread_rwlock_wrlock(LOCK) \ + glwthread_rwlock_wrlock (LOCK) +# define glthread_rwlock_unlock(LOCK) \ + glwthread_rwlock_unlock (LOCK) +# define glthread_rwlock_destroy(LOCK) \ + glwthread_rwlock_destroy (LOCK) + +/* --------------------- gl_recursive_lock_t datatype --------------------- */ + +typedef glwthread_recmutex_t gl_recursive_lock_t; +# define gl_recursive_lock_define(STORAGECLASS, NAME) \ + STORAGECLASS gl_recursive_lock_t NAME; +# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \ + STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer; +# define gl_recursive_lock_initializer \ + GLWTHREAD_RECMUTEX_INIT +# define glthread_recursive_lock_init(LOCK) \ + (glwthread_recmutex_init (LOCK), 0) +# define glthread_recursive_lock_lock(LOCK) \ + glwthread_recmutex_lock (LOCK) +# define glthread_recursive_lock_unlock(LOCK) \ + glwthread_recmutex_unlock (LOCK) +# define glthread_recursive_lock_destroy(LOCK) \ + glwthread_recmutex_destroy (LOCK) + +/* -------------------------- gl_once_t datatype -------------------------- */ + +typedef glwthread_once_t gl_once_t; +# define gl_once_define(STORAGECLASS, NAME) \ + STORAGECLASS gl_once_t NAME = GLWTHREAD_ONCE_INIT; +# define glthread_once(ONCE_CONTROL, INITFUNCTION) \ + (glwthread_once (ONCE_CONTROL, INITFUNCTION), 0) + +# ifdef __cplusplus +} +# endif + +#endif + +/* ========================================================================= */ + +#if !(USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS) + +/* Provide dummy implementation if threads are not supported. */ + +/* -------------------------- gl_lock_t datatype -------------------------- */ + +typedef int gl_lock_t; +# define gl_lock_define(STORAGECLASS, NAME) +# define gl_lock_define_initialized(STORAGECLASS, NAME) +# define glthread_lock_init(NAME) 0 +# define glthread_lock_lock(NAME) 0 +# define glthread_lock_unlock(NAME) 0 +# define glthread_lock_destroy(NAME) 0 + +/* ------------------------- gl_rwlock_t datatype ------------------------- */ + +typedef int gl_rwlock_t; +# define gl_rwlock_define(STORAGECLASS, NAME) +# define gl_rwlock_define_initialized(STORAGECLASS, NAME) +# define glthread_rwlock_init(NAME) 0 +# define glthread_rwlock_rdlock(NAME) 0 +# define glthread_rwlock_wrlock(NAME) 0 +# define glthread_rwlock_unlock(NAME) 0 +# define glthread_rwlock_destroy(NAME) 0 + +/* --------------------- gl_recursive_lock_t datatype --------------------- */ + +typedef int gl_recursive_lock_t; +# define gl_recursive_lock_define(STORAGECLASS, NAME) +# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) +# define glthread_recursive_lock_init(NAME) 0 +# define glthread_recursive_lock_lock(NAME) 0 +# define glthread_recursive_lock_unlock(NAME) 0 +# define glthread_recursive_lock_destroy(NAME) 0 + +/* -------------------------- gl_once_t datatype -------------------------- */ + +typedef int gl_once_t; +# define gl_once_define(STORAGECLASS, NAME) \ + STORAGECLASS gl_once_t NAME = 0; +# define glthread_once(ONCE_CONTROL, INITFUNCTION) \ + (*(ONCE_CONTROL) == 0 ? (*(ONCE_CONTROL) = ~ 0, INITFUNCTION (), 0) : 0) + +#endif + +/* ========================================================================= */ + +/* Macros with built-in error handling. */ + +/* -------------------------- gl_lock_t datatype -------------------------- */ + +#define gl_lock_init(NAME) \ + do \ + { \ + if (glthread_lock_init (&NAME)) \ + abort (); \ + } \ + while (0) +#define gl_lock_lock(NAME) \ + do \ + { \ + if (glthread_lock_lock (&NAME)) \ + abort (); \ + } \ + while (0) +#define gl_lock_unlock(NAME) \ + do \ + { \ + if (glthread_lock_unlock (&NAME)) \ + abort (); \ + } \ + while (0) +#define gl_lock_destroy(NAME) \ + do \ + { \ + if (glthread_lock_destroy (&NAME)) \ + abort (); \ + } \ + while (0) + +/* ------------------------- gl_rwlock_t datatype ------------------------- */ + +#define gl_rwlock_init(NAME) \ + do \ + { \ + if (glthread_rwlock_init (&NAME)) \ + abort (); \ + } \ + while (0) +#define gl_rwlock_rdlock(NAME) \ + do \ + { \ + if (glthread_rwlock_rdlock (&NAME)) \ + abort (); \ + } \ + while (0) +#define gl_rwlock_wrlock(NAME) \ + do \ + { \ + if (glthread_rwlock_wrlock (&NAME)) \ + abort (); \ + } \ + while (0) +#define gl_rwlock_unlock(NAME) \ + do \ + { \ + if (glthread_rwlock_unlock (&NAME)) \ + abort (); \ + } \ + while (0) +#define gl_rwlock_destroy(NAME) \ + do \ + { \ + if (glthread_rwlock_destroy (&NAME)) \ + abort (); \ + } \ + while (0) + +/* --------------------- gl_recursive_lock_t datatype --------------------- */ + +#define gl_recursive_lock_init(NAME) \ + do \ + { \ + if (glthread_recursive_lock_init (&NAME)) \ + abort (); \ + } \ + while (0) +#define gl_recursive_lock_lock(NAME) \ + do \ + { \ + if (glthread_recursive_lock_lock (&NAME)) \ + abort (); \ + } \ + while (0) +#define gl_recursive_lock_unlock(NAME) \ + do \ + { \ + if (glthread_recursive_lock_unlock (&NAME)) \ + abort (); \ + } \ + while (0) +#define gl_recursive_lock_destroy(NAME) \ + do \ + { \ + if (glthread_recursive_lock_destroy (&NAME)) \ + abort (); \ + } \ + while (0) + +/* -------------------------- gl_once_t datatype -------------------------- */ + +#define gl_once(NAME, INITFUNCTION) \ + do \ + { \ + if (glthread_once (&NAME, INITFUNCTION)) \ + abort (); \ + } \ + while (0) + +/* ========================================================================= */ + +#endif /* _LOCK_H */ diff -Nru datamash-1.7/lib/glthread/threadlib.c datamash-1.8/lib/glthread/threadlib.c --- datamash-1.7/lib/glthread/threadlib.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/glthread/threadlib.c 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,108 @@ +/* Multithreading primitives. + Copyright (C) 2005-2021 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 Bruno Haible , 2005. */ + +#include + +/* ========================================================================= */ + +#if USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS + +/* Use the POSIX threads library. */ + +# include +# include +# include + +# if PTHREAD_IN_USE_DETECTION_HARD + +# if defined __FreeBSD__ || defined __DragonFly__ /* FreeBSD */ + +/* Test using pthread_key_create. */ + +int +glthread_in_use (void) +{ + static int tested; + static int result; /* 1: linked with -lpthread, 0: only with libc */ + + if (!tested) + { + pthread_key_t key; + int err = pthread_key_create (&key, NULL); + + if (err == ENOSYS) + result = 0; + else + { + result = 1; + if (err == 0) + pthread_key_delete (key); + } + tested = 1; + } + return result; +} + +# else /* Solaris, HP-UX */ + +/* Test using pthread_create. */ + +/* The function to be executed by a dummy thread. */ +static void * +dummy_thread_func (void *arg) +{ + return arg; +} + +int +glthread_in_use (void) +{ + static int tested; + static int result; /* 1: linked with -lpthread, 0: only with libc */ + + if (!tested) + { + pthread_t thread; + + if (pthread_create (&thread, NULL, dummy_thread_func, NULL) != 0) + /* Thread creation failed. */ + result = 0; + else + { + /* Thread creation works. */ + void *retval; + if (pthread_join (thread, &retval) != 0) + abort (); + result = 1; + } + tested = 1; + } + return result; +} + +# endif + +# endif + +#endif + +/* ========================================================================= */ + +/* This declaration is solely to ensure that after preprocessing + this file is never empty. */ +typedef int dummy; diff -Nru datamash-1.7/lib/gnulib.mk datamash-1.8/lib/gnulib.mk --- datamash-1.7/lib/gnulib.mk 2020-04-23 17:33:45.000000000 +0000 +++ datamash-1.8/lib/gnulib.mk 2022-05-28 01:47:09.000000000 +0000 @@ -1,6 +1,6 @@ ## DO NOT EDIT! GENERATED AUTOMATICALLY! ## Process this file with automake to produce Makefile.in. -# Copyright (C) 2002-2020 Free Software Foundation, Inc. +# Copyright (C) 2002-2021 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 @@ -47,6 +47,8 @@ # crypto/sha512 \ # dirname \ # do-release-commit-and-tag \ +# dup2 \ +# errno \ # error \ # expl \ # extensions \ @@ -56,7 +58,7 @@ # fpucw \ # gendocs \ # getopt-gnu \ -# gettext \ +# gettext-h \ # git-version-gen \ # gitlog-to-changelog \ # gnu-web-doc-update \ @@ -66,6 +68,8 @@ # hash-pjw \ # hash-pjw-bare \ # ignore-value \ +# inet_pton \ +# inline \ # intprops \ # inttostr \ # inttypes \ @@ -76,31 +80,42 @@ # localeconv \ # logl \ # maintainer-makefile \ -# mbsrtowcs \ # minmax \ # modfl \ # netinet_in \ # non-recursive-gnulib-prefix-hack \ +# pclose \ # pmccabe2html \ +# popen \ # progname \ # propername \ # random \ # readme-release \ # realloc-gnu \ # roundl \ +# setlocale \ +# sh-quote \ +# signbit \ # size_max \ +# snprintf \ # sqrtl \ +# std-gnu11 \ +# stdbool \ # stdint \ # stdnoreturn \ # stpcpy \ +# strcase \ +# strdup-posix \ # strsep \ +# strtold \ +# strtoll \ # sys_socket \ # unlocked-io \ # update-copyright \ # version-etc \ +# waitpid \ # warnings \ # xalloc \ -# xstrndup \ # xstrtol \ # xstrtol-error \ # xstrtoumax @@ -121,7 +136,7 @@ # 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 = (__GNUC__ || 60000000 <= __DECC_VER) +HAVE_INCLUDE_NEXT = (__GNUC__ || __clang__ || 60000000 <= __DECC_VER) ## end gnulib module absolute-header @@ -155,6 +170,43 @@ ## end gnulib module announce-gen +## begin gnulib module arpa_inet + +BUILT_SOURCES += lib/arpa/inet.h + +# We need the following in order to create when the system +# doesn't have one. +lib/arpa/inet.h: lib/arpa_inet.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H) + $(AM_V_at)$(MKDIR_P) lib/arpa + $(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|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \ + -e 's|@''NEXT_ARPA_INET_H''@|$(NEXT_ARPA_INET_H)|g' \ + -e 's|@''HAVE_ARPA_INET_H''@|$(HAVE_ARPA_INET_H)|g' \ + -e 's/@''GNULIB_INET_NTOP''@/$(GNULIB_INET_NTOP)/g' \ + -e 's/@''GNULIB_INET_PTON''@/$(GNULIB_INET_PTON)/g' \ + -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \ + -e 's|@''HAVE_DECL_INET_NTOP''@|$(HAVE_DECL_INET_NTOP)|g' \ + -e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \ + -e 's|@''REPLACE_INET_NTOP''@|$(REPLACE_INET_NTOP)|g' \ + -e 's|@''REPLACE_INET_PTON''@|$(REPLACE_INET_PTON)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(top_srcdir)/lib/arpa_inet.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += lib/arpa/inet.h lib/arpa/inet.h-t +MOSTLYCLEANDIRS += lib/arpa + +EXTRA_DIST += lib/arpa_inet.in.h + +## end gnulib module arpa_inet + ## begin gnulib module assure @@ -162,12 +214,27 @@ ## end gnulib module assure +## begin gnulib module attribute + + +EXTRA_DIST += lib/attribute.h + +## end gnulib module attribute + ## begin gnulib module base64 lib_libdatamash_a_SOURCES += lib/base64.h lib/base64.c ## end gnulib module base64 +## begin gnulib module basename-lgpl + +lib_libdatamash_a_SOURCES += lib/basename-lgpl.c + +EXTRA_DIST += lib/basename-lgpl.h + +## end gnulib module basename-lgpl + ## begin gnulib module bitrotate lib_libdatamash_a_SOURCES += lib/bitrotate.h lib/bitrotate.c @@ -252,6 +319,23 @@ ## end gnulib module ceill +## begin gnulib module cloexec + +lib_libdatamash_a_SOURCES += lib/cloexec.c + +EXTRA_DIST += lib/cloexec.h + +## end gnulib module cloexec + +## begin gnulib module close + + +EXTRA_DIST += lib/close.c + +EXTRA_lib_libdatamash_a_SOURCES += lib/close.c + +## end gnulib module close + ## begin gnulib module close-stream lib_libdatamash_a_SOURCES += lib/close-stream.c @@ -395,7 +479,7 @@ ## begin gnulib module dirname-lgpl -lib_libdatamash_a_SOURCES += lib/dirname-lgpl.c lib/basename-lgpl.c lib/stripslash.c +lib_libdatamash_a_SOURCES += lib/dirname-lgpl.c lib/stripslash.c EXTRA_DIST += lib/dirname.h @@ -408,12 +492,14 @@ ## end gnulib module do-release-commit-and-tag -## begin gnulib module dosname +## begin gnulib module dup2 -EXTRA_DIST += lib/dosname.h +EXTRA_DIST += lib/dup2.c -## end gnulib module dosname +EXTRA_lib_libdatamash_a_SOURCES += lib/dup2.c + +## end gnulib module dup2 ## begin gnulib module errno @@ -484,6 +570,62 @@ ## end gnulib module fabsl +## begin gnulib module fcntl + + +EXTRA_DIST += lib/fcntl.c + +EXTRA_lib_libdatamash_a_SOURCES += lib/fcntl.c + +## end gnulib module fcntl + +## begin gnulib module fcntl-h + +BUILT_SOURCES += lib/fcntl.h + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +lib/fcntl.h: lib/fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(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_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \ + -e 's/@''GNULIB_CREAT''@/$(GNULIB_CREAT)/g' \ + -e 's/@''GNULIB_FCNTL''@/$(GNULIB_FCNTL)/g' \ + -e 's/@''GNULIB_NONBLOCKING''@/$(GNULIB_NONBLOCKING)/g' \ + -e 's/@''GNULIB_OPEN''@/$(GNULIB_OPEN)/g' \ + -e 's/@''GNULIB_OPENAT''@/$(GNULIB_OPENAT)/g' \ + -e 's/@''GNULIB_MDA_CREAT''@/$(GNULIB_MDA_CREAT)/g' \ + -e 's/@''GNULIB_MDA_OPEN''@/$(GNULIB_MDA_OPEN)/g' \ + -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \ + -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \ + -e 's|@''REPLACE_CREAT''@|$(REPLACE_CREAT)|g' \ + -e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \ + -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \ + -e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(top_srcdir)/lib/fcntl.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += lib/fcntl.h lib/fcntl.h-t + +EXTRA_DIST += lib/fcntl.in.h + +## end gnulib module fcntl-h + +## begin gnulib module fd-hook + +lib_libdatamash_a_SOURCES += lib/fd-hook.c + +EXTRA_DIST += lib/fd-hook.h + +## end gnulib module fd-hook + ## begin gnulib module fflush @@ -493,6 +635,20 @@ ## end gnulib module fflush +## begin gnulib module filename + + +EXTRA_DIST += lib/filename.h + +## end gnulib module filename + +## begin gnulib module flexmember + + +EXTRA_DIST += lib/flexmember.h + +## end gnulib module flexmember + ## begin gnulib module float BUILT_SOURCES += $(FLOAT_H) @@ -645,6 +801,15 @@ ## end gnulib module gendocs +## begin gnulib module getdtablesize + + +EXTRA_DIST += lib/getdtablesize.c + +EXTRA_lib_libdatamash_a_SOURCES += lib/getdtablesize.c + +## end gnulib module getdtablesize + ## begin gnulib module getopt-posix BUILT_SOURCES += $(GETOPT_H) $(GETOPT_CDEFS_H) @@ -687,23 +852,6 @@ ## end gnulib module getprogname -## begin gnulib module gettext - -# If your project uses "gettextize --intl" to put a source-code -# copy of libintl into the package, every Makefile.am needs -# -I$(top_builddir)/intl, so that can be found in this directory. -# Here's one way to do this: -#AM_CPPFLAGS += -I$(top_builddir)/intl -# This option has no effect when the user disables NLS (because then -# the intl directory contains no libintl.h file). This option is not -# enabled by default because the intl directory might not exist if -# your project does not use "gettext --intl", and some compilers -# complain about -I options applied to nonexistent directories. - -EXTRA_DIST += $(top_srcdir)/build-aux/config.rpath - -## end gnulib module gettext - ## begin gnulib module gettext-h lib_libdatamash_a_SOURCES += lib/gettext.h @@ -865,6 +1013,15 @@ ## end gnulib module ignore-value +## begin gnulib module inet_pton + + +EXTRA_DIST += lib/inet_pton.c + +EXTRA_lib_libdatamash_a_SOURCES += lib/inet_pton.c + +## end gnulib module inet_pton + ## begin gnulib module intprops @@ -896,7 +1053,6 @@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_INTTYPES_H''@|$(NEXT_INTTYPES_H)|g' \ - -e 's/@''PRI_MACROS_BROKEN''@/$(PRI_MACROS_BROKEN)/g' \ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \ -e 's/@''GNULIB_IMAXABS''@/$(GNULIB_IMAXABS)/g' \ @@ -1016,6 +1172,40 @@ ## end gnulib module iswxdigit +## begin gnulib module langinfo + +BUILT_SOURCES += lib/langinfo.h + +# We need the following in order to create an empty placeholder for +# when the system doesn't have one. +lib/langinfo.h: lib/langinfo.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_LANGINFO_H''@|$(HAVE_LANGINFO_H)|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_LANGINFO_H''@|$(NEXT_LANGINFO_H)|g' \ + -e 's/@''GNULIB_NL_LANGINFO''@/$(GNULIB_NL_LANGINFO)/g' \ + -e 's|@''HAVE_LANGINFO_CODESET''@|$(HAVE_LANGINFO_CODESET)|g' \ + -e 's|@''HAVE_LANGINFO_T_FMT_AMPM''@|$(HAVE_LANGINFO_T_FMT_AMPM)|g' \ + -e 's|@''HAVE_LANGINFO_ALTMON''@|$(HAVE_LANGINFO_ALTMON)|g' \ + -e 's|@''HAVE_LANGINFO_ERA''@|$(HAVE_LANGINFO_ERA)|g' \ + -e 's|@''HAVE_LANGINFO_YESEXPR''@|$(HAVE_LANGINFO_YESEXPR)|g' \ + -e 's|@''HAVE_NL_LANGINFO''@|$(HAVE_NL_LANGINFO)|g' \ + -e 's|@''REPLACE_NL_LANGINFO''@|$(REPLACE_NL_LANGINFO)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(top_srcdir)/lib/langinfo.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += lib/langinfo.h lib/langinfo.h-t + +EXTRA_DIST += lib/langinfo.in.h + +## end gnulib module langinfo + ## begin gnulib module ldexpl @@ -1124,6 +1314,20 @@ ## end gnulib module localeconv +## begin gnulib module localename + +lib_libdatamash_a_SOURCES += lib/localename.c lib/localename-table.c + +EXTRA_DIST += lib/localename-table.h lib/localename.h + +## end gnulib module localename + +## begin gnulib module lock + +lib_libdatamash_a_SOURCES += lib/glthread/lock.h lib/glthread/lock.c + +## end gnulib module lock + ## begin gnulib module log @@ -1285,6 +1489,12 @@ -e 's/@''GNULIB_TRUNC''@/$(GNULIB_TRUNC)/g' \ -e 's/@''GNULIB_TRUNCF''@/$(GNULIB_TRUNCF)/g' \ -e 's/@''GNULIB_TRUNCL''@/$(GNULIB_TRUNCL)/g' \ + -e 's/@''GNULIB_MDA_J0''@/$(GNULIB_MDA_J0)/g' \ + -e 's/@''GNULIB_MDA_J1''@/$(GNULIB_MDA_J1)/g' \ + -e 's/@''GNULIB_MDA_JN''@/$(GNULIB_MDA_JN)/g' \ + -e 's/@''GNULIB_MDA_Y0''@/$(GNULIB_MDA_Y0)/g' \ + -e 's/@''GNULIB_MDA_Y1''@/$(GNULIB_MDA_Y1)/g' \ + -e 's/@''GNULIB_MDA_YN''@/$(GNULIB_MDA_YN)/g' \ | \ sed -e 's|@''HAVE_ACOSF''@|$(HAVE_ACOSF)|g' \ -e 's|@''HAVE_ACOSL''@|$(HAVE_ACOSL)|g' \ @@ -1453,7 +1663,7 @@ -e 's|@''REPLACE_ROUNDF''@|$(REPLACE_ROUNDF)|g' \ -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_SIGNBIT_USING_BUILTINS''@|$(REPLACE_SIGNBIT_USING_BUILTINS)|g' \ -e 's|@''REPLACE_SINF''@|$(REPLACE_SINF)|g' \ -e 's|@''REPLACE_SINHF''@|$(REPLACE_SINHF)|g' \ -e 's|@''REPLACE_SQRTF''@|$(REPLACE_SQRTF)|g' \ @@ -1512,15 +1722,6 @@ ## end gnulib module mbslen -## begin gnulib module mbsrtowcs - - -EXTRA_DIST += lib/mbsrtowcs-impl.h lib/mbsrtowcs-state.c lib/mbsrtowcs.c - -EXTRA_lib_libdatamash_a_SOURCES += lib/mbsrtowcs-state.c lib/mbsrtowcs.c - -## end gnulib module mbsrtowcs - ## begin gnulib module mbsstr lib_libdatamash_a_SOURCES += lib/mbsstr.c @@ -1624,6 +1825,15 @@ ## end gnulib module non-recursive-gnulib-prefix-hack +## begin gnulib module open + + +EXTRA_DIST += lib/open.c + +EXTRA_lib_libdatamash_a_SOURCES += lib/open.c + +## end gnulib module open + ## begin gnulib module pathmax @@ -1631,6 +1841,15 @@ ## end gnulib module pathmax +## begin gnulib module pclose + + +EXTRA_DIST += lib/pclose.c + +EXTRA_lib_libdatamash_a_SOURCES += lib/pclose.c + +## end gnulib module pclose + ## begin gnulib module pmccabe2html @@ -1638,6 +1857,15 @@ ## end gnulib module pmccabe2html +## begin gnulib module popen + + +EXTRA_DIST += lib/popen.c + +EXTRA_lib_libdatamash_a_SOURCES += lib/popen.c + +## end gnulib module popen + ## begin gnulib module progname lib_libdatamash_a_SOURCES += lib/progname.h lib/progname.c @@ -1712,6 +1940,15 @@ ## end gnulib module roundl +## begin gnulib module setlocale + + +EXTRA_DIST += lib/setlocale.c + +EXTRA_lib_libdatamash_a_SOURCES += lib/setlocale.c + +## end gnulib module setlocale + ## begin gnulib module setlocale-null lib_libdatamash_a_SOURCES += lib/setlocale_null.c @@ -1722,6 +1959,12 @@ ## end gnulib module setlocale-null +## begin gnulib module sh-quote + +lib_libdatamash_a_SOURCES += lib/sh-quote.h lib/sh-quote.c + +## end gnulib module sh-quote + ## begin gnulib module signbit @@ -1797,6 +2040,15 @@ ## end gnulib module snippet/warn-on-use +## begin gnulib module snprintf + + +EXTRA_DIST += lib/snprintf.c + +EXTRA_lib_libdatamash_a_SOURCES += lib/snprintf.c + +## end gnulib module snprintf + ## begin gnulib module sqrtl @@ -1806,6 +2058,15 @@ ## end gnulib module sqrtl +## begin gnulib module stat + + +EXTRA_DIST += lib/stat-w32.c lib/stat-w32.h lib/stat.c + +EXTRA_lib_libdatamash_a_SOURCES += lib/stat-w32.c lib/stat.c + +## end gnulib module stat + ## begin gnulib module stat-time lib_libdatamash_a_SOURCES += lib/stat-time.c @@ -2036,8 +2297,15 @@ -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GNULIB_VPRINTF_POSIX)/g' \ -e 's/@''GNULIB_VSNPRINTF''@/$(GNULIB_VSNPRINTF)/g' \ -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GNULIB_VSPRINTF_POSIX)/g' \ + -e 's/@''GNULIB_MDA_FCLOSEALL''@/$(GNULIB_MDA_FCLOSEALL)/g' \ + -e 's/@''GNULIB_MDA_FDOPEN''@/$(GNULIB_MDA_FDOPEN)/g' \ + -e 's/@''GNULIB_MDA_FILENO''@/$(GNULIB_MDA_FILENO)/g' \ + -e 's/@''GNULIB_MDA_GETW''@/$(GNULIB_MDA_GETW)/g' \ + -e 's/@''GNULIB_MDA_PUTW''@/$(GNULIB_MDA_PUTW)/g' \ + -e 's/@''GNULIB_MDA_TEMPNAM''@/$(GNULIB_MDA_TEMPNAM)/g' \ < $(top_srcdir)/lib/stdio.in.h | \ - sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \ + sed -e 's|@''HAVE_DECL_FCLOSEALL''@|$(HAVE_DECL_FCLOSEALL)|g' \ + -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \ -e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \ -e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \ -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \ @@ -2113,9 +2381,11 @@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \ -e 's/@''GNULIB__EXIT''@/$(GNULIB__EXIT)/g' \ + -e 's/@''GNULIB_ALIGNED_ALLOC''@/$(GNULIB_ALIGNED_ALLOC)/g' \ -e 's/@''GNULIB_ATOLL''@/$(GNULIB_ATOLL)/g' \ -e 's/@''GNULIB_CALLOC_POSIX''@/$(GNULIB_CALLOC_POSIX)/g' \ -e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GNULIB_CANONICALIZE_FILE_NAME)/g' \ + -e 's/@''GNULIB_FREE_POSIX''@/$(GNULIB_FREE_POSIX)/g' \ -e 's/@''GNULIB_GETLOADAVG''@/$(GNULIB_GETLOADAVG)/g' \ -e 's/@''GNULIB_GETSUBOPT''@/$(GNULIB_GETSUBOPT)/g' \ -e 's/@''GNULIB_GRANTPT''@/$(GNULIB_GRANTPT)/g' \ @@ -2126,6 +2396,7 @@ -e 's/@''GNULIB_MKOSTEMPS''@/$(GNULIB_MKOSTEMPS)/g' \ -e 's/@''GNULIB_MKSTEMP''@/$(GNULIB_MKSTEMP)/g' \ -e 's/@''GNULIB_MKSTEMPS''@/$(GNULIB_MKSTEMPS)/g' \ + -e 's/@''GNULIB_POSIX_MEMALIGN''@/$(GNULIB_POSIX_MEMALIGN)/g' \ -e 's/@''GNULIB_POSIX_OPENPT''@/$(GNULIB_POSIX_OPENPT)/g' \ -e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \ -e 's/@''GNULIB_PTSNAME_R''@/$(GNULIB_PTSNAME_R)/g' \ @@ -2147,10 +2418,19 @@ -e 's/@''GNULIB_UNLOCKPT''@/$(GNULIB_UNLOCKPT)/g' \ -e 's/@''GNULIB_UNSETENV''@/$(GNULIB_UNSETENV)/g' \ -e 's/@''GNULIB_WCTOMB''@/$(GNULIB_WCTOMB)/g' \ + -e 's/@''GNULIB_MDA_ECVT''@/$(GNULIB_MDA_ECVT)/g' \ + -e 's/@''GNULIB_MDA_FCVT''@/$(GNULIB_MDA_FCVT)/g' \ + -e 's/@''GNULIB_MDA_GCVT''@/$(GNULIB_MDA_GCVT)/g' \ + -e 's/@''GNULIB_MDA_MKTEMP''@/$(GNULIB_MDA_MKTEMP)/g' \ + -e 's/@''GNULIB_MDA_PUTENV''@/$(GNULIB_MDA_PUTENV)/g' \ < $(top_srcdir)/lib/stdlib.in.h | \ sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \ + -e 's|@''HAVE_ALIGNED_ALLOC''@|$(HAVE_ALIGNED_ALLOC)|g' \ -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \ -e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \ + -e 's|@''HAVE_DECL_ECVT''@|$(HAVE_DECL_ECVT)|g' \ + -e 's|@''HAVE_DECL_FCVT''@|$(HAVE_DECL_FCVT)|g' \ + -e 's|@''HAVE_DECL_GCVT''@|$(HAVE_DECL_GCVT)|g' \ -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \ -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \ -e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \ @@ -2162,6 +2442,7 @@ -e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \ -e 's|@''HAVE_MKSTEMP''@|$(HAVE_MKSTEMP)|g' \ -e 's|@''HAVE_MKSTEMPS''@|$(HAVE_MKSTEMPS)|g' \ + -e 's|@''HAVE_POSIX_MEMALIGN''@|$(HAVE_POSIX_MEMALIGN)|g' \ -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' \ @@ -2184,12 +2465,15 @@ -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \ -e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \ -e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \ + -e 's|@''REPLACE_ALIGNED_ALLOC''@|$(REPLACE_ALIGNED_ALLOC)|g' \ -e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \ -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \ + -e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \ -e 's|@''REPLACE_INITSTATE''@|$(REPLACE_INITSTATE)|g' \ -e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \ -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \ -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ + -e 's|@''REPLACE_POSIX_MEMALIGN''@|$(REPLACE_POSIX_MEMALIGN)|g' \ -e 's|@''REPLACE_PTSNAME''@|$(REPLACE_PTSNAME)|g' \ -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \ -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ @@ -2249,6 +2533,24 @@ ## end gnulib module stpcpy +## begin gnulib module strcase + + +EXTRA_DIST += lib/strcasecmp.c lib/strncasecmp.c + +EXTRA_lib_libdatamash_a_SOURCES += lib/strcasecmp.c lib/strncasecmp.c + +## end gnulib module strcase + +## begin gnulib module strdup-posix + + +EXTRA_DIST += lib/strdup.c + +EXTRA_lib_libdatamash_a_SOURCES += lib/strdup.c + +## end gnulib module strdup-posix + ## begin gnulib module streq @@ -2332,14 +2634,18 @@ -e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \ -e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \ -e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \ + -e 's/@''GNULIB_STRERRORNAME_NP''@/$(GNULIB_STRERRORNAME_NP)/g' \ + -e 's/@''GNULIB_SIGABBREV_NP''@/$(GNULIB_SIGABBREV_NP)/g' \ + -e 's/@''GNULIB_SIGDESCR_NP''@/$(GNULIB_SIGDESCR_NP)/g' \ -e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \ -e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \ + -e 's/@''GNULIB_MDA_MEMCCPY''@/$(GNULIB_MDA_MEMCCPY)/g' \ + -e 's/@''GNULIB_MDA_STRDUP''@/$(GNULIB_MDA_STRDUP)/g' \ < $(top_srcdir)/lib/string.in.h | \ sed -e 's|@''HAVE_EXPLICIT_BZERO''@|$(HAVE_EXPLICIT_BZERO)|g' \ -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \ -e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \ -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \ - -e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|g' \ -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \ -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \ -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \ @@ -2355,8 +2661,12 @@ -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \ -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \ -e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \ + -e 's|@''HAVE_STRERRORNAME_NP''@|$(HAVE_STRERRORNAME_NP)|g' \ + -e 's|@''HAVE_SIGABBREV_NP''@|$(HAVE_SIGABBREV_NP)|g' \ + -e 's|@''HAVE_SIGDESCR_NP''@|$(HAVE_SIGDESCR_NP)|g' \ -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \ -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \ + -e 's|@''REPLACE_FFSLL''@|$(REPLACE_FFSLL)|g' \ -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \ -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \ -e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \ @@ -2370,6 +2680,7 @@ -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \ -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \ -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \ + -e 's|@''REPLACE_STRERRORNAME_NP''@|$(REPLACE_STRERRORNAME_NP)|g' \ -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \ -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ @@ -2384,6 +2695,37 @@ ## end gnulib module string +## begin gnulib module strings + +BUILT_SOURCES += lib/strings.h + +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +lib/strings.h: lib/strings.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_STRINGS_H''@|$(HAVE_STRINGS_H)|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_STRINGS_H''@|$(NEXT_STRINGS_H)|g' \ + -e 's/@''GNULIB_FFS''@/$(GNULIB_FFS)/g' \ + -e 's|@''HAVE_FFS''@|$(HAVE_FFS)|g' \ + -e 's|@''HAVE_STRCASECMP''@|$(HAVE_STRCASECMP)|g' \ + -e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(top_srcdir)/lib/strings.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += lib/strings.h lib/strings.h-t + +EXTRA_DIST += lib/strings.in.h + +## end gnulib module strings + ## begin gnulib module strndup @@ -2417,6 +2759,33 @@ ## end gnulib module strsep +## begin gnulib module strtod + + +EXTRA_DIST += lib/strtod.c + +EXTRA_lib_libdatamash_a_SOURCES += lib/strtod.c + +## end gnulib module strtod + +## begin gnulib module strtold + + +EXTRA_DIST += lib/strtod.c lib/strtold.c + +EXTRA_lib_libdatamash_a_SOURCES += lib/strtod.c lib/strtold.c + +## end gnulib module strtold + +## begin gnulib module strtoll + + +EXTRA_DIST += lib/strtol.c lib/strtoll.c + +EXTRA_lib_libdatamash_a_SOURCES += lib/strtol.c lib/strtoll.c + +## end gnulib module strtoll + ## begin gnulib module strtoull @@ -2508,8 +2877,10 @@ -e 's/@''GNULIB_FSTAT''@/$(GNULIB_FSTAT)/g' \ -e 's/@''GNULIB_FSTATAT''@/$(GNULIB_FSTATAT)/g' \ -e 's/@''GNULIB_FUTIMENS''@/$(GNULIB_FUTIMENS)/g' \ + -e 's/@''GNULIB_GETUMASK''@/$(GNULIB_GETUMASK)/g' \ -e 's/@''GNULIB_LCHMOD''@/$(GNULIB_LCHMOD)/g' \ -e 's/@''GNULIB_LSTAT''@/$(GNULIB_LSTAT)/g' \ + -e 's/@''GNULIB_MKDIR''@/$(GNULIB_MKDIR)/g' \ -e 's/@''GNULIB_MKDIRAT''@/$(GNULIB_MKDIRAT)/g' \ -e 's/@''GNULIB_MKFIFO''@/$(GNULIB_MKFIFO)/g' \ -e 's/@''GNULIB_MKFIFOAT''@/$(GNULIB_MKFIFOAT)/g' \ @@ -2518,9 +2889,13 @@ -e 's/@''GNULIB_STAT''@/$(GNULIB_STAT)/g' \ -e 's/@''GNULIB_UTIMENSAT''@/$(GNULIB_UTIMENSAT)/g' \ -e 's/@''GNULIB_OVERRIDES_STRUCT_STAT''@/$(GNULIB_OVERRIDES_STRUCT_STAT)/g' \ + -e 's/@''GNULIB_MDA_CHMOD''@/$(GNULIB_MDA_CHMOD)/g' \ + -e 's/@''GNULIB_MDA_MKDIR''@/$(GNULIB_MDA_MKDIR)/g' \ + -e 's/@''GNULIB_MDA_UMASK''@/$(GNULIB_MDA_UMASK)/g' \ -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \ -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \ -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \ + -e 's|@''HAVE_GETUMASK''@|$(HAVE_GETUMASK)|g' \ -e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \ -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \ -e 's|@''HAVE_MKDIRAT''@|$(HAVE_MKDIRAT)|g' \ @@ -2536,7 +2911,9 @@ -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \ -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \ -e 's|@''REPLACE_MKFIFO''@|$(REPLACE_MKFIFO)|g' \ + -e 's|@''REPLACE_MKFIFOAT''@|$(REPLACE_MKFIFOAT)|g' \ -e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \ + -e 's|@''REPLACE_MKNODAT''@|$(REPLACE_MKNODAT)|g' \ -e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \ -e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ @@ -2604,6 +2981,47 @@ ## end gnulib module sys_uio +## begin gnulib module sys_wait + +BUILT_SOURCES += lib/sys/wait.h + +# We need the following in order to create when the system +# has one that is incomplete. +lib/sys/wait.h: lib/sys_wait.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) + $(AM_V_at)$(MKDIR_P) lib/sys + $(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_SYS_WAIT_H''@|$(NEXT_SYS_WAIT_H)|g' \ + -e 's/@''GNULIB_WAITPID''@/$(GNULIB_WAITPID)/g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(top_srcdir)/lib/sys_wait.in.h; \ + } > $@-t && \ + mv $@-t $@ +MOSTLYCLEANFILES += lib/sys/wait.h lib/sys/wait.h-t +MOSTLYCLEANDIRS += lib/sys + +EXTRA_DIST += lib/sys_wait.in.h + +## end gnulib module sys_wait + +## begin gnulib module thread-optim + + +EXTRA_DIST += lib/thread-optim.h + +## end gnulib module thread-optim + +## begin gnulib module threadlib + +lib_libdatamash_a_SOURCES += lib/glthread/threadlib.c + +## end gnulib module threadlib + ## begin gnulib module time BUILT_SOURCES += lib/time.h @@ -2625,15 +3043,17 @@ -e 's/@''GNULIB_STRFTIME''@/$(GNULIB_STRFTIME)/g' \ -e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \ -e 's/@''GNULIB_TIMEGM''@/$(GNULIB_TIMEGM)/g' \ + -e 's/@''GNULIB_TIMESPEC_GET''@/$(GNULIB_TIMESPEC_GET)/g' \ -e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \ -e 's/@''GNULIB_TIME_RZ''@/$(GNULIB_TIME_RZ)/g' \ -e 's/@''GNULIB_TZSET''@/$(GNULIB_TZSET)/g' \ + -e 's/@''GNULIB_MDA_TZSET''@/$(GNULIB_MDA_TZSET)/g' \ -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \ -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \ -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \ -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \ + -e 's|@''HAVE_TIMESPEC_GET''@|$(HAVE_TIMESPEC_GET)|g' \ -e 's|@''HAVE_TIMEZONE_T''@|$(HAVE_TIMEZONE_T)|g' \ - -e 's|@''HAVE_TZSET''@|$(HAVE_TZSET)|g' \ -e 's|@''REPLACE_CTIME''@|$(REPLACE_CTIME)|g' \ -e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \ -e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \ @@ -2647,6 +3067,7 @@ -e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ -e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ -e 's|@''UNISTD_H_DEFINES_STRUCT_TIMESPEC''@|$(UNISTD_H_DEFINES_STRUCT_TIMESPEC)|g' \ + -e 's|@''TIME_H_DEFINES_TIME_UTC''@|$(TIME_H_DEFINES_TIME_UTC)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ @@ -2720,6 +3141,13 @@ -e 's/@''GNULIB_DUP3''@/$(GNULIB_DUP3)/g' \ -e 's/@''GNULIB_ENVIRON''@/$(GNULIB_ENVIRON)/g' \ -e 's/@''GNULIB_EUIDACCESS''@/$(GNULIB_EUIDACCESS)/g' \ + -e 's/@''GNULIB_EXECL''@/$(GNULIB_EXECL)/g' \ + -e 's/@''GNULIB_EXECLE''@/$(GNULIB_EXECLE)/g' \ + -e 's/@''GNULIB_EXECLP''@/$(GNULIB_EXECLP)/g' \ + -e 's/@''GNULIB_EXECV''@/$(GNULIB_EXECV)/g' \ + -e 's/@''GNULIB_EXECVE''@/$(GNULIB_EXECVE)/g' \ + -e 's/@''GNULIB_EXECVP''@/$(GNULIB_EXECVP)/g' \ + -e 's/@''GNULIB_EXECVPE''@/$(GNULIB_EXECVPE)/g' \ -e 's/@''GNULIB_FACCESSAT''@/$(GNULIB_FACCESSAT)/g' \ -e 's/@''GNULIB_FCHDIR''@/$(GNULIB_FCHDIR)/g' \ -e 's/@''GNULIB_FCHOWNAT''@/$(GNULIB_FCHOWNAT)/g' \ @@ -2729,6 +3157,7 @@ -e 's/@''GNULIB_GETCWD''@/$(GNULIB_GETCWD)/g' \ -e 's/@''GNULIB_GETDOMAINNAME''@/$(GNULIB_GETDOMAINNAME)/g' \ -e 's/@''GNULIB_GETDTABLESIZE''@/$(GNULIB_GETDTABLESIZE)/g' \ + -e 's/@''GNULIB_GETENTROPY''@/$(GNULIB_GETENTROPY)/g' \ -e 's/@''GNULIB_GETGROUPS''@/$(GNULIB_GETGROUPS)/g' \ -e 's/@''GNULIB_GETHOSTNAME''@/$(GNULIB_GETHOSTNAME)/g' \ -e 's/@''GNULIB_GETLOGIN''@/$(GNULIB_GETLOGIN)/g' \ @@ -2764,12 +3193,33 @@ -e 's/@''GNULIB_UNLINKAT''@/$(GNULIB_UNLINKAT)/g' \ -e 's/@''GNULIB_USLEEP''@/$(GNULIB_USLEEP)/g' \ -e 's/@''GNULIB_WRITE''@/$(GNULIB_WRITE)/g' \ + -e 's/@''GNULIB_MDA_ACCESS''@/$(GNULIB_MDA_ACCESS)/g' \ + -e 's/@''GNULIB_MDA_CHDIR''@/$(GNULIB_MDA_CHDIR)/g' \ + -e 's/@''GNULIB_MDA_CLOSE''@/$(GNULIB_MDA_CLOSE)/g' \ + -e 's/@''GNULIB_MDA_DUP''@/$(GNULIB_MDA_DUP)/g' \ + -e 's/@''GNULIB_MDA_DUP2''@/$(GNULIB_MDA_DUP2)/g' \ + -e 's/@''GNULIB_MDA_EXECL''@/$(GNULIB_MDA_EXECL)/g' \ + -e 's/@''GNULIB_MDA_EXECLE''@/$(GNULIB_MDA_EXECLE)/g' \ + -e 's/@''GNULIB_MDA_EXECLP''@/$(GNULIB_MDA_EXECLP)/g' \ + -e 's/@''GNULIB_MDA_EXECV''@/$(GNULIB_MDA_EXECV)/g' \ + -e 's/@''GNULIB_MDA_EXECVE''@/$(GNULIB_MDA_EXECVE)/g' \ + -e 's/@''GNULIB_MDA_EXECVP''@/$(GNULIB_MDA_EXECVP)/g' \ + -e 's/@''GNULIB_MDA_EXECVPE''@/$(GNULIB_MDA_EXECVPE)/g' \ + -e 's/@''GNULIB_MDA_GETCWD''@/$(GNULIB_MDA_GETCWD)/g' \ + -e 's/@''GNULIB_MDA_GETPID''@/$(GNULIB_MDA_GETPID)/g' \ + -e 's/@''GNULIB_MDA_ISATTY''@/$(GNULIB_MDA_ISATTY)/g' \ + -e 's/@''GNULIB_MDA_LSEEK''@/$(GNULIB_MDA_LSEEK)/g' \ + -e 's/@''GNULIB_MDA_READ''@/$(GNULIB_MDA_READ)/g' \ + -e 's/@''GNULIB_MDA_RMDIR''@/$(GNULIB_MDA_RMDIR)/g' \ + -e 's/@''GNULIB_MDA_SWAB''@/$(GNULIB_MDA_SWAB)/g' \ + -e 's/@''GNULIB_MDA_UNLINK''@/$(GNULIB_MDA_UNLINK)/g' \ + -e 's/@''GNULIB_MDA_WRITE''@/$(GNULIB_MDA_WRITE)/g' \ < $(top_srcdir)/lib/unistd.in.h | \ sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \ -e 's|@''HAVE_COPY_FILE_RANGE''@|$(HAVE_COPY_FILE_RANGE)|g' \ - -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \ -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \ + -e 's|@''HAVE_EXECVPE''@|$(HAVE_EXECVPE)|g' \ -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \ -e 's|@''HAVE_FCHDIR''@|$(HAVE_FCHDIR)|g' \ -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \ @@ -2777,6 +3227,7 @@ -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \ -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \ + -e 's|@''HAVE_GETENTROPY''@|$(HAVE_GETENTROPY)|g' \ -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \ -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ @@ -2798,6 +3249,7 @@ -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \ -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \ -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ + -e 's|@''HAVE_DECL_EXECVPE''@|$(HAVE_DECL_EXECVPE)|g' \ -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' \ @@ -2816,6 +3268,13 @@ -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \ -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \ -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \ + -e 's|@''REPLACE_EXECL''@|$(REPLACE_EXECL)|g' \ + -e 's|@''REPLACE_EXECLE''@|$(REPLACE_EXECLE)|g' \ + -e 's|@''REPLACE_EXECLP''@|$(REPLACE_EXECLP)|g' \ + -e 's|@''REPLACE_EXECV''@|$(REPLACE_EXECV)|g' \ + -e 's|@''REPLACE_EXECVE''@|$(REPLACE_EXECVE)|g' \ + -e 's|@''REPLACE_EXECVP''@|$(REPLACE_EXECVP)|g' \ + -e 's|@''REPLACE_EXECVPE''@|$(REPLACE_EXECVPE)|g' \ -e 's|@''REPLACE_FACCESSAT''@|$(REPLACE_FACCESSAT)|g' \ -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \ -e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \ @@ -2846,6 +3305,7 @@ -e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \ -e 's|@''REPLACE_USLEEP''@|$(REPLACE_USLEEP)|g' \ -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \ + -e 's|@''UNISTD_H_HAVE_SYS_RANDOM_H''@|$(UNISTD_H_HAVE_SYS_RANDOM_H)|g' \ -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \ -e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ @@ -2954,6 +3414,15 @@ ## end gnulib module useless-if-before-free +## begin gnulib module vasnprintf + + +EXTRA_DIST += lib/asnprintf.c lib/float+.h lib/printf-args.c lib/printf-args.h lib/printf-parse.c lib/printf-parse.h lib/vasnprintf.c lib/vasnprintf.h + +EXTRA_lib_libdatamash_a_SOURCES += lib/asnprintf.c lib/printf-args.c lib/printf-parse.c lib/vasnprintf.c + +## end gnulib module vasnprintf + ## begin gnulib module vc-list-files @@ -2974,6 +3443,15 @@ ## end gnulib module version-etc +## begin gnulib module waitpid + + +EXTRA_DIST += lib/waitpid.c + +EXTRA_lib_libdatamash_a_SOURCES += lib/waitpid.c + +## end gnulib module waitpid + ## begin gnulib module wchar BUILT_SOURCES += lib/wchar.h @@ -3007,6 +3485,7 @@ -e 's/@''GNULIB_WMEMCMP''@/$(GNULIB_WMEMCMP)/g' \ -e 's/@''GNULIB_WMEMCPY''@/$(GNULIB_WMEMCPY)/g' \ -e 's/@''GNULIB_WMEMMOVE''@/$(GNULIB_WMEMMOVE)/g' \ + -e 's/@''GNULIB_WMEMPCPY''@/$(GNULIB_WMEMPCPY)/g' \ -e 's/@''GNULIB_WMEMSET''@/$(GNULIB_WMEMSET)/g' \ -e 's/@''GNULIB_WCSLEN''@/$(GNULIB_WCSLEN)/g' \ -e 's/@''GNULIB_WCSNLEN''@/$(GNULIB_WCSNLEN)/g' \ @@ -3032,6 +3511,7 @@ -e 's/@''GNULIB_WCSTOK''@/$(GNULIB_WCSTOK)/g' \ -e 's/@''GNULIB_WCSWIDTH''@/$(GNULIB_WCSWIDTH)/g' \ -e 's/@''GNULIB_WCSFTIME''@/$(GNULIB_WCSFTIME)/g' \ + -e 's/@''GNULIB_MDA_WCSDUP''@/$(GNULIB_MDA_WCSDUP)/g' \ < $(top_srcdir)/lib/wchar.in.h | \ sed -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \ -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \ @@ -3047,6 +3527,7 @@ -e 's|@''HAVE_WMEMCMP''@|$(HAVE_WMEMCMP)|g' \ -e 's|@''HAVE_WMEMCPY''@|$(HAVE_WMEMCPY)|g' \ -e 's|@''HAVE_WMEMMOVE''@|$(HAVE_WMEMMOVE)|g' \ + -e 's|@''HAVE_WMEMPCPY''@|$(HAVE_WMEMPCPY)|g' \ -e 's|@''HAVE_WMEMSET''@|$(HAVE_WMEMSET)|g' \ -e 's|@''HAVE_WCSLEN''@|$(HAVE_WCSLEN)|g' \ -e 's|@''HAVE_WCSNLEN''@|$(HAVE_WCSNLEN)|g' \ @@ -3073,6 +3554,7 @@ -e 's|@''HAVE_WCSWIDTH''@|$(HAVE_WCSWIDTH)|g' \ -e 's|@''HAVE_WCSFTIME''@|$(HAVE_WCSFTIME)|g' \ -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \ + -e 's|@''HAVE_DECL_WCSDUP''@|$(HAVE_DECL_WCSDUP)|g' \ -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \ | \ sed -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \ @@ -3156,6 +3638,42 @@ ## end gnulib module wcwidth +## begin gnulib module windows-mutex + + +EXTRA_DIST += lib/windows-initguard.h lib/windows-mutex.c lib/windows-mutex.h + +EXTRA_lib_libdatamash_a_SOURCES += lib/windows-mutex.c + +## end gnulib module windows-mutex + +## begin gnulib module windows-once + + +EXTRA_DIST += lib/windows-once.c lib/windows-once.h + +EXTRA_lib_libdatamash_a_SOURCES += lib/windows-once.c + +## end gnulib module windows-once + +## begin gnulib module windows-recmutex + + +EXTRA_DIST += lib/windows-initguard.h lib/windows-recmutex.c lib/windows-recmutex.h + +EXTRA_lib_libdatamash_a_SOURCES += lib/windows-recmutex.c + +## end gnulib module windows-recmutex + +## begin gnulib module windows-rwlock + + +EXTRA_DIST += lib/windows-initguard.h lib/windows-rwlock.c lib/windows-rwlock.h + +EXTRA_lib_libdatamash_a_SOURCES += lib/windows-rwlock.c + +## end gnulib module windows-rwlock + ## begin gnulib module xalloc lib_libdatamash_a_SOURCES += lib/xmalloc.c @@ -3168,6 +3686,8 @@ lib_libdatamash_a_SOURCES += lib/xalloc-die.c +EXTRA_DIST += lib/xalloc.h + ## end gnulib module xalloc-die ## begin gnulib module xalloc-oversized @@ -3177,6 +3697,12 @@ ## end gnulib module xalloc-oversized +## begin gnulib module xsize + +lib_libdatamash_a_SOURCES += lib/xsize.h lib/xsize.c + +## end gnulib module xsize + ## begin gnulib module xstriconv lib_libdatamash_a_SOURCES += lib/xstriconv.h lib/xstriconv.c diff -Nru datamash-1.7/lib/hard-locale.c datamash-1.8/lib/hard-locale.c --- datamash-1.7/lib/hard-locale.c 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/hard-locale.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* hard-locale.c -- Determine whether a locale is hard. - Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2020 Free Software + Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.7/lib/hard-locale.h datamash-1.8/lib/hard-locale.h --- datamash-1.7/lib/hard-locale.h 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/hard-locale.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* Determine whether a locale is hard. - Copyright (C) 1999, 2003-2004, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 1999, 2003-2004, 2009-2021 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.7/lib/hash.c datamash-1.8/lib/hash.c --- datamash-1.7/lib/hash.c 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/hash.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* hash - hashing table processing. - Copyright (C) 1998-2004, 2006-2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 1998-2004, 2006-2007, 2009-2021 Free Software Foundation, Inc. Written by Jim Meyering, 1992. @@ -138,38 +138,24 @@ /* Information and lookup. */ -/* The following few functions provide information about the overall hash - table organization: the number of entries, number of buckets and maximum - length of buckets. */ - -/* Return the number of buckets in the hash table. The table size, the total - number of buckets (used plus unused), or the maximum number of slots, are - the same quantity. */ - size_t hash_get_n_buckets (const Hash_table *table) { return table->n_buckets; } -/* Return the number of slots in use (non-empty buckets). */ - size_t hash_get_n_buckets_used (const Hash_table *table) { return table->n_buckets_used; } -/* Return the number of active entries. */ - size_t hash_get_n_entries (const Hash_table *table) { return table->n_entries; } -/* Return the length of the longest chain (bucket). */ - size_t hash_get_max_bucket_length (const Hash_table *table) { @@ -194,9 +180,6 @@ return max_bucket_length; } -/* Do a mild validation of a hash table, by traversing it and checking two - statistics. */ - bool hash_table_ok (const Hash_table *table) { @@ -254,9 +237,6 @@ return table->bucket + n; } -/* If ENTRY matches an entry already in the hash table, return the - entry from the table. Otherwise, return NULL. */ - void * hash_lookup (const Hash_table *table, const void *entry) { @@ -275,15 +255,6 @@ /* Walking. */ -/* The functions in this page traverse the hash table and process the - contained entries. For the traversal to work properly, the hash table - should not be resized nor modified while any particular entry is being - processed. In particular, entries should not be added, and an entry - may be removed only if there is no shrink threshold and the entry being - removed has already been passed to hash_get_next. */ - -/* Return the first data in the table, or NULL if the table is empty. */ - void * hash_get_first (const Hash_table *table) { @@ -299,10 +270,6 @@ return bucket->data; } -/* Return the user data for the entry following ENTRY, where ENTRY has been - returned by a previous call to either 'hash_get_first' or 'hash_get_next'. - Return NULL if there are no more entries. */ - void * hash_get_next (const Hash_table *table, const void *entry) { @@ -328,10 +295,6 @@ return NULL; } -/* Fill BUFFER with pointers to active user entries in the hash table, then - return the number of pointers copied. Do not copy more than BUFFER_SIZE - pointers. */ - size_t hash_get_entries (const Hash_table *table, void **buffer, size_t buffer_size) @@ -356,14 +319,6 @@ return counter; } -/* Call a PROCESSOR function for each entry of a hash table, and return the - number of entries for which the processor function returned success. A - pointer to some PROCESSOR_DATA which will be made available to each call to - the processor function. The PROCESSOR accepts two arguments: the first is - the user entry being walked into, the second is the value of PROCESSOR_DATA - as received. The walking continue for as long as the PROCESSOR function - returns nonzero. When it returns zero, the walking is interrupted. */ - size_t hash_do_for_each (const Hash_table *table, Hash_processor processor, void *processor_data) @@ -390,9 +345,6 @@ /* Allocation and clean-up. */ -/* Return a hash index for a NUL-terminated STRING between 0 and N_BUCKETS-1. - This is a convenience routine for constructing other hashing functions. */ - #if USE_DIFF_HASH /* About hashings, Paul Eggert writes to me (FP), on 1994-01-01: "Please see @@ -546,7 +498,7 @@ if (!tuning->is_n_buckets) { float new_candidate = candidate / tuning->growth_threshold; - if (SIZE_MAX <= new_candidate) + if ((float) SIZE_MAX <= new_candidate) return 0; candidate = new_candidate; } @@ -556,40 +508,6 @@ return candidate; } -/* Allocate and return a new hash table, or NULL upon failure. The initial - number of buckets is automatically selected so as to _guarantee_ that you - may insert at least CANDIDATE different user entries before any growth of - the hash table size occurs. So, if have a reasonably tight a-priori upper - bound on the number of entries you intend to insert in the hash table, you - may save some table memory and insertion time, by specifying it here. If - the IS_N_BUCKETS field of the TUNING structure is true, the CANDIDATE - argument has its meaning changed to the wanted number of buckets. - - TUNING points to a structure of user-supplied values, in case some fine - tuning is wanted over the default behavior of the hasher. If TUNING is - NULL, the default tuning parameters are used instead. If TUNING is - provided but the values requested are out of bounds or might cause - rounding errors, return NULL. - - The user-supplied HASHER function, when not NULL, accepts two - arguments ENTRY and TABLE_SIZE. It computes, by hashing ENTRY contents, a - slot number for that entry which should be in the range 0..TABLE_SIZE-1. - This slot number is then returned. - - The user-supplied COMPARATOR function, when not NULL, accepts two - arguments pointing to user data, it then returns true for a pair of entries - that compare equal, or false otherwise. This function is internally called - on entries which are already known to hash to the same bucket index, - but which are distinct pointers. - - The user-supplied DATA_FREER function, when not NULL, may be later called - with the user data as an argument, just before the entry containing the - data gets freed. This happens from within 'hash_free' or 'hash_clear'. - You should specify this function only if you want these functions to free - all of your 'data' data. This is typically the case when your data is - simply an auxiliary struct that you have malloc'd to aggregate several - values. */ - Hash_table * hash_initialize (size_t candidate, const Hash_tuning *tuning, Hash_hasher hasher, Hash_comparator comparator, @@ -645,10 +563,6 @@ return NULL; } -/* Make all buckets empty, placing any chained entries on the free list. - Apply the user-specified function data_freer (if any) to the datas of any - affected entries. */ - void hash_clear (Hash_table *table) { @@ -687,11 +601,6 @@ table->n_entries = 0; } -/* Reclaim all storage associated with a hash table. If a data_freer - function has been supplied by the user when the hash table was created, - this function applies it to the data of each entry before freeing that - entry. */ - void hash_free (Hash_table *table) { @@ -931,14 +840,6 @@ return true; } -/* For an already existing hash table, change the number of buckets through - specifying CANDIDATE. The contents of the hash table are preserved. The - new number of buckets is automatically selected so as to _guarantee_ that - the table may receive at least CANDIDATE different user entries, including - those already in the table, before any other growth of the hash table size - occurs. If TUNING->IS_N_BUCKETS is true, then CANDIDATE specifies the - exact number of buckets desired. Return true iff the rehash succeeded. */ - bool hash_rehash (Hash_table *table, size_t candidate) { @@ -1018,22 +919,6 @@ return false; } -/* Insert ENTRY into hash TABLE if there is not already a matching entry. - - Return -1 upon memory allocation failure. - Return 1 if insertion succeeded. - Return 0 if there is already a matching entry in the table, - and in that case, if MATCHED_ENT is non-NULL, set *MATCHED_ENT - to that entry. - - This interface is easier to use than hash_insert when you must - distinguish between the latter two cases. More importantly, - hash_insert is unusable for some types of ENTRY values. When using - hash_insert, the only way to distinguish those cases is to compare - the return value and ENTRY. That works only when you can have two - different ENTRY values that point to data that compares "equal". Thus, - when the ENTRY value is a simple scalar, you must use - hash_insert_if_absent. ENTRY must not be NULL. */ int hash_insert_if_absent (Hash_table *table, void const *entry, void const **matched_ent) @@ -1076,7 +961,7 @@ : (table->n_buckets * tuning->growth_factor * tuning->growth_threshold)); - if (SIZE_MAX <= candidate) + if ((float) SIZE_MAX <= candidate) return -1; /* If the rehash fails, arrange to return NULL. */ @@ -1116,12 +1001,6 @@ return 1; } -/* If ENTRY matches an entry already in the hash table, return the pointer - to the entry from the table. Otherwise, insert ENTRY and return ENTRY. - Return NULL if the storage required for insertion cannot be allocated. - This implementation does not support duplicate entries or insertion of - NULL. */ - void * hash_insert (Hash_table *table, void const *entry) { @@ -1132,12 +1011,8 @@ : (void *) (err == 0 ? matched_ent : entry)); } -/* If ENTRY is already in the table, remove it and return the just-deleted - data (the user may want to deallocate its storage). If ENTRY is not in the - table, don't modify the table and return NULL. */ - void * -hash_delete (Hash_table *table, const void *entry) +hash_remove (Hash_table *table, const void *entry) { void *data; struct hash_entry *bucket; @@ -1196,6 +1071,12 @@ return data; } +void * +hash_delete (Hash_table *table, const void *entry) +{ + return hash_remove (table, entry); +} + /* Testing. */ #if TESTING diff -Nru datamash-1.7/lib/hash.h datamash-1.8/lib/hash.h --- datamash-1.7/lib/hash.h 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/hash.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* hash - hashing table processing. - Copyright (C) 1998-1999, 2001, 2003, 2009-2020 Free Software Foundation, + Copyright (C) 1998-1999, 2001, 2003, 2009-2021 Free Software Foundation, Inc. Written by Jim Meyering , 1998. @@ -27,29 +27,10 @@ # include # include -/* The __attribute__ feature is available in gcc versions 2.5 and later. - The warn_unused_result attribute appeared first in gcc-3.4.0. */ -# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) -# define _GL_ATTRIBUTE_WUR __attribute__ ((__warn_unused_result__)) -# else -# define _GL_ATTRIBUTE_WUR /* empty */ +# ifdef __cplusplus +extern "C" { # endif -# ifndef _GL_ATTRIBUTE_DEPRECATED -/* The __attribute__((__deprecated__)) feature - is available in gcc versions 3.1 and newer. */ -# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 1) -# define _GL_ATTRIBUTE_DEPRECATED /* empty */ -# else -# define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__)) -# endif -# endif - -typedef size_t (*Hash_hasher) (const void *, size_t); -typedef bool (*Hash_comparator) (const void *, const void *); -typedef void (*Hash_data_freer) (void *); -typedef bool (*Hash_processor) (void *, void *); - struct hash_tuning { /* This structure is mainly used for 'hash_initialize', see the block @@ -68,39 +49,213 @@ typedef struct hash_table Hash_table; -/* Information and lookup. */ -size_t hash_get_n_buckets (const Hash_table *) _GL_ATTRIBUTE_PURE; -size_t hash_get_n_buckets_used (const Hash_table *) _GL_ATTRIBUTE_PURE; -size_t hash_get_n_entries (const Hash_table *) _GL_ATTRIBUTE_PURE; -size_t hash_get_max_bucket_length (const Hash_table *) _GL_ATTRIBUTE_PURE; -bool hash_table_ok (const Hash_table *) _GL_ATTRIBUTE_PURE; -void hash_print_statistics (const Hash_table *, FILE *); -void *hash_lookup (const Hash_table *, const void *); - -/* Walking. */ -void *hash_get_first (const Hash_table *) _GL_ATTRIBUTE_PURE; -void *hash_get_next (const Hash_table *, const void *); -size_t hash_get_entries (const Hash_table *, void **, size_t); -size_t hash_do_for_each (const Hash_table *, Hash_processor, void *); - -/* Allocation and clean-up. */ -size_t hash_string (const char *, size_t) _GL_ATTRIBUTE_PURE; -void hash_reset_tuning (Hash_tuning *); -Hash_table *hash_initialize (size_t, const Hash_tuning *, - Hash_hasher, Hash_comparator, - Hash_data_freer) _GL_ATTRIBUTE_WUR; -Hash_table *hash_xinitialize (size_t, const Hash_tuning *, - Hash_hasher, Hash_comparator, - Hash_data_freer) _GL_ATTRIBUTE_WUR; -void hash_clear (Hash_table *); -void hash_free (Hash_table *); - -/* Insertion and deletion. */ -bool hash_rehash (Hash_table *, size_t) _GL_ATTRIBUTE_WUR; -void *hash_insert (Hash_table *, const void *) _GL_ATTRIBUTE_WUR; - -int hash_insert_if_absent (Hash_table *table, const void *entry, - const void **matched_ent); -void *hash_delete (Hash_table *, const void *); +/* + * Information and lookup. + */ + +/* The following few functions provide information about the overall hash + table organization: the number of entries, number of buckets and maximum + length of buckets. */ + +/* Return the number of buckets in the hash table. The table size, the total + number of buckets (used plus unused), or the maximum number of slots, are + the same quantity. */ +extern size_t hash_get_n_buckets (const Hash_table *table) + _GL_ATTRIBUTE_PURE; + +/* Return the number of slots in use (non-empty buckets). */ +extern size_t hash_get_n_buckets_used (const Hash_table *table) + _GL_ATTRIBUTE_PURE; + +/* Return the number of active entries. */ +extern size_t hash_get_n_entries (const Hash_table *table) + _GL_ATTRIBUTE_PURE; + +/* Return the length of the longest chain (bucket). */ +extern size_t hash_get_max_bucket_length (const Hash_table *table) + _GL_ATTRIBUTE_PURE; + +/* Do a mild validation of a hash table, by traversing it and checking two + statistics. */ +extern bool hash_table_ok (const Hash_table *table) + _GL_ATTRIBUTE_PURE; + +extern void hash_print_statistics (const Hash_table *table, FILE *stream); + +/* If ENTRY matches an entry already in the hash table, return the + entry from the table. Otherwise, return NULL. */ +extern void *hash_lookup (const Hash_table *table, const void *entry); + +/* + * Walking. + */ + +/* The functions in this page traverse the hash table and process the + contained entries. For the traversal to work properly, the hash table + should not be resized nor modified while any particular entry is being + processed. In particular, entries should not be added, and an entry + may be removed only if there is no shrink threshold and the entry being + removed has already been passed to hash_get_next. */ + +/* Return the first data in the table, or NULL if the table is empty. */ +extern void *hash_get_first (const Hash_table *table) + _GL_ATTRIBUTE_PURE; + +/* Return the user data for the entry following ENTRY, where ENTRY has been + returned by a previous call to either 'hash_get_first' or 'hash_get_next'. + Return NULL if there are no more entries. */ +extern void *hash_get_next (const Hash_table *table, const void *entry); + +/* Fill BUFFER with pointers to active user entries in the hash table, then + return the number of pointers copied. Do not copy more than BUFFER_SIZE + pointers. */ +extern size_t hash_get_entries (const Hash_table *table, void **buffer, + size_t buffer_size); + +typedef bool (*Hash_processor) (void *entry, void *processor_data); + +/* Call a PROCESSOR function for each entry of a hash table, and return the + number of entries for which the processor function returned success. A + pointer to some PROCESSOR_DATA which will be made available to each call to + the processor function. The PROCESSOR accepts two arguments: the first is + the user entry being walked into, the second is the value of PROCESSOR_DATA + as received. The walking continue for as long as the PROCESSOR function + returns nonzero. When it returns zero, the walking is interrupted. */ +extern size_t hash_do_for_each (const Hash_table *table, + Hash_processor processor, void *processor_data); + +/* + * Allocation and clean-up. + */ + +/* Return a hash index for a NUL-terminated STRING between 0 and N_BUCKETS-1. + This is a convenience routine for constructing other hashing functions. */ +extern size_t hash_string (const char *string, size_t n_buckets) + _GL_ATTRIBUTE_PURE; + +extern void hash_reset_tuning (Hash_tuning *tuning); + +typedef size_t (*Hash_hasher) (const void *entry, size_t table_size); +typedef bool (*Hash_comparator) (const void *entry1, const void *entry2); +typedef void (*Hash_data_freer) (void *entry); + +/* Allocate and return a new hash table, or NULL upon failure. The initial + number of buckets is automatically selected so as to _guarantee_ that you + may insert at least CANDIDATE different user entries before any growth of + the hash table size occurs. So, if have a reasonably tight a-priori upper + bound on the number of entries you intend to insert in the hash table, you + may save some table memory and insertion time, by specifying it here. If + the IS_N_BUCKETS field of the TUNING structure is true, the CANDIDATE + argument has its meaning changed to the wanted number of buckets. + + TUNING points to a structure of user-supplied values, in case some fine + tuning is wanted over the default behavior of the hasher. If TUNING is + NULL, the default tuning parameters are used instead. If TUNING is + provided but the values requested are out of bounds or might cause + rounding errors, return NULL. + + The user-supplied HASHER function, when not NULL, accepts two + arguments ENTRY and TABLE_SIZE. It computes, by hashing ENTRY contents, a + slot number for that entry which should be in the range 0..TABLE_SIZE-1. + This slot number is then returned. + + The user-supplied COMPARATOR function, when not NULL, accepts two + arguments pointing to user data, it then returns true for a pair of entries + that compare equal, or false otherwise. This function is internally called + on entries which are already known to hash to the same bucket index, + but which are distinct pointers. + + The user-supplied DATA_FREER function, when not NULL, may be later called + with the user data as an argument, just before the entry containing the + data gets freed. This happens from within 'hash_free' or 'hash_clear'. + You should specify this function only if you want these functions to free + all of your 'data' data. This is typically the case when your data is + simply an auxiliary struct that you have malloc'd to aggregate several + values. */ +extern Hash_table *hash_initialize (size_t candidate, + const Hash_tuning *tuning, + Hash_hasher hasher, + Hash_comparator comparator, + Hash_data_freer data_freer) + _GL_ATTRIBUTE_NODISCARD; + +/* Same as hash_initialize, but invokes xalloc_die on memory exhaustion. */ +/* This function is defined by module 'xhash'. */ +extern Hash_table *hash_xinitialize (size_t candidate, + const Hash_tuning *tuning, + Hash_hasher hasher, + Hash_comparator comparator, + Hash_data_freer data_freer) + _GL_ATTRIBUTE_NODISCARD; + +/* Make all buckets empty, placing any chained entries on the free list. + Apply the user-specified function data_freer (if any) to the datas of any + affected entries. */ +extern void hash_clear (Hash_table *table); + +/* Reclaim all storage associated with a hash table. If a data_freer + function has been supplied by the user when the hash table was created, + this function applies it to the data of each entry before freeing that + entry. */ +extern void hash_free (Hash_table *table); + +/* + * Insertion and deletion. + */ + +/* For an already existing hash table, change the number of buckets through + specifying CANDIDATE. The contents of the hash table are preserved. The + new number of buckets is automatically selected so as to _guarantee_ that + the table may receive at least CANDIDATE different user entries, including + those already in the table, before any other growth of the hash table size + occurs. If TUNING->IS_N_BUCKETS is true, then CANDIDATE specifies the + exact number of buckets desired. Return true iff the rehash succeeded. */ +extern bool hash_rehash (Hash_table *table, size_t candidate) + _GL_ATTRIBUTE_NODISCARD; + +/* If ENTRY matches an entry already in the hash table, return the pointer + to the entry from the table. Otherwise, insert ENTRY and return ENTRY. + Return NULL if the storage required for insertion cannot be allocated. + This implementation does not support duplicate entries or insertion of + NULL. */ +extern void *hash_insert (Hash_table *table, const void *entry) + _GL_ATTRIBUTE_NODISCARD; + +/* Same as hash_insert, but invokes xalloc_die on memory exhaustion. */ +/* This function is defined by module 'xhash'. */ +extern void *hash_xinsert (Hash_table *table, const void *entry); + +/* Insert ENTRY into hash TABLE if there is not already a matching entry. + + Return -1 upon memory allocation failure. + Return 1 if insertion succeeded. + Return 0 if there is already a matching entry in the table, + and in that case, if MATCHED_ENT is non-NULL, set *MATCHED_ENT + to that entry. + + This interface is easier to use than hash_insert when you must + distinguish between the latter two cases. More importantly, + hash_insert is unusable for some types of ENTRY values. When using + hash_insert, the only way to distinguish those cases is to compare + the return value and ENTRY. That works only when you can have two + different ENTRY values that point to data that compares "equal". Thus, + when the ENTRY value is a simple scalar, you must use + hash_insert_if_absent. ENTRY must not be NULL. */ +extern int hash_insert_if_absent (Hash_table *table, const void *entry, + const void **matched_ent); + +/* If ENTRY is already in the table, remove it and return the just-deleted + data (the user may want to deallocate its storage). If ENTRY is not in the + table, don't modify the table and return NULL. */ +extern void *hash_remove (Hash_table *table, const void *entry); + +/* Same as hash_remove. This interface is deprecated. + FIXME: Remove in 2022. */ +extern void *hash_delete (Hash_table *table, const void *entry) + _GL_ATTRIBUTE_DEPRECATED; + +# ifdef __cplusplus +} +# endif #endif diff -Nru datamash-1.7/lib/hash-pjw-bare.c datamash-1.8/lib/hash-pjw-bare.c --- datamash-1.7/lib/hash-pjw-bare.c 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/hash-pjw-bare.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* hash-pjw-bare.c -- compute a hash value from a provided buffer. - Copyright (C) 2012-2020 Free Software Foundation, Inc. + Copyright (C) 2012-2021 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.7/lib/hash-pjw-bare.h datamash-1.8/lib/hash-pjw-bare.h --- datamash-1.7/lib/hash-pjw-bare.h 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/hash-pjw-bare.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* hash-pjw-bare.h -- declaration for a simple hash function - Copyright (C) 2012-2020 Free Software Foundation, Inc. + Copyright (C) 2012-2021 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.7/lib/hash-pjw.c datamash-1.8/lib/hash-pjw.c --- datamash-1.7/lib/hash-pjw.c 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/hash-pjw.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* hash-pjw.c -- compute a hash value from a NUL-terminated string. - Copyright (C) 2001, 2003, 2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2001, 2003, 2006, 2009-2021 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.7/lib/hash-pjw.h datamash-1.8/lib/hash-pjw.h --- datamash-1.7/lib/hash-pjw.h 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/hash-pjw.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* hash-pjw.h -- declaration for a simple hash function - Copyright (C) 2001, 2003, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2001, 2003, 2009-2021 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.7/lib/iconv.c datamash-1.8/lib/iconv.c --- datamash-1.7/lib/iconv.c 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/iconv.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Character set conversion. - Copyright (C) 1999-2001, 2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 1999-2001, 2007, 2009-2021 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.7/lib/iconv_close.c datamash-1.8/lib/iconv_close.c --- datamash-1.7/lib/iconv_close.c 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/iconv_close.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Character set conversion. - Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2021 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.7/lib/iconv.in.h datamash-1.8/lib/iconv.in.h --- datamash-1.7/lib/iconv.in.h 2020-04-23 04:03:33.000000000 +0000 +++ datamash-1.8/lib/iconv.in.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* A GNU-like . - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 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.7/lib/iconv_open-aix.gperf datamash-1.8/lib/iconv_open-aix.gperf --- datamash-1.7/lib/iconv_open-aix.gperf 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/iconv_open-aix.gperf 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Character set conversion. - Copyright (C) 2007, 2020 Free Software Foundation, Inc. + Copyright (C) 2007, 2020-2021 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.7/lib/iconv_open.c datamash-1.8/lib/iconv_open.c --- datamash-1.7/lib/iconv_open.c 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/iconv_open.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Character set conversion. - Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2021 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.7/lib/iconv_open-hpux.gperf datamash-1.8/lib/iconv_open-hpux.gperf --- datamash-1.7/lib/iconv_open-hpux.gperf 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/iconv_open-hpux.gperf 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Character set conversion. - Copyright (C) 2007, 2020 Free Software Foundation, Inc. + Copyright (C) 2007, 2020-2021 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.7/lib/iconv_open-irix.gperf datamash-1.8/lib/iconv_open-irix.gperf --- datamash-1.7/lib/iconv_open-irix.gperf 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/iconv_open-irix.gperf 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Character set conversion. - Copyright (C) 2007, 2020 Free Software Foundation, Inc. + Copyright (C) 2007, 2020-2021 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.7/lib/iconv_open-osf.gperf datamash-1.8/lib/iconv_open-osf.gperf --- datamash-1.7/lib/iconv_open-osf.gperf 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/iconv_open-osf.gperf 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Character set conversion. - Copyright (C) 2007, 2020 Free Software Foundation, Inc. + Copyright (C) 2007, 2020-2021 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.7/lib/iconv_open-solaris.gperf datamash-1.8/lib/iconv_open-solaris.gperf --- datamash-1.7/lib/iconv_open-solaris.gperf 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/iconv_open-solaris.gperf 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Character set conversion. - Copyright (C) 2007, 2009, 2020 Free Software Foundation, Inc. + Copyright (C) 2007, 2009, 2020-2021 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.7/lib/iconv_open-zos.gperf datamash-1.8/lib/iconv_open-zos.gperf --- datamash-1.7/lib/iconv_open-zos.gperf 2020-04-23 04:03:28.000000000 +0000 +++ datamash-1.8/lib/iconv_open-zos.gperf 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Character set conversion. - Copyright (C) 2019-2020 Free Software Foundation, Inc. + Copyright (C) 2019-2021 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.7/lib/ignore-value.h datamash-1.8/lib/ignore-value.h --- datamash-1.7/lib/ignore-value.h 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/ignore-value.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* ignore a function return without a compiler warning. -*- coding: utf-8 -*- - Copyright (C) 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2008-2021 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 @@ -39,8 +39,9 @@ versions 3.4 and newer have __attribute__ ((__warn_unused_result__)) which may cause unwanted diagnostics in that case. Use __typeof__ and __extension__ to work around the problem, if the workaround is - known to be needed. */ -#if 3 < __GNUC__ + (4 <= __GNUC_MINOR__) + known to be needed. + The workaround is not needed with clang. */ +#if (3 < __GNUC__ + (4 <= __GNUC_MINOR__)) && !defined __clang__ # define ignore_value(x) \ (__extension__ ({ __typeof__ (x) __x = (x); (void) __x; })) #else diff -Nru datamash-1.7/lib/inet_pton.c datamash-1.8/lib/inet_pton.c --- datamash-1.7/lib/inet_pton.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/inet_pton.c 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,268 @@ +/* inet_pton.c -- convert IPv4 and IPv6 addresses from text to binary form + + Copyright (C) 2006, 2008-2021 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 . */ + +/* + * Copyright (c) 1996,1999 by Internet Software Consortium. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS + * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE + * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + */ + +#include + +/* Specification. */ +#include + +#if HAVE_DECL_INET_PTON + +# undef inet_pton + +int +rpl_inet_pton (int af, const char *restrict src, void *restrict dst) +{ + return inet_pton (af, src, dst); +} + +#else + +# include +# include +# include + +# define NS_INADDRSZ 4 +# define NS_IN6ADDRSZ 16 +# define NS_INT16SZ 2 + +/* + * WARNING: Don't even consider trying to compile this on a system where + * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. + */ + +static int inet_pton4 (const char *src, unsigned char *dst); +# if HAVE_IPV6 +static int inet_pton6 (const char *src, unsigned char *dst); +# endif + +/* int + * inet_pton(af, src, dst) + * convert from presentation format (which usually means ASCII printable) + * to network format (which is usually some kind of binary format). + * return: + * 1 if the address was valid for the specified address family + * 0 if the address wasn't valid ('dst' is untouched in this case) + * -1 if some other error occurred ('dst' is untouched in this case, too) + * author: + * Paul Vixie, 1996. + */ +int +inet_pton (int af, const char *restrict src, void *restrict dst) +{ + switch (af) + { + case AF_INET: + return (inet_pton4 (src, dst)); + +# if HAVE_IPV6 + case AF_INET6: + return (inet_pton6 (src, dst)); +# endif + + default: + errno = EAFNOSUPPORT; + return (-1); + } + /* NOTREACHED */ +} + +/* int + * inet_pton4(src, dst) + * like inet_aton() but without all the hexadecimal, octal (with the + * exception of 0) and shorthand. + * return: + * 1 if 'src' is a valid dotted quad, else 0. + * notice: + * does not touch 'dst' unless it's returning 1. + * author: + * Paul Vixie, 1996. + */ +static int +inet_pton4 (const char *restrict src, unsigned char *restrict dst) +{ + int saw_digit, octets, ch; + unsigned char tmp[NS_INADDRSZ], *tp; + + saw_digit = 0; + octets = 0; + *(tp = tmp) = 0; + while ((ch = *src++) != '\0') + { + + if (ch >= '0' && ch <= '9') + { + unsigned new = *tp * 10 + (ch - '0'); + + if (saw_digit && *tp == 0) + return (0); + if (new > 255) + return (0); + *tp = new; + if (!saw_digit) + { + if (++octets > 4) + return (0); + saw_digit = 1; + } + } + else if (ch == '.' && saw_digit) + { + if (octets == 4) + return (0); + *++tp = 0; + saw_digit = 0; + } + else + return (0); + } + if (octets < 4) + return (0); + memcpy (dst, tmp, NS_INADDRSZ); + return (1); +} + +# if HAVE_IPV6 + +/* int + * inet_pton6(src, dst) + * convert presentation level address to network order binary form. + * return: + * 1 if 'src' is a valid [RFC1884 2.2] address, else 0. + * notice: + * (1) does not touch 'dst' unless it's returning 1. + * (2) :: in a full address is silently ignored. + * credit: + * inspired by Mark Andrews. + * author: + * Paul Vixie, 1996. + */ +static int +inet_pton6 (const char *restrict src, unsigned char *restrict dst) +{ + static const char xdigits[] = "0123456789abcdef"; + unsigned char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp; + const char *curtok; + int ch, saw_xdigit; + unsigned val; + + tp = memset (tmp, '\0', NS_IN6ADDRSZ); + endp = tp + NS_IN6ADDRSZ; + colonp = NULL; + /* Leading :: requires some special handling. */ + if (*src == ':') + if (*++src != ':') + return (0); + curtok = src; + saw_xdigit = 0; + val = 0; + while ((ch = c_tolower (*src++)) != '\0') + { + const char *pch; + + pch = strchr (xdigits, ch); + if (pch != NULL) + { + val <<= 4; + val |= (pch - xdigits); + if (val > 0xffff) + return (0); + saw_xdigit = 1; + continue; + } + if (ch == ':') + { + curtok = src; + if (!saw_xdigit) + { + if (colonp) + return (0); + colonp = tp; + continue; + } + else if (*src == '\0') + { + return (0); + } + if (tp + NS_INT16SZ > endp) + return (0); + *tp++ = (u_char) (val >> 8) & 0xff; + *tp++ = (u_char) val & 0xff; + saw_xdigit = 0; + val = 0; + continue; + } + if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) && + inet_pton4 (curtok, tp) > 0) + { + tp += NS_INADDRSZ; + saw_xdigit = 0; + break; /* '\0' was seen by inet_pton4(). */ + } + return (0); + } + if (saw_xdigit) + { + if (tp + NS_INT16SZ > endp) + return (0); + *tp++ = (u_char) (val >> 8) & 0xff; + *tp++ = (u_char) val & 0xff; + } + if (colonp != NULL) + { + /* + * Since some memmove()'s erroneously fail to handle + * overlapping regions, we'll do the shift by hand. + */ + const int n = tp - colonp; + int i; + + if (tp == endp) + return (0); + for (i = 1; i <= n; i++) + { + endp[-i] = colonp[n - i]; + colonp[n - i] = 0; + } + tp = endp; + } + if (tp != endp) + return (0); + memcpy (dst, tmp, NS_IN6ADDRSZ); + return (1); +} + +# endif + +#endif diff -Nru datamash-1.7/lib/intprops.h datamash-1.8/lib/intprops.h --- datamash-1.7/lib/intprops.h 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/intprops.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* intprops.h -- properties of integer types - Copyright (C) 2001-2020 Free Software Foundation, Inc. + Copyright (C) 2001-2021 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 @@ -48,7 +48,7 @@ /* Minimum and maximum values for integer types and expressions. */ /* The width in bits of the integer type or expression T. - Do not evaluate T. + Do not evaluate T. T must not be a bit-field expression. Padding bits are not supported; this is checked at compile-time below. */ #define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT) @@ -70,7 +70,7 @@ ? _GL_SIGNED_INT_MAXIMUM (e) \ : _GL_INT_NEGATE_CONVERT (e, 1)) #define _GL_SIGNED_INT_MAXIMUM(e) \ - (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH ((e) + 0) - 2)) - 1) * 2 + 1) + (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH (+ (e)) - 2)) - 1) * 2 + 1) /* Work around OpenVMS incompatibility with C99. */ #if !defined LLONG_MAX && defined __INT64_MAX @@ -86,6 +86,7 @@ /* 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__ \ + || (4 <= __clang_major__) \ || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \ || (0x5110 <= __SUNPRO_C && !__STDC__)) # define _GL_HAVE___TYPEOF__ 1 @@ -94,8 +95,9 @@ #endif /* Return 1 if the integer type or expression T might be signed. Return 0 - if it is definitely unsigned. This macro does not evaluate its argument, - and expands to an integer constant expression. */ + if it is definitely unsigned. T must not be a bit-field expression. + This macro does not evaluate its argument, and expands to an + integer constant expression. */ #if _GL_HAVE___TYPEOF__ # define _GL_SIGNED_TYPE_OR_EXPR(t) TYPE_SIGNED (__typeof__ (t)) #else @@ -108,6 +110,8 @@ #define INT_BITS_STRLEN_BOUND(b) (((b) * 146 + 484) / 485) /* Bound on length of the string representing an integer type or expression T. + T must not be a bit-field expression. + Subtract 1 for the sign bit if T is signed, and then add 1 more for a minus sign if needed. @@ -119,7 +123,7 @@ + _GL_SIGNED_TYPE_OR_EXPR (t)) /* Bound on buffer size needed to represent an integer type or expression T, - including the terminating null. */ + including the terminating null. T must not be a bit-field expression. */ #define INT_BUFSIZE_BOUND(t) (INT_STRLEN_BOUND (t) + 1) @@ -222,7 +226,9 @@ /* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow (A, B, P) work when P is non-null. */ -#if 5 <= __GNUC__ && !defined __ICC +/* __builtin_{add,sub}_overflow exists but is not reliable in GCC 5.x and 6.x, + see . */ +#if 7 <= __GNUC__ && !defined __ICC # define _GL_HAS_BUILTIN_ADD_OVERFLOW 1 #elif defined __has_builtin # define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow) @@ -239,8 +245,18 @@ #endif /* True if __builtin_add_overflow_p (A, B, C) works, and similarly for - __builtin_mul_overflow_p and __builtin_mul_overflow_p. */ -#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__) + __builtin_sub_overflow_p and __builtin_mul_overflow_p. */ +#if defined __clang__ || defined __ICC +/* Clang 11 lacks __builtin_mul_overflow_p, and even if it did it + would presumably run afoul of Clang bug 16404. ICC 2021.1's + __builtin_add_overflow_p etc. are not treated as integral constant + expressions even when all arguments are. */ +# define _GL_HAS_BUILTIN_OVERFLOW_P 0 +#elif defined __has_builtin +# define _GL_HAS_BUILTIN_OVERFLOW_P __has_builtin (__builtin_mul_overflow_p) +#else +# define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__) +#endif /* The _GL*_OVERFLOW macros have the same restrictions as the *_RANGE_OVERFLOW macros, except that they do not assume that operands @@ -373,8 +389,9 @@ _GL_INT_OP_WRAPV (a, b, r, -, _GL_INT_SUBTRACT_RANGE_OVERFLOW) #endif #if _GL_HAS_BUILTIN_MUL_OVERFLOW -# if (9 < __GNUC__ + (3 <= __GNUC_MINOR__) \ - || (__GNUC__ == 8 && 4 <= __GNUC_MINOR__)) +# if ((9 < __GNUC__ + (3 <= __GNUC_MINOR__) \ + || (__GNUC__ == 8 && 4 <= __GNUC_MINOR__)) \ + && !defined __ICC) # define INT_MULTIPLY_WRAPV(a, b, r) __builtin_mul_overflow (a, b, r) # else /* Work around GCC bug 91450. */ @@ -395,7 +412,7 @@ For now, assume all versions of GCC-like compilers generate bogus warnings for _Generic. This matters only for compilers that lack relevant builtins. */ -#if __GNUC__ +#if __GNUC__ || defined __clang__ # define _GL__GENERIC_BOGUS 1 #else # define _GL__GENERIC_BOGUS 0 @@ -565,7 +582,7 @@ ? (EXPR_SIGNED (_GL_INT_CONVERT (tmax, b)) \ ? (a) < (tmax) / (b) \ : ((INT_NEGATE_OVERFLOW (b) \ - ? _GL_INT_CONVERT (b, tmax) >> (TYPE_WIDTH (b) - 1) \ + ? _GL_INT_CONVERT (b, tmax) >> (TYPE_WIDTH (+ (b)) - 1) \ : (tmax) / -(b)) \ <= -1 - (a))) \ : INT_NEGATE_OVERFLOW (_GL_INT_CONVERT (b, tmin)) && (b) == -1 \ @@ -581,4 +598,33 @@ : (tmin) / (a) < (b)) \ : (tmax) / (b) < (a))) +/* The following macros compute A + B, A - B, and A * B, respectively. + If no overflow occurs, they set *R to the result and return 1; + otherwise, they return 0 and may modify *R. + + Example usage: + + long int result; + if (INT_ADD_OK (a, b, &result)) + printf ("result is %ld\n", result); + else + printf ("overflow\n"); + + A, B, and *R should be integers; they need not be the same type, + and they need not be all signed or all unsigned. + + These macros work correctly on all known practical hosts, and do not rely + on undefined behavior due to signed arithmetic overflow. + + These macros are not constant expressions. + + These macros may evaluate their arguments zero or multiple times, so the + arguments should not have side effects. + + These macros are tuned for B being a constant. */ + +#define INT_ADD_OK(a, b, r) ! INT_ADD_WRAPV (a, b, r) +#define INT_SUBTRACT_OK(a, b, r) ! INT_SUBTRACT_WRAPV (a, b, r) +#define INT_MULTIPLY_OK(a, b, r) ! INT_MULTIPLY_WRAPV (a, b, r) + #endif /* _GL_INTPROPS_H */ diff -Nru datamash-1.7/lib/inttostr.h datamash-1.8/lib/inttostr.h --- datamash-1.7/lib/inttostr.h 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/inttostr.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* inttostr.h -- convert integers to printable strings - Copyright (C) 2001-2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2001-2006, 2009-2021 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 @@ -22,25 +22,8 @@ #include "intprops.h" -#ifndef __GNUC_PREREQ -# if defined __GNUC__ && defined __GNUC_MINOR__ -# define __GNUC_PREREQ(maj, min) \ - ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) -# else -# define __GNUC_PREREQ(maj, min) 0 -# endif -#endif - -#if __GNUC_PREREQ (3,4) -# undef __attribute_warn_unused_result__ -# define __attribute_warn_unused_result__ \ - __attribute__ ((__warn_unused_result__)) -#else -# define __attribute_warn_unused_result__ /* empty */ -#endif - -char *imaxtostr (intmax_t, char *) __attribute_warn_unused_result__; -char *inttostr (int, char *) __attribute_warn_unused_result__; -char *offtostr (off_t, char *) __attribute_warn_unused_result__; -char *uinttostr (unsigned int, char *) __attribute_warn_unused_result__; -char *umaxtostr (uintmax_t, char *) __attribute_warn_unused_result__; +char *imaxtostr (intmax_t, char *) _GL_ATTRIBUTE_NODISCARD; +char *inttostr (int, char *) _GL_ATTRIBUTE_NODISCARD; +char *offtostr (off_t, char *) _GL_ATTRIBUTE_NODISCARD; +char *uinttostr (unsigned int, char *) _GL_ATTRIBUTE_NODISCARD; +char *umaxtostr (uintmax_t, char *) _GL_ATTRIBUTE_NODISCARD; diff -Nru datamash-1.7/lib/inttypes.in.h datamash-1.8/lib/inttypes.in.h --- datamash-1.7/lib/inttypes.in.h 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/inttypes.in.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (C) 2006-2020 Free Software Foundation, Inc. +/* Copyright (C) 2006-2021 Free Software Foundation, Inc. Written by Paul Eggert, Bruno Haible, Derek Price. This file is part of gnulib. @@ -78,110 +78,92 @@ # define _LONG_LONG_FORMAT_PREFIX "ll" #endif -#if !defined PRId8 || @PRI_MACROS_BROKEN@ -# undef PRId8 +#if !defined PRId8 # ifdef INT8_MAX # define PRId8 "d" # endif #endif -#if !defined PRIi8 || @PRI_MACROS_BROKEN@ -# undef PRIi8 +#if !defined PRIi8 # ifdef INT8_MAX # define PRIi8 "i" # endif #endif -#if !defined PRIo8 || @PRI_MACROS_BROKEN@ -# undef PRIo8 +#if !defined PRIo8 # ifdef UINT8_MAX # define PRIo8 "o" # endif #endif -#if !defined PRIu8 || @PRI_MACROS_BROKEN@ -# undef PRIu8 +#if !defined PRIu8 # ifdef UINT8_MAX # define PRIu8 "u" # endif #endif -#if !defined PRIx8 || @PRI_MACROS_BROKEN@ -# undef PRIx8 +#if !defined PRIx8 # ifdef UINT8_MAX # define PRIx8 "x" # endif #endif -#if !defined PRIX8 || @PRI_MACROS_BROKEN@ -# undef PRIX8 +#if !defined PRIX8 # ifdef UINT8_MAX # define PRIX8 "X" # endif #endif -#if !defined PRId16 || @PRI_MACROS_BROKEN@ -# undef PRId16 +#if !defined PRId16 # ifdef INT16_MAX # define PRId16 "d" # endif #endif -#if !defined PRIi16 || @PRI_MACROS_BROKEN@ -# undef PRIi16 +#if !defined PRIi16 # ifdef INT16_MAX # define PRIi16 "i" # endif #endif -#if !defined PRIo16 || @PRI_MACROS_BROKEN@ -# undef PRIo16 +#if !defined PRIo16 # ifdef UINT16_MAX # define PRIo16 "o" # endif #endif -#if !defined PRIu16 || @PRI_MACROS_BROKEN@ -# undef PRIu16 +#if !defined PRIu16 # ifdef UINT16_MAX # define PRIu16 "u" # endif #endif -#if !defined PRIx16 || @PRI_MACROS_BROKEN@ -# undef PRIx16 +#if !defined PRIx16 # ifdef UINT16_MAX # define PRIx16 "x" # endif #endif -#if !defined PRIX16 || @PRI_MACROS_BROKEN@ -# undef PRIX16 +#if !defined PRIX16 # ifdef UINT16_MAX # define PRIX16 "X" # endif #endif -#if !defined PRId32 || @PRI_MACROS_BROKEN@ -# undef PRId32 +#if !defined PRId32 # ifdef INT32_MAX # define PRId32 "d" # endif #endif -#if !defined PRIi32 || @PRI_MACROS_BROKEN@ -# undef PRIi32 +#if !defined PRIi32 # ifdef INT32_MAX # define PRIi32 "i" # endif #endif -#if !defined PRIo32 || @PRI_MACROS_BROKEN@ -# undef PRIo32 +#if !defined PRIo32 # ifdef UINT32_MAX # define PRIo32 "o" # endif #endif -#if !defined PRIu32 || @PRI_MACROS_BROKEN@ -# undef PRIu32 +#if !defined PRIu32 # ifdef UINT32_MAX # define PRIu32 "u" # endif #endif -#if !defined PRIx32 || @PRI_MACROS_BROKEN@ -# undef PRIx32 +#if !defined PRIx32 # ifdef UINT32_MAX # define PRIx32 "x" # endif #endif -#if !defined PRIX32 || @PRI_MACROS_BROKEN@ -# undef PRIX32 +#if !defined PRIX32 # ifdef UINT32_MAX # define PRIX32 "X" # endif @@ -194,12 +176,10 @@ # elif LONG_MAX >> 30 == 1 # define _PRI64_PREFIX _LONG_LONG_FORMAT_PREFIX # endif -# if !defined PRId64 || @PRI_MACROS_BROKEN@ -# undef PRId64 +# if !defined PRId64 # define PRId64 _PRI64_PREFIX "d" # endif -# if !defined PRIi64 || @PRI_MACROS_BROKEN@ -# undef PRIi64 +# if !defined PRIi64 # define PRIi64 _PRI64_PREFIX "i" # endif #endif @@ -211,263 +191,217 @@ # elif ULONG_MAX >> 31 == 1 # define _PRIu64_PREFIX _LONG_LONG_FORMAT_PREFIX # endif -# if !defined PRIo64 || @PRI_MACROS_BROKEN@ -# undef PRIo64 +# if !defined PRIo64 # define PRIo64 _PRIu64_PREFIX "o" # endif -# if !defined PRIu64 || @PRI_MACROS_BROKEN@ -# undef PRIu64 +# if !defined PRIu64 # define PRIu64 _PRIu64_PREFIX "u" # endif -# if !defined PRIx64 || @PRI_MACROS_BROKEN@ -# undef PRIx64 +# if !defined PRIx64 # define PRIx64 _PRIu64_PREFIX "x" # endif -# if !defined PRIX64 || @PRI_MACROS_BROKEN@ -# undef PRIX64 +# if !defined PRIX64 # define PRIX64 _PRIu64_PREFIX "X" # endif #endif -#if !defined PRIdLEAST8 || @PRI_MACROS_BROKEN@ -# undef PRIdLEAST8 +#if !defined PRIdLEAST8 # define PRIdLEAST8 "d" #endif -#if !defined PRIiLEAST8 || @PRI_MACROS_BROKEN@ -# undef PRIiLEAST8 +#if !defined PRIiLEAST8 # define PRIiLEAST8 "i" #endif -#if !defined PRIoLEAST8 || @PRI_MACROS_BROKEN@ -# undef PRIoLEAST8 +#if !defined PRIoLEAST8 # define PRIoLEAST8 "o" #endif -#if !defined PRIuLEAST8 || @PRI_MACROS_BROKEN@ -# undef PRIuLEAST8 +#if !defined PRIuLEAST8 # define PRIuLEAST8 "u" #endif -#if !defined PRIxLEAST8 || @PRI_MACROS_BROKEN@ -# undef PRIxLEAST8 +#if !defined PRIxLEAST8 # define PRIxLEAST8 "x" #endif -#if !defined PRIXLEAST8 || @PRI_MACROS_BROKEN@ -# undef PRIXLEAST8 +#if !defined PRIXLEAST8 # define PRIXLEAST8 "X" #endif -#if !defined PRIdLEAST16 || @PRI_MACROS_BROKEN@ -# undef PRIdLEAST16 +#if !defined PRIdLEAST16 # define PRIdLEAST16 "d" #endif -#if !defined PRIiLEAST16 || @PRI_MACROS_BROKEN@ -# undef PRIiLEAST16 +#if !defined PRIiLEAST16 # define PRIiLEAST16 "i" #endif -#if !defined PRIoLEAST16 || @PRI_MACROS_BROKEN@ -# undef PRIoLEAST16 +#if !defined PRIoLEAST16 # define PRIoLEAST16 "o" #endif -#if !defined PRIuLEAST16 || @PRI_MACROS_BROKEN@ -# undef PRIuLEAST16 +#if !defined PRIuLEAST16 # define PRIuLEAST16 "u" #endif -#if !defined PRIxLEAST16 || @PRI_MACROS_BROKEN@ -# undef PRIxLEAST16 +#if !defined PRIxLEAST16 # define PRIxLEAST16 "x" #endif -#if !defined PRIXLEAST16 || @PRI_MACROS_BROKEN@ -# undef PRIXLEAST16 +#if !defined PRIXLEAST16 # define PRIXLEAST16 "X" #endif -#if !defined PRIdLEAST32 || @PRI_MACROS_BROKEN@ -# undef PRIdLEAST32 +#if !defined PRIdLEAST32 # define PRIdLEAST32 "d" #endif -#if !defined PRIiLEAST32 || @PRI_MACROS_BROKEN@ -# undef PRIiLEAST32 +#if !defined PRIiLEAST32 # define PRIiLEAST32 "i" #endif -#if !defined PRIoLEAST32 || @PRI_MACROS_BROKEN@ -# undef PRIoLEAST32 +#if !defined PRIoLEAST32 # define PRIoLEAST32 "o" #endif -#if !defined PRIuLEAST32 || @PRI_MACROS_BROKEN@ -# undef PRIuLEAST32 +#if !defined PRIuLEAST32 # define PRIuLEAST32 "u" #endif -#if !defined PRIxLEAST32 || @PRI_MACROS_BROKEN@ -# undef PRIxLEAST32 +#if !defined PRIxLEAST32 # define PRIxLEAST32 "x" #endif -#if !defined PRIXLEAST32 || @PRI_MACROS_BROKEN@ -# undef PRIXLEAST32 +#if !defined PRIXLEAST32 # define PRIXLEAST32 "X" #endif #ifdef INT64_MAX -# if !defined PRIdLEAST64 || @PRI_MACROS_BROKEN@ -# undef PRIdLEAST64 +# if !defined PRIdLEAST64 # define PRIdLEAST64 PRId64 # endif -# if !defined PRIiLEAST64 || @PRI_MACROS_BROKEN@ -# undef PRIiLEAST64 +# if !defined PRIiLEAST64 # define PRIiLEAST64 PRIi64 # endif #endif #ifdef UINT64_MAX -# if !defined PRIoLEAST64 || @PRI_MACROS_BROKEN@ -# undef PRIoLEAST64 +# if !defined PRIoLEAST64 # define PRIoLEAST64 PRIo64 # endif -# if !defined PRIuLEAST64 || @PRI_MACROS_BROKEN@ -# undef PRIuLEAST64 +# if !defined PRIuLEAST64 # define PRIuLEAST64 PRIu64 # endif -# if !defined PRIxLEAST64 || @PRI_MACROS_BROKEN@ -# undef PRIxLEAST64 +# if !defined PRIxLEAST64 # define PRIxLEAST64 PRIx64 # endif -# if !defined PRIXLEAST64 || @PRI_MACROS_BROKEN@ -# undef PRIXLEAST64 +# if !defined PRIXLEAST64 # define PRIXLEAST64 PRIX64 # endif #endif -#if !defined PRIdFAST8 || @PRI_MACROS_BROKEN@ -# undef PRIdFAST8 +#if !defined PRIdFAST8 # if INT_FAST8_MAX > INT32_MAX # define PRIdFAST8 PRId64 # else # define PRIdFAST8 "d" # endif #endif -#if !defined PRIiFAST8 || @PRI_MACROS_BROKEN@ -# undef PRIiFAST8 +#if !defined PRIiFAST8 # if INT_FAST8_MAX > INT32_MAX # define PRIiFAST8 PRIi64 # else # define PRIiFAST8 "i" # endif #endif -#if !defined PRIoFAST8 || @PRI_MACROS_BROKEN@ -# undef PRIoFAST8 +#if !defined PRIoFAST8 # if UINT_FAST8_MAX > UINT32_MAX # define PRIoFAST8 PRIo64 # else # define PRIoFAST8 "o" # endif #endif -#if !defined PRIuFAST8 || @PRI_MACROS_BROKEN@ -# undef PRIuFAST8 +#if !defined PRIuFAST8 # if UINT_FAST8_MAX > UINT32_MAX # define PRIuFAST8 PRIu64 # else # define PRIuFAST8 "u" # endif #endif -#if !defined PRIxFAST8 || @PRI_MACROS_BROKEN@ -# undef PRIxFAST8 +#if !defined PRIxFAST8 # if UINT_FAST8_MAX > UINT32_MAX # define PRIxFAST8 PRIx64 # else # define PRIxFAST8 "x" # endif #endif -#if !defined PRIXFAST8 || @PRI_MACROS_BROKEN@ -# undef PRIXFAST8 +#if !defined PRIXFAST8 # if UINT_FAST8_MAX > UINT32_MAX # define PRIXFAST8 PRIX64 # else # define PRIXFAST8 "X" # endif #endif -#if !defined PRIdFAST16 || @PRI_MACROS_BROKEN@ -# undef PRIdFAST16 +#if !defined PRIdFAST16 # if INT_FAST16_MAX > INT32_MAX # define PRIdFAST16 PRId64 # else # define PRIdFAST16 "d" # endif #endif -#if !defined PRIiFAST16 || @PRI_MACROS_BROKEN@ -# undef PRIiFAST16 +#if !defined PRIiFAST16 # if INT_FAST16_MAX > INT32_MAX # define PRIiFAST16 PRIi64 # else # define PRIiFAST16 "i" # endif #endif -#if !defined PRIoFAST16 || @PRI_MACROS_BROKEN@ -# undef PRIoFAST16 +#if !defined PRIoFAST16 # if UINT_FAST16_MAX > UINT32_MAX # define PRIoFAST16 PRIo64 # else # define PRIoFAST16 "o" # endif #endif -#if !defined PRIuFAST16 || @PRI_MACROS_BROKEN@ -# undef PRIuFAST16 +#if !defined PRIuFAST16 # if UINT_FAST16_MAX > UINT32_MAX # define PRIuFAST16 PRIu64 # else # define PRIuFAST16 "u" # endif #endif -#if !defined PRIxFAST16 || @PRI_MACROS_BROKEN@ -# undef PRIxFAST16 +#if !defined PRIxFAST16 # if UINT_FAST16_MAX > UINT32_MAX # define PRIxFAST16 PRIx64 # else # define PRIxFAST16 "x" # endif #endif -#if !defined PRIXFAST16 || @PRI_MACROS_BROKEN@ -# undef PRIXFAST16 +#if !defined PRIXFAST16 # if UINT_FAST16_MAX > UINT32_MAX # define PRIXFAST16 PRIX64 # else # define PRIXFAST16 "X" # endif #endif -#if !defined PRIdFAST32 || @PRI_MACROS_BROKEN@ -# undef PRIdFAST32 +#if !defined PRIdFAST32 # if INT_FAST32_MAX > INT32_MAX # define PRIdFAST32 PRId64 # else # define PRIdFAST32 "d" # endif #endif -#if !defined PRIiFAST32 || @PRI_MACROS_BROKEN@ -# undef PRIiFAST32 +#if !defined PRIiFAST32 # if INT_FAST32_MAX > INT32_MAX # define PRIiFAST32 PRIi64 # else # define PRIiFAST32 "i" # endif #endif -#if !defined PRIoFAST32 || @PRI_MACROS_BROKEN@ -# undef PRIoFAST32 +#if !defined PRIoFAST32 # if UINT_FAST32_MAX > UINT32_MAX # define PRIoFAST32 PRIo64 # else # define PRIoFAST32 "o" # endif #endif -#if !defined PRIuFAST32 || @PRI_MACROS_BROKEN@ -# undef PRIuFAST32 +#if !defined PRIuFAST32 # if UINT_FAST32_MAX > UINT32_MAX # define PRIuFAST32 PRIu64 # else # define PRIuFAST32 "u" # endif #endif -#if !defined PRIxFAST32 || @PRI_MACROS_BROKEN@ -# undef PRIxFAST32 +#if !defined PRIxFAST32 # if UINT_FAST32_MAX > UINT32_MAX # define PRIxFAST32 PRIx64 # else # define PRIxFAST32 "x" # endif #endif -#if !defined PRIXFAST32 || @PRI_MACROS_BROKEN@ -# undef PRIXFAST32 +#if !defined PRIXFAST32 # if UINT_FAST32_MAX > UINT32_MAX # define PRIXFAST32 PRIX64 # else @@ -475,76 +409,64 @@ # endif #endif #ifdef INT64_MAX -# if !defined PRIdFAST64 || @PRI_MACROS_BROKEN@ -# undef PRIdFAST64 +# if !defined PRIdFAST64 # define PRIdFAST64 PRId64 # endif -# if !defined PRIiFAST64 || @PRI_MACROS_BROKEN@ -# undef PRIiFAST64 +# if !defined PRIiFAST64 # define PRIiFAST64 PRIi64 # endif #endif #ifdef UINT64_MAX -# if !defined PRIoFAST64 || @PRI_MACROS_BROKEN@ -# undef PRIoFAST64 +# if !defined PRIoFAST64 # define PRIoFAST64 PRIo64 # endif -# if !defined PRIuFAST64 || @PRI_MACROS_BROKEN@ -# undef PRIuFAST64 +# if !defined PRIuFAST64 # define PRIuFAST64 PRIu64 # endif -# if !defined PRIxFAST64 || @PRI_MACROS_BROKEN@ -# undef PRIxFAST64 +# if !defined PRIxFAST64 # define PRIxFAST64 PRIx64 # endif -# if !defined PRIXFAST64 || @PRI_MACROS_BROKEN@ -# undef PRIXFAST64 +# if !defined PRIXFAST64 # define PRIXFAST64 PRIX64 # endif #endif -#if !defined PRIdMAX || @PRI_MACROS_BROKEN@ -# undef PRIdMAX +#if !defined PRIdMAX # if @INT32_MAX_LT_INTMAX_MAX@ # define PRIdMAX PRId64 # else # define PRIdMAX "ld" # endif #endif -#if !defined PRIiMAX || @PRI_MACROS_BROKEN@ -# undef PRIiMAX +#if !defined PRIiMAX # if @INT32_MAX_LT_INTMAX_MAX@ # define PRIiMAX PRIi64 # else # define PRIiMAX "li" # endif #endif -#if !defined PRIoMAX || @PRI_MACROS_BROKEN@ -# undef PRIoMAX +#if !defined PRIoMAX # if @UINT32_MAX_LT_UINTMAX_MAX@ # define PRIoMAX PRIo64 # else # define PRIoMAX "lo" # endif #endif -#if !defined PRIuMAX || @PRI_MACROS_BROKEN@ -# undef PRIuMAX +#if !defined PRIuMAX # if @UINT32_MAX_LT_UINTMAX_MAX@ # define PRIuMAX PRIu64 # else # define PRIuMAX "lu" # endif #endif -#if !defined PRIxMAX || @PRI_MACROS_BROKEN@ -# undef PRIxMAX +#if !defined PRIxMAX # if @UINT32_MAX_LT_UINTMAX_MAX@ # define PRIxMAX PRIx64 # else # define PRIxMAX "lx" # endif #endif -#if !defined PRIXMAX || @PRI_MACROS_BROKEN@ -# undef PRIXMAX +#if !defined PRIXMAX # if @UINT32_MAX_LT_UINTMAX_MAX@ # define PRIXMAX PRIX64 # else @@ -552,129 +474,108 @@ # endif #endif -#if !defined PRIdPTR || @PRI_MACROS_BROKEN@ -# undef PRIdPTR +#if !defined PRIdPTR # ifdef INTPTR_MAX # define PRIdPTR @PRIPTR_PREFIX@ "d" # endif #endif -#if !defined PRIiPTR || @PRI_MACROS_BROKEN@ -# undef PRIiPTR +#if !defined PRIiPTR # ifdef INTPTR_MAX # define PRIiPTR @PRIPTR_PREFIX@ "i" # endif #endif -#if !defined PRIoPTR || @PRI_MACROS_BROKEN@ -# undef PRIoPTR +#if !defined PRIoPTR # ifdef UINTPTR_MAX # define PRIoPTR @PRIPTR_PREFIX@ "o" # endif #endif -#if !defined PRIuPTR || @PRI_MACROS_BROKEN@ -# undef PRIuPTR +#if !defined PRIuPTR # ifdef UINTPTR_MAX # define PRIuPTR @PRIPTR_PREFIX@ "u" # endif #endif -#if !defined PRIxPTR || @PRI_MACROS_BROKEN@ -# undef PRIxPTR +#if !defined PRIxPTR # ifdef UINTPTR_MAX # define PRIxPTR @PRIPTR_PREFIX@ "x" # endif #endif -#if !defined PRIXPTR || @PRI_MACROS_BROKEN@ -# undef PRIXPTR +#if !defined PRIXPTR # ifdef UINTPTR_MAX # define PRIXPTR @PRIPTR_PREFIX@ "X" # endif #endif -#if !defined SCNd8 || @PRI_MACROS_BROKEN@ -# undef SCNd8 +#if !defined SCNd8 # ifdef INT8_MAX # define SCNd8 "hhd" # endif #endif -#if !defined SCNi8 || @PRI_MACROS_BROKEN@ -# undef SCNi8 +#if !defined SCNi8 # ifdef INT8_MAX # define SCNi8 "hhi" # endif #endif -#if !defined SCNo8 || @PRI_MACROS_BROKEN@ -# undef SCNo8 +#if !defined SCNo8 # ifdef UINT8_MAX # define SCNo8 "hho" # endif #endif -#if !defined SCNu8 || @PRI_MACROS_BROKEN@ -# undef SCNu8 +#if !defined SCNu8 # ifdef UINT8_MAX # define SCNu8 "hhu" # endif #endif -#if !defined SCNx8 || @PRI_MACROS_BROKEN@ -# undef SCNx8 +#if !defined SCNx8 # ifdef UINT8_MAX # define SCNx8 "hhx" # endif #endif -#if !defined SCNd16 || @PRI_MACROS_BROKEN@ -# undef SCNd16 +#if !defined SCNd16 # ifdef INT16_MAX # define SCNd16 "hd" # endif #endif -#if !defined SCNi16 || @PRI_MACROS_BROKEN@ -# undef SCNi16 +#if !defined SCNi16 # ifdef INT16_MAX # define SCNi16 "hi" # endif #endif -#if !defined SCNo16 || @PRI_MACROS_BROKEN@ -# undef SCNo16 +#if !defined SCNo16 # ifdef UINT16_MAX # define SCNo16 "ho" # endif #endif -#if !defined SCNu16 || @PRI_MACROS_BROKEN@ -# undef SCNu16 +#if !defined SCNu16 # ifdef UINT16_MAX # define SCNu16 "hu" # endif #endif -#if !defined SCNx16 || @PRI_MACROS_BROKEN@ -# undef SCNx16 +#if !defined SCNx16 # ifdef UINT16_MAX # define SCNx16 "hx" # endif #endif -#if !defined SCNd32 || @PRI_MACROS_BROKEN@ -# undef SCNd32 +#if !defined SCNd32 # ifdef INT32_MAX # define SCNd32 "d" # endif #endif -#if !defined SCNi32 || @PRI_MACROS_BROKEN@ -# undef SCNi32 +#if !defined SCNi32 # ifdef INT32_MAX # define SCNi32 "i" # endif #endif -#if !defined SCNo32 || @PRI_MACROS_BROKEN@ -# undef SCNo32 +#if !defined SCNo32 # ifdef UINT32_MAX # define SCNo32 "o" # endif #endif -#if !defined SCNu32 || @PRI_MACROS_BROKEN@ -# undef SCNu32 +#if !defined SCNu32 # ifdef UINT32_MAX # define SCNu32 "u" # endif #endif -#if !defined SCNx32 || @PRI_MACROS_BROKEN@ -# undef SCNx32 +#if !defined SCNx32 # ifdef UINT32_MAX # define SCNx32 "x" # endif @@ -687,12 +588,10 @@ # elif LONG_MAX >> 30 == 1 # define _SCN64_PREFIX _LONG_LONG_FORMAT_PREFIX # endif -# if !defined SCNd64 || @PRI_MACROS_BROKEN@ -# undef SCNd64 +# if !defined SCNd64 # define SCNd64 _SCN64_PREFIX "d" # endif -# if !defined SCNi64 || @PRI_MACROS_BROKEN@ -# undef SCNi64 +# if !defined SCNi64 # define SCNi64 _SCN64_PREFIX "i" # endif #endif @@ -704,107 +603,83 @@ # elif ULONG_MAX >> 31 == 1 # define _SCNu64_PREFIX _LONG_LONG_FORMAT_PREFIX # endif -# if !defined SCNo64 || @PRI_MACROS_BROKEN@ -# undef SCNo64 +# if !defined SCNo64 # define SCNo64 _SCNu64_PREFIX "o" # endif -# if !defined SCNu64 || @PRI_MACROS_BROKEN@ -# undef SCNu64 +# if !defined SCNu64 # define SCNu64 _SCNu64_PREFIX "u" # endif -# if !defined SCNx64 || @PRI_MACROS_BROKEN@ -# undef SCNx64 +# if !defined SCNx64 # define SCNx64 _SCNu64_PREFIX "x" # endif #endif -#if !defined SCNdLEAST8 || @PRI_MACROS_BROKEN@ -# undef SCNdLEAST8 +#if !defined SCNdLEAST8 # define SCNdLEAST8 "hhd" #endif -#if !defined SCNiLEAST8 || @PRI_MACROS_BROKEN@ -# undef SCNiLEAST8 +#if !defined SCNiLEAST8 # define SCNiLEAST8 "hhi" #endif -#if !defined SCNoLEAST8 || @PRI_MACROS_BROKEN@ -# undef SCNoLEAST8 +#if !defined SCNoLEAST8 # define SCNoLEAST8 "hho" #endif -#if !defined SCNuLEAST8 || @PRI_MACROS_BROKEN@ -# undef SCNuLEAST8 +#if !defined SCNuLEAST8 # define SCNuLEAST8 "hhu" #endif -#if !defined SCNxLEAST8 || @PRI_MACROS_BROKEN@ -# undef SCNxLEAST8 +#if !defined SCNxLEAST8 # define SCNxLEAST8 "hhx" #endif -#if !defined SCNdLEAST16 || @PRI_MACROS_BROKEN@ -# undef SCNdLEAST16 +#if !defined SCNdLEAST16 # define SCNdLEAST16 "hd" #endif -#if !defined SCNiLEAST16 || @PRI_MACROS_BROKEN@ -# undef SCNiLEAST16 +#if !defined SCNiLEAST16 # define SCNiLEAST16 "hi" #endif -#if !defined SCNoLEAST16 || @PRI_MACROS_BROKEN@ -# undef SCNoLEAST16 +#if !defined SCNoLEAST16 # define SCNoLEAST16 "ho" #endif -#if !defined SCNuLEAST16 || @PRI_MACROS_BROKEN@ -# undef SCNuLEAST16 +#if !defined SCNuLEAST16 # define SCNuLEAST16 "hu" #endif -#if !defined SCNxLEAST16 || @PRI_MACROS_BROKEN@ -# undef SCNxLEAST16 +#if !defined SCNxLEAST16 # define SCNxLEAST16 "hx" #endif -#if !defined SCNdLEAST32 || @PRI_MACROS_BROKEN@ -# undef SCNdLEAST32 +#if !defined SCNdLEAST32 # define SCNdLEAST32 "d" #endif -#if !defined SCNiLEAST32 || @PRI_MACROS_BROKEN@ -# undef SCNiLEAST32 +#if !defined SCNiLEAST32 # define SCNiLEAST32 "i" #endif -#if !defined SCNoLEAST32 || @PRI_MACROS_BROKEN@ -# undef SCNoLEAST32 +#if !defined SCNoLEAST32 # define SCNoLEAST32 "o" #endif -#if !defined SCNuLEAST32 || @PRI_MACROS_BROKEN@ -# undef SCNuLEAST32 +#if !defined SCNuLEAST32 # define SCNuLEAST32 "u" #endif -#if !defined SCNxLEAST32 || @PRI_MACROS_BROKEN@ -# undef SCNxLEAST32 +#if !defined SCNxLEAST32 # define SCNxLEAST32 "x" #endif #ifdef INT64_MAX -# if !defined SCNdLEAST64 || @PRI_MACROS_BROKEN@ -# undef SCNdLEAST64 +# if !defined SCNdLEAST64 # define SCNdLEAST64 SCNd64 # endif -# if !defined SCNiLEAST64 || @PRI_MACROS_BROKEN@ -# undef SCNiLEAST64 +# if !defined SCNiLEAST64 # define SCNiLEAST64 SCNi64 # endif #endif #ifdef UINT64_MAX -# if !defined SCNoLEAST64 || @PRI_MACROS_BROKEN@ -# undef SCNoLEAST64 +# if !defined SCNoLEAST64 # define SCNoLEAST64 SCNo64 # endif -# if !defined SCNuLEAST64 || @PRI_MACROS_BROKEN@ -# undef SCNuLEAST64 +# if !defined SCNuLEAST64 # define SCNuLEAST64 SCNu64 # endif -# if !defined SCNxLEAST64 || @PRI_MACROS_BROKEN@ -# undef SCNxLEAST64 +# if !defined SCNxLEAST64 # define SCNxLEAST64 SCNx64 # endif #endif -#if !defined SCNdFAST8 || @PRI_MACROS_BROKEN@ -# undef SCNdFAST8 +#if !defined SCNdFAST8 # if INT_FAST8_MAX > INT32_MAX # define SCNdFAST8 SCNd64 # elif INT_FAST8_MAX == 0x7fff @@ -815,8 +690,7 @@ # define SCNdFAST8 "d" # endif #endif -#if !defined SCNiFAST8 || @PRI_MACROS_BROKEN@ -# undef SCNiFAST8 +#if !defined SCNiFAST8 # if INT_FAST8_MAX > INT32_MAX # define SCNiFAST8 SCNi64 # elif INT_FAST8_MAX == 0x7fff @@ -827,8 +701,7 @@ # define SCNiFAST8 "i" # endif #endif -#if !defined SCNoFAST8 || @PRI_MACROS_BROKEN@ -# undef SCNoFAST8 +#if !defined SCNoFAST8 # if UINT_FAST8_MAX > UINT32_MAX # define SCNoFAST8 SCNo64 # elif UINT_FAST8_MAX == 0xffff @@ -839,8 +712,7 @@ # define SCNoFAST8 "o" # endif #endif -#if !defined SCNuFAST8 || @PRI_MACROS_BROKEN@ -# undef SCNuFAST8 +#if !defined SCNuFAST8 # if UINT_FAST8_MAX > UINT32_MAX # define SCNuFAST8 SCNu64 # elif UINT_FAST8_MAX == 0xffff @@ -851,8 +723,7 @@ # define SCNuFAST8 "u" # endif #endif -#if !defined SCNxFAST8 || @PRI_MACROS_BROKEN@ -# undef SCNxFAST8 +#if !defined SCNxFAST8 # if UINT_FAST8_MAX > UINT32_MAX # define SCNxFAST8 SCNx64 # elif UINT_FAST8_MAX == 0xffff @@ -863,8 +734,7 @@ # define SCNxFAST8 "x" # endif #endif -#if !defined SCNdFAST16 || @PRI_MACROS_BROKEN@ -# undef SCNdFAST16 +#if !defined SCNdFAST16 # if INT_FAST16_MAX > INT32_MAX # define SCNdFAST16 SCNd64 # elif INT_FAST16_MAX == 0x7fff @@ -873,8 +743,7 @@ # define SCNdFAST16 "d" # endif #endif -#if !defined SCNiFAST16 || @PRI_MACROS_BROKEN@ -# undef SCNiFAST16 +#if !defined SCNiFAST16 # if INT_FAST16_MAX > INT32_MAX # define SCNiFAST16 SCNi64 # elif INT_FAST16_MAX == 0x7fff @@ -883,8 +752,7 @@ # define SCNiFAST16 "i" # endif #endif -#if !defined SCNoFAST16 || @PRI_MACROS_BROKEN@ -# undef SCNoFAST16 +#if !defined SCNoFAST16 # if UINT_FAST16_MAX > UINT32_MAX # define SCNoFAST16 SCNo64 # elif UINT_FAST16_MAX == 0xffff @@ -893,8 +761,7 @@ # define SCNoFAST16 "o" # endif #endif -#if !defined SCNuFAST16 || @PRI_MACROS_BROKEN@ -# undef SCNuFAST16 +#if !defined SCNuFAST16 # if UINT_FAST16_MAX > UINT32_MAX # define SCNuFAST16 SCNu64 # elif UINT_FAST16_MAX == 0xffff @@ -903,8 +770,7 @@ # define SCNuFAST16 "u" # endif #endif -#if !defined SCNxFAST16 || @PRI_MACROS_BROKEN@ -# undef SCNxFAST16 +#if !defined SCNxFAST16 # if UINT_FAST16_MAX > UINT32_MAX # define SCNxFAST16 SCNx64 # elif UINT_FAST16_MAX == 0xffff @@ -913,40 +779,35 @@ # define SCNxFAST16 "x" # endif #endif -#if !defined SCNdFAST32 || @PRI_MACROS_BROKEN@ -# undef SCNdFAST32 +#if !defined SCNdFAST32 # if INT_FAST32_MAX > INT32_MAX # define SCNdFAST32 SCNd64 # else # define SCNdFAST32 "d" # endif #endif -#if !defined SCNiFAST32 || @PRI_MACROS_BROKEN@ -# undef SCNiFAST32 +#if !defined SCNiFAST32 # if INT_FAST32_MAX > INT32_MAX # define SCNiFAST32 SCNi64 # else # define SCNiFAST32 "i" # endif #endif -#if !defined SCNoFAST32 || @PRI_MACROS_BROKEN@ -# undef SCNoFAST32 +#if !defined SCNoFAST32 # if UINT_FAST32_MAX > UINT32_MAX # define SCNoFAST32 SCNo64 # else # define SCNoFAST32 "o" # endif #endif -#if !defined SCNuFAST32 || @PRI_MACROS_BROKEN@ -# undef SCNuFAST32 +#if !defined SCNuFAST32 # if UINT_FAST32_MAX > UINT32_MAX # define SCNuFAST32 SCNu64 # else # define SCNuFAST32 "u" # endif #endif -#if !defined SCNxFAST32 || @PRI_MACROS_BROKEN@ -# undef SCNxFAST32 +#if !defined SCNxFAST32 # if UINT_FAST32_MAX > UINT32_MAX # define SCNxFAST32 SCNx64 # else @@ -954,64 +815,54 @@ # endif #endif #ifdef INT64_MAX -# if !defined SCNdFAST64 || @PRI_MACROS_BROKEN@ -# undef SCNdFAST64 +# if !defined SCNdFAST64 # define SCNdFAST64 SCNd64 # endif -# if !defined SCNiFAST64 || @PRI_MACROS_BROKEN@ -# undef SCNiFAST64 +# if !defined SCNiFAST64 # define SCNiFAST64 SCNi64 # endif #endif #ifdef UINT64_MAX -# if !defined SCNoFAST64 || @PRI_MACROS_BROKEN@ -# undef SCNoFAST64 +# if !defined SCNoFAST64 # define SCNoFAST64 SCNo64 # endif -# if !defined SCNuFAST64 || @PRI_MACROS_BROKEN@ -# undef SCNuFAST64 +# if !defined SCNuFAST64 # define SCNuFAST64 SCNu64 # endif -# if !defined SCNxFAST64 || @PRI_MACROS_BROKEN@ -# undef SCNxFAST64 +# if !defined SCNxFAST64 # define SCNxFAST64 SCNx64 # endif #endif -#if !defined SCNdMAX || @PRI_MACROS_BROKEN@ -# undef SCNdMAX +#if !defined SCNdMAX # if @INT32_MAX_LT_INTMAX_MAX@ # define SCNdMAX SCNd64 # else # define SCNdMAX "ld" # endif #endif -#if !defined SCNiMAX || @PRI_MACROS_BROKEN@ -# undef SCNiMAX +#if !defined SCNiMAX # if @INT32_MAX_LT_INTMAX_MAX@ # define SCNiMAX SCNi64 # else # define SCNiMAX "li" # endif #endif -#if !defined SCNoMAX || @PRI_MACROS_BROKEN@ -# undef SCNoMAX +#if !defined SCNoMAX # if @UINT32_MAX_LT_UINTMAX_MAX@ # define SCNoMAX SCNo64 # else # define SCNoMAX "lo" # endif #endif -#if !defined SCNuMAX || @PRI_MACROS_BROKEN@ -# undef SCNuMAX +#if !defined SCNuMAX # if @UINT32_MAX_LT_UINTMAX_MAX@ # define SCNuMAX SCNu64 # else # define SCNuMAX "lu" # endif #endif -#if !defined SCNxMAX || @PRI_MACROS_BROKEN@ -# undef SCNxMAX +#if !defined SCNxMAX # if @UINT32_MAX_LT_UINTMAX_MAX@ # define SCNxMAX SCNx64 # else @@ -1019,32 +870,27 @@ # endif #endif -#if !defined SCNdPTR || @PRI_MACROS_BROKEN@ -# undef SCNdPTR +#if !defined SCNdPTR # ifdef INTPTR_MAX # define SCNdPTR @PRIPTR_PREFIX@ "d" # endif #endif -#if !defined SCNiPTR || @PRI_MACROS_BROKEN@ -# undef SCNiPTR +#if !defined SCNiPTR # ifdef INTPTR_MAX # define SCNiPTR @PRIPTR_PREFIX@ "i" # endif #endif -#if !defined SCNoPTR || @PRI_MACROS_BROKEN@ -# undef SCNoPTR +#if !defined SCNoPTR # ifdef UINTPTR_MAX # define SCNoPTR @PRIPTR_PREFIX@ "o" # endif #endif -#if !defined SCNuPTR || @PRI_MACROS_BROKEN@ -# undef SCNuPTR +#if !defined SCNuPTR # ifdef UINTPTR_MAX # define SCNuPTR @PRIPTR_PREFIX@ "u" # endif #endif -#if !defined SCNxPTR || @PRI_MACROS_BROKEN@ -# undef SCNxPTR +#if !defined SCNxPTR # ifdef UINTPTR_MAX # define SCNxPTR @PRIPTR_PREFIX@ "x" # endif diff -Nru datamash-1.7/lib/isblank.c datamash-1.8/lib/isblank.c --- datamash-1.7/lib/isblank.c 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/isblank.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* Test whether a character is a blank. - Copyright (C) 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2009-2021 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.7/lib/isfinite.c datamash-1.8/lib/isfinite.c --- datamash-1.7/lib/isfinite.c 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/isfinite.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Test for finite value (zero, subnormal, or normal, and not infinite or NaN). - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 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.7/lib/isinf.c datamash-1.8/lib/isinf.c --- datamash-1.7/lib/isinf.c 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/isinf.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Test for positive or negative infinity. - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 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.7/lib/isnan.c datamash-1.8/lib/isnan.c --- datamash-1.7/lib/isnan.c 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/isnan.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Test for NaN that does not need libm. - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 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.7/lib/isnand.c datamash-1.8/lib/isnand.c --- datamash-1.7/lib/isnand.c 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/isnand.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Test for NaN that does not need libm. - Copyright (C) 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2008-2021 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.7/lib/isnand-nolibm.h datamash-1.8/lib/isnand-nolibm.h --- datamash-1.7/lib/isnand-nolibm.h 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/isnand-nolibm.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Test for NaN that does not need libm. - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 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 @@ -17,8 +17,8 @@ #if HAVE_ISNAND_IN_LIBC /* Get declaration of isnan macro. */ # include -# if __GNUC__ >= 4 - /* GCC 4.0 and newer provides three built-ins for isnan. */ +# if (__GNUC__ >= 4) || (__clang_major__ >= 4) + /* GCC >= 4.0 and clang provide a type-generic built-in for isnan. */ # undef isnand # define isnand(x) __builtin_isnan ((double)(x)) # else diff -Nru datamash-1.7/lib/isnanf.c datamash-1.8/lib/isnanf.c --- datamash-1.7/lib/isnanf.c 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/isnanf.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Test for NaN that does not need libm. - Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2021 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.7/lib/isnanf-nolibm.h datamash-1.8/lib/isnanf-nolibm.h --- datamash-1.7/lib/isnanf-nolibm.h 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/isnanf-nolibm.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Test for NaN that does not need libm. - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 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 @@ -17,10 +17,11 @@ #if HAVE_ISNANF_IN_LIBC /* Get declaration of isnan macro or (older) isnanf function. */ # include -# if __GNUC__ >= 4 - /* GCC 4.0 and newer provides three built-ins for isnan. */ +# if (__GNUC__ >= 4) || (__clang_major__ >= 4) + /* GCC >= 4.0 and clang provide a type-generic built-in for isnan. + GCC >= 4.0 also provides __builtin_isnanf, but clang doesn't. */ # undef isnanf -# define isnanf(x) __builtin_isnanf ((float)(x)) +# define isnanf(x) __builtin_isnan ((float)(x)) # elif defined isnan # undef isnanf # define isnanf(x) isnan ((float)(x)) diff -Nru datamash-1.7/lib/isnanl.c datamash-1.8/lib/isnanl.c --- datamash-1.7/lib/isnanl.c 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/isnanl.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Test for NaN that does not need libm. - Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2021 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.7/lib/isnanl-nolibm.h datamash-1.8/lib/isnanl-nolibm.h --- datamash-1.7/lib/isnanl-nolibm.h 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/isnanl-nolibm.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Test for NaN that does not need libm. - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 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 @@ -17,10 +17,11 @@ #if HAVE_ISNANL_IN_LIBC /* Get declaration of isnan macro or (older) isnanl function. */ # include -# if __GNUC__ >= 4 - /* GCC 4.0 and newer provides three built-ins for isnan. */ +# if (__GNUC__ >= 4) || (__clang_major__ >= 4) + /* GCC >= 4.0 and clang provide a type-generic built-in for isnan. + GCC >= 4.0 also provides __builtin_isnanl, but clang doesn't. */ # undef isnanl -# define isnanl(x) __builtin_isnanl ((long double)(x)) +# define isnanl(x) __builtin_isnan ((long double)(x)) # elif defined isnan # undef isnanl # define isnanl(x) isnan ((long double)(x)) diff -Nru datamash-1.7/lib/iswblank.c datamash-1.8/lib/iswblank.c --- datamash-1.7/lib/iswblank.c 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/iswblank.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Test wide character for being blank. - Copyright (C) 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2008-2021 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.7/lib/iswdigit.c datamash-1.8/lib/iswdigit.c --- datamash-1.7/lib/iswdigit.c 2020-04-23 04:03:28.000000000 +0000 +++ datamash-1.8/lib/iswdigit.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Test wide character for being a digit. - Copyright (C) 2020 Free Software Foundation, Inc. + Copyright (C) 2020-2021 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.7/lib/iswxdigit.c datamash-1.8/lib/iswxdigit.c --- datamash-1.7/lib/iswxdigit.c 2020-04-23 04:03:28.000000000 +0000 +++ datamash-1.8/lib/iswxdigit.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Test wide character for being a hexadecimal digit. - Copyright (C) 2020 Free Software Foundation, Inc. + Copyright (C) 2020-2021 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.7/lib/itold.c datamash-1.8/lib/itold.c --- datamash-1.7/lib/itold.c 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/itold.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Replacement for 'int' to 'long double' conversion routine. - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 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.7/lib/langinfo.in.h datamash-1.8/lib/langinfo.in.h --- datamash-1.7/lib/langinfo.in.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/langinfo.in.h 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,222 @@ +/* Substitute for and wrapper around . + Copyright (C) 2009-2021 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 . */ + +/* + * POSIX for platforms that lack it or have an incomplete one. + * + */ + +#ifndef _@GUARD_PREFIX@_LANGINFO_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_LANGINFO_H@ +# @INCLUDE_NEXT@ @NEXT_LANGINFO_H@ +#endif + +#ifndef _@GUARD_PREFIX@_LANGINFO_H +#define _@GUARD_PREFIX@_LANGINFO_H + + +#if !@HAVE_LANGINFO_H@ + +/* A platform that lacks . */ + +/* Assume that it also lacks and the nl_item type. */ +# if !GNULIB_defined_nl_item +typedef int nl_item; +# define GNULIB_defined_nl_item 1 +# endif + +/* nl_langinfo items of the LC_CTYPE category */ +# define CODESET 10000 +/* nl_langinfo items of the LC_NUMERIC category */ +# define RADIXCHAR 10001 +# define DECIMAL_POINT RADIXCHAR +# define THOUSEP 10002 +# define THOUSANDS_SEP THOUSEP +# define GROUPING 10114 +/* nl_langinfo items of the LC_TIME category */ +# define D_T_FMT 10003 +# define D_FMT 10004 +# define T_FMT 10005 +# define T_FMT_AMPM 10006 +# define AM_STR 10007 +# define PM_STR 10008 +# define DAY_1 10009 +# define DAY_2 (DAY_1 + 1) +# define DAY_3 (DAY_1 + 2) +# define DAY_4 (DAY_1 + 3) +# define DAY_5 (DAY_1 + 4) +# define DAY_6 (DAY_1 + 5) +# define DAY_7 (DAY_1 + 6) +# define ABDAY_1 10016 +# define ABDAY_2 (ABDAY_1 + 1) +# define ABDAY_3 (ABDAY_1 + 2) +# define ABDAY_4 (ABDAY_1 + 3) +# define ABDAY_5 (ABDAY_1 + 4) +# define ABDAY_6 (ABDAY_1 + 5) +# define ABDAY_7 (ABDAY_1 + 6) +# define MON_1 10023 +# define MON_2 (MON_1 + 1) +# define MON_3 (MON_1 + 2) +# define MON_4 (MON_1 + 3) +# define MON_5 (MON_1 + 4) +# define MON_6 (MON_1 + 5) +# define MON_7 (MON_1 + 6) +# define MON_8 (MON_1 + 7) +# define MON_9 (MON_1 + 8) +# define MON_10 (MON_1 + 9) +# define MON_11 (MON_1 + 10) +# define MON_12 (MON_1 + 11) +# define ALTMON_1 10200 +# define ALTMON_2 (ALTMON_1 + 1) +# define ALTMON_3 (ALTMON_1 + 2) +# define ALTMON_4 (ALTMON_1 + 3) +# define ALTMON_5 (ALTMON_1 + 4) +# define ALTMON_6 (ALTMON_1 + 5) +# define ALTMON_7 (ALTMON_1 + 6) +# define ALTMON_8 (ALTMON_1 + 7) +# define ALTMON_9 (ALTMON_1 + 8) +# define ALTMON_10 (ALTMON_1 + 9) +# define ALTMON_11 (ALTMON_1 + 10) +# define ALTMON_12 (ALTMON_1 + 11) +# define ABMON_1 10035 +# define ABMON_2 (ABMON_1 + 1) +# define ABMON_3 (ABMON_1 + 2) +# define ABMON_4 (ABMON_1 + 3) +# define ABMON_5 (ABMON_1 + 4) +# define ABMON_6 (ABMON_1 + 5) +# define ABMON_7 (ABMON_1 + 6) +# define ABMON_8 (ABMON_1 + 7) +# define ABMON_9 (ABMON_1 + 8) +# define ABMON_10 (ABMON_1 + 9) +# define ABMON_11 (ABMON_1 + 10) +# define ABMON_12 (ABMON_1 + 11) +# define ERA 10047 +# define ERA_D_FMT 10048 +# define ERA_D_T_FMT 10049 +# define ERA_T_FMT 10050 +# define ALT_DIGITS 10051 +/* nl_langinfo items of the LC_MONETARY category */ +# define CRNCYSTR 10052 +# define CURRENCY_SYMBOL CRNCYSTR +# define INT_CURR_SYMBOL 10100 +# define MON_DECIMAL_POINT 10101 +# define MON_THOUSANDS_SEP 10102 +# define MON_GROUPING 10103 +# define POSITIVE_SIGN 10104 +# define NEGATIVE_SIGN 10105 +# define FRAC_DIGITS 10106 +# define INT_FRAC_DIGITS 10107 +# define P_CS_PRECEDES 10108 +# define N_CS_PRECEDES 10109 +# define P_SEP_BY_SPACE 10110 +# define N_SEP_BY_SPACE 10111 +# define P_SIGN_POSN 10112 +# define N_SIGN_POSN 10113 +/* nl_langinfo items of the LC_MESSAGES category */ +# define YESEXPR 10053 +# define NOEXPR 10054 + +#else + +/* A platform that has . */ + +# if !@HAVE_LANGINFO_CODESET@ +# define CODESET 10000 +# define GNULIB_defined_CODESET 1 +# endif + +# if !@HAVE_LANGINFO_T_FMT_AMPM@ +# define T_FMT_AMPM 10006 +# define GNULIB_defined_T_FMT_AMPM 1 +# endif + +# if !@HAVE_LANGINFO_ALTMON@ +# define ALTMON_1 10200 +# define ALTMON_2 (ALTMON_1 + 1) +# define ALTMON_3 (ALTMON_1 + 2) +# define ALTMON_4 (ALTMON_1 + 3) +# define ALTMON_5 (ALTMON_1 + 4) +# define ALTMON_6 (ALTMON_1 + 5) +# define ALTMON_7 (ALTMON_1 + 6) +# define ALTMON_8 (ALTMON_1 + 7) +# define ALTMON_9 (ALTMON_1 + 8) +# define ALTMON_10 (ALTMON_1 + 9) +# define ALTMON_11 (ALTMON_1 + 10) +# define ALTMON_12 (ALTMON_1 + 11) +# define GNULIB_defined_ALTMON 1 +# endif + +# if !@HAVE_LANGINFO_ERA@ +# define ERA 10047 +# define ERA_D_FMT 10048 +# define ERA_D_T_FMT 10049 +# define ERA_T_FMT 10050 +# define ALT_DIGITS 10051 +# define GNULIB_defined_ERA 1 +# endif + +# if !@HAVE_LANGINFO_YESEXPR@ +# define YESEXPR 10053 +# define NOEXPR 10054 +# define GNULIB_defined_YESEXPR 1 +# endif + +#endif + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + +/* Declare overridden functions. */ + + +/* Return a piece of locale dependent information. + Note: The difference between nl_langinfo (CODESET) and locale_charset () + is that the latter normalizes the encoding names to GNU conventions. */ + +#if @GNULIB_NL_LANGINFO@ +# if @REPLACE_NL_LANGINFO@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef nl_langinfo +# define nl_langinfo rpl_nl_langinfo +# endif +_GL_FUNCDECL_RPL (nl_langinfo, char *, (nl_item item)); +_GL_CXXALIAS_RPL (nl_langinfo, char *, (nl_item item)); +# else +# if !@HAVE_NL_LANGINFO@ +_GL_FUNCDECL_SYS (nl_langinfo, char *, (nl_item item)); +# endif +_GL_CXXALIAS_SYS (nl_langinfo, char *, (nl_item item)); +# endif +_GL_CXXALIASWARN (nl_langinfo); +#elif defined GNULIB_POSIXCHECK +# undef nl_langinfo +# if HAVE_RAW_DECL_NL_LANGINFO +_GL_WARN_ON_USE (nl_langinfo, "nl_langinfo is not portable - " + "use gnulib module nl_langinfo for portability"); +# endif +#endif + + +#endif /* _@GUARD_PREFIX@_LANGINFO_H */ +#endif /* _@GUARD_PREFIX@_LANGINFO_H */ diff -Nru datamash-1.7/lib/lc-charset-dispatch.c datamash-1.8/lib/lc-charset-dispatch.c --- datamash-1.7/lib/lc-charset-dispatch.c 2020-04-23 04:03:28.000000000 +0000 +++ datamash-1.8/lib/lc-charset-dispatch.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Dispatching based on the current locale's character encoding. - Copyright (C) 2018-2020 Free Software Foundation, Inc. + Copyright (C) 2018-2021 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.7/lib/lc-charset-dispatch.h datamash-1.8/lib/lc-charset-dispatch.h --- datamash-1.7/lib/lc-charset-dispatch.h 2020-04-23 04:03:28.000000000 +0000 +++ datamash-1.8/lib/lc-charset-dispatch.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Dispatching based on the current locale's character encoding. - Copyright (C) 2018-2020 Free Software Foundation, Inc. + Copyright (C) 2018-2021 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.7/lib/ldexpl.c datamash-1.8/lib/ldexpl.c --- datamash-1.7/lib/ldexpl.c 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/ldexpl.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,7 +1,7 @@ /* Emulation for ldexpl. Contributed by Paolo Bonzini - Copyright 2002-2003, 2007-2020 Free Software Foundation, Inc. + Copyright 2002-2003, 2007-2021 Free Software Foundation, Inc. This file is part of gnulib. diff -Nru datamash-1.7/lib/libc-config.h datamash-1.8/lib/libc-config.h --- datamash-1.7/lib/libc-config.h 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/libc-config.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* System definitions for code taken from the GNU C Library - Copyright 2017-2020 Free Software Foundation, Inc. + Copyright 2017-2021 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 @@ -71,107 +71,114 @@ # endif #endif - -/* Prepare to include , which is our copy of glibc - . */ +#ifndef __glibc_likely +/* either does not exist, or predates glibc commit + 2012-12-28T06:33:01Z!siddhesh@redhat.com + (91998e449e0ce758db55aecf2abc3ee510fcbc8f) + and so does not suffice for Gnulib. Prepare to include , + which is Gnulib's copy of a more-recent glibc . */ /* Define _FEATURES_H so that does not include . */ -#ifndef _FEATURES_H -# define _FEATURES_H 1 -#endif +# ifndef _FEATURES_H +# define _FEATURES_H 1 +# endif /* Define __WORDSIZE so that does not attempt to include nonexistent files. Make it a syntax error, since Gnulib does not use __WORDSIZE now, and if Gnulib uses it later the syntax error will let us know that __WORDSIZE needs configuring. */ -#ifndef __WORDSIZE -# define __WORDSIZE %%% -#endif +# ifndef __WORDSIZE +# define __WORDSIZE %%% +# endif /* Undef the macros unconditionally defined by our copy of glibc , so that they do not clash with any system-defined versions. */ -#undef _SYS_CDEFS_H -#undef __ASMNAME -#undef __ASMNAME2 -#undef __BEGIN_DECLS -#undef __CONCAT -#undef __END_DECLS -#undef __HAVE_GENERIC_SELECTION -#undef __LDBL_COMPAT -#undef __LDBL_REDIR -#undef __LDBL_REDIR1 -#undef __LDBL_REDIR1_DECL -#undef __LDBL_REDIR1_NTH -#undef __LDBL_REDIR_DECL -#undef __LDBL_REDIR_NTH -#undef __LEAF -#undef __LEAF_ATTR -#undef __NTH -#undef __NTHNL -#undef __P -#undef __PMT -#undef __REDIRECT -#undef __REDIRECT_LDBL -#undef __REDIRECT_NTH -#undef __REDIRECT_NTHNL -#undef __REDIRECT_NTH_LDBL -#undef __STRING -#undef __THROW -#undef __THROWNL -#undef __always_inline -#undef __attribute__ -#undef __attribute_alloc_size__ -#undef __attribute_artificial__ -#undef __attribute_const__ -#undef __attribute_deprecated__ -#undef __attribute_deprecated_msg__ -#undef __attribute_format_arg__ -#undef __attribute_format_strfmon__ -#undef __attribute_malloc__ -#undef __attribute_noinline__ -#undef __attribute_nonstring__ -#undef __attribute_pure__ -#undef __attribute_used__ -#undef __attribute_warn_unused_result__ -#undef __bos -#undef __bos0 -#undef __errordecl -#undef __extension__ -#undef __extern_always_inline -#undef __extern_inline -#undef __flexarr -#undef __fortify_function -#undef __glibc_c99_flexarr_available -#undef __glibc_clang_has_extension -#undef __glibc_likely -#undef __glibc_macro_warning -#undef __glibc_macro_warning1 -#undef __glibc_unlikely -#undef __inline -#undef __ptr_t -#undef __restrict -#undef __restrict_arr -#undef __va_arg_pack -#undef __va_arg_pack_len -#undef __warnattr -#undef __warndecl +# undef _SYS_CDEFS_H +# undef __ASMNAME +# undef __ASMNAME2 +# undef __BEGIN_DECLS +# undef __CONCAT +# undef __END_DECLS +# undef __HAVE_GENERIC_SELECTION +# undef __LDBL_COMPAT +# undef __LDBL_REDIR +# undef __LDBL_REDIR1 +# undef __LDBL_REDIR1_DECL +# undef __LDBL_REDIR1_NTH +# undef __LDBL_REDIR2_DECL +# undef __LDBL_REDIR_DECL +# undef __LDBL_REDIR_NTH +# undef __LEAF +# undef __LEAF_ATTR +# undef __NTH +# undef __NTHNL +# undef __REDIRECT +# undef __REDIRECT_LDBL +# undef __REDIRECT_NTH +# undef __REDIRECT_NTHNL +# undef __REDIRECT_NTH_LDBL +# undef __STRING +# undef __THROW +# undef __THROWNL +# undef __attr_access +# undef __attribute__ +# undef __attribute_alloc_size__ +# undef __attribute_artificial__ +# undef __attribute_const__ +# undef __attribute_deprecated__ +# undef __attribute_deprecated_msg__ +# undef __attribute_format_arg__ +# undef __attribute_format_strfmon__ +# undef __attribute_malloc__ +# undef __attribute_noinline__ +# undef __attribute_nonstring__ +# undef __attribute_pure__ +# undef __attribute_returns_twice__ +# undef __attribute_used__ +# undef __attribute_warn_unused_result__ +# undef __bos +# undef __bos0 +# undef __errordecl +# undef __extension__ +# undef __extern_always_inline +# undef __extern_inline +# undef __flexarr +# undef __fortify_function +# undef __glibc_c99_flexarr_available +# undef __glibc_clang_has_attribute +# undef __glibc_clang_has_builtin +# undef __glibc_clang_has_extension +# undef __glibc_macro_warning +# undef __glibc_macro_warning1 +# undef __glibc_objsize +# undef __glibc_objsize0 +# undef __glibc_unlikely +# undef __inline +# undef __ptr_t +# undef __restrict +# undef __restrict_arr +# undef __va_arg_pack +# undef __va_arg_pack_len +# undef __warnattr /* Include our copy of glibc . */ -#include +# include /* __inline is too pessimistic for non-GCC. */ -#undef __inline -#ifndef HAVE___INLINE -# if 199901 <= __STDC_VERSION__ || defined inline -# define __inline inline -# else -# define __inline +# undef __inline +# ifndef HAVE___INLINE +# if 199901 <= __STDC_VERSION__ || defined inline +# define __inline inline +# else +# define __inline +# endif # endif -#endif + +#endif /* defined __glibc_likely */ /* A substitute for glibc , good enough for Gnulib. */ #define attribute_hidden -#define libc_hidden_proto(name, ...) +#define libc_hidden_proto(name) #define libc_hidden_def(name) #define libc_hidden_weak(name) #define libc_hidden_ver(local, name) @@ -180,4 +187,5 @@ /* A substitute for glibc , good enough for Gnulib. */ #define SHLIB_COMPAT(lib, introduced, obsoleted) 0 -#define versioned_symbol(lib, local, symbol, version) +#define compat_symbol(lib, local, symbol, version) extern int dummy +#define versioned_symbol(lib, local, symbol, version) extern int dummy diff -Nru datamash-1.7/lib/limits.in.h datamash-1.8/lib/limits.in.h --- datamash-1.7/lib/limits.in.h 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/limits.in.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* A GNU-like . - Copyright 2016-2020 Free Software Foundation, Inc. + Copyright 2016-2021 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 @@ -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@_LIMITS_H - #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ #endif @PRAGMA_COLUMNS@ -/* The include_next requires a split double-inclusion guard. */ +#if defined _GL_ALREADY_INCLUDING_LIMITS_H +/* Special invocation convention: + On Haiku/x86_64, we have a sequence of nested includes + -> -> . + In this situation, LONG_MAX and INT_MAX are not yet defined, + therefore we should not attempt to define LONG_BIT. */ + #@INCLUDE_NEXT@ @NEXT_LIMITS_H@ +#else +/* Normal invocation convention. */ + +#ifndef _@GUARD_PREFIX@_LIMITS_H + +# define _GL_ALREADY_INCLUDING_LIMITS_H + +/* The include_next requires a split double-inclusion guard. */ +# @INCLUDE_NEXT@ @NEXT_LIMITS_H@ + +# undef _GL_ALREADY_INCLUDING_LIMITS_H + #ifndef _@GUARD_PREFIX@_LIMITS_H #define _@GUARD_PREFIX@_LIMITS_H @@ -102,3 +118,4 @@ #endif /* _@GUARD_PREFIX@_LIMITS_H */ #endif /* _@GUARD_PREFIX@_LIMITS_H */ +#endif diff -Nru datamash-1.7/lib/linebuffer.c datamash-1.8/lib/linebuffer.c --- datamash-1.7/lib/linebuffer.c 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/linebuffer.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* linebuffer.c -- read arbitrarily long lines - Copyright (C) 1986, 1991, 1998-1999, 2001, 2003-2004, 2006-2007, 2009-2020 + Copyright (C) 1986, 1991, 1998-1999, 2001, 2003-2004, 2006-2007, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.7/lib/linebuffer.h datamash-1.8/lib/linebuffer.h --- datamash-1.7/lib/linebuffer.h 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/linebuffer.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* linebuffer.h -- declarations for reading arbitrarily long lines - Copyright (C) 1986, 1991, 1998-1999, 2002-2003, 2007, 2009-2020 Free + Copyright (C) 1986, 1991, 1998-1999, 2002-2003, 2007, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.7/lib/localcharset.c datamash-1.8/lib/localcharset.c --- datamash-1.7/lib/localcharset.c 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/localcharset.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* Determine a canonical name for the current locale's character encoding. - Copyright (C) 2000-2006, 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2000-2006, 2008-2021 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.7/lib/localcharset.h datamash-1.8/lib/localcharset.h --- datamash-1.7/lib/localcharset.h 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/localcharset.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Determine a canonical name for the current locale's character encoding. - Copyright (C) 2000-2003, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2000-2003, 2009-2021 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.7/lib/localeconv.c datamash-1.8/lib/localeconv.c --- datamash-1.7/lib/localeconv.c 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/localeconv.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Query locale dependent information for formatting numbers. - Copyright (C) 2012-2020 Free Software Foundation, Inc. + Copyright (C) 2012-2021 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.7/lib/locale.in.h datamash-1.8/lib/locale.in.h --- datamash-1.7/lib/locale.in.h 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/locale.in.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* A POSIX . - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 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.7/lib/localename.c datamash-1.8/lib/localename.c --- datamash-1.7/lib/localename.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/localename.c 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,3470 @@ +/* Determine name of the currently selected locale. + Copyright (C) 1995-2021 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 Ulrich Drepper , 1995. */ +/* Native Windows code written by Tor Lillqvist . */ +/* Mac OS X code written by Bruno Haible . */ + +#include + +/* Specification. */ +#ifdef IN_LIBINTL +# include "gettextP.h" +#else +# include "localename.h" +#endif + +#include +#include +#include +#include +#include +#include + +#include "flexmember.h" +#include "setlocale_null.h" +#include "thread-optim.h" + +/* We cannot support uselocale() on platforms where the locale_t type is fake. + See intl-thread-locale.m4 for details. */ +#if HAVE_WORKING_USELOCALE && !HAVE_FAKE_LOCALES +# define HAVE_GOOD_USELOCALE 1 +#endif + +#if HAVE_GOOD_USELOCALE +/* Mac OS X 10.5 defines the locale_t type in . */ +# if defined __APPLE__ && defined __MACH__ +# include +# endif +# if (__GLIBC__ >= 2 && !defined __UCLIBC__) || (defined __linux__ && HAVE_LANGINFO_H) || defined __CYGWIN__ +# include +# endif +# if !defined IN_LIBINTL +# include "glthread/lock.h" +# endif +# if defined __sun +# if HAVE_GETLOCALENAME_L +/* Solaris >= 12. */ +extern char * getlocalename_l(int, locale_t); +# elif HAVE_SOLARIS114_LOCALES +# include +# endif +# endif +# if HAVE_NAMELESS_LOCALES +# include +# include "localename-table.h" +# endif +#endif + +#if HAVE_CFPREFERENCESCOPYAPPVALUE +# include +# include +#endif + +#if defined _WIN32 && !defined __CYGWIN__ +# define WINDOWS_NATIVE +# if !defined IN_LIBINTL +# include "glthread/lock.h" +# endif +#endif + +#if defined WINDOWS_NATIVE || defined __CYGWIN__ /* Native Windows or Cygwin */ +# define WIN32_LEAN_AND_MEAN +# include +# include +/* List of language codes, sorted by value: + 0x01 LANG_ARABIC + 0x02 LANG_BULGARIAN + 0x03 LANG_CATALAN + 0x04 LANG_CHINESE + 0x05 LANG_CZECH + 0x06 LANG_DANISH + 0x07 LANG_GERMAN + 0x08 LANG_GREEK + 0x09 LANG_ENGLISH + 0x0a LANG_SPANISH + 0x0b LANG_FINNISH + 0x0c LANG_FRENCH + 0x0d LANG_HEBREW + 0x0e LANG_HUNGARIAN + 0x0f LANG_ICELANDIC + 0x10 LANG_ITALIAN + 0x11 LANG_JAPANESE + 0x12 LANG_KOREAN + 0x13 LANG_DUTCH + 0x14 LANG_NORWEGIAN + 0x15 LANG_POLISH + 0x16 LANG_PORTUGUESE + 0x17 LANG_ROMANSH + 0x18 LANG_ROMANIAN + 0x19 LANG_RUSSIAN + 0x1a LANG_CROATIAN == LANG_SERBIAN + 0x1b LANG_SLOVAK + 0x1c LANG_ALBANIAN + 0x1d LANG_SWEDISH + 0x1e LANG_THAI + 0x1f LANG_TURKISH + 0x20 LANG_URDU + 0x21 LANG_INDONESIAN + 0x22 LANG_UKRAINIAN + 0x23 LANG_BELARUSIAN + 0x24 LANG_SLOVENIAN + 0x25 LANG_ESTONIAN + 0x26 LANG_LATVIAN + 0x27 LANG_LITHUANIAN + 0x28 LANG_TAJIK + 0x29 LANG_FARSI + 0x2a LANG_VIETNAMESE + 0x2b LANG_ARMENIAN + 0x2c LANG_AZERI + 0x2d LANG_BASQUE + 0x2e LANG_SORBIAN + 0x2f LANG_MACEDONIAN + 0x30 LANG_SUTU + 0x31 LANG_TSONGA + 0x32 LANG_TSWANA + 0x33 LANG_VENDA + 0x34 LANG_XHOSA + 0x35 LANG_ZULU + 0x36 LANG_AFRIKAANS + 0x37 LANG_GEORGIAN + 0x38 LANG_FAEROESE + 0x39 LANG_HINDI + 0x3a LANG_MALTESE + 0x3b LANG_SAMI + 0x3c LANG_GAELIC + 0x3d LANG_YIDDISH + 0x3e LANG_MALAY + 0x3f LANG_KAZAK + 0x40 LANG_KYRGYZ + 0x41 LANG_SWAHILI + 0x42 LANG_TURKMEN + 0x43 LANG_UZBEK + 0x44 LANG_TATAR + 0x45 LANG_BENGALI + 0x46 LANG_PUNJABI + 0x47 LANG_GUJARATI + 0x48 LANG_ORIYA + 0x49 LANG_TAMIL + 0x4a LANG_TELUGU + 0x4b LANG_KANNADA + 0x4c LANG_MALAYALAM + 0x4d LANG_ASSAMESE + 0x4e LANG_MARATHI + 0x4f LANG_SANSKRIT + 0x50 LANG_MONGOLIAN + 0x51 LANG_TIBETAN + 0x52 LANG_WELSH + 0x53 LANG_CAMBODIAN + 0x54 LANG_LAO + 0x55 LANG_BURMESE + 0x56 LANG_GALICIAN + 0x57 LANG_KONKANI + 0x58 LANG_MANIPURI + 0x59 LANG_SINDHI + 0x5a LANG_SYRIAC + 0x5b LANG_SINHALESE + 0x5c LANG_CHEROKEE + 0x5d LANG_INUKTITUT + 0x5e LANG_AMHARIC + 0x5f LANG_TAMAZIGHT + 0x60 LANG_KASHMIRI + 0x61 LANG_NEPALI + 0x62 LANG_FRISIAN + 0x63 LANG_PASHTO + 0x64 LANG_TAGALOG + 0x65 LANG_DIVEHI + 0x66 LANG_EDO + 0x67 LANG_FULFULDE + 0x68 LANG_HAUSA + 0x69 LANG_IBIBIO + 0x6a LANG_YORUBA + 0x6d LANG_BASHKIR + 0x6e LANG_LUXEMBOURGISH + 0x6f LANG_GREENLANDIC + 0x70 LANG_IGBO + 0x71 LANG_KANURI + 0x72 LANG_OROMO + 0x73 LANG_TIGRINYA + 0x74 LANG_GUARANI + 0x75 LANG_HAWAIIAN + 0x76 LANG_LATIN + 0x77 LANG_SOMALI + 0x78 LANG_YI + 0x79 LANG_PAPIAMENTU + 0x7a LANG_MAPUDUNGUN + 0x7c LANG_MOHAWK + 0x7e LANG_BRETON + 0x82 LANG_OCCITAN + 0x83 LANG_CORSICAN + 0x84 LANG_ALSATIAN + 0x85 LANG_YAKUT + 0x86 LANG_KICHE + 0x87 LANG_KINYARWANDA + 0x88 LANG_WOLOF + 0x8c LANG_DARI + 0x91 LANG_SCOTTISH_GAELIC +*/ +/* Mingw headers don't have latest language and sublanguage codes. */ +# ifndef LANG_AFRIKAANS +# define LANG_AFRIKAANS 0x36 +# endif +# ifndef LANG_ALBANIAN +# define LANG_ALBANIAN 0x1c +# endif +# ifndef LANG_ALSATIAN +# define LANG_ALSATIAN 0x84 +# endif +# ifndef LANG_AMHARIC +# define LANG_AMHARIC 0x5e +# endif +# ifndef LANG_ARABIC +# define LANG_ARABIC 0x01 +# endif +# ifndef LANG_ARMENIAN +# define LANG_ARMENIAN 0x2b +# endif +# ifndef LANG_ASSAMESE +# define LANG_ASSAMESE 0x4d +# endif +# ifndef LANG_AZERI +# define LANG_AZERI 0x2c +# endif +# ifndef LANG_BASHKIR +# define LANG_BASHKIR 0x6d +# endif +# ifndef LANG_BASQUE +# define LANG_BASQUE 0x2d +# endif +# ifndef LANG_BELARUSIAN +# define LANG_BELARUSIAN 0x23 +# endif +# ifndef LANG_BENGALI +# define LANG_BENGALI 0x45 +# endif +# ifndef LANG_BRETON +# define LANG_BRETON 0x7e +# endif +# ifndef LANG_BURMESE +# define LANG_BURMESE 0x55 +# endif +# ifndef LANG_CAMBODIAN +# define LANG_CAMBODIAN 0x53 +# endif +# ifndef LANG_CATALAN +# define LANG_CATALAN 0x03 +# endif +# ifndef LANG_CHEROKEE +# define LANG_CHEROKEE 0x5c +# endif +# ifndef LANG_CORSICAN +# define LANG_CORSICAN 0x83 +# endif +# ifndef LANG_DARI +# define LANG_DARI 0x8c +# endif +# ifndef LANG_DIVEHI +# define LANG_DIVEHI 0x65 +# endif +# ifndef LANG_EDO +# define LANG_EDO 0x66 +# endif +# ifndef LANG_ESTONIAN +# define LANG_ESTONIAN 0x25 +# endif +# ifndef LANG_FAEROESE +# define LANG_FAEROESE 0x38 +# endif +# ifndef LANG_FARSI +# define LANG_FARSI 0x29 +# endif +# ifndef LANG_FRISIAN +# define LANG_FRISIAN 0x62 +# endif +# ifndef LANG_FULFULDE +# define LANG_FULFULDE 0x67 +# endif +# ifndef LANG_GAELIC +# define LANG_GAELIC 0x3c +# endif +# ifndef LANG_GALICIAN +# define LANG_GALICIAN 0x56 +# endif +# ifndef LANG_GEORGIAN +# define LANG_GEORGIAN 0x37 +# endif +# ifndef LANG_GREENLANDIC +# define LANG_GREENLANDIC 0x6f +# endif +# ifndef LANG_GUARANI +# define LANG_GUARANI 0x74 +# endif +# ifndef LANG_GUJARATI +# define LANG_GUJARATI 0x47 +# endif +# ifndef LANG_HAUSA +# define LANG_HAUSA 0x68 +# endif +# ifndef LANG_HAWAIIAN +# define LANG_HAWAIIAN 0x75 +# endif +# ifndef LANG_HEBREW +# define LANG_HEBREW 0x0d +# endif +# ifndef LANG_HINDI +# define LANG_HINDI 0x39 +# endif +# ifndef LANG_IBIBIO +# define LANG_IBIBIO 0x69 +# endif +# ifndef LANG_IGBO +# define LANG_IGBO 0x70 +# endif +# ifndef LANG_INDONESIAN +# define LANG_INDONESIAN 0x21 +# endif +# ifndef LANG_INUKTITUT +# define LANG_INUKTITUT 0x5d +# endif +# ifndef LANG_KANNADA +# define LANG_KANNADA 0x4b +# endif +# ifndef LANG_KANURI +# define LANG_KANURI 0x71 +# endif +# ifndef LANG_KASHMIRI +# define LANG_KASHMIRI 0x60 +# endif +# ifndef LANG_KAZAK +# define LANG_KAZAK 0x3f +# endif +# ifndef LANG_KICHE +# define LANG_KICHE 0x86 +# endif +# ifndef LANG_KINYARWANDA +# define LANG_KINYARWANDA 0x87 +# endif +# ifndef LANG_KONKANI +# define LANG_KONKANI 0x57 +# endif +# ifndef LANG_KYRGYZ +# define LANG_KYRGYZ 0x40 +# endif +# ifndef LANG_LAO +# define LANG_LAO 0x54 +# endif +# ifndef LANG_LATIN +# define LANG_LATIN 0x76 +# endif +# ifndef LANG_LATVIAN +# define LANG_LATVIAN 0x26 +# endif +# ifndef LANG_LITHUANIAN +# define LANG_LITHUANIAN 0x27 +# endif +# ifndef LANG_LUXEMBOURGISH +# define LANG_LUXEMBOURGISH 0x6e +# endif +# ifndef LANG_MACEDONIAN +# define LANG_MACEDONIAN 0x2f +# endif +# ifndef LANG_MALAY +# define LANG_MALAY 0x3e +# endif +# ifndef LANG_MALAYALAM +# define LANG_MALAYALAM 0x4c +# endif +# ifndef LANG_MALTESE +# define LANG_MALTESE 0x3a +# endif +# ifndef LANG_MANIPURI +# define LANG_MANIPURI 0x58 +# endif +# ifndef LANG_MAORI +# define LANG_MAORI 0x81 +# endif +# ifndef LANG_MAPUDUNGUN +# define LANG_MAPUDUNGUN 0x7a +# endif +# ifndef LANG_MARATHI +# define LANG_MARATHI 0x4e +# endif +# ifndef LANG_MOHAWK +# define LANG_MOHAWK 0x7c +# endif +# ifndef LANG_MONGOLIAN +# define LANG_MONGOLIAN 0x50 +# endif +# ifndef LANG_NEPALI +# define LANG_NEPALI 0x61 +# endif +# ifndef LANG_OCCITAN +# define LANG_OCCITAN 0x82 +# endif +# ifndef LANG_ORIYA +# define LANG_ORIYA 0x48 +# endif +# ifndef LANG_OROMO +# define LANG_OROMO 0x72 +# endif +# ifndef LANG_PAPIAMENTU +# define LANG_PAPIAMENTU 0x79 +# endif +# ifndef LANG_PASHTO +# define LANG_PASHTO 0x63 +# endif +# ifndef LANG_PUNJABI +# define LANG_PUNJABI 0x46 +# endif +# ifndef LANG_QUECHUA +# define LANG_QUECHUA 0x6b +# endif +# ifndef LANG_ROMANSH +# define LANG_ROMANSH 0x17 +# endif +# ifndef LANG_SAMI +# define LANG_SAMI 0x3b +# endif +# ifndef LANG_SANSKRIT +# define LANG_SANSKRIT 0x4f +# endif +# ifndef LANG_SCOTTISH_GAELIC +# define LANG_SCOTTISH_GAELIC 0x91 +# endif +# ifndef LANG_SERBIAN +# define LANG_SERBIAN 0x1a +# endif +# ifndef LANG_SINDHI +# define LANG_SINDHI 0x59 +# endif +# ifndef LANG_SINHALESE +# define LANG_SINHALESE 0x5b +# endif +# ifndef LANG_SLOVAK +# define LANG_SLOVAK 0x1b +# endif +# ifndef LANG_SOMALI +# define LANG_SOMALI 0x77 +# endif +# ifndef LANG_SORBIAN +# define LANG_SORBIAN 0x2e +# endif +# ifndef LANG_SOTHO +# define LANG_SOTHO 0x6c +# endif +# ifndef LANG_SUTU +# define LANG_SUTU 0x30 +# endif +# ifndef LANG_SWAHILI +# define LANG_SWAHILI 0x41 +# endif +# ifndef LANG_SYRIAC +# define LANG_SYRIAC 0x5a +# endif +# ifndef LANG_TAGALOG +# define LANG_TAGALOG 0x64 +# endif +# ifndef LANG_TAJIK +# define LANG_TAJIK 0x28 +# endif +# ifndef LANG_TAMAZIGHT +# define LANG_TAMAZIGHT 0x5f +# endif +# ifndef LANG_TAMIL +# define LANG_TAMIL 0x49 +# endif +# ifndef LANG_TATAR +# define LANG_TATAR 0x44 +# endif +# ifndef LANG_TELUGU +# define LANG_TELUGU 0x4a +# endif +# ifndef LANG_THAI +# define LANG_THAI 0x1e +# endif +# ifndef LANG_TIBETAN +# define LANG_TIBETAN 0x51 +# endif +# ifndef LANG_TIGRINYA +# define LANG_TIGRINYA 0x73 +# endif +# ifndef LANG_TSONGA +# define LANG_TSONGA 0x31 +# endif +# ifndef LANG_TSWANA +# define LANG_TSWANA 0x32 +# endif +# ifndef LANG_TURKMEN +# define LANG_TURKMEN 0x42 +# endif +# ifndef LANG_UIGHUR +# define LANG_UIGHUR 0x80 +# endif +# ifndef LANG_UKRAINIAN +# define LANG_UKRAINIAN 0x22 +# endif +# ifndef LANG_URDU +# define LANG_URDU 0x20 +# endif +# ifndef LANG_UZBEK +# define LANG_UZBEK 0x43 +# endif +# ifndef LANG_VENDA +# define LANG_VENDA 0x33 +# endif +# ifndef LANG_VIETNAMESE +# define LANG_VIETNAMESE 0x2a +# endif +# ifndef LANG_WELSH +# define LANG_WELSH 0x52 +# endif +# ifndef LANG_WOLOF +# define LANG_WOLOF 0x88 +# endif +# ifndef LANG_XHOSA +# define LANG_XHOSA 0x34 +# endif +# ifndef LANG_YAKUT +# define LANG_YAKUT 0x85 +# endif +# ifndef LANG_YI +# define LANG_YI 0x78 +# endif +# ifndef LANG_YIDDISH +# define LANG_YIDDISH 0x3d +# endif +# ifndef LANG_YORUBA +# define LANG_YORUBA 0x6a +# endif +# ifndef LANG_ZULU +# define LANG_ZULU 0x35 +# endif +# ifndef SUBLANG_AFRIKAANS_SOUTH_AFRICA +# define SUBLANG_AFRIKAANS_SOUTH_AFRICA 0x01 +# endif +# ifndef SUBLANG_ALBANIAN_ALBANIA +# define SUBLANG_ALBANIAN_ALBANIA 0x01 +# endif +# ifndef SUBLANG_ALSATIAN_FRANCE +# define SUBLANG_ALSATIAN_FRANCE 0x01 +# endif +# ifndef SUBLANG_AMHARIC_ETHIOPIA +# define SUBLANG_AMHARIC_ETHIOPIA 0x01 +# endif +# ifndef SUBLANG_ARABIC_SAUDI_ARABIA +# define SUBLANG_ARABIC_SAUDI_ARABIA 0x01 +# endif +# ifndef SUBLANG_ARABIC_IRAQ +# define SUBLANG_ARABIC_IRAQ 0x02 +# endif +# ifndef SUBLANG_ARABIC_EGYPT +# define SUBLANG_ARABIC_EGYPT 0x03 +# endif +# ifndef SUBLANG_ARABIC_LIBYA +# define SUBLANG_ARABIC_LIBYA 0x04 +# endif +# ifndef SUBLANG_ARABIC_ALGERIA +# define SUBLANG_ARABIC_ALGERIA 0x05 +# endif +# ifndef SUBLANG_ARABIC_MOROCCO +# define SUBLANG_ARABIC_MOROCCO 0x06 +# endif +# ifndef SUBLANG_ARABIC_TUNISIA +# define SUBLANG_ARABIC_TUNISIA 0x07 +# endif +# ifndef SUBLANG_ARABIC_OMAN +# define SUBLANG_ARABIC_OMAN 0x08 +# endif +# ifndef SUBLANG_ARABIC_YEMEN +# define SUBLANG_ARABIC_YEMEN 0x09 +# endif +# ifndef SUBLANG_ARABIC_SYRIA +# define SUBLANG_ARABIC_SYRIA 0x0a +# endif +# ifndef SUBLANG_ARABIC_JORDAN +# define SUBLANG_ARABIC_JORDAN 0x0b +# endif +# ifndef SUBLANG_ARABIC_LEBANON +# define SUBLANG_ARABIC_LEBANON 0x0c +# endif +# ifndef SUBLANG_ARABIC_KUWAIT +# define SUBLANG_ARABIC_KUWAIT 0x0d +# endif +# ifndef SUBLANG_ARABIC_UAE +# define SUBLANG_ARABIC_UAE 0x0e +# endif +# ifndef SUBLANG_ARABIC_BAHRAIN +# define SUBLANG_ARABIC_BAHRAIN 0x0f +# endif +# ifndef SUBLANG_ARABIC_QATAR +# define SUBLANG_ARABIC_QATAR 0x10 +# endif +# ifndef SUBLANG_ARMENIAN_ARMENIA +# define SUBLANG_ARMENIAN_ARMENIA 0x01 +# endif +# ifndef SUBLANG_ASSAMESE_INDIA +# define SUBLANG_ASSAMESE_INDIA 0x01 +# endif +# ifndef SUBLANG_AZERI_LATIN +# define SUBLANG_AZERI_LATIN 0x01 +# endif +# ifndef SUBLANG_AZERI_CYRILLIC +# define SUBLANG_AZERI_CYRILLIC 0x02 +# endif +# ifndef SUBLANG_BASHKIR_RUSSIA +# define SUBLANG_BASHKIR_RUSSIA 0x01 +# endif +# ifndef SUBLANG_BASQUE_BASQUE +# define SUBLANG_BASQUE_BASQUE 0x01 +# endif +# ifndef SUBLANG_BELARUSIAN_BELARUS +# define SUBLANG_BELARUSIAN_BELARUS 0x01 +# endif +# ifndef SUBLANG_BENGALI_INDIA +# define SUBLANG_BENGALI_INDIA 0x01 +# endif +# ifndef SUBLANG_BENGALI_BANGLADESH +# define SUBLANG_BENGALI_BANGLADESH 0x02 +# endif +# ifndef SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN +# define SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN 0x05 +# endif +# ifndef SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC +# define SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC 0x08 +# endif +# ifndef SUBLANG_BRETON_FRANCE +# define SUBLANG_BRETON_FRANCE 0x01 +# endif +# ifndef SUBLANG_BULGARIAN_BULGARIA +# define SUBLANG_BULGARIAN_BULGARIA 0x01 +# endif +# ifndef SUBLANG_CAMBODIAN_CAMBODIA +# define SUBLANG_CAMBODIAN_CAMBODIA 0x01 +# endif +# ifndef SUBLANG_CATALAN_SPAIN +# define SUBLANG_CATALAN_SPAIN 0x01 +# endif +# ifndef SUBLANG_CORSICAN_FRANCE +# define SUBLANG_CORSICAN_FRANCE 0x01 +# endif +# ifndef SUBLANG_CROATIAN_CROATIA +# define SUBLANG_CROATIAN_CROATIA 0x01 +# endif +# ifndef SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN +# define SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN 0x04 +# endif +# ifndef SUBLANG_CHINESE_MACAU +# define SUBLANG_CHINESE_MACAU 0x05 +# endif +# ifndef SUBLANG_CZECH_CZECH_REPUBLIC +# define SUBLANG_CZECH_CZECH_REPUBLIC 0x01 +# endif +# ifndef SUBLANG_DANISH_DENMARK +# define SUBLANG_DANISH_DENMARK 0x01 +# endif +# ifndef SUBLANG_DARI_AFGHANISTAN +# define SUBLANG_DARI_AFGHANISTAN 0x01 +# endif +# ifndef SUBLANG_DIVEHI_MALDIVES +# define SUBLANG_DIVEHI_MALDIVES 0x01 +# endif +# ifndef SUBLANG_DUTCH_SURINAM +# define SUBLANG_DUTCH_SURINAM 0x03 +# endif +# ifndef SUBLANG_ENGLISH_SOUTH_AFRICA +# define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07 +# endif +# ifndef SUBLANG_ENGLISH_JAMAICA +# define SUBLANG_ENGLISH_JAMAICA 0x08 +# endif +# ifndef SUBLANG_ENGLISH_CARIBBEAN +# define SUBLANG_ENGLISH_CARIBBEAN 0x09 +# endif +# ifndef SUBLANG_ENGLISH_BELIZE +# define SUBLANG_ENGLISH_BELIZE 0x0a +# endif +# ifndef SUBLANG_ENGLISH_TRINIDAD +# define SUBLANG_ENGLISH_TRINIDAD 0x0b +# endif +# ifndef SUBLANG_ENGLISH_ZIMBABWE +# define SUBLANG_ENGLISH_ZIMBABWE 0x0c +# endif +# ifndef SUBLANG_ENGLISH_PHILIPPINES +# define SUBLANG_ENGLISH_PHILIPPINES 0x0d +# endif +# ifndef SUBLANG_ENGLISH_INDONESIA +# define SUBLANG_ENGLISH_INDONESIA 0x0e +# endif +# ifndef SUBLANG_ENGLISH_HONGKONG +# define SUBLANG_ENGLISH_HONGKONG 0x0f +# endif +# ifndef SUBLANG_ENGLISH_INDIA +# define SUBLANG_ENGLISH_INDIA 0x10 +# endif +# ifndef SUBLANG_ENGLISH_MALAYSIA +# define SUBLANG_ENGLISH_MALAYSIA 0x11 +# endif +# ifndef SUBLANG_ENGLISH_SINGAPORE +# define SUBLANG_ENGLISH_SINGAPORE 0x12 +# endif +# ifndef SUBLANG_ESTONIAN_ESTONIA +# define SUBLANG_ESTONIAN_ESTONIA 0x01 +# endif +# ifndef SUBLANG_FAEROESE_FAROE_ISLANDS +# define SUBLANG_FAEROESE_FAROE_ISLANDS 0x01 +# endif +# ifndef SUBLANG_FARSI_IRAN +# define SUBLANG_FARSI_IRAN 0x01 +# endif +# ifndef SUBLANG_FINNISH_FINLAND +# define SUBLANG_FINNISH_FINLAND 0x01 +# endif +# ifndef SUBLANG_FRENCH_LUXEMBOURG +# define SUBLANG_FRENCH_LUXEMBOURG 0x05 +# endif +# ifndef SUBLANG_FRENCH_MONACO +# define SUBLANG_FRENCH_MONACO 0x06 +# endif +# ifndef SUBLANG_FRENCH_WESTINDIES +# define SUBLANG_FRENCH_WESTINDIES 0x07 +# endif +# ifndef SUBLANG_FRENCH_REUNION +# define SUBLANG_FRENCH_REUNION 0x08 +# endif +# ifndef SUBLANG_FRENCH_CONGO +# define SUBLANG_FRENCH_CONGO 0x09 +# endif +# ifndef SUBLANG_FRENCH_SENEGAL +# define SUBLANG_FRENCH_SENEGAL 0x0a +# endif +# ifndef SUBLANG_FRENCH_CAMEROON +# define SUBLANG_FRENCH_CAMEROON 0x0b +# endif +# ifndef SUBLANG_FRENCH_COTEDIVOIRE +# define SUBLANG_FRENCH_COTEDIVOIRE 0x0c +# endif +# ifndef SUBLANG_FRENCH_MALI +# define SUBLANG_FRENCH_MALI 0x0d +# endif +# ifndef SUBLANG_FRENCH_MOROCCO +# define SUBLANG_FRENCH_MOROCCO 0x0e +# endif +# ifndef SUBLANG_FRENCH_HAITI +# define SUBLANG_FRENCH_HAITI 0x0f +# endif +# ifndef SUBLANG_FRISIAN_NETHERLANDS +# define SUBLANG_FRISIAN_NETHERLANDS 0x01 +# endif +# ifndef SUBLANG_GALICIAN_SPAIN +# define SUBLANG_GALICIAN_SPAIN 0x01 +# endif +# ifndef SUBLANG_GEORGIAN_GEORGIA +# define SUBLANG_GEORGIAN_GEORGIA 0x01 +# endif +# ifndef SUBLANG_GERMAN_LUXEMBOURG +# define SUBLANG_GERMAN_LUXEMBOURG 0x04 +# endif +# ifndef SUBLANG_GERMAN_LIECHTENSTEIN +# define SUBLANG_GERMAN_LIECHTENSTEIN 0x05 +# endif +# ifndef SUBLANG_GREEK_GREECE +# define SUBLANG_GREEK_GREECE 0x01 +# endif +# ifndef SUBLANG_GREENLANDIC_GREENLAND +# define SUBLANG_GREENLANDIC_GREENLAND 0x01 +# endif +# ifndef SUBLANG_GUJARATI_INDIA +# define SUBLANG_GUJARATI_INDIA 0x01 +# endif +# ifndef SUBLANG_HAUSA_NIGERIA_LATIN +# define SUBLANG_HAUSA_NIGERIA_LATIN 0x01 +# endif +# ifndef SUBLANG_HEBREW_ISRAEL +# define SUBLANG_HEBREW_ISRAEL 0x01 +# endif +# ifndef SUBLANG_HINDI_INDIA +# define SUBLANG_HINDI_INDIA 0x01 +# endif +# ifndef SUBLANG_HUNGARIAN_HUNGARY +# define SUBLANG_HUNGARIAN_HUNGARY 0x01 +# endif +# ifndef SUBLANG_ICELANDIC_ICELAND +# define SUBLANG_ICELANDIC_ICELAND 0x01 +# endif +# ifndef SUBLANG_IGBO_NIGERIA +# define SUBLANG_IGBO_NIGERIA 0x01 +# endif +# ifndef SUBLANG_INDONESIAN_INDONESIA +# define SUBLANG_INDONESIAN_INDONESIA 0x01 +# endif +# ifndef SUBLANG_INUKTITUT_CANADA +# define SUBLANG_INUKTITUT_CANADA 0x01 +# endif +# undef SUBLANG_INUKTITUT_CANADA_LATIN +# define SUBLANG_INUKTITUT_CANADA_LATIN 0x02 +# undef SUBLANG_IRISH_IRELAND +# define SUBLANG_IRISH_IRELAND 0x02 +# ifndef SUBLANG_JAPANESE_JAPAN +# define SUBLANG_JAPANESE_JAPAN 0x01 +# endif +# ifndef SUBLANG_KANNADA_INDIA +# define SUBLANG_KANNADA_INDIA 0x01 +# endif +# ifndef SUBLANG_KASHMIRI_INDIA +# define SUBLANG_KASHMIRI_INDIA 0x02 +# endif +# ifndef SUBLANG_KAZAK_KAZAKHSTAN +# define SUBLANG_KAZAK_KAZAKHSTAN 0x01 +# endif +# ifndef SUBLANG_KICHE_GUATEMALA +# define SUBLANG_KICHE_GUATEMALA 0x01 +# endif +# ifndef SUBLANG_KINYARWANDA_RWANDA +# define SUBLANG_KINYARWANDA_RWANDA 0x01 +# endif +# ifndef SUBLANG_KONKANI_INDIA +# define SUBLANG_KONKANI_INDIA 0x01 +# endif +# ifndef SUBLANG_KYRGYZ_KYRGYZSTAN +# define SUBLANG_KYRGYZ_KYRGYZSTAN 0x01 +# endif +# ifndef SUBLANG_LAO_LAOS +# define SUBLANG_LAO_LAOS 0x01 +# endif +# ifndef SUBLANG_LATVIAN_LATVIA +# define SUBLANG_LATVIAN_LATVIA 0x01 +# endif +# ifndef SUBLANG_LITHUANIAN_LITHUANIA +# define SUBLANG_LITHUANIAN_LITHUANIA 0x01 +# endif +# undef SUBLANG_LOWER_SORBIAN_GERMANY +# define SUBLANG_LOWER_SORBIAN_GERMANY 0x02 +# ifndef SUBLANG_LUXEMBOURGISH_LUXEMBOURG +# define SUBLANG_LUXEMBOURGISH_LUXEMBOURG 0x01 +# endif +# ifndef SUBLANG_MACEDONIAN_MACEDONIA +# define SUBLANG_MACEDONIAN_MACEDONIA 0x01 +# endif +# ifndef SUBLANG_MALAY_MALAYSIA +# define SUBLANG_MALAY_MALAYSIA 0x01 +# endif +# ifndef SUBLANG_MALAY_BRUNEI_DARUSSALAM +# define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02 +# endif +# ifndef SUBLANG_MALAYALAM_INDIA +# define SUBLANG_MALAYALAM_INDIA 0x01 +# endif +# ifndef SUBLANG_MALTESE_MALTA +# define SUBLANG_MALTESE_MALTA 0x01 +# endif +# ifndef SUBLANG_MAORI_NEW_ZEALAND +# define SUBLANG_MAORI_NEW_ZEALAND 0x01 +# endif +# ifndef SUBLANG_MAPUDUNGUN_CHILE +# define SUBLANG_MAPUDUNGUN_CHILE 0x01 +# endif +# ifndef SUBLANG_MARATHI_INDIA +# define SUBLANG_MARATHI_INDIA 0x01 +# endif +# ifndef SUBLANG_MOHAWK_CANADA +# define SUBLANG_MOHAWK_CANADA 0x01 +# endif +# ifndef SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA +# define SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA 0x01 +# endif +# ifndef SUBLANG_MONGOLIAN_PRC +# define SUBLANG_MONGOLIAN_PRC 0x02 +# endif +# ifndef SUBLANG_NEPALI_NEPAL +# define SUBLANG_NEPALI_NEPAL 0x01 +# endif +# ifndef SUBLANG_NEPALI_INDIA +# define SUBLANG_NEPALI_INDIA 0x02 +# endif +# ifndef SUBLANG_OCCITAN_FRANCE +# define SUBLANG_OCCITAN_FRANCE 0x01 +# endif +# ifndef SUBLANG_ORIYA_INDIA +# define SUBLANG_ORIYA_INDIA 0x01 +# endif +# ifndef SUBLANG_PASHTO_AFGHANISTAN +# define SUBLANG_PASHTO_AFGHANISTAN 0x01 +# endif +# ifndef SUBLANG_POLISH_POLAND +# define SUBLANG_POLISH_POLAND 0x01 +# endif +# ifndef SUBLANG_PUNJABI_INDIA +# define SUBLANG_PUNJABI_INDIA 0x01 +# endif +# ifndef SUBLANG_PUNJABI_PAKISTAN +# define SUBLANG_PUNJABI_PAKISTAN 0x02 +# endif +# ifndef SUBLANG_QUECHUA_BOLIVIA +# define SUBLANG_QUECHUA_BOLIVIA 0x01 +# endif +# ifndef SUBLANG_QUECHUA_ECUADOR +# define SUBLANG_QUECHUA_ECUADOR 0x02 +# endif +# ifndef SUBLANG_QUECHUA_PERU +# define SUBLANG_QUECHUA_PERU 0x03 +# endif +# ifndef SUBLANG_ROMANIAN_ROMANIA +# define SUBLANG_ROMANIAN_ROMANIA 0x01 +# endif +# ifndef SUBLANG_ROMANIAN_MOLDOVA +# define SUBLANG_ROMANIAN_MOLDOVA 0x02 +# endif +# ifndef SUBLANG_ROMANSH_SWITZERLAND +# define SUBLANG_ROMANSH_SWITZERLAND 0x01 +# endif +# ifndef SUBLANG_RUSSIAN_RUSSIA +# define SUBLANG_RUSSIAN_RUSSIA 0x01 +# endif +# ifndef SUBLANG_RUSSIAN_MOLDAVIA +# define SUBLANG_RUSSIAN_MOLDAVIA 0x02 +# endif +# ifndef SUBLANG_SAMI_NORTHERN_NORWAY +# define SUBLANG_SAMI_NORTHERN_NORWAY 0x01 +# endif +# ifndef SUBLANG_SAMI_NORTHERN_SWEDEN +# define SUBLANG_SAMI_NORTHERN_SWEDEN 0x02 +# endif +# ifndef SUBLANG_SAMI_NORTHERN_FINLAND +# define SUBLANG_SAMI_NORTHERN_FINLAND 0x03 +# endif +# ifndef SUBLANG_SAMI_LULE_NORWAY +# define SUBLANG_SAMI_LULE_NORWAY 0x04 +# endif +# ifndef SUBLANG_SAMI_LULE_SWEDEN +# define SUBLANG_SAMI_LULE_SWEDEN 0x05 +# endif +# ifndef SUBLANG_SAMI_SOUTHERN_NORWAY +# define SUBLANG_SAMI_SOUTHERN_NORWAY 0x06 +# endif +# ifndef SUBLANG_SAMI_SOUTHERN_SWEDEN +# define SUBLANG_SAMI_SOUTHERN_SWEDEN 0x07 +# endif +# undef SUBLANG_SAMI_SKOLT_FINLAND +# define SUBLANG_SAMI_SKOLT_FINLAND 0x08 +# undef SUBLANG_SAMI_INARI_FINLAND +# define SUBLANG_SAMI_INARI_FINLAND 0x09 +# ifndef SUBLANG_SANSKRIT_INDIA +# define SUBLANG_SANSKRIT_INDIA 0x01 +# endif +# ifndef SUBLANG_SERBIAN_LATIN +# define SUBLANG_SERBIAN_LATIN 0x02 +# endif +# ifndef SUBLANG_SERBIAN_CYRILLIC +# define SUBLANG_SERBIAN_CYRILLIC 0x03 +# endif +# ifndef SUBLANG_SINDHI_INDIA +# define SUBLANG_SINDHI_INDIA 0x01 +# endif +# undef SUBLANG_SINDHI_PAKISTAN +# define SUBLANG_SINDHI_PAKISTAN 0x02 +# ifndef SUBLANG_SINDHI_AFGHANISTAN +# define SUBLANG_SINDHI_AFGHANISTAN 0x02 +# endif +# ifndef SUBLANG_SINHALESE_SRI_LANKA +# define SUBLANG_SINHALESE_SRI_LANKA 0x01 +# endif +# ifndef SUBLANG_SLOVAK_SLOVAKIA +# define SUBLANG_SLOVAK_SLOVAKIA 0x01 +# endif +# ifndef SUBLANG_SLOVENIAN_SLOVENIA +# define SUBLANG_SLOVENIAN_SLOVENIA 0x01 +# endif +# ifndef SUBLANG_SOTHO_SOUTH_AFRICA +# define SUBLANG_SOTHO_SOUTH_AFRICA 0x01 +# endif +# ifndef SUBLANG_SPANISH_GUATEMALA +# define SUBLANG_SPANISH_GUATEMALA 0x04 +# endif +# ifndef SUBLANG_SPANISH_COSTA_RICA +# define SUBLANG_SPANISH_COSTA_RICA 0x05 +# endif +# ifndef SUBLANG_SPANISH_PANAMA +# define SUBLANG_SPANISH_PANAMA 0x06 +# endif +# ifndef SUBLANG_SPANISH_DOMINICAN_REPUBLIC +# define SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07 +# endif +# ifndef SUBLANG_SPANISH_VENEZUELA +# define SUBLANG_SPANISH_VENEZUELA 0x08 +# endif +# ifndef SUBLANG_SPANISH_COLOMBIA +# define SUBLANG_SPANISH_COLOMBIA 0x09 +# endif +# ifndef SUBLANG_SPANISH_PERU +# define SUBLANG_SPANISH_PERU 0x0a +# endif +# ifndef SUBLANG_SPANISH_ARGENTINA +# define SUBLANG_SPANISH_ARGENTINA 0x0b +# endif +# ifndef SUBLANG_SPANISH_ECUADOR +# define SUBLANG_SPANISH_ECUADOR 0x0c +# endif +# ifndef SUBLANG_SPANISH_CHILE +# define SUBLANG_SPANISH_CHILE 0x0d +# endif +# ifndef SUBLANG_SPANISH_URUGUAY +# define SUBLANG_SPANISH_URUGUAY 0x0e +# endif +# ifndef SUBLANG_SPANISH_PARAGUAY +# define SUBLANG_SPANISH_PARAGUAY 0x0f +# endif +# ifndef SUBLANG_SPANISH_BOLIVIA +# define SUBLANG_SPANISH_BOLIVIA 0x10 +# endif +# ifndef SUBLANG_SPANISH_EL_SALVADOR +# define SUBLANG_SPANISH_EL_SALVADOR 0x11 +# endif +# ifndef SUBLANG_SPANISH_HONDURAS +# define SUBLANG_SPANISH_HONDURAS 0x12 +# endif +# ifndef SUBLANG_SPANISH_NICARAGUA +# define SUBLANG_SPANISH_NICARAGUA 0x13 +# endif +# ifndef SUBLANG_SPANISH_PUERTO_RICO +# define SUBLANG_SPANISH_PUERTO_RICO 0x14 +# endif +# ifndef SUBLANG_SPANISH_US +# define SUBLANG_SPANISH_US 0x15 +# endif +# ifndef SUBLANG_SWAHILI_KENYA +# define SUBLANG_SWAHILI_KENYA 0x01 +# endif +# ifndef SUBLANG_SWEDISH_SWEDEN +# define SUBLANG_SWEDISH_SWEDEN 0x01 +# endif +# ifndef SUBLANG_SWEDISH_FINLAND +# define SUBLANG_SWEDISH_FINLAND 0x02 +# endif +# ifndef SUBLANG_SYRIAC_SYRIA +# define SUBLANG_SYRIAC_SYRIA 0x01 +# endif +# ifndef SUBLANG_TAGALOG_PHILIPPINES +# define SUBLANG_TAGALOG_PHILIPPINES 0x01 +# endif +# ifndef SUBLANG_TAJIK_TAJIKISTAN +# define SUBLANG_TAJIK_TAJIKISTAN 0x01 +# endif +# ifndef SUBLANG_TAMAZIGHT_ARABIC +# define SUBLANG_TAMAZIGHT_ARABIC 0x01 +# endif +# ifndef SUBLANG_TAMAZIGHT_ALGERIA_LATIN +# define SUBLANG_TAMAZIGHT_ALGERIA_LATIN 0x02 +# endif +# ifndef SUBLANG_TAMIL_INDIA +# define SUBLANG_TAMIL_INDIA 0x01 +# endif +# ifndef SUBLANG_TATAR_RUSSIA +# define SUBLANG_TATAR_RUSSIA 0x01 +# endif +# ifndef SUBLANG_TELUGU_INDIA +# define SUBLANG_TELUGU_INDIA 0x01 +# endif +# ifndef SUBLANG_THAI_THAILAND +# define SUBLANG_THAI_THAILAND 0x01 +# endif +# ifndef SUBLANG_TIBETAN_PRC +# define SUBLANG_TIBETAN_PRC 0x01 +# endif +# undef SUBLANG_TIBETAN_BHUTAN +# define SUBLANG_TIBETAN_BHUTAN 0x02 +# ifndef SUBLANG_TIGRINYA_ETHIOPIA +# define SUBLANG_TIGRINYA_ETHIOPIA 0x01 +# endif +# ifndef SUBLANG_TIGRINYA_ERITREA +# define SUBLANG_TIGRINYA_ERITREA 0x02 +# endif +# ifndef SUBLANG_TSWANA_SOUTH_AFRICA +# define SUBLANG_TSWANA_SOUTH_AFRICA 0x01 +# endif +# ifndef SUBLANG_TURKISH_TURKEY +# define SUBLANG_TURKISH_TURKEY 0x01 +# endif +# ifndef SUBLANG_TURKMEN_TURKMENISTAN +# define SUBLANG_TURKMEN_TURKMENISTAN 0x01 +# endif +# ifndef SUBLANG_UIGHUR_PRC +# define SUBLANG_UIGHUR_PRC 0x01 +# endif +# ifndef SUBLANG_UKRAINIAN_UKRAINE +# define SUBLANG_UKRAINIAN_UKRAINE 0x01 +# endif +# ifndef SUBLANG_UPPER_SORBIAN_GERMANY +# define SUBLANG_UPPER_SORBIAN_GERMANY 0x01 +# endif +# ifndef SUBLANG_URDU_PAKISTAN +# define SUBLANG_URDU_PAKISTAN 0x01 +# endif +# ifndef SUBLANG_URDU_INDIA +# define SUBLANG_URDU_INDIA 0x02 +# endif +# ifndef SUBLANG_UZBEK_LATIN +# define SUBLANG_UZBEK_LATIN 0x01 +# endif +# ifndef SUBLANG_UZBEK_CYRILLIC +# define SUBLANG_UZBEK_CYRILLIC 0x02 +# endif +# ifndef SUBLANG_VIETNAMESE_VIETNAM +# define SUBLANG_VIETNAMESE_VIETNAM 0x01 +# endif +# ifndef SUBLANG_WELSH_UNITED_KINGDOM +# define SUBLANG_WELSH_UNITED_KINGDOM 0x01 +# endif +# ifndef SUBLANG_WOLOF_SENEGAL +# define SUBLANG_WOLOF_SENEGAL 0x01 +# endif +# ifndef SUBLANG_XHOSA_SOUTH_AFRICA +# define SUBLANG_XHOSA_SOUTH_AFRICA 0x01 +# endif +# ifndef SUBLANG_YAKUT_RUSSIA +# define SUBLANG_YAKUT_RUSSIA 0x01 +# endif +# ifndef SUBLANG_YI_PRC +# define SUBLANG_YI_PRC 0x01 +# endif +# ifndef SUBLANG_YORUBA_NIGERIA +# define SUBLANG_YORUBA_NIGERIA 0x01 +# endif +# ifndef SUBLANG_ZULU_SOUTH_AFRICA +# define SUBLANG_ZULU_SOUTH_AFRICA 0x01 +# endif +/* GetLocaleInfoA operations. */ +# ifndef LOCALE_SNAME +# define LOCALE_SNAME 0x5c +# endif +# ifndef LOCALE_NAME_MAX_LENGTH +# define LOCALE_NAME_MAX_LENGTH 85 +# endif +/* Don't assume that UNICODE is not defined. */ +# undef GetLocaleInfo +# define GetLocaleInfo GetLocaleInfoA +# undef EnumSystemLocales +# define EnumSystemLocales EnumSystemLocalesA +#endif + +/* We want to use the system's setlocale() function here, not the gnulib + override. */ +#undef setlocale + + +#if HAVE_CFPREFERENCESCOPYAPPVALUE +/* Mac OS X 10.4 or newer */ + +/* Canonicalize a Mac OS X locale name to a Unix locale name. + NAME is a sufficiently large buffer. + On input, it contains the Mac OS X locale name. + On output, it contains the Unix locale name. */ +# if !defined IN_LIBINTL +static +# endif +void +gl_locale_name_canonicalize (char *name) +{ + /* This conversion is based on a posting by + Deborah GoldSmith on 2005-03-08, + https://lists.apple.com/archives/carbon-dev/2005/Mar/msg00293.html */ + + /* Convert legacy (NeXTstep inherited) English names to Unix (ISO 639 and + ISO 3166) names. Prior to Mac OS X 10.3, there is no API for doing this. + Therefore we do it ourselves, using a table based on the results of the + Mac OS X 10.3.8 function + CFLocaleCreateCanonicalLocaleIdentifierFromString(). */ + typedef struct { const char legacy[21+1]; const char unixy[5+1]; } + legacy_entry; + static const legacy_entry legacy_table[] = { + { "Afrikaans", "af" }, + { "Albanian", "sq" }, + { "Amharic", "am" }, + { "Arabic", "ar" }, + { "Armenian", "hy" }, + { "Assamese", "as" }, + { "Aymara", "ay" }, + { "Azerbaijani", "az" }, + { "Basque", "eu" }, + { "Belarusian", "be" }, + { "Belorussian", "be" }, + { "Bengali", "bn" }, + { "Brazilian Portugese", "pt_BR" }, + { "Brazilian Portuguese", "pt_BR" }, + { "Breton", "br" }, + { "Bulgarian", "bg" }, + { "Burmese", "my" }, + { "Byelorussian", "be" }, + { "Catalan", "ca" }, + { "Chewa", "ny" }, + { "Chichewa", "ny" }, + { "Chinese", "zh" }, + { "Chinese, Simplified", "zh_CN" }, + { "Chinese, Traditional", "zh_TW" }, + { "Chinese, Tradtional", "zh_TW" }, + { "Croatian", "hr" }, + { "Czech", "cs" }, + { "Danish", "da" }, + { "Dutch", "nl" }, + { "Dzongkha", "dz" }, + { "English", "en" }, + { "Esperanto", "eo" }, + { "Estonian", "et" }, + { "Faroese", "fo" }, + { "Farsi", "fa" }, + { "Finnish", "fi" }, + { "Flemish", "nl_BE" }, + { "French", "fr" }, + { "Galician", "gl" }, + { "Gallegan", "gl" }, + { "Georgian", "ka" }, + { "German", "de" }, + { "Greek", "el" }, + { "Greenlandic", "kl" }, + { "Guarani", "gn" }, + { "Gujarati", "gu" }, + { "Hawaiian", "haw" }, /* Yes, "haw", not "cpe". */ + { "Hebrew", "he" }, + { "Hindi", "hi" }, + { "Hungarian", "hu" }, + { "Icelandic", "is" }, + { "Indonesian", "id" }, + { "Inuktitut", "iu" }, + { "Irish", "ga" }, + { "Italian", "it" }, + { "Japanese", "ja" }, + { "Javanese", "jv" }, + { "Kalaallisut", "kl" }, + { "Kannada", "kn" }, + { "Kashmiri", "ks" }, + { "Kazakh", "kk" }, + { "Khmer", "km" }, + { "Kinyarwanda", "rw" }, + { "Kirghiz", "ky" }, + { "Korean", "ko" }, + { "Kurdish", "ku" }, + { "Latin", "la" }, + { "Latvian", "lv" }, + { "Lithuanian", "lt" }, + { "Macedonian", "mk" }, + { "Malagasy", "mg" }, + { "Malay", "ms" }, + { "Malayalam", "ml" }, + { "Maltese", "mt" }, + { "Manx", "gv" }, + { "Marathi", "mr" }, + { "Moldavian", "mo" }, + { "Mongolian", "mn" }, + { "Nepali", "ne" }, + { "Norwegian", "nb" }, /* Yes, "nb", not the obsolete "no". */ + { "Nyanja", "ny" }, + { "Nynorsk", "nn" }, + { "Oriya", "or" }, + { "Oromo", "om" }, + { "Panjabi", "pa" }, + { "Pashto", "ps" }, + { "Persian", "fa" }, + { "Polish", "pl" }, + { "Portuguese", "pt" }, + { "Portuguese, Brazilian", "pt_BR" }, + { "Punjabi", "pa" }, + { "Pushto", "ps" }, + { "Quechua", "qu" }, + { "Romanian", "ro" }, + { "Ruanda", "rw" }, + { "Rundi", "rn" }, + { "Russian", "ru" }, + { "Sami", "se_NO" }, /* Not just "se". */ + { "Sanskrit", "sa" }, + { "Scottish", "gd" }, + { "Serbian", "sr" }, + { "Simplified Chinese", "zh_CN" }, + { "Sindhi", "sd" }, + { "Sinhalese", "si" }, + { "Slovak", "sk" }, + { "Slovenian", "sl" }, + { "Somali", "so" }, + { "Spanish", "es" }, + { "Sundanese", "su" }, + { "Swahili", "sw" }, + { "Swedish", "sv" }, + { "Tagalog", "tl" }, + { "Tajik", "tg" }, + { "Tajiki", "tg" }, + { "Tamil", "ta" }, + { "Tatar", "tt" }, + { "Telugu", "te" }, + { "Thai", "th" }, + { "Tibetan", "bo" }, + { "Tigrinya", "ti" }, + { "Tongan", "to" }, + { "Traditional Chinese", "zh_TW" }, + { "Turkish", "tr" }, + { "Turkmen", "tk" }, + { "Uighur", "ug" }, + { "Ukrainian", "uk" }, + { "Urdu", "ur" }, + { "Uzbek", "uz" }, + { "Vietnamese", "vi" }, + { "Welsh", "cy" }, + { "Yiddish", "yi" } + }; + + /* Convert new-style locale names with language tags (ISO 639 and ISO 15924) + to Unix (ISO 639 and ISO 3166) names. */ + typedef struct { const char langtag[7+1]; const char unixy[12+1]; } + langtag_entry; + static const langtag_entry langtag_table[] = { + /* Mac OS X has "az-Arab", "az-Cyrl", "az-Latn". + The default script for az on Unix is Latin. */ + { "az-Latn", "az" }, + /* Mac OS X has "bs-Cyrl", "bs-Latn". + The default script for bs on Unix is Latin. */ + { "bs-Latn", "bs" }, + /* Mac OS X has "ga-dots". Does not yet exist on Unix. */ + { "ga-dots", "ga" }, + /* Mac OS X has "kk-Cyrl". + The default script for kk on Unix is Cyrillic. */ + { "kk-Cyrl", "kk" }, + /* Mac OS X has "mn-Cyrl", "mn-Mong". + The default script for mn on Unix is Cyrillic. */ + { "mn-Cyrl", "mn" }, + /* Mac OS X has "ms-Arab", "ms-Latn". + The default script for ms on Unix is Latin. */ + { "ms-Latn", "ms" }, + /* Mac OS X has "pa-Arab", "pa-Guru". + Country codes are used to distinguish these on Unix. */ + { "pa-Arab", "pa_PK" }, + { "pa-Guru", "pa_IN" }, + /* Mac OS X has "shi-Latn", "shi-Tfng". Does not yet exist on Unix. */ + /* Mac OS X has "sr-Cyrl", "sr-Latn". + The default script for sr on Unix is Cyrillic. */ + { "sr-Cyrl", "sr" }, + /* Mac OS X has "tg-Cyrl". + The default script for tg on Unix is Cyrillic. */ + { "tg-Cyrl", "tg" }, + /* Mac OS X has "tk-Cyrl". + The default script for tk on Unix is Cyrillic. */ + { "tk-Cyrl", "tk" }, + /* Mac OS X has "tt-Cyrl". + The default script for tt on Unix is Cyrillic. */ + { "tt-Cyrl", "tt" }, + /* Mac OS X has "uz-Arab", "uz-Cyrl", "uz-Latn". + The default script for uz on Unix is Latin. */ + { "uz-Latn", "uz" }, + /* Mac OS X has "vai-Latn", "vai-Vaii". Does not yet exist on Unix. */ + /* Mac OS X has "yue-Hans", "yue-Hant". + The default script for yue on Unix is Simplified Han. */ + { "yue-Hans", "yue" }, + /* Mac OS X has "zh-Hans", "zh-Hant". + Country codes are used to distinguish these on Unix. */ + { "zh-Hans", "zh_CN" }, + { "zh-Hant", "zh_TW" } + }; + + /* Convert script names (ISO 15924) to Unix conventions. + See https://www.unicode.org/iso15924/iso15924-codes.html */ + typedef struct { const char script[4+1]; const char unixy[9+1]; } + script_entry; + static const script_entry script_table[] = { + { "Arab", "arabic" }, + { "Cyrl", "cyrillic" }, + { "Latn", "latin" }, + { "Mong", "mongolian" } + }; + + /* Step 1: Convert using legacy_table. */ + if (name[0] >= 'A' && name[0] <= 'Z') + { + unsigned int i1, i2; + i1 = 0; + i2 = sizeof (legacy_table) / sizeof (legacy_entry); + while (i2 - i1 > 1) + { + /* At this point we know that if name occurs in legacy_table, + its index must be >= i1 and < i2. */ + unsigned int i = (i1 + i2) >> 1; + const legacy_entry *p = &legacy_table[i]; + if (strcmp (name, p->legacy) < 0) + i2 = i; + else + i1 = i; + } + if (strcmp (name, legacy_table[i1].legacy) == 0) + { + strcpy (name, legacy_table[i1].unixy); + return; + } + } + + /* Step 2: Convert using langtag_table and script_table. */ + if (strlen (name) == 7 && name[2] == '-') + { + unsigned int i1, i2; + i1 = 0; + i2 = sizeof (langtag_table) / sizeof (langtag_entry); + while (i2 - i1 > 1) + { + /* At this point we know that if name occurs in langtag_table, + its index must be >= i1 and < i2. */ + unsigned int i = (i1 + i2) >> 1; + const langtag_entry *p = &langtag_table[i]; + if (strcmp (name, p->langtag) < 0) + i2 = i; + else + i1 = i; + } + if (strcmp (name, langtag_table[i1].langtag) == 0) + { + strcpy (name, langtag_table[i1].unixy); + return; + } + + i1 = 0; + i2 = sizeof (script_table) / sizeof (script_entry); + while (i2 - i1 > 1) + { + /* At this point we know that if (name + 3) occurs in script_table, + its index must be >= i1 and < i2. */ + unsigned int i = (i1 + i2) >> 1; + const script_entry *p = &script_table[i]; + if (strcmp (name + 3, p->script) < 0) + i2 = i; + else + i1 = i; + } + if (strcmp (name + 3, script_table[i1].script) == 0) + { + name[2] = '@'; + strcpy (name + 3, script_table[i1].unixy); + return; + } + } + + /* Step 3: Convert new-style dash to Unix underscore. */ + { + char *p; + for (p = name; *p != '\0'; p++) + if (*p == '-') + *p = '_'; + } +} + +#endif + + +#if defined WINDOWS_NATIVE || defined __CYGWIN__ /* Native Windows or Cygwin */ + +/* Canonicalize a Windows native locale name to a Unix locale name. + NAME is a sufficiently large buffer. + On input, it contains the Windows locale name. + On output, it contains the Unix locale name. */ +# if !defined IN_LIBINTL +static +# endif +void +gl_locale_name_canonicalize (char *name) +{ + /* FIXME: This is probably incomplete: it does not handle "zh-Hans" and + "zh-Hant". */ + char *p; + + for (p = name; *p != '\0'; p++) + if (*p == '-') + { + *p = '_'; + p++; + for (; *p != '\0'; p++) + { + if (*p >= 'a' && *p <= 'z') + *p += 'A' - 'a'; + if (*p == '-') + { + *p = '\0'; + return; + } + } + return; + } +} + +# if !defined IN_LIBINTL +static +# endif +const char * +gl_locale_name_from_win32_LANGID (LANGID langid) +{ + /* Activate the new code only when the GETTEXT_MUI environment variable is + set, for the time being, since the new code is not well tested. */ + if (getenv ("GETTEXT_MUI") != NULL) + { + static char namebuf[256]; + + /* Query the system's notion of locale name. + On Windows95/98/ME, GetLocaleInfoA returns some incorrect results. + But we don't need to support systems that are so old. */ + if (GetLocaleInfoA (MAKELCID (langid, SORT_DEFAULT), LOCALE_SNAME, + namebuf, sizeof (namebuf) - 1)) + { + /* Convert it to a Unix locale name. */ + gl_locale_name_canonicalize (namebuf); + return namebuf; + } + } + /* Internet Explorer has an LCID to RFC3066 name mapping stored in + HKEY_CLASSES_ROOT\Mime\Database\Rfc1766. But we better don't use that + since IE's i18n subsystem is known to be inconsistent with the native + Windows base (e.g. they have different character conversion facilities + that produce different results). */ + /* Use our own table. */ + { + int primary, sub; + + /* Split into language and territory part. */ + primary = PRIMARYLANGID (langid); + sub = SUBLANGID (langid); + + /* Dispatch on language. + See also https://www.unicode.org/unicode/onlinedat/languages.html . + For details about languages, see https://www.ethnologue.com/ . */ + switch (primary) + { + case LANG_AFRIKAANS: + switch (sub) + { + case SUBLANG_AFRIKAANS_SOUTH_AFRICA: return "af_ZA"; + } + return "af"; + case LANG_ALBANIAN: + switch (sub) + { + case SUBLANG_ALBANIAN_ALBANIA: return "sq_AL"; + } + return "sq"; + case LANG_ALSATIAN: + switch (sub) + { + case SUBLANG_ALSATIAN_FRANCE: return "gsw_FR"; + } + return "gsw"; + case LANG_AMHARIC: + switch (sub) + { + case SUBLANG_AMHARIC_ETHIOPIA: return "am_ET"; + } + return "am"; + case LANG_ARABIC: + switch (sub) + { + case SUBLANG_ARABIC_SAUDI_ARABIA: return "ar_SA"; + case SUBLANG_ARABIC_IRAQ: return "ar_IQ"; + case SUBLANG_ARABIC_EGYPT: return "ar_EG"; + case SUBLANG_ARABIC_LIBYA: return "ar_LY"; + case SUBLANG_ARABIC_ALGERIA: return "ar_DZ"; + case SUBLANG_ARABIC_MOROCCO: return "ar_MA"; + case SUBLANG_ARABIC_TUNISIA: return "ar_TN"; + case SUBLANG_ARABIC_OMAN: return "ar_OM"; + case SUBLANG_ARABIC_YEMEN: return "ar_YE"; + case SUBLANG_ARABIC_SYRIA: return "ar_SY"; + case SUBLANG_ARABIC_JORDAN: return "ar_JO"; + case SUBLANG_ARABIC_LEBANON: return "ar_LB"; + case SUBLANG_ARABIC_KUWAIT: return "ar_KW"; + case SUBLANG_ARABIC_UAE: return "ar_AE"; + case SUBLANG_ARABIC_BAHRAIN: return "ar_BH"; + case SUBLANG_ARABIC_QATAR: return "ar_QA"; + } + return "ar"; + case LANG_ARMENIAN: + switch (sub) + { + case SUBLANG_ARMENIAN_ARMENIA: return "hy_AM"; + } + return "hy"; + case LANG_ASSAMESE: + switch (sub) + { + case SUBLANG_ASSAMESE_INDIA: return "as_IN"; + } + return "as"; + case LANG_AZERI: + switch (sub) + { + /* FIXME: Adjust this when Azerbaijani locales appear on Unix. */ + case 0x1e: return "az@latin"; + case SUBLANG_AZERI_LATIN: return "az_AZ@latin"; + case 0x1d: return "az@cyrillic"; + case SUBLANG_AZERI_CYRILLIC: return "az_AZ@cyrillic"; + } + return "az"; + case LANG_BASHKIR: + switch (sub) + { + case SUBLANG_BASHKIR_RUSSIA: return "ba_RU"; + } + return "ba"; + case LANG_BASQUE: + switch (sub) + { + case SUBLANG_BASQUE_BASQUE: return "eu_ES"; + } + return "eu"; /* Ambiguous: could be "eu_ES" or "eu_FR". */ + case LANG_BELARUSIAN: + switch (sub) + { + case SUBLANG_BELARUSIAN_BELARUS: return "be_BY"; + } + return "be"; + case LANG_BENGALI: + switch (sub) + { + case SUBLANG_BENGALI_INDIA: return "bn_IN"; + case SUBLANG_BENGALI_BANGLADESH: return "bn_BD"; + } + return "bn"; + case LANG_BRETON: + switch (sub) + { + case SUBLANG_BRETON_FRANCE: return "br_FR"; + } + return "br"; + case LANG_BULGARIAN: + switch (sub) + { + case SUBLANG_BULGARIAN_BULGARIA: return "bg_BG"; + } + return "bg"; + case LANG_BURMESE: + switch (sub) + { + case SUBLANG_DEFAULT: return "my_MM"; + } + return "my"; + case LANG_CAMBODIAN: + switch (sub) + { + case SUBLANG_CAMBODIAN_CAMBODIA: return "km_KH"; + } + return "km"; + case LANG_CATALAN: + switch (sub) + { + case SUBLANG_CATALAN_SPAIN: return "ca_ES"; + } + return "ca"; + case LANG_CHEROKEE: + switch (sub) + { + case SUBLANG_DEFAULT: return "chr_US"; + } + return "chr"; + case LANG_CHINESE: + switch (sub) + { + case SUBLANG_CHINESE_TRADITIONAL: case 0x1f: return "zh_TW"; + case SUBLANG_CHINESE_SIMPLIFIED: case 0x00: return "zh_CN"; + case SUBLANG_CHINESE_HONGKONG: return "zh_HK"; /* traditional */ + case SUBLANG_CHINESE_SINGAPORE: return "zh_SG"; /* simplified */ + case SUBLANG_CHINESE_MACAU: return "zh_MO"; /* traditional */ + } + return "zh"; + case LANG_CORSICAN: + switch (sub) + { + case SUBLANG_CORSICAN_FRANCE: return "co_FR"; + } + return "co"; + case LANG_CROATIAN: /* LANG_CROATIAN == LANG_SERBIAN == LANG_BOSNIAN + * What used to be called Serbo-Croatian + * should really now be two separate + * languages because of political reasons. + * (Says tml, who knows nothing about Serbian + * or Croatian.) + * (I can feel those flames coming already.) + */ + switch (sub) + { + /* Croatian */ + case 0x00: return "hr"; + case SUBLANG_CROATIAN_CROATIA: return "hr_HR"; + case SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN: return "hr_BA"; + /* Serbian */ + case 0x1f: return "sr"; + case 0x1c: return "sr"; /* latin */ + case SUBLANG_SERBIAN_LATIN: return "sr_CS"; /* latin */ + case 0x09: return "sr_RS"; /* latin */ + case 0x0b: return "sr_ME"; /* latin */ + case 0x06: return "sr_BA"; /* latin */ + case 0x1b: return "sr@cyrillic"; + case SUBLANG_SERBIAN_CYRILLIC: return "sr_CS@cyrillic"; + case 0x0a: return "sr_RS@cyrillic"; + case 0x0c: return "sr_ME@cyrillic"; + case 0x07: return "sr_BA@cyrillic"; + /* Bosnian */ + case 0x1e: return "bs"; + case 0x1a: return "bs"; /* latin */ + case SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_LATIN: return "bs_BA"; /* latin */ + case 0x19: return "bs@cyrillic"; + case SUBLANG_BOSNIAN_BOSNIA_HERZEGOVINA_CYRILLIC: return "bs_BA@cyrillic"; + } + return "hr"; + case LANG_CZECH: + switch (sub) + { + case SUBLANG_CZECH_CZECH_REPUBLIC: return "cs_CZ"; + } + return "cs"; + case LANG_DANISH: + switch (sub) + { + case SUBLANG_DANISH_DENMARK: return "da_DK"; + } + return "da"; + case LANG_DARI: + /* FIXME: Adjust this when such locales appear on Unix. */ + switch (sub) + { + case SUBLANG_DARI_AFGHANISTAN: return "prs_AF"; + } + return "prs"; + case LANG_DIVEHI: + switch (sub) + { + case SUBLANG_DIVEHI_MALDIVES: return "dv_MV"; + } + return "dv"; + case LANG_DUTCH: + switch (sub) + { + case SUBLANG_DUTCH: return "nl_NL"; + case SUBLANG_DUTCH_BELGIAN: /* FLEMISH, VLAAMS */ return "nl_BE"; + case SUBLANG_DUTCH_SURINAM: return "nl_SR"; + } + return "nl"; + case LANG_EDO: + switch (sub) + { + case SUBLANG_DEFAULT: return "bin_NG"; + } + return "bin"; + case LANG_ENGLISH: + switch (sub) + { + /* SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. Heh. I thought + * English was the language spoken in England. + * Oh well. + */ + case SUBLANG_ENGLISH_US: return "en_US"; + case SUBLANG_ENGLISH_UK: return "en_GB"; + case SUBLANG_ENGLISH_AUS: return "en_AU"; + case SUBLANG_ENGLISH_CAN: return "en_CA"; + case SUBLANG_ENGLISH_NZ: return "en_NZ"; + case SUBLANG_ENGLISH_EIRE: return "en_IE"; + case SUBLANG_ENGLISH_SOUTH_AFRICA: return "en_ZA"; + case SUBLANG_ENGLISH_JAMAICA: return "en_JM"; + case SUBLANG_ENGLISH_CARIBBEAN: return "en_GD"; /* Grenada? */ + case SUBLANG_ENGLISH_BELIZE: return "en_BZ"; + case SUBLANG_ENGLISH_TRINIDAD: return "en_TT"; + case SUBLANG_ENGLISH_ZIMBABWE: return "en_ZW"; + case SUBLANG_ENGLISH_PHILIPPINES: return "en_PH"; + case SUBLANG_ENGLISH_INDONESIA: return "en_ID"; + case SUBLANG_ENGLISH_HONGKONG: return "en_HK"; + case SUBLANG_ENGLISH_INDIA: return "en_IN"; + case SUBLANG_ENGLISH_MALAYSIA: return "en_MY"; + case SUBLANG_ENGLISH_SINGAPORE: return "en_SG"; + } + return "en"; + case LANG_ESTONIAN: + switch (sub) + { + case SUBLANG_ESTONIAN_ESTONIA: return "et_EE"; + } + return "et"; + case LANG_FAEROESE: + switch (sub) + { + case SUBLANG_FAEROESE_FAROE_ISLANDS: return "fo_FO"; + } + return "fo"; + case LANG_FARSI: + switch (sub) + { + case SUBLANG_FARSI_IRAN: return "fa_IR"; + } + return "fa"; + case LANG_FINNISH: + switch (sub) + { + case SUBLANG_FINNISH_FINLAND: return "fi_FI"; + } + return "fi"; + case LANG_FRENCH: + switch (sub) + { + case SUBLANG_FRENCH: return "fr_FR"; + case SUBLANG_FRENCH_BELGIAN: /* WALLOON */ return "fr_BE"; + case SUBLANG_FRENCH_CANADIAN: return "fr_CA"; + case SUBLANG_FRENCH_SWISS: return "fr_CH"; + case SUBLANG_FRENCH_LUXEMBOURG: return "fr_LU"; + case SUBLANG_FRENCH_MONACO: return "fr_MC"; + case SUBLANG_FRENCH_WESTINDIES: return "fr"; /* Caribbean? */ + case SUBLANG_FRENCH_REUNION: return "fr_RE"; + case SUBLANG_FRENCH_CONGO: return "fr_CG"; + case SUBLANG_FRENCH_SENEGAL: return "fr_SN"; + case SUBLANG_FRENCH_CAMEROON: return "fr_CM"; + case SUBLANG_FRENCH_COTEDIVOIRE: return "fr_CI"; + case SUBLANG_FRENCH_MALI: return "fr_ML"; + case SUBLANG_FRENCH_MOROCCO: return "fr_MA"; + case SUBLANG_FRENCH_HAITI: return "fr_HT"; + } + return "fr"; + case LANG_FRISIAN: + switch (sub) + { + case SUBLANG_FRISIAN_NETHERLANDS: return "fy_NL"; + } + return "fy"; + case LANG_FULFULDE: + /* Spoken in Nigeria, Guinea, Senegal, Mali, Niger, Cameroon, Benin. */ + switch (sub) + { + case SUBLANG_DEFAULT: return "ff_NG"; + } + return "ff"; + case LANG_GAELIC: + switch (sub) + { + case 0x01: /* SCOTTISH */ + /* old, superseded by LANG_SCOTTISH_GAELIC */ + return "gd_GB"; + case SUBLANG_IRISH_IRELAND: return "ga_IE"; + } + return "ga"; + case LANG_GALICIAN: + switch (sub) + { + case SUBLANG_GALICIAN_SPAIN: return "gl_ES"; + } + return "gl"; + case LANG_GEORGIAN: + switch (sub) + { + case SUBLANG_GEORGIAN_GEORGIA: return "ka_GE"; + } + return "ka"; + case LANG_GERMAN: + switch (sub) + { + case SUBLANG_GERMAN: return "de_DE"; + case SUBLANG_GERMAN_SWISS: return "de_CH"; + case SUBLANG_GERMAN_AUSTRIAN: return "de_AT"; + case SUBLANG_GERMAN_LUXEMBOURG: return "de_LU"; + case SUBLANG_GERMAN_LIECHTENSTEIN: return "de_LI"; + } + return "de"; + case LANG_GREEK: + switch (sub) + { + case SUBLANG_GREEK_GREECE: return "el_GR"; + } + return "el"; + case LANG_GREENLANDIC: + switch (sub) + { + case SUBLANG_GREENLANDIC_GREENLAND: return "kl_GL"; + } + return "kl"; + case LANG_GUARANI: + switch (sub) + { + case SUBLANG_DEFAULT: return "gn_PY"; + } + return "gn"; + case LANG_GUJARATI: + switch (sub) + { + case SUBLANG_GUJARATI_INDIA: return "gu_IN"; + } + return "gu"; + case LANG_HAUSA: + switch (sub) + { + case 0x1f: return "ha"; + case SUBLANG_HAUSA_NIGERIA_LATIN: return "ha_NG"; + } + return "ha"; + case LANG_HAWAIIAN: + /* FIXME: Do they mean Hawaiian ("haw_US", 1000 speakers) + or Hawaii Creole English ("cpe_US", 600000 speakers)? */ + switch (sub) + { + case SUBLANG_DEFAULT: return "cpe_US"; + } + return "cpe"; + case LANG_HEBREW: + switch (sub) + { + case SUBLANG_HEBREW_ISRAEL: return "he_IL"; + } + return "he"; + case LANG_HINDI: + switch (sub) + { + case SUBLANG_HINDI_INDIA: return "hi_IN"; + } + return "hi"; + case LANG_HUNGARIAN: + switch (sub) + { + case SUBLANG_HUNGARIAN_HUNGARY: return "hu_HU"; + } + return "hu"; + case LANG_IBIBIO: + switch (sub) + { + case SUBLANG_DEFAULT: return "nic_NG"; + } + return "nic"; + case LANG_ICELANDIC: + switch (sub) + { + case SUBLANG_ICELANDIC_ICELAND: return "is_IS"; + } + return "is"; + case LANG_IGBO: + switch (sub) + { + case SUBLANG_IGBO_NIGERIA: return "ig_NG"; + } + return "ig"; + case LANG_INDONESIAN: + switch (sub) + { + case SUBLANG_INDONESIAN_INDONESIA: return "id_ID"; + } + return "id"; + case LANG_INUKTITUT: + switch (sub) + { + case 0x1e: return "iu"; /* syllabic */ + case SUBLANG_INUKTITUT_CANADA: return "iu_CA"; /* syllabic */ + case 0x1f: return "iu@latin"; + case SUBLANG_INUKTITUT_CANADA_LATIN: return "iu_CA@latin"; + } + return "iu"; + case LANG_ITALIAN: + switch (sub) + { + case SUBLANG_ITALIAN: return "it_IT"; + case SUBLANG_ITALIAN_SWISS: return "it_CH"; + } + return "it"; + case LANG_JAPANESE: + switch (sub) + { + case SUBLANG_JAPANESE_JAPAN: return "ja_JP"; + } + return "ja"; + case LANG_KANNADA: + switch (sub) + { + case SUBLANG_KANNADA_INDIA: return "kn_IN"; + } + return "kn"; + case LANG_KANURI: + switch (sub) + { + case SUBLANG_DEFAULT: return "kr_NG"; + } + return "kr"; + case LANG_KASHMIRI: + switch (sub) + { + case SUBLANG_DEFAULT: return "ks_PK"; + case SUBLANG_KASHMIRI_INDIA: return "ks_IN"; + } + return "ks"; + case LANG_KAZAK: + switch (sub) + { + case SUBLANG_KAZAK_KAZAKHSTAN: return "kk_KZ"; + } + return "kk"; + case LANG_KICHE: + /* FIXME: Adjust this when such locales appear on Unix. */ + switch (sub) + { + case SUBLANG_KICHE_GUATEMALA: return "qut_GT"; + } + return "qut"; + case LANG_KINYARWANDA: + switch (sub) + { + case SUBLANG_KINYARWANDA_RWANDA: return "rw_RW"; + } + return "rw"; + case LANG_KONKANI: + /* FIXME: Adjust this when such locales appear on Unix. */ + switch (sub) + { + case SUBLANG_KONKANI_INDIA: return "kok_IN"; + } + return "kok"; + case LANG_KOREAN: + switch (sub) + { + case SUBLANG_DEFAULT: return "ko_KR"; + } + return "ko"; + case LANG_KYRGYZ: + switch (sub) + { + case SUBLANG_KYRGYZ_KYRGYZSTAN: return "ky_KG"; + } + return "ky"; + case LANG_LAO: + switch (sub) + { + case SUBLANG_LAO_LAOS: return "lo_LA"; + } + return "lo"; + case LANG_LATIN: + switch (sub) + { + case SUBLANG_DEFAULT: return "la_VA"; + } + return "la"; + case LANG_LATVIAN: + switch (sub) + { + case SUBLANG_LATVIAN_LATVIA: return "lv_LV"; + } + return "lv"; + case LANG_LITHUANIAN: + switch (sub) + { + case SUBLANG_LITHUANIAN_LITHUANIA: return "lt_LT"; + } + return "lt"; + case LANG_LUXEMBOURGISH: + switch (sub) + { + case SUBLANG_LUXEMBOURGISH_LUXEMBOURG: return "lb_LU"; + } + return "lb"; + case LANG_MACEDONIAN: + switch (sub) + { + case SUBLANG_MACEDONIAN_MACEDONIA: return "mk_MK"; + } + return "mk"; + case LANG_MALAY: + switch (sub) + { + case SUBLANG_MALAY_MALAYSIA: return "ms_MY"; + case SUBLANG_MALAY_BRUNEI_DARUSSALAM: return "ms_BN"; + } + return "ms"; + case LANG_MALAYALAM: + switch (sub) + { + case SUBLANG_MALAYALAM_INDIA: return "ml_IN"; + } + return "ml"; + case LANG_MALTESE: + switch (sub) + { + case SUBLANG_MALTESE_MALTA: return "mt_MT"; + } + return "mt"; + case LANG_MANIPURI: + /* FIXME: Adjust this when such locales appear on Unix. */ + switch (sub) + { + case SUBLANG_DEFAULT: return "mni_IN"; + } + return "mni"; + case LANG_MAORI: + switch (sub) + { + case SUBLANG_MAORI_NEW_ZEALAND: return "mi_NZ"; + } + return "mi"; + case LANG_MAPUDUNGUN: + switch (sub) + { + case SUBLANG_MAPUDUNGUN_CHILE: return "arn_CL"; + } + return "arn"; + case LANG_MARATHI: + switch (sub) + { + case SUBLANG_MARATHI_INDIA: return "mr_IN"; + } + return "mr"; + case LANG_MOHAWK: + switch (sub) + { + case SUBLANG_MOHAWK_CANADA: return "moh_CA"; + } + return "moh"; + case LANG_MONGOLIAN: + switch (sub) + { + case SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA: case 0x1e: return "mn_MN"; + case SUBLANG_MONGOLIAN_PRC: case 0x1f: return "mn_CN"; + } + return "mn"; /* Ambiguous: could be "mn_CN" or "mn_MN". */ + case LANG_NEPALI: + switch (sub) + { + case SUBLANG_NEPALI_NEPAL: return "ne_NP"; + case SUBLANG_NEPALI_INDIA: return "ne_IN"; + } + return "ne"; + case LANG_NORWEGIAN: + switch (sub) + { + case 0x1f: return "nb"; + case SUBLANG_NORWEGIAN_BOKMAL: return "nb_NO"; + case 0x1e: return "nn"; + case SUBLANG_NORWEGIAN_NYNORSK: return "nn_NO"; + } + return "no"; + case LANG_OCCITAN: + switch (sub) + { + case SUBLANG_OCCITAN_FRANCE: return "oc_FR"; + } + return "oc"; + case LANG_ORIYA: + switch (sub) + { + case SUBLANG_ORIYA_INDIA: return "or_IN"; + } + return "or"; + case LANG_OROMO: + switch (sub) + { + case SUBLANG_DEFAULT: return "om_ET"; + } + return "om"; + case LANG_PAPIAMENTU: + switch (sub) + { + case SUBLANG_DEFAULT: return "pap_AN"; + } + return "pap"; + case LANG_PASHTO: + switch (sub) + { + case SUBLANG_PASHTO_AFGHANISTAN: return "ps_AF"; + } + return "ps"; /* Ambiguous: could be "ps_PK" or "ps_AF". */ + case LANG_POLISH: + switch (sub) + { + case SUBLANG_POLISH_POLAND: return "pl_PL"; + } + return "pl"; + case LANG_PORTUGUESE: + switch (sub) + { + /* Hmm. SUBLANG_PORTUGUESE_BRAZILIAN == SUBLANG_DEFAULT. + Same phenomenon as SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. */ + case SUBLANG_PORTUGUESE_BRAZILIAN: return "pt_BR"; + case SUBLANG_PORTUGUESE: return "pt_PT"; + } + return "pt"; + case LANG_PUNJABI: + switch (sub) + { + case SUBLANG_PUNJABI_INDIA: return "pa_IN"; /* Gurmukhi script */ + case SUBLANG_PUNJABI_PAKISTAN: return "pa_PK"; /* Arabic script */ + } + return "pa"; + case LANG_QUECHUA: + /* Note: Microsoft uses the non-ISO language code "quz". */ + switch (sub) + { + case SUBLANG_QUECHUA_BOLIVIA: return "qu_BO"; + case SUBLANG_QUECHUA_ECUADOR: return "qu_EC"; + case SUBLANG_QUECHUA_PERU: return "qu_PE"; + } + return "qu"; + case LANG_ROMANIAN: + switch (sub) + { + case SUBLANG_ROMANIAN_ROMANIA: return "ro_RO"; + case SUBLANG_ROMANIAN_MOLDOVA: return "ro_MD"; + } + return "ro"; + case LANG_ROMANSH: + switch (sub) + { + case SUBLANG_ROMANSH_SWITZERLAND: return "rm_CH"; + } + return "rm"; + case LANG_RUSSIAN: + switch (sub) + { + case SUBLANG_RUSSIAN_RUSSIA: return "ru_RU"; + case SUBLANG_RUSSIAN_MOLDAVIA: return "ru_MD"; + } + return "ru"; /* Ambiguous: could be "ru_RU" or "ru_UA" or "ru_MD". */ + case LANG_SAMI: + switch (sub) + { + /* Northern Sami */ + case 0x00: return "se"; + case SUBLANG_SAMI_NORTHERN_NORWAY: return "se_NO"; + case SUBLANG_SAMI_NORTHERN_SWEDEN: return "se_SE"; + case SUBLANG_SAMI_NORTHERN_FINLAND: return "se_FI"; + /* Lule Sami */ + case 0x1f: return "smj"; + case SUBLANG_SAMI_LULE_NORWAY: return "smj_NO"; + case SUBLANG_SAMI_LULE_SWEDEN: return "smj_SE"; + /* Southern Sami */ + case 0x1e: return "sma"; + case SUBLANG_SAMI_SOUTHERN_NORWAY: return "sma_NO"; + case SUBLANG_SAMI_SOUTHERN_SWEDEN: return "sma_SE"; + /* Skolt Sami */ + case 0x1d: return "sms"; + case SUBLANG_SAMI_SKOLT_FINLAND: return "sms_FI"; + /* Inari Sami */ + case 0x1c: return "smn"; + case SUBLANG_SAMI_INARI_FINLAND: return "smn_FI"; + } + return "se"; /* or "smi"? */ + case LANG_SANSKRIT: + switch (sub) + { + case SUBLANG_SANSKRIT_INDIA: return "sa_IN"; + } + return "sa"; + case LANG_SCOTTISH_GAELIC: + switch (sub) + { + case SUBLANG_DEFAULT: return "gd_GB"; + } + return "gd"; + case LANG_SINDHI: + switch (sub) + { + case SUBLANG_SINDHI_INDIA: return "sd_IN"; + case SUBLANG_SINDHI_PAKISTAN: return "sd_PK"; + /*case SUBLANG_SINDHI_AFGHANISTAN: return "sd_AF";*/ + } + return "sd"; + case LANG_SINHALESE: + switch (sub) + { + case SUBLANG_SINHALESE_SRI_LANKA: return "si_LK"; + } + return "si"; + case LANG_SLOVAK: + switch (sub) + { + case SUBLANG_SLOVAK_SLOVAKIA: return "sk_SK"; + } + return "sk"; + case LANG_SLOVENIAN: + switch (sub) + { + case SUBLANG_SLOVENIAN_SLOVENIA: return "sl_SI"; + } + return "sl"; + case LANG_SOMALI: + switch (sub) + { + case SUBLANG_DEFAULT: return "so_SO"; + } + return "so"; + case LANG_SORBIAN: + /* FIXME: Adjust this when such locales appear on Unix. */ + switch (sub) + { + /* Upper Sorbian */ + case 0x00: return "hsb"; + case SUBLANG_UPPER_SORBIAN_GERMANY: return "hsb_DE"; + /* Lower Sorbian */ + case 0x1f: return "dsb"; + case SUBLANG_LOWER_SORBIAN_GERMANY: return "dsb_DE"; + } + return "wen"; + case LANG_SOTHO: + /* + calls it "Sesotho sa Leboa"; according to + + + it's the same as Northern Sotho. */ + switch (sub) + { + case SUBLANG_SOTHO_SOUTH_AFRICA: return "nso_ZA"; + } + return "nso"; + case LANG_SPANISH: + switch (sub) + { + case SUBLANG_SPANISH: return "es_ES"; + case SUBLANG_SPANISH_MEXICAN: return "es_MX"; + case SUBLANG_SPANISH_MODERN: + return "es_ES@modern"; /* not seen on Unix */ + case SUBLANG_SPANISH_GUATEMALA: return "es_GT"; + case SUBLANG_SPANISH_COSTA_RICA: return "es_CR"; + case SUBLANG_SPANISH_PANAMA: return "es_PA"; + case SUBLANG_SPANISH_DOMINICAN_REPUBLIC: return "es_DO"; + case SUBLANG_SPANISH_VENEZUELA: return "es_VE"; + case SUBLANG_SPANISH_COLOMBIA: return "es_CO"; + case SUBLANG_SPANISH_PERU: return "es_PE"; + case SUBLANG_SPANISH_ARGENTINA: return "es_AR"; + case SUBLANG_SPANISH_ECUADOR: return "es_EC"; + case SUBLANG_SPANISH_CHILE: return "es_CL"; + case SUBLANG_SPANISH_URUGUAY: return "es_UY"; + case SUBLANG_SPANISH_PARAGUAY: return "es_PY"; + case SUBLANG_SPANISH_BOLIVIA: return "es_BO"; + case SUBLANG_SPANISH_EL_SALVADOR: return "es_SV"; + case SUBLANG_SPANISH_HONDURAS: return "es_HN"; + case SUBLANG_SPANISH_NICARAGUA: return "es_NI"; + case SUBLANG_SPANISH_PUERTO_RICO: return "es_PR"; + case SUBLANG_SPANISH_US: return "es_US"; + } + return "es"; + case LANG_SUTU: + switch (sub) + { + case SUBLANG_DEFAULT: return "bnt_TZ"; /* or "st_LS" or "nso_ZA"? */ + } + return "bnt"; + case LANG_SWAHILI: + switch (sub) + { + case SUBLANG_SWAHILI_KENYA: return "sw_KE"; + } + return "sw"; + case LANG_SWEDISH: + switch (sub) + { + case SUBLANG_SWEDISH_SWEDEN: return "sv_SE"; + case SUBLANG_SWEDISH_FINLAND: return "sv_FI"; + } + return "sv"; + case LANG_SYRIAC: + switch (sub) + { + case SUBLANG_SYRIAC_SYRIA: return "syr_SY"; /* An extinct language. */ + } + return "syr"; + case LANG_TAGALOG: + switch (sub) + { + case SUBLANG_TAGALOG_PHILIPPINES: return "tl_PH"; /* or "fil_PH"? */ + } + return "tl"; /* or "fil"? */ + case LANG_TAJIK: + switch (sub) + { + case 0x1f: return "tg"; + case SUBLANG_TAJIK_TAJIKISTAN: return "tg_TJ"; + } + return "tg"; + case LANG_TAMAZIGHT: + /* Note: Microsoft uses the non-ISO language code "tmz". */ + switch (sub) + { + /* FIXME: Adjust this when Tamazight locales appear on Unix. */ + case SUBLANG_TAMAZIGHT_ARABIC: return "ber_MA@arabic"; + case 0x1f: return "ber@latin"; + case SUBLANG_TAMAZIGHT_ALGERIA_LATIN: return "ber_DZ@latin"; + } + return "ber"; + case LANG_TAMIL: + switch (sub) + { + case SUBLANG_TAMIL_INDIA: return "ta_IN"; + } + return "ta"; /* Ambiguous: could be "ta_IN" or "ta_LK" or "ta_SG". */ + case LANG_TATAR: + switch (sub) + { + case SUBLANG_TATAR_RUSSIA: return "tt_RU"; + } + return "tt"; + case LANG_TELUGU: + switch (sub) + { + case SUBLANG_TELUGU_INDIA: return "te_IN"; + } + return "te"; + case LANG_THAI: + switch (sub) + { + case SUBLANG_THAI_THAILAND: return "th_TH"; + } + return "th"; + case LANG_TIBETAN: + switch (sub) + { + case SUBLANG_TIBETAN_PRC: + /* Most Tibetans would not like "bo_CN". But Tibet does not yet + have a country code of its own. */ + return "bo"; + case SUBLANG_TIBETAN_BHUTAN: return "bo_BT"; + } + return "bo"; + case LANG_TIGRINYA: + switch (sub) + { + case SUBLANG_TIGRINYA_ETHIOPIA: return "ti_ET"; + case SUBLANG_TIGRINYA_ERITREA: return "ti_ER"; + } + return "ti"; + case LANG_TSONGA: + switch (sub) + { + case SUBLANG_DEFAULT: return "ts_ZA"; + } + return "ts"; + case LANG_TSWANA: + /* Spoken in South Africa, Botswana. */ + switch (sub) + { + case SUBLANG_TSWANA_SOUTH_AFRICA: return "tn_ZA"; + } + return "tn"; + case LANG_TURKISH: + switch (sub) + { + case SUBLANG_TURKISH_TURKEY: return "tr_TR"; + } + return "tr"; + case LANG_TURKMEN: + switch (sub) + { + case SUBLANG_TURKMEN_TURKMENISTAN: return "tk_TM"; + } + return "tk"; + case LANG_UIGHUR: + switch (sub) + { + case SUBLANG_UIGHUR_PRC: return "ug_CN"; + } + return "ug"; + case LANG_UKRAINIAN: + switch (sub) + { + case SUBLANG_UKRAINIAN_UKRAINE: return "uk_UA"; + } + return "uk"; + case LANG_URDU: + switch (sub) + { + case SUBLANG_URDU_PAKISTAN: return "ur_PK"; + case SUBLANG_URDU_INDIA: return "ur_IN"; + } + return "ur"; + case LANG_UZBEK: + switch (sub) + { + case 0x1f: return "uz"; + case SUBLANG_UZBEK_LATIN: return "uz_UZ"; + case 0x1e: return "uz@cyrillic"; + case SUBLANG_UZBEK_CYRILLIC: return "uz_UZ@cyrillic"; + } + return "uz"; + case LANG_VENDA: + switch (sub) + { + case SUBLANG_DEFAULT: return "ve_ZA"; + } + return "ve"; + case LANG_VIETNAMESE: + switch (sub) + { + case SUBLANG_VIETNAMESE_VIETNAM: return "vi_VN"; + } + return "vi"; + case LANG_WELSH: + switch (sub) + { + case SUBLANG_WELSH_UNITED_KINGDOM: return "cy_GB"; + } + return "cy"; + case LANG_WOLOF: + switch (sub) + { + case SUBLANG_WOLOF_SENEGAL: return "wo_SN"; + } + return "wo"; + case LANG_XHOSA: + switch (sub) + { + case SUBLANG_XHOSA_SOUTH_AFRICA: return "xh_ZA"; + } + return "xh"; + case LANG_YAKUT: + switch (sub) + { + case SUBLANG_YAKUT_RUSSIA: return "sah_RU"; + } + return "sah"; + case LANG_YI: + switch (sub) + { + case SUBLANG_YI_PRC: return "ii_CN"; + } + return "ii"; + case LANG_YIDDISH: + switch (sub) + { + case SUBLANG_DEFAULT: return "yi_IL"; + } + return "yi"; + case LANG_YORUBA: + switch (sub) + { + case SUBLANG_YORUBA_NIGERIA: return "yo_NG"; + } + return "yo"; + case LANG_ZULU: + switch (sub) + { + case SUBLANG_ZULU_SOUTH_AFRICA: return "zu_ZA"; + } + return "zu"; + default: return "C"; + } + } +} + +# if !defined IN_LIBINTL +static +# endif +const char * +gl_locale_name_from_win32_LCID (LCID lcid) +{ + LANGID langid; + + /* Strip off the sorting rules, keep only the language part. */ + langid = LANGIDFROMLCID (lcid); + + return gl_locale_name_from_win32_LANGID (langid); +} + +# ifdef WINDOWS_NATIVE + +/* Two variables to interface between get_lcid and the EnumLocales + callback function below. */ +static LCID found_lcid; +static char lname[LC_MAX * (LOCALE_NAME_MAX_LENGTH + 1) + 1]; + +/* Callback function for EnumLocales. */ +static BOOL CALLBACK +enum_locales_fn (LPSTR locale_num_str) +{ + char *endp; + char locval[2 * LOCALE_NAME_MAX_LENGTH + 1 + 1]; + LCID try_lcid = strtoul (locale_num_str, &endp, 16); + + if (GetLocaleInfo (try_lcid, LOCALE_SENGLANGUAGE, + locval, LOCALE_NAME_MAX_LENGTH)) + { + strcat (locval, "_"); + if (GetLocaleInfo (try_lcid, LOCALE_SENGCOUNTRY, + locval + strlen (locval), LOCALE_NAME_MAX_LENGTH)) + { + size_t locval_len = strlen (locval); + + if (strncmp (locval, lname, locval_len) == 0 + && (lname[locval_len] == '.' + || lname[locval_len] == '\0')) + { + found_lcid = try_lcid; + return FALSE; + } + } + } + return TRUE; +} + +/* This lock protects the get_lcid against multiple simultaneous calls. */ +gl_lock_define_initialized(static, get_lcid_lock) + +/* Return the Locale ID (LCID) number given the locale's name, a + string, in LOCALE_NAME. This works by enumerating all the locales + supported by the system, until we find one whose name matches + LOCALE_NAME. */ +static LCID +get_lcid (const char *locale_name) +{ + /* A simple cache. */ + static LCID last_lcid; + static char last_locale[1000]; + + /* Lock while looking for an LCID, to protect access to static + variables: last_lcid, last_locale, found_lcid, and lname. */ + gl_lock_lock (get_lcid_lock); + if (last_lcid > 0 && strcmp (locale_name, last_locale) == 0) + { + gl_lock_unlock (get_lcid_lock); + return last_lcid; + } + strncpy (lname, locale_name, sizeof (lname) - 1); + lname[sizeof (lname) - 1] = '\0'; + found_lcid = 0; + EnumSystemLocales (enum_locales_fn, LCID_SUPPORTED); + if (found_lcid > 0) + { + last_lcid = found_lcid; + strcpy (last_locale, locale_name); + } + gl_lock_unlock (get_lcid_lock); + return found_lcid; +} + +# endif +#endif + + +#if HAVE_GOOD_USELOCALE /* glibc, Mac OS X, FreeBSD >= 9.1, Cygwin >= 2.6, + Solaris 11 OpenIndiana, or Solaris >= 11.4 */ + +/* Simple hash set of strings. We don't want to drag in lots of hash table + code here. */ + +# define SIZE_BITS (sizeof (size_t) * CHAR_BIT) + +/* A hash function for NUL-terminated char* strings using + the method described by Bruno Haible. + See https://www.haible.de/bruno/hashfunc.html. */ +static size_t _GL_ATTRIBUTE_PURE +string_hash (const void *x) +{ + const char *s = (const char *) x; + size_t h = 0; + + for (; *s; s++) + h = *s + ((h << 9) | (h >> (SIZE_BITS - 9))); + + return h; +} + +/* A hash table of fixed size. Multiple threads can access it read-only + simultaneously, but only one thread can insert into it at the same time. */ + +/* A node in a hash bucket collision list. */ +struct struniq_hash_node + { + struct struniq_hash_node * volatile next; + char contents[FLEXIBLE_ARRAY_MEMBER]; + }; + +# define STRUNIQ_HASH_TABLE_SIZE 257 +static struct struniq_hash_node * volatile struniq_hash_table[STRUNIQ_HASH_TABLE_SIZE] + /* = { NULL, ..., NULL } */; + +/* This lock protects the struniq_hash_table against multiple simultaneous + insertions. */ +gl_lock_define_initialized(static, struniq_lock) + +/* Store a copy of the given string in a string pool with indefinite extent. + Return a pointer to this copy. */ +static const char * +struniq (const char *string) +{ + size_t hashcode = string_hash (string); + size_t slot = hashcode % STRUNIQ_HASH_TABLE_SIZE; + size_t size; + struct struniq_hash_node *new_node; + struct struniq_hash_node *p; + for (p = struniq_hash_table[slot]; p != NULL; p = p->next) + if (strcmp (p->contents, string) == 0) + return p->contents; + size = strlen (string) + 1; + new_node = + (struct struniq_hash_node *) + malloc (FLEXSIZEOF (struct struniq_hash_node, contents, size)); + if (new_node == NULL) + /* Out of memory. Return a statically allocated string. */ + return "C"; + memcpy (new_node->contents, string, size); + { + bool mt = gl_multithreaded (); + /* Lock while inserting new_node. */ + if (mt) gl_lock_lock (struniq_lock); + /* Check whether another thread already added the string while we were + waiting on the lock. */ + for (p = struniq_hash_table[slot]; p != NULL; p = p->next) + if (strcmp (p->contents, string) == 0) + { + free (new_node); + new_node = p; + goto done; + } + /* Really insert new_node into the hash table. Fill new_node entirely + first, because other threads may be iterating over the linked list. */ + new_node->next = struniq_hash_table[slot]; + struniq_hash_table[slot] = new_node; + done: + /* Unlock after new_node is inserted. */ + if (mt) gl_lock_unlock (struniq_lock); + } + return new_node->contents; +} + +#endif + + +#if HAVE_GOOD_USELOCALE && HAVE_NAMELESS_LOCALES + +/* The 'locale_t' object does not contain the names of the locale categories. + We have to associate them with the object through a hash table. + The hash table is defined in localename-table.[hc]. */ + +/* Returns the name of a given locale category in a given locale_t object, + allocated as a string with indefinite extent. */ +static const char * +get_locale_t_name (int category, locale_t locale) +{ + if (locale == LC_GLOBAL_LOCALE) + { + /* Query the global locale. */ + const char *name = setlocale_null (category); + if (name != NULL) + return struniq (name); + else + /* Should normally not happen. */ + return ""; + } + else + { + /* Look up the names in the hash table. */ + size_t hashcode = locale_hash_function (locale); + size_t slot = hashcode % LOCALE_HASH_TABLE_SIZE; + /* If the locale was not found in the table, return "". This can + happen if the application uses the original newlocale()/duplocale() + functions instead of the overridden ones. */ + const char *name = ""; + struct locale_hash_node *p; + /* Lock while looking up the hash node. */ + gl_rwlock_rdlock (locale_lock); + for (p = locale_hash_table[slot]; p != NULL; p = p->next) + if (p->locale == locale) + { + name = p->names.category_name[category]; + break; + } + gl_rwlock_unlock (locale_lock); + return name; + } +} + +# if !(defined newlocale && defined duplocale && defined freelocale) +# error "newlocale, duplocale, freelocale not being replaced as expected!" +# endif + +/* newlocale() override. */ +locale_t +newlocale (int category_mask, const char *name, locale_t base) +#undef newlocale +{ + struct locale_categories_names names; + struct locale_hash_node *node; + locale_t result; + + /* Make sure name has indefinite extent. */ + if (((LC_CTYPE_MASK | LC_NUMERIC_MASK | LC_TIME_MASK | LC_COLLATE_MASK + | LC_MONETARY_MASK | LC_MESSAGES_MASK) + & category_mask) != 0) + name = struniq (name); + + /* Determine the category names of the result. */ + if (((LC_CTYPE_MASK | LC_NUMERIC_MASK | LC_TIME_MASK | LC_COLLATE_MASK + | LC_MONETARY_MASK | LC_MESSAGES_MASK) + & ~category_mask) == 0) + { + /* Use name, ignore base. */ + int category; + + name = struniq (name); + for (category = 0; category < 6; category++) + names.category_name[category] = name; + } + else + { + /* Use base, possibly also name. */ + if (base == NULL) + { + int category; + + for (category = 0; category < 6; category++) + { + int mask; + + switch (category) + { + case LC_CTYPE: + mask = LC_CTYPE_MASK; + break; + case LC_NUMERIC: + mask = LC_NUMERIC_MASK; + break; + case LC_TIME: + mask = LC_TIME_MASK; + break; + case LC_COLLATE: + mask = LC_COLLATE_MASK; + break; + case LC_MONETARY: + mask = LC_MONETARY_MASK; + break; + case LC_MESSAGES: + mask = LC_MESSAGES_MASK; + break; + default: + abort (); + } + names.category_name[category] = + ((mask & category_mask) != 0 ? name : "C"); + } + } + else if (base == LC_GLOBAL_LOCALE) + { + int category; + + for (category = 0; category < 6; category++) + { + int mask; + + switch (category) + { + case LC_CTYPE: + mask = LC_CTYPE_MASK; + break; + case LC_NUMERIC: + mask = LC_NUMERIC_MASK; + break; + case LC_TIME: + mask = LC_TIME_MASK; + break; + case LC_COLLATE: + mask = LC_COLLATE_MASK; + break; + case LC_MONETARY: + mask = LC_MONETARY_MASK; + break; + case LC_MESSAGES: + mask = LC_MESSAGES_MASK; + break; + default: + abort (); + } + names.category_name[category] = + ((mask & category_mask) != 0 + ? name + : get_locale_t_name (category, LC_GLOBAL_LOCALE)); + } + } + else + { + /* Look up the names of base in the hash table. Like multiple calls + of get_locale_t_name, but locking only once. */ + struct locale_hash_node *p; + int category; + + /* Lock while looking up the hash node. */ + gl_rwlock_rdlock (locale_lock); + for (p = locale_hash_table[locale_hash_function (base) % LOCALE_HASH_TABLE_SIZE]; + p != NULL; + p = p->next) + if (p->locale == base) + break; + + for (category = 0; category < 6; category++) + { + int mask; + + switch (category) + { + case LC_CTYPE: + mask = LC_CTYPE_MASK; + break; + case LC_NUMERIC: + mask = LC_NUMERIC_MASK; + break; + case LC_TIME: + mask = LC_TIME_MASK; + break; + case LC_COLLATE: + mask = LC_COLLATE_MASK; + break; + case LC_MONETARY: + mask = LC_MONETARY_MASK; + break; + case LC_MESSAGES: + mask = LC_MESSAGES_MASK; + break; + default: + abort (); + } + names.category_name[category] = + ((mask & category_mask) != 0 + ? name + : (p != NULL ? p->names.category_name[category] : "")); + } + + gl_rwlock_unlock (locale_lock); + } + } + + node = (struct locale_hash_node *) malloc (sizeof (struct locale_hash_node)); + if (node == NULL) + /* errno is set to ENOMEM. */ + return NULL; + + result = newlocale (category_mask, name, base); + if (result == NULL) + { + int saved_errno = errno; + free (node); + errno = saved_errno; + return NULL; + } + + /* Fill the hash node. */ + node->locale = result; + node->names = names; + + /* Insert it in the hash table. */ + { + size_t hashcode = locale_hash_function (result); + size_t slot = hashcode % LOCALE_HASH_TABLE_SIZE; + struct locale_hash_node *p; + + /* Lock while inserting the new node. */ + gl_rwlock_wrlock (locale_lock); + for (p = locale_hash_table[slot]; p != NULL; p = p->next) + if (p->locale == result) + { + /* This can happen if the application uses the original freelocale() + function instead of the overridden one. */ + p->names = node->names; + break; + } + if (p == NULL) + { + node->next = locale_hash_table[slot]; + locale_hash_table[slot] = node; + } + + gl_rwlock_unlock (locale_lock); + + if (p != NULL) + free (node); + } + + return result; +} + +/* duplocale() override. */ +locale_t +duplocale (locale_t locale) +#undef duplocale +{ + struct locale_hash_node *node; + locale_t result; + + if (locale == NULL) + /* Invalid argument. */ + abort (); + + node = (struct locale_hash_node *) malloc (sizeof (struct locale_hash_node)); + if (node == NULL) + /* errno is set to ENOMEM. */ + return NULL; + + result = duplocale (locale); + if (result == NULL) + { + int saved_errno = errno; + free (node); + errno = saved_errno; + return NULL; + } + + /* Fill the hash node. */ + node->locale = result; + if (locale == LC_GLOBAL_LOCALE) + { + int category; + + for (category = 0; category < 6; category++) + node->names.category_name[category] = + get_locale_t_name (category, LC_GLOBAL_LOCALE); + + /* Lock before inserting the new node. */ + gl_rwlock_wrlock (locale_lock); + } + else + { + struct locale_hash_node *p; + + /* Lock once, for the lookup and the insertion. */ + gl_rwlock_wrlock (locale_lock); + + for (p = locale_hash_table[locale_hash_function (locale) % LOCALE_HASH_TABLE_SIZE]; + p != NULL; + p = p->next) + if (p->locale == locale) + break; + if (p != NULL) + node->names = p->names; + else + { + /* This can happen if the application uses the original + newlocale()/duplocale() functions instead of the overridden + ones. */ + int category; + + for (category = 0; category < 6; category++) + node->names.category_name[category] = ""; + } + } + + /* Insert it in the hash table. */ + { + size_t hashcode = locale_hash_function (result); + size_t slot = hashcode % LOCALE_HASH_TABLE_SIZE; + struct locale_hash_node *p; + + for (p = locale_hash_table[slot]; p != NULL; p = p->next) + if (p->locale == result) + { + /* This can happen if the application uses the original freelocale() + function instead of the overridden one. */ + p->names = node->names; + break; + } + if (p == NULL) + { + node->next = locale_hash_table[slot]; + locale_hash_table[slot] = node; + } + + gl_rwlock_unlock (locale_lock); + + if (p != NULL) + free (node); + } + + return result; +} + +/* freelocale() override. */ +void +freelocale (locale_t locale) +#undef freelocale +{ + if (locale == NULL || locale == LC_GLOBAL_LOCALE) + /* Invalid argument. */ + abort (); + + { + size_t hashcode = locale_hash_function (locale); + size_t slot = hashcode % LOCALE_HASH_TABLE_SIZE; + struct locale_hash_node *found; + struct locale_hash_node **p; + + found = NULL; + /* Lock while removing the hash node. */ + gl_rwlock_wrlock (locale_lock); + for (p = &locale_hash_table[slot]; *p != NULL; p = &(*p)->next) + if ((*p)->locale == locale) + { + found = *p; + *p = (*p)->next; + break; + } + gl_rwlock_unlock (locale_lock); + free (found); + } + + freelocale (locale); +} + +#endif + + +#if defined IN_LIBINTL || HAVE_GOOD_USELOCALE + +/* Like gl_locale_name_thread, except that the result is not in storage of + indefinite extent. */ +# if !defined IN_LIBINTL +static +# endif +const char * +gl_locale_name_thread_unsafe (int category, const char *categoryname _GL_UNUSED) +{ +# if HAVE_GOOD_USELOCALE + { + locale_t thread_locale = uselocale (NULL); + if (thread_locale != LC_GLOBAL_LOCALE) + { +# if __GLIBC__ >= 2 && !defined __UCLIBC__ + /* Work around an incorrect definition of the _NL_LOCALE_NAME macro in + glibc < 2.12. + See . */ + const char *name = + nl_langinfo (_NL_ITEM ((category), _NL_ITEM_INDEX (-1))); + if (name[0] == '\0') + /* Fallback code for glibc < 2.4, which did not implement + nl_langinfo (_NL_LOCALE_NAME (category)). */ + name = thread_locale->__names[category]; + return name; +# elif defined __linux__ && HAVE_LANGINFO_H && defined NL_LOCALE_NAME + /* musl libc */ + return nl_langinfo_l (NL_LOCALE_NAME (category), thread_locale); +# elif (defined __FreeBSD__ || defined __DragonFly__) || (defined __APPLE__ && defined __MACH__) + /* FreeBSD, Mac OS X */ + int mask; + + switch (category) + { + case LC_CTYPE: + mask = LC_CTYPE_MASK; + break; + case LC_NUMERIC: + mask = LC_NUMERIC_MASK; + break; + case LC_TIME: + mask = LC_TIME_MASK; + break; + case LC_COLLATE: + mask = LC_COLLATE_MASK; + break; + case LC_MONETARY: + mask = LC_MONETARY_MASK; + break; + case LC_MESSAGES: + mask = LC_MESSAGES_MASK; + break; + default: /* We shouldn't get here. */ + return ""; + } + return querylocale (mask, thread_locale); +# elif defined __sun +# if HAVE_GETLOCALENAME_L + /* Solaris >= 12. */ + return getlocalename_l (category, thread_locale); +# elif HAVE_SOLARIS114_LOCALES + /* Solaris >= 11.4. */ + void *lcp = (*thread_locale)->core.data->lcp; + if (lcp != NULL) + switch (category) + { + case LC_CTYPE: + case LC_NUMERIC: + case LC_TIME: + case LC_COLLATE: + case LC_MONETARY: + case LC_MESSAGES: + return ((const char * const *) lcp)[category]; + default: /* We shouldn't get here. */ + return ""; + } +# elif HAVE_NAMELESS_LOCALES + return get_locale_t_name (category, thread_locale); +# else + /* Solaris 11 OpenIndiana. + For the internal structure of locale objects, see + https://github.com/OpenIndiana/illumos-gate/blob/master/usr/src/lib/libc/port/locale/localeimpl.h */ + switch (category) + { + case LC_CTYPE: + case LC_NUMERIC: + case LC_TIME: + case LC_COLLATE: + case LC_MONETARY: + case LC_MESSAGES: + return ((const char * const *) thread_locale)[category]; + default: /* We shouldn't get here. */ + return ""; + } +# endif +# elif defined _AIX && HAVE_NAMELESS_LOCALES + return get_locale_t_name (category, thread_locale); +# elif defined __CYGWIN__ + /* Cygwin < 2.6 lacks uselocale and thread-local locales altogether. + Cygwin <= 2.6.1 lacks NL_LOCALE_NAME, requiring peeking inside + an opaque struct. */ +# ifdef NL_LOCALE_NAME + return nl_langinfo_l (NL_LOCALE_NAME (category), thread_locale); +# else + /* FIXME: Remove when we can assume new-enough Cygwin. */ + struct __locale_t { + char categories[7][32]; + }; + return ((struct __locale_t *) thread_locale)->categories[category]; +# endif +# elif defined __ANDROID__ + return MB_CUR_MAX == 4 ? "C.UTF-8" : "C"; +# endif + } + } +# endif + return NULL; +} + +#endif + +const char * +gl_locale_name_thread (int category, const char *categoryname _GL_UNUSED) +{ +#if HAVE_GOOD_USELOCALE + const char *name = gl_locale_name_thread_unsafe (category, categoryname); + if (name != NULL) + return struniq (name); +#endif + /* On WINDOWS_NATIVE, don't use GetThreadLocale() here, because when + SetThreadLocale has not been called - which is a very frequent case - + the value of GetThreadLocale() ignores past calls to 'setlocale'. */ + return NULL; +} + +/* XPG3 defines the result of 'setlocale (category, NULL)' as: + "Directs 'setlocale()' to query 'category' and return the current + setting of 'local'." + However it does not specify the exact format. Neither do SUSV2 and + ISO C 99. So we can use this feature only on selected systems (e.g. + those using GNU C Library). */ +#if defined _LIBC || ((defined __GLIBC__ && __GLIBC__ >= 2) && !defined __UCLIBC__) +# define HAVE_LOCALE_NULL +#endif + +const char * +gl_locale_name_posix (int category, const char *categoryname _GL_UNUSED) +{ +#if defined WINDOWS_NATIVE + if (LC_MIN <= category && category <= LC_MAX) + { + const char *locname = + /* setlocale_null (category) is identical to setlocale (category, NULL) + on this platform. */ + setlocale (category, NULL); + + /* Convert locale name to LCID. We don't want to use + LocaleNameToLCID because (a) it is only available since Vista, + and (b) it doesn't accept locale names returned by 'setlocale'. */ + LCID lcid = get_lcid (locname); + + if (lcid > 0) + return gl_locale_name_from_win32_LCID (lcid); + } +#endif + { + const char *locname; + + /* Use the POSIX methods of looking to 'LC_ALL', 'LC_xxx', and 'LANG'. + On some systems this can be done by the 'setlocale' function itself. */ +#if defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL + locname = setlocale_null (category); +#else + /* On other systems we ignore what setlocale reports and instead look at the + environment variables directly. This is necessary + 1. on systems which have a facility for customizing the default locale + (Mac OS X, native Windows, Cygwin) and where the system's setlocale() + function ignores this default locale (Mac OS X, Cygwin), in two cases: + a. when the user missed to use the setlocale() override from libintl + (for example by not including ), + b. when setlocale supports only the "C" locale, such as on Cygwin + 1.5.x. In this case even the override from libintl cannot help. + 2. on all systems where setlocale supports only the "C" locale. */ + /* Strictly speaking, it is a POSIX violation to look at the environment + variables regardless whether setlocale has been called or not. POSIX + says: + "For C-language programs, the POSIX locale shall be the + default locale when the setlocale() function is not called." + But we assume that all programs that use internationalized APIs call + setlocale (LC_ALL, ""). */ + locname = gl_locale_name_environ (category, categoryname); +#endif + /* Convert the locale name from the format returned by setlocale() or found + in the environment variables to the XPG syntax. */ +#if defined WINDOWS_NATIVE + if (locname != NULL) + { + /* Convert locale name to LCID. We don't want to use + LocaleNameToLCID because (a) it is only available since Vista, + and (b) it doesn't accept locale names returned by 'setlocale'. */ + LCID lcid = get_lcid (locname); + + if (lcid > 0) + return gl_locale_name_from_win32_LCID (lcid); + } +#endif + return locname; + } +} + +const char * +gl_locale_name_environ (int category _GL_UNUSED, const char *categoryname) +{ + const char *retval; + + /* Setting of LC_ALL overrides all other. */ + retval = getenv ("LC_ALL"); + if (retval != NULL && retval[0] != '\0') + return retval; + /* Next comes the name of the desired category. */ + retval = getenv (categoryname); + if (retval != NULL && retval[0] != '\0') + return retval; + /* Last possibility is the LANG environment variable. */ + retval = getenv ("LANG"); + if (retval != NULL && retval[0] != '\0') + { +#if HAVE_CFPREFERENCESCOPYAPPVALUE + /* Mac OS X 10.2 or newer. + Ignore invalid LANG value set by the Terminal application. */ + if (strcmp (retval, "UTF-8") != 0) +#endif +#if defined __CYGWIN__ + /* Cygwin. + Ignore dummy LANG value set by ~/.profile. */ + if (strcmp (retval, "C.UTF-8") != 0) +#endif + return retval; + } + + return NULL; +} + +const char * +gl_locale_name_default (void) +{ + /* POSIX:2001 says: + "All implementations shall define a locale as the default locale, to be + invoked when no environment variables are set, or set to the empty + string. This default locale can be the POSIX locale or any other + implementation-defined locale. Some implementations may provide + facilities for local installation administrators to set the default + locale, customizing it for each location. POSIX:2001 does not require + such a facility. + + The systems with such a facility are Mac OS X and Windows: They provide a + GUI that allows the user to choose a locale. + - On Mac OS X, by default, none of LC_* or LANG are set. Starting with + Mac OS X 10.4 or 10.5, LANG is set for processes launched by the + 'Terminal' application (but sometimes to an incorrect value "UTF-8"). + When no environment variable is set, setlocale (LC_ALL, "") uses the + "C" locale. + - On native Windows, by default, none of LC_* or LANG are set. + When no environment variable is set, setlocale (LC_ALL, "") uses the + locale chosen by the user. + - On Cygwin 1.5.x, by default, none of LC_* or LANG are set. + When no environment variable is set, setlocale (LC_ALL, "") uses the + "C" locale. + - On Cygwin 1.7, by default, LANG is set to "C.UTF-8" when the default + ~/.profile is executed. + When no environment variable is set, setlocale (LC_ALL, "") uses the + "C.UTF-8" locale, which operates in the same way as the "C" locale. + */ + +#if !(HAVE_CFPREFERENCESCOPYAPPVALUE || defined WINDOWS_NATIVE || defined __CYGWIN__) + + /* The system does not have a way of setting the locale, other than the + POSIX specified environment variables. We use C as default locale. */ + return "C"; + +#else + + /* Return an XPG style locale name language[_territory][@modifier]. + Don't even bother determining the codeset; it's not useful in this + context, because message catalogs are not specific to a single + codeset. */ + +# if HAVE_CFPREFERENCESCOPYAPPVALUE + /* Mac OS X 10.4 or newer */ + /* Don't use the API introduced in Mac OS X 10.5, CFLocaleCopyCurrent, + because in macOS 10.13.4 it has the following behaviour: + When two or more languages are specified in the + "System Preferences > Language & Region > Preferred Languages" panel, + it returns en_CC where CC is the territory (even when English is not among + the preferred languages!). What we want instead is what + CFLocaleCopyCurrent returned in earlier macOS releases and what + CFPreferencesCopyAppValue still returns, namely ll_CC where ll is the + first among the preferred languages and CC is the territory. */ + { + /* Cache the locale name, since CoreFoundation calls are expensive. */ + static const char *cached_localename; + + if (cached_localename == NULL) + { + char namebuf[256]; + CFTypeRef value = + CFPreferencesCopyAppValue (CFSTR ("AppleLocale"), + kCFPreferencesCurrentApplication); + if (value != NULL && CFGetTypeID (value) == CFStringGetTypeID ()) + { + CFStringRef name = (CFStringRef)value; + + if (CFStringGetCString (name, namebuf, sizeof (namebuf), + kCFStringEncodingASCII)) + { + gl_locale_name_canonicalize (namebuf); + cached_localename = strdup (namebuf); + } + } + if (cached_localename == NULL) + cached_localename = "C"; + } + return cached_localename; + } + +# endif + +# if defined WINDOWS_NATIVE || defined __CYGWIN__ /* Native Windows or Cygwin */ + { + LCID lcid; + + /* Use native Windows API locale ID. */ + lcid = GetThreadLocale (); + + return gl_locale_name_from_win32_LCID (lcid); + } +# endif +#endif +} + +/* Determine the current locale's name, and canonicalize it into XPG syntax + language[_territory][.codeset][@modifier] + The codeset part in the result is not reliable; the locale_charset() + should be used for codeset information instead. + The result must not be freed; it is statically allocated. */ + +const char * +gl_locale_name (int category, const char *categoryname) +{ + const char *retval; + + retval = gl_locale_name_thread (category, categoryname); + if (retval != NULL) + return retval; + + retval = gl_locale_name_posix (category, categoryname); + if (retval != NULL) + return retval; + + return gl_locale_name_default (); +} diff -Nru datamash-1.7/lib/localename.h datamash-1.8/lib/localename.h --- datamash-1.7/lib/localename.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/localename.h 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,98 @@ +/* Determine name of the currently selected locale. + Copyright (C) 2007, 2009-2021 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_LOCALENAME_H +#define _GL_LOCALENAME_H + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Determine the current locale's name. + It considers both the POSIX notion of locale name (see functions + gl_locale_name_thread and gl_locale_name_posix) and the system notion + of locale name (see function gl_locale_name_default). + CATEGORY is a locale category abbreviation, as defined in , + but not LC_ALL. E.g. LC_MESSAGES. + CATEGORYNAME is the name of CATEGORY as a string, e.g. "LC_MESSAGES". + Return the locale category's name, canonicalized into XPG syntax + language[_territory][.codeset][@modifier] + The codeset part in the result is not reliable; the locale_charset() + should be used for codeset information instead. + The result must not be freed; it is statically allocated. */ +extern const char * gl_locale_name (int category, const char *categoryname); + +/* Determine the current per-thread locale's name, as specified by uselocale() + calls. + CATEGORY is a locale category abbreviation, as defined in , + but not LC_ALL. E.g. LC_MESSAGES. + CATEGORYNAME is the name of CATEGORY as a string, e.g. "LC_MESSAGES". + Return the locale category's name, canonicalized into XPG syntax + language[_territory][.codeset][@modifier] + or NULL if no locale has been specified for the current thread. + The codeset part in the result is not reliable; the locale_charset() + should be used for codeset information instead. + The result must not be freed; it is statically allocated. */ +extern const char * gl_locale_name_thread (int category, const char *categoryname); + +/* Determine the thread-independent current locale's name, as specified by + setlocale() calls or by environment variables. + CATEGORY is a locale category abbreviation, as defined in , + but not LC_ALL. E.g. LC_MESSAGES. + CATEGORYNAME is the name of CATEGORY as a string, e.g. "LC_MESSAGES". + Return the locale category's name, canonicalized into XPG syntax + language[_territory][.codeset][@modifier] + or NULL if no locale has been specified to setlocale() or by environment + variables. + The codeset part in the result is not reliable; the locale_charset() + should be used for codeset information instead. + The result must not be freed; it is statically allocated. */ +extern const char * gl_locale_name_posix (int category, const char *categoryname); + +/* Determine the default locale's name, as specified by environment + variables. + Return the locale category's name, or NULL if no locale has been specified + by environment variables. + The result must not be freed; it is statically allocated. */ +extern const char * gl_locale_name_environ (int category, const char *categoryname); + +/* Determine the default locale's name. This is the current locale's name, + if not specified by uselocale() calls, by setlocale() calls, or by + environment variables. This locale name is usually determined by systems + settings that the user can manipulate through a GUI. + + Quoting POSIX:2001: + "All implementations shall define a locale as the default locale, + to be invoked when no environment variables are set, or set to the + empty string. This default locale can be the C locale or any other + implementation-defined locale. Some implementations may provide + facilities for local installation administrators to set the default + locale, customizing it for each location. IEEE Std 1003.1-2001 does + not require such a facility." + + The result must not be freed; it is statically allocated. */ +extern const char * gl_locale_name_default (void) +#if !(HAVE_CFPREFERENCESCOPYAPPVALUE || defined _WIN32 || defined __CYGWIN__) + _GL_ATTRIBUTE_CONST +#endif + ; + +#ifdef __cplusplus +} +#endif + +#endif /* _GL_LOCALENAME_H */ diff -Nru datamash-1.7/lib/localename-table.c datamash-1.8/lib/localename-table.c --- datamash-1.7/lib/localename-table.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/localename-table.c 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,48 @@ +/* Table that maps a locale object to the names of the locale categories. + Copyright (C) 2018-2021 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 , 2018. */ + +#include + +#if HAVE_WORKING_USELOCALE && HAVE_NAMELESS_LOCALES + +/* Specification. */ +#include "localename-table.h" + +#include + +/* A hash function for pointers. */ +size_t _GL_ATTRIBUTE_CONST +locale_hash_function (locale_t x) +{ + uintptr_t p = (uintptr_t) x; + size_t h = ((p % 4177) << 12) + ((p % 79) << 6) + (p % 61); + return h; +} + +struct locale_hash_node * locale_hash_table[LOCALE_HASH_TABLE_SIZE] + /* = { NULL, ..., NULL } */; + +gl_rwlock_define_initialized(, locale_lock) + +#else + +/* This declaration is solely to ensure that after preprocessing + this file is never empty. */ +typedef int dummy; + +#endif diff -Nru datamash-1.7/lib/localename-table.h datamash-1.8/lib/localename-table.h --- datamash-1.7/lib/localename-table.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/localename-table.h 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,73 @@ +/* Table that maps a locale object to the names of the locale categories. + Copyright (C) 2018-2021 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 , 2018. */ + +#if HAVE_WORKING_USELOCALE && HAVE_NAMELESS_LOCALES + +# include +# include + +# ifdef IN_LIBINTL +# include "lock.h" +# else +# include "glthread/lock.h" +# endif + +struct locale_categories_names + { + /* Locale category -> name (allocated with indefinite extent). */ + const char *category_name[6]; + }; + +/* A hash table of fixed size. Multiple threads can access it read-only + simultaneously, but only one thread can insert into it or remove from it + at the same time. + This hash table has global scope, so that when an application uses both + GNU libintl and gnulib, the application sees only one hash table. (When + linking statically with libintl, the fact that localename-table.c is a + separate compilation unit resolves the duplicate symbol conflict. When + linking with libintl as a shared library, we rely on ELF and the symbol + conflict resolution implemented in the ELF dynamic loader here.) + Both the libintl overrides and the gnulib overrides of the functions + newlocale, duplocale, freelocale see the same hash table (and the same lock). + For this reason, the internal layout of the hash table and the hash function + MUST NEVER CHANGE. If you need to change the internal layout or the hash + function, introduce versioning by appending a version suffix to the symbols + at the linker level. */ +# define locale_hash_function libintl_locale_hash_function +# define locale_hash_table libintl_locale_hash_table +# define locale_lock libintl_locale_lock + +extern size_t _GL_ATTRIBUTE_CONST locale_hash_function (locale_t x); + +/* A node in a hash bucket collision list. */ +struct locale_hash_node + { + struct locale_hash_node *next; + locale_t locale; + struct locale_categories_names names; + }; + +# define LOCALE_HASH_TABLE_SIZE 101 +extern struct locale_hash_node * locale_hash_table[LOCALE_HASH_TABLE_SIZE]; + +/* This lock protects the locale_hash_table against multiple simultaneous + accesses (except that multiple simultaneous read accesses are allowed). */ + +gl_rwlock_define(extern, locale_lock) + +#endif diff -Nru datamash-1.7/lib/local.mk datamash-1.8/lib/local.mk --- datamash-1.7/lib/local.mk 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/lib/local.mk 2022-05-28 02:52:43.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2014-2020 Assaf Gordon +# Copyright (C) 2014-2021 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.7/lib/log.c datamash-1.8/lib/log.c --- datamash-1.7/lib/log.c 2020-04-23 04:03:28.000000000 +0000 +++ datamash-1.8/lib/log.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Logarithm. - Copyright (C) 2012-2020 Free Software Foundation, Inc. + Copyright (C) 2012-2021 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.7/lib/lseek.c datamash-1.8/lib/lseek.c --- datamash-1.7/lib/lseek.c 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/lseek.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* An lseek() function that detects pipes. - Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2021 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.7/lib/malloca.c datamash-1.8/lib/malloca.c --- datamash-1.7/lib/malloca.c 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/malloca.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Safe automatic memory allocation. - Copyright (C) 2003, 2006-2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2003, 2006-2007, 2009-2021 Free Software Foundation, Inc. Written by Bruno Haible , 2003, 2018. This program is free software; you can redistribute it and/or modify diff -Nru datamash-1.7/lib/malloca.h datamash-1.8/lib/malloca.h --- datamash-1.7/lib/malloca.h 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/malloca.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Safe automatic memory allocation. - Copyright (C) 2003-2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2003-2007, 2009-2021 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software; you can redistribute it and/or modify @@ -89,7 +89,7 @@ /* ------------------- Auxiliary, non-public definitions ------------------- */ /* Determine the alignment of a type at compile time. */ -#if defined __GNUC__ || defined __IBM__ALIGNOF__ +#if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__ # define sa_alignof __alignof__ #elif defined __cplusplus template struct sa_alignof_helper { char __slot1; type __slot2; }; diff -Nru datamash-1.7/lib/malloc.c datamash-1.8/lib/malloc.c --- datamash-1.7/lib/malloc.c 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/malloc.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* malloc() function that is glibc compatible. - Copyright (C) 1997-1998, 2006-2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 1997-1998, 2006-2007, 2009-2021 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.7/lib/math.in.h datamash-1.8/lib/math.in.h --- datamash-1.7/lib/math.in.h 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/math.in.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* A GNU-like . - Copyright (C) 2002-2003, 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2002-2003, 2007-2021 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 @@ -22,8 +22,23 @@ #endif @PRAGMA_COLUMNS@ +#if defined _GL_INCLUDING_MATH_H +/* Special invocation convention: + - On FreeBSD 12.2 we have a sequence of nested includes + -> -> -> -> + -> -> -> -> + In this situation, the functions are not yet declared, therefore we cannot + provide the C++ aliases. */ + +#@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_MATH_H@ + +#else +/* Normal invocation convention. */ + /* The include_next requires a split double-inclusion guard. */ +#define _GL_INCLUDING_MATH_H #@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_MATH_H@ +#undef _GL_INCLUDING_MATH_H #ifndef _@GUARD_PREFIX@_MATH_H #define _@GUARD_PREFIX@_MATH_H @@ -255,7 +270,9 @@ _GL_FUNCDECL_SYS (acosl, long double, (long double x)); # endif _GL_CXXALIAS_SYS (acosl, long double, (long double x)); +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (acosl); +# endif #elif defined GNULIB_POSIXCHECK # undef acosl # if HAVE_RAW_DECL_ACOSL @@ -295,7 +312,9 @@ _GL_FUNCDECL_SYS (asinl, long double, (long double x)); # endif _GL_CXXALIAS_SYS (asinl, long double, (long double x)); +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (asinl); +# endif #elif defined GNULIB_POSIXCHECK # undef asinl # if HAVE_RAW_DECL_ASINL @@ -335,7 +354,9 @@ _GL_FUNCDECL_SYS (atanl, long double, (long double x)); # endif _GL_CXXALIAS_SYS (atanl, long double, (long double x)); +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (atanl); +# endif #elif defined GNULIB_POSIXCHECK # undef atanl # if HAVE_RAW_DECL_ATANL @@ -399,7 +420,7 @@ # endif _GL_CXXALIAS_SYS (cbrt, double, (double x)); # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (cbrt); +_GL_CXXALIASWARN1 (cbrt, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK # undef cbrt @@ -469,7 +490,7 @@ _GL_CXXALIAS_SYS (ceil, double, (double x)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (ceil); +_GL_CXXALIASWARN1 (ceil, double, (double x)); # endif #endif @@ -488,7 +509,9 @@ # endif _GL_CXXALIAS_SYS (ceill, long double, (long double x)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (ceill); +# endif #elif defined GNULIB_POSIXCHECK # undef ceill # if HAVE_RAW_DECL_CEILL @@ -519,7 +542,7 @@ # endif _GL_CXXALIAS_SYS (copysign, double, (double x, double y)); # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (copysign); +_GL_CXXALIASWARN1 (copysign, double, (double x, double y)); # endif #elif defined GNULIB_POSIXCHECK # undef copysign @@ -574,7 +597,9 @@ _GL_FUNCDECL_SYS (cosl, long double, (long double x)); # endif _GL_CXXALIAS_SYS (cosl, long double, (long double x)); +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (cosl); +# endif #elif defined GNULIB_POSIXCHECK # undef cosl # if HAVE_RAW_DECL_COSL @@ -648,7 +673,9 @@ # endif _GL_CXXALIAS_SYS (expl, long double, (long double x)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (expl); +# endif #elif defined GNULIB_POSIXCHECK # undef expl # if HAVE_RAW_DECL_EXPL @@ -687,7 +714,7 @@ _GL_CXXALIAS_SYS (exp2, double, (double x)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (exp2); +_GL_CXXALIASWARN1 (exp2, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK # undef exp2 @@ -760,7 +787,7 @@ _GL_CXXALIAS_SYS (expm1, double, (double x)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (expm1); +_GL_CXXALIASWARN1 (expm1, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK # undef expm1 @@ -803,7 +830,9 @@ _GL_FUNCDECL_SYS (fabsf, float, (float x)); # endif _GL_CXXALIAS_SYS (fabsf, float, (float x)); +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (fabsf); +# endif #elif defined GNULIB_POSIXCHECK # undef fabsf # if HAVE_RAW_DECL_FABSF @@ -827,7 +856,9 @@ # endif _GL_CXXALIAS_SYS (fabsl, long double, (long double x)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (fabsl); +# endif #elif defined GNULIB_POSIXCHECK # undef fabsl # if HAVE_RAW_DECL_FABSL @@ -873,7 +904,7 @@ _GL_CXXALIAS_SYS (floor, double, (double x)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (floor); +_GL_CXXALIASWARN1 (floor, double, (double x)); # endif #endif @@ -892,7 +923,9 @@ # endif _GL_CXXALIAS_SYS (floorl, long double, (long double x)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (floorl); +# endif #elif defined GNULIB_POSIXCHECK # undef floorl # if HAVE_RAW_DECL_FLOORL @@ -942,7 +975,7 @@ _GL_CXXALIAS_SYS (fma, double, (double x, double y, double z)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (fma); +_GL_CXXALIASWARN1 (fma, double, (double x, double y, double z)); # endif #elif defined GNULIB_POSIXCHECK # undef fma @@ -1019,7 +1052,7 @@ _GL_CXXALIAS_SYS (fmod, double, (double x, double y)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (fmod); +_GL_CXXALIASWARN1 (fmod, double, (double x, double y)); # endif #elif defined GNULIB_POSIXCHECK # undef fmod @@ -1044,7 +1077,9 @@ # endif _GL_CXXALIAS_SYS (fmodl, long double, (long double x, long double y)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (fmodl); +# endif #elif defined GNULIB_POSIXCHECK # undef fmodl # if HAVE_RAW_DECL_FMODL @@ -1076,7 +1111,9 @@ # endif _GL_CXXALIAS_SYS (frexpf, float, (float x, int *expptr)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (frexpf); +# endif #elif defined GNULIB_POSIXCHECK # undef frexpf # if HAVE_RAW_DECL_FREXPF @@ -1138,7 +1175,9 @@ # endif #endif #if @GNULIB_FREXPL@ && !(@REPLACE_FREXPL@ && !@HAVE_DECL_FREXPL@) +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (frexpl); +# endif #endif #if !@GNULIB_FREXPL@ && defined GNULIB_POSIXCHECK # undef frexpl @@ -1164,7 +1203,9 @@ # endif _GL_CXXALIAS_SYS (hypotf, float, (float x, float y)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (hypotf); +# endif #elif defined GNULIB_POSIXCHECK # undef hypotf # if HAVE_RAW_DECL_HYPOTF @@ -1186,7 +1227,7 @@ _GL_CXXALIAS_SYS (hypot, double, (double x, double y)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (hypot); +_GL_CXXALIASWARN1 (hypot, double, (double x, double y)); # endif #elif defined GNULIB_POSIXCHECK # undef hypot @@ -1211,7 +1252,9 @@ # endif _GL_CXXALIAS_SYS (hypotl, long double, (long double x, long double y)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (hypotl); +# endif #elif defined GNULIB_POSIXCHECK # undef hypotl # if HAVE_RAW_DECL_HYPOTL @@ -1259,7 +1302,7 @@ _GL_CXXALIAS_SYS (ilogb, int, (double x)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (ilogb); +_GL_CXXALIASWARN1 (ilogb, int, (double x)); # endif #elif defined GNULIB_POSIXCHECK # undef ilogb @@ -1293,6 +1336,55 @@ #endif +#if @GNULIB_MDA_J0@ +/* On native Windows, map 'j0' to '_j0', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::j0 always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef j0 +# define j0 _j0 +# endif +_GL_CXXALIAS_MDA (j0, double, (double x)); +# else +_GL_CXXALIAS_SYS (j0, double, (double x)); +# endif +_GL_CXXALIASWARN (j0); +#endif + +#if @GNULIB_MDA_J1@ +/* On native Windows, map 'j1' to '_j1', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::j1 always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef j1 +# define j1 _j1 +# endif +_GL_CXXALIAS_MDA (j1, double, (double x)); +# else +_GL_CXXALIAS_SYS (j1, double, (double x)); +# endif +_GL_CXXALIASWARN (j1); +#endif + +#if @GNULIB_MDA_JN@ +/* On native Windows, map 'jn' to '_jn', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::jn always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef jn +# define jn _jn +# endif +_GL_CXXALIAS_MDA (jn, double, (int n, double x)); +# else +_GL_CXXALIAS_SYS (jn, double, (int n, double x)); +# endif +_GL_CXXALIASWARN (jn); +#endif + + /* Return x * 2^exp. */ #if @GNULIB_LDEXPF@ # if !@HAVE_LDEXPF@ @@ -1300,7 +1392,9 @@ _GL_FUNCDECL_SYS (ldexpf, float, (float x, int exp)); # endif _GL_CXXALIAS_SYS (ldexpf, float, (float x, int exp)); +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (ldexpf); +# endif #elif defined GNULIB_POSIXCHECK # undef ldexpf # if HAVE_RAW_DECL_LDEXPF @@ -1326,7 +1420,9 @@ # endif #endif #if @GNULIB_LDEXPL@ +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (ldexpl); +# endif #endif #if !@GNULIB_LDEXPL@ && defined GNULIB_POSIXCHECK # undef ldexpl @@ -1373,7 +1469,7 @@ _GL_CXXALIAS_SYS (log, double, (double x)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (log); +_GL_CXXALIASWARN1 (log, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK # undef log @@ -1398,7 +1494,9 @@ # endif _GL_CXXALIAS_SYS (logl, long double, (long double x)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (logl); +# endif #elif defined GNULIB_POSIXCHECK # undef logl # if HAVE_RAW_DECL_LOGL @@ -1444,7 +1542,7 @@ _GL_CXXALIAS_SYS (log10, double, (double x)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (log10); +_GL_CXXALIASWARN1 (log10, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK # undef log10 @@ -1469,7 +1567,9 @@ # endif _GL_CXXALIAS_SYS (log10l, long double, (long double x)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (log10l); +# endif #elif defined GNULIB_POSIXCHECK # undef log10l # if HAVE_RAW_DECL_LOG10L @@ -1517,7 +1617,7 @@ _GL_CXXALIAS_SYS (log1p, double, (double x)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (log1p); +_GL_CXXALIASWARN1 (log1p, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK # undef log1p @@ -1591,7 +1691,7 @@ _GL_CXXALIAS_SYS (log2, double, (double x)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (log2); +_GL_CXXALIASWARN1 (log2, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK # undef log2 @@ -1663,7 +1763,7 @@ _GL_CXXALIAS_SYS (logb, double, (double x)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (logb); +_GL_CXXALIASWARN1 (logb, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK # undef logb @@ -1733,7 +1833,7 @@ _GL_CXXALIAS_SYS (modf, double, (double x, double *iptr)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (modf); +_GL_CXXALIASWARN1 (modf, double, (double x, double *iptr)); # endif #elif defined GNULIB_POSIXCHECK # undef modf @@ -1760,7 +1860,9 @@ # endif _GL_CXXALIAS_SYS (modfl, long double, (long double x, long double *iptr)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (modfl); +# endif #elif defined GNULIB_POSIXCHECK # undef modfl # if HAVE_RAW_DECL_MODFL @@ -1824,7 +1926,7 @@ _GL_CXXALIAS_SYS (remainder, double, (double x, double y)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (remainder); +_GL_CXXALIASWARN1 (remainder, double, (double x, double y)); # endif #elif defined GNULIB_POSIXCHECK # undef remainder @@ -1881,7 +1983,7 @@ # endif _GL_CXXALIAS_SYS (rint, double, (double x)); # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (rint); +_GL_CXXALIASWARN1 (rint, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK # undef rint @@ -1953,7 +2055,7 @@ _GL_CXXALIAS_SYS (round, double, (double x)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (round); +_GL_CXXALIASWARN1 (round, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK # undef round @@ -2020,7 +2122,9 @@ _GL_FUNCDECL_SYS (sinl, long double, (long double x)); # endif _GL_CXXALIAS_SYS (sinl, long double, (long double x)); +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (sinl); +# endif #elif defined GNULIB_POSIXCHECK # undef sinl # if HAVE_RAW_DECL_SINL @@ -2094,7 +2198,9 @@ # endif _GL_CXXALIAS_SYS (sqrtl, long double, (long double x)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (sqrtl); +# endif #elif defined GNULIB_POSIXCHECK # undef sqrtl # if HAVE_RAW_DECL_SQRTL @@ -2134,7 +2240,9 @@ _GL_FUNCDECL_SYS (tanl, long double, (long double x)); # endif _GL_CXXALIAS_SYS (tanl, long double, (long double x)); +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (tanl); +# endif #elif defined GNULIB_POSIXCHECK # undef tanl # if HAVE_RAW_DECL_TANL @@ -2207,7 +2315,7 @@ _GL_CXXALIAS_SYS (trunc, double, (double x)); # endif # if __GLIBC__ >= 2 -_GL_CXXALIASWARN (trunc); +_GL_CXXALIASWARN1 (trunc, double, (double x)); # endif #elif defined GNULIB_POSIXCHECK # undef trunc @@ -2241,6 +2349,55 @@ #endif +#if @GNULIB_MDA_Y0@ +/* On native Windows, map 'y0' to '_y0', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::y0 always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef y0 +# define y0 _y0 +# endif +_GL_CXXALIAS_MDA (y0, double, (double x)); +# else +_GL_CXXALIAS_SYS (y0, double, (double x)); +# endif +_GL_CXXALIASWARN (y0); +#endif + +#if @GNULIB_MDA_Y1@ +/* On native Windows, map 'y1' to '_y1', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::y1 always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef y1 +# define y1 _y1 +# endif +_GL_CXXALIAS_MDA (y1, double, (double x)); +# else +_GL_CXXALIAS_SYS (y1, double, (double x)); +# endif +_GL_CXXALIASWARN (y1); +#endif + +#if @GNULIB_MDA_YN@ +/* On native Windows, map 'yn' to '_yn', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::yn always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef yn +# define yn _yn +# endif +_GL_CXXALIAS_MDA (yn, double, (int n, double x)); +# else +_GL_CXXALIAS_SYS (yn, double, (int n, double x)); +# endif +_GL_CXXALIASWARN (yn); +#endif + + /* Definitions of function-like macros come here, after the function declarations. */ @@ -2260,7 +2417,7 @@ # if defined isfinite || defined GNULIB_NAMESPACE _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isfinite) # undef isfinite -# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined _AIX)) +# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __OpenBSD__ || defined _AIX || (defined _WIN32 && !defined __CYGWIN__))) /* This platform's possibly defines isfinite through a set of inline functions. */ _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isfinite, rpl_isfinite, bool) @@ -2294,7 +2451,7 @@ # if defined isinf || defined GNULIB_NAMESPACE _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isinf) # undef isinf -# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__)) +# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __OpenBSD__ || (defined _WIN32 && !defined __CYGWIN__))) /* This platform's possibly defines isinf through a set of inline functions. */ _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isinf, rpl_isinf, bool) @@ -2318,10 +2475,11 @@ # if @HAVE_ISNANF@ /* The original included above provides a declaration of isnan macro or (older) isnanf function. */ -# if __GNUC__ >= 4 - /* GCC 4.0 and newer provides three built-ins for isnan. */ +# if (__GNUC__ >= 4) || (__clang_major__ >= 4) + /* GCC >= 4.0 and clang provide a type-generic built-in for isnan. + GCC >= 4.0 also provides __builtin_isnanf, but clang doesn't. */ # undef isnanf -# define isnanf(x) __builtin_isnanf ((float)(x)) +# define isnanf(x) __builtin_isnan ((float)(x)) # elif defined isnan # undef isnanf # define isnanf(x) isnan ((float)(x)) @@ -2341,8 +2499,8 @@ # if @HAVE_ISNAND@ /* The original included above provides a declaration of isnan macro. */ -# if __GNUC__ >= 4 - /* GCC 4.0 and newer provides three built-ins for isnan. */ +# if (__GNUC__ >= 4) || (__clang_major__ >= 4) + /* GCC >= 4.0 and clang provide a type-generic built-in for isnan. */ # undef isnand # define isnand(x) __builtin_isnan ((double)(x)) # else @@ -2362,10 +2520,11 @@ # if @HAVE_ISNANL@ /* The original included above provides a declaration of isnan macro or (older) isnanl function. */ -# if __GNUC__ >= 4 - /* GCC 4.0 and newer provides three built-ins for isnan. */ +# if (__GNUC__ >= 4) || (__clang_major__ >= 4) + /* GCC >= 4.0 and clang provide a type-generic built-in for isnan. + GCC >= 4.0 also provides __builtin_isnanl, but clang doesn't. */ # undef isnanl -# define isnanl(x) __builtin_isnanl ((long double)(x)) +# define isnanl(x) __builtin_isnan ((long double)(x)) # elif defined isnan # undef isnanl # define isnanl(x) isnan ((long double)(x)) @@ -2385,20 +2544,20 @@ isnanf.h (e.g.) here, because those may end up being macros that recursively expand back to isnan. So use the gnulib replacements for them directly. */ -# if @HAVE_ISNANF@ && __GNUC__ >= 4 -# define gl_isnan_f(x) __builtin_isnanf ((float)(x)) +# if @HAVE_ISNANF@ && (__GNUC__ >= 4) || (__clang_major__ >= 4) +# define gl_isnan_f(x) __builtin_isnan ((float)(x)) # else _GL_EXTERN_C int rpl_isnanf (float x); # define gl_isnan_f(x) rpl_isnanf (x) # endif -# if @HAVE_ISNAND@ && __GNUC__ >= 4 +# if @HAVE_ISNAND@ && (__GNUC__ >= 4) || (__clang_major__ >= 4) # define gl_isnan_d(x) __builtin_isnan ((double)(x)) # else _GL_EXTERN_C int rpl_isnand (double x); # define gl_isnan_d(x) rpl_isnand (x) # endif -# if @HAVE_ISNANL@ && __GNUC__ >= 4 -# define gl_isnan_l(x) __builtin_isnanl ((long double)(x)) +# if @HAVE_ISNANL@ && (__GNUC__ >= 4) || (__clang_major__ >= 4) +# define gl_isnan_l(x) __builtin_isnan ((long double)(x)) # else _GL_EXTERN_C int rpl_isnanl (long double x) _GL_ATTRIBUTE_CONST; # define gl_isnan_l(x) rpl_isnanl (x) @@ -2408,18 +2567,18 @@ (sizeof (x) == sizeof (long double) ? gl_isnan_l (x) : \ sizeof (x) == sizeof (double) ? gl_isnan_d (x) : \ gl_isnan_f (x)) -# elif __GNUC__ >= 4 +# elif (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnan # define isnan(x) \ - (sizeof (x) == sizeof (long double) ? __builtin_isnanl ((long double)(x)) : \ + (sizeof (x) == sizeof (long double) ? __builtin_isnan ((long double)(x)) : \ sizeof (x) == sizeof (double) ? __builtin_isnan ((double)(x)) : \ - __builtin_isnanf ((float)(x))) + __builtin_isnan ((float)(x))) # endif # ifdef __cplusplus # if defined isnan || defined GNULIB_NAMESPACE _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isnan) # undef isnan -# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__)) +# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || (defined __FreeBSD__ && __clang_major__ < 7) || defined __OpenBSD__ || (defined _WIN32 && !defined __CYGWIN__))) /* This platform's possibly defines isnan through a set of inline functions. */ _GL_MATH_CXX_REAL_FLOATING_DECL_2 (isnan, rpl_isnan, bool) @@ -2444,10 +2603,10 @@ #if @GNULIB_SIGNBIT@ -# if (@REPLACE_SIGNBIT_USING_GCC@ \ +# if (@REPLACE_SIGNBIT_USING_BUILTINS@ \ && (!defined __cplusplus || __cplusplus < 201103)) # undef signbit - /* GCC 4.0 and newer provides three built-ins for signbit. */ + /* GCC >= 4.0 and clang provide three built-ins for signbit. */ # define signbit(x) \ (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \ sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \ @@ -2458,7 +2617,7 @@ _GL_EXTERN_C int gl_signbitf (float arg); _GL_EXTERN_C int gl_signbitd (double arg); _GL_EXTERN_C int gl_signbitl (long double arg); -# if __GNUC__ >= 2 && !defined __STRICT_ANSI__ +# if (__GNUC__ >= 2 || defined __clang__) && !defined __STRICT_ANSI__ # define _GL_NUM_UINT_WORDS(type) \ ((sizeof (type) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) # if defined FLT_SIGNBIT_WORD && defined FLT_SIGNBIT_BIT && !defined gl_signbitf @@ -2502,7 +2661,7 @@ # if defined signbit || defined GNULIB_NAMESPACE _GL_MATH_CXX_REAL_FLOATING_DECL_1 (signbit) # undef signbit -# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined _AIX)) +# if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __OpenBSD__ || defined _AIX || (defined _WIN32 && !defined __CYGWIN__))) /* This platform's possibly defines signbit through a set of inline functions. */ _GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit, rpl_signbit, bool) @@ -2523,4 +2682,5 @@ _GL_INLINE_HEADER_END #endif /* _@GUARD_PREFIX@_MATH_H */ +#endif /* _GL_INCLUDING_MATH_H */ #endif /* _@GUARD_PREFIX@_MATH_H */ diff -Nru datamash-1.7/lib/mbchar.c datamash-1.8/lib/mbchar.c --- datamash-1.7/lib/mbchar.c 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/mbchar.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2006, 2009-2020 Free Software Foundation, Inc. +/* Copyright (C) 2001, 2006, 2009-2021 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.7/lib/mbchar.h datamash-1.8/lib/mbchar.h --- datamash-1.7/lib/mbchar.h 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/mbchar.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Multibyte character data type. - Copyright (C) 2001, 2005-2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2001, 2005-2007, 2009-2021 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 @@ -146,13 +146,6 @@ #include #include - -/* Tru64 with Desktop Toolkit C has a bug: must be included before - . - BSD/OS 4.1 has a bug: and must be included before - . */ -#include -#include #include #include diff -Nru datamash-1.7/lib/mbiter.h datamash-1.8/lib/mbiter.h --- datamash-1.7/lib/mbiter.h 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/mbiter.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Iterating through multibyte strings: macros for multi-byte encodings. - Copyright (C) 2001, 2005, 2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2001, 2005, 2007, 2009-2021 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 @@ -86,13 +86,6 @@ #include #include #include - -/* Tru64 with Desktop Toolkit C has a bug: must be included before - . - BSD/OS 4.1 has a bug: and must be included before - . */ -#include -#include #include #include "mbchar.h" diff -Nru datamash-1.7/lib/mbrtowc.c datamash-1.8/lib/mbrtowc.c --- datamash-1.7/lib/mbrtowc.c 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/mbrtowc.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Convert multibyte character to wide character. - Copyright (C) 1999-2002, 2005-2020 Free Software Foundation, Inc. + Copyright (C) 1999-2002, 2005-2021 Free Software Foundation, Inc. Written by Bruno Haible , 2008. This program is free software: you can redistribute it and/or modify @@ -50,18 +50,11 @@ # endif +# include "attribute.h" # include "verify.h" # include "lc-charset-dispatch.h" # include "mbtowc-lock.h" -# ifndef FALLTHROUGH -# if __GNUC__ < 7 -# define FALLTHROUGH ((void) 0) -# else -# define FALLTHROUGH __attribute__ ((__fallthrough__)) -# endif -# endif - verify (sizeof (mbstate_t) >= 4); static char internal_state[4]; diff -Nru datamash-1.7/lib/mbrtowc-impl.h datamash-1.8/lib/mbrtowc-impl.h --- datamash-1.7/lib/mbrtowc-impl.h 2020-04-23 04:03:28.000000000 +0000 +++ datamash-1.8/lib/mbrtowc-impl.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Convert multibyte character to wide character. - Copyright (C) 1999-2002, 2005-2020 Free Software Foundation, Inc. + Copyright (C) 1999-2002, 2005-2021 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.7/lib/mbrtowc-impl-utf8.h datamash-1.8/lib/mbrtowc-impl-utf8.h --- datamash-1.7/lib/mbrtowc-impl-utf8.h 2020-04-23 04:03:28.000000000 +0000 +++ datamash-1.8/lib/mbrtowc-impl-utf8.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Convert multibyte character to wide character. - Copyright (C) 1999-2002, 2005-2020 Free Software Foundation, Inc. + Copyright (C) 1999-2002, 2005-2021 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.7/lib/mbsinit.c datamash-1.8/lib/mbsinit.c --- datamash-1.7/lib/mbsinit.c 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/mbsinit.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Test for initial conversion state. - Copyright (C) 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2008-2021 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.7/lib/mbslen.c datamash-1.8/lib/mbslen.c --- datamash-1.7/lib/mbslen.c 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/mbslen.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Counting the multibyte characters in a string. - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 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.7/lib/mbsrtowcs.c datamash-1.8/lib/mbsrtowcs.c --- datamash-1.7/lib/mbsrtowcs.c 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/mbsrtowcs.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -/* Convert string to wide string. - Copyright (C) 2008-2020 Free Software Foundation, Inc. - Written by Bruno Haible , 2008. - - 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 - -#include -#include -#include - -#include "strnlen1.h" - - -extern mbstate_t _gl_mbsrtowcs_state; - -#define FUNC mbsrtowcs -#define DCHAR_T wchar_t -#define INTERNAL_STATE _gl_mbsrtowcs_state -#define MBRTOWC mbrtowc -#include "mbsrtowcs-impl.h" diff -Nru datamash-1.7/lib/mbsrtowcs-impl.h datamash-1.8/lib/mbsrtowcs-impl.h --- datamash-1.7/lib/mbsrtowcs-impl.h 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/mbsrtowcs-impl.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,122 +0,0 @@ -/* Convert string to wide string. - Copyright (C) 2008-2020 Free Software Foundation, Inc. - Written by Bruno Haible , 2008. - - 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 . */ - -size_t -FUNC (DCHAR_T *dest, const char **srcp, size_t len, mbstate_t *ps) -{ - if (ps == NULL) - ps = &INTERNAL_STATE; - { - const char *src = *srcp; - - if (dest != NULL) - { - DCHAR_T *destptr = dest; - - for (; len > 0; destptr++, len--) - { - size_t src_avail; - size_t ret; - - /* An optimized variant of - src_avail = strnlen1 (src, MB_LEN_MAX); */ - if (src[0] == '\0') - src_avail = 1; - else if (src[1] == '\0') - src_avail = 2; - else if (src[2] == '\0') - src_avail = 3; - else if (MB_LEN_MAX <= 4 || src[3] == '\0') - src_avail = 4; - else - src_avail = 4 + strnlen1 (src + 4, MB_LEN_MAX - 4); - - /* Parse the next multibyte character. */ - ret = MBRTOWC (destptr, src, src_avail, ps); - - if (ret == (size_t)(-2)) - /* Encountered a multibyte character that extends past a '\0' byte - or that is longer than MB_LEN_MAX bytes. Cannot happen. */ - abort (); - - if (ret == (size_t)(-1)) - goto bad_input; - if (ret == 0) - { - src = NULL; - /* Here mbsinit (ps). */ - break; - } - src += ret; - } - - *srcp = src; - return destptr - dest; - } - else - { - /* Ignore dest and len, don't store *srcp at the end, and - don't clobber *ps. */ - mbstate_t state = *ps; - size_t totalcount = 0; - - for (;; totalcount++) - { - size_t src_avail; - size_t ret; - - /* An optimized variant of - src_avail = strnlen1 (src, MB_LEN_MAX); */ - if (src[0] == '\0') - src_avail = 1; - else if (src[1] == '\0') - src_avail = 2; - else if (src[2] == '\0') - src_avail = 3; - else if (MB_LEN_MAX <= 4 || src[3] == '\0') - src_avail = 4; - else - src_avail = 4 + strnlen1 (src + 4, MB_LEN_MAX - 4); - - /* Parse the next multibyte character. */ - ret = MBRTOWC (NULL, src, src_avail, &state); - - if (ret == (size_t)(-2)) - /* Encountered a multibyte character that extends past a '\0' byte - or that is longer than MB_LEN_MAX bytes. Cannot happen. */ - abort (); - - if (ret == (size_t)(-1)) - goto bad_input2; - if (ret == 0) - { - /* Here mbsinit (&state). */ - break; - } - src += ret; - } - - return totalcount; - } - - bad_input: - *srcp = src; - bad_input2: - errno = EILSEQ; - return (size_t)(-1); - } -} diff -Nru datamash-1.7/lib/mbsrtowcs-state.c datamash-1.8/lib/mbsrtowcs-state.c --- datamash-1.7/lib/mbsrtowcs-state.c 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/mbsrtowcs-state.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -/* Convert string to wide string. - Copyright (C) 2008-2020 Free Software Foundation, Inc. - Written by Bruno Haible , 2008. - - 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 - -/* Internal state used by the functions mbsrtowcs() and mbsnrtowcs(). */ -mbstate_t _gl_mbsrtowcs_state -/* The state must initially be in the "initial state"; so, zero-initialize it. - On most systems, putting it into BSS is sufficient. Not so on Mac OS X 10.3, - see . - When it needs an initializer, use 0 or {0} as initializer? 0 only works - when mbstate_t is a scalar type (such as when gnulib defines it, or on - AIX, IRIX, mingw). {0} works as an initializer in all cases: for a struct - or union type, but also for a scalar type (ISO C 99, 6.7.8.(11)). */ -#if defined __ELF__ - /* On ELF systems, variables in BSS behave well. */ -#else - /* Use braces, to be on the safe side. */ - = { 0 } -#endif - ; diff -Nru datamash-1.7/lib/mbsstr.c datamash-1.8/lib/mbsstr.c --- datamash-1.7/lib/mbsstr.c 2020-04-23 04:03:34.000000000 +0000 +++ datamash-1.8/lib/mbsstr.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Searching in a string. -*- coding: utf-8 -*- - Copyright (C) 2005-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2021 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.7/lib/mbtowc-lock.c datamash-1.8/lib/mbtowc-lock.c --- datamash-1.7/lib/mbtowc-lock.c 2020-04-23 04:03:28.000000000 +0000 +++ datamash-1.8/lib/mbtowc-lock.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Return the internal lock used by mbrtowc and mbrtoc32. - Copyright (C) 2019-2020 Free Software Foundation, Inc. + Copyright (C) 2019-2021 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.7/lib/mbtowc-lock.h datamash-1.8/lib/mbtowc-lock.h --- datamash-1.7/lib/mbtowc-lock.h 2020-04-23 04:03:28.000000000 +0000 +++ datamash-1.8/lib/mbtowc-lock.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Use the internal lock used by mbrtowc and mbrtoc32. - Copyright (C) 2019-2020 Free Software Foundation, Inc. + Copyright (C) 2019-2021 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.7/lib/mbuiter.h datamash-1.8/lib/mbuiter.h --- datamash-1.7/lib/mbuiter.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/mbuiter.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Iterating through multibyte strings: macros for multi-byte encodings. - Copyright (C) 2001, 2005, 2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2001, 2005, 2007, 2009-2021 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,13 +94,6 @@ #include #include #include - -/* Tru64 with Desktop Toolkit C has a bug: must be included before - . - BSD/OS 4.1 has a bug: and must be included before - . */ -#include -#include #include #include "mbchar.h" diff -Nru datamash-1.7/lib/md5.c datamash-1.8/lib/md5.c --- datamash-1.7/lib/md5.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/md5.c 2022-05-28 01:46:58.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-2020 Free Software + Copyright (C) 1995-1997, 1999-2001, 2005-2006, 2008-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. diff -Nru datamash-1.7/lib/md5.h datamash-1.8/lib/md5.h --- datamash-1.7/lib/md5.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/md5.h 2022-05-28 01:46:58.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-2020 Free Software + Copyright (C) 1995-1997, 1999-2001, 2004-2006, 2008-2021 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -40,7 +40,7 @@ #endif #ifndef __THROW -# if defined __cplusplus && __GNUC_PREREQ (2,8) +# if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major__ >= 4) # define __THROW throw () # else # define __THROW diff -Nru datamash-1.7/lib/memchr.c datamash-1.8/lib/memchr.c --- datamash-1.7/lib/memchr.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/memchr.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2020 +/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2021 Free Software Foundation, Inc. Based on strlen implementation by Torbjorn Granlund (tege@sics.se), diff -Nru datamash-1.7/lib/memchr.valgrind datamash-1.8/lib/memchr.valgrind --- datamash-1.7/lib/memchr.valgrind 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/memchr.valgrind 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ # Suppress a valgrind message about use of uninitialized memory in memchr(). -# Copyright (C) 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 2009-2021 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.7/lib/minmax.h datamash-1.8/lib/minmax.h --- datamash-1.7/lib/minmax.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/minmax.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* MIN, MAX macros. - Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2020 Free Software + Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify diff -Nru datamash-1.7/lib/modf.c datamash-1.8/lib/modf.c --- datamash-1.7/lib/modf.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/modf.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Get signed integer and fractional parts of a floating-point number. - Copyright (C) 2012-2020 Free Software Foundation, Inc. + Copyright (C) 2012-2021 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.7/lib/modfl.c datamash-1.8/lib/modfl.c --- datamash-1.7/lib/modfl.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/modfl.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Get signed integer and fractional parts of a floating-point number. - Copyright (C) 2012-2020 Free Software Foundation, Inc. + Copyright (C) 2012-2021 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.7/lib/msvc-inval.c datamash-1.8/lib/msvc-inval.c --- datamash-1.7/lib/msvc-inval.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/msvc-inval.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Invalid parameter handler for MSVC runtime libraries. - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 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.7/lib/msvc-inval.h datamash-1.8/lib/msvc-inval.h --- datamash-1.7/lib/msvc-inval.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/msvc-inval.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Invalid parameter handler for MSVC runtime libraries. - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 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.7/lib/msvc-nothrow.c datamash-1.8/lib/msvc-nothrow.c --- datamash-1.7/lib/msvc-nothrow.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/msvc-nothrow.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* Wrappers that don't throw invalid parameter notifications with MSVC runtime libraries. - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 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.7/lib/msvc-nothrow.h datamash-1.8/lib/msvc-nothrow.h --- datamash-1.7/lib/msvc-nothrow.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/msvc-nothrow.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* Wrappers that don't throw invalid parameter notifications with MSVC runtime libraries. - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 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.7/lib/netinet_in.in.h datamash-1.8/lib/netinet_in.in.h --- datamash-1.7/lib/netinet_in.in.h 2020-04-23 17:13:30.000000000 +0000 +++ datamash-1.8/lib/netinet_in.in.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Substitute for . - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 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.7/lib/_Noreturn.h datamash-1.8/lib/_Noreturn.h --- datamash-1.7/lib/_Noreturn.h 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/lib/_Noreturn.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* A C macro for declaring that a function does not return. - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 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.7/lib/open.c datamash-1.8/lib/open.c --- datamash-1.7/lib/open.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/open.c 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,209 @@ +/* Open a descriptor to a file. + Copyright (C) 2007-2021 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 the user's config.h happens to include , let it include only + the system's here, so that orig_open doesn't recurse to + rpl_open. */ +#define __need_system_fcntl_h +#include + +/* Get the original definition of open. It might be defined as a macro. */ +#include +#include +#undef __need_system_fcntl_h + +static int +orig_open (const char *filename, int flags, mode_t mode) +{ +#if defined _WIN32 && !defined __CYGWIN__ + return _open (filename, flags, mode); +#else + return open (filename, flags, mode); +#endif +} + +/* Specification. */ +/* Write "fcntl.h" here, not , otherwise OSF/1 5.1 DTK cc eliminates + this include because of the preliminary #include above. */ +#include "fcntl.h" + +#include "cloexec.h" + +#include +#include +#include +#include +#include +#include + +#ifndef REPLACE_OPEN_DIRECTORY +# define REPLACE_OPEN_DIRECTORY 0 +#endif + +int +open (const char *filename, int flags, ...) +{ + /* 0 = unknown, 1 = yes, -1 = no. */ +#if GNULIB_defined_O_CLOEXEC + int have_cloexec = -1; +#else + static int have_cloexec; +#endif + + mode_t mode; + int fd; + + mode = 0; + if (flags & O_CREAT) + { + va_list arg; + va_start (arg, flags); + + /* We have to use PROMOTED_MODE_T instead of mode_t, otherwise GCC 4 + creates crashing code when 'mode_t' is smaller than 'int'. */ + mode = va_arg (arg, PROMOTED_MODE_T); + + va_end (arg); + } + +#if GNULIB_defined_O_NONBLOCK + /* The only known platform that lacks O_NONBLOCK is mingw, but it + also lacks named pipes and Unix sockets, which are the only two + file types that require non-blocking handling in open(). + Therefore, it is safe to ignore O_NONBLOCK here. It is handy + that mingw also lacks openat(), so that is also covered here. */ + flags &= ~O_NONBLOCK; +#endif + +#if defined _WIN32 && ! defined __CYGWIN__ + if (strcmp (filename, "/dev/null") == 0) + filename = "NUL"; +#endif + +#if OPEN_TRAILING_SLASH_BUG + /* Fail if one of O_CREAT, O_WRONLY, O_RDWR is specified and the filename + ends in a slash, as POSIX says such a filename must name a directory + : + "A pathname that contains at least one non- character and that + ends with one or more trailing characters shall not be resolved + successfully unless the last pathname component before the trailing + characters names an existing directory" + If the named file already exists as a directory, then + - if O_CREAT is specified, open() must fail because of the semantics + of O_CREAT, + - if O_WRONLY or O_RDWR is specified, open() must fail because POSIX + + says that it fails with errno = EISDIR in this case. + If the named file does not exist or does not name a directory, then + - if O_CREAT is specified, open() must fail since open() cannot create + directories, + - if O_WRONLY or O_RDWR is specified, open() must fail because the + file does not contain a '.' directory. */ + if ((flags & O_CREAT) + || (flags & O_ACCMODE) == O_RDWR + || (flags & O_ACCMODE) == O_WRONLY) + { + size_t len = strlen (filename); + if (len > 0 && filename[len - 1] == '/') + { + errno = EISDIR; + return -1; + } + } +#endif + + fd = orig_open (filename, + flags & ~(have_cloexec < 0 ? O_CLOEXEC : 0), mode); + + if (flags & O_CLOEXEC) + { + if (! have_cloexec) + { + if (0 <= fd) + have_cloexec = 1; + else if (errno == EINVAL) + { + fd = orig_open (filename, flags & ~O_CLOEXEC, mode); + have_cloexec = -1; + } + } + if (have_cloexec < 0 && 0 <= fd) + set_cloexec_flag (fd, true); + } + + +#if REPLACE_FCHDIR + /* Implementing fchdir and fdopendir requires the ability to open a + directory file descriptor. If open doesn't support that (as on + mingw), we use a dummy file that behaves the same as directories + on Linux (ie. always reports EOF on attempts to read()), and + override fstat() in fchdir.c to hide the fact that we have a + dummy. */ + if (REPLACE_OPEN_DIRECTORY && fd < 0 && errno == EACCES + && ((flags & O_ACCMODE) == O_RDONLY + || (O_SEARCH != O_RDONLY && (flags & O_ACCMODE) == O_SEARCH))) + { + struct stat statbuf; + if (stat (filename, &statbuf) == 0 && S_ISDIR (statbuf.st_mode)) + { + /* Maximum recursion depth of 1. */ + fd = open ("/dev/null", flags, mode); + if (0 <= fd) + fd = _gl_register_fd (fd, filename); + } + else + errno = EACCES; + } +#endif + +#if OPEN_TRAILING_SLASH_BUG + /* If the filename ends in a slash and fd does not refer to a directory, + then fail. + Rationale: POSIX says such a filename must name a directory + : + "A pathname that contains at least one non- character and that + ends with one or more trailing characters shall not be resolved + successfully unless the last pathname component before the trailing + characters names an existing directory" + If the named file without the slash is not a directory, open() must fail + with ENOTDIR. */ + if (fd >= 0) + { + /* We know len is positive, since open did not fail with ENOENT. */ + size_t len = strlen (filename); + if (filename[len - 1] == '/') + { + struct stat statbuf; + + if (fstat (fd, &statbuf) >= 0 && !S_ISDIR (statbuf.st_mode)) + { + close (fd); + errno = ENOTDIR; + return -1; + } + } + } +#endif + +#if REPLACE_FCHDIR + if (!REPLACE_OPEN_DIRECTORY && 0 <= fd) + fd = _gl_register_fd (fd, filename); +#endif + + return fd; +} diff -Nru datamash-1.7/lib/pathmax.h datamash-1.8/lib/pathmax.h --- datamash-1.7/lib/pathmax.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/pathmax.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Define PATH_MAX somehow. Requires sys/types.h. - Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2020 Free Software + Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify diff -Nru datamash-1.7/lib/pclose.c datamash-1.8/lib/pclose.c --- datamash-1.7/lib/pclose.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/pclose.c 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,28 @@ +/* Close a stream to a sub-process. + Copyright (C) 2011-2021 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 + +/* Native Windows API. */ + +int +pclose (FILE *stream) +{ + return _pclose (stream); +} diff -Nru datamash-1.7/lib/popen.c datamash-1.8/lib/popen.c --- datamash-1.7/lib/popen.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/popen.c 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,103 @@ +/* Open a stream to a sub-process. + Copyright (C) 2009-2021 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 Eric Blake , 2009. */ + +#include + +/* Specification. */ +#include + +#if defined _WIN32 && ! defined __CYGWIN__ +/* Native Windows API. */ + +# include + +FILE * +popen (const char *filename, const char *mode) +{ + /* Use binary mode by default. */ + if (strcmp (mode, "r") == 0) + mode = "rb"; + else if (strcmp (mode, "w") == 0) + mode = "wb"; + + return _popen (filename, mode); +} + +#else + +# include +# include +# include +# include + +# undef popen + +FILE * +rpl_popen (const char *filename, const char *mode) +{ + /* All other platforms have popen and fcntl. + The bug of the child clobbering its own file descriptors if stdin + or stdout was closed in the parent can be worked around by + opening those two fds as close-on-exec to begin with. */ + /* Cygwin 1.5.x also has a bug where the popen fd is improperly + marked close-on-exec, and if the application undoes this, then + the fd leaks into subsequent popen calls. We could work around + this by maintaining a list of all fd's opened by popen, and + temporarily marking them cloexec around the real popen call, but + we would also have to override pclose, and the bookkeeping seems + extreme given that cygwin 1.7 no longer has the bug. */ + FILE *result; + int cloexec0 = fcntl (STDIN_FILENO, F_GETFD); + int cloexec1 = fcntl (STDOUT_FILENO, F_GETFD); + int saved_errno; + + /* If either stdin or stdout was closed (that is, fcntl failed), + then we open a dummy close-on-exec fd to occupy that slot. That + way, popen's internal use of pipe() will not contain either fd 0 + or 1, overcoming the fact that the child process blindly calls + close() on the parent's end of the pipe without first checking + whether it is clobbering the fd just placed there via dup2(); the + exec will get rid of the dummy fd's in the child. Fortunately, + closed stderr in the parent does not cause problems in the + child. */ + if (cloexec0 < 0) + { + if (open ("/dev/null", O_RDONLY) != STDIN_FILENO + || fcntl (STDIN_FILENO, F_SETFD, + fcntl (STDIN_FILENO, F_GETFD) | FD_CLOEXEC) == -1) + abort (); + } + if (cloexec1 < 0) + { + if (open ("/dev/null", O_RDONLY) != STDOUT_FILENO + || fcntl (STDOUT_FILENO, F_SETFD, + fcntl (STDOUT_FILENO, F_GETFD) | FD_CLOEXEC) == -1) + abort (); + } + result = popen (filename, mode); + /* Now, close any dummy fd's created in the parent. */ + saved_errno = errno; + if (cloexec0 < 0) + close (STDIN_FILENO); + if (cloexec1 < 0) + close (STDOUT_FILENO); + errno = saved_errno; + return result; +} + +#endif diff -Nru datamash-1.7/lib/printf-args.c datamash-1.8/lib/printf-args.c --- datamash-1.7/lib/printf-args.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/printf-args.c 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,183 @@ +/* Decomposed printf argument list. + Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2021 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 . */ + +/* This file can be parametrized with the following macros: + ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions. + PRINTF_FETCHARGS Name of the function to be defined. + STATIC Set to 'static' to declare the function static. */ + +#ifndef PRINTF_FETCHARGS +# include +#endif + +/* Specification. */ +#ifndef PRINTF_FETCHARGS +# include "printf-args.h" +#endif + +#ifdef STATIC +STATIC +#endif +int +PRINTF_FETCHARGS (va_list args, arguments *a) +{ + size_t i; + argument *ap; + + for (i = 0, ap = &a->arg[0]; i < a->count; i++, ap++) + switch (ap->type) + { + case TYPE_SCHAR: + ap->a.a_schar = va_arg (args, /*signed char*/ int); + break; + case TYPE_UCHAR: + ap->a.a_uchar = va_arg (args, /*unsigned char*/ int); + break; + case TYPE_SHORT: + ap->a.a_short = va_arg (args, /*short*/ int); + break; + case TYPE_USHORT: + ap->a.a_ushort = va_arg (args, /*unsigned short*/ int); + break; + case TYPE_INT: + ap->a.a_int = va_arg (args, int); + break; + case TYPE_UINT: + ap->a.a_uint = va_arg (args, unsigned int); + break; + case TYPE_LONGINT: + ap->a.a_longint = va_arg (args, long int); + break; + case TYPE_ULONGINT: + ap->a.a_ulongint = va_arg (args, unsigned long int); + break; + case TYPE_LONGLONGINT: + ap->a.a_longlongint = va_arg (args, long long int); + break; + case TYPE_ULONGLONGINT: + ap->a.a_ulonglongint = va_arg (args, unsigned long long int); + break; + case TYPE_DOUBLE: + ap->a.a_double = va_arg (args, double); + break; + case TYPE_LONGDOUBLE: + ap->a.a_longdouble = va_arg (args, long double); + break; + case TYPE_CHAR: + ap->a.a_char = va_arg (args, int); + break; +#if HAVE_WINT_T + case TYPE_WIDE_CHAR: + /* Although ISO C 99 7.24.1.(2) says that wint_t is "unchanged by + default argument promotions", this is not the case in mingw32, + where wint_t is 'unsigned short'. */ + ap->a.a_wide_char = + (sizeof (wint_t) < sizeof (int) + ? (wint_t) va_arg (args, int) + : va_arg (args, wint_t)); + break; +#endif + case TYPE_STRING: + ap->a.a_string = va_arg (args, const char *); + /* A null pointer is an invalid argument for "%s", but in practice + it occurs quite frequently in printf statements that produce + debug output. Use a fallback in this case. */ + if (ap->a.a_string == NULL) + ap->a.a_string = "(NULL)"; + break; +#if HAVE_WCHAR_T + case TYPE_WIDE_STRING: + ap->a.a_wide_string = va_arg (args, const wchar_t *); + /* A null pointer is an invalid argument for "%ls", but in practice + it occurs quite frequently in printf statements that produce + debug output. Use a fallback in this case. */ + if (ap->a.a_wide_string == NULL) + { + static const wchar_t wide_null_string[] = + { + (wchar_t)'(', + (wchar_t)'N', (wchar_t)'U', (wchar_t)'L', (wchar_t)'L', + (wchar_t)')', + (wchar_t)0 + }; + ap->a.a_wide_string = wide_null_string; + } + break; +#endif + case TYPE_POINTER: + ap->a.a_pointer = va_arg (args, void *); + break; + case TYPE_COUNT_SCHAR_POINTER: + ap->a.a_count_schar_pointer = va_arg (args, signed char *); + break; + case TYPE_COUNT_SHORT_POINTER: + ap->a.a_count_short_pointer = va_arg (args, short *); + break; + case TYPE_COUNT_INT_POINTER: + ap->a.a_count_int_pointer = va_arg (args, int *); + break; + case TYPE_COUNT_LONGINT_POINTER: + ap->a.a_count_longint_pointer = va_arg (args, long int *); + break; + case TYPE_COUNT_LONGLONGINT_POINTER: + ap->a.a_count_longlongint_pointer = va_arg (args, long long int *); + break; +#if ENABLE_UNISTDIO + /* The unistdio extensions. */ + case TYPE_U8_STRING: + ap->a.a_u8_string = va_arg (args, const uint8_t *); + /* A null pointer is an invalid argument for "%U", but in practice + it occurs quite frequently in printf statements that produce + debug output. Use a fallback in this case. */ + if (ap->a.a_u8_string == NULL) + { + static const uint8_t u8_null_string[] = + { '(', 'N', 'U', 'L', 'L', ')', 0 }; + ap->a.a_u8_string = u8_null_string; + } + break; + case TYPE_U16_STRING: + ap->a.a_u16_string = va_arg (args, const uint16_t *); + /* A null pointer is an invalid argument for "%lU", but in practice + it occurs quite frequently in printf statements that produce + debug output. Use a fallback in this case. */ + if (ap->a.a_u16_string == NULL) + { + static const uint16_t u16_null_string[] = + { '(', 'N', 'U', 'L', 'L', ')', 0 }; + ap->a.a_u16_string = u16_null_string; + } + break; + case TYPE_U32_STRING: + ap->a.a_u32_string = va_arg (args, const uint32_t *); + /* A null pointer is an invalid argument for "%llU", but in practice + it occurs quite frequently in printf statements that produce + debug output. Use a fallback in this case. */ + if (ap->a.a_u32_string == NULL) + { + static const uint32_t u32_null_string[] = + { '(', 'N', 'U', 'L', 'L', ')', 0 }; + ap->a.a_u32_string = u32_null_string; + } + break; +#endif + default: + /* Unknown type. */ + return -1; + } + return 0; +} diff -Nru datamash-1.7/lib/printf-args.h datamash-1.8/lib/printf-args.h --- datamash-1.7/lib/printf-args.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/printf-args.h 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,150 @@ +/* Decomposed printf argument list. + Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2021 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 _PRINTF_ARGS_H +#define _PRINTF_ARGS_H + +/* This file can be parametrized with the following macros: + ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions. + PRINTF_FETCHARGS Name of the function to be declared. + STATIC Set to 'static' to declare the function static. */ + +/* Default parameters. */ +#ifndef PRINTF_FETCHARGS +# define PRINTF_FETCHARGS printf_fetchargs +#endif + +/* Get size_t. */ +#include + +/* Get wchar_t. */ +#if HAVE_WCHAR_T +# include +#endif + +/* Get wint_t. */ +#if HAVE_WINT_T +# include +#endif + +/* Get va_list. */ +#include + + +/* Argument types */ +typedef enum +{ + TYPE_NONE, + TYPE_SCHAR, + TYPE_UCHAR, + TYPE_SHORT, + TYPE_USHORT, + TYPE_INT, + TYPE_UINT, + TYPE_LONGINT, + TYPE_ULONGINT, + TYPE_LONGLONGINT, + TYPE_ULONGLONGINT, + TYPE_DOUBLE, + TYPE_LONGDOUBLE, + TYPE_CHAR, +#if HAVE_WINT_T + TYPE_WIDE_CHAR, +#endif + TYPE_STRING, +#if HAVE_WCHAR_T + TYPE_WIDE_STRING, +#endif + TYPE_POINTER, + TYPE_COUNT_SCHAR_POINTER, + TYPE_COUNT_SHORT_POINTER, + TYPE_COUNT_INT_POINTER, + TYPE_COUNT_LONGINT_POINTER, + TYPE_COUNT_LONGLONGINT_POINTER +#if ENABLE_UNISTDIO + /* The unistdio extensions. */ +, TYPE_U8_STRING +, TYPE_U16_STRING +, TYPE_U32_STRING +#endif +} arg_type; + +/* Polymorphic argument */ +typedef struct +{ + arg_type type; + union + { + signed char a_schar; + unsigned char a_uchar; + short a_short; + unsigned short a_ushort; + int a_int; + unsigned int a_uint; + long int a_longint; + unsigned long int a_ulongint; + long long int a_longlongint; + unsigned long long int a_ulonglongint; + float a_float; + double a_double; + long double a_longdouble; + int a_char; +#if HAVE_WINT_T + wint_t a_wide_char; +#endif + const char* a_string; +#if HAVE_WCHAR_T + const wchar_t* a_wide_string; +#endif + void* a_pointer; + signed char * a_count_schar_pointer; + short * a_count_short_pointer; + int * a_count_int_pointer; + long int * a_count_longint_pointer; + long long int * a_count_longlongint_pointer; +#if ENABLE_UNISTDIO + /* The unistdio extensions. */ + const uint8_t * a_u8_string; + const uint16_t * a_u16_string; + const uint32_t * a_u32_string; +#endif + } + a; +} +argument; + +/* Number of directly allocated arguments (no malloc() needed). */ +#define N_DIRECT_ALLOC_ARGUMENTS 7 + +typedef struct +{ + size_t count; + argument *arg; + argument direct_alloc_arg[N_DIRECT_ALLOC_ARGUMENTS]; +} +arguments; + + +/* Fetch the arguments, putting them into a. */ +#ifdef STATIC +STATIC +#else +extern +#endif +int PRINTF_FETCHARGS (va_list args, arguments *a); + +#endif /* _PRINTF_ARGS_H */ diff -Nru datamash-1.7/lib/printf-parse.c datamash-1.8/lib/printf-parse.c --- datamash-1.7/lib/printf-parse.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/printf-parse.c 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,632 @@ +/* Formatted output to strings. + Copyright (C) 1999-2000, 2002-2003, 2006-2021 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 . */ + +/* This file can be parametrized with the following macros: + CHAR_T The element type of the format string. + CHAR_T_ONLY_ASCII Set to 1 to enable verification that all characters + in the format string are ASCII. + DIRECTIVE Structure denoting a format directive. + Depends on CHAR_T. + DIRECTIVES Structure denoting the set of format directives of a + format string. Depends on CHAR_T. + PRINTF_PARSE Function that parses a format string. + Depends on CHAR_T. + STATIC Set to 'static' to declare the function static. + ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions. */ + +#ifndef PRINTF_PARSE +# include +#endif + +/* Specification. */ +#ifndef PRINTF_PARSE +# include "printf-parse.h" +#endif + +/* Default parameters. */ +#ifndef PRINTF_PARSE +# define PRINTF_PARSE printf_parse +# define CHAR_T char +# define DIRECTIVE char_directive +# define DIRECTIVES char_directives +#endif + +/* Get size_t, NULL. */ +#include + +/* Get intmax_t. */ +#if defined IN_LIBINTL || defined IN_LIBASPRINTF +# if HAVE_STDINT_H_WITH_UINTMAX +# include +# endif +# if HAVE_INTTYPES_H_WITH_UINTMAX +# include +# endif +#else +# include +#endif + +/* malloc(), realloc(), free(). */ +#include + +/* memcpy(). */ +#include + +/* errno. */ +#include + +/* Checked size_t computations. */ +#include "xsize.h" + +#if CHAR_T_ONLY_ASCII +/* c_isascii(). */ +# include "c-ctype.h" +#endif + +#ifdef STATIC +STATIC +#endif +int +PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a) +{ + const CHAR_T *cp = format; /* pointer into format */ + size_t arg_posn = 0; /* number of regular arguments consumed */ + size_t d_allocated; /* allocated elements of d->dir */ + size_t a_allocated; /* allocated elements of a->arg */ + size_t max_width_length = 0; + size_t max_precision_length = 0; + + d->count = 0; + d_allocated = N_DIRECT_ALLOC_DIRECTIVES; + d->dir = d->direct_alloc_dir; + + a->count = 0; + a_allocated = N_DIRECT_ALLOC_ARGUMENTS; + a->arg = a->direct_alloc_arg; + +#define REGISTER_ARG(_index_,_type_) \ + { \ + size_t n = (_index_); \ + if (n >= a_allocated) \ + { \ + size_t memory_size; \ + argument *memory; \ + \ + a_allocated = xtimes (a_allocated, 2); \ + if (a_allocated <= n) \ + a_allocated = xsum (n, 1); \ + memory_size = xtimes (a_allocated, sizeof (argument)); \ + if (size_overflow_p (memory_size)) \ + /* Overflow, would lead to out of memory. */ \ + goto out_of_memory; \ + memory = (argument *) (a->arg != a->direct_alloc_arg \ + ? realloc (a->arg, memory_size) \ + : malloc (memory_size)); \ + if (memory == NULL) \ + /* Out of memory. */ \ + goto out_of_memory; \ + if (a->arg == a->direct_alloc_arg) \ + memcpy (memory, a->arg, a->count * sizeof (argument)); \ + a->arg = memory; \ + } \ + while (a->count <= n) \ + a->arg[a->count++].type = TYPE_NONE; \ + if (a->arg[n].type == TYPE_NONE) \ + a->arg[n].type = (_type_); \ + else if (a->arg[n].type != (_type_)) \ + /* Ambiguous type for positional argument. */ \ + goto error; \ + } + + while (*cp != '\0') + { + CHAR_T c = *cp++; + if (c == '%') + { + size_t arg_index = ARG_NONE; + DIRECTIVE *dp = &d->dir[d->count]; /* pointer to next directive */ + + /* Initialize the next directive. */ + dp->dir_start = cp - 1; + dp->flags = 0; + dp->width_start = NULL; + dp->width_end = NULL; + dp->width_arg_index = ARG_NONE; + dp->precision_start = NULL; + dp->precision_end = NULL; + dp->precision_arg_index = ARG_NONE; + dp->arg_index = ARG_NONE; + + /* Test for positional argument. */ + if (*cp >= '0' && *cp <= '9') + { + const CHAR_T *np; + + for (np = cp; *np >= '0' && *np <= '9'; np++) + ; + if (*np == '$') + { + size_t n = 0; + + for (np = cp; *np >= '0' && *np <= '9'; np++) + n = xsum (xtimes (n, 10), *np - '0'); + if (n == 0) + /* Positional argument 0. */ + goto error; + if (size_overflow_p (n)) + /* n too large, would lead to out of memory later. */ + goto error; + arg_index = n - 1; + cp = np + 1; + } + } + + /* Read the flags. */ + for (;;) + { + if (*cp == '\'') + { + dp->flags |= FLAG_GROUP; + cp++; + } + else if (*cp == '-') + { + dp->flags |= FLAG_LEFT; + cp++; + } + else if (*cp == '+') + { + dp->flags |= FLAG_SHOWSIGN; + cp++; + } + else if (*cp == ' ') + { + dp->flags |= FLAG_SPACE; + cp++; + } + else if (*cp == '#') + { + dp->flags |= FLAG_ALT; + cp++; + } + else if (*cp == '0') + { + dp->flags |= FLAG_ZERO; + cp++; + } +#if __GLIBC__ >= 2 && !defined __UCLIBC__ + else if (*cp == 'I') + { + dp->flags |= FLAG_LOCALIZED; + cp++; + } +#endif + else + break; + } + + /* Parse the field width. */ + if (*cp == '*') + { + dp->width_start = cp; + cp++; + dp->width_end = cp; + if (max_width_length < 1) + max_width_length = 1; + + /* Test for positional argument. */ + if (*cp >= '0' && *cp <= '9') + { + const CHAR_T *np; + + for (np = cp; *np >= '0' && *np <= '9'; np++) + ; + if (*np == '$') + { + size_t n = 0; + + for (np = cp; *np >= '0' && *np <= '9'; np++) + n = xsum (xtimes (n, 10), *np - '0'); + if (n == 0) + /* Positional argument 0. */ + goto error; + if (size_overflow_p (n)) + /* n too large, would lead to out of memory later. */ + goto error; + dp->width_arg_index = n - 1; + cp = np + 1; + } + } + if (dp->width_arg_index == ARG_NONE) + { + dp->width_arg_index = arg_posn++; + if (dp->width_arg_index == ARG_NONE) + /* arg_posn wrapped around. */ + goto error; + } + REGISTER_ARG (dp->width_arg_index, TYPE_INT); + } + else if (*cp >= '0' && *cp <= '9') + { + size_t width_length; + + dp->width_start = cp; + for (; *cp >= '0' && *cp <= '9'; cp++) + ; + dp->width_end = cp; + width_length = dp->width_end - dp->width_start; + if (max_width_length < width_length) + max_width_length = width_length; + } + + /* Parse the precision. */ + if (*cp == '.') + { + cp++; + if (*cp == '*') + { + dp->precision_start = cp - 1; + cp++; + dp->precision_end = cp; + if (max_precision_length < 2) + max_precision_length = 2; + + /* Test for positional argument. */ + if (*cp >= '0' && *cp <= '9') + { + const CHAR_T *np; + + for (np = cp; *np >= '0' && *np <= '9'; np++) + ; + if (*np == '$') + { + size_t n = 0; + + for (np = cp; *np >= '0' && *np <= '9'; np++) + n = xsum (xtimes (n, 10), *np - '0'); + if (n == 0) + /* Positional argument 0. */ + goto error; + if (size_overflow_p (n)) + /* n too large, would lead to out of memory + later. */ + goto error; + dp->precision_arg_index = n - 1; + cp = np + 1; + } + } + if (dp->precision_arg_index == ARG_NONE) + { + dp->precision_arg_index = arg_posn++; + if (dp->precision_arg_index == ARG_NONE) + /* arg_posn wrapped around. */ + goto error; + } + REGISTER_ARG (dp->precision_arg_index, TYPE_INT); + } + else + { + size_t precision_length; + + dp->precision_start = cp - 1; + for (; *cp >= '0' && *cp <= '9'; cp++) + ; + dp->precision_end = cp; + precision_length = dp->precision_end - dp->precision_start; + if (max_precision_length < precision_length) + max_precision_length = precision_length; + } + } + + { + arg_type type; + + /* Parse argument type/size specifiers. */ + { + int flags = 0; + + for (;;) + { + if (*cp == 'h') + { + flags |= (1 << (flags & 1)); + cp++; + } + else if (*cp == 'L') + { + flags |= 4; + cp++; + } + else if (*cp == 'l') + { + flags += 8; + cp++; + } + else if (*cp == 'j') + { + if (sizeof (intmax_t) > sizeof (long)) + { + /* intmax_t = long long */ + flags += 16; + } + else if (sizeof (intmax_t) > sizeof (int)) + { + /* intmax_t = long */ + flags += 8; + } + cp++; + } + else if (*cp == 'z' || *cp == 'Z') + { + /* 'z' is standardized in ISO C 99, but glibc uses 'Z' + because the warning facility in gcc-2.95.2 understands + only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784). */ + if (sizeof (size_t) > sizeof (long)) + { + /* size_t = long long */ + flags += 16; + } + else if (sizeof (size_t) > sizeof (int)) + { + /* size_t = long */ + flags += 8; + } + cp++; + } + else if (*cp == 't') + { + if (sizeof (ptrdiff_t) > sizeof (long)) + { + /* ptrdiff_t = long long */ + flags += 16; + } + else if (sizeof (ptrdiff_t) > sizeof (int)) + { + /* ptrdiff_t = long */ + flags += 8; + } + cp++; + } +#if defined __APPLE__ && defined __MACH__ + /* On Mac OS X 10.3, PRIdMAX is defined as "qd". + We cannot change it to "lld" because PRIdMAX must also + be understood by the system's printf routines. */ + else if (*cp == 'q') + { + if (64 / 8 > sizeof (long)) + { + /* int64_t = long long */ + flags += 16; + } + else + { + /* int64_t = long */ + flags += 8; + } + cp++; + } +#endif +#if defined _WIN32 && ! defined __CYGWIN__ + /* On native Windows, PRIdMAX is defined as "I64d". + We cannot change it to "lld" because PRIdMAX must also + be understood by the system's printf routines. */ + else if (*cp == 'I' && cp[1] == '6' && cp[2] == '4') + { + if (64 / 8 > sizeof (long)) + { + /* __int64 = long long */ + flags += 16; + } + else + { + /* __int64 = long */ + flags += 8; + } + cp += 3; + } +#endif + else + break; + } + + /* Read the conversion character. */ + c = *cp++; + switch (c) + { + case 'd': case 'i': + /* If 'long long' is larger than 'long': */ + if (flags >= 16 || (flags & 4)) + type = TYPE_LONGLONGINT; + else + /* If 'long long' is the same as 'long', we parse "lld" into + TYPE_LONGINT. */ + if (flags >= 8) + type = TYPE_LONGINT; + else if (flags & 2) + type = TYPE_SCHAR; + else if (flags & 1) + type = TYPE_SHORT; + else + type = TYPE_INT; + break; + case 'o': case 'u': case 'x': case 'X': + /* If 'unsigned long long' is larger than 'unsigned long': */ + if (flags >= 16 || (flags & 4)) + type = TYPE_ULONGLONGINT; + else + /* If 'unsigned long long' is the same as 'unsigned long', we + parse "llu" into TYPE_ULONGINT. */ + if (flags >= 8) + type = TYPE_ULONGINT; + else if (flags & 2) + type = TYPE_UCHAR; + else if (flags & 1) + type = TYPE_USHORT; + else + type = TYPE_UINT; + break; + case 'f': case 'F': case 'e': case 'E': case 'g': case 'G': + case 'a': case 'A': + if (flags >= 16 || (flags & 4)) + type = TYPE_LONGDOUBLE; + else + type = TYPE_DOUBLE; + break; + case 'c': + if (flags >= 8) +#if HAVE_WINT_T + type = TYPE_WIDE_CHAR; +#else + goto error; +#endif + else + type = TYPE_CHAR; + break; +#if HAVE_WINT_T + case 'C': + type = TYPE_WIDE_CHAR; + c = 'c'; + break; +#endif + case 's': + if (flags >= 8) +#if HAVE_WCHAR_T + type = TYPE_WIDE_STRING; +#else + goto error; +#endif + else + type = TYPE_STRING; + break; +#if HAVE_WCHAR_T + case 'S': + type = TYPE_WIDE_STRING; + c = 's'; + break; +#endif + case 'p': + type = TYPE_POINTER; + break; + case 'n': + /* If 'long long' is larger than 'long': */ + if (flags >= 16 || (flags & 4)) + type = TYPE_COUNT_LONGLONGINT_POINTER; + else + /* If 'long long' is the same as 'long', we parse "lln" into + TYPE_COUNT_LONGINT_POINTER. */ + if (flags >= 8) + type = TYPE_COUNT_LONGINT_POINTER; + else if (flags & 2) + type = TYPE_COUNT_SCHAR_POINTER; + else if (flags & 1) + type = TYPE_COUNT_SHORT_POINTER; + else + type = TYPE_COUNT_INT_POINTER; + break; +#if ENABLE_UNISTDIO + /* The unistdio extensions. */ + case 'U': + if (flags >= 16) + type = TYPE_U32_STRING; + else if (flags >= 8) + type = TYPE_U16_STRING; + else + type = TYPE_U8_STRING; + break; +#endif + case '%': + type = TYPE_NONE; + break; + default: + /* Unknown conversion character. */ + goto error; + } + } + + if (type != TYPE_NONE) + { + dp->arg_index = arg_index; + if (dp->arg_index == ARG_NONE) + { + dp->arg_index = arg_posn++; + if (dp->arg_index == ARG_NONE) + /* arg_posn wrapped around. */ + goto error; + } + REGISTER_ARG (dp->arg_index, type); + } + dp->conversion = c; + dp->dir_end = cp; + } + + d->count++; + if (d->count >= d_allocated) + { + size_t memory_size; + DIRECTIVE *memory; + + d_allocated = xtimes (d_allocated, 2); + memory_size = xtimes (d_allocated, sizeof (DIRECTIVE)); + if (size_overflow_p (memory_size)) + /* Overflow, would lead to out of memory. */ + goto out_of_memory; + memory = (DIRECTIVE *) (d->dir != d->direct_alloc_dir + ? realloc (d->dir, memory_size) + : malloc (memory_size)); + if (memory == NULL) + /* Out of memory. */ + goto out_of_memory; + if (d->dir == d->direct_alloc_dir) + memcpy (memory, d->dir, d->count * sizeof (DIRECTIVE)); + d->dir = memory; + } + } +#if CHAR_T_ONLY_ASCII + else if (!c_isascii (c)) + { + /* Non-ASCII character. Not supported. */ + goto error; + } +#endif + } + d->dir[d->count].dir_start = cp; + + d->max_width_length = max_width_length; + d->max_precision_length = max_precision_length; + return 0; + +error: + if (a->arg != a->direct_alloc_arg) + free (a->arg); + if (d->dir != d->direct_alloc_dir) + free (d->dir); + errno = EINVAL; + return -1; + +out_of_memory: + if (a->arg != a->direct_alloc_arg) + free (a->arg); + if (d->dir != d->direct_alloc_dir) + free (d->dir); + errno = ENOMEM; + return -1; +} + +#undef PRINTF_PARSE +#undef DIRECTIVES +#undef DIRECTIVE +#undef CHAR_T_ONLY_ASCII +#undef CHAR_T diff -Nru datamash-1.7/lib/printf-parse.h datamash-1.8/lib/printf-parse.h --- datamash-1.7/lib/printf-parse.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/printf-parse.h 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,193 @@ +/* Parse printf format string. + Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2021 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 _PRINTF_PARSE_H +#define _PRINTF_PARSE_H + +/* This file can be parametrized with the following macros: + ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions. + STATIC Set to 'static' to declare the function static. */ + +#if HAVE_FEATURES_H +# include /* for __GLIBC__, __UCLIBC__ */ +#endif + +#include "printf-args.h" + + +/* Flags */ +#define FLAG_GROUP 1 /* ' flag */ +#define FLAG_LEFT 2 /* - flag */ +#define FLAG_SHOWSIGN 4 /* + flag */ +#define FLAG_SPACE 8 /* space flag */ +#define FLAG_ALT 16 /* # flag */ +#define FLAG_ZERO 32 +#if __GLIBC__ >= 2 && !defined __UCLIBC__ +# define FLAG_LOCALIZED 64 /* I flag, uses localized digits */ +#endif + +/* arg_index value indicating that no argument is consumed. */ +#define ARG_NONE (~(size_t)0) + +/* xxx_directive: A parsed directive. + xxx_directives: A parsed format string. */ + +/* Number of directly allocated directives (no malloc() needed). */ +#define N_DIRECT_ALLOC_DIRECTIVES 7 + +/* A parsed directive. */ +typedef struct +{ + const char* dir_start; + const char* dir_end; + int flags; + const char* width_start; + const char* width_end; + size_t width_arg_index; + const char* precision_start; + const char* precision_end; + size_t precision_arg_index; + char conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */ + size_t arg_index; +} +char_directive; + +/* A parsed format string. */ +typedef struct +{ + size_t count; + char_directive *dir; + size_t max_width_length; + size_t max_precision_length; + char_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES]; +} +char_directives; + +#if ENABLE_UNISTDIO + +/* A parsed directive. */ +typedef struct +{ + const uint8_t* dir_start; + const uint8_t* dir_end; + int flags; + const uint8_t* width_start; + const uint8_t* width_end; + size_t width_arg_index; + const uint8_t* precision_start; + const uint8_t* precision_end; + size_t precision_arg_index; + uint8_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */ + size_t arg_index; +} +u8_directive; + +/* A parsed format string. */ +typedef struct +{ + size_t count; + u8_directive *dir; + size_t max_width_length; + size_t max_precision_length; + u8_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES]; +} +u8_directives; + +/* A parsed directive. */ +typedef struct +{ + const uint16_t* dir_start; + const uint16_t* dir_end; + int flags; + const uint16_t* width_start; + const uint16_t* width_end; + size_t width_arg_index; + const uint16_t* precision_start; + const uint16_t* precision_end; + size_t precision_arg_index; + uint16_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */ + size_t arg_index; +} +u16_directive; + +/* A parsed format string. */ +typedef struct +{ + size_t count; + u16_directive *dir; + size_t max_width_length; + size_t max_precision_length; + u16_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES]; +} +u16_directives; + +/* A parsed directive. */ +typedef struct +{ + const uint32_t* dir_start; + const uint32_t* dir_end; + int flags; + const uint32_t* width_start; + const uint32_t* width_end; + size_t width_arg_index; + const uint32_t* precision_start; + const uint32_t* precision_end; + size_t precision_arg_index; + uint32_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */ + size_t arg_index; +} +u32_directive; + +/* A parsed format string. */ +typedef struct +{ + size_t count; + u32_directive *dir; + size_t max_width_length; + size_t max_precision_length; + u32_directive direct_alloc_dir[N_DIRECT_ALLOC_DIRECTIVES]; +} +u32_directives; + +#endif + + +/* Parses the format string. Fills in the number N of directives, and fills + in directives[0], ..., directives[N-1], and sets directives[N].dir_start + to the end of the format string. Also fills in the arg_type fields of the + arguments and the needed count of arguments. */ +#if ENABLE_UNISTDIO +extern int + ulc_printf_parse (const char *format, char_directives *d, arguments *a); +extern int + u8_printf_parse (const uint8_t *format, u8_directives *d, arguments *a); +extern int + u16_printf_parse (const uint16_t *format, u16_directives *d, + arguments *a); +extern int + u32_printf_parse (const uint32_t *format, u32_directives *d, + arguments *a); +#else +# ifdef STATIC +STATIC +# else +extern +# endif +int printf_parse (const char *format, char_directives *d, arguments *a); +#endif + +#endif /* _PRINTF_PARSE_H */ diff -Nru datamash-1.7/lib/progname.c datamash-1.8/lib/progname.c --- datamash-1.7/lib/progname.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/progname.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Program name management. - Copyright (C) 2001-2003, 2005-2020 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2005-2021 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.7/lib/progname.h datamash-1.8/lib/progname.h --- datamash-1.7/lib/progname.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/progname.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Program name management. - Copyright (C) 2001-2004, 2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2001-2004, 2006, 2009-2021 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.7/lib/propername.c datamash-1.8/lib/propername.c --- datamash-1.7/lib/propername.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/propername.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Localization of proper names. - Copyright (C) 2006-2020 Free Software Foundation, Inc. + Copyright (C) 2006-2021 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.7/lib/propername.h datamash-1.8/lib/propername.h --- datamash-1.7/lib/propername.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/propername.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Localization of proper names. -*- coding: utf-8 -*- - Copyright (C) 2006, 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2006, 2008-2021 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.7/lib/quotearg.c datamash-1.8/lib/quotearg.c --- datamash-1.7/lib/quotearg.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/quotearg.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* quotearg.c - quote arguments for output - Copyright (C) 1998-2002, 2004-2020 Free Software Foundation, Inc. + Copyright (C) 1998-2002, 2004-2021 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 "attribute.h" #include "minmax.h" #include "xalloc.h" #include "c-strcaseeq.h" @@ -54,14 +55,6 @@ #define INT_BITS (sizeof (int) * CHAR_BIT) -#ifndef FALLTHROUGH -# if __GNUC__ < 7 -# define FALLTHROUGH ((void) 0) -# else -# define FALLTHROUGH __attribute__ ((__fallthrough__)) -# endif -#endif - struct quoting_options { /* Basic quoting style. */ diff -Nru datamash-1.7/lib/quotearg.h datamash-1.8/lib/quotearg.h --- datamash-1.7/lib/quotearg.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/quotearg.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* quotearg.h - quote arguments for output - Copyright (C) 1998-2002, 2004, 2006, 2008-2020 Free Software Foundation, + Copyright (C) 1998-2002, 2004, 2006, 2008-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.7/lib/quote.h datamash-1.8/lib/quote.h --- datamash-1.7/lib/quote.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/quote.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* quote.h - prototypes for quote.c - Copyright (C) 1998-2001, 2003, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 1998-2001, 2003, 2009-2021 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.7/lib/random.c datamash-1.8/lib/random.c --- datamash-1.7/lib/random.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/random.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (C) 1995-2020 Free Software Foundation, Inc. +/* Copyright (C) 1995-2021 Free Software Foundation, Inc. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public diff -Nru datamash-1.7/lib/random_r.c datamash-1.8/lib/random_r.c --- datamash-1.7/lib/random_r.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/random_r.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* - Copyright (C) 1995-2020 Free Software Foundation, Inc. + Copyright (C) 1995-2021 Free Software Foundation, Inc. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public diff -Nru datamash-1.7/lib/realloc.c datamash-1.8/lib/realloc.c --- datamash-1.7/lib/realloc.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/realloc.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* realloc() function that is glibc compatible. - Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2020 Free Software + Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.7/lib/round.c datamash-1.8/lib/round.c --- datamash-1.7/lib/round.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/round.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Round toward nearest, breaking ties away from zero. - Copyright (C) 2007, 2010-2020 Free Software Foundation, Inc. + Copyright (C) 2007, 2010-2021 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,7 +66,7 @@ /* MSVC with option -fp:strict refuses to compile constant initializers that contain floating-point operations. Pacify this compiler. */ -#ifdef _MSC_VER +#if defined _MSC_VER && !defined __clang__ # pragma fenv_access (off) #endif diff -Nru datamash-1.7/lib/roundl.c datamash-1.8/lib/roundl.c --- datamash-1.7/lib/roundl.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/roundl.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Round toward nearest, breaking ties away from zero. - Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2021 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.7/lib/setlocale.c datamash-1.8/lib/setlocale.c --- datamash-1.7/lib/setlocale.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/setlocale.c 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,1673 @@ +/* Set the current locale. -*- coding: utf-8 -*- + Copyright (C) 2009, 2011-2021 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 , 2009. */ + +#include + +/* Override setlocale() so that when the default locale is requested + (locale = ""), the environment variables LC_ALL, LC_*, and LANG are + considered. + Also include all the functionality from libintl's setlocale() override. */ + +/* Please keep this file in sync with + gettext/gettext-runtime/intl/setlocale.c ! */ + +/* Specification. */ +#include + +#include +#include +#include + +#include "localename.h" + +#if HAVE_CFLOCALECOPYPREFERREDLANGUAGES || HAVE_CFPREFERENCESCOPYAPPVALUE +# if HAVE_CFLOCALECOPYPREFERREDLANGUAGES +# include +# elif HAVE_CFPREFERENCESCOPYAPPVALUE +# include +# endif +# include +# include +# include +extern void gl_locale_name_canonicalize (char *name); +#endif + +#if 1 + +# undef setlocale + +/* Which of the replacements to activate? */ +# if NEED_SETLOCALE_IMPROVED +# define setlocale_improved rpl_setlocale +# elif NEED_SETLOCALE_MTSAFE +# define setlocale_mtsafe rpl_setlocale +# else +# error "This file should only be compiled if NEED_SETLOCALE_IMPROVED || NEED_SETLOCALE_MTSAFE." +# endif + +/* Like setlocale, but guaranteed to be multithread-safe if LOCALE == NULL. */ +# if !SETLOCALE_NULL_ALL_MTSAFE || !SETLOCALE_NULL_ONE_MTSAFE /* i.e. if NEED_SETLOCALE_MTSAFE */ + +# if NEED_SETLOCALE_IMPROVED +static +# endif +char * +setlocale_mtsafe (int category, const char *locale) +{ + if (locale == NULL) + return (char *) setlocale_null (category); + else + return setlocale (category, locale); +} +# else /* !NEED_SETLOCALE_MTSAFE */ + +# define setlocale_mtsafe setlocale + +# endif /* NEED_SETLOCALE_MTSAFE */ + +# if NEED_SETLOCALE_IMPROVED + +/* Return string representation of locale category CATEGORY. */ +static const char * +category_to_name (int category) +{ + const char *retval; + + switch (category) + { + case LC_COLLATE: + retval = "LC_COLLATE"; + break; + case LC_CTYPE: + retval = "LC_CTYPE"; + break; + case LC_MONETARY: + retval = "LC_MONETARY"; + break; + case LC_NUMERIC: + retval = "LC_NUMERIC"; + break; + case LC_TIME: + retval = "LC_TIME"; + break; + case LC_MESSAGES: + retval = "LC_MESSAGES"; + break; + default: + /* If you have a better idea for a default value let me know. */ + retval = "LC_XXX"; + } + + return retval; +} + +# if defined _WIN32 && ! defined __CYGWIN__ + +/* The native Windows setlocale() function expects locale names of the form + "German" or "German_Germany" or "DEU", but not "de" or "de_DE". We need + to convert the names from the form with ISO 639 language code and ISO 3166 + country code to the form with English names or with three-letter identifier. + The three-letter identifiers known by a Windows XP SP2 or SP3 are: + AFK Afrikaans_South Africa.1252 + ARA Arabic_Saudi Arabia.1256 + ARB Arabic_Lebanon.1256 + ARE Arabic_Egypt.1256 + ARG Arabic_Algeria.1256 + ARH Arabic_Bahrain.1256 + ARI Arabic_Iraq.1256 + ARJ Arabic_Jordan.1256 + ARK Arabic_Kuwait.1256 + ARL Arabic_Libya.1256 + ARM Arabic_Morocco.1256 + ARO Arabic_Oman.1256 + ARQ Arabic_Qatar.1256 + ARS Arabic_Syria.1256 + ART Arabic_Tunisia.1256 + ARU Arabic_U.A.E..1256 + ARY Arabic_Yemen.1256 + AZE Azeri (Latin)_Azerbaijan.1254 + BEL Belarusian_Belarus.1251 + BGR Bulgarian_Bulgaria.1251 + BSB Bosnian_Bosnia and Herzegovina.1250 + BSC Bosnian (Cyrillic)_Bosnia and Herzegovina.1250 (wrong encoding!) + CAT Catalan_Spain.1252 + CHH Chinese_Hong Kong S.A.R..950 + CHI Chinese_Singapore.936 + CHS Chinese_People's Republic of China.936 + CHT Chinese_Taiwan.950 + CSY Czech_Czech Republic.1250 + CYM Welsh_United Kingdom.1252 + DAN Danish_Denmark.1252 + DEA German_Austria.1252 + DEC German_Liechtenstein.1252 + DEL German_Luxembourg.1252 + DES German_Switzerland.1252 + DEU German_Germany.1252 + ELL Greek_Greece.1253 + ENA English_Australia.1252 + ENB English_Caribbean.1252 + ENC English_Canada.1252 + ENG English_United Kingdom.1252 + ENI English_Ireland.1252 + ENJ English_Jamaica.1252 + ENL English_Belize.1252 + ENP English_Republic of the Philippines.1252 + ENS English_South Africa.1252 + ENT English_Trinidad and Tobago.1252 + ENU English_United States.1252 + ENW English_Zimbabwe.1252 + ENZ English_New Zealand.1252 + ESA Spanish_Panama.1252 + ESB Spanish_Bolivia.1252 + ESC Spanish_Costa Rica.1252 + ESD Spanish_Dominican Republic.1252 + ESE Spanish_El Salvador.1252 + ESF Spanish_Ecuador.1252 + ESG Spanish_Guatemala.1252 + ESH Spanish_Honduras.1252 + ESI Spanish_Nicaragua.1252 + ESL Spanish_Chile.1252 + ESM Spanish_Mexico.1252 + ESN Spanish_Spain.1252 + ESO Spanish_Colombia.1252 + ESP Spanish_Spain.1252 + ESR Spanish_Peru.1252 + ESS Spanish_Argentina.1252 + ESU Spanish_Puerto Rico.1252 + ESV Spanish_Venezuela.1252 + ESY Spanish_Uruguay.1252 + ESZ Spanish_Paraguay.1252 + ETI Estonian_Estonia.1257 + EUQ Basque_Spain.1252 + FAR Farsi_Iran.1256 + FIN Finnish_Finland.1252 + FOS Faroese_Faroe Islands.1252 + FPO Filipino_Philippines.1252 + FRA French_France.1252 + FRB French_Belgium.1252 + FRC French_Canada.1252 + FRL French_Luxembourg.1252 + FRM French_Principality of Monaco.1252 + FRS French_Switzerland.1252 + FYN Frisian_Netherlands.1252 + GLC Galician_Spain.1252 + HEB Hebrew_Israel.1255 + HRB Croatian_Bosnia and Herzegovina.1250 + HRV Croatian_Croatia.1250 + HUN Hungarian_Hungary.1250 + IND Indonesian_Indonesia.1252 + IRE Irish_Ireland.1252 + ISL Icelandic_Iceland.1252 + ITA Italian_Italy.1252 + ITS Italian_Switzerland.1252 + IUK Inuktitut (Latin)_Canada.1252 + JPN Japanese_Japan.932 + KKZ Kazakh_Kazakhstan.1251 + KOR Korean_Korea.949 + KYR Kyrgyz_Kyrgyzstan.1251 + LBX Luxembourgish_Luxembourg.1252 + LTH Lithuanian_Lithuania.1257 + LVI Latvian_Latvia.1257 + MKI FYRO Macedonian_Former Yugoslav Republic of Macedonia.1251 + MON Mongolian_Mongolia.1251 + MPD Mapudungun_Chile.1252 + MSB Malay_Brunei Darussalam.1252 + MSL Malay_Malaysia.1252 + MWK Mohawk_Canada.1252 + NLB Dutch_Belgium.1252 + NLD Dutch_Netherlands.1252 + NON Norwegian-Nynorsk_Norway.1252 + NOR Norwegian (Bokmål)_Norway.1252 + NSO Northern Sotho_South Africa.1252 + PLK Polish_Poland.1250 + PTB Portuguese_Brazil.1252 + PTG Portuguese_Portugal.1252 + QUB Quechua_Bolivia.1252 + QUE Quechua_Ecuador.1252 + QUP Quechua_Peru.1252 + RMC Romansh_Switzerland.1252 + ROM Romanian_Romania.1250 + RUS Russian_Russia.1251 + SKY Slovak_Slovakia.1250 + SLV Slovenian_Slovenia.1250 + SMA Sami (Southern)_Norway.1252 + SMB Sami (Southern)_Sweden.1252 + SME Sami (Northern)_Norway.1252 + SMF Sami (Northern)_Sweden.1252 + SMG Sami (Northern)_Finland.1252 + SMJ Sami (Lule)_Norway.1252 + SMK Sami (Lule)_Sweden.1252 + SMN Sami (Inari)_Finland.1252 + SMS Sami (Skolt)_Finland.1252 + SQI Albanian_Albania.1250 + SRB Serbian (Cyrillic)_Serbia and Montenegro.1251 + SRL Serbian (Latin)_Serbia and Montenegro.1250 + SRN Serbian (Cyrillic)_Bosnia and Herzegovina.1251 + SRS Serbian (Latin)_Bosnia and Herzegovina.1250 + SVE Swedish_Sweden.1252 + SVF Swedish_Finland.1252 + SWK Swahili_Kenya.1252 + THA Thai_Thailand.874 + TRK Turkish_Turkey.1254 + TSN Tswana_South Africa.1252 + TTT Tatar_Russia.1251 + UKR Ukrainian_Ukraine.1251 + URD Urdu_Islamic Republic of Pakistan.1256 + USA English_United States.1252 + UZB Uzbek (Latin)_Uzbekistan.1254 + VIT Vietnamese_Viet Nam.1258 + XHO Xhosa_South Africa.1252 + ZHH Chinese_Hong Kong S.A.R..950 + ZHI Chinese_Singapore.936 + ZHM Chinese_Macau S.A.R..950 + ZUL Zulu_South Africa.1252 + */ + +/* Table from ISO 639 language code, optionally with country or script suffix, + to English name. + Keep in sync with the gl_locale_name_from_win32_LANGID function in + localename.c! */ +struct table_entry +{ + const char *code; + const char *english; +}; +static const struct table_entry language_table[] = + { + { "af", "Afrikaans" }, + { "am", "Amharic" }, + { "ar", "Arabic" }, + { "arn", "Mapudungun" }, + { "as", "Assamese" }, + { "az@cyrillic", "Azeri (Cyrillic)" }, + { "az@latin", "Azeri (Latin)" }, + { "ba", "Bashkir" }, + { "be", "Belarusian" }, + { "ber", "Tamazight" }, + { "ber@arabic", "Tamazight (Arabic)" }, + { "ber@latin", "Tamazight (Latin)" }, + { "bg", "Bulgarian" }, + { "bin", "Edo" }, + { "bn", "Bengali" }, + { "bn_BD", "Bengali (Bangladesh)" }, + { "bn_IN", "Bengali (India)" }, + { "bnt", "Sutu" }, + { "bo", "Tibetan" }, + { "br", "Breton" }, + { "bs", "BSB" }, /* "Bosnian (Latin)" */ + { "bs@cyrillic", "BSC" }, /* Bosnian (Cyrillic) */ + { "ca", "Catalan" }, + { "chr", "Cherokee" }, + { "co", "Corsican" }, + { "cpe", "Hawaiian" }, + { "cs", "Czech" }, + { "cy", "Welsh" }, + { "da", "Danish" }, + { "de", "German" }, + { "dsb", "Lower Sorbian" }, + { "dv", "Divehi" }, + { "el", "Greek" }, + { "en", "English" }, + { "es", "Spanish" }, + { "et", "Estonian" }, + { "eu", "Basque" }, + { "fa", "Farsi" }, + { "ff", "Fulfulde" }, + { "fi", "Finnish" }, + { "fo", "Faroese" }, /* "Faeroese" does not work */ + { "fr", "French" }, + { "fy", "Frisian" }, + { "ga", "IRE" }, /* Gaelic (Ireland) */ + { "gd", "Gaelic (Scotland)" }, + { "gd", "Scottish Gaelic" }, + { "gl", "Galician" }, + { "gn", "Guarani" }, + { "gsw", "Alsatian" }, + { "gu", "Gujarati" }, + { "ha", "Hausa" }, + { "he", "Hebrew" }, + { "hi", "Hindi" }, + { "hr", "Croatian" }, + { "hsb", "Upper Sorbian" }, + { "hu", "Hungarian" }, + { "hy", "Armenian" }, + { "id", "Indonesian" }, + { "ig", "Igbo" }, + { "ii", "Yi" }, + { "is", "Icelandic" }, + { "it", "Italian" }, + { "iu", "IUK" }, /* Inuktitut */ + { "ja", "Japanese" }, + { "ka", "Georgian" }, + { "kk", "Kazakh" }, + { "kl", "Greenlandic" }, + { "km", "Cambodian" }, + { "km", "Khmer" }, + { "kn", "Kannada" }, + { "ko", "Korean" }, + { "kok", "Konkani" }, + { "kr", "Kanuri" }, + { "ks", "Kashmiri" }, + { "ks_IN", "Kashmiri_India" }, + { "ks_PK", "Kashmiri (Arabic)_Pakistan" }, + { "ky", "Kyrgyz" }, + { "la", "Latin" }, + { "lb", "Luxembourgish" }, + { "lo", "Lao" }, + { "lt", "Lithuanian" }, + { "lv", "Latvian" }, + { "mi", "Maori" }, + { "mk", "FYRO Macedonian" }, + { "mk", "Macedonian" }, + { "ml", "Malayalam" }, + { "mn", "Mongolian" }, + { "mni", "Manipuri" }, + { "moh", "Mohawk" }, + { "mr", "Marathi" }, + { "ms", "Malay" }, + { "mt", "Maltese" }, + { "my", "Burmese" }, + { "nb", "NOR" }, /* Norwegian Bokmål */ + { "ne", "Nepali" }, + { "nic", "Ibibio" }, + { "nl", "Dutch" }, + { "nn", "NON" }, /* Norwegian Nynorsk */ + { "no", "Norwegian" }, + { "nso", "Northern Sotho" }, + { "nso", "Sepedi" }, + { "oc", "Occitan" }, + { "om", "Oromo" }, + { "or", "Oriya" }, + { "pa", "Punjabi" }, + { "pap", "Papiamentu" }, + { "pl", "Polish" }, + { "prs", "Dari" }, + { "ps", "Pashto" }, + { "pt", "Portuguese" }, + { "qu", "Quechua" }, + { "qut", "K'iche'" }, + { "rm", "Romansh" }, + { "ro", "Romanian" }, + { "ru", "Russian" }, + { "rw", "Kinyarwanda" }, + { "sa", "Sanskrit" }, + { "sah", "Yakut" }, + { "sd", "Sindhi" }, + { "se", "Sami (Northern)" }, + { "se", "Northern Sami" }, + { "si", "Sinhalese" }, + { "sk", "Slovak" }, + { "sl", "Slovenian" }, + { "sma", "Sami (Southern)" }, + { "sma", "Southern Sami" }, + { "smj", "Sami (Lule)" }, + { "smj", "Lule Sami" }, + { "smn", "Sami (Inari)" }, + { "smn", "Inari Sami" }, + { "sms", "Sami (Skolt)" }, + { "sms", "Skolt Sami" }, + { "so", "Somali" }, + { "sq", "Albanian" }, + { "sr", "Serbian (Latin)" }, + { "sr@cyrillic", "SRB" }, /* Serbian (Cyrillic) */ + { "sv", "Swedish" }, + { "sw", "Swahili" }, + { "syr", "Syriac" }, + { "ta", "Tamil" }, + { "te", "Telugu" }, + { "tg", "Tajik" }, + { "th", "Thai" }, + { "ti", "Tigrinya" }, + { "tk", "Turkmen" }, + { "tl", "Filipino" }, + { "tn", "Tswana" }, + { "tr", "Turkish" }, + { "ts", "Tsonga" }, + { "tt", "Tatar" }, + { "ug", "Uighur" }, + { "uk", "Ukrainian" }, + { "ur", "Urdu" }, + { "uz", "Uzbek" }, + { "uz", "Uzbek (Latin)" }, + { "uz@cyrillic", "Uzbek (Cyrillic)" }, + { "ve", "Venda" }, + { "vi", "Vietnamese" }, + { "wen", "Sorbian" }, + { "wo", "Wolof" }, + { "xh", "Xhosa" }, + { "yi", "Yiddish" }, + { "yo", "Yoruba" }, + { "zh", "Chinese" }, + { "zu", "Zulu" } + }; + +/* Table from ISO 3166 country code to English name. + Keep in sync with the gl_locale_name_from_win32_LANGID function in + localename.c! */ +static const struct table_entry country_table[] = + { + { "AE", "U.A.E." }, + { "AF", "Afghanistan" }, + { "AL", "Albania" }, + { "AM", "Armenia" }, + { "AN", "Netherlands Antilles" }, + { "AR", "Argentina" }, + { "AT", "Austria" }, + { "AU", "Australia" }, + { "AZ", "Azerbaijan" }, + { "BA", "Bosnia and Herzegovina" }, + { "BD", "Bangladesh" }, + { "BE", "Belgium" }, + { "BG", "Bulgaria" }, + { "BH", "Bahrain" }, + { "BN", "Brunei Darussalam" }, + { "BO", "Bolivia" }, + { "BR", "Brazil" }, + { "BT", "Bhutan" }, + { "BY", "Belarus" }, + { "BZ", "Belize" }, + { "CA", "Canada" }, + { "CG", "Congo" }, + { "CH", "Switzerland" }, + { "CI", "Cote d'Ivoire" }, + { "CL", "Chile" }, + { "CM", "Cameroon" }, + { "CN", "People's Republic of China" }, + { "CO", "Colombia" }, + { "CR", "Costa Rica" }, + { "CS", "Serbia and Montenegro" }, + { "CZ", "Czech Republic" }, + { "DE", "Germany" }, + { "DK", "Denmark" }, + { "DO", "Dominican Republic" }, + { "DZ", "Algeria" }, + { "EC", "Ecuador" }, + { "EE", "Estonia" }, + { "EG", "Egypt" }, + { "ER", "Eritrea" }, + { "ES", "Spain" }, + { "ET", "Ethiopia" }, + { "FI", "Finland" }, + { "FO", "Faroe Islands" }, + { "FR", "France" }, + { "GB", "United Kingdom" }, + { "GD", "Caribbean" }, + { "GE", "Georgia" }, + { "GL", "Greenland" }, + { "GR", "Greece" }, + { "GT", "Guatemala" }, + { "HK", "Hong Kong" }, + { "HK", "Hong Kong S.A.R." }, + { "HN", "Honduras" }, + { "HR", "Croatia" }, + { "HT", "Haiti" }, + { "HU", "Hungary" }, + { "ID", "Indonesia" }, + { "IE", "Ireland" }, + { "IL", "Israel" }, + { "IN", "India" }, + { "IQ", "Iraq" }, + { "IR", "Iran" }, + { "IS", "Iceland" }, + { "IT", "Italy" }, + { "JM", "Jamaica" }, + { "JO", "Jordan" }, + { "JP", "Japan" }, + { "KE", "Kenya" }, + { "KG", "Kyrgyzstan" }, + { "KH", "Cambodia" }, + { "KR", "South Korea" }, + { "KW", "Kuwait" }, + { "KZ", "Kazakhstan" }, + { "LA", "Laos" }, + { "LB", "Lebanon" }, + { "LI", "Liechtenstein" }, + { "LK", "Sri Lanka" }, + { "LT", "Lithuania" }, + { "LU", "Luxembourg" }, + { "LV", "Latvia" }, + { "LY", "Libya" }, + { "MA", "Morocco" }, + { "MC", "Principality of Monaco" }, + { "MD", "Moldava" }, + { "MD", "Moldova" }, + { "ME", "Montenegro" }, + { "MK", "Former Yugoslav Republic of Macedonia" }, + { "ML", "Mali" }, + { "MM", "Myanmar" }, + { "MN", "Mongolia" }, + { "MO", "Macau S.A.R." }, + { "MT", "Malta" }, + { "MV", "Maldives" }, + { "MX", "Mexico" }, + { "MY", "Malaysia" }, + { "NG", "Nigeria" }, + { "NI", "Nicaragua" }, + { "NL", "Netherlands" }, + { "NO", "Norway" }, + { "NP", "Nepal" }, + { "NZ", "New Zealand" }, + { "OM", "Oman" }, + { "PA", "Panama" }, + { "PE", "Peru" }, + { "PH", "Philippines" }, + { "PK", "Islamic Republic of Pakistan" }, + { "PL", "Poland" }, + { "PR", "Puerto Rico" }, + { "PT", "Portugal" }, + { "PY", "Paraguay" }, + { "QA", "Qatar" }, + { "RE", "Reunion" }, + { "RO", "Romania" }, + { "RS", "Serbia" }, + { "RU", "Russia" }, + { "RW", "Rwanda" }, + { "SA", "Saudi Arabia" }, + { "SE", "Sweden" }, + { "SG", "Singapore" }, + { "SI", "Slovenia" }, + { "SK", "Slovak" }, + { "SN", "Senegal" }, + { "SO", "Somalia" }, + { "SR", "Suriname" }, + { "SV", "El Salvador" }, + { "SY", "Syria" }, + { "TH", "Thailand" }, + { "TJ", "Tajikistan" }, + { "TM", "Turkmenistan" }, + { "TN", "Tunisia" }, + { "TR", "Turkey" }, + { "TT", "Trinidad and Tobago" }, + { "TW", "Taiwan" }, + { "TZ", "Tanzania" }, + { "UA", "Ukraine" }, + { "US", "United States" }, + { "UY", "Uruguay" }, + { "VA", "Vatican" }, + { "VE", "Venezuela" }, + { "VN", "Viet Nam" }, + { "YE", "Yemen" }, + { "ZA", "South Africa" }, + { "ZW", "Zimbabwe" } + }; + +/* Given a string STRING, find the set of indices i such that TABLE[i].code is + the given STRING. It is a range [lo,hi-1]. */ +typedef struct { size_t lo; size_t hi; } range_t; +static void +search (const struct table_entry *table, size_t table_size, const char *string, + range_t *result) +{ + /* The table is sorted. Perform a binary search. */ + size_t hi = table_size; + size_t lo = 0; + while (lo < hi) + { + /* Invariant: + for i < lo, strcmp (table[i].code, string) < 0, + for i >= hi, strcmp (table[i].code, string) > 0. */ + size_t mid = (hi + lo) >> 1; /* >= lo, < hi */ + int cmp = strcmp (table[mid].code, string); + if (cmp < 0) + lo = mid + 1; + else if (cmp > 0) + hi = mid; + else + { + /* Found an i with + strcmp (language_table[i].code, string) == 0. + Find the entire interval of such i. */ + { + size_t i; + + for (i = mid; i > lo; ) + { + i--; + if (strcmp (table[i].code, string) < 0) + { + lo = i + 1; + break; + } + } + } + { + size_t i; + + for (i = mid + 1; i < hi; i++) + { + if (strcmp (table[i].code, string) > 0) + { + hi = i; + break; + } + } + } + /* The set of i with + strcmp (language_table[i].code, string) == 0 + is the interval [lo, hi-1]. */ + break; + } + } + result->lo = lo; + result->hi = hi; +} + +/* Like setlocale, but accept also locale names in the form ll or ll_CC, + where ll is an ISO 639 language code and CC is an ISO 3166 country code. */ +static char * +setlocale_unixlike (int category, const char *locale) +{ + char *result; + char llCC_buf[64]; + char ll_buf[64]; + char CC_buf[64]; + + /* The native Windows implementation of setlocale understands the special + locale name "C", but not "POSIX". Therefore map "POSIX" to "C". */ + if (locale != NULL && strcmp (locale, "POSIX") == 0) + locale = "C"; + + /* First, try setlocale with the original argument unchanged. */ + result = setlocale_mtsafe (category, locale); + if (result != NULL) + return result; + + /* Otherwise, assume the argument is in the form + language[_territory][.codeset][@modifier] + and try to map it using the tables. */ + if (strlen (locale) < sizeof (llCC_buf)) + { + /* Second try: Remove the codeset part. */ + { + const char *p = locale; + char *q = llCC_buf; + + /* Copy the part before the dot. */ + for (; *p != '\0' && *p != '.'; p++, q++) + *q = *p; + if (*p == '.') + /* Skip the part up to the '@', if any. */ + for (; *p != '\0' && *p != '@'; p++) + ; + /* Copy the part starting with '@', if any. */ + for (; *p != '\0'; p++, q++) + *q = *p; + *q = '\0'; + } + /* llCC_buf now contains + language[_territory][@modifier] + */ + if (strcmp (llCC_buf, locale) != 0) + { + result = setlocale (category, llCC_buf); + if (result != NULL) + return result; + } + /* Look it up in language_table. */ + { + range_t range; + size_t i; + + search (language_table, + sizeof (language_table) / sizeof (language_table[0]), + llCC_buf, + &range); + + for (i = range.lo; i < range.hi; i++) + { + /* Try the replacement in language_table[i]. */ + result = setlocale (category, language_table[i].english); + if (result != NULL) + return result; + } + } + /* Split language[_territory][@modifier] + into ll_buf = language[@modifier] + and CC_buf = territory + */ + { + const char *underscore = strchr (llCC_buf, '_'); + if (underscore != NULL) + { + const char *territory_start = underscore + 1; + const char *territory_end = strchr (territory_start, '@'); + if (territory_end == NULL) + territory_end = territory_start + strlen (territory_start); + + memcpy (ll_buf, llCC_buf, underscore - llCC_buf); + strcpy (ll_buf + (underscore - llCC_buf), territory_end); + + memcpy (CC_buf, territory_start, territory_end - territory_start); + CC_buf[territory_end - territory_start] = '\0'; + + { + /* Look up ll_buf in language_table + and CC_buf in country_table. */ + range_t language_range; + + search (language_table, + sizeof (language_table) / sizeof (language_table[0]), + ll_buf, + &language_range); + if (language_range.lo < language_range.hi) + { + range_t country_range; + + search (country_table, + sizeof (country_table) / sizeof (country_table[0]), + CC_buf, + &country_range); + if (country_range.lo < country_range.hi) + { + size_t i; + size_t j; + + for (i = language_range.lo; i < language_range.hi; i++) + for (j = country_range.lo; j < country_range.hi; j++) + { + /* Concatenate the replacements. */ + const char *part1 = language_table[i].english; + size_t part1_len = strlen (part1); + const char *part2 = country_table[j].english; + size_t part2_len = strlen (part2) + 1; + char buf[64+64]; + + if (!(part1_len + 1 + part2_len <= sizeof (buf))) + abort (); + memcpy (buf, part1, part1_len); + buf[part1_len] = '_'; + memcpy (buf + part1_len + 1, part2, part2_len); + + /* Try the concatenated replacements. */ + result = setlocale (category, buf); + if (result != NULL) + return result; + } + } + + /* Try omitting the country entirely. This may set a locale + corresponding to the wrong country, but is better than + failing entirely. */ + { + size_t i; + + for (i = language_range.lo; i < language_range.hi; i++) + { + /* Try only the language replacement. */ + result = + setlocale (category, language_table[i].english); + if (result != NULL) + return result; + } + } + } + } + } + } + } + + /* Failed. */ + return NULL; +} + +# elif defined __ANDROID__ + +/* Like setlocale, but accept also the locale names "C" and "POSIX". */ +static char * +setlocale_unixlike (int category, const char *locale) +{ + char *result = setlocale_mtsafe (category, locale); + if (result == NULL) + switch (category) + { + case LC_CTYPE: + case LC_NUMERIC: + case LC_TIME: + case LC_COLLATE: + case LC_MONETARY: + case LC_MESSAGES: + case LC_ALL: + case LC_PAPER: + case LC_NAME: + case LC_ADDRESS: + case LC_TELEPHONE: + case LC_MEASUREMENT: + if (locale == NULL + || strcmp (locale, "C") == 0 || strcmp (locale, "POSIX") == 0) + result = (char *) "C"; + break; + default: + break; + } + return result; +} +# define setlocale setlocale_unixlike + +# else +# define setlocale_unixlike setlocale_mtsafe +# endif + +# if LC_MESSAGES == 1729 + +/* The system does not store an LC_MESSAGES locale category. Do it here. */ +static char lc_messages_name[64] = "C"; + +/* Like setlocale, but support also LC_MESSAGES. */ +static char * +setlocale_single (int category, const char *locale) +{ + if (category == LC_MESSAGES) + { + if (locale != NULL) + { + lc_messages_name[sizeof (lc_messages_name) - 1] = '\0'; + strncpy (lc_messages_name, locale, sizeof (lc_messages_name) - 1); + } + return lc_messages_name; + } + else + return setlocale_unixlike (category, locale); +} + +# else +# define setlocale_single setlocale_unixlike +# endif + +# if defined __APPLE__ && defined __MACH__ + +/* Mapping from language to main territory where that language is spoken. */ +static char const locales_with_principal_territory[][6 + 1] = + { + /* Language Main territory */ + "ace_ID", /* Achinese Indonesia */ + "af_ZA", /* Afrikaans South Africa */ + "ak_GH", /* Akan Ghana */ + "am_ET", /* Amharic Ethiopia */ + "an_ES", /* Aragonese Spain */ + "ang_GB", /* Old English Britain */ + "arn_CL", /* Mapudungun Chile */ + "as_IN", /* Assamese India */ + "ast_ES", /* Asturian Spain */ + "av_RU", /* Avaric Russia */ + "awa_IN", /* Awadhi India */ + "az_AZ", /* Azerbaijani Azerbaijan */ + "ban_ID", /* Balinese Indonesia */ + "be_BY", /* Belarusian Belarus */ + "bej_SD", /* Beja Sudan */ + "bem_ZM", /* Bemba Zambia */ + "bg_BG", /* Bulgarian Bulgaria */ + "bho_IN", /* Bhojpuri India */ + "bi_VU", /* Bislama Vanuatu */ + "bik_PH", /* Bikol Philippines */ + "bin_NG", /* Bini Nigeria */ + "bm_ML", /* Bambara Mali */ + "bn_IN", /* Bengali India */ + "bo_CN", /* Tibetan China */ + "br_FR", /* Breton France */ + "bs_BA", /* Bosnian Bosnia */ + "bug_ID", /* Buginese Indonesia */ + "ca_ES", /* Catalan Spain */ + "ce_RU", /* Chechen Russia */ + "ceb_PH", /* Cebuano Philippines */ + "co_FR", /* Corsican France */ + "cr_CA", /* Cree Canada */ + /* Don't put "crh_UZ" or "crh_UA" here. That would be asking for fruitless + political discussion. */ + "cs_CZ", /* Czech Czech Republic */ + "csb_PL", /* Kashubian Poland */ + "cy_GB", /* Welsh Britain */ + "da_DK", /* Danish Denmark */ + "de_DE", /* German Germany */ + "din_SD", /* Dinka Sudan */ + "doi_IN", /* Dogri India */ + "dsb_DE", /* Lower Sorbian Germany */ + "dv_MV", /* Divehi Maldives */ + "dz_BT", /* Dzongkha Bhutan */ + "ee_GH", /* Éwé Ghana */ + "el_GR", /* Greek Greece */ + /* Don't put "en_GB" or "en_US" here. That would be asking for fruitless + political discussion. */ + "es_ES", /* Spanish Spain */ + "et_EE", /* Estonian Estonia */ + "fa_IR", /* Persian Iran */ + "fi_FI", /* Finnish Finland */ + "fil_PH", /* Filipino Philippines */ + "fj_FJ", /* Fijian Fiji */ + "fo_FO", /* Faroese Faeroe Islands */ + "fon_BJ", /* Fon Benin */ + "fr_FR", /* French France */ + "fur_IT", /* Friulian Italy */ + "fy_NL", /* Western Frisian Netherlands */ + "ga_IE", /* Irish Ireland */ + "gd_GB", /* Scottish Gaelic Britain */ + "gon_IN", /* Gondi India */ + "gsw_CH", /* Swiss German Switzerland */ + "gu_IN", /* Gujarati India */ + "he_IL", /* Hebrew Israel */ + "hi_IN", /* Hindi India */ + "hil_PH", /* Hiligaynon Philippines */ + "hr_HR", /* Croatian Croatia */ + "hsb_DE", /* Upper Sorbian Germany */ + "ht_HT", /* Haitian Haiti */ + "hu_HU", /* Hungarian Hungary */ + "hy_AM", /* Armenian Armenia */ + "id_ID", /* Indonesian Indonesia */ + "ig_NG", /* Igbo Nigeria */ + "ii_CN", /* Sichuan Yi China */ + "ilo_PH", /* Iloko Philippines */ + "is_IS", /* Icelandic Iceland */ + "it_IT", /* Italian Italy */ + "ja_JP", /* Japanese Japan */ + "jab_NG", /* Hyam Nigeria */ + "jv_ID", /* Javanese Indonesia */ + "ka_GE", /* Georgian Georgia */ + "kab_DZ", /* Kabyle Algeria */ + "kaj_NG", /* Jju Nigeria */ + "kam_KE", /* Kamba Kenya */ + "kmb_AO", /* Kimbundu Angola */ + "kcg_NG", /* Tyap Nigeria */ + "kdm_NG", /* Kagoma Nigeria */ + "kg_CD", /* Kongo Democratic Republic of Congo */ + "kk_KZ", /* Kazakh Kazakhstan */ + "kl_GL", /* Kalaallisut Greenland */ + "km_KH", /* Central Khmer Cambodia */ + "kn_IN", /* Kannada India */ + "ko_KR", /* Korean Korea (South) */ + "kok_IN", /* Konkani India */ + "kr_NG", /* Kanuri Nigeria */ + "kru_IN", /* Kurukh India */ + "ky_KG", /* Kyrgyz Kyrgyzstan */ + "lg_UG", /* Ganda Uganda */ + "li_BE", /* Limburgish Belgium */ + "lo_LA", /* Laotian Laos */ + "lt_LT", /* Lithuanian Lithuania */ + "lu_CD", /* Luba-Katanga Democratic Republic of Congo */ + "lua_CD", /* Luba-Lulua Democratic Republic of Congo */ + "luo_KE", /* Luo Kenya */ + "lv_LV", /* Latvian Latvia */ + "mad_ID", /* Madurese Indonesia */ + "mag_IN", /* Magahi India */ + "mai_IN", /* Maithili India */ + "mak_ID", /* Makasar Indonesia */ + "man_ML", /* Mandingo Mali */ + "men_SL", /* Mende Sierra Leone */ + "mfe_MU", /* Mauritian Creole Mauritius */ + "mg_MG", /* Malagasy Madagascar */ + "mi_NZ", /* Maori New Zealand */ + "min_ID", /* Minangkabau Indonesia */ + "mk_MK", /* Macedonian North Macedonia */ + "ml_IN", /* Malayalam India */ + "mn_MN", /* Mongolian Mongolia */ + "mni_IN", /* Manipuri India */ + "mos_BF", /* Mossi Burkina Faso */ + "mr_IN", /* Marathi India */ + "ms_MY", /* Malay Malaysia */ + "mt_MT", /* Maltese Malta */ + "mwr_IN", /* Marwari India */ + "my_MM", /* Burmese Myanmar */ + "na_NR", /* Nauru Nauru */ + "nah_MX", /* Nahuatl Mexico */ + "nap_IT", /* Neapolitan Italy */ + "nb_NO", /* Norwegian Bokmål Norway */ + "nds_DE", /* Low Saxon Germany */ + "ne_NP", /* Nepali Nepal */ + "nl_NL", /* Dutch Netherlands */ + "nn_NO", /* Norwegian Nynorsk Norway */ + "no_NO", /* Norwegian Norway */ + "nr_ZA", /* South Ndebele South Africa */ + "nso_ZA", /* Northern Sotho South Africa */ + "ny_MW", /* Chichewa Malawi */ + "nym_TZ", /* Nyamwezi Tanzania */ + "nyn_UG", /* Nyankole Uganda */ + "oc_FR", /* Occitan France */ + "oj_CA", /* Ojibwa Canada */ + "or_IN", /* Oriya India */ + "pa_IN", /* Punjabi India */ + "pag_PH", /* Pangasinan Philippines */ + "pam_PH", /* Pampanga Philippines */ + "pap_AN", /* Papiamento Netherlands Antilles - this line can be removed in 2018 */ + "pbb_CO", /* Páez Colombia */ + "pl_PL", /* Polish Poland */ + "ps_AF", /* Pashto Afghanistan */ + "pt_PT", /* Portuguese Portugal */ + "raj_IN", /* Rajasthani India */ + "rm_CH", /* Romansh Switzerland */ + "rn_BI", /* Kirundi Burundi */ + "ro_RO", /* Romanian Romania */ + "ru_RU", /* Russian Russia */ + "rw_RW", /* Kinyarwanda Rwanda */ + "sa_IN", /* Sanskrit India */ + "sah_RU", /* Yakut Russia */ + "sas_ID", /* Sasak Indonesia */ + "sat_IN", /* Santali India */ + "sc_IT", /* Sardinian Italy */ + "scn_IT", /* Sicilian Italy */ + "sg_CF", /* Sango Central African Republic */ + "shn_MM", /* Shan Myanmar */ + "si_LK", /* Sinhala Sri Lanka */ + "sid_ET", /* Sidamo Ethiopia */ + "sk_SK", /* Slovak Slovakia */ + "sl_SI", /* Slovenian Slovenia */ + "sm_WS", /* Samoan Samoa */ + "smn_FI", /* Inari Sami Finland */ + "sms_FI", /* Skolt Sami Finland */ + "so_SO", /* Somali Somalia */ + "sq_AL", /* Albanian Albania */ + "sr_RS", /* Serbian Serbia */ + "srr_SN", /* Serer Senegal */ + "suk_TZ", /* Sukuma Tanzania */ + "sus_GN", /* Susu Guinea */ + "sv_SE", /* Swedish Sweden */ + "te_IN", /* Telugu India */ + "tem_SL", /* Timne Sierra Leone */ + "tet_ID", /* Tetum Indonesia */ + "tg_TJ", /* Tajik Tajikistan */ + "th_TH", /* Thai Thailand */ + "ti_ER", /* Tigrinya Eritrea */ + "tiv_NG", /* Tiv Nigeria */ + "tk_TM", /* Turkmen Turkmenistan */ + "tl_PH", /* Tagalog Philippines */ + "to_TO", /* Tonga Tonga */ + "tpi_PG", /* Tok Pisin Papua New Guinea */ + "tr_TR", /* Turkish Turkey */ + "tum_MW", /* Tumbuka Malawi */ + "ug_CN", /* Uighur China */ + "uk_UA", /* Ukrainian Ukraine */ + "umb_AO", /* Umbundu Angola */ + "ur_PK", /* Urdu Pakistan */ + "uz_UZ", /* Uzbek Uzbekistan */ + "ve_ZA", /* Venda South Africa */ + "vi_VN", /* Vietnamese Vietnam */ + "wa_BE", /* Walloon Belgium */ + "wal_ET", /* Walamo Ethiopia */ + "war_PH", /* Waray Philippines */ + "wen_DE", /* Sorbian Germany */ + "yao_MW", /* Yao Malawi */ + "zap_MX" /* Zapotec Mexico */ + }; + +/* Compare just the language part of two locale names. */ +static int +langcmp (const char *locale1, const char *locale2) +{ + size_t locale1_len; + size_t locale2_len; + int cmp; + + { + const char *locale1_end = strchr (locale1, '_'); + if (locale1_end != NULL) + locale1_len = locale1_end - locale1; + else + locale1_len = strlen (locale1); + } + { + const char *locale2_end = strchr (locale2, '_'); + if (locale2_end != NULL) + locale2_len = locale2_end - locale2; + else + locale2_len = strlen (locale2); + } + + if (locale1_len < locale2_len) + { + cmp = memcmp (locale1, locale2, locale1_len); + if (cmp == 0) + cmp = -1; + } + else + { + cmp = memcmp (locale1, locale2, locale2_len); + if (locale1_len > locale2_len && cmp == 0) + cmp = 1; + } + + return cmp; +} + +/* Given a locale name, return the main locale with the same language, + or NULL if not found. + For example: "fr_DE" -> "fr_FR". */ +static const char * +get_main_locale_with_same_language (const char *locale) +{ +# define table locales_with_principal_territory + /* The table is sorted. Perform a binary search. */ + size_t hi = sizeof (table) / sizeof (table[0]); + size_t lo = 0; + while (lo < hi) + { + /* Invariant: + for i < lo, langcmp (table[i], locale) < 0, + for i >= hi, langcmp (table[i], locale) > 0. */ + size_t mid = (hi + lo) >> 1; /* >= lo, < hi */ + int cmp = langcmp (table[mid], locale); + if (cmp < 0) + lo = mid + 1; + else if (cmp > 0) + hi = mid; + else + { + /* Found an i with + langcmp (language_table[i], locale) == 0. + Verify that it is the only such i. */ + if (mid > lo && langcmp (table[mid - 1], locale) >= 0) + abort (); + if (mid + 1 < hi && langcmp (table[mid + 1], locale) <= 0) + abort (); + return table[mid]; + } + } +# undef table + return NULL; +} + +/* Mapping from territory to main language that is spoken in that territory. */ +static char const locales_with_principal_language[][6 + 1] = + { + /* This is based on the set of existing locales in glibc, with duplicates + removed, and on the Wikipedia pages named "Languages of ". + If in doubt, use the locale that exists in macOS. For example, the only + "*_IN" locale in macOS 10.13 is "hi_IN", so use that. */ + /* A useful shell function for producing a line of this table is: + func_line () + { + # Usage: func_line ll_CC + ll=`echo "$1" | sed -e 's|_.*||'` + cc=`echo "$1" | sed -e 's|^.*_||'` + llx=`sed -n -e "s|^${ll} ||p" < gettext-tools/doc/ISO_639` + ccx=`expand gettext-tools/doc/ISO_3166 | sed -n -e "s|^${cc} *||p"` + echo " \"$1\", /$X* ${llx} ${ccx} *$X/" + } + */ + /* Main language Territory */ + "ca_AD", /* Catalan Andorra */ + "ar_AE", /* Arabic United Arab Emirates */ + "ps_AF", /* Pashto Afghanistan */ + "en_AG", /* English Antigua and Barbuda */ + "sq_AL", /* Albanian Albania */ + "hy_AM", /* Armenian Armenia */ + "pap_AN", /* Papiamento Netherlands Antilles - this line can be removed in 2018 */ + "pt_AO", /* Portuguese Angola */ + "es_AR", /* Spanish Argentina */ + "de_AT", /* German Austria */ + "en_AU", /* English Australia */ + /* Aruba has two official languages: "nl_AW", "pap_AW". */ + "az_AZ", /* Azerbaijani Azerbaijan */ + "bs_BA", /* Bosnian Bosnia */ + "bn_BD", /* Bengali Bangladesh */ + "nl_BE", /* Dutch Belgium */ + "fr_BF", /* French Burkina Faso */ + "bg_BG", /* Bulgarian Bulgaria */ + "ar_BH", /* Arabic Bahrain */ + "rn_BI", /* Kirundi Burundi */ + "fr_BJ", /* French Benin */ + "es_BO", /* Spanish Bolivia */ + "pt_BR", /* Portuguese Brazil */ + "dz_BT", /* Dzongkha Bhutan */ + "en_BW", /* English Botswana */ + "be_BY", /* Belarusian Belarus */ + "en_CA", /* English Canada */ + "fr_CD", /* French Democratic Republic of Congo */ + "sg_CF", /* Sango Central African Republic */ + "de_CH", /* German Switzerland */ + "es_CL", /* Spanish Chile */ + "zh_CN", /* Chinese China */ + "es_CO", /* Spanish Colombia */ + "es_CR", /* Spanish Costa Rica */ + "es_CU", /* Spanish Cuba */ + /* Curaçao has three official languages: "nl_CW", "pap_CW", "en_CW". */ + "el_CY", /* Greek Cyprus */ + "cs_CZ", /* Czech Czech Republic */ + "de_DE", /* German Germany */ + /* Djibouti has two official languages: "ar_DJ" and "fr_DJ". */ + "da_DK", /* Danish Denmark */ + "es_DO", /* Spanish Dominican Republic */ + "ar_DZ", /* Arabic Algeria */ + "es_EC", /* Spanish Ecuador */ + "et_EE", /* Estonian Estonia */ + "ar_EG", /* Arabic Egypt */ + "ti_ER", /* Tigrinya Eritrea */ + "es_ES", /* Spanish Spain */ + "am_ET", /* Amharic Ethiopia */ + "fi_FI", /* Finnish Finland */ + /* Fiji has three official languages: "en_FJ", "fj_FJ", "hif_FJ". */ + "fo_FO", /* Faroese Faeroe Islands */ + "fr_FR", /* French France */ + "en_GB", /* English Britain */ + "ka_GE", /* Georgian Georgia */ + "en_GH", /* English Ghana */ + "kl_GL", /* Kalaallisut Greenland */ + "fr_GN", /* French Guinea */ + "el_GR", /* Greek Greece */ + "es_GT", /* Spanish Guatemala */ + "zh_HK", /* Chinese Hong Kong */ + "es_HN", /* Spanish Honduras */ + "hr_HR", /* Croatian Croatia */ + "ht_HT", /* Haitian Haiti */ + "hu_HU", /* Hungarian Hungary */ + "id_ID", /* Indonesian Indonesia */ + "en_IE", /* English Ireland */ + "he_IL", /* Hebrew Israel */ + "hi_IN", /* Hindi India */ + "ar_IQ", /* Arabic Iraq */ + "fa_IR", /* Persian Iran */ + "is_IS", /* Icelandic Iceland */ + "it_IT", /* Italian Italy */ + "ar_JO", /* Arabic Jordan */ + "ja_JP", /* Japanese Japan */ + "sw_KE", /* Swahili Kenya */ + "ky_KG", /* Kyrgyz Kyrgyzstan */ + "km_KH", /* Central Khmer Cambodia */ + "ko_KR", /* Korean Korea (South) */ + "ar_KW", /* Arabic Kuwait */ + "kk_KZ", /* Kazakh Kazakhstan */ + "lo_LA", /* Laotian Laos */ + "ar_LB", /* Arabic Lebanon */ + "de_LI", /* German Liechtenstein */ + "si_LK", /* Sinhala Sri Lanka */ + "lt_LT", /* Lithuanian Lithuania */ + /* Luxembourg has three official languages: "lb_LU", "fr_LU", "de_LU". */ + "lv_LV", /* Latvian Latvia */ + "ar_LY", /* Arabic Libya */ + "ar_MA", /* Arabic Morocco */ + "sr_ME", /* Serbian Montenegro */ + "mg_MG", /* Malagasy Madagascar */ + "mk_MK", /* Macedonian North Macedonia */ + "fr_ML", /* French Mali */ + "my_MM", /* Burmese Myanmar */ + "mn_MN", /* Mongolian Mongolia */ + "mt_MT", /* Maltese Malta */ + "mfe_MU", /* Mauritian Creole Mauritius */ + "dv_MV", /* Divehi Maldives */ + "ny_MW", /* Chichewa Malawi */ + "es_MX", /* Spanish Mexico */ + "ms_MY", /* Malay Malaysia */ + "en_NG", /* English Nigeria */ + "es_NI", /* Spanish Nicaragua */ + "nl_NL", /* Dutch Netherlands */ + "no_NO", /* Norwegian Norway */ + "ne_NP", /* Nepali Nepal */ + "na_NR", /* Nauru Nauru */ + "niu_NU", /* Niuean Niue */ + "en_NZ", /* English New Zealand */ + "ar_OM", /* Arabic Oman */ + "es_PA", /* Spanish Panama */ + "es_PE", /* Spanish Peru */ + "tpi_PG", /* Tok Pisin Papua New Guinea */ + "fil_PH", /* Filipino Philippines */ + "pa_PK", /* Punjabi Pakistan */ + "pl_PL", /* Polish Poland */ + "es_PR", /* Spanish Puerto Rico */ + "pt_PT", /* Portuguese Portugal */ + "es_PY", /* Spanish Paraguay */ + "ar_QA", /* Arabic Qatar */ + "ro_RO", /* Romanian Romania */ + "sr_RS", /* Serbian Serbia */ + "ru_RU", /* Russian Russia */ + "rw_RW", /* Kinyarwanda Rwanda */ + "ar_SA", /* Arabic Saudi Arabia */ + "en_SC", /* English Seychelles */ + "ar_SD", /* Arabic Sudan */ + "sv_SE", /* Swedish Sweden */ + "en_SG", /* English Singapore */ + "sl_SI", /* Slovenian Slovenia */ + "sk_SK", /* Slovak Slovakia */ + "en_SL", /* English Sierra Leone */ + "fr_SN", /* French Senegal */ + "so_SO", /* Somali Somalia */ + "ar_SS", /* Arabic South Sudan */ + "es_SV", /* Spanish El Salvador */ + "ar_SY", /* Arabic Syria */ + "th_TH", /* Thai Thailand */ + "tg_TJ", /* Tajik Tajikistan */ + "tk_TM", /* Turkmen Turkmenistan */ + "ar_TN", /* Arabic Tunisia */ + "to_TO", /* Tonga Tonga */ + "tr_TR", /* Turkish Turkey */ + "zh_TW", /* Chinese Taiwan */ + "sw_TZ", /* Swahili Tanzania */ + "uk_UA", /* Ukrainian Ukraine */ + "lg_UG", /* Ganda Uganda */ + "en_US", /* English United States of America */ + "es_UY", /* Spanish Uruguay */ + "uz_UZ", /* Uzbek Uzbekistan */ + "es_VE", /* Spanish Venezuela */ + "vi_VN", /* Vietnamese Vietnam */ + "bi_VU", /* Bislama Vanuatu */ + "sm_WS", /* Samoan Samoa */ + "ar_YE", /* Arabic Yemen */ + "en_ZA", /* English South Africa */ + "en_ZM", /* English Zambia */ + "en_ZW" /* English Zimbabwe */ + }; + +/* Compare just the territory part of two locale names. */ +static int +terrcmp (const char *locale1, const char *locale2) +{ + const char *territory1 = strrchr (locale1, '_') + 1; + const char *territory2 = strrchr (locale2, '_') + 1; + + return strcmp (territory1, territory2); +} + +/* Given a locale name, return the locale corresponding to the main language + with the same territory, or NULL if not found. + For example: "fr_DE" -> "de_DE". */ +static const char * +get_main_locale_with_same_territory (const char *locale) +{ + if (strrchr (locale, '_') != NULL) + { +# define table locales_with_principal_language + /* The table is sorted. Perform a binary search. */ + size_t hi = sizeof (table) / sizeof (table[0]); + size_t lo = 0; + while (lo < hi) + { + /* Invariant: + for i < lo, terrcmp (table[i], locale) < 0, + for i >= hi, terrcmp (table[i], locale) > 0. */ + size_t mid = (hi + lo) >> 1; /* >= lo, < hi */ + int cmp = terrcmp (table[mid], locale); + if (cmp < 0) + lo = mid + 1; + else if (cmp > 0) + hi = mid; + else + { + /* Found an i with + terrcmp (language_table[i], locale) == 0. + Verify that it is the only such i. */ + if (mid > lo && terrcmp (table[mid - 1], locale) >= 0) + abort (); + if (mid + 1 < hi && terrcmp (table[mid + 1], locale) <= 0) + abort (); + return table[mid]; + } + } +# undef table + } + return NULL; +} + +# endif + +char * +setlocale_improved (int category, const char *locale) +{ + if (locale != NULL && locale[0] == '\0') + { + /* A request to the set the current locale to the default locale. */ + if (category == LC_ALL) + { + /* Set LC_CTYPE first. Then the other categories. */ + static int const categories[] = + { + LC_CTYPE, + LC_NUMERIC, + LC_TIME, + LC_COLLATE, + LC_MONETARY, + LC_MESSAGES + }; + char *saved_locale; + const char *base_name; + unsigned int i; + + /* Back up the old locale, in case one of the steps fails. */ + saved_locale = setlocale (LC_ALL, NULL); + if (saved_locale == NULL) + return NULL; + saved_locale = strdup (saved_locale); + if (saved_locale == NULL) + return NULL; + + /* Set LC_CTYPE category. Set all other categories (except possibly + LC_MESSAGES) to the same value in the same call; this is likely to + save calls. */ + base_name = + gl_locale_name_environ (LC_CTYPE, category_to_name (LC_CTYPE)); + if (base_name == NULL) + base_name = gl_locale_name_default (); + + if (setlocale_unixlike (LC_ALL, base_name) != NULL) + { + /* LC_CTYPE category already set. */ + i = 1; + } + else + { + /* On Mac OS X, "UTF-8" is a valid locale name for LC_CTYPE but + not for LC_ALL. Therefore this call may fail. So, try + another base_name. */ + base_name = "C"; + if (setlocale_unixlike (LC_ALL, base_name) == NULL) + goto fail; + i = 0; + } +# if defined _WIN32 && ! defined __CYGWIN__ + /* On native Windows, setlocale(LC_ALL,...) may succeed but set the + LC_CTYPE category to an invalid value ("C") when it does not + support the specified encoding. Report a failure instead. */ + if (strchr (base_name, '.') != NULL + && strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + goto fail; +# endif + + for (; i < sizeof (categories) / sizeof (categories[0]); i++) + { + int cat = categories[i]; + const char *name; + + name = gl_locale_name_environ (cat, category_to_name (cat)); + if (name == NULL) + name = gl_locale_name_default (); + + /* If name is the same as base_name, it has already been set + through the setlocale call before the loop. */ + if (strcmp (name, base_name) != 0 +# if LC_MESSAGES == 1729 + || cat == LC_MESSAGES +# endif + ) + if (setlocale_single (cat, name) == NULL) +# if defined __APPLE__ && defined __MACH__ + { + /* On Mac OS X 10.13, some locales can be set through + System Preferences > Language & Region, that are not + supported by libc. The system's setlocale() falls + back to "C" for these locale categories. We can do + better, by trying an existing locale with the same + language or an existing locale with the same territory. + If we can't, print a warning, to limit user + expectations. */ + int warn = 0; + + if (cat == LC_CTYPE) + warn = (setlocale_single (cat, "UTF-8") == NULL); + else if (cat == LC_MESSAGES) + { +# if HAVE_CFLOCALECOPYPREFERREDLANGUAGES || HAVE_CFPREFERENCESCOPYAPPVALUE /* MacOS X 10.4 or newer */ + /* Take the primary language preference. */ +# if HAVE_CFLOCALECOPYPREFERREDLANGUAGES /* MacOS X 10.5 or newer */ + CFArrayRef prefArray = CFLocaleCopyPreferredLanguages (); +# elif HAVE_CFPREFERENCESCOPYAPPVALUE /* MacOS X 10.4 or newer */ + CFTypeRef preferences = + CFPreferencesCopyAppValue (CFSTR ("AppleLanguages"), + kCFPreferencesCurrentApplication); + if (preferences != NULL + && CFGetTypeID (preferences) == CFArrayGetTypeID ()) + { + CFArrayRef prefArray = (CFArrayRef)preferences; +# endif + int n = CFArrayGetCount (prefArray); + if (n > 0) + { + char buf[256]; + CFTypeRef element = CFArrayGetValueAtIndex (prefArray, 0); + if (element != NULL + && CFGetTypeID (element) == CFStringGetTypeID () + && CFStringGetCString ((CFStringRef)element, + buf, sizeof (buf), + kCFStringEncodingASCII)) + { + /* Remove the country. + E.g. "zh-Hans-DE" -> "zh-Hans". */ + char *last_minus = strrchr (buf, '-'); + if (last_minus != NULL) + *last_minus = '\0'; + + /* Convert to Unix locale name. + E.g. "zh-Hans" -> "zh_CN". */ + gl_locale_name_canonicalize (buf); + + /* Try setlocale with this value. */ + if (setlocale_single (cat, buf) == NULL) + { + const char *last_try = + get_main_locale_with_same_language (buf); + + if (last_try == NULL + || setlocale_single (cat, last_try) == NULL) + warn = 1; + } + } + } +# if HAVE_CFLOCALECOPYPREFERREDLANGUAGES /* MacOS X 10.5 or newer */ + CFRelease (prefArray); +# elif HAVE_CFPREFERENCESCOPYAPPVALUE /* MacOS X 10.4 or newer */ + } +# endif +# else + const char *last_try = + get_main_locale_with_same_language (name); + + if (last_try == NULL + || setlocale_single (cat, last_try) == NULL) + warn = 1; +# endif + } + else + { + /* For LC_NUMERIC, the application should use the locale + properties kCFLocaleDecimalSeparator, + kCFLocaleGroupingSeparator. + For LC_TIME, the application should use the locale + property kCFLocaleCalendarIdentifier. + For LC_COLLATE, the application should use the locale + properties kCFLocaleCollationIdentifier, + kCFLocaleCollatorIdentifier. + For LC_MONETARY, the applicationshould use the locale + properties kCFLocaleCurrencySymbol, + kCFLocaleCurrencyCode. + But since most applications don't have macOS specific + code like this, try an existing locale with the same + territory. */ + const char *last_try = + get_main_locale_with_same_territory (name); + + if (last_try == NULL + || setlocale_single (cat, last_try) == NULL) + warn = 1; + } + + if (warn) + { + /* Warn only if the environment variable + SETLOCALE_VERBOSE is set. Otherwise these warnings + are just annoyances, since normal users won't invoke + 'localedef'. */ + const char *verbose = getenv ("SETLOCALE_VERBOSE"); + if (verbose != NULL && verbose[0] != '\0') + fprintf (stderr, + "Warning: Failed to set locale category %s to %s.\n", + category_to_name (cat), name); + } + } +# else + goto fail; +# endif + } + + /* All steps were successful. */ + free (saved_locale); + return setlocale (LC_ALL, NULL); + + fail: + if (saved_locale[0] != '\0') /* don't risk an endless recursion */ + setlocale (LC_ALL, saved_locale); + free (saved_locale); + return NULL; + } + else + { + const char *name = + gl_locale_name_environ (category, category_to_name (category)); + if (name == NULL) + name = gl_locale_name_default (); + + return setlocale_single (category, name); + } + } + else + { +# if defined _WIN32 && ! defined __CYGWIN__ + if (category == LC_ALL && locale != NULL && strchr (locale, '.') != NULL) + { + char *saved_locale; + + /* Back up the old locale. */ + saved_locale = setlocale (LC_ALL, NULL); + if (saved_locale == NULL) + return NULL; + saved_locale = strdup (saved_locale); + if (saved_locale == NULL) + return NULL; + + if (setlocale_unixlike (LC_ALL, locale) == NULL) + { + free (saved_locale); + return NULL; + } + + /* On native Windows, setlocale(LC_ALL,...) may succeed but set the + LC_CTYPE category to an invalid value ("C") when it does not + support the specified encoding. Report a failure instead. */ + if (strcmp (setlocale (LC_CTYPE, NULL), "C") == 0) + { + if (saved_locale[0] != '\0') /* don't risk an endless recursion */ + setlocale (LC_ALL, saved_locale); + free (saved_locale); + return NULL; + } + + /* It was really successful. */ + free (saved_locale); + return setlocale (LC_ALL, NULL); + } + else +# endif + return setlocale_single (category, locale); + } +} + +# endif /* NEED_SETLOCALE_IMPROVED */ + +#endif diff -Nru datamash-1.7/lib/setlocale-lock.c datamash-1.8/lib/setlocale-lock.c --- datamash-1.7/lib/setlocale-lock.c 2020-04-23 04:03:28.000000000 +0000 +++ datamash-1.8/lib/setlocale-lock.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Return the internal lock used by setlocale_null_r. - Copyright (C) 2019-2020 Free Software Foundation, Inc. + Copyright (C) 2019-2021 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.7/lib/setlocale_null.c datamash-1.8/lib/setlocale_null.c --- datamash-1.7/lib/setlocale_null.c 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/lib/setlocale_null.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Query the name of the current global locale. - Copyright (C) 2019-2020 Free Software Foundation, Inc. + Copyright (C) 2019-2021 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.7/lib/setlocale_null.h datamash-1.8/lib/setlocale_null.h --- datamash-1.7/lib/setlocale_null.h 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/lib/setlocale_null.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Query the name of the current global locale. - Copyright (C) 2019-2020 Free Software Foundation, Inc. + Copyright (C) 2019-2021 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.7/lib/sha1.c datamash-1.8/lib/sha1.c --- datamash-1.7/lib/sha1.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/sha1.c 2022-05-28 01:46:58.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-2020 Free Software Foundation, Inc. + Copyright (C) 2000-2001, 2003-2006, 2008-2021 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 diff -Nru datamash-1.7/lib/sha1.h datamash-1.8/lib/sha1.h --- datamash-1.7/lib/sha1.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/sha1.h 2022-05-28 01:46:58.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-2020 Free Software + Copyright (C) 2000-2001, 2003, 2005-2006, 2008-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it diff -Nru datamash-1.7/lib/sha256.c datamash-1.8/lib/sha256.c --- datamash-1.7/lib/sha256.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/sha256.c 2022-05-28 01:46:58.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-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2008-2021 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.7/lib/sha256.h datamash-1.8/lib/sha256.h --- datamash-1.7/lib/sha256.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/sha256.h 2022-05-28 01:46:58.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-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2008-2021 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.7/lib/sha512.c datamash-1.8/lib/sha512.c --- datamash-1.7/lib/sha512.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/sha512.c 2022-05-28 01:46:58.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-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2008-2021 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.7/lib/sha512.h datamash-1.8/lib/sha512.h --- datamash-1.7/lib/sha512.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/sha512.h 2022-05-28 01:46:58.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-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2008-2021 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.7/lib/sh-quote.c datamash-1.8/lib/sh-quote.c --- datamash-1.7/lib/sh-quote.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/sh-quote.c 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,107 @@ +/* Shell quoting. + Copyright (C) 2001-2004, 2006, 2009-2021 Free Software Foundation, Inc. + Written by Bruno Haible , 2001. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU 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 "sh-quote.h" + +#include + +#include "quotearg.h" +#include "xalloc.h" + +/* Describes quoting for sh compatible shells. */ +static struct quoting_options *sh_quoting_options; + +/* Initializes the sh_quoting_options variable. */ +static void +init_sh_quoting_options () +{ + sh_quoting_options = clone_quoting_options (NULL); + set_quoting_style (sh_quoting_options, shell_quoting_style); +} + +/* Returns the number of bytes needed for the quoted string. */ +size_t +shell_quote_length (const char *string) +{ + if (sh_quoting_options == NULL) + init_sh_quoting_options (); + return quotearg_buffer (NULL, 0, string, strlen (string), + sh_quoting_options); +} + +/* Copies the quoted string to p and returns the incremented p. + There must be room for shell_quote_length (string) + 1 bytes at p. */ +char * +shell_quote_copy (char *p, const char *string) +{ + if (sh_quoting_options == NULL) + init_sh_quoting_options (); + return p + quotearg_buffer (p, (size_t)(-1), string, strlen (string), + sh_quoting_options); +} + +/* Returns the freshly allocated quoted string. */ +char * +shell_quote (const char *string) +{ + if (sh_quoting_options == NULL) + init_sh_quoting_options (); + return quotearg_alloc (string, strlen (string), sh_quoting_options); +} + +/* Returns a freshly allocated string containing all argument strings, quoted, + separated through spaces. */ +char * +shell_quote_argv (const char * const *argv) +{ + if (*argv != NULL) + { + const char * const *argp; + size_t length; + char *command; + char *p; + + length = 0; + for (argp = argv; ; ) + { + length += shell_quote_length (*argp) + 1; + argp++; + if (*argp == NULL) + break; + } + + command = XNMALLOC (length, char); + + p = command; + for (argp = argv; ; ) + { + p = shell_quote_copy (p, *argp); + argp++; + if (*argp == NULL) + break; + *p++ = ' '; + } + *p = '\0'; + + return command; + } + else + return xstrdup (""); +} diff -Nru datamash-1.7/lib/sh-quote.h datamash-1.8/lib/sh-quote.h --- datamash-1.7/lib/sh-quote.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/sh-quote.h 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,49 @@ +/* Shell quoting. + Copyright (C) 2001-2002, 2004, 2009-2021 Free Software Foundation, Inc. + Written by Bruno Haible , 2001. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU 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 _SH_QUOTE_H +#define _SH_QUOTE_H + +/* When passing a command to a shell, we must quote the program name and + arguments, since Unix shells interpret characters like " ", "'", "<", ">", + "$", '*', '?' etc. in a special way. */ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Returns the number of bytes needed for the quoted string. */ +extern size_t shell_quote_length (const char *string); + +/* Copies the quoted string to p and returns the incremented p. + There must be room for shell_quote_length (string) + 1 bytes at p. */ +extern char * shell_quote_copy (char *restrict p, const char *string); + +/* Returns the freshly allocated quoted string. */ +extern char * shell_quote (const char *string); + +/* Returns a freshly allocated string containing all argument strings, quoted, + separated through spaces. */ +extern char * shell_quote_argv (const char * const *argv); + +#ifdef __cplusplus +} +#endif + +#endif /* _SH_QUOTE_H */ diff -Nru datamash-1.7/lib/signbitd.c datamash-1.8/lib/signbitd.c --- datamash-1.7/lib/signbitd.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/signbitd.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* signbit() macro: Determine the sign bit of a floating-point number. - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 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.7/lib/signbitf.c datamash-1.8/lib/signbitf.c --- datamash-1.7/lib/signbitf.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/signbitf.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* signbit() macro: Determine the sign bit of a floating-point number. - Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2021 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.7/lib/signbitl.c datamash-1.8/lib/signbitl.c --- datamash-1.7/lib/signbitl.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/signbitl.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* signbit() macro: Determine the sign bit of a floating-point number. - Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2021 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.7/lib/size_max.h datamash-1.8/lib/size_max.h --- datamash-1.7/lib/size_max.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/size_max.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* size_max.h -- declare SIZE_MAX through system headers - Copyright (C) 2005-2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009-2021 Free Software Foundation, Inc. Written by Simon Josefsson. This program is free software; you can redistribute it and/or modify diff -Nru datamash-1.7/lib/snprintf.c datamash-1.8/lib/snprintf.c --- datamash-1.7/lib/snprintf.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/snprintf.c 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,71 @@ +/* Formatted output to strings. + Copyright (C) 2004, 2006-2021 Free Software Foundation, Inc. + Written by Simon Josefsson and Paul Eggert. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU 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 . */ + +#include + +/* Specification. */ +#include + +#include +#include +#include +#include +#include + +#include "vasnprintf.h" + +/* Print formatted output to string STR. Similar to sprintf, but + additional length SIZE limit how much is written into STR. Returns + string length of formatted string (which may be larger than SIZE). + STR may be NULL, in which case nothing will be written. On error, + return a negative value. */ +int +snprintf (char *str, size_t size, const char *format, ...) +{ + char *output; + size_t len; + size_t lenbuf = size; + va_list args; + + va_start (args, format); + output = vasnprintf (str, &lenbuf, format, args); + len = lenbuf; + va_end (args); + + if (!output) + return -1; + + if (output != str) + { + if (size) + { + size_t pruned_len = (len < size ? len : size - 1); + memcpy (str, output, pruned_len); + str[pruned_len] = '\0'; + } + + free (output); + } + + if (INT_MAX < len) + { + errno = EOVERFLOW; + return -1; + } + + return len; +} diff -Nru datamash-1.7/lib/sqrtl.c datamash-1.8/lib/sqrtl.c --- datamash-1.7/lib/sqrtl.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/sqrtl.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,7 +1,7 @@ /* Emulation for sqrtl. Contributed by Paolo Bonzini - Copyright 2002-2003, 2007, 2009-2020 Free Software Foundation, Inc. + Copyright 2002-2003, 2007, 2009-2021 Free Software Foundation, Inc. This file is part of gnulib. diff -Nru datamash-1.7/lib/stat.c datamash-1.8/lib/stat.c --- datamash-1.7/lib/stat.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/stat.c 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,440 @@ +/* Work around platform bugs in stat. + Copyright (C) 2009-2021 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 Eric Blake and Bruno Haible. */ + +/* If the user's config.h happens to include , let it include only + the system's here, so that orig_stat doesn't recurse to + rpl_stat. */ +#define __need_system_sys_stat_h +#include + +/* Get the original definition of stat. It might be defined as a macro. */ +#include +#include +#undef __need_system_sys_stat_h + +#if defined _WIN32 && ! defined __CYGWIN__ +# define WINDOWS_NATIVE +#endif + +#if !defined WINDOWS_NATIVE + +static int +orig_stat (const char *filename, struct stat *buf) +{ + return stat (filename, buf); +} + +#endif + +/* Specification. */ +#ifdef __osf__ +/* Write "sys/stat.h" here, not , otherwise OSF/1 5.1 DTK cc + eliminates this include because of the preliminary #include + above. */ +# include "sys/stat.h" +#else +# include +#endif + +#include "stat-time.h" + +#include +#include +#include +#include +#include "filename.h" +#include "malloca.h" +#include "verify.h" + +#ifdef WINDOWS_NATIVE +# define WIN32_LEAN_AND_MEAN +# include +# include "stat-w32.h" +/* Don't assume that UNICODE is not defined. */ +# undef WIN32_FIND_DATA +# define WIN32_FIND_DATA WIN32_FIND_DATAA +# undef CreateFile +# define CreateFile CreateFileA +# undef FindFirstFile +# define FindFirstFile FindFirstFileA +#endif + +#ifdef WINDOWS_NATIVE +/* Return TRUE if the given file name denotes an UNC root. */ +static BOOL +is_unc_root (const char *rname) +{ + /* Test whether it has the syntax '\\server\share'. */ + if (ISSLASH (rname[0]) && ISSLASH (rname[1])) + { + /* It starts with two slashes. Find the next slash. */ + const char *p = rname + 2; + const char *q = p; + while (*q != '\0' && !ISSLASH (*q)) + q++; + if (q > p && *q != '\0') + { + /* Found the next slash at q. */ + q++; + const char *r = q; + while (*r != '\0' && !ISSLASH (*r)) + r++; + if (r > q && *r == '\0') + return TRUE; + } + } + return FALSE; +} +#endif + +/* Store information about NAME into ST. Work around bugs with + trailing slashes. Mingw has other bugs (such as st_ino always + being 0 on success) which this wrapper does not work around. But + at least this implementation provides the ability to emulate fchdir + correctly. */ + +int +rpl_stat (char const *name, struct stat *buf) +{ +#ifdef WINDOWS_NATIVE + /* Fill the fields ourselves, because the original stat function returns + values for st_atime, st_mtime, st_ctime that depend on the current time + zone. See + */ + /* XXX Should we convert to wchar_t* and prepend '\\?\', in order to work + around length limitations + ? */ + + /* POSIX + specifies: "More than two leading characters shall be treated as + a single character." */ + if (ISSLASH (name[0]) && ISSLASH (name[1]) && ISSLASH (name[2])) + { + name += 2; + while (ISSLASH (name[1])) + name++; + } + + size_t len = strlen (name); + size_t drive_prefix_len = (HAS_DEVICE (name) ? 2 : 0); + + /* Remove trailing slashes (except the very first one, at position + drive_prefix_len), but remember their presence. */ + size_t rlen; + bool check_dir = false; + + rlen = len; + while (rlen > drive_prefix_len && ISSLASH (name[rlen-1])) + { + check_dir = true; + if (rlen == drive_prefix_len + 1) + break; + rlen--; + } + + /* Handle '' and 'C:'. */ + if (!check_dir && rlen == drive_prefix_len) + { + errno = ENOENT; + return -1; + } + + /* Handle '\\'. */ + if (rlen == 1 && ISSLASH (name[0]) && len >= 2) + { + errno = ENOENT; + return -1; + } + + const char *rname; + char *malloca_rname; + if (rlen == len) + { + rname = name; + malloca_rname = NULL; + } + else + { + malloca_rname = malloca (rlen + 1); + if (malloca_rname == NULL) + { + errno = ENOMEM; + return -1; + } + memcpy (malloca_rname, name, rlen); + malloca_rname[rlen] = '\0'; + rname = malloca_rname; + } + + /* There are two ways to get at the requested information: + - by scanning the parent directory and examining the relevant + directory entry, + - by opening the file directly. + The first approach fails for root directories (e.g. 'C:\') and + UNC root directories (e.g. '\\server\share'). + The second approach fails for some system files (e.g. 'C:\pagefile.sys' + and 'C:\hiberfil.sys'): ERROR_SHARING_VIOLATION. + The second approach gives more information (in particular, correct + st_dev, st_ino, st_nlink fields). + So we use the second approach and, as a fallback except for root and + UNC root directories, also the first approach. */ + { + int ret; + + { + /* Approach based on the file. */ + + /* Open a handle to the file. + CreateFile + + */ + HANDLE h = + CreateFile (rname, + FILE_READ_ATTRIBUTES, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + NULL, + OPEN_EXISTING, + /* FILE_FLAG_POSIX_SEMANTICS (treat file names that differ only + in case as different) makes sense only when applied to *all* + filesystem operations. */ + FILE_FLAG_BACKUP_SEMANTICS /* | FILE_FLAG_POSIX_SEMANTICS */, + NULL); + if (h != INVALID_HANDLE_VALUE) + { + ret = _gl_fstat_by_handle (h, rname, buf); + CloseHandle (h); + goto done; + } + } + + /* Test for root and UNC root directories. */ + if ((rlen == drive_prefix_len + 1 && ISSLASH (rname[drive_prefix_len])) + || is_unc_root (rname)) + goto failed; + + /* Fallback. */ + { + /* Approach based on the directory entry. */ + + if (strchr (rname, '?') != NULL || strchr (rname, '*') != NULL) + { + /* Other Windows API functions would fail with error + ERROR_INVALID_NAME. */ + if (malloca_rname != NULL) + freea (malloca_rname); + errno = ENOENT; + return -1; + } + + /* Get the details about the directory entry. This can be done through + FindFirstFile + + + or through + FindFirstFileEx with argument FindExInfoBasic + + + */ + WIN32_FIND_DATA info; + HANDLE h = FindFirstFile (rname, &info); + if (h == INVALID_HANDLE_VALUE) + goto failed; + + /* Test for error conditions before starting to fill *buf. */ + if (sizeof (buf->st_size) <= 4 && info.nFileSizeHigh > 0) + { + FindClose (h); + if (malloca_rname != NULL) + freea (malloca_rname); + errno = EOVERFLOW; + return -1; + } + +# if _GL_WINDOWS_STAT_INODES + buf->st_dev = 0; +# if _GL_WINDOWS_STAT_INODES == 2 + buf->st_ino._gl_ino[0] = buf->st_ino._gl_ino[1] = 0; +# else /* _GL_WINDOWS_STAT_INODES == 1 */ + buf->st_ino = 0; +# endif +# else + /* st_ino is not wide enough for identifying a file on a device. + Without st_ino, st_dev is pointless. */ + buf->st_dev = 0; + buf->st_ino = 0; +# endif + + /* st_mode. */ + unsigned int mode = + /* XXX How to handle FILE_ATTRIBUTE_REPARSE_POINT ? */ + ((info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? _S_IFDIR | S_IEXEC_UGO : _S_IFREG) + | S_IREAD_UGO + | ((info.dwFileAttributes & FILE_ATTRIBUTE_READONLY) ? 0 : S_IWRITE_UGO); + if (!(info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) + { + /* Determine whether the file is executable by looking at the file + name suffix. */ + if (info.nFileSizeHigh > 0 || info.nFileSizeLow > 0) + { + const char *last_dot = NULL; + const char *p; + for (p = info.cFileName; *p != '\0'; p++) + if (*p == '.') + last_dot = p; + if (last_dot != NULL) + { + const char *suffix = last_dot + 1; + if (_stricmp (suffix, "exe") == 0 + || _stricmp (suffix, "bat") == 0 + || _stricmp (suffix, "cmd") == 0 + || _stricmp (suffix, "com") == 0) + mode |= S_IEXEC_UGO; + } + } + } + buf->st_mode = mode; + + /* st_nlink. Ignore hard links here. */ + buf->st_nlink = 1; + + /* There's no easy way to map the Windows SID concept to an integer. */ + buf->st_uid = 0; + buf->st_gid = 0; + + /* st_rdev is irrelevant for normal files and directories. */ + buf->st_rdev = 0; + + /* st_size. */ + if (sizeof (buf->st_size) <= 4) + /* Range check already done above. */ + buf->st_size = info.nFileSizeLow; + else + buf->st_size = ((long long) info.nFileSizeHigh << 32) | (long long) info.nFileSizeLow; + + /* st_atime, st_mtime, st_ctime. */ +# if _GL_WINDOWS_STAT_TIMESPEC + buf->st_atim = _gl_convert_FILETIME_to_timespec (&info.ftLastAccessTime); + buf->st_mtim = _gl_convert_FILETIME_to_timespec (&info.ftLastWriteTime); + buf->st_ctim = _gl_convert_FILETIME_to_timespec (&info.ftCreationTime); +# else + buf->st_atime = _gl_convert_FILETIME_to_POSIX (&info.ftLastAccessTime); + buf->st_mtime = _gl_convert_FILETIME_to_POSIX (&info.ftLastWriteTime); + buf->st_ctime = _gl_convert_FILETIME_to_POSIX (&info.ftCreationTime); +# endif + + FindClose (h); + + ret = 0; + } + + done: + if (ret >= 0 && check_dir && !S_ISDIR (buf->st_mode)) + { + errno = ENOTDIR; + ret = -1; + } + if (malloca_rname != NULL) + { + int saved_errno = errno; + freea (malloca_rname); + errno = saved_errno; + } + return ret; + } + + failed: + { + DWORD error = GetLastError (); + #if 0 + fprintf (stderr, "rpl_stat error 0x%x\n", (unsigned int) error); + #endif + + if (malloca_rname != NULL) + freea (malloca_rname); + + switch (error) + { + /* Some of these errors probably cannot happen with the specific flags + that we pass to CreateFile. But who knows... */ + case ERROR_FILE_NOT_FOUND: /* The last component of rname does not exist. */ + case ERROR_PATH_NOT_FOUND: /* Some directory component in rname does not exist. */ + case ERROR_BAD_PATHNAME: /* rname is such as '\\server'. */ + case ERROR_BAD_NET_NAME: /* rname is such as '\\server\nonexistentshare'. */ + case ERROR_INVALID_NAME: /* rname contains wildcards, misplaced colon, etc. */ + case ERROR_DIRECTORY: + errno = ENOENT; + break; + + case ERROR_ACCESS_DENIED: /* rname is such as 'C:\System Volume Information\foo'. */ + case ERROR_SHARING_VIOLATION: /* rname is such as 'C:\pagefile.sys' (second approach only). */ + /* XXX map to EACCES or EPERM? */ + errno = EACCES; + break; + + case ERROR_OUTOFMEMORY: + errno = ENOMEM; + break; + + case ERROR_WRITE_PROTECT: + errno = EROFS; + break; + + case ERROR_WRITE_FAULT: + case ERROR_READ_FAULT: + case ERROR_GEN_FAILURE: + errno = EIO; + break; + + case ERROR_BUFFER_OVERFLOW: + case ERROR_FILENAME_EXCED_RANGE: + errno = ENAMETOOLONG; + break; + + case ERROR_DELETE_PENDING: /* XXX map to EACCES or EPERM? */ + errno = EPERM; + break; + + default: + errno = EINVAL; + break; + } + + return -1; + } +#else + int result = orig_stat (name, buf); + if (result == 0) + { +# if REPLACE_FUNC_STAT_FILE + /* Solaris 9 mistakenly succeeds when given a non-directory with a + trailing slash. */ + if (!S_ISDIR (buf->st_mode)) + { + size_t len = strlen (name); + if (ISSLASH (name[len - 1])) + { + errno = ENOTDIR; + return -1; + } + } +# endif /* REPLACE_FUNC_STAT_FILE */ + result = stat_time_normalize (result, buf); + } + return result; +#endif +} diff -Nru datamash-1.7/lib/stat-time.h datamash-1.8/lib/stat-time.h --- datamash-1.7/lib/stat-time.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/stat-time.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* stat-related time functions. - Copyright (C) 2005, 2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2005, 2007, 2009-2021 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.7/lib/stat-w32.c datamash-1.8/lib/stat-w32.c --- datamash-1.7/lib/stat-w32.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/stat-w32.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Core of implementation of fstat and stat for native Windows. - Copyright (C) 2017-2020 Free Software Foundation, Inc. + Copyright (C) 2017-2021 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 @@ -20,9 +20,23 @@ #if defined _WIN32 && ! defined __CYGWIN__ -/* Ensure that defines FILE_ID_INFO. */ -#undef _WIN32_WINNT -#define _WIN32_WINNT _WIN32_WINNT_WIN8 +/* Attempt to make define FILE_ID_INFO. + But ensure that the redefinition of _WIN32_WINNT does not make us assume + Windows Vista or newer when building for an older version of Windows. */ +#if HAVE_SDKDDKVER_H +# include +# if _WIN32_WINNT >= _WIN32_WINNT_VISTA +# define WIN32_ASSUME_VISTA 1 +# else +# define WIN32_ASSUME_VISTA 0 +# endif +# if !defined _WIN32_WINNT || (_WIN32_WINNT < _WIN32_WINNT_WIN8) +# undef _WIN32_WINNT +# define _WIN32_WINNT _WIN32_WINNT_WIN8 +# endif +#else +# define WIN32_ASSUME_VISTA (_WIN32_WINNT >= _WIN32_WINNT_VISTA) +#endif #include #include @@ -38,21 +52,34 @@ #include "pathmax.h" #include "verify.h" +/* Don't assume that UNICODE is not defined. */ +#undef LoadLibrary +#define LoadLibrary LoadLibraryA +#undef GetFinalPathNameByHandle +#define GetFinalPathNameByHandle GetFinalPathNameByHandleA + +/* Older mingw headers do not define VOLUME_NAME_NONE. */ +#ifndef VOLUME_NAME_NONE +# define VOLUME_NAME_NONE 4 +#endif + +#if !WIN32_ASSUME_VISTA + /* Avoid warnings from gcc -Wcast-function-type. */ -#define GetProcAddress \ - (void *) GetProcAddress +# define GetProcAddress \ + (void *) GetProcAddress -#if _GL_WINDOWS_STAT_INODES == 2 +# if _GL_WINDOWS_STAT_INODES == 2 /* GetFileInformationByHandleEx was introduced only in Windows Vista. */ typedef DWORD (WINAPI * GetFileInformationByHandleExFuncType) (HANDLE hFile, FILE_INFO_BY_HANDLE_CLASS fiClass, LPVOID lpBuffer, DWORD dwBufferSize); static GetFileInformationByHandleExFuncType GetFileInformationByHandleExFunc = NULL; -#endif +# endif /* GetFinalPathNameByHandle was introduced only in Windows Vista. */ typedef DWORD (WINAPI * GetFinalPathNameByHandleFuncType) (HANDLE hFile, - LPTSTR lpFilePath, + LPSTR lpFilePath, DWORD lenFilePath, DWORD dwFlags); static GetFinalPathNameByHandleFuncType GetFinalPathNameByHandleFunc = NULL; @@ -64,16 +91,23 @@ HMODULE kernel32 = LoadLibrary ("kernel32.dll"); if (kernel32 != NULL) { -#if _GL_WINDOWS_STAT_INODES == 2 +# if _GL_WINDOWS_STAT_INODES == 2 GetFileInformationByHandleExFunc = (GetFileInformationByHandleExFuncType) GetProcAddress (kernel32, "GetFileInformationByHandleEx"); -#endif +# endif GetFinalPathNameByHandleFunc = (GetFinalPathNameByHandleFuncType) GetProcAddress (kernel32, "GetFinalPathNameByHandleA"); } initialized = TRUE; } +#else + +# define GetFileInformationByHandleExFunc GetFileInformationByHandleEx +# define GetFinalPathNameByHandleFunc GetFinalPathNameByHandle + +#endif + /* Converts a FILETIME to GMT time since 1970-01-01 00:00:00. */ #if _GL_WINDOWS_STAT_TIMESPEC struct timespec @@ -132,8 +166,10 @@ DWORD type = GetFileType (h); if (type == FILE_TYPE_DISK) { +#if !WIN32_ASSUME_VISTA if (!initialized) initialize (); +#endif /* st_mode can be determined through GetFileAttributesEx diff -Nru datamash-1.7/lib/stat-w32.h datamash-1.8/lib/stat-w32.h --- datamash-1.7/lib/stat-w32.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/stat-w32.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Core of implementation of fstat and stat for native Windows. - Copyright (C) 2017-2020 Free Software Foundation, Inc. + Copyright (C) 2017-2021 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.7/lib/stdalign.in.h datamash-1.8/lib/stdalign.in.h --- datamash-1.7/lib/stdalign.in.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/stdalign.in.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* A substitute for ISO C11 . - Copyright 2011-2020 Free Software Foundation, Inc. + Copyright 2011-2021 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 @@ -34,11 +34,12 @@ requirement of a structure member (i.e., slot or field) that is of type TYPE, as an integer constant expression. - This differs from GCC's __alignof__ operator, which can yield a - better-performing alignment for an object of that type. For - example, on x86 with GCC, __alignof__ (double) and __alignof__ - (long long) are 8, whereas alignof (double) and alignof (long long) - are 4 unless the option '-malign-double' is used. + This differs from GCC's and clang's __alignof__ operator, which can + yield a better-performing alignment for an object of that type. For + example, on x86 with GCC and on Linux/x86 with clang, + __alignof__ (double) and __alignof__ (long long) are 8, whereas + alignof (double) and alignof (long long) are 4 unless the option + '-malign-double' is used. The result cannot be used as a value for an 'enum' constant, if you want to be portable to HP-UX 10.20 cc and AIX 3.2.5 xlc. @@ -53,9 +54,12 @@ #undef _Alignof /* GCC releases before GCC 4.9 had a bug in _Alignof. See GCC bug 52023 - . */ + . + clang versions < 8.0.0 have the same bug. */ #if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \ - || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9))) + || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9) \ + && !defined __clang__) \ + || (defined __clang__ && __clang_major__ < 8)) # ifdef __cplusplus # if 201103 <= __cplusplus # define _Alignof(type) alignof (type) @@ -102,8 +106,9 @@ # define _Alignas(a) alignas (a) # elif ((defined __APPLE__ && defined __MACH__ \ ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \ - : __GNUC__ && !defined __ibmxl__) \ - || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \ + : __GNUC__ && !defined __ibmxl__) \ + || (4 <= __clang_major__) \ + || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \ || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__) # define _Alignas(a) __attribute__ ((__aligned__ (a))) # elif 1300 <= _MSC_VER diff -Nru datamash-1.7/lib/stdarg.in.h datamash-1.8/lib/stdarg.in.h --- datamash-1.7/lib/stdarg.in.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/stdarg.in.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Substitute for and wrapper around . - Copyright (C) 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2008-2021 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.7/lib/stdbool.in.h datamash-1.8/lib/stdbool.in.h --- datamash-1.7/lib/stdbool.in.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/stdbool.in.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2003, 2006-2020 Free Software Foundation, Inc. +/* Copyright (C) 2001-2003, 2006-2021 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.7/lib/stddef.in.h datamash-1.8/lib/stddef.in.h --- datamash-1.7/lib/stddef.in.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/stddef.in.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* A substitute for POSIX 2008 , for platforms that have issues. - Copyright (C) 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2009-2021 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 @@ -49,6 +49,23 @@ # ifndef _@GUARD_PREFIX@_STDDEF_H +/* On AIX 7.2, with xlc in 64-bit mode, defines max_align_t to a + type with alignment 4, but 'long' has alignment 8. */ +# if defined _AIX && defined _ARCH_PPC64 +# if !GNULIB_defined_max_align_t +# ifdef _MAX_ALIGN_T +/* /usr/include/stddef.h has already defined max_align_t. Override it. */ +typedef long rpl_max_align_t; +# define max_align_t rpl_max_align_t +# else +/* Prevent /usr/include/stddef.h from defining max_align_t. */ +typedef long max_align_t; +# define _MAX_ALIGN_T +# endif +# define GNULIB_defined_max_align_t 1 +# endif +# endif + /* The include_next requires a split double-inclusion guard. */ # @INCLUDE_NEXT@ @NEXT_STDDEF_H@ @@ -97,7 +114,7 @@ and the C11 standard allows this. Work around this problem by using __alignof__ (which returns 8 for double) rather than _Alignof (which returns 4), and align each union member accordingly. */ -# ifdef __GNUC__ +# if defined __GNUC__ || (__clang_major__ >= 4) # define _GL_STDDEF_ALIGNAS(type) \ __attribute__ ((__aligned__ (__alignof__ (type)))) # else diff -Nru datamash-1.7/lib/stdint.in.h datamash-1.8/lib/stdint.in.h --- datamash-1.7/lib/stdint.in.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/stdint.in.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2002, 2004-2020 Free Software Foundation, Inc. +/* Copyright (C) 2001-2002, 2004-2021 Free Software Foundation, Inc. Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood. This file is part of gnulib. @@ -302,12 +302,11 @@ /* kLIBC's 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. - Similarly, mingw 5.22 defines _INTPTR_T_DEFINED and - _UINTPTR_T_DEFINED and needs its own definitions of intptr_t and + Similarly, MinGW WSL-5.4.1 needs its own intptr_t and uintptr_t to avoid conflicting declarations of system functions like _findclose in . */ # if !((defined __KLIBC__ && defined _INTPTR_T_DECLARED) \ - || (defined __MINGW32__ && defined _INTPTR_T_DEFINED && defined _UINTPTR_T_DEFINED)) + || defined __MINGW32__) # undef intptr_t # undef uintptr_t # ifdef _WIN64 @@ -580,11 +579,6 @@ -> -> -> , and the latter includes and assumes its types are already defined. */ # 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 diff -Nru datamash-1.7/lib/stdio-impl.h datamash-1.8/lib/stdio-impl.h --- datamash-1.7/lib/stdio-impl.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/stdio-impl.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Implementation details of FILE streams. - Copyright (C) 2007-2008, 2010-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2008, 2010-2021 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 @@ -175,7 +175,7 @@ # define fp_ fp # endif -# if defined _SCO_DS /* OpenServer */ +# if defined _SCO_DS || (defined __SCO_VERSION__ || defined __sysv5__) /* OpenServer 5, OpenServer 6, UnixWare 7 */ # define _cnt __cnt # define _ptr __ptr # define _base __base diff -Nru datamash-1.7/lib/stdio.in.h datamash-1.8/lib/stdio.in.h --- datamash-1.7/lib/stdio.in.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/stdio.in.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* A GNU-like . - Copyright (C) 2004, 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2004, 2007-2021 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 @@ -62,35 +62,51 @@ We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because gnulib and libintl do '#define printf __printf__' when they override the 'printf' function. */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) -# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) +#ifndef _GL_ATTRIBUTE_FORMAT +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || defined __clang__ +# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) +# else +# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */ +# endif +#endif + +/* An __attribute__ __format__ specifier for a function that takes a format + string and arguments, where the format string directives are the ones + standardized by ISO C99 and POSIX. + _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD */ +/* __gnu_printf__ is supported in GCC >= 4.4. */ +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) +# define _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD __gnu_printf__ +#else +# define _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD __printf__ +#endif + +/* An __attribute__ __format__ specifier for a function that takes a format + string and arguments, where the format string directives are the ones of the + system printf(), rather than the ones standardized by ISO C99 and POSIX. + _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM */ +/* On mingw, Gnulib sets __USE_MINGW_ANSI_STDIO in order to get closer to + the standards. The macro GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU indicates + whether this change is effective. On older mingw, it is not. */ +#if GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU +# define _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD #else -# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */ +# define _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM __printf__ #endif -/* _GL_ATTRIBUTE_FORMAT_PRINTF +/* _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD indicates to GCC that the function takes a format string and arguments, where the format string directives are the ones standardized by ISO C99 and POSIX. */ -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) -# define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \ - _GL_ATTRIBUTE_FORMAT ((__gnu_printf__, formatstring_parameter, first_argument)) -#else -# define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \ - _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument)) -#endif +#define _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(formatstring_parameter, first_argument) \ + _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, formatstring_parameter, first_argument)) -/* _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_PRINTF, +/* _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD, except that it indicates to GCC that the supported format string directives are the ones of the system printf(), rather than the ones standardized by ISO C99 and POSIX. */ -#if GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU -# define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \ - _GL_ATTRIBUTE_FORMAT_PRINTF (formatstring_parameter, first_argument) -#else -# define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \ - _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument)) -#endif +#define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \ + _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM, formatstring_parameter, first_argument)) /* _GL_ATTRIBUTE_FORMAT_SCANF indicates to GCC that the function takes a format string and arguments, @@ -172,13 +188,13 @@ # define dprintf rpl_dprintf # endif _GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *restrict format, ...) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ARG_NONNULL ((2))); _GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *restrict format, ...)); # else # if !@HAVE_DPRINTF@ _GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *restrict format, ...) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ARG_NONNULL ((2))); # endif _GL_CXXALIAS_SYS (dprintf, int, (int fd, const char *restrict format, ...)); @@ -213,6 +229,31 @@ "use gnulib module fclose for portable POSIX compliance"); #endif +#if @GNULIB_MDA_FCLOSEALL@ +/* On native Windows, map 'fcloseall' to '_fcloseall', so that -loldnames is + not required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::fcloseall on all platforms that have + it. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fcloseall +# define fcloseall _fcloseall +# endif +_GL_CXXALIAS_MDA (fcloseall, int, (void)); +# else +# if @HAVE_DECL_FCLOSEALL@ +# if defined __FreeBSD__ +_GL_CXXALIAS_SYS (fcloseall, void, (void)); +# else +_GL_CXXALIAS_SYS (fcloseall, int, (void)); +# endif +# endif +# endif +# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_FCLOSEALL@ +_GL_CXXALIASWARN (fcloseall); +# endif +#endif + #if @GNULIB_FDOPEN@ # if @REPLACE_FDOPEN@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -222,6 +263,12 @@ _GL_FUNCDECL_RPL (fdopen, FILE *, (int fd, const char *mode) _GL_ARG_NONNULL ((2))); _GL_CXXALIAS_RPL (fdopen, FILE *, (int fd, const char *mode)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fdopen +# define fdopen _fdopen +# endif +_GL_CXXALIAS_MDA (fdopen, FILE *, (int fd, const char *mode)); # else _GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode)); # endif @@ -231,6 +278,20 @@ /* Assume fdopen is always declared. */ _GL_WARN_ON_USE (fdopen, "fdopen on native Windows platforms is not POSIX compliant - " "use gnulib module fdopen for portability"); +#elif @GNULIB_MDA_FDOPEN@ +/* On native Windows, map 'fdopen' to '_fdopen', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::fdopen always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fdopen +# define fdopen _fdopen +# endif +_GL_CXXALIAS_MDA (fdopen, FILE *, (int fd, const char *mode)); +# else +_GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode)); +# endif +_GL_CXXALIASWARN (fdopen); #endif #if @GNULIB_FFLUSH@ @@ -295,6 +356,22 @@ # endif #endif +#if @GNULIB_MDA_FILENO@ +/* On native Windows, map 'fileno' to '_fileno', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::fileno always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fileno +# define fileno _fileno +# endif +_GL_CXXALIAS_MDA (fileno, int, (FILE *restrict stream)); +# else +_GL_CXXALIAS_SYS (fileno, int, (FILE *restrict stream)); +# endif +_GL_CXXALIASWARN (fileno); +#endif + #if @GNULIB_FOPEN@ # if @REPLACE_FOPEN@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -330,7 +407,7 @@ # if @GNULIB_FPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@ _GL_FUNCDECL_RPL (fprintf, int, (FILE *restrict fp, const char *restrict format, ...) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ARG_NONNULL ((1, 2))); # else _GL_FUNCDECL_RPL (fprintf, int, @@ -822,6 +899,22 @@ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); #endif +#if @GNULIB_MDA_GETW@ +/* On native Windows, map 'getw' to '_getw', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::getw always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getw +# define getw _getw +# endif +_GL_CXXALIAS_MDA (getw, int, (FILE *restrict stream)); +# else +_GL_CXXALIAS_SYS (getw, int, (FILE *restrict stream)); +# endif +_GL_CXXALIASWARN (getw); +#endif + #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@ struct obstack; /* Grow an obstack with formatted output. Return the number of @@ -835,7 +928,7 @@ # endif _GL_FUNCDECL_RPL (obstack_printf, int, (struct obstack *obs, const char *format, ...) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ARG_NONNULL ((1, 2))); _GL_CXXALIAS_RPL (obstack_printf, int, (struct obstack *obs, const char *format, ...)); @@ -843,7 +936,7 @@ # if !@HAVE_DECL_OBSTACK_PRINTF@ _GL_FUNCDECL_SYS (obstack_printf, int, (struct obstack *obs, const char *format, ...) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ARG_NONNULL ((1, 2))); # endif _GL_CXXALIAS_SYS (obstack_printf, int, @@ -856,7 +949,7 @@ # endif _GL_FUNCDECL_RPL (obstack_vprintf, int, (struct obstack *obs, const char *format, va_list args) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ARG_NONNULL ((1, 2))); _GL_CXXALIAS_RPL (obstack_vprintf, int, (struct obstack *obs, const char *format, va_list args)); @@ -864,7 +957,7 @@ # if !@HAVE_DECL_OBSTACK_PRINTF@ _GL_FUNCDECL_SYS (obstack_vprintf, int, (struct obstack *obs, const char *format, va_list args) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ARG_NONNULL ((1, 2))); # endif _GL_CXXALIAS_SYS (obstack_vprintf, int, @@ -938,7 +1031,7 @@ #if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@ # if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \ || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)) -# if defined __GNUC__ +# if defined __GNUC__ || defined __clang__ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) /* Don't break __attribute__((format(printf,M,N))). */ # define printf __printf__ @@ -948,7 +1041,7 @@ (const char *restrict format, ...) __asm__ (@ASM_SYMBOL_PREFIX@ _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf)) - _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2) _GL_ARG_NONNULL ((1))); # else _GL_FUNCDECL_RPL_1 (__printf__, int, @@ -965,7 +1058,7 @@ # endif _GL_FUNCDECL_RPL (printf, int, (const char *restrict format, ...) - _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2) _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (printf, int, (const char *restrict format, ...)); # endif @@ -1035,6 +1128,22 @@ # endif #endif +#if @GNULIB_MDA_PUTW@ +/* On native Windows, map 'putw' to '_putw', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::putw always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef putw +# define putw _putw +# endif +_GL_CXXALIAS_MDA (putw, int, (int w, FILE *restrict stream)); +# else +_GL_CXXALIAS_SYS (putw, int, (int w, FILE *restrict stream)); +# endif +_GL_CXXALIASWARN (putw); +#endif + #if @GNULIB_REMOVE@ # if @REPLACE_REMOVE@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -1112,7 +1221,7 @@ #if @GNULIB_SCANF@ # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@ -# if defined __GNUC__ +# if defined __GNUC__ || defined __clang__ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef scanf /* Don't break __attribute__((format(scanf,M,N))). */ @@ -1151,7 +1260,7 @@ _GL_FUNCDECL_RPL (snprintf, int, (char *restrict str, size_t size, const char *restrict format, ...) - _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4) _GL_ARG_NONNULL ((3))); _GL_CXXALIAS_RPL (snprintf, int, (char *restrict str, size_t size, @@ -1161,14 +1270,16 @@ _GL_FUNCDECL_SYS (snprintf, int, (char *restrict str, size_t size, const char *restrict format, ...) - _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4) _GL_ARG_NONNULL ((3))); # endif _GL_CXXALIAS_SYS (snprintf, int, (char *restrict str, size_t size, const char *restrict format, ...)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (snprintf); +# endif #elif defined GNULIB_POSIXCHECK # undef snprintf # if HAVE_RAW_DECL_SNPRINTF @@ -1193,7 +1304,7 @@ # endif _GL_FUNCDECL_RPL (sprintf, int, (char *restrict str, const char *restrict format, ...) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ARG_NONNULL ((1, 2))); _GL_CXXALIAS_RPL (sprintf, int, (char *restrict str, const char *restrict format, ...)); @@ -1212,6 +1323,22 @@ "POSIX compliance"); #endif +#if @GNULIB_MDA_TEMPNAM@ +/* On native Windows, map 'tempnam' to '_tempnam', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::tempnam always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef tempnam +# define tempnam _tempnam +# endif +_GL_CXXALIAS_MDA (tempnam, char *, (const char *dir, const char *prefix)); +# else +_GL_CXXALIAS_SYS (tempnam, char *, (const char *dir, const char *prefix)); +# endif +_GL_CXXALIASWARN (tempnam); +#endif + #if @GNULIB_TMPFILE@ # if @REPLACE_TMPFILE@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -1244,7 +1371,7 @@ # endif _GL_FUNCDECL_RPL (asprintf, int, (char **result, const char *format, ...) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ARG_NONNULL ((1, 2))); _GL_CXXALIAS_RPL (asprintf, int, (char **result, const char *format, ...)); @@ -1252,7 +1379,7 @@ # if !@HAVE_VASPRINTF@ _GL_FUNCDECL_SYS (asprintf, int, (char **result, const char *format, ...) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3) _GL_ARG_NONNULL ((1, 2))); # endif _GL_CXXALIAS_SYS (asprintf, int, @@ -1265,7 +1392,7 @@ # endif _GL_FUNCDECL_RPL (vasprintf, int, (char **result, const char *format, va_list args) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ARG_NONNULL ((1, 2))); _GL_CXXALIAS_RPL (vasprintf, int, (char **result, const char *format, va_list args)); @@ -1273,7 +1400,7 @@ # if !@HAVE_VASPRINTF@ _GL_FUNCDECL_SYS (vasprintf, int, (char **result, const char *format, va_list args) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ARG_NONNULL ((1, 2))); # endif _GL_CXXALIAS_SYS (vasprintf, int, @@ -1289,7 +1416,7 @@ # endif _GL_FUNCDECL_RPL (vdprintf, int, (int fd, const char *restrict format, va_list args) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ARG_NONNULL ((2))); _GL_CXXALIAS_RPL (vdprintf, int, (int fd, const char *restrict format, va_list args)); @@ -1297,7 +1424,7 @@ # if !@HAVE_VDPRINTF@ _GL_FUNCDECL_SYS (vdprintf, int, (int fd, const char *restrict format, va_list args) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ARG_NONNULL ((2))); # endif /* Need to cast, because on Solaris, the third parameter will likely be @@ -1327,7 +1454,7 @@ _GL_FUNCDECL_RPL (vfprintf, int, (FILE *restrict fp, const char *restrict format, va_list args) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ARG_NONNULL ((1, 2))); # else _GL_FUNCDECL_RPL (vfprintf, int, @@ -1380,7 +1507,9 @@ (FILE *restrict stream, const char *restrict format, va_list args)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (vfscanf); +# endif #endif #if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VPRINTF@ @@ -1392,7 +1521,7 @@ # define GNULIB_overrides_vprintf 1 # if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@ _GL_FUNCDECL_RPL (vprintf, int, (const char *restrict format, va_list args) - _GL_ATTRIBUTE_FORMAT_PRINTF (1, 0) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 0) _GL_ARG_NONNULL ((1))); # else _GL_FUNCDECL_RPL (vprintf, int, (const char *restrict format, va_list args) @@ -1434,7 +1563,9 @@ # else _GL_CXXALIAS_SYS (vscanf, int, (const char *restrict format, va_list args)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (vscanf); +# endif #endif #if @GNULIB_VSNPRINTF@ @@ -1445,7 +1576,7 @@ _GL_FUNCDECL_RPL (vsnprintf, int, (char *restrict str, size_t size, const char *restrict format, va_list args) - _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0) _GL_ARG_NONNULL ((3))); _GL_CXXALIAS_RPL (vsnprintf, int, (char *restrict str, size_t size, @@ -1455,14 +1586,16 @@ _GL_FUNCDECL_SYS (vsnprintf, int, (char *restrict str, size_t size, const char *restrict format, va_list args) - _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0) _GL_ARG_NONNULL ((3))); # endif _GL_CXXALIAS_SYS (vsnprintf, int, (char *restrict str, size_t size, const char *restrict format, va_list args)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (vsnprintf); +# endif #elif defined GNULIB_POSIXCHECK # undef vsnprintf # if HAVE_RAW_DECL_VSNPRINTF @@ -1479,7 +1612,7 @@ _GL_FUNCDECL_RPL (vsprintf, int, (char *restrict str, const char *restrict format, va_list args) - _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0) + _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0) _GL_ARG_NONNULL ((1, 2))); _GL_CXXALIAS_RPL (vsprintf, int, (char *restrict str, diff -Nru datamash-1.7/lib/stdlib.in.h datamash-1.8/lib/stdlib.in.h --- datamash-1.7/lib/stdlib.in.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/stdlib.in.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* A GNU-like . - Copyright (C) 1995, 2001-2004, 2006-2020 Free Software Foundation, Inc. + Copyright (C) 1995, 2001-2004, 2006-2021 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 @@ -53,8 +53,8 @@ # include #endif -/* Native Windows platforms declare mktemp() in . */ -#if 0 && (defined _WIN32 && ! defined __CYGWIN__) +/* Native Windows platforms declare _mktemp() in . */ +#if defined _WIN32 && !defined __CYGWIN__ # include #endif @@ -101,10 +101,12 @@ /* The __attribute__ feature is available in gcc versions 2.5 and later. The attribute __pure__ was added in gcc 2.96. */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) -# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) -#else -# define _GL_ATTRIBUTE_PURE /* empty */ +#ifndef _GL_ATTRIBUTE_PURE +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__ +# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define _GL_ATTRIBUTE_PURE /* empty */ +# endif #endif /* The definition of _Noreturn is copied here. */ @@ -147,6 +149,31 @@ #endif +/* Allocate memory with indefinite extent and specified alignment. */ +#if @GNULIB_ALIGNED_ALLOC@ +# if @REPLACE_ALIGNED_ALLOC@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef aligned_alloc +# define aligned_alloc rpl_aligned_alloc +# endif +_GL_FUNCDECL_RPL (aligned_alloc, void *, (size_t alignment, size_t size)); +_GL_CXXALIAS_RPL (aligned_alloc, void *, (size_t alignment, size_t size)); +# else +# if @HAVE_ALIGNED_ALLOC@ +_GL_CXXALIAS_SYS (aligned_alloc, void *, (size_t alignment, size_t size)); +# endif +# endif +# if @HAVE_ALIGNED_ALLOC@ +_GL_CXXALIASWARN (aligned_alloc); +# endif +#elif defined GNULIB_POSIXCHECK +# undef aligned_alloc +# if HAVE_RAW_DECL_ALIGNED_ALLOC +_GL_WARN_ON_USE (aligned_alloc, "aligned_alloc is not portable - " + "use gnulib module aligned_alloc for portability"); +# endif +#endif + #if @GNULIB_ATOLL@ /* Parse a signed decimal integer. Returns the value of the integer. Errors are not detected. */ @@ -215,6 +242,94 @@ # endif #endif +#if @GNULIB_MDA_ECVT@ +/* On native Windows, map 'ecvt' to '_ecvt', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::ecvt on all platforms that have + it. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef ecvt +# define ecvt _ecvt +# endif +_GL_CXXALIAS_MDA (ecvt, char *, + (double number, int ndigits, int *decptp, int *signp)); +# else +# if @HAVE_DECL_ECVT@ +_GL_CXXALIAS_SYS (ecvt, char *, + (double number, int ndigits, int *decptp, int *signp)); +# endif +# endif +# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_ECVT@ +_GL_CXXALIASWARN (ecvt); +# endif +#endif + +#if @GNULIB_MDA_FCVT@ +/* On native Windows, map 'fcvt' to '_fcvt', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::fcvt on all platforms that have + it. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef fcvt +# define fcvt _fcvt +# endif +_GL_CXXALIAS_MDA (fcvt, char *, + (double number, int ndigits, int *decptp, int *signp)); +# else +# if @HAVE_DECL_FCVT@ +_GL_CXXALIAS_SYS (fcvt, char *, + (double number, int ndigits, int *decptp, int *signp)); +# endif +# endif +# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_FCVT@ +_GL_CXXALIASWARN (fcvt); +# endif +#endif + +#if @GNULIB_FREE_POSIX@ +# if @REPLACE_FREE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef free +# define free rpl_free +# endif +_GL_FUNCDECL_RPL (free, void, (void *ptr)); +_GL_CXXALIAS_RPL (free, void, (void *ptr)); +# else +_GL_CXXALIAS_SYS (free, void, (void *ptr)); +# endif +# if __GLIBC__ >= 2 +_GL_CXXALIASWARN (free); +# endif +#elif defined GNULIB_POSIXCHECK +# undef free +/* Assume free is always declared. */ +_GL_WARN_ON_USE (free, "free is not future POSIX compliant everywhere - " + "use gnulib module free for portability"); +#endif + +#if @GNULIB_MDA_GCVT@ +/* On native Windows, map 'gcvt' to '_gcvt', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::gcvt on all platforms that have + it. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef gcvt +# define gcvt _gcvt +# endif +_GL_CXXALIAS_MDA (gcvt, char *, (double number, int ndigits, char *buf)); +# else +# if @HAVE_DECL_GCVT@ +_GL_CXXALIAS_SYS (gcvt, char *, (double number, int ndigits, char *buf)); +# endif +# endif +# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_GCVT@ +_GL_CXXALIASWARN (gcvt); +# endif +#endif + #if @GNULIB_GETLOADAVG@ /* Store max(NELEM,3) load average numbers in LOADAVG[]. The three numbers are the load average of the last 1 minute, the last 5 @@ -466,6 +581,51 @@ # endif #endif +#if @GNULIB_MDA_MKTEMP@ +/* On native Windows, map 'mktemp' to '_mktemp', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::mktemp always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef mktemp +# define mktemp _mktemp +# endif +_GL_CXXALIAS_MDA (mktemp, char *, (char * /*template*/)); +# else +_GL_CXXALIAS_SYS (mktemp, char *, (char * /*template*/)); +# endif +_GL_CXXALIASWARN (mktemp); +#endif + +/* Allocate memory with indefinite extent and specified alignment. */ +#if @GNULIB_POSIX_MEMALIGN@ +# if @REPLACE_POSIX_MEMALIGN@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef posix_memalign +# define posix_memalign rpl_posix_memalign +# endif +_GL_FUNCDECL_RPL (posix_memalign, int, + (void **memptr, size_t alignment, size_t size) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (posix_memalign, int, + (void **memptr, size_t alignment, size_t size)); +# else +# if @HAVE_POSIX_MEMALIGN@ +_GL_CXXALIAS_SYS (posix_memalign, int, + (void **memptr, size_t alignment, size_t size)); +# endif +# endif +# if @HAVE_POSIX_MEMALIGN@ +_GL_CXXALIASWARN (posix_memalign); +# endif +#elif defined GNULIB_POSIXCHECK +# undef posix_memalign +# if HAVE_RAW_DECL_POSIX_MEMALIGN +_GL_WARN_ON_USE (posix_memalign, "posix_memalign is not portable - " + "use gnulib module posix_memalign for portability"); +# endif +#endif + #if @GNULIB_POSIX_OPENPT@ /* Return an FD open to the master side of a pseudo-terminal. Flags should include O_RDWR, and may also include O_NOCTTY. */ @@ -544,6 +704,28 @@ # endif _GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (putenv, int, (char *string)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef putenv +# define putenv _putenv +# endif +_GL_CXXALIAS_MDA (putenv, int, (char *string)); +# else +_GL_CXXALIAS_SYS (putenv, int, (char *string)); +# endif +_GL_CXXALIASWARN (putenv); +#elif @GNULIB_MDA_PUTENV@ +/* On native Windows, map 'putenv' to '_putenv', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::putenv always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef putenv +# define putenv _putenv +# endif +/* Need to cast, because on mingw, the parameter is either + 'const char *string' or 'char *string'. */ +_GL_CXXALIAS_MDA_CAST (putenv, int, (char *string)); # else _GL_CXXALIAS_SYS (putenv, int, (char *string)); # endif diff -Nru datamash-1.7/lib/stdnoreturn.in.h datamash-1.8/lib/stdnoreturn.in.h --- datamash-1.7/lib/stdnoreturn.in.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/stdnoreturn.in.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* A substitute for ISO C11 . - Copyright 2012-2020 Free Software Foundation, Inc. + Copyright 2012-2021 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.7/lib/stpcpy.c datamash-1.8/lib/stpcpy.c --- datamash-1.7/lib/stpcpy.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/stpcpy.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* stpcpy.c -- copy a string and return pointer to end of new string - Copyright (C) 1992, 1995, 1997-1998, 2006, 2009-2020 Free Software + Copyright (C) 1992, 1995, 1997-1998, 2006, 2009-2021 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. diff -Nru datamash-1.7/lib/strcasecmp.c datamash-1.8/lib/strcasecmp.c --- datamash-1.7/lib/strcasecmp.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/strcasecmp.c 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,62 @@ +/* Case-insensitive string comparison function. + Copyright (C) 1998-1999, 2005-2007, 2009-2021 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 . */ + +#include + +/* Specification. */ +#include + +#include +#include + +#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch)) + +/* Compare strings S1 and S2, ignoring case, returning less than, equal to or + greater than zero if S1 is lexicographically less than, equal to or greater + than S2. + Note: This function does not work with multibyte strings! */ + +int +strcasecmp (const char *s1, const char *s2) +{ + const unsigned char *p1 = (const unsigned char *) s1; + const unsigned char *p2 = (const unsigned char *) s2; + unsigned char c1, c2; + + if (p1 == p2) + return 0; + + do + { + c1 = TOLOWER (*p1); + c2 = TOLOWER (*p2); + + if (c1 == '\0') + break; + + ++p1; + ++p2; + } + while (c1 == c2); + + if (UCHAR_MAX <= INT_MAX) + return c1 - c2; + else + /* On machines where 'char' and 'int' are types of the same size, the + difference of two 'unsigned char' values - including the sign bit - + doesn't fit in an 'int'. */ + return _GL_CMP (c1, c2); +} diff -Nru datamash-1.7/lib/strdup.c datamash-1.8/lib/strdup.c --- datamash-1.7/lib/strdup.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/strdup.c 2022-05-28 01:46:58.000000000 +0000 @@ -0,0 +1,54 @@ +/* Copyright (C) 1991, 1996-1998, 2002-2004, 2006-2007, 2009-2021 Free Software + Foundation, Inc. + + This file is part of the GNU C Library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU 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 _LIBC +# include +#endif + +/* Get specification. */ +#include + +#include + +#undef __strdup +#ifdef _LIBC +# undef strdup +#endif + +#ifndef weak_alias +# define __strdup strdup +#endif + +/* Duplicate S, returning an identical malloc'd string. */ +char * +__strdup (const char *s) +{ + size_t len = strlen (s) + 1; + void *new = malloc (len); + + if (new == NULL) + return NULL; + + return (char *) memcpy (new, s, len); +} +#ifdef libc_hidden_def +libc_hidden_def (__strdup) +#endif +#ifdef weak_alias +weak_alias (__strdup, strdup) +#endif diff -Nru datamash-1.7/lib/streq.h datamash-1.8/lib/streq.h --- datamash-1.7/lib/streq.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/streq.h 2022-05-28 01:46:58.000000000 +0000 @@ -1,5 +1,5 @@ /* Optimized string comparison. - Copyright (C) 2001-2002, 2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2007, 2009-2021 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 @@ -29,7 +29,7 @@ /* Help GCC to generate good code for string comparisons with immediate strings. */ -#if defined (__GNUC__) && defined (__OPTIMIZE__) +#if (defined __GNUC__ || defined __clang__) && defined __OPTIMIZE__ static inline int streq9 (const char *s1, const char *s2) diff -Nru datamash-1.7/lib/strerror.c datamash-1.8/lib/strerror.c --- datamash-1.7/lib/strerror.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/strerror.c 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ /* strerror.c --- POSIX compatible system error routine - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 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.7/lib/strerror-override.c datamash-1.8/lib/strerror-override.c --- datamash-1.7/lib/strerror-override.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/strerror-override.c 2022-05-28 01:46:58.000000000 +0000 @@ -1,6 +1,6 @@ /* strerror-override.c --- POSIX compatible system error routine - Copyright (C) 2010-2020 Free Software Foundation, Inc. + Copyright (C) 2010-2021 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.7/lib/strerror-override.h datamash-1.8/lib/strerror-override.h --- datamash-1.7/lib/strerror-override.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/strerror-override.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ /* strerror-override.h --- POSIX compatible system error routine - Copyright (C) 2010-2020 Free Software Foundation, Inc. + Copyright (C) 2010-2021 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.7/lib/striconv.c datamash-1.8/lib/striconv.c --- datamash-1.7/lib/striconv.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/striconv.c 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Charset conversion. - Copyright (C) 2001-2007, 2010-2020 Free Software Foundation, Inc. + Copyright (C) 2001-2007, 2010-2021 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.7/lib/striconv.h datamash-1.8/lib/striconv.h --- datamash-1.7/lib/striconv.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/striconv.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Charset conversion. - Copyright (C) 2001-2004, 2006-2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2001-2004, 2006-2007, 2009-2021 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.7/lib/string.in.h datamash-1.8/lib/string.in.h --- datamash-1.7/lib/string.in.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/string.in.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ /* A GNU-like . - Copyright (C) 1995-1996, 2001-2020 Free Software Foundation, Inc. + Copyright (C) 1995-1996, 2001-2021 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 @@ -54,10 +54,12 @@ /* The __attribute__ feature is available in gcc versions 2.5 and later. The attribute __pure__ was added in gcc 2.96. */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) -# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) -#else -# define _GL_ATTRIBUTE_PURE /* empty */ +#ifndef _GL_ATTRIBUTE_PURE +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__ +# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define _GL_ATTRIBUTE_PURE /* empty */ +# endif #endif /* NetBSD 5.0 declares strsignal in , not in . */ @@ -67,6 +69,14 @@ # include #endif +/* AIX 7.2 declares ffsl and ffsll in , not in . */ +/* But in any case avoid namespace pollution on glibc systems. */ +#if ((@GNULIB_FFSL@ || @GNULIB_FFSLL@ || defined GNULIB_POSIXCHECK) \ + && defined _AIX) \ + && ! defined __GLIBC__ +# include +#endif + /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ /* The definition of _GL_ARG_NONNULL is copied here. */ @@ -108,10 +118,18 @@ /* Find the index of the least-significant set bit. */ #if @GNULIB_FFSLL@ -# if !@HAVE_FFSLL@ +# if @REPLACE_FFSLL@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define ffsll rpl_ffsll +# endif +_GL_FUNCDECL_RPL (ffsll, int, (long long int i)); +_GL_CXXALIAS_RPL (ffsll, int, (long long int i)); +# else +# if !@HAVE_FFSLL@ _GL_FUNCDECL_SYS (ffsll, int, (long long int i)); -# endif +# endif _GL_CXXALIAS_SYS (ffsll, int, (long long int i)); +# endif _GL_CXXALIASWARN (ffsll); #elif defined GNULIB_POSIXCHECK # undef ffsll @@ -121,10 +139,30 @@ #endif +#if @GNULIB_MDA_MEMCCPY@ +/* On native Windows, map 'memccpy' to '_memccpy', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::memccpy always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef memccpy +# define memccpy _memccpy +# endif +_GL_CXXALIAS_MDA (memccpy, void *, + (void *dest, const void *src, int c, size_t n)); +# else +_GL_CXXALIAS_SYS (memccpy, void *, + (void *dest, const void *src, int c, size_t n)); +# endif +_GL_CXXALIASWARN (memccpy); +#endif + + /* Return the first instance of C within N bytes of S, or NULL. */ #if @GNULIB_MEMCHR@ # if @REPLACE_MEMCHR@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef memchr # define memchr rpl_memchr # endif _GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n) @@ -132,11 +170,6 @@ _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n)); # else -# if ! @HAVE_MEMCHR@ -_GL_FUNCDECL_SYS (memchr, void *, (void const *__s, int __c, size_t __n) - _GL_ATTRIBUTE_PURE - _GL_ARG_NONNULL ((1))); -# endif /* On some systems, this function is defined as an overloaded function: extern "C" { const void * std::memchr (const void *, int, size_t); } extern "C++" { void * std::memchr (void *, int, size_t); } */ @@ -332,9 +365,11 @@ GB18030 and the character to be searched is a digit. */ # undef strchr /* Assume strchr is always declared. */ -_GL_WARN_ON_USE (strchr, "strchr cannot work correctly on character strings " - "in some multibyte locales - " - "use mbschr if you care about internationalization"); +_GL_WARN_ON_USE_CXX (strchr, + const char *, char *, (const char *, int), + "strchr cannot work correctly on character strings " + "in some multibyte locales - " + "use mbschr if you care about internationalization"); #endif /* Find the first occurrence of C in S or the final NUL byte. */ @@ -385,6 +420,12 @@ # endif _GL_FUNCDECL_RPL (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (strdup, char *, (char const *__s)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef strdup +# define strdup _strdup +# endif +_GL_CXXALIAS_MDA (strdup, char *, (char const *__s)); # else # if defined __cplusplus && defined GNULIB_NAMESPACE && defined strdup /* strdup exists as a function and as a macro. Get rid of the macro. */ @@ -402,6 +443,23 @@ _GL_WARN_ON_USE (strdup, "strdup is unportable - " "use gnulib module strdup for portability"); # endif +#elif @GNULIB_MDA_STRDUP@ +/* On native Windows, map 'creat' to '_creat', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::creat always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef strdup +# define strdup _strdup +# endif +_GL_CXXALIAS_MDA (strdup, char *, (char const *__s)); +# else +# if defined __cplusplus && defined GNULIB_NAMESPACE && defined strdup +# undef strdup +# endif +_GL_CXXALIAS_SYS (strdup, char *, (char const *__s)); +# endif +_GL_CXXALIASWARN (strdup); #endif /* Append no more than N characters from SRC onto DEST. */ @@ -526,15 +584,19 @@ locale encoding is GB18030 and one of the characters to be searched is a digit. */ # undef strpbrk -_GL_WARN_ON_USE (strpbrk, "strpbrk cannot work correctly on character strings " - "in multibyte locales - " - "use mbspbrk if you care about internationalization"); +_GL_WARN_ON_USE_CXX (strpbrk, + const char *, char *, (const char *, const char *), + "strpbrk cannot work correctly on character strings " + "in multibyte locales - " + "use mbspbrk if you care about internationalization"); # endif #elif defined GNULIB_POSIXCHECK # undef strpbrk # if HAVE_RAW_DECL_STRPBRK -_GL_WARN_ON_USE (strpbrk, "strpbrk is unportable - " - "use gnulib module strpbrk for portability"); +_GL_WARN_ON_USE_CXX (strpbrk, + const char *, char *, (const char *, const char *), + "strpbrk is unportable - " + "use gnulib module strpbrk for portability"); # endif #endif @@ -553,9 +615,11 @@ GB18030 and the character to be searched is a digit. */ # undef strrchr /* Assume strrchr is always declared. */ -_GL_WARN_ON_USE (strrchr, "strrchr cannot work correctly on character strings " - "in some multibyte locales - " - "use mbsrchr if you care about internationalization"); +_GL_WARN_ON_USE_CXX (strrchr, + const char *, char *, (const char *, int), + "strrchr cannot work correctly on character strings " + "in some multibyte locales - " + "use mbsrchr if you care about internationalization"); #endif /* Search the next delimiter (char listed in DELIM) starting at *STRINGP. @@ -1025,6 +1089,60 @@ # endif #endif +/* Return the name of the system error code ERRNUM. */ +#if @GNULIB_STRERRORNAME_NP@ +# if @REPLACE_STRERRORNAME_NP@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef strerrorname_np +# define strerrorname_np rpl_strerrorname_np +# endif +_GL_FUNCDECL_RPL (strerrorname_np, const char *, (int errnum)); +_GL_CXXALIAS_RPL (strerrorname_np, const char *, (int errnum)); +# else +# if !@HAVE_STRERRORNAME_NP@ +_GL_FUNCDECL_SYS (strerrorname_np, const char *, (int errnum)); +# endif +_GL_CXXALIAS_SYS (strerrorname_np, const char *, (int errnum)); +# endif +_GL_CXXALIASWARN (strerrorname_np); +#elif defined GNULIB_POSIXCHECK +# undef strerrorname_np +# if HAVE_RAW_DECL_STRERRORNAME_NP +_GL_WARN_ON_USE (strerrorname_np, "strerrorname_np is unportable - " + "use gnulib module strerrorname_np for portability"); +# endif +#endif + +/* Return an abbreviation string for the signal number SIG. */ +#if @GNULIB_SIGABBREV_NP@ +# if ! @HAVE_SIGABBREV_NP@ +_GL_FUNCDECL_SYS (sigabbrev_np, const char *, (int sig)); +# endif +_GL_CXXALIAS_SYS (sigabbrev_np, const char *, (int sig)); +_GL_CXXALIASWARN (sigabbrev_np); +#elif defined GNULIB_POSIXCHECK +# undef sigabbrev_np +# if HAVE_RAW_DECL_SIGABBREV_NP +_GL_WARN_ON_USE (sigabbrev_np, "sigabbrev_np is unportable - " + "use gnulib module sigabbrev_np for portability"); +# endif +#endif + +/* Return an English description string for the signal number SIG. */ +#if @GNULIB_SIGDESCR_NP@ +# if ! @HAVE_SIGDESCR_NP@ +_GL_FUNCDECL_SYS (sigdescr_np, const char *, (int sig)); +# endif +_GL_CXXALIAS_SYS (sigdescr_np, const char *, (int sig)); +_GL_CXXALIASWARN (sigdescr_np); +#elif defined GNULIB_POSIXCHECK +# undef sigdescr_np +# if HAVE_RAW_DECL_SIGDESCR_NP +_GL_WARN_ON_USE (sigdescr_np, "sigdescr_np is unportable - " + "use gnulib module sigdescr_np for portability"); +# endif +#endif + #if @GNULIB_STRSIGNAL@ # if @REPLACE_STRSIGNAL@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) diff -Nru datamash-1.7/lib/strings.in.h datamash-1.8/lib/strings.in.h --- datamash-1.7/lib/strings.in.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/strings.in.h 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,122 @@ +/* A substitute . + + Copyright (C) 2007-2021 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@_STRINGS_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +/* Minix 3.1.8 has a bug: must be included before . + But avoid namespace pollution on glibc systems. */ +#if defined __minix && !defined __GLIBC__ +# include +#endif + +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_STRINGS_H@ +# @INCLUDE_NEXT@ @NEXT_STRINGS_H@ +#endif + +#ifndef _@GUARD_PREFIX@_STRINGS_H +#define _@GUARD_PREFIX@_STRINGS_H + +#if ! @HAVE_DECL_STRNCASECMP@ +/* Get size_t. */ +# include +#endif + + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_ARG_NONNULL is copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + +#ifdef __cplusplus +extern "C" { +#endif + + + /* Find the index of the least-significant set bit. */ +#if @GNULIB_FFS@ +# if !@HAVE_FFS@ +_GL_FUNCDECL_SYS (ffs, int, (int i)); +# endif +_GL_CXXALIAS_SYS (ffs, int, (int i)); +_GL_CXXALIASWARN (ffs); +#elif defined GNULIB_POSIXCHECK +# undef ffs +# if HAVE_RAW_DECL_FFS +_GL_WARN_ON_USE (ffs, "ffs is not portable - use the ffs module"); +# endif +#endif + +/* Compare strings S1 and S2, ignoring case, returning less than, equal to or + greater than zero if S1 is lexicographically less than, equal to or greater + than S2. + Note: This function does not work in multibyte locales. */ +#if ! @HAVE_STRCASECMP@ +extern int strcasecmp (char const *s1, char const *s2) + _GL_ARG_NONNULL ((1, 2)); +#endif +#if defined GNULIB_POSIXCHECK +/* strcasecmp() does not work with multibyte strings: + POSIX says that it operates on "strings", and "string" in POSIX is defined + as a sequence of bytes, not of characters. */ +# undef strcasecmp +# if HAVE_RAW_DECL_STRCASECMP +_GL_WARN_ON_USE (strcasecmp, "strcasecmp cannot work correctly on character " + "strings in multibyte locales - " + "use mbscasecmp if you care about " + "internationalization, or use c_strcasecmp , " + "gnulib module c-strcase) if you want a locale " + "independent function"); +# endif +#endif + +/* Compare no more than N bytes of strings S1 and S2, ignoring case, + returning less than, equal to or greater than zero if S1 is + lexicographically less than, equal to or greater than S2. + Note: This function cannot work correctly in multibyte locales. */ +#if ! @HAVE_DECL_STRNCASECMP@ +extern int strncasecmp (char const *s1, char const *s2, size_t n) + _GL_ARG_NONNULL ((1, 2)); +#endif +#if defined GNULIB_POSIXCHECK +/* strncasecmp() does not work with multibyte strings: + POSIX says that it operates on "strings", and "string" in POSIX is defined + as a sequence of bytes, not of characters. */ +# undef strncasecmp +# if HAVE_RAW_DECL_STRNCASECMP +_GL_WARN_ON_USE (strncasecmp, "strncasecmp cannot work correctly on character " + "strings in multibyte locales - " + "use mbsncasecmp or mbspcasecmp if you care about " + "internationalization, or use c_strncasecmp , " + "gnulib module c-strcase) if you want a locale " + "independent function"); +# endif +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* _@GUARD_PREFIX@_STRING_H */ +#endif /* _@GUARD_PREFIX@_STRING_H */ diff -Nru datamash-1.7/lib/stripslash.c datamash-1.8/lib/stripslash.c --- datamash-1.7/lib/stripslash.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/stripslash.c 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ /* stripslash.c -- remove redundant trailing slashes from a file name - Copyright (C) 1990, 2001, 2003-2006, 2009-2020 Free Software Foundation, + Copyright (C) 1990, 2001, 2003-2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.7/lib/str-kmp.h datamash-1.8/lib/str-kmp.h --- datamash-1.7/lib/str-kmp.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/str-kmp.h 2022-05-28 01:46:58.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-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2021 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.7/lib/strncasecmp.c datamash-1.8/lib/strncasecmp.c --- datamash-1.7/lib/strncasecmp.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/strncasecmp.c 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,62 @@ +/* strncasecmp.c -- case insensitive string comparator + Copyright (C) 1998-1999, 2005-2007, 2009-2021 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 . */ + +#include + +/* Specification. */ +#include + +#include +#include + +#define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch)) + +/* Compare no more than N bytes of strings S1 and S2, ignoring case, + returning less than, equal to or greater than zero if S1 is + lexicographically less than, equal to or greater than S2. + Note: This function cannot work correctly in multibyte locales. */ + +int +strncasecmp (const char *s1, const char *s2, size_t n) +{ + register const unsigned char *p1 = (const unsigned char *) s1; + register const unsigned char *p2 = (const unsigned char *) s2; + unsigned char c1, c2; + + if (p1 == p2 || n == 0) + return 0; + + do + { + c1 = TOLOWER (*p1); + c2 = TOLOWER (*p2); + + if (--n == 0 || c1 == '\0') + break; + + ++p1; + ++p2; + } + while (c1 == c2); + + if (UCHAR_MAX <= INT_MAX) + return c1 - c2; + else + /* On machines where 'char' and 'int' are types of the same size, the + difference of two 'unsigned char' values - including the sign bit - + doesn't fit in an 'int'. */ + return _GL_CMP (c1, c2); +} diff -Nru datamash-1.7/lib/strndup.c datamash-1.8/lib/strndup.c --- datamash-1.7/lib/strndup.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/strndup.c 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ /* A replacement function, for systems that lack strndup. - Copyright (C) 1996-1998, 2001-2003, 2005-2007, 2009-2020 Free Software + Copyright (C) 1996-1998, 2001-2003, 2005-2007, 2009-2021 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it diff -Nru datamash-1.7/lib/strnlen1.c datamash-1.8/lib/strnlen1.c --- datamash-1.7/lib/strnlen1.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/strnlen1.c 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Find the length of STRING + 1, but scan at most MAXLEN bytes. - Copyright (C) 2005-2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009-2021 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.7/lib/strnlen1.h datamash-1.8/lib/strnlen1.h --- datamash-1.7/lib/strnlen1.h 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/strnlen1.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Find the length of STRING + 1, but scan at most MAXLEN bytes. - Copyright (C) 2005, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2005, 2009-2021 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.7/lib/strnlen.c datamash-1.8/lib/strnlen.c --- datamash-1.7/lib/strnlen.c 2020-04-23 04:03:35.000000000 +0000 +++ datamash-1.8/lib/strnlen.c 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Find the length of STRING, but scan at most MAXLEN characters. - Copyright (C) 2005-2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2007, 2009-2021 Free Software Foundation, Inc. Written by Simon Josefsson. This program is free software; you can redistribute it and/or modify diff -Nru datamash-1.7/lib/strsep.c datamash-1.8/lib/strsep.c --- datamash-1.7/lib/strsep.c 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/strsep.c 2022-05-28 01:46:59.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (C) 2004, 2007, 2009-2020 Free Software Foundation, Inc. +/* Copyright (C) 2004, 2007, 2009-2021 Free Software Foundation, Inc. Written by Yoann Vandoorselaere . diff -Nru datamash-1.7/lib/strtod.c datamash-1.8/lib/strtod.c --- datamash-1.7/lib/strtod.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/strtod.c 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,486 @@ +/* Copyright (C) 1991-1992, 1997, 1999, 2003, 2006, 2008-2021 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 . */ + +#if ! defined USE_LONG_DOUBLE +# include +#endif + +/* Specification. */ +#include + +#include /* isspace() */ +#include +#include /* {DBL,LDBL}_{MIN,MAX} */ +#include /* LONG_{MIN,MAX} */ +#include /* localeconv() */ +#include /* NAN */ +#include +#include /* sprintf() */ +#include /* strdup() */ +#if HAVE_NL_LANGINFO +# include +#endif + +#include "c-ctype.h" + +#undef MIN +#undef MAX +#ifdef USE_LONG_DOUBLE +# define STRTOD strtold +# define LDEXP ldexpl +# if defined __hpux && defined __hppa + /* We cannot call strtold on HP-UX/hppa, because its return type is a struct, + not a 'long double'. */ +# define HAVE_UNDERLYING_STRTOD 0 +# elif STRTOLD_HAS_UNDERFLOW_BUG + /* strtold would not set errno=ERANGE upon underflow. */ +# define HAVE_UNDERLYING_STRTOD 0 +# else +# define HAVE_UNDERLYING_STRTOD HAVE_STRTOLD +# endif +# define DOUBLE long double +# define MIN LDBL_MIN +# define MAX LDBL_MAX +# define L_(literal) literal##L +#else +# define STRTOD strtod +# define LDEXP ldexp +# define HAVE_UNDERLYING_STRTOD 1 +# define DOUBLE double +# define MIN DBL_MIN +# define MAX DBL_MAX +# define L_(literal) literal +#endif + +#if (defined USE_LONG_DOUBLE ? HAVE_LDEXPM_IN_LIBC : HAVE_LDEXP_IN_LIBC) +# define USE_LDEXP 1 +#else +# define USE_LDEXP 0 +#endif + +/* Return true if C is a space in the current locale, avoiding + problems with signed char and isspace. */ +static bool +locale_isspace (char c) +{ + unsigned char uc = c; + return isspace (uc) != 0; +} + +/* Determine the decimal-point character according to the current locale. */ +static char +decimal_point_char (void) +{ + const char *point; + /* Determine it in a multithread-safe way. We know nl_langinfo is + multithread-safe on glibc systems and Mac OS X systems, but is not required + to be multithread-safe by POSIX. sprintf(), however, is multithread-safe. + localeconv() is rarely multithread-safe. */ +#if HAVE_NL_LANGINFO && (__GLIBC__ || defined __UCLIBC__ || (defined __APPLE__ && defined __MACH__)) + point = nl_langinfo (RADIXCHAR); +#elif 1 + char pointbuf[5]; + sprintf (pointbuf, "%#.0f", 1.0); + point = &pointbuf[1]; +#else + point = localeconv () -> decimal_point; +#endif + /* The decimal point is always a single byte: either '.' or ','. */ + return (point[0] != '\0' ? point[0] : '.'); +} + +#if !USE_LDEXP + #undef LDEXP + #define LDEXP dummy_ldexp + /* A dummy definition that will never be invoked. */ + static DOUBLE LDEXP (DOUBLE x _GL_UNUSED, int exponent _GL_UNUSED) + { + abort (); + return L_(0.0); + } +#endif + +/* Return X * BASE**EXPONENT. Return an extreme value and set errno + to ERANGE if underflow or overflow occurs. */ +static DOUBLE +scale_radix_exp (DOUBLE x, int radix, long int exponent) +{ + /* If RADIX == 10, this code is neither precise nor fast; it is + merely a straightforward and relatively portable approximation. + If N == 2, this code is precise on a radix-2 implementation, + albeit perhaps not fast if ldexp is not in libc. */ + + long int e = exponent; + + if (USE_LDEXP && radix == 2) + return LDEXP (x, e < INT_MIN ? INT_MIN : INT_MAX < e ? INT_MAX : e); + else + { + DOUBLE r = x; + + if (r != 0) + { + if (e < 0) + { + while (e++ != 0) + { + r /= radix; + if (r == 0 && x != 0) + { + errno = ERANGE; + break; + } + } + } + else + { + while (e-- != 0) + { + if (r < -MAX / radix) + { + errno = ERANGE; + return -HUGE_VAL; + } + else if (MAX / radix < r) + { + errno = ERANGE; + return HUGE_VAL; + } + else + r *= radix; + } + } + } + + return r; + } +} + +/* Parse a number at NPTR; this is a bit like strtol (NPTR, ENDPTR) + except there are no leading spaces or signs or "0x", and ENDPTR is + nonnull. The number uses a base BASE (either 10 or 16) fraction, a + radix RADIX (either 10 or 2) exponent, and exponent character + EXPCHAR. BASE is RADIX**RADIX_MULTIPLIER. */ +static DOUBLE +parse_number (const char *nptr, + int base, int radix, int radix_multiplier, char radixchar, + char expchar, + char **endptr) +{ + const char *s = nptr; + const char *digits_start; + const char *digits_end; + const char *radixchar_ptr; + long int exponent; + DOUBLE num; + + /* First, determine the start and end of the digit sequence. */ + digits_start = s; + radixchar_ptr = NULL; + for (;; ++s) + { + if (base == 16 ? c_isxdigit (*s) : c_isdigit (*s)) + ; + else if (radixchar_ptr == NULL && *s == radixchar) + { + /* Record that we have found the decimal point. */ + radixchar_ptr = s; + } + else + /* Any other character terminates the digit sequence. */ + break; + } + digits_end = s; + /* Now radixchar_ptr == NULL or + digits_start <= radixchar_ptr < digits_end. */ + + if (false) + { /* Unoptimized. */ + exponent = + (radixchar_ptr != NULL + ? - (long int) (digits_end - radixchar_ptr - 1) + : 0); + } + else + { /* Remove trailing zero digits. This reduces rounding errors for + inputs such as 1.0000000000 or 10000000000e-10. */ + while (digits_end > digits_start) + { + if (digits_end - 1 == radixchar_ptr || *(digits_end - 1) == '0') + digits_end--; + else + break; + } + exponent = + (radixchar_ptr != NULL + ? (digits_end > radixchar_ptr + ? - (long int) (digits_end - radixchar_ptr - 1) + : (long int) (radixchar_ptr - digits_end)) + : (long int) (s - digits_end)); + } + + /* Then, convert the digit sequence to a number. */ + { + const char *dp; + num = 0; + for (dp = digits_start; dp < digits_end; dp++) + if (dp != radixchar_ptr) + { + int digit; + + /* Make sure that multiplication by BASE will not overflow. */ + if (!(num <= MAX / base)) + { + /* The value of the digit and all subsequent digits don't matter, + since we have already gotten as many digits as can be + represented in a 'DOUBLE'. This doesn't necessarily mean that + the result will overflow: The exponent may reduce it to within + range. */ + exponent += + (digits_end - dp) + - (radixchar_ptr >= dp && radixchar_ptr < digits_end ? 1 : 0); + break; + } + + /* Eat the next digit. */ + if (c_isdigit (*dp)) + digit = *dp - '0'; + else if (base == 16 && c_isxdigit (*dp)) + digit = c_tolower (*dp) - ('a' - 10); + else + abort (); + num = num * base + digit; + } + } + + exponent = exponent * radix_multiplier; + + /* Finally, parse the exponent. */ + if (c_tolower (*s) == expchar && ! locale_isspace (s[1])) + { + /* Add any given exponent to the implicit one. */ + int saved_errno = errno; + char *end; + long int value = strtol (s + 1, &end, 10); + errno = saved_errno; + + if (s + 1 != end) + { + /* Skip past the exponent, and add in the implicit exponent, + resulting in an extreme value on overflow. */ + s = end; + exponent = + (exponent < 0 + ? (value < LONG_MIN - exponent ? LONG_MIN : exponent + value) + : (LONG_MAX - exponent < value ? LONG_MAX : exponent + value)); + } + } + + *endptr = (char *) s; + return scale_radix_exp (num, radix, exponent); +} + +/* 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 -MIN * MIN does not work when cross-compiling + to PowerPC on Mac OS X 10.5. */ +static DOUBLE +minus_zero (void) +{ +#if defined __hpux || defined __sgi || defined __ICC + return -MIN * MIN; +#else + return -0.0; +#endif +} + +/* Convert NPTR to a DOUBLE. If ENDPTR is not NULL, a pointer to the + character after the last one used in the number is put in *ENDPTR. */ +DOUBLE +STRTOD (const char *nptr, char **endptr) +#if HAVE_UNDERLYING_STRTOD +# ifdef USE_LONG_DOUBLE +# undef strtold +# else +# undef strtod +# endif +#else +# undef STRTOD +# define STRTOD(NPTR,ENDPTR) \ + parse_number (NPTR, 10, 10, 1, radixchar, 'e', ENDPTR) +#endif +/* From here on, STRTOD refers to the underlying implementation. It needs + to handle only finite unsigned decimal numbers with non-null ENDPTR. */ +{ + char radixchar; + bool negative = false; + + /* The number so far. */ + DOUBLE num; + + const char *s = nptr; + const char *end; + char *endbuf; + int saved_errno = errno; + + radixchar = decimal_point_char (); + + /* Eat whitespace. */ + while (locale_isspace (*s)) + ++s; + + /* Get the sign. */ + negative = *s == '-'; + if (*s == '-' || *s == '+') + ++s; + + num = STRTOD (s, &endbuf); + end = endbuf; + + if (c_isdigit (s[*s == radixchar])) + { + /* If a hex float was converted incorrectly, do it ourselves. + If the string starts with "0x" but does not contain digits, + consume the "0" ourselves. If a hex float is followed by a + 'p' but no exponent, then adjust the end pointer. */ + if (*s == '0' && c_tolower (s[1]) == 'x') + { + if (! c_isxdigit (s[2 + (s[2] == radixchar)])) + { + end = s + 1; + + /* strtod() on z/OS returns ERANGE for "0x". */ + errno = saved_errno; + } + else if (end <= s + 2) + { + num = parse_number (s + 2, 16, 2, 4, radixchar, 'p', &endbuf); + end = endbuf; + } + else + { + const char *p = s + 2; + while (p < end && c_tolower (*p) != 'p') + p++; + if (p < end && ! c_isdigit (p[1 + (p[1] == '-' || p[1] == '+')])) + { + char *dup = strdup (s); + errno = saved_errno; + if (!dup) + { + /* Not really our day, is it. Rounding errors are + better than outright failure. */ + num = + parse_number (s + 2, 16, 2, 4, radixchar, 'p', &endbuf); + } + else + { + dup[p - s] = '\0'; + num = STRTOD (dup, &endbuf); + saved_errno = errno; + free (dup); + errno = saved_errno; + } + end = p; + } + } + } + else + { + /* If "1e 1" was misparsed as 10.0 instead of 1.0, re-do the + underlying STRTOD on a copy of the original string + truncated to avoid the bug. */ + const char *e = s + 1; + while (e < end && c_tolower (*e) != 'e') + e++; + if (e < end && ! c_isdigit (e[1 + (e[1] == '-' || e[1] == '+')])) + { + char *dup = strdup (s); + errno = saved_errno; + if (!dup) + { + /* Not really our day, is it. Rounding errors are + better than outright failure. */ + num = parse_number (s, 10, 10, 1, radixchar, 'e', &endbuf); + } + else + { + dup[e - s] = '\0'; + num = STRTOD (dup, &endbuf); + saved_errno = errno; + free (dup); + errno = saved_errno; + } + end = e; + } + } + + s = end; + } + + /* Check for infinities and NaNs. */ + else if (c_tolower (*s) == 'i' + && c_tolower (s[1]) == 'n' + && c_tolower (s[2]) == 'f') + { + s += 3; + if (c_tolower (*s) == 'i' + && c_tolower (s[1]) == 'n' + && c_tolower (s[2]) == 'i' + && c_tolower (s[3]) == 't' + && c_tolower (s[4]) == 'y') + s += 5; + num = HUGE_VAL; + errno = saved_errno; + } + else if (c_tolower (*s) == 'n' + && c_tolower (s[1]) == 'a' + && c_tolower (s[2]) == 'n') + { + s += 3; + if (*s == '(') + { + const char *p = s + 1; + while (c_isalnum (*p)) + p++; + if (*p == ')') + s = p + 1; + } + + /* If the underlying implementation misparsed the NaN, assume + its result is incorrect, and return a NaN. Normally it's + better to use the underlying implementation's result, since a + nice implementation populates the bits of the NaN according + to interpreting n-char-sequence as a hexadecimal number. */ + if (s != end || num == num) + num = NAN; + errno = saved_errno; + } + else + { + /* No conversion could be performed. */ + errno = EINVAL; + s = nptr; + } + + if (endptr != NULL) + *endptr = (char *) s; + /* Special case -0.0, since at least ICC miscompiles negation. We + can't use copysign(), as that drags in -lm on some platforms. */ + if (!num && negative) + return minus_zero (); + return negative ? -num : num; +} diff -Nru datamash-1.7/lib/strtoimax.c datamash-1.8/lib/strtoimax.c --- datamash-1.7/lib/strtoimax.c 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/strtoimax.c 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ /* Convert string representation of a number into an intmax_t value. - Copyright (C) 1999, 2001-2004, 2006, 2009-2020 Free Software Foundation, + Copyright (C) 1999, 2001-2004, 2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.7/lib/strtol.c datamash-1.8/lib/strtol.c --- datamash-1.7/lib/strtol.c 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/strtol.c 2022-05-28 01:46:59.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-2020 Free Software + Copyright (C) 1991-1992, 1994-1999, 2003, 2005-2007, 2009-2021 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C diff -Nru datamash-1.7/lib/strtold.c datamash-1.8/lib/strtold.c --- datamash-1.7/lib/strtold.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/strtold.c 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,37 @@ +/* Convert string to 'long double'. + Copyright (C) 2019-2021 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 , 2019. */ + +#include + +#if HAVE_SAME_LONG_DOUBLE_AS_DOUBLE + +/* Specification. */ +# include + +long double +strtold (const char *str, char **endp) +{ + return strtod (str, endp); +} + +#else + +# define USE_LONG_DOUBLE +# include "strtod.c" + +#endif diff -Nru datamash-1.7/lib/strtoll.c datamash-1.8/lib/strtoll.c --- datamash-1.7/lib/strtoll.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/strtoll.c 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,33 @@ +/* Function to parse a 'long long int' from text. + Copyright (C) 1995-1997, 1999, 2001, 2009-2021 Free Software Foundation, + Inc. + This file is part of the GNU C Library. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU 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 . */ + +#define QUAD 1 + +#include + +#ifdef _LIBC +# ifdef SHARED +# include + +# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_2) +compat_symbol (libc, __strtoll_internal, __strtoq_internal, GLIBC_2_0); +# endif + +# endif +weak_alias (strtoll, strtoq) +#endif diff -Nru datamash-1.7/lib/strtoul.c datamash-1.8/lib/strtoul.c --- datamash-1.7/lib/strtoul.c 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/strtoul.c 2022-05-28 01:46:59.000000000 +0000 @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1997, 2009-2020 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1997, 2009-2021 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.7/lib/strtoull.c datamash-1.8/lib/strtoull.c --- datamash-1.7/lib/strtoull.c 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/strtoull.c 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Function to parse an 'unsigned long long int' from text. - Copyright (C) 1995-1997, 1999, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 1995-1997, 1999, 2009-2021 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.7/lib/sys-limits.h datamash-1.8/lib/sys-limits.h --- datamash-1.7/lib/sys-limits.h 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/sys-limits.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ /* System call limits - Copyright 2018-2020 Free Software Foundation, Inc. + Copyright 2018-2021 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.7/lib/sys_socket.in.h datamash-1.8/lib/sys_socket.in.h --- datamash-1.7/lib/sys_socket.in.h 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/sys_socket.in.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ /* Provide a sys/socket header file for systems lacking it (read: MinGW) and for systems where it is incomplete. - Copyright (C) 2005-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2021 Free Software Foundation, Inc. Written by Simon Josefsson. This program is free software; you can redistribute it and/or modify @@ -195,12 +195,7 @@ /* Include headers needed by the emulation code. */ # include # include - -# if !GNULIB_defined_socklen_t -typedef int socklen_t; -# define GNULIB_defined_socklen_t 1 -# endif - +/* If these headers don't define socklen_t, does. */ # endif /* Rudimentary 'struct msghdr'; this works as long as you don't try to @@ -261,7 +256,7 @@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef close # define close close_used_without_including_unistd_h -# else +# elif !defined __clang__ _GL_WARN_ON_USE (close, "close() used without including "); # endif diff -Nru datamash-1.7/lib/sys_stat.in.h datamash-1.8/lib/sys_stat.in.h --- datamash-1.7/lib/sys_stat.in.h 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/sys_stat.in.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Provide a more complete sys/stat.h header file. - Copyright (C) 2005-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2021 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 @@ -375,11 +375,11 @@ # define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH) #endif -/* S_IXUGO is a common extension to POSIX. */ +/* Although S_IXUGO and S_IRWXUGO are not specified by POSIX and are + not implemented in GNU/Linux, some Gnulib-using apps use the macros. */ #if !S_IXUGO # define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) #endif - #ifndef S_IRWXUGO # define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO) #endif @@ -391,6 +391,24 @@ #endif +#if @GNULIB_MDA_CHMOD@ +/* On native Windows, map 'chmod' to '_chmod', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::chmod always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef chmod +# define chmod _chmod +# endif +/* Need to cast, because in mingw the last argument is 'int mode'. */ +_GL_CXXALIAS_MDA_CAST (chmod, int, (const char *filename, mode_t mode)); +# else +_GL_CXXALIAS_SYS (chmod, int, (const char *filename, mode_t mode)); +# endif +_GL_CXXALIASWARN (chmod); +#endif + + #if @GNULIB_FCHMODAT@ # if @REPLACE_FCHMODAT@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -432,7 +450,9 @@ # else _GL_CXXALIAS_SYS (fstat, int, (int fd, struct stat *buf)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (fstat); +# endif #elif @GNULIB_OVERRIDES_STRUCT_STAT@ # undef fstat # define fstat fstat_used_without_requesting_gnulib_module_fstat @@ -515,6 +535,23 @@ #endif +#if @GNULIB_GETUMASK@ +# if !@HAVE_GETUMASK@ +_GL_FUNCDECL_SYS (getumask, mode_t, (void)); +# endif +_GL_CXXALIAS_SYS (getumask, mode_t, (void)); +# if @HAVE_GETUMASK@ +_GL_CXXALIASWARN (getumask); +# endif +#elif defined GNULIB_POSIXCHECK +# undef getumask +# if HAVE_RAW_DECL_GETUMASK +_GL_WARN_ON_USE (getumask, "getumask is not portable - " + "use gnulib module getumask for portability"); +# endif +#endif + + #if @GNULIB_LCHMOD@ /* Change the mode of FILENAME to MODE, without dereferencing it if FILENAME denotes a symbolic link. */ @@ -571,21 +608,20 @@ #endif -#if @REPLACE_MKDIR@ -# if !(defined __cplusplus && defined GNULIB_NAMESPACE) -# undef mkdir -# define mkdir rpl_mkdir -# endif +#if @GNULIB_MKDIR@ +# if @REPLACE_MKDIR@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef mkdir +# define mkdir rpl_mkdir +# endif _GL_FUNCDECL_RPL (mkdir, int, (char const *name, mode_t mode) - _GL_ARG_NONNULL ((1))); + _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode)); -#else +# elif defined _WIN32 && !defined __CYGWIN__ /* mingw's _mkdir() function has 1 argument, but we pass 2 arguments. Additionally, it declares _mkdir (and depending on compile flags, an alias mkdir), only in the nonstandard includes and , which are included above. */ -# if defined _WIN32 && ! defined __CYGWIN__ - # if !GNULIB_defined_rpl_mkdir static int rpl_mkdir (char const *name, mode_t mode) @@ -594,16 +630,44 @@ } # define GNULIB_defined_rpl_mkdir 1 # endif - # if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef mkdir +# define mkdir rpl_mkdir +# endif +_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode)); +# else +_GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode)); +# endif +_GL_CXXALIASWARN (mkdir); +#elif defined GNULIB_POSIXCHECK +# undef mkdir +# if HAVE_RAW_DECL_MKDIR +_GL_WARN_ON_USE (mkdir, "mkdir does not always support two parameters - " + "use gnulib module mkdir for portability"); +# endif +#elif @GNULIB_MDA_MKDIR@ +/* On native Windows, map 'mkdir' to '_mkdir', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::mkdir always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !GNULIB_defined_rpl_mkdir +static int +rpl_mkdir (char const *name, mode_t mode) +{ + return _mkdir (name); +} +# define GNULIB_defined_rpl_mkdir 1 +# endif +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef mkdir # define mkdir rpl_mkdir # endif _GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode)); # else _GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode)); # endif -#endif _GL_CXXALIASWARN (mkdir); +#endif #if @GNULIB_MKDIRAT@ @@ -649,11 +713,21 @@ #if @GNULIB_MKFIFOAT@ -# if !@HAVE_MKFIFOAT@ +# if @REPLACE_MKFIFOAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef mkfifoat +# define mkfifoat rpl_mkfifoat +# endif +_GL_FUNCDECL_RPL (mkfifoat, int, (int fd, char const *file, mode_t mode) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (mkfifoat, int, (int fd, char const *file, mode_t mode)); +# else +# if !@HAVE_MKFIFOAT@ _GL_FUNCDECL_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode) _GL_ARG_NONNULL ((2))); -# endif +# endif _GL_CXXALIAS_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode)); +# endif _GL_CXXALIASWARN (mkfifoat); #elif defined GNULIB_POSIXCHECK # undef mkfifoat @@ -692,13 +766,25 @@ #if @GNULIB_MKNODAT@ -# if !@HAVE_MKNODAT@ +# if @REPLACE_MKNODAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef mknodat +# define mknodat rpl_mknodat +# endif +_GL_FUNCDECL_RPL (mknodat, int, + (int fd, char const *file, mode_t mode, dev_t dev) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (mknodat, int, + (int fd, char const *file, mode_t mode, dev_t dev)); +# else +# if !@HAVE_MKNODAT@ _GL_FUNCDECL_SYS (mknodat, int, (int fd, char const *file, mode_t mode, dev_t dev) _GL_ARG_NONNULL ((2))); -# endif +# endif _GL_CXXALIAS_SYS (mknodat, int, (int fd, char const *file, mode_t mode, dev_t dev)); +# endif _GL_CXXALIASWARN (mknodat); #elif defined GNULIB_POSIXCHECK # undef mknodat @@ -783,6 +869,24 @@ #endif +#if @GNULIB_MDA_UMASK@ +/* On native Windows, map 'umask' to '_umask', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::umask always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef umask +# define umask _umask +# endif +/* Need to cast, because in mingw the last argument is 'int mode'. */ +_GL_CXXALIAS_MDA_CAST (umask, mode_t, (mode_t mask)); +# else +_GL_CXXALIAS_SYS (umask, mode_t, (mode_t mask)); +# endif +_GL_CXXALIASWARN (umask); +#endif + + #if @GNULIB_UTIMENSAT@ /* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our utimensat implementation relies on futimesat, which on Solaris 10 makes an invocation diff -Nru datamash-1.7/lib/sys_types.in.h datamash-1.8/lib/sys_types.in.h --- datamash-1.7/lib/sys_types.in.h 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/sys_types.in.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ /* Provide a more complete sys/types.h. - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 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.7/lib/sys_uio.in.h datamash-1.8/lib/sys_uio.in.h --- datamash-1.7/lib/sys_uio.in.h 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/sys_uio.in.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Substitute for . - Copyright (C) 2011-2020 Free Software Foundation, Inc. + Copyright (C) 2011-2021 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.7/lib/sys_wait.in.h datamash-1.8/lib/sys_wait.in.h --- datamash-1.7/lib/sys_wait.in.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/sys_wait.in.h 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,131 @@ +/* A POSIX-like . + Copyright (C) 2001-2003, 2005-2021 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@_SYS_WAIT_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +/* The include_next requires a split double-inclusion guard. */ +#if !(defined _WIN32 && ! defined __CYGWIN__) +# @INCLUDE_NEXT@ @NEXT_SYS_WAIT_H@ +#endif + +#ifndef _@GUARD_PREFIX@_SYS_WAIT_H +#define _@GUARD_PREFIX@_SYS_WAIT_H + +/* Get pid_t. */ +#include + + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + + +#if !(defined _WIN32 && ! defined __CYGWIN__) +/* Unix API. */ + +/* The following macros apply to an argument x, that is a status of a process, + as returned by waitpid(). + On nearly all systems, including Linux/x86, WEXITSTATUS are bits 15..8 and + WTERMSIG are bits 7..0, while BeOS uses the opposite. Therefore programs + have to use the abstract macros. */ + +/* For valid x, exactly one of WIFSIGNALED(x), WIFEXITED(x), WIFSTOPPED(x) + is true. */ +# ifndef WIFSIGNALED +# define WIFSIGNALED(x) (WTERMSIG (x) != 0 && WTERMSIG(x) != 0x7f) +# endif +# ifndef WIFEXITED +# define WIFEXITED(x) (WTERMSIG (x) == 0) +# endif +# ifndef WIFSTOPPED +# define WIFSTOPPED(x) (WTERMSIG (x) == 0x7f) +# endif + +/* The termination signal. Only to be accessed if WIFSIGNALED(x) is true. */ +# ifndef WTERMSIG +# define WTERMSIG(x) ((x) & 0x7f) +# endif + +/* The exit status. Only to be accessed if WIFEXITED(x) is true. */ +# ifndef WEXITSTATUS +# define WEXITSTATUS(x) (((x) >> 8) & 0xff) +# endif + +/* The stopping signal. Only to be accessed if WIFSTOPPED(x) is true. */ +# ifndef WSTOPSIG +# define WSTOPSIG(x) (((x) >> 8) & 0x7f) +# endif + +/* True if the process dumped core. Not standardized by POSIX. */ +# ifndef WCOREDUMP +# define WCOREDUMP(x) ((x) & 0x80) +# endif + +#else +/* Native Windows API. */ + +# include /* for SIGTERM */ + +/* The following macros apply to an argument x, that is a status of a process, + as returned by waitpid() or, equivalently, _cwait() or GetExitCodeProcess(). + This value is simply an 'int', not composed of bit fields. */ + +/* When an unhandled fatal signal terminates a process, the exit code is 3. */ +# define WIFSIGNALED(x) ((x) == 3) +# define WIFEXITED(x) ((x) != 3) +# define WIFSTOPPED(x) 0 + +/* The signal that terminated a process is not known posthum. */ +# define WTERMSIG(x) SIGTERM + +# define WEXITSTATUS(x) (x) + +/* There are no stopping signals. */ +# define WSTOPSIG(x) 0 + +/* There are no core dumps. */ +# define WCOREDUMP(x) 0 + +#endif + + +/* Declarations of functions. */ + +#if @GNULIB_WAITPID@ +# if defined _WIN32 && ! defined __CYGWIN__ +_GL_FUNCDECL_SYS (waitpid, pid_t, (pid_t pid, int *statusp, int options)); +# endif +/* Need to cast, because on Cygwin, the second parameter is + __wait_status_ptr_t statusp. */ +_GL_CXXALIAS_SYS_CAST (waitpid, pid_t, (pid_t pid, int *statusp, int options)); +_GL_CXXALIASWARN (waitpid); +#elif defined GNULIB_POSIXCHECK +# undef waitpid +# if HAVE_RAW_DECL_WAITPID +_GL_WARN_ON_USE (waitpid, "waitpid is unportable - " + "use gnulib module sys_wait for portability"); +# endif +#endif + + +#endif /* _@GUARD_PREFIX@_SYS_WAIT_H */ +#endif /* _@GUARD_PREFIX@_SYS_WAIT_H */ diff -Nru datamash-1.7/lib/thread-optim.h datamash-1.8/lib/thread-optim.h --- datamash-1.7/lib/thread-optim.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/thread-optim.h 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,60 @@ +/* Optimization of multithreaded code. + + Copyright (C) 2020-2021 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 , 2020. */ + +#ifndef _THREAD_OPTIM_H +#define _THREAD_OPTIM_H + +/* This file defines a way to optimize multithreaded code for the single-thread + case, based on the variable '__libc_single_threaded', defined in + glibc >= 2.32. */ + +/* Typical use: In a block or function, use + + bool mt = gl_multithreaded (); + ... + if (mt) + if (pthread_mutex_lock (&lock)) abort (); + ... + if (mt) + if (pthread_mutex_unlock (&lock)) abort (); + + The gl_multithreaded () invocation determines whether the program currently + is multithreaded. + + if (mt) STATEMENT executes STATEMENT in the multithreaded case, and skips + it in the single-threaded case. + + The code between the gl_multithreaded () invocation and any use of the + variable 'mt' must not create threads or invoke functions that may + indirectly create threads (e.g. 'dlopen' may, indirectly through C++ + initializers of global variables in the shared library being opened, + create threads). + + The lock here is meant to synchronize threads in the same process. The + same optimization cannot be applied to locks that synchronize different + processes (e.g. through shared memory mappings). */ + +#if HAVE_SYS_SINGLE_THREADED_H /* glibc >= 2.32 */ +# include +# define gl_multithreaded() !__libc_single_threaded +#else +# define gl_multithreaded() 1 +#endif + +#endif /* _THREAD_OPTIM_H */ diff -Nru datamash-1.7/lib/time.in.h datamash-1.8/lib/time.in.h --- datamash-1.7/lib/time.in.h 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/time.in.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ /* A more-standard . - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 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,6 +101,25 @@ # define GNULIB_defined_struct_time_t_must_be_integral 1 # endif +/* Define TIME_UTC, a positive integer constant used for timespec_get(). */ +# if ! @TIME_H_DEFINES_TIME_UTC@ +# if !GNULIB_defined_TIME_UTC +# define TIME_UTC 1 +# define GNULIB_defined_TIME_UTC 1 +# endif +# endif + +/* Set *TS to the current time, and return BASE. + Upon failure, return 0. */ +# if @GNULIB_TIMESPEC_GET@ +# if ! @HAVE_TIMESPEC_GET@ +_GL_FUNCDECL_SYS (timespec_get, int, (struct timespec *ts, int base) + _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIAS_SYS (timespec_get, int, (struct timespec *ts, int base)); +_GL_CXXALIASWARN (timespec_get); +# endif + /* Sleep for at least RQTP seconds unless interrupted, If interrupted, return -1 and store the remaining time into RMTP. See . */ @@ -135,10 +154,27 @@ # endif _GL_FUNCDECL_RPL (tzset, void, (void)); _GL_CXXALIAS_RPL (tzset, void, (void)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef tzset +# define tzset _tzset +# endif +_GL_CXXALIAS_MDA (tzset, void, (void)); # else -# if ! @HAVE_TZSET@ -_GL_FUNCDECL_SYS (tzset, void, (void)); +_GL_CXXALIAS_SYS (tzset, void, (void)); +# endif +_GL_CXXALIASWARN (tzset); +# elif @GNULIB_MDA_TZSET@ +/* On native Windows, map 'tzset' to '_tzset', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::tzset always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef tzset +# define tzset _tzset # endif +_GL_CXXALIAS_MDA (tzset, void, (void)); +# else _GL_CXXALIAS_SYS (tzset, void, (void)); # endif _GL_CXXALIASWARN (tzset); @@ -350,17 +386,17 @@ # endif # if defined GNULIB_POSIXCHECK # undef asctime_r -_GL_WARN_ON_USE (asctime, "asctime_r can overrun buffers in some cases - " +_GL_WARN_ON_USE (asctime_r, "asctime_r can overrun buffers in some cases - " "better use strftime (or even sprintf) instead"); # endif # if defined GNULIB_POSIXCHECK # undef ctime -_GL_WARN_ON_USE (asctime, "ctime can overrun buffers in some cases - " +_GL_WARN_ON_USE (ctime, "ctime can overrun buffers in some cases - " "better use strftime (or even sprintf) instead"); # endif # if defined GNULIB_POSIXCHECK # undef ctime_r -_GL_WARN_ON_USE (asctime, "ctime_r can overrun buffers in some cases - " +_GL_WARN_ON_USE (ctime_r, "ctime_r can overrun buffers in some cases - " "better use strftime (or even sprintf) instead"); # endif diff -Nru datamash-1.7/lib/trim.c datamash-1.8/lib/trim.c --- datamash-1.7/lib/trim.c 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/trim.c 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Removes leading and/or trailing whitespaces - Copyright (C) 2006-2020 Free Software Foundation, Inc. + Copyright (C) 2006-2021 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.7/lib/trim.h datamash-1.8/lib/trim.h --- datamash-1.7/lib/trim.h 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/trim.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Removes leading and/or trailing whitespaces - Copyright (C) 2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2006, 2009-2021 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.7/lib/trunc.c datamash-1.8/lib/trunc.c --- datamash-1.7/lib/trunc.c 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/trunc.c 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Round towards zero. - Copyright (C) 2007, 2010-2020 Free Software Foundation, Inc. + Copyright (C) 2007, 2010-2021 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 @@ -56,7 +56,7 @@ /* MSVC with option -fp:strict refuses to compile constant initializers that contain floating-point operations. Pacify this compiler. */ -#ifdef _MSC_VER +#if defined _MSC_VER && !defined __clang__ # pragma fenv_access (off) #endif diff -Nru datamash-1.7/lib/truncl.c datamash-1.8/lib/truncl.c --- datamash-1.7/lib/truncl.c 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/truncl.c 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Round towards zero. - Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2007, 2009-2021 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.7/lib/u64.h datamash-1.8/lib/u64.h --- datamash-1.7/lib/u64.h 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/u64.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ /* uint64_t-like operations that work even on hosts lacking uint64_t - Copyright (C) 2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2006, 2009-2021 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.7/lib/unistd.in.h datamash-1.8/lib/unistd.in.h --- datamash-1.7/lib/unistd.in.h 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/unistd.in.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Substitute for and wrapper around . - Copyright (C) 2003-2020 Free Software Foundation, Inc. + Copyright (C) 2003-2021 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,20 +93,18 @@ # undef __need_system_stdlib_h #endif -/* Native Windows platforms declare chdir, getcwd, rmdir in +/* Native Windows platforms declare _chdir, _getcwd, _rmdir in and/or , not in . - They also declare access(), chmod(), close(), dup(), dup2(), isatty(), - lseek(), read(), unlink(), write() in . */ -#if ((@GNULIB_CHDIR@ || @GNULIB_GETCWD@ || @GNULIB_RMDIR@ \ - || defined GNULIB_POSIXCHECK) \ - && (defined _WIN32 && ! defined __CYGWIN__)) -# include /* mingw32, mingw64 */ -# include /* mingw64, MSVC 9 */ -#elif (@GNULIB_CLOSE@ || @GNULIB_DUP@ || @GNULIB_DUP2@ || @GNULIB_ISATTY@ \ - || @GNULIB_LSEEK@ || @GNULIB_READ@ || @GNULIB_UNLINK@ || @GNULIB_WRITE@ \ - || defined GNULIB_POSIXCHECK) \ - && (defined _WIN32 && ! defined __CYGWIN__) + They also declare _access(), _chmod(), _close(), _dup(), _dup2(), _isatty(), + _lseek(), _read(), _unlink(), _write() in . */ +#if defined _WIN32 && !defined __CYGWIN__ # include +# include +#endif + +/* Native Windows platforms declare _execl*, _execv* in . */ +#if defined _WIN32 && !defined __CYGWIN__ +# include #endif /* AIX and OSF/1 5.1 declare getdomainname in , not in . @@ -118,6 +116,17 @@ # include #endif +/* Mac OS X 10.13, Solaris 11.4, and Android 9.0 declare getentropy in + , not in . */ +/* But avoid namespace pollution on glibc systems. */ +#if (@GNULIB_GETENTROPY@ || defined GNULIB_POSIXCHECK) \ + && ((defined __APPLE__ && defined __MACH__) || defined __sun \ + || defined __ANDROID__) \ + && @UNISTD_H_HAVE_SYS_RANDOM_H@ \ + && !defined __GLIBC__ +# include +#endif + /* Android 4.3 declares fchownat in , not in . */ /* But avoid namespace pollution on glibc systems. */ #if (@GNULIB_FCHOWNAT@ || defined GNULIB_POSIXCHECK) && defined __ANDROID__ \ @@ -127,11 +136,8 @@ /* MSVC defines off_t in . May also define off_t to a 64-bit type on native Windows. */ -/* But avoid namespace pollution on glibc systems. */ -#ifndef __GLIBC__ -/* Get off_t, ssize_t. */ -# include -#endif +/* Get off_t, ssize_t, mode_t. */ +#include /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ @@ -262,6 +268,12 @@ _GL_FUNCDECL_RPL (access, int, (const char *file, int mode) _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (access, int, (const char *file, int mode)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef access +# define access _access +# endif +_GL_CXXALIAS_MDA (access, int, (const char *file, int mode)); # else _GL_CXXALIAS_SYS (access, int, (const char *file, int mode)); # endif @@ -275,11 +287,33 @@ "also, this function is a security risk - " "use the gnulib module faccessat instead"); # endif +#elif @GNULIB_MDA_ACCESS@ +/* On native Windows, map 'access' to '_access', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::access always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef access +# define access _access +# endif +_GL_CXXALIAS_MDA (access, int, (const char *file, int mode)); +# else +_GL_CXXALIAS_SYS (access, int, (const char *file, int mode)); +# endif +_GL_CXXALIASWARN (access); #endif #if @GNULIB_CHDIR@ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef chdir +# define chdir _chdir +# endif +_GL_CXXALIAS_MDA (chdir, int, (const char *file)); +# else _GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1))); +# endif _GL_CXXALIASWARN (chdir); #elif defined GNULIB_POSIXCHECK # undef chdir @@ -287,6 +321,20 @@ _GL_WARN_ON_USE (chown, "chdir is not always in - " "use gnulib module chdir for portability"); # endif +#elif @GNULIB_MDA_CHDIR@ +/* On native Windows, map 'chdir' to '_chdir', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::chdir always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef chdir +# define chdir _chdir +# endif +_GL_CXXALIAS_MDA (chdir, int, (const char *file)); +# else +_GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1))); +# endif +_GL_CXXALIASWARN (chdir); #endif @@ -331,6 +379,12 @@ # endif _GL_FUNCDECL_RPL (close, int, (int fd)); _GL_CXXALIAS_RPL (close, int, (int fd)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef close +# define close _close +# endif +_GL_CXXALIAS_MDA (close, int, (int fd)); # else _GL_CXXALIAS_SYS (close, int, (int fd)); # endif @@ -343,6 +397,20 @@ /* Assume close is always declared. */ _GL_WARN_ON_USE (close, "close does not portably work on sockets - " "use gnulib module close for portability"); +#elif @GNULIB_MDA_CLOSE@ +/* On native Windows, map 'close' to '_close', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::close always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef close +# define close _close +# endif +_GL_CXXALIAS_MDA (close, int, (int fd)); +# else +_GL_CXXALIAS_SYS (close, int, (int fd)); +# endif +_GL_CXXALIASWARN (close); #endif @@ -357,10 +425,11 @@ # endif _GL_CXXALIASWARN (copy_file_range); #elif defined GNULIB_POSIXCHECK -/* Assume copy_file_range is always declared. */ +# if HAVE_RAW_DECL_COPY_FILE_RANGE _GL_WARN_ON_USE (copy_file_range, "copy_file_range is unportable - " "use gnulib module copy_file_range for portability"); +# endif #endif @@ -371,6 +440,12 @@ # endif _GL_FUNCDECL_RPL (dup, int, (int oldfd)); _GL_CXXALIAS_RPL (dup, int, (int oldfd)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef dup +# define dup _dup +# endif +_GL_CXXALIAS_MDA (dup, int, (int oldfd)); # else _GL_CXXALIAS_SYS (dup, int, (int oldfd)); # endif @@ -381,6 +456,20 @@ _GL_WARN_ON_USE (dup, "dup is unportable - " "use gnulib module dup for portability"); # endif +#elif @GNULIB_MDA_DUP@ +/* On native Windows, map 'dup' to '_dup', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::dup always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef dup +# define dup _dup +# endif +_GL_CXXALIAS_MDA (dup, int, (int oldfd)); +# else +_GL_CXXALIAS_SYS (dup, int, (int oldfd)); +# endif +_GL_CXXALIASWARN (dup); #endif @@ -396,10 +485,13 @@ # endif _GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd)); _GL_CXXALIAS_RPL (dup2, int, (int oldfd, int newfd)); -# else -# if !@HAVE_DUP2@ -_GL_FUNCDECL_SYS (dup2, int, (int oldfd, int newfd)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef dup2 +# define dup2 _dup2 # endif +_GL_CXXALIAS_MDA (dup2, int, (int oldfd, int newfd)); +# else _GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd)); # endif _GL_CXXALIASWARN (dup2); @@ -409,6 +501,20 @@ _GL_WARN_ON_USE (dup2, "dup2 is unportable - " "use gnulib module dup2 for portability"); # endif +#elif @GNULIB_MDA_DUP2@ +/* On native Windows, map 'dup2' to '_dup2', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::dup2 always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef dup2 +# define dup2 _dup2 +# endif +_GL_CXXALIAS_MDA (dup2, int, (int oldfd, int newfd)); +# else +_GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd)); +# endif +_GL_CXXALIASWARN (dup2); #endif @@ -509,6 +615,282 @@ #endif +#if @GNULIB_EXECL@ +# if @REPLACE_EXECL@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execl +# define execl rpl_execl +# endif +_GL_FUNCDECL_RPL (execl, int, (const char *program, const char *arg, ...) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (execl, int, (const char *program, const char *arg, ...)); +# else +_GL_CXXALIAS_SYS (execl, int, (const char *program, const char *arg, ...)); +# endif +_GL_CXXALIASWARN (execl); +#elif defined GNULIB_POSIXCHECK +# undef execl +# if HAVE_RAW_DECL_EXECL +_GL_WARN_ON_USE (execl, "execl behaves very differently on mingw - " + "use gnulib module execl for portability"); +# endif +#elif @GNULIB_MDA_EXECL@ +/* On native Windows, map 'execl' to '_execl', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::execl always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execl +# define execl _execl +# endif +_GL_CXXALIAS_MDA (execl, intptr_t, (const char *program, const char *arg, ...)); +# else +_GL_CXXALIAS_SYS (execl, int, (const char *program, const char *arg, ...)); +# endif +_GL_CXXALIASWARN (execl); +#endif + +#if @GNULIB_EXECLE@ +# if @REPLACE_EXECLE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execle +# define execle rpl_execle +# endif +_GL_FUNCDECL_RPL (execle, int, (const char *program, const char *arg, ...) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (execle, int, (const char *program, const char *arg, ...)); +# else +_GL_CXXALIAS_SYS (execle, int, (const char *program, const char *arg, ...)); +# endif +_GL_CXXALIASWARN (execle); +#elif defined GNULIB_POSIXCHECK +# undef execle +# if HAVE_RAW_DECL_EXECLE +_GL_WARN_ON_USE (execle, "execle behaves very differently on mingw - " + "use gnulib module execle for portability"); +# endif +#elif @GNULIB_MDA_EXECLE@ +/* On native Windows, map 'execle' to '_execle', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::execle always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execle +# define execle _execle +# endif +_GL_CXXALIAS_MDA (execle, intptr_t, + (const char *program, const char *arg, ...)); +# else +_GL_CXXALIAS_SYS (execle, int, (const char *program, const char *arg, ...)); +# endif +_GL_CXXALIASWARN (execle); +#endif + +#if @GNULIB_EXECLP@ +# if @REPLACE_EXECLP@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execlp +# define execlp rpl_execlp +# endif +_GL_FUNCDECL_RPL (execlp, int, (const char *program, const char *arg, ...) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (execlp, int, (const char *program, const char *arg, ...)); +# else +_GL_CXXALIAS_SYS (execlp, int, (const char *program, const char *arg, ...)); +# endif +_GL_CXXALIASWARN (execlp); +#elif defined GNULIB_POSIXCHECK +# undef execlp +# if HAVE_RAW_DECL_EXECLP +_GL_WARN_ON_USE (execlp, "execlp behaves very differently on mingw - " + "use gnulib module execlp for portability"); +# endif +#elif @GNULIB_MDA_EXECLP@ +/* On native Windows, map 'execlp' to '_execlp', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::execlp always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execlp +# define execlp _execlp +# endif +_GL_CXXALIAS_MDA (execlp, intptr_t, + (const char *program, const char *arg, ...)); +# else +_GL_CXXALIAS_SYS (execlp, int, (const char *program, const char *arg, ...)); +# endif +_GL_CXXALIASWARN (execlp); +#endif + + +#if @GNULIB_EXECV@ +# if @REPLACE_EXECV@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execv +# define execv rpl_execv +# endif +_GL_FUNCDECL_RPL (execv, int, (const char *program, char * const *argv) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (execv, int, (const char *program, char * const *argv)); +# else +_GL_CXXALIAS_SYS (execv, int, (const char *program, char * const *argv)); +# endif +_GL_CXXALIASWARN (execv); +#elif defined GNULIB_POSIXCHECK +# undef execv +# if HAVE_RAW_DECL_EXECV +_GL_WARN_ON_USE (execv, "execv behaves very differently on mingw - " + "use gnulib module execv for portability"); +# endif +#elif @GNULIB_MDA_EXECV@ +/* On native Windows, map 'execv' to '_execv', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::execv always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execv +# define execv _execv +# endif +_GL_CXXALIAS_MDA_CAST (execv, intptr_t, + (const char *program, char * const *argv)); +# else +_GL_CXXALIAS_SYS (execv, int, (const char *program, char * const *argv)); +# endif +_GL_CXXALIASWARN (execv); +#endif + +#if @GNULIB_EXECVE@ +# if @REPLACE_EXECVE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execve +# define execve rpl_execve +# endif +_GL_FUNCDECL_RPL (execve, int, + (const char *program, char * const *argv, char * const *env) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (execve, int, + (const char *program, char * const *argv, char * const *env)); +# else +_GL_CXXALIAS_SYS (execve, int, + (const char *program, char * const *argv, char * const *env)); +# endif +_GL_CXXALIASWARN (execve); +#elif defined GNULIB_POSIXCHECK +# undef execve +# if HAVE_RAW_DECL_EXECVE +_GL_WARN_ON_USE (execve, "execve behaves very differently on mingw - " + "use gnulib module execve for portability"); +# endif +#elif @GNULIB_MDA_EXECVE@ +/* On native Windows, map 'execve' to '_execve', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::execve always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execve +# define execve _execve +# endif +_GL_CXXALIAS_MDA_CAST (execve, intptr_t, + (const char *program, char * const *argv, + char * const *env)); +# else +_GL_CXXALIAS_SYS (execve, int, + (const char *program, char * const *argv, char * const *env)); +# endif +_GL_CXXALIASWARN (execve); +#endif + +#if @GNULIB_EXECVP@ +# if @REPLACE_EXECVP@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execvp +# define execvp rpl_execvp +# endif +_GL_FUNCDECL_RPL (execvp, int, (const char *program, char * const *argv) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (execvp, int, (const char *program, char * const *argv)); +# else +_GL_CXXALIAS_SYS (execvp, int, (const char *program, char * const *argv)); +# endif +_GL_CXXALIASWARN (execvp); +#elif defined GNULIB_POSIXCHECK +# undef execvp +# if HAVE_RAW_DECL_EXECVP +_GL_WARN_ON_USE (execvp, "execvp behaves very differently on mingw - " + "use gnulib module execvp for portability"); +# endif +#elif @GNULIB_MDA_EXECVP@ +/* On native Windows, map 'execvp' to '_execvp', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::execvp always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execvp +# define execvp _execvp +# endif +_GL_CXXALIAS_MDA_CAST (execvp, intptr_t, + (const char *program, char * const *argv)); +# else +_GL_CXXALIAS_SYS (execvp, int, (const char *program, char * const *argv)); +# endif +_GL_CXXALIASWARN (execvp); +#endif + +#if @GNULIB_EXECVPE@ +# if @REPLACE_EXECVPE@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execvpe +# define execvpe rpl_execvpe +# endif +_GL_FUNCDECL_RPL (execvpe, int, + (const char *program, char * const *argv, char * const *env) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (execvpe, int, + (const char *program, char * const *argv, char * const *env)); +# else +# if !@HAVE_DECL_EXECVPE@ +_GL_FUNCDECL_SYS (execvpe, int, + (const char *program, char * const *argv, char * const *env) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (execvpe, int, + (const char *program, char * const *argv, char * const *env)); +# endif +_GL_CXXALIASWARN (execvpe); +#elif defined GNULIB_POSIXCHECK +# undef execvpe +# if HAVE_RAW_DECL_EXECVPE +_GL_WARN_ON_USE (execvpe, "execvpe behaves very differently on mingw - " + "use gnulib module execvpe for portability"); +# endif +#elif @GNULIB_MDA_EXECVPE@ +/* On native Windows, map 'execvpe' to '_execvpe', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::execvpe on all platforms that have + it. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef execvpe +# define execvpe _execvpe +# endif +_GL_CXXALIAS_MDA_CAST (execvpe, intptr_t, + (const char *program, char * const *argv, + char * const *env)); +# elif @HAVE_EXECVPE@ +# if !@HAVE_DECL_EXECVPE@ +_GL_FUNCDECL_SYS (execvpe, int, + (const char *program, char * const *argv, char * const *env) + _GL_ARG_NONNULL ((1, 2))); +# endif +_GL_CXXALIAS_SYS (execvpe, int, + (const char *program, char * const *argv, char * const *env)); +# endif +# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_EXECVPE@ +_GL_CXXALIASWARN (execvpe); +# endif +#endif + + #if @GNULIB_FACCESSAT@ # if @REPLACE_FACCESSAT@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -596,7 +978,7 @@ # undef fchownat # if HAVE_RAW_DECL_FCHOWNAT _GL_WARN_ON_USE (fchownat, "fchownat is not portable - " - "use gnulib module openat for portability"); + "use gnulib module fchownat for portability"); # endif #endif @@ -684,6 +1066,12 @@ # endif _GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size)); _GL_CXXALIAS_RPL (getcwd, char *, (char *buf, size_t size)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getcwd +# define getcwd _getcwd +# endif +_GL_CXXALIAS_MDA (getcwd, char *, (char *buf, size_t size)); # else /* Need to cast, because on mingw, the second parameter is int size. */ @@ -696,6 +1084,22 @@ _GL_WARN_ON_USE (getcwd, "getcwd is unportable - " "use gnulib module getcwd for portability"); # endif +#elif @GNULIB_MDA_GETCWD@ +/* On native Windows, map 'getcwd' to '_getcwd', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::getcwd always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getcwd +# define getcwd _getcwd +# endif +/* Need to cast, because on mingw, the second parameter is either + 'int size' or 'size_t size'. */ +_GL_CXXALIAS_MDA_CAST (getcwd, char *, (char *buf, size_t size)); +# else +_GL_CXXALIAS_SYS_CAST (getcwd, char *, (char *buf, size_t size)); +# endif +_GL_CXXALIASWARN (getcwd); #endif @@ -763,6 +1167,22 @@ #endif +#if @GNULIB_GETENTROPY@ +/* Fill a buffer with random bytes. */ +# if !@HAVE_GETENTROPY@ +_GL_FUNCDECL_SYS (getentropy, int, (void *buffer, size_t length)); +# endif +_GL_CXXALIAS_SYS (getentropy, int, (void *buffer, size_t length)); +_GL_CXXALIASWARN (getentropy); +#elif defined GNULIB_POSIXCHECK +# undef getentropy +# if HAVE_RAW_DECL_GETENTROPY +_GL_WARN_ON_USE (getentropy, "getentropy is unportable - " + "use gnulib module getentropy for portability"); +# endif +#endif + + #if @GNULIB_GETGROUPS@ /* Return the supplemental groups that the current process belongs to. It is unspecified whether the effective group id is in the list. @@ -1014,6 +1434,23 @@ #endif +#if @GNULIB_MDA_GETPID@ +/* On native Windows, map 'getpid' to '_getpid', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::getpid always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getpid +# define getpid _getpid +# endif +_GL_CXXALIAS_MDA (getpid, int, (void)); +# else +_GL_CXXALIAS_SYS (getpid, pid_t, (void)); +# endif +_GL_CXXALIASWARN (getpid); +#endif + + #if @GNULIB_GETUSERSHELL@ /* Return the next valid login shell on the system, or NULL when the end of the list has been reached. */ @@ -1086,6 +1523,12 @@ # endif _GL_FUNCDECL_RPL (isatty, int, (int fd)); _GL_CXXALIAS_RPL (isatty, int, (int fd)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef isatty +# define isatty _isatty +# endif +_GL_CXXALIAS_MDA (isatty, int, (int fd)); # else _GL_CXXALIAS_SYS (isatty, int, (int fd)); # endif @@ -1096,6 +1539,20 @@ _GL_WARN_ON_USE (isatty, "isatty has portability problems on native Windows - " "use gnulib module isatty for portability"); # endif +#elif @GNULIB_MDA_ISATTY@ +/* On native Windows, map 'isatty' to '_isatty', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::isatty always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef isatty +# define isatty _isatty +# endif +_GL_CXXALIAS_MDA (isatty, int, (int fd)); +# else +_GL_CXXALIAS_SYS (isatty, int, (int fd)); +# endif +_GL_CXXALIASWARN (isatty); #endif @@ -1207,6 +1664,12 @@ # endif _GL_FUNCDECL_RPL (lseek, off_t, (int fd, off_t offset, int whence)); _GL_CXXALIAS_RPL (lseek, off_t, (int fd, off_t offset, int whence)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef lseek +# define lseek _lseek +# endif +_GL_CXXALIAS_MDA (lseek, off_t, (int fd, off_t offset, int whence)); # else _GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence)); # endif @@ -1217,6 +1680,20 @@ _GL_WARN_ON_USE (lseek, "lseek does not fail with ESPIPE on pipes on some " "systems - use gnulib module lseek for portability"); # endif +#elif @GNULIB_MDA_LSEEK@ +/* On native Windows, map 'lseek' to '_lseek', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::lseek always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef lseek +# define lseek _lseek +# endif +_GL_CXXALIAS_MDA (lseek, long, (int fd, long offset, int whence)); +# else +_GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence)); +# endif +_GL_CXXALIASWARN (lseek); #endif @@ -1349,11 +1826,32 @@ _GL_FUNCDECL_RPL (read, ssize_t, (int fd, void *buf, size_t count) _GL_ARG_NONNULL ((2))); _GL_CXXALIAS_RPL (read, ssize_t, (int fd, void *buf, size_t count)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef read +# define read _read +# endif +_GL_CXXALIAS_MDA (read, ssize_t, (int fd, void *buf, size_t count)); # else -/* Need to cast, because on mingw, the third parameter is - unsigned int count - and the return type is 'int'. */ -_GL_CXXALIAS_SYS_CAST (read, ssize_t, (int fd, void *buf, size_t count)); +_GL_CXXALIAS_SYS (read, ssize_t, (int fd, void *buf, size_t count)); +# endif +_GL_CXXALIASWARN (read); +#elif @GNULIB_MDA_READ@ +/* On native Windows, map 'read' to '_read', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::read always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef read +# define read _read +# endif +# ifdef __MINGW32__ +_GL_CXXALIAS_MDA (read, int, (int fd, void *buf, unsigned int count)); +# else +_GL_CXXALIAS_MDA (read, ssize_t, (int fd, void *buf, unsigned int count)); +# endif +# else +_GL_CXXALIAS_SYS (read, ssize_t, (int fd, void *buf, size_t count)); # endif _GL_CXXALIASWARN (read); #endif @@ -1438,6 +1936,12 @@ # endif _GL_FUNCDECL_RPL (rmdir, int, (char const *name) _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (rmdir, int, (char const *name)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef rmdir +# define rmdir _rmdir +# endif +_GL_CXXALIAS_MDA (rmdir, int, (char const *name)); # else _GL_CXXALIAS_SYS (rmdir, int, (char const *name)); # endif @@ -1448,6 +1952,20 @@ _GL_WARN_ON_USE (rmdir, "rmdir is unportable - " "use gnulib module rmdir for portability"); # endif +#elif @GNULIB_MDA_RMDIR@ +/* On native Windows, map 'rmdir' to '_rmdir', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::rmdir always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef rmdir +# define rmdir _rmdir +# endif +_GL_CXXALIAS_MDA (rmdir, int, (char const *name)); +# else +_GL_CXXALIAS_SYS (rmdir, int, (char const *name)); +# endif +_GL_CXXALIASWARN (rmdir); #endif @@ -1506,6 +2024,23 @@ #endif +#if @GNULIB_MDA_SWAB@ +/* On native Windows, map 'swab' to '_swab', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::creat always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef swab +# define swab _swab +# endif +_GL_CXXALIAS_MDA (swab, void, (char *from, char *to, int n)); +# else +_GL_CXXALIAS_SYS (swab, void, (const void *from, void *to, ssize_t n)); +# endif +_GL_CXXALIASWARN (swab); +#endif + + #if @GNULIB_SYMLINK@ # if @REPLACE_SYMLINK@ # if !(defined __cplusplus && defined GNULIB_NAMESPACE) @@ -1630,6 +2165,12 @@ # endif _GL_FUNCDECL_RPL (unlink, int, (char const *file) _GL_ARG_NONNULL ((1))); _GL_CXXALIAS_RPL (unlink, int, (char const *file)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef unlink +# define unlink _unlink +# endif +_GL_CXXALIAS_MDA (unlink, int, (char const *file)); # else _GL_CXXALIAS_SYS (unlink, int, (char const *file)); # endif @@ -1640,6 +2181,20 @@ _GL_WARN_ON_USE (unlink, "unlink is not portable - " "use gnulib module unlink for portability"); # endif +#elif @GNULIB_MDA_UNLINK@ +/* On native Windows, map 'unlink' to '_unlink', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::unlink always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef unlink +# define unlink _unlink +# endif +_GL_CXXALIAS_MDA (unlink, int, (char const *file)); +# else +_GL_CXXALIAS_SYS (unlink, int, (char const *file)); +# endif +_GL_CXXALIASWARN (unlink); #endif @@ -1664,7 +2219,7 @@ # undef unlinkat # if HAVE_RAW_DECL_UNLINKAT _GL_WARN_ON_USE (unlinkat, "unlinkat is not portable - " - "use gnulib module openat for portability"); + "use gnulib module unlinkat for portability"); # endif #endif @@ -1711,11 +2266,32 @@ _GL_FUNCDECL_RPL (write, ssize_t, (int fd, const void *buf, size_t count) _GL_ARG_NONNULL ((2))); _GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef write +# define write _write +# endif +_GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, size_t count)); +# else +_GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count)); +# endif +_GL_CXXALIASWARN (write); +#elif @GNULIB_MDA_WRITE@ +/* On native Windows, map 'write' to '_write', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::write always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef write +# define write _write +# endif +# ifdef __MINGW32__ +_GL_CXXALIAS_MDA (write, int, (int fd, const void *buf, unsigned int count)); +# else +_GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, unsigned int count)); +# endif # else -/* Need to cast, because on mingw, the third parameter is - unsigned int count - and the return type is 'int'. */ -_GL_CXXALIAS_SYS_CAST (write, ssize_t, (int fd, const void *buf, size_t count)); +_GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count)); # endif _GL_CXXALIASWARN (write); #endif diff -Nru datamash-1.7/lib/unistr/u8-mbtoucr.c datamash-1.8/lib/unistr/u8-mbtoucr.c --- datamash-1.7/lib/unistr/u8-mbtoucr.c 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/unistr/u8-mbtoucr.c 2022-05-28 01:46:59.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-2020 Free Software Foundation, Inc. + Copyright (C) 1999-2002, 2006-2007, 2009-2021 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software: you can redistribute it and/or modify it diff -Nru datamash-1.7/lib/unistr/u8-uctomb-aux.c datamash-1.8/lib/unistr/u8-uctomb-aux.c --- datamash-1.7/lib/unistr/u8-uctomb-aux.c 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/unistr/u8-uctomb-aux.c 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Conversion UCS-4 to UTF-8. - Copyright (C) 2002, 2006-2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2002, 2006-2007, 2009-2021 Free Software Foundation, Inc. Written by Bruno Haible , 2002. This program is free software: you can redistribute it and/or modify it @@ -20,16 +20,10 @@ /* Specification. */ #include "unistr.h" -#ifndef FALLTHROUGH -# if __GNUC__ < 7 -# define FALLTHROUGH ((void) 0) -# else -# define FALLTHROUGH __attribute__ ((__fallthrough__)) -# endif -#endif +#include "attribute.h" int -u8_uctomb_aux (uint8_t *s, ucs4_t uc, int n) +u8_uctomb_aux (uint8_t *s, ucs4_t uc, ptrdiff_t n) { int count; diff -Nru datamash-1.7/lib/unistr/u8-uctomb.c datamash-1.8/lib/unistr/u8-uctomb.c --- datamash-1.7/lib/unistr/u8-uctomb.c 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/unistr/u8-uctomb.c 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Store a character in UTF-8 string. - Copyright (C) 2002, 2005-2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2002, 2005-2006, 2009-2021 Free Software Foundation, Inc. Written by Bruno Haible , 2002. This program is free software: you can redistribute it and/or modify it @@ -25,18 +25,12 @@ /* Specification. */ #include "unistr.h" -#ifndef FALLTHROUGH -# if __GNUC__ < 7 -# define FALLTHROUGH ((void) 0) -# else -# define FALLTHROUGH __attribute__ ((__fallthrough__)) -# endif -#endif +#include "attribute.h" #if !HAVE_INLINE int -u8_uctomb (uint8_t *s, ucs4_t uc, int n) +u8_uctomb (uint8_t *s, ucs4_t uc, ptrdiff_t n) { if (uc < 0x80) { diff -Nru datamash-1.7/lib/unistr.in.h datamash-1.8/lib/unistr.in.h --- datamash-1.7/lib/unistr.in.h 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/unistr.in.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Elementary Unicode string functions. - Copyright (C) 2001-2002, 2005-2020 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2005-2021 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 @@ -25,7 +25,7 @@ /* Get bool. */ #include -/* Get size_t. */ +/* Get size_t, ptrdiff_t. */ #include #ifdef __cplusplus @@ -305,13 +305,13 @@ #if GNULIB_UNISTR_U8_UCTOMB || HAVE_LIBUNISTRING /* Auxiliary function, also used by u8_chr, u8_strchr, u8_strrchr. */ extern int - u8_uctomb_aux (uint8_t *s, ucs4_t uc, int n); + u8_uctomb_aux (uint8_t *s, ucs4_t uc, ptrdiff_t n); # if !HAVE_INLINE extern int - u8_uctomb (uint8_t *s, ucs4_t uc, int n); + u8_uctomb (uint8_t *s, ucs4_t uc, ptrdiff_t n); # else static inline int -u8_uctomb (uint8_t *s, ucs4_t uc, int n) +u8_uctomb (uint8_t *s, ucs4_t uc, ptrdiff_t n) { if (uc < 0x80 && n > 0) { @@ -327,13 +327,13 @@ #if GNULIB_UNISTR_U16_UCTOMB || HAVE_LIBUNISTRING /* Auxiliary function, also used by u16_chr, u16_strchr, u16_strrchr. */ extern int - u16_uctomb_aux (uint16_t *s, ucs4_t uc, int n); + u16_uctomb_aux (uint16_t *s, ucs4_t uc, ptrdiff_t n); # if !HAVE_INLINE extern int - u16_uctomb (uint16_t *s, ucs4_t uc, int n); + u16_uctomb (uint16_t *s, ucs4_t uc, ptrdiff_t n); # else static inline int -u16_uctomb (uint16_t *s, ucs4_t uc, int n) +u16_uctomb (uint16_t *s, ucs4_t uc, ptrdiff_t n) { if (uc < 0xd800 && n > 0) { @@ -349,10 +349,10 @@ #if GNULIB_UNISTR_U32_UCTOMB || HAVE_LIBUNISTRING # if !HAVE_INLINE extern int - u32_uctomb (uint32_t *s, ucs4_t uc, int n); + u32_uctomb (uint32_t *s, ucs4_t uc, ptrdiff_t n); # else static inline int -u32_uctomb (uint32_t *s, ucs4_t uc, int n) +u32_uctomb (uint32_t *s, ucs4_t uc, ptrdiff_t n) { if (uc < 0xd800 || (uc >= 0xe000 && uc < 0x110000)) { diff -Nru datamash-1.7/lib/unitypes.in.h datamash-1.8/lib/unitypes.in.h --- datamash-1.7/lib/unitypes.in.h 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/unitypes.in.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Elementary types and macros for the GNU UniString library. - Copyright (C) 2002, 2005-2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2002, 2005-2006, 2009-2021 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 @@ -26,7 +26,7 @@ /* Attribute of a function whose result depends only on the arguments (not pointers!) and which has no side effects. */ #ifndef _UC_ATTRIBUTE_CONST -# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) || defined __clang__ # define _UC_ATTRIBUTE_CONST __attribute__ ((__const__)) # else # define _UC_ATTRIBUTE_CONST @@ -36,7 +36,7 @@ /* Attribute of a function whose result depends only on the arguments (possibly pointers) and global memory, and which has no side effects. */ #ifndef _UC_ATTRIBUTE_PURE -# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__ # define _UC_ATTRIBUTE_PURE __attribute__ ((__pure__)) # else # define _UC_ATTRIBUTE_PURE @@ -47,7 +47,9 @@ pass a pointer to a different object in the specified pointer argument than in the other pointer arguments. */ #ifndef _UC_RESTRICT -# if defined __restrict || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) +# if defined __restrict \ + || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) \ + || __clang_major__ >= 3 # define _UC_RESTRICT __restrict # elif 199901L <= __STDC_VERSION__ || defined restrict # define _UC_RESTRICT restrict diff -Nru datamash-1.7/lib/uniwidth/cjk.h datamash-1.8/lib/uniwidth/cjk.h --- datamash-1.7/lib/uniwidth/cjk.h 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/uniwidth/cjk.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Test for CJK encoding. - Copyright (C) 2001-2002, 2005-2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2005-2007, 2009-2021 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.7/lib/uniwidth/width.c datamash-1.8/lib/uniwidth/width.c --- datamash-1.7/lib/uniwidth/width.c 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/uniwidth/width.c 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Determine display width of Unicode character. - Copyright (C) 2001-2002, 2006-2020 Free Software Foundation, Inc. + Copyright (C) 2001-2002, 2006-2021 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.7/lib/uniwidth.in.h datamash-1.8/lib/uniwidth.in.h --- datamash-1.7/lib/uniwidth.in.h 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/uniwidth.in.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Display width functions. - Copyright (C) 2001-2002, 2005, 2007, 2009-2020 Free Software Foundation, + Copyright (C) 2001-2002, 2005, 2007, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it diff -Nru datamash-1.7/lib/unlocked-io.h datamash-1.8/lib/unlocked-io.h --- datamash-1.7/lib/unlocked-io.h 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/unlocked-io.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ /* Prefer faster, non-thread-safe stdio functions if available. - Copyright (C) 2001-2004, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2001-2004, 2009-2021 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.7/lib/unused-parameter.h datamash-1.8/lib/unused-parameter.h --- datamash-1.7/lib/unused-parameter.h 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/unused-parameter.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ /* A C macro for declaring that specific function parameters are not used. - Copyright (C) 2008-2020 Free Software Foundation, Inc. + Copyright (C) 2008-2021 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 @@ -28,9 +28,5 @@ _GL_UNUSED_PARAMETER int *(*param)(void) */ #ifndef _GL_UNUSED_PARAMETER -# if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) -# define _GL_UNUSED_PARAMETER __attribute__ ((__unused__)) -# else -# define _GL_UNUSED_PARAMETER -# endif +# define _GL_UNUSED_PARAMETER _GL_ATTRIBUTE_MAYBE_UNUSED #endif diff -Nru datamash-1.7/lib/vasnprintf.c datamash-1.8/lib/vasnprintf.c --- datamash-1.7/lib/vasnprintf.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/vasnprintf.c 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,5871 @@ +/* vsprintf with automatic memory allocation. + Copyright (C) 1999, 2002-2021 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 . */ + +/* This file can be parametrized with the following macros: + VASNPRINTF The name of the function being defined. + FCHAR_T The element type of the format string. + DCHAR_T The element type of the destination (result) string. + FCHAR_T_ONLY_ASCII Set to 1 to enable verification that all characters + in the format string are ASCII. MUST be set if + FCHAR_T and DCHAR_T are not the same type. + DIRECTIVE Structure denoting a format directive. + Depends on FCHAR_T. + DIRECTIVES Structure denoting the set of format directives of a + format string. Depends on FCHAR_T. + PRINTF_PARSE Function that parses a format string. + Depends on FCHAR_T. + DCHAR_CPY memcpy like function for DCHAR_T[] arrays. + DCHAR_SET memset like function for DCHAR_T[] arrays. + DCHAR_MBSNLEN mbsnlen like function for DCHAR_T[] arrays. + SNPRINTF The system's snprintf (or similar) function. + This may be either snprintf or swprintf. + TCHAR_T The element type of the argument and result string + of the said SNPRINTF function. This may be either + char or wchar_t. The code exploits that + sizeof (TCHAR_T) | sizeof (DCHAR_T) and + alignof (TCHAR_T) <= alignof (DCHAR_T). + DCHAR_IS_TCHAR Set to 1 if DCHAR_T and TCHAR_T are the same type. + DCHAR_CONV_FROM_ENCODING A function to convert from char[] to DCHAR[]. + DCHAR_IS_UINT8_T Set to 1 if DCHAR_T is uint8_t. + DCHAR_IS_UINT16_T Set to 1 if DCHAR_T is uint16_t. + DCHAR_IS_UINT32_T Set to 1 if DCHAR_T is uint32_t. + ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions. + ENABLE_WCHAR_FALLBACK Set to 1 to avoid EILSEQ during conversion of wide + characters (wchar_t) and wide character strings + (wchar_t[]) to multibyte sequences. The fallback is the + hexadecimal escape syntax (\unnnn or \Unnnnnnnn) or, + if wchar_t is not Unicode encoded, \wnnnn or \Wnnnnnnnn. + */ + +/* Tell glibc's to provide a prototype for snprintf(). + This must come before because may include + , and once has been included, it's too late. */ +#ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +#endif + +#ifndef VASNPRINTF +# include +#endif +#ifndef IN_LIBINTL +# include +#endif + +/* Specification. */ +#ifndef VASNPRINTF +# if WIDE_CHAR_VERSION +# include "vasnwprintf.h" +# else +# include "vasnprintf.h" +# endif +#endif + +#include /* localeconv() */ +#include /* snprintf(), sprintf() */ +#include /* abort(), malloc(), realloc(), free() */ +#include /* memcpy(), strlen() */ +#include /* errno */ +#include /* CHAR_BIT */ +#include /* DBL_MAX_EXP, LDBL_MAX_EXP */ +#if HAVE_NL_LANGINFO +# include +#endif +#ifndef VASNPRINTF +# if WIDE_CHAR_VERSION +# include "wprintf-parse.h" +# else +# include "printf-parse.h" +# endif +#endif + +/* Checked size_t computations. */ +#include "xsize.h" + +#include "attribute.h" +#include "verify.h" + +#if (NEED_PRINTF_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL +# include +# include "float+.h" +#endif + +#if (NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL +# include +# include "isnand-nolibm.h" +#endif + +#if (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE) && !defined IN_LIBINTL +# include +# include "isnanl-nolibm.h" +# include "fpucw.h" +#endif + +#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL +# include +# include "isnand-nolibm.h" +# include "printf-frexp.h" +#endif + +#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL +# include +# include "isnanl-nolibm.h" +# include "printf-frexpl.h" +# include "fpucw.h" +#endif + +/* Default parameters. */ +#ifndef VASNPRINTF +# if WIDE_CHAR_VERSION +# define VASNPRINTF vasnwprintf +# define FCHAR_T wchar_t +# define DCHAR_T wchar_t +# define TCHAR_T wchar_t +# define DCHAR_IS_TCHAR 1 +# define DIRECTIVE wchar_t_directive +# define DIRECTIVES wchar_t_directives +# define PRINTF_PARSE wprintf_parse +# define DCHAR_CPY wmemcpy +# define DCHAR_SET wmemset +# else +# define VASNPRINTF vasnprintf +# define FCHAR_T char +# define DCHAR_T char +# define TCHAR_T char +# define DCHAR_IS_TCHAR 1 +# define DIRECTIVE char_directive +# define DIRECTIVES char_directives +# define PRINTF_PARSE printf_parse +# define DCHAR_CPY memcpy +# define DCHAR_SET memset +# endif +#endif +#if WIDE_CHAR_VERSION + /* TCHAR_T is wchar_t. */ +# define USE_SNPRINTF 1 +# if HAVE_DECL__SNWPRINTF + /* On Windows, the function swprintf() has a different signature than + on Unix; we use the function _snwprintf() or - on mingw - snwprintf() + instead. The mingw function snwprintf() has fewer bugs than the + MSVCRT function _snwprintf(), so prefer that. */ +# if defined __MINGW32__ +# define SNPRINTF snwprintf +# else +# define SNPRINTF _snwprintf +# define USE_MSVC__SNPRINTF 1 +# endif +# else + /* Unix. */ +# define SNPRINTF swprintf +# endif +#else + /* TCHAR_T is char. */ + /* Use snprintf if it exists under the name 'snprintf' or '_snprintf'. + But don't use it on BeOS, since BeOS snprintf produces no output if the + size argument is >= 0x3000000. + Also don't use it on Linux libc5, since there snprintf with size = 1 + writes any output without bounds, like sprintf. */ +# if (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF) && !defined __BEOS__ && !(__GNU_LIBRARY__ == 1) +# define USE_SNPRINTF 1 +# else +# define USE_SNPRINTF 0 +# endif +# if HAVE_DECL__SNPRINTF + /* Windows. The mingw function snprintf() has fewer bugs than the MSVCRT + function _snprintf(), so prefer that. */ +# if defined __MINGW32__ +# define SNPRINTF snprintf + /* Here we need to call the native snprintf, not rpl_snprintf. */ +# undef snprintf +# else + /* MSVC versions < 14 did not have snprintf, only _snprintf. */ +# define SNPRINTF _snprintf +# define USE_MSVC__SNPRINTF 1 +# endif +# else + /* Unix. */ +# define SNPRINTF snprintf + /* Here we need to call the native snprintf, not rpl_snprintf. */ +# undef snprintf +# endif +#endif +/* Here we need to call the native sprintf, not rpl_sprintf. */ +#undef sprintf + +/* GCC >= 4.0 with -Wall emits unjustified "... may be used uninitialized" + warnings in this file. Use -Dlint to suppress them. */ +#if defined GCC_LINT || defined lint +# define IF_LINT(Code) Code +#else +# define IF_LINT(Code) /* empty */ +#endif + +/* Avoid some warnings from "gcc -Wshadow". + This file doesn't use the exp() and remainder() functions. */ +#undef exp +#define exp expo +#undef remainder +#define remainder rem + +#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && !WIDE_CHAR_VERSION +# if (HAVE_STRNLEN && !defined _AIX) +# define local_strnlen strnlen +# else +# ifndef local_strnlen_defined +# define local_strnlen_defined 1 +static size_t +local_strnlen (const char *string, size_t maxlen) +{ + const char *end = memchr (string, '\0', maxlen); + return end ? (size_t) (end - string) : maxlen; +} +# endif +# endif +#endif + +#if (((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && WIDE_CHAR_VERSION) || ((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && !WIDE_CHAR_VERSION && DCHAR_IS_TCHAR)) && HAVE_WCHAR_T +# if HAVE_WCSLEN +# define local_wcslen wcslen +# else + /* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid + a dependency towards this library, here is a local substitute. + Define this substitute only once, even if this file is included + twice in the same compilation unit. */ +# ifndef local_wcslen_defined +# define local_wcslen_defined 1 +static size_t +local_wcslen (const wchar_t *s) +{ + const wchar_t *ptr; + + for (ptr = s; *ptr != (wchar_t) 0; ptr++) + ; + return ptr - s; +} +# endif +# endif +#endif + +#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && HAVE_WCHAR_T && WIDE_CHAR_VERSION +# if HAVE_WCSNLEN +# define local_wcsnlen wcsnlen +# else +# ifndef local_wcsnlen_defined +# define local_wcsnlen_defined 1 +static size_t +local_wcsnlen (const wchar_t *s, size_t maxlen) +{ + const wchar_t *ptr; + + for (ptr = s; maxlen > 0 && *ptr != (wchar_t) 0; ptr++, maxlen--) + ; + return ptr - s; +} +# endif +# endif +#endif + +#if (((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL) || ENABLE_WCHAR_FALLBACK) && HAVE_WCHAR_T) || (ENABLE_WCHAR_FALLBACK && HAVE_WINT_T)) && !WIDE_CHAR_VERSION +# if ENABLE_WCHAR_FALLBACK +static size_t +wctomb_fallback (char *s, wchar_t wc) +{ + static char hex[16] = "0123456789ABCDEF"; + + s[0] = '\\'; + if (sizeof (wchar_t) > 2 && wc > 0xffff) + { +# if __STDC_ISO_10646__ || (__GLIBC__ >= 2) || (defined _WIN32 || defined __CYGWIN__) + s[1] = 'U'; +# else + s[1] = 'W'; +# endif + s[2] = hex[(wc & 0xf0000000U) >> 28]; + s[3] = hex[(wc & 0xf000000U) >> 24]; + s[4] = hex[(wc & 0xf00000U) >> 20]; + s[5] = hex[(wc & 0xf0000U) >> 16]; + s[6] = hex[(wc & 0xf000U) >> 12]; + s[7] = hex[(wc & 0xf00U) >> 8]; + s[8] = hex[(wc & 0xf0U) >> 4]; + s[9] = hex[wc & 0xfU]; + return 10; + } + else + { +# if __STDC_ISO_10646__ || (__GLIBC__ >= 2) || (defined _WIN32 || defined __CYGWIN__) + s[1] = 'u'; +# else + s[1] = 'w'; +# endif + s[2] = hex[(wc & 0xf000U) >> 12]; + s[3] = hex[(wc & 0xf00U) >> 8]; + s[4] = hex[(wc & 0xf0U) >> 4]; + s[5] = hex[wc & 0xfU]; + return 6; + } +} +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t +static size_t +local_wcrtomb (char *s, wchar_t wc, mbstate_t *ps) +{ + size_t count = wcrtomb (s, wc, ps); + if (count == (size_t)(-1)) + count = wctomb_fallback (s, wc); + return count; +} +# else +static int +local_wctomb (char *s, wchar_t wc) +{ + int count = wctomb (s, wc); + if (count < 0) + count = wctomb_fallback (s, wc); + return count; +} +# define local_wcrtomb(S, WC, PS) local_wctomb ((S), (WC)) +# endif +# else +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t +# define local_wcrtomb(S, WC, PS) wcrtomb ((S), (WC), (PS)) +# else +# define local_wcrtomb(S, WC, PS) wctomb ((S), (WC)) +# endif +# endif +#endif + +#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL +/* Determine the decimal-point character according to the current locale. */ +# ifndef decimal_point_char_defined +# define decimal_point_char_defined 1 +static char +decimal_point_char (void) +{ + const char *point; + /* Determine it in a multithread-safe way. We know nl_langinfo is + multithread-safe on glibc systems and Mac OS X systems, but is not required + to be multithread-safe by POSIX. sprintf(), however, is multithread-safe. + localeconv() is rarely multithread-safe. */ +# if HAVE_NL_LANGINFO && (__GLIBC__ || defined __UCLIBC__ || (defined __APPLE__ && defined __MACH__)) + point = nl_langinfo (RADIXCHAR); +# elif 1 + char pointbuf[5]; + sprintf (pointbuf, "%#.0f", 1.0); + point = &pointbuf[1]; +# else + point = localeconv () -> decimal_point; +# endif + /* The decimal point is always a single byte: either '.' or ','. */ + return (point[0] != '\0' ? point[0] : '.'); +} +# endif +#endif + +#if NEED_PRINTF_INFINITE_DOUBLE && !NEED_PRINTF_DOUBLE && !defined IN_LIBINTL + +/* Equivalent to !isfinite(x) || x == 0, but does not require libm. */ +static int +is_infinite_or_zero (double x) +{ + return isnand (x) || x + x == x; +} + +#endif + +#if NEED_PRINTF_INFINITE_LONG_DOUBLE && !NEED_PRINTF_LONG_DOUBLE && !defined IN_LIBINTL + +/* Equivalent to !isfinite(x) || x == 0, but does not require libm. */ +static int +is_infinite_or_zerol (long double x) +{ + return isnanl (x) || x + x == x; +} + +#endif + +#if (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL + +/* Converting 'long double' to decimal without rare rounding bugs requires + real bignums. We use the naming conventions of GNU gmp, but vastly simpler + (and slower) algorithms. */ + +typedef unsigned int mp_limb_t; +# define GMP_LIMB_BITS 32 +verify (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS); + +typedef unsigned long long mp_twolimb_t; +# define GMP_TWOLIMB_BITS 64 +verify (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS); + +/* Representation of a bignum >= 0. */ +typedef struct +{ + size_t nlimbs; + mp_limb_t *limbs; /* Bits in little-endian order, allocated with malloc(). */ +} mpn_t; + +/* Compute the product of two bignums >= 0. + Return the allocated memory in case of success, NULL in case of memory + allocation failure. */ +static void * +multiply (mpn_t src1, mpn_t src2, mpn_t *dest) +{ + const mp_limb_t *p1; + const mp_limb_t *p2; + size_t len1; + size_t len2; + + if (src1.nlimbs <= src2.nlimbs) + { + len1 = src1.nlimbs; + p1 = src1.limbs; + len2 = src2.nlimbs; + p2 = src2.limbs; + } + else + { + len1 = src2.nlimbs; + p1 = src2.limbs; + len2 = src1.nlimbs; + p2 = src1.limbs; + } + /* Now 0 <= len1 <= len2. */ + if (len1 == 0) + { + /* src1 or src2 is zero. */ + dest->nlimbs = 0; + dest->limbs = (mp_limb_t *) malloc (1); + } + else + { + /* Here 1 <= len1 <= len2. */ + size_t dlen; + mp_limb_t *dp; + size_t k, i, j; + + dlen = len1 + len2; + dp = (mp_limb_t *) malloc (dlen * sizeof (mp_limb_t)); + if (dp == NULL) + return NULL; + for (k = len2; k > 0; ) + dp[--k] = 0; + for (i = 0; i < len1; i++) + { + mp_limb_t digit1 = p1[i]; + mp_twolimb_t carry = 0; + for (j = 0; j < len2; j++) + { + mp_limb_t digit2 = p2[j]; + carry += (mp_twolimb_t) digit1 * (mp_twolimb_t) digit2; + carry += dp[i + j]; + dp[i + j] = (mp_limb_t) carry; + carry = carry >> GMP_LIMB_BITS; + } + dp[i + len2] = (mp_limb_t) carry; + } + /* Normalise. */ + while (dlen > 0 && dp[dlen - 1] == 0) + dlen--; + dest->nlimbs = dlen; + dest->limbs = dp; + } + return dest->limbs; +} + +/* Compute the quotient of a bignum a >= 0 and a bignum b > 0. + a is written as a = q * b + r with 0 <= r < b. q is the quotient, r + the remainder. + Finally, round-to-even is performed: If r > b/2 or if r = b/2 and q is odd, + q is incremented. + Return the allocated memory in case of success, NULL in case of memory + allocation failure. */ +static void * +divide (mpn_t a, mpn_t b, mpn_t *q) +{ + /* Algorithm: + First normalise a and b: a=[a[m-1],...,a[0]], b=[b[n-1],...,b[0]] + with m>=0 and n>0 (in base beta = 2^GMP_LIMB_BITS). + If m=n=1, perform a single-precision division: + r:=0, j:=m, + while j>0 do + {Here (q[m-1]*beta^(m-1)+...+q[j]*beta^j) * b[0] + r*beta^j = + = a[m-1]*beta^(m-1)+...+a[j]*beta^j und 0<=r=n>1, perform a multiple-precision division: + We have a/b < beta^(m-n+1). + s:=intDsize-1-(highest bit in b[n-1]), 0<=s=beta/2. + For j=m-n,...,0: {Here 0 <= r < b*beta^(j+1).} + Compute q* : + q* := floor((r[j+n]*beta+r[j+n-1])/b[n-1]). + In case of overflow (q* >= beta) set q* := beta-1. + Compute c2 := ((r[j+n]*beta+r[j+n-1]) - q* * b[n-1])*beta + r[j+n-2] + and c3 := b[n-2] * q*. + {We have 0 <= c2 < 2*beta^2, even 0 <= c2 < beta^2 if no overflow + occurred. Furthermore 0 <= c3 < beta^2. + If there was overflow and + r[j+n]*beta+r[j+n-1] - q* * b[n-1] >= beta, i.e. c2 >= beta^2, + the next test can be skipped.} + While c3 > c2, {Here 0 <= c2 < c3 < beta^2} + Put q* := q* - 1, c2 := c2 + b[n-1]*beta, c3 := c3 - b[n-2]. + If q* > 0: + Put r := r - b * q* * beta^j. In detail: + [r[n+j],...,r[j]] := [r[n+j],...,r[j]] - q* * [b[n-1],...,b[0]]. + hence: u:=0, for i:=0 to n-1 do + u := u + q* * b[i], + r[j+i]:=r[j+i]-(u mod beta) (+ beta, if carry), + u:=u div beta (+ 1, if carry in subtraction) + r[n+j]:=r[n+j]-u. + {Since always u = (q* * [b[i-1],...,b[0]] div beta^i) + 1 + < q* + 1 <= beta, + the carry u does not overflow.} + If a negative carry occurs, put q* := q* - 1 + and [r[n+j],...,r[j]] := [r[n+j],...,r[j]] + [0,b[n-1],...,b[0]]. + Set q[j] := q*. + Normalise [q[m-n],..,q[0]]; this yields the quotient q. + Shift [r[n-1],...,r[0]] right by s bits and normalise; this yields the + rest r. + The room for q[j] can be allocated at the memory location of r[n+j]. + Finally, round-to-even: + Shift r left by 1 bit. + If r > b or if r = b and q[0] is odd, q := q+1. + */ + const mp_limb_t *a_ptr = a.limbs; + size_t a_len = a.nlimbs; + const mp_limb_t *b_ptr = b.limbs; + size_t b_len = b.nlimbs; + mp_limb_t *roomptr; + mp_limb_t *tmp_roomptr = NULL; + mp_limb_t *q_ptr; + size_t q_len; + mp_limb_t *r_ptr; + size_t r_len; + + /* Allocate room for a_len+2 digits. + (Need a_len+1 digits for the real division and 1 more digit for the + final rounding of q.) */ + roomptr = (mp_limb_t *) malloc ((a_len + 2) * sizeof (mp_limb_t)); + if (roomptr == NULL) + return NULL; + + /* Normalise a. */ + while (a_len > 0 && a_ptr[a_len - 1] == 0) + a_len--; + + /* Normalise b. */ + for (;;) + { + if (b_len == 0) + /* Division by zero. */ + abort (); + if (b_ptr[b_len - 1] == 0) + b_len--; + else + break; + } + + /* Here m = a_len >= 0 and n = b_len > 0. */ + + if (a_len < b_len) + { + /* m beta^(m-2) <= a/b < beta^m */ + r_ptr = roomptr; + q_ptr = roomptr + 1; + { + mp_limb_t den = b_ptr[0]; + mp_limb_t remainder = 0; + const mp_limb_t *sourceptr = a_ptr + a_len; + mp_limb_t *destptr = q_ptr + a_len; + size_t count; + for (count = a_len; count > 0; count--) + { + mp_twolimb_t num = + ((mp_twolimb_t) remainder << GMP_LIMB_BITS) | *--sourceptr; + *--destptr = num / den; + remainder = num % den; + } + /* Normalise and store r. */ + if (remainder > 0) + { + r_ptr[0] = remainder; + r_len = 1; + } + else + r_len = 0; + /* Normalise q. */ + q_len = a_len; + if (q_ptr[q_len - 1] == 0) + q_len--; + } + } + else + { + /* n>1: multiple precision division. + beta^(m-1) <= a < beta^m, beta^(n-1) <= b < beta^n ==> + beta^(m-n-1) <= a/b < beta^(m-n+1). */ + /* Determine s. */ + size_t s; + { + mp_limb_t msd = b_ptr[b_len - 1]; /* = b[n-1], > 0 */ + /* Determine s = GMP_LIMB_BITS - integer_length (msd). + Code copied from gnulib's integer_length.c. */ +# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) \ + || (__clang_major__ >= 4) + s = __builtin_clz (msd); +# else +# if defined DBL_EXPBIT0_WORD && defined DBL_EXPBIT0_BIT + if (GMP_LIMB_BITS <= DBL_MANT_BIT) + { + /* Use 'double' operations. + Assumes an IEEE 754 'double' implementation. */ +# define DBL_EXP_MASK ((DBL_MAX_EXP - DBL_MIN_EXP) | 7) +# define DBL_EXP_BIAS (DBL_EXP_MASK / 2 - 1) +# define NWORDS \ + ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int)) + union { double value; unsigned int word[NWORDS]; } m; + + /* Use a single integer to floating-point conversion. */ + m.value = msd; + + s = GMP_LIMB_BITS + - (((m.word[DBL_EXPBIT0_WORD] >> DBL_EXPBIT0_BIT) & DBL_EXP_MASK) + - DBL_EXP_BIAS); + } + else +# undef NWORDS +# endif + { + s = 31; + if (msd >= 0x10000) + { + msd = msd >> 16; + s -= 16; + } + if (msd >= 0x100) + { + msd = msd >> 8; + s -= 8; + } + if (msd >= 0x10) + { + msd = msd >> 4; + s -= 4; + } + if (msd >= 0x4) + { + msd = msd >> 2; + s -= 2; + } + if (msd >= 0x2) + { + msd = msd >> 1; + s -= 1; + } + } +# endif + } + /* 0 <= s < GMP_LIMB_BITS. + Copy b, shifting it left by s bits. */ + if (s > 0) + { + tmp_roomptr = (mp_limb_t *) malloc (b_len * sizeof (mp_limb_t)); + if (tmp_roomptr == NULL) + { + free (roomptr); + return NULL; + } + { + const mp_limb_t *sourceptr = b_ptr; + mp_limb_t *destptr = tmp_roomptr; + mp_twolimb_t accu = 0; + size_t count; + for (count = b_len; count > 0; count--) + { + accu += (mp_twolimb_t) *sourceptr++ << s; + *destptr++ = (mp_limb_t) accu; + accu = accu >> GMP_LIMB_BITS; + } + /* accu must be zero, since that was how s was determined. */ + if (accu != 0) + abort (); + } + b_ptr = tmp_roomptr; + } + /* Copy a, shifting it left by s bits, yields r. + Memory layout: + At the beginning: r = roomptr[0..a_len], + at the end: r = roomptr[0..b_len-1], q = roomptr[b_len..a_len] */ + r_ptr = roomptr; + if (s == 0) + { + memcpy (r_ptr, a_ptr, a_len * sizeof (mp_limb_t)); + r_ptr[a_len] = 0; + } + else + { + const mp_limb_t *sourceptr = a_ptr; + mp_limb_t *destptr = r_ptr; + mp_twolimb_t accu = 0; + size_t count; + for (count = a_len; count > 0; count--) + { + accu += (mp_twolimb_t) *sourceptr++ << s; + *destptr++ = (mp_limb_t) accu; + accu = accu >> GMP_LIMB_BITS; + } + *destptr++ = (mp_limb_t) accu; + } + q_ptr = roomptr + b_len; + q_len = a_len - b_len + 1; /* q will have m-n+1 limbs */ + { + size_t j = a_len - b_len; /* m-n */ + mp_limb_t b_msd = b_ptr[b_len - 1]; /* b[n-1] */ + mp_limb_t b_2msd = b_ptr[b_len - 2]; /* b[n-2] */ + mp_twolimb_t b_msdd = /* b[n-1]*beta+b[n-2] */ + ((mp_twolimb_t) b_msd << GMP_LIMB_BITS) | b_2msd; + /* Division loop, traversed m-n+1 times. + j counts down, b is unchanged, beta/2 <= b[n-1] < beta. */ + for (;;) + { + mp_limb_t q_star; + mp_limb_t c1; + if (r_ptr[j + b_len] < b_msd) /* r[j+n] < b[n-1] ? */ + { + /* Divide r[j+n]*beta+r[j+n-1] by b[n-1], no overflow. */ + mp_twolimb_t num = + ((mp_twolimb_t) r_ptr[j + b_len] << GMP_LIMB_BITS) + | r_ptr[j + b_len - 1]; + q_star = num / b_msd; + c1 = num % b_msd; + } + else + { + /* Overflow, hence r[j+n]*beta+r[j+n-1] >= beta*b[n-1]. */ + q_star = (mp_limb_t)~(mp_limb_t)0; /* q* = beta-1 */ + /* Test whether r[j+n]*beta+r[j+n-1] - (beta-1)*b[n-1] >= beta + <==> r[j+n]*beta+r[j+n-1] + b[n-1] >= beta*b[n-1]+beta + <==> b[n-1] < floor((r[j+n]*beta+r[j+n-1]+b[n-1])/beta) + {<= beta !}. + If yes, jump directly to the subtraction loop. + (Otherwise, r[j+n]*beta+r[j+n-1] - (beta-1)*b[n-1] < beta + <==> floor((r[j+n]*beta+r[j+n-1]+b[n-1])/beta) = b[n-1] ) */ + if (r_ptr[j + b_len] > b_msd + || (c1 = r_ptr[j + b_len - 1] + b_msd) < b_msd) + /* r[j+n] >= b[n-1]+1 or + r[j+n] = b[n-1] and the addition r[j+n-1]+b[n-1] gives a + carry. */ + goto subtract; + } + /* q_star = q*, + c1 = (r[j+n]*beta+r[j+n-1]) - q* * b[n-1] (>=0, 0, decrease it by + b[n-1]*beta+b[n-2]. Because of b[n-1]*beta+b[n-2] >= beta^2/2 + this can happen only twice. */ + if (c3 > c2) + { + q_star = q_star - 1; /* q* := q* - 1 */ + if (c3 - c2 > b_msdd) + q_star = q_star - 1; /* q* := q* - 1 */ + } + } + if (q_star > 0) + subtract: + { + /* Subtract r := r - b * q* * beta^j. */ + mp_limb_t cr; + { + const mp_limb_t *sourceptr = b_ptr; + mp_limb_t *destptr = r_ptr + j; + mp_twolimb_t carry = 0; + size_t count; + for (count = b_len; count > 0; count--) + { + /* Here 0 <= carry <= q*. */ + carry = + carry + + (mp_twolimb_t) q_star * (mp_twolimb_t) *sourceptr++ + + (mp_limb_t) ~(*destptr); + /* Here 0 <= carry <= beta*q* + beta-1. */ + *destptr++ = ~(mp_limb_t) carry; + carry = carry >> GMP_LIMB_BITS; /* <= q* */ + } + cr = (mp_limb_t) carry; + } + /* Subtract cr from r_ptr[j + b_len], then forget about + r_ptr[j + b_len]. */ + if (cr > r_ptr[j + b_len]) + { + /* Subtraction gave a carry. */ + q_star = q_star - 1; /* q* := q* - 1 */ + /* Add b back. */ + { + const mp_limb_t *sourceptr = b_ptr; + mp_limb_t *destptr = r_ptr + j; + mp_limb_t carry = 0; + size_t count; + for (count = b_len; count > 0; count--) + { + mp_limb_t source1 = *sourceptr++; + mp_limb_t source2 = *destptr; + *destptr++ = source1 + source2 + carry; + carry = + (carry + ? source1 >= (mp_limb_t) ~source2 + : source1 > (mp_limb_t) ~source2); + } + } + /* Forget about the carry and about r[j+n]. */ + } + } + /* q* is determined. Store it as q[j]. */ + q_ptr[j] = q_star; + if (j == 0) + break; + j--; + } + } + r_len = b_len; + /* Normalise q. */ + if (q_ptr[q_len - 1] == 0) + q_len--; +# if 0 /* Not needed here, since we need r only to compare it with b/2, and + b is shifted left by s bits. */ + /* Shift r right by s bits. */ + if (s > 0) + { + mp_limb_t ptr = r_ptr + r_len; + mp_twolimb_t accu = 0; + size_t count; + for (count = r_len; count > 0; count--) + { + accu = (mp_twolimb_t) (mp_limb_t) accu << GMP_LIMB_BITS; + accu += (mp_twolimb_t) *--ptr << (GMP_LIMB_BITS - s); + *ptr = (mp_limb_t) (accu >> GMP_LIMB_BITS); + } + } +# endif + /* Normalise r. */ + while (r_len > 0 && r_ptr[r_len - 1] == 0) + r_len--; + } + /* Compare r << 1 with b. */ + if (r_len > b_len) + goto increment_q; + { + size_t i; + for (i = b_len;;) + { + mp_limb_t r_i = + (i <= r_len && i > 0 ? r_ptr[i - 1] >> (GMP_LIMB_BITS - 1) : 0) + | (i < r_len ? r_ptr[i] << 1 : 0); + mp_limb_t b_i = (i < b_len ? b_ptr[i] : 0); + if (r_i > b_i) + goto increment_q; + if (r_i < b_i) + goto keep_q; + if (i == 0) + break; + i--; + } + } + if (q_len > 0 && ((q_ptr[0] & 1) != 0)) + /* q is odd. */ + increment_q: + { + size_t i; + for (i = 0; i < q_len; i++) + if (++(q_ptr[i]) != 0) + goto keep_q; + q_ptr[q_len++] = 1; + } + keep_q: + if (tmp_roomptr != NULL) + free (tmp_roomptr); + q->limbs = q_ptr; + q->nlimbs = q_len; + return roomptr; +} + +/* Convert a bignum a >= 0, multiplied with 10^extra_zeroes, to decimal + representation. + Destroys the contents of a. + Return the allocated memory - containing the decimal digits in low-to-high + order, terminated with a NUL character - in case of success, NULL in case + of memory allocation failure. */ +static char * +convert_to_decimal (mpn_t a, size_t extra_zeroes) +{ + mp_limb_t *a_ptr = a.limbs; + size_t a_len = a.nlimbs; + /* 0.03345 is slightly larger than log(2)/(9*log(10)). */ + size_t c_len = 9 * ((size_t)(a_len * (GMP_LIMB_BITS * 0.03345f)) + 1); + /* We need extra_zeroes bytes for zeroes, followed by c_len bytes for the + digits of a, followed by 1 byte for the terminating NUL. */ + char *c_ptr = (char *) malloc (xsum (xsum (extra_zeroes, c_len), 1)); + if (c_ptr != NULL) + { + char *d_ptr = c_ptr; + for (; extra_zeroes > 0; extra_zeroes--) + *d_ptr++ = '0'; + while (a_len > 0) + { + /* Divide a by 10^9, in-place. */ + mp_limb_t remainder = 0; + mp_limb_t *ptr = a_ptr + a_len; + size_t count; + for (count = a_len; count > 0; count--) + { + mp_twolimb_t num = + ((mp_twolimb_t) remainder << GMP_LIMB_BITS) | *--ptr; + *ptr = num / 1000000000; + remainder = num % 1000000000; + } + /* Store the remainder as 9 decimal digits. */ + for (count = 9; count > 0; count--) + { + *d_ptr++ = '0' + (remainder % 10); + remainder = remainder / 10; + } + /* Normalize a. */ + if (a_ptr[a_len - 1] == 0) + a_len--; + } + /* Remove leading zeroes. */ + while (d_ptr > c_ptr && d_ptr[-1] == '0') + d_ptr--; + /* But keep at least one zero. */ + if (d_ptr == c_ptr) + *d_ptr++ = '0'; + /* Terminate the string. */ + *d_ptr = '\0'; + } + return c_ptr; +} + +# if NEED_PRINTF_LONG_DOUBLE + +/* Assuming x is finite and >= 0: + write x as x = 2^e * m, where m is a bignum. + Return the allocated memory in case of success, NULL in case of memory + allocation failure. */ +static void * +decode_long_double (long double x, int *ep, mpn_t *mp) +{ + mpn_t m; + int exp; + long double y; + size_t i; + + /* Allocate memory for result. */ + m.nlimbs = (LDBL_MANT_BIT + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS; + m.limbs = (mp_limb_t *) malloc (m.nlimbs * sizeof (mp_limb_t)); + if (m.limbs == NULL) + return NULL; + /* Split into exponential part and mantissa. */ + y = frexpl (x, &exp); + if (!(y >= 0.0L && y < 1.0L)) + abort (); + /* x = 2^exp * y = 2^(exp - LDBL_MANT_BIT) * (y * 2^LDBL_MANT_BIT), and the + latter is an integer. */ + /* Convert the mantissa (y * 2^LDBL_MANT_BIT) to a sequence of limbs. + I'm not sure whether it's safe to cast a 'long double' value between + 2^31 and 2^32 to 'unsigned int', therefore play safe and cast only + 'long double' values between 0 and 2^16 (to 'unsigned int' or 'int', + doesn't matter). */ +# if (LDBL_MANT_BIT % GMP_LIMB_BITS) != 0 +# if (LDBL_MANT_BIT % GMP_LIMB_BITS) > GMP_LIMB_BITS / 2 + { + mp_limb_t hi, lo; + y *= (mp_limb_t) 1 << (LDBL_MANT_BIT % (GMP_LIMB_BITS / 2)); + hi = (int) y; + y -= hi; + if (!(y >= 0.0L && y < 1.0L)) + abort (); + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2); + lo = (int) y; + y -= lo; + if (!(y >= 0.0L && y < 1.0L)) + abort (); + m.limbs[LDBL_MANT_BIT / GMP_LIMB_BITS] = (hi << (GMP_LIMB_BITS / 2)) | lo; + } +# else + { + mp_limb_t d; + y *= (mp_limb_t) 1 << (LDBL_MANT_BIT % GMP_LIMB_BITS); + d = (int) y; + y -= d; + if (!(y >= 0.0L && y < 1.0L)) + abort (); + m.limbs[LDBL_MANT_BIT / GMP_LIMB_BITS] = d; + } +# endif +# endif + for (i = LDBL_MANT_BIT / GMP_LIMB_BITS; i > 0; ) + { + mp_limb_t hi, lo; + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2); + hi = (int) y; + y -= hi; + if (!(y >= 0.0L && y < 1.0L)) + abort (); + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2); + lo = (int) y; + y -= lo; + if (!(y >= 0.0L && y < 1.0L)) + abort (); + m.limbs[--i] = (hi << (GMP_LIMB_BITS / 2)) | lo; + } +# if 0 /* On FreeBSD 6.1/x86, 'long double' numbers sometimes have excess + precision. */ + if (!(y == 0.0L)) + abort (); +# endif + /* Normalise. */ + while (m.nlimbs > 0 && m.limbs[m.nlimbs - 1] == 0) + m.nlimbs--; + *mp = m; + *ep = exp - LDBL_MANT_BIT; + return m.limbs; +} + +# endif + +# if NEED_PRINTF_DOUBLE + +/* Assuming x is finite and >= 0: + write x as x = 2^e * m, where m is a bignum. + Return the allocated memory in case of success, NULL in case of memory + allocation failure. */ +static void * +decode_double (double x, int *ep, mpn_t *mp) +{ + mpn_t m; + int exp; + double y; + size_t i; + + /* Allocate memory for result. */ + m.nlimbs = (DBL_MANT_BIT + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS; + m.limbs = (mp_limb_t *) malloc (m.nlimbs * sizeof (mp_limb_t)); + if (m.limbs == NULL) + return NULL; + /* Split into exponential part and mantissa. */ + y = frexp (x, &exp); + if (!(y >= 0.0 && y < 1.0)) + abort (); + /* x = 2^exp * y = 2^(exp - DBL_MANT_BIT) * (y * 2^DBL_MANT_BIT), and the + latter is an integer. */ + /* Convert the mantissa (y * 2^DBL_MANT_BIT) to a sequence of limbs. + I'm not sure whether it's safe to cast a 'double' value between + 2^31 and 2^32 to 'unsigned int', therefore play safe and cast only + 'double' values between 0 and 2^16 (to 'unsigned int' or 'int', + doesn't matter). */ +# if (DBL_MANT_BIT % GMP_LIMB_BITS) != 0 +# if (DBL_MANT_BIT % GMP_LIMB_BITS) > GMP_LIMB_BITS / 2 + { + mp_limb_t hi, lo; + y *= (mp_limb_t) 1 << (DBL_MANT_BIT % (GMP_LIMB_BITS / 2)); + hi = (int) y; + y -= hi; + if (!(y >= 0.0 && y < 1.0)) + abort (); + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2); + lo = (int) y; + y -= lo; + if (!(y >= 0.0 && y < 1.0)) + abort (); + m.limbs[DBL_MANT_BIT / GMP_LIMB_BITS] = (hi << (GMP_LIMB_BITS / 2)) | lo; + } +# else + { + mp_limb_t d; + y *= (mp_limb_t) 1 << (DBL_MANT_BIT % GMP_LIMB_BITS); + d = (int) y; + y -= d; + if (!(y >= 0.0 && y < 1.0)) + abort (); + m.limbs[DBL_MANT_BIT / GMP_LIMB_BITS] = d; + } +# endif +# endif + for (i = DBL_MANT_BIT / GMP_LIMB_BITS; i > 0; ) + { + mp_limb_t hi, lo; + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2); + hi = (int) y; + y -= hi; + if (!(y >= 0.0 && y < 1.0)) + abort (); + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2); + lo = (int) y; + y -= lo; + if (!(y >= 0.0 && y < 1.0)) + abort (); + m.limbs[--i] = (hi << (GMP_LIMB_BITS / 2)) | lo; + } + if (!(y == 0.0)) + abort (); + /* Normalise. */ + while (m.nlimbs > 0 && m.limbs[m.nlimbs - 1] == 0) + m.nlimbs--; + *mp = m; + *ep = exp - DBL_MANT_BIT; + return m.limbs; +} + +# endif + +/* Assuming x = 2^e * m is finite and >= 0, and n is an integer: + Returns the decimal representation of round (x * 10^n). + Return the allocated memory - containing the decimal digits in low-to-high + order, terminated with a NUL character - in case of success, NULL in case + of memory allocation failure. */ +static char * +scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n) +{ + int s; + size_t extra_zeroes; + unsigned int abs_n; + unsigned int abs_s; + mp_limb_t *pow5_ptr; + size_t pow5_len; + unsigned int s_limbs; + unsigned int s_bits; + mpn_t pow5; + mpn_t z; + void *z_memory; + char *digits; + + if (memory == NULL) + return NULL; + /* x = 2^e * m, hence + y = round (2^e * 10^n * m) = round (2^(e+n) * 5^n * m) + = round (2^s * 5^n * m). */ + s = e + n; + extra_zeroes = 0; + /* Factor out a common power of 10 if possible. */ + if (s > 0 && n > 0) + { + extra_zeroes = (s < n ? s : n); + s -= extra_zeroes; + n -= extra_zeroes; + } + /* Here y = round (2^s * 5^n * m) * 10^extra_zeroes. + Before converting to decimal, we need to compute + z = round (2^s * 5^n * m). */ + /* Compute 5^|n|, possibly shifted by |s| bits if n and s have the same + sign. 2.322 is slightly larger than log(5)/log(2). */ + abs_n = (n >= 0 ? n : -n); + abs_s = (s >= 0 ? s : -s); + pow5_ptr = (mp_limb_t *) malloc (((int)(abs_n * (2.322f / GMP_LIMB_BITS)) + 1 + + abs_s / GMP_LIMB_BITS + 1) + * sizeof (mp_limb_t)); + if (pow5_ptr == NULL) + { + free (memory); + return NULL; + } + /* Initialize with 1. */ + pow5_ptr[0] = 1; + pow5_len = 1; + /* Multiply with 5^|n|. */ + if (abs_n > 0) + { + static mp_limb_t const small_pow5[13 + 1] = + { + 1, 5, 25, 125, 625, 3125, 15625, 78125, 390625, 1953125, 9765625, + 48828125, 244140625, 1220703125 + }; + unsigned int n13; + for (n13 = 0; n13 <= abs_n; n13 += 13) + { + mp_limb_t digit1 = small_pow5[n13 + 13 <= abs_n ? 13 : abs_n - n13]; + size_t j; + mp_twolimb_t carry = 0; + for (j = 0; j < pow5_len; j++) + { + mp_limb_t digit2 = pow5_ptr[j]; + carry += (mp_twolimb_t) digit1 * (mp_twolimb_t) digit2; + pow5_ptr[j] = (mp_limb_t) carry; + carry = carry >> GMP_LIMB_BITS; + } + if (carry > 0) + pow5_ptr[pow5_len++] = (mp_limb_t) carry; + } + } + s_limbs = abs_s / GMP_LIMB_BITS; + s_bits = abs_s % GMP_LIMB_BITS; + if (n >= 0 ? s >= 0 : s <= 0) + { + /* Multiply with 2^|s|. */ + if (s_bits > 0) + { + mp_limb_t *ptr = pow5_ptr; + mp_twolimb_t accu = 0; + size_t count; + for (count = pow5_len; count > 0; count--) + { + accu += (mp_twolimb_t) *ptr << s_bits; + *ptr++ = (mp_limb_t) accu; + accu = accu >> GMP_LIMB_BITS; + } + if (accu > 0) + { + *ptr = (mp_limb_t) accu; + pow5_len++; + } + } + if (s_limbs > 0) + { + size_t count; + for (count = pow5_len; count > 0;) + { + count--; + pow5_ptr[s_limbs + count] = pow5_ptr[count]; + } + for (count = s_limbs; count > 0;) + { + count--; + pow5_ptr[count] = 0; + } + pow5_len += s_limbs; + } + pow5.limbs = pow5_ptr; + pow5.nlimbs = pow5_len; + if (n >= 0) + { + /* Multiply m with pow5. No division needed. */ + z_memory = multiply (m, pow5, &z); + } + else + { + /* Divide m by pow5 and round. */ + z_memory = divide (m, pow5, &z); + } + } + else + { + pow5.limbs = pow5_ptr; + pow5.nlimbs = pow5_len; + if (n >= 0) + { + /* n >= 0, s < 0. + Multiply m with pow5, then divide by 2^|s|. */ + mpn_t numerator; + mpn_t denominator; + void *tmp_memory; + tmp_memory = multiply (m, pow5, &numerator); + if (tmp_memory == NULL) + { + free (pow5_ptr); + free (memory); + return NULL; + } + /* Construct 2^|s|. */ + { + mp_limb_t *ptr = pow5_ptr + pow5_len; + size_t i; + for (i = 0; i < s_limbs; i++) + ptr[i] = 0; + ptr[s_limbs] = (mp_limb_t) 1 << s_bits; + denominator.limbs = ptr; + denominator.nlimbs = s_limbs + 1; + } + z_memory = divide (numerator, denominator, &z); + free (tmp_memory); + } + else + { + /* n < 0, s > 0. + Multiply m with 2^s, then divide by pow5. */ + mpn_t numerator; + mp_limb_t *num_ptr; + num_ptr = (mp_limb_t *) malloc ((m.nlimbs + s_limbs + 1) + * sizeof (mp_limb_t)); + if (num_ptr == NULL) + { + free (pow5_ptr); + free (memory); + return NULL; + } + { + mp_limb_t *destptr = num_ptr; + { + size_t i; + for (i = 0; i < s_limbs; i++) + *destptr++ = 0; + } + if (s_bits > 0) + { + const mp_limb_t *sourceptr = m.limbs; + mp_twolimb_t accu = 0; + size_t count; + for (count = m.nlimbs; count > 0; count--) + { + accu += (mp_twolimb_t) *sourceptr++ << s_bits; + *destptr++ = (mp_limb_t) accu; + accu = accu >> GMP_LIMB_BITS; + } + if (accu > 0) + *destptr++ = (mp_limb_t) accu; + } + else + { + const mp_limb_t *sourceptr = m.limbs; + size_t count; + for (count = m.nlimbs; count > 0; count--) + *destptr++ = *sourceptr++; + } + numerator.limbs = num_ptr; + numerator.nlimbs = destptr - num_ptr; + } + z_memory = divide (numerator, pow5, &z); + free (num_ptr); + } + } + free (pow5_ptr); + free (memory); + + /* Here y = round (x * 10^n) = z * 10^extra_zeroes. */ + + if (z_memory == NULL) + return NULL; + digits = convert_to_decimal (z, extra_zeroes); + free (z_memory); + return digits; +} + +# if NEED_PRINTF_LONG_DOUBLE + +/* Assuming x is finite and >= 0, and n is an integer: + Returns the decimal representation of round (x * 10^n). + Return the allocated memory - containing the decimal digits in low-to-high + order, terminated with a NUL character - in case of success, NULL in case + of memory allocation failure. */ +static char * +scale10_round_decimal_long_double (long double x, int n) +{ + int e IF_LINT(= 0); + mpn_t m; + void *memory = decode_long_double (x, &e, &m); + return scale10_round_decimal_decoded (e, m, memory, n); +} + +# endif + +# if NEED_PRINTF_DOUBLE + +/* Assuming x is finite and >= 0, and n is an integer: + Returns the decimal representation of round (x * 10^n). + Return the allocated memory - containing the decimal digits in low-to-high + order, terminated with a NUL character - in case of success, NULL in case + of memory allocation failure. */ +static char * +scale10_round_decimal_double (double x, int n) +{ + int e IF_LINT(= 0); + mpn_t m; + void *memory = decode_double (x, &e, &m); + return scale10_round_decimal_decoded (e, m, memory, n); +} + +# endif + +# if NEED_PRINTF_LONG_DOUBLE + +/* Assuming x is finite and > 0: + Return an approximation for n with 10^n <= x < 10^(n+1). + The approximation is usually the right n, but may be off by 1 sometimes. */ +static int +floorlog10l (long double x) +{ + int exp; + long double y; + double z; + double l; + + /* Split into exponential part and mantissa. */ + y = frexpl (x, &exp); + if (!(y >= 0.0L && y < 1.0L)) + abort (); + if (y == 0.0L) + return INT_MIN; + if (y < 0.5L) + { + while (y < (1.0L / (1 << (GMP_LIMB_BITS / 2)) / (1 << (GMP_LIMB_BITS / 2)))) + { + y *= 1.0L * (1 << (GMP_LIMB_BITS / 2)) * (1 << (GMP_LIMB_BITS / 2)); + exp -= GMP_LIMB_BITS; + } + if (y < (1.0L / (1 << 16))) + { + y *= 1.0L * (1 << 16); + exp -= 16; + } + if (y < (1.0L / (1 << 8))) + { + y *= 1.0L * (1 << 8); + exp -= 8; + } + if (y < (1.0L / (1 << 4))) + { + y *= 1.0L * (1 << 4); + exp -= 4; + } + if (y < (1.0L / (1 << 2))) + { + y *= 1.0L * (1 << 2); + exp -= 2; + } + if (y < (1.0L / (1 << 1))) + { + y *= 1.0L * (1 << 1); + exp -= 1; + } + } + if (!(y >= 0.5L && y < 1.0L)) + abort (); + /* Compute an approximation for l = log2(x) = exp + log2(y). */ + l = exp; + z = y; + if (z < 0.70710678118654752444) + { + z *= 1.4142135623730950488; + l -= 0.5; + } + if (z < 0.8408964152537145431) + { + z *= 1.1892071150027210667; + l -= 0.25; + } + if (z < 0.91700404320467123175) + { + z *= 1.0905077326652576592; + l -= 0.125; + } + if (z < 0.9576032806985736469) + { + z *= 1.0442737824274138403; + l -= 0.0625; + } + /* Now 0.95 <= z <= 1.01. */ + z = 1 - z; + /* log2(1-z) = 1/log(2) * (- z - z^2/2 - z^3/3 - z^4/4 - ...) + Four terms are enough to get an approximation with error < 10^-7. */ + l -= 1.4426950408889634074 * z * (1.0 + z * (0.5 + z * ((1.0 / 3) + z * 0.25))); + /* Finally multiply with log(2)/log(10), yields an approximation for + log10(x). */ + l *= 0.30102999566398119523; + /* Round down to the next integer. */ + return (int) l + (l < 0 ? -1 : 0); +} + +# endif + +# if NEED_PRINTF_DOUBLE + +/* Assuming x is finite and > 0: + Return an approximation for n with 10^n <= x < 10^(n+1). + The approximation is usually the right n, but may be off by 1 sometimes. */ +static int +floorlog10 (double x) +{ + int exp; + double y; + double z; + double l; + + /* Split into exponential part and mantissa. */ + y = frexp (x, &exp); + if (!(y >= 0.0 && y < 1.0)) + abort (); + if (y == 0.0) + return INT_MIN; + if (y < 0.5) + { + while (y < (1.0 / (1 << (GMP_LIMB_BITS / 2)) / (1 << (GMP_LIMB_BITS / 2)))) + { + y *= 1.0 * (1 << (GMP_LIMB_BITS / 2)) * (1 << (GMP_LIMB_BITS / 2)); + exp -= GMP_LIMB_BITS; + } + if (y < (1.0 / (1 << 16))) + { + y *= 1.0 * (1 << 16); + exp -= 16; + } + if (y < (1.0 / (1 << 8))) + { + y *= 1.0 * (1 << 8); + exp -= 8; + } + if (y < (1.0 / (1 << 4))) + { + y *= 1.0 * (1 << 4); + exp -= 4; + } + if (y < (1.0 / (1 << 2))) + { + y *= 1.0 * (1 << 2); + exp -= 2; + } + if (y < (1.0 / (1 << 1))) + { + y *= 1.0 * (1 << 1); + exp -= 1; + } + } + if (!(y >= 0.5 && y < 1.0)) + abort (); + /* Compute an approximation for l = log2(x) = exp + log2(y). */ + l = exp; + z = y; + if (z < 0.70710678118654752444) + { + z *= 1.4142135623730950488; + l -= 0.5; + } + if (z < 0.8408964152537145431) + { + z *= 1.1892071150027210667; + l -= 0.25; + } + if (z < 0.91700404320467123175) + { + z *= 1.0905077326652576592; + l -= 0.125; + } + if (z < 0.9576032806985736469) + { + z *= 1.0442737824274138403; + l -= 0.0625; + } + /* Now 0.95 <= z <= 1.01. */ + z = 1 - z; + /* log2(1-z) = 1/log(2) * (- z - z^2/2 - z^3/3 - z^4/4 - ...) + Four terms are enough to get an approximation with error < 10^-7. */ + l -= 1.4426950408889634074 * z * (1.0 + z * (0.5 + z * ((1.0 / 3) + z * 0.25))); + /* Finally multiply with log(2)/log(10), yields an approximation for + log10(x). */ + l *= 0.30102999566398119523; + /* Round down to the next integer. */ + return (int) l + (l < 0 ? -1 : 0); +} + +# endif + +/* Tests whether a string of digits consists of exactly PRECISION zeroes and + a single '1' digit. */ +static int +is_borderline (const char *digits, size_t precision) +{ + for (; precision > 0; precision--, digits++) + if (*digits != '0') + return 0; + if (*digits != '1') + return 0; + digits++; + return *digits == '\0'; +} + +#endif + +#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF + +/* Use a different function name, to make it possible that the 'wchar_t' + parametrization and the 'char' parametrization get compiled in the same + translation unit. */ +# if WIDE_CHAR_VERSION +# define MAX_ROOM_NEEDED wmax_room_needed +# else +# define MAX_ROOM_NEEDED max_room_needed +# endif + +/* Returns the number of TCHAR_T units needed as temporary space for the result + of sprintf or SNPRINTF of a single conversion directive. */ +static size_t +MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index, FCHAR_T conversion, + arg_type type, int flags, size_t width, int has_precision, + size_t precision, int pad_ourselves) +{ + size_t tmp_length; + + switch (conversion) + { + case 'd': case 'i': case 'u': + if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) + tmp_length = + (unsigned int) (sizeof (unsigned long long) * CHAR_BIT + * 0.30103 /* binary -> decimal */ + ) + + 1; /* turn floor into ceil */ + else if (type == TYPE_LONGINT || type == TYPE_ULONGINT) + tmp_length = + (unsigned int) (sizeof (unsigned long) * CHAR_BIT + * 0.30103 /* binary -> decimal */ + ) + + 1; /* turn floor into ceil */ + else + tmp_length = + (unsigned int) (sizeof (unsigned int) * CHAR_BIT + * 0.30103 /* binary -> decimal */ + ) + + 1; /* turn floor into ceil */ + if (tmp_length < precision) + tmp_length = precision; + /* Multiply by 2, as an estimate for FLAG_GROUP. */ + tmp_length = xsum (tmp_length, tmp_length); + /* Add 1, to account for a leading sign. */ + tmp_length = xsum (tmp_length, 1); + break; + + case 'o': + if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) + tmp_length = + (unsigned int) (sizeof (unsigned long long) * CHAR_BIT + * 0.333334 /* binary -> octal */ + ) + + 1; /* turn floor into ceil */ + else if (type == TYPE_LONGINT || type == TYPE_ULONGINT) + tmp_length = + (unsigned int) (sizeof (unsigned long) * CHAR_BIT + * 0.333334 /* binary -> octal */ + ) + + 1; /* turn floor into ceil */ + else + tmp_length = + (unsigned int) (sizeof (unsigned int) * CHAR_BIT + * 0.333334 /* binary -> octal */ + ) + + 1; /* turn floor into ceil */ + if (tmp_length < precision) + tmp_length = precision; + /* Add 1, to account for a leading sign. */ + tmp_length = xsum (tmp_length, 1); + break; + + case 'x': case 'X': + if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT) + tmp_length = + (unsigned int) (sizeof (unsigned long long) * CHAR_BIT + * 0.25 /* binary -> hexadecimal */ + ) + + 1; /* turn floor into ceil */ + else if (type == TYPE_LONGINT || type == TYPE_ULONGINT) + tmp_length = + (unsigned int) (sizeof (unsigned long) * CHAR_BIT + * 0.25 /* binary -> hexadecimal */ + ) + + 1; /* turn floor into ceil */ + else + tmp_length = + (unsigned int) (sizeof (unsigned int) * CHAR_BIT + * 0.25 /* binary -> hexadecimal */ + ) + + 1; /* turn floor into ceil */ + if (tmp_length < precision) + tmp_length = precision; + /* Add 2, to account for a leading sign or alternate form. */ + tmp_length = xsum (tmp_length, 2); + break; + + case 'f': case 'F': + if (type == TYPE_LONGDOUBLE) + tmp_length = + (unsigned int) (LDBL_MAX_EXP + * 0.30103 /* binary -> decimal */ + * 2 /* estimate for FLAG_GROUP */ + ) + + 1 /* turn floor into ceil */ + + 10; /* sign, decimal point etc. */ + else + tmp_length = + (unsigned int) (DBL_MAX_EXP + * 0.30103 /* binary -> decimal */ + * 2 /* estimate for FLAG_GROUP */ + ) + + 1 /* turn floor into ceil */ + + 10; /* sign, decimal point etc. */ + tmp_length = xsum (tmp_length, precision); + break; + + case 'e': case 'E': case 'g': case 'G': + tmp_length = + 12; /* sign, decimal point, exponent etc. */ + tmp_length = xsum (tmp_length, precision); + break; + + case 'a': case 'A': + if (type == TYPE_LONGDOUBLE) + tmp_length = + (unsigned int) (LDBL_DIG + * 0.831 /* decimal -> hexadecimal */ + ) + + 1; /* turn floor into ceil */ + else + tmp_length = + (unsigned int) (DBL_DIG + * 0.831 /* decimal -> hexadecimal */ + ) + + 1; /* turn floor into ceil */ + if (tmp_length < precision) + tmp_length = precision; + /* Account for sign, decimal point etc. */ + tmp_length = xsum (tmp_length, 12); + break; + + case 'c': +# if HAVE_WINT_T && !WIDE_CHAR_VERSION + if (type == TYPE_WIDE_CHAR) + { + tmp_length = MB_CUR_MAX; +# if ENABLE_WCHAR_FALLBACK + if (tmp_length < (sizeof (wchar_t) > 2 ? 10 : 6)) + tmp_length = (sizeof (wchar_t) > 2 ? 10 : 6); +# endif + } + else +# endif + tmp_length = 1; + break; + + case 's': +# if HAVE_WCHAR_T + if (type == TYPE_WIDE_STRING) + { +# if WIDE_CHAR_VERSION + /* ISO C says about %ls in fwprintf: + "If the precision is not specified or is greater than the size + of the array, the array shall contain a null wide character." + So if there is a precision, we must not use wcslen. */ + const wchar_t *arg = ap->arg[arg_index].a.a_wide_string; + + if (has_precision) + tmp_length = local_wcsnlen (arg, precision); + else + tmp_length = local_wcslen (arg); +# else + /* ISO C says about %ls in fprintf: + "If a precision is specified, no more than that many bytes are + written (including shift sequences, if any), and the array + shall contain a null wide character if, to equal the multibyte + character sequence length given by the precision, the function + would need to access a wide character one past the end of the + array." + So if there is a precision, we must not use wcslen. */ + /* This case has already been handled separately in VASNPRINTF. */ + abort (); +# endif + } + else +# endif + { +# if WIDE_CHAR_VERSION + /* ISO C says about %s in fwprintf: + "If the precision is not specified or is greater than the size + of the converted array, the converted array shall contain a + null wide character." + So if there is a precision, we must not use strlen. */ + /* This case has already been handled separately in VASNPRINTF. */ + abort (); +# else + /* ISO C says about %s in fprintf: + "If the precision is not specified or greater than the size of + the array, the array shall contain a null character." + So if there is a precision, we must not use strlen. */ + const char *arg = ap->arg[arg_index].a.a_string; + + if (has_precision) + tmp_length = local_strnlen (arg, precision); + else + tmp_length = strlen (arg); +# endif + } + break; + + case 'p': + tmp_length = + (unsigned int) (sizeof (void *) * CHAR_BIT + * 0.25 /* binary -> hexadecimal */ + ) + + 1 /* turn floor into ceil */ + + 2; /* account for leading 0x */ + break; + + default: + abort (); + } + + if (!pad_ourselves) + { +# if ENABLE_UNISTDIO + /* Padding considers the number of characters, therefore the number of + elements after padding may be + > max (tmp_length, width) + but is certainly + <= tmp_length + width. */ + tmp_length = xsum (tmp_length, width); +# else + /* Padding considers the number of elements, says POSIX. */ + if (tmp_length < width) + tmp_length = width; +# endif + } + + tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */ + + return tmp_length; +} + +#endif + +DCHAR_T * +VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, + const FCHAR_T *format, va_list args) +{ + DIRECTIVES d; + arguments a; + + if (PRINTF_PARSE (format, &d, &a) < 0) + /* errno is already set. */ + return NULL; + +#define CLEANUP() \ + if (d.dir != d.direct_alloc_dir) \ + free (d.dir); \ + if (a.arg != a.direct_alloc_arg) \ + free (a.arg); + + if (PRINTF_FETCHARGS (args, &a) < 0) + { + CLEANUP (); + errno = EINVAL; + return NULL; + } + + { + size_t buf_neededlength; + TCHAR_T *buf; + TCHAR_T *buf_malloced; + const FCHAR_T *cp; + size_t i; + DIRECTIVE *dp; + /* Output string accumulator. */ + DCHAR_T *result; + size_t allocated; + size_t length; + + /* Allocate a small buffer that will hold a directive passed to + sprintf or snprintf. */ + buf_neededlength = + xsum4 (7, d.max_width_length, d.max_precision_length, 6); +#if HAVE_ALLOCA + if (buf_neededlength < 4000 / sizeof (TCHAR_T)) + { + buf = (TCHAR_T *) alloca (buf_neededlength * sizeof (TCHAR_T)); + buf_malloced = NULL; + } + else +#endif + { + size_t buf_memsize = xtimes (buf_neededlength, sizeof (TCHAR_T)); + if (size_overflow_p (buf_memsize)) + goto out_of_memory_1; + buf = (TCHAR_T *) malloc (buf_memsize); + if (buf == NULL) + goto out_of_memory_1; + buf_malloced = buf; + } + + if (resultbuf != NULL) + { + result = resultbuf; + allocated = *lengthp; + } + else + { + result = NULL; + allocated = 0; + } + length = 0; + /* Invariants: + result is either == resultbuf or == NULL or malloc-allocated. + If length > 0, then result != NULL. */ + + /* Ensures that allocated >= needed. Aborts through a jump to + out_of_memory if needed is SIZE_MAX or otherwise too big. */ +#define ENSURE_ALLOCATION(needed) \ + if ((needed) > allocated) \ + { \ + size_t memory_size; \ + DCHAR_T *memory; \ + \ + allocated = (allocated > 0 ? xtimes (allocated, 2) : 12); \ + if ((needed) > allocated) \ + allocated = (needed); \ + memory_size = xtimes (allocated, sizeof (DCHAR_T)); \ + if (size_overflow_p (memory_size)) \ + goto out_of_memory; \ + if (result == resultbuf || result == NULL) \ + memory = (DCHAR_T *) malloc (memory_size); \ + else \ + memory = (DCHAR_T *) realloc (result, memory_size); \ + if (memory == NULL) \ + goto out_of_memory; \ + if (result == resultbuf && length > 0) \ + DCHAR_CPY (memory, result, length); \ + result = memory; \ + } + + for (cp = format, i = 0, dp = &d.dir[0]; ; cp = dp->dir_end, i++, dp++) + { + if (cp != dp->dir_start) + { + size_t n = dp->dir_start - cp; + size_t augmented_length = xsum (length, n); + + ENSURE_ALLOCATION (augmented_length); + /* This copies a piece of FCHAR_T[] into a DCHAR_T[]. Here we + need that the format string contains only ASCII characters + if FCHAR_T and DCHAR_T are not the same type. */ + if (sizeof (FCHAR_T) == sizeof (DCHAR_T)) + { + DCHAR_CPY (result + length, (const DCHAR_T *) cp, n); + length = augmented_length; + } + else + { + do + result[length++] = *cp++; + while (--n > 0); + } + } + if (i == d.count) + break; + + /* Execute a single directive. */ + if (dp->conversion == '%') + { + size_t augmented_length; + + if (!(dp->arg_index == ARG_NONE)) + abort (); + augmented_length = xsum (length, 1); + ENSURE_ALLOCATION (augmented_length); + result[length] = '%'; + length = augmented_length; + } + else + { + if (!(dp->arg_index != ARG_NONE)) + abort (); + + if (dp->conversion == 'n') + { + switch (a.arg[dp->arg_index].type) + { + case TYPE_COUNT_SCHAR_POINTER: + *a.arg[dp->arg_index].a.a_count_schar_pointer = length; + break; + case TYPE_COUNT_SHORT_POINTER: + *a.arg[dp->arg_index].a.a_count_short_pointer = length; + break; + case TYPE_COUNT_INT_POINTER: + *a.arg[dp->arg_index].a.a_count_int_pointer = length; + break; + case TYPE_COUNT_LONGINT_POINTER: + *a.arg[dp->arg_index].a.a_count_longint_pointer = length; + break; + case TYPE_COUNT_LONGLONGINT_POINTER: + *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length; + break; + default: + abort (); + } + } +#if ENABLE_UNISTDIO + /* The unistdio extensions. */ + else if (dp->conversion == 'U') + { + arg_type type = a.arg[dp->arg_index].type; + int flags = dp->flags; + int has_width; + size_t width; + int has_precision; + size_t precision; + + has_width = 0; + width = 0; + if (dp->width_start != dp->width_end) + { + if (dp->width_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->width_arg_index].a.a_int; + width = arg; + if (arg < 0) + { + /* "A negative field width is taken as a '-' flag + followed by a positive field width." */ + flags |= FLAG_LEFT; + width = -width; + } + } + else + { + const FCHAR_T *digitp = dp->width_start; + + do + width = xsum (xtimes (width, 10), *digitp++ - '0'); + while (digitp != dp->width_end); + } + has_width = 1; + } + + has_precision = 0; + precision = 0; + if (dp->precision_start != dp->precision_end) + { + if (dp->precision_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->precision_arg_index].a.a_int; + /* "A negative precision is taken as if the precision + were omitted." */ + if (arg >= 0) + { + precision = arg; + has_precision = 1; + } + } + else + { + const FCHAR_T *digitp = dp->precision_start + 1; + + precision = 0; + while (digitp != dp->precision_end) + precision = xsum (xtimes (precision, 10), *digitp++ - '0'); + has_precision = 1; + } + } + + switch (type) + { + case TYPE_U8_STRING: + { + const uint8_t *arg = a.arg[dp->arg_index].a.a_u8_string; + const uint8_t *arg_end; + size_t characters; + + if (has_precision) + { + /* Use only PRECISION characters, from the left. */ + arg_end = arg; + characters = 0; + for (; precision > 0; precision--) + { + int count = u8_strmblen (arg_end); + if (count == 0) + break; + if (count < 0) + { + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end += count; + characters++; + } + } + else if (has_width) + { + /* Use the entire string, and count the number of + characters. */ + arg_end = arg; + characters = 0; + for (;;) + { + int count = u8_strmblen (arg_end); + if (count == 0) + break; + if (count < 0) + { + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end += count; + characters++; + } + } + else + { + /* Use the entire string. */ + arg_end = arg + u8_strlen (arg); + /* The number of characters doesn't matter. */ + characters = 0; + } + + if (characters < width && !(dp->flags & FLAG_LEFT)) + { + size_t n = width - characters; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + +# if DCHAR_IS_UINT8_T + { + size_t n = arg_end - arg; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_CPY (result + length, arg, n); + length += n; + } +# else + { /* Convert. */ + DCHAR_T *converted = result + length; + size_t converted_len = allocated - length; +# if DCHAR_IS_TCHAR + /* Convert from UTF-8 to locale encoding. */ + converted = + u8_conv_to_encoding (locale_charset (), + iconveh_question_mark, + arg, arg_end - arg, NULL, + converted, &converted_len); +# else + /* Convert from UTF-8 to UTF-16/UTF-32. */ + converted = + U8_TO_DCHAR (arg, arg_end - arg, + converted, &converted_len); +# endif + if (converted == NULL) + { + int saved_errno = errno; + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = saved_errno; + return NULL; + } + if (converted != result + length) + { + ENSURE_ALLOCATION (xsum (length, converted_len)); + DCHAR_CPY (result + length, converted, converted_len); + free (converted); + } + length += converted_len; + } +# endif + + if (characters < width && (dp->flags & FLAG_LEFT)) + { + size_t n = width - characters; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + } + break; + + case TYPE_U16_STRING: + { + const uint16_t *arg = a.arg[dp->arg_index].a.a_u16_string; + const uint16_t *arg_end; + size_t characters; + + if (has_precision) + { + /* Use only PRECISION characters, from the left. */ + arg_end = arg; + characters = 0; + for (; precision > 0; precision--) + { + int count = u16_strmblen (arg_end); + if (count == 0) + break; + if (count < 0) + { + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end += count; + characters++; + } + } + else if (has_width) + { + /* Use the entire string, and count the number of + characters. */ + arg_end = arg; + characters = 0; + for (;;) + { + int count = u16_strmblen (arg_end); + if (count == 0) + break; + if (count < 0) + { + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end += count; + characters++; + } + } + else + { + /* Use the entire string. */ + arg_end = arg + u16_strlen (arg); + /* The number of characters doesn't matter. */ + characters = 0; + } + + if (characters < width && !(dp->flags & FLAG_LEFT)) + { + size_t n = width - characters; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + +# if DCHAR_IS_UINT16_T + { + size_t n = arg_end - arg; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_CPY (result + length, arg, n); + length += n; + } +# else + { /* Convert. */ + DCHAR_T *converted = result + length; + size_t converted_len = allocated - length; +# if DCHAR_IS_TCHAR + /* Convert from UTF-16 to locale encoding. */ + converted = + u16_conv_to_encoding (locale_charset (), + iconveh_question_mark, + arg, arg_end - arg, NULL, + converted, &converted_len); +# else + /* Convert from UTF-16 to UTF-8/UTF-32. */ + converted = + U16_TO_DCHAR (arg, arg_end - arg, + converted, &converted_len); +# endif + if (converted == NULL) + { + int saved_errno = errno; + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = saved_errno; + return NULL; + } + if (converted != result + length) + { + ENSURE_ALLOCATION (xsum (length, converted_len)); + DCHAR_CPY (result + length, converted, converted_len); + free (converted); + } + length += converted_len; + } +# endif + + if (characters < width && (dp->flags & FLAG_LEFT)) + { + size_t n = width - characters; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + } + break; + + case TYPE_U32_STRING: + { + const uint32_t *arg = a.arg[dp->arg_index].a.a_u32_string; + const uint32_t *arg_end; + size_t characters; + + if (has_precision) + { + /* Use only PRECISION characters, from the left. */ + arg_end = arg; + characters = 0; + for (; precision > 0; precision--) + { + int count = u32_strmblen (arg_end); + if (count == 0) + break; + if (count < 0) + { + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end += count; + characters++; + } + } + else if (has_width) + { + /* Use the entire string, and count the number of + characters. */ + arg_end = arg; + characters = 0; + for (;;) + { + int count = u32_strmblen (arg_end); + if (count == 0) + break; + if (count < 0) + { + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end += count; + characters++; + } + } + else + { + /* Use the entire string. */ + arg_end = arg + u32_strlen (arg); + /* The number of characters doesn't matter. */ + characters = 0; + } + + if (characters < width && !(dp->flags & FLAG_LEFT)) + { + size_t n = width - characters; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + +# if DCHAR_IS_UINT32_T + { + size_t n = arg_end - arg; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_CPY (result + length, arg, n); + length += n; + } +# else + { /* Convert. */ + DCHAR_T *converted = result + length; + size_t converted_len = allocated - length; +# if DCHAR_IS_TCHAR + /* Convert from UTF-32 to locale encoding. */ + converted = + u32_conv_to_encoding (locale_charset (), + iconveh_question_mark, + arg, arg_end - arg, NULL, + converted, &converted_len); +# else + /* Convert from UTF-32 to UTF-8/UTF-16. */ + converted = + U32_TO_DCHAR (arg, arg_end - arg, + converted, &converted_len); +# endif + if (converted == NULL) + { + int saved_errno = errno; + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = saved_errno; + return NULL; + } + if (converted != result + length) + { + ENSURE_ALLOCATION (xsum (length, converted_len)); + DCHAR_CPY (result + length, converted, converted_len); + free (converted); + } + length += converted_len; + } +# endif + + if (characters < width && (dp->flags & FLAG_LEFT)) + { + size_t n = width - characters; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + } + break; + + default: + abort (); + } + } +#endif +#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL) || ENABLE_WCHAR_FALLBACK) && HAVE_WCHAR_T + else if (dp->conversion == 's' +# if WIDE_CHAR_VERSION + && a.arg[dp->arg_index].type != TYPE_WIDE_STRING +# else + && a.arg[dp->arg_index].type == TYPE_WIDE_STRING +# endif + ) + { + /* The normal handling of the 's' directive below requires + allocating a temporary buffer. The determination of its + length (tmp_length), in the case when a precision is + specified, below requires a conversion between a char[] + string and a wchar_t[] wide string. It could be done, but + we have no guarantee that the implementation of sprintf will + use the exactly same algorithm. Without this guarantee, it + is possible to have buffer overrun bugs. In order to avoid + such bugs, we implement the entire processing of the 's' + directive ourselves. */ + int flags = dp->flags; + int has_width; + size_t width; + int has_precision; + size_t precision; + + has_width = 0; + width = 0; + if (dp->width_start != dp->width_end) + { + if (dp->width_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->width_arg_index].a.a_int; + width = arg; + if (arg < 0) + { + /* "A negative field width is taken as a '-' flag + followed by a positive field width." */ + flags |= FLAG_LEFT; + width = -width; + } + } + else + { + const FCHAR_T *digitp = dp->width_start; + + do + width = xsum (xtimes (width, 10), *digitp++ - '0'); + while (digitp != dp->width_end); + } + has_width = 1; + } + + has_precision = 0; + precision = 6; + if (dp->precision_start != dp->precision_end) + { + if (dp->precision_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->precision_arg_index].a.a_int; + /* "A negative precision is taken as if the precision + were omitted." */ + if (arg >= 0) + { + precision = arg; + has_precision = 1; + } + } + else + { + const FCHAR_T *digitp = dp->precision_start + 1; + + precision = 0; + while (digitp != dp->precision_end) + precision = xsum (xtimes (precision, 10), *digitp++ - '0'); + has_precision = 1; + } + } + +# if WIDE_CHAR_VERSION + /* %s in vasnwprintf. See the specification of fwprintf. */ + { + const char *arg = a.arg[dp->arg_index].a.a_string; + const char *arg_end; + size_t characters; + + if (has_precision) + { + /* Use only as many bytes as needed to produce PRECISION + wide characters, from the left. */ +# if HAVE_MBRTOWC + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + arg_end = arg; + characters = 0; + for (; precision > 0; precision--) + { + int count; +# if HAVE_MBRTOWC + count = mbrlen (arg_end, MB_CUR_MAX, &state); +# else + count = mblen (arg_end, MB_CUR_MAX); +# endif + if (count == 0) + /* Found the terminating NUL. */ + break; + if (count < 0) + { + /* Invalid or incomplete multibyte character. */ + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end += count; + characters++; + } + } + else if (has_width) + { + /* Use the entire string, and count the number of wide + characters. */ +# if HAVE_MBRTOWC + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + arg_end = arg; + characters = 0; + for (;;) + { + int count; +# if HAVE_MBRTOWC + count = mbrlen (arg_end, MB_CUR_MAX, &state); +# else + count = mblen (arg_end, MB_CUR_MAX); +# endif + if (count == 0) + /* Found the terminating NUL. */ + break; + if (count < 0) + { + /* Invalid or incomplete multibyte character. */ + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end += count; + characters++; + } + } + else + { + /* Use the entire string. */ + arg_end = arg + strlen (arg); + /* The number of characters doesn't matter. */ + characters = 0; + } + + if (characters < width && !(dp->flags & FLAG_LEFT)) + { + size_t n = width - characters; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + + if (has_precision || has_width) + { + /* We know the number of wide characters in advance. */ + size_t remaining; +# if HAVE_MBRTOWC + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + ENSURE_ALLOCATION (xsum (length, characters)); + for (remaining = characters; remaining > 0; remaining--) + { + wchar_t wc; + int count; +# if HAVE_MBRTOWC + count = mbrtowc (&wc, arg, arg_end - arg, &state); +# else + count = mbtowc (&wc, arg, arg_end - arg); +# endif + if (count <= 0) + /* mbrtowc not consistent with mbrlen, or mbtowc + not consistent with mblen. */ + abort (); + result[length++] = wc; + arg += count; + } + if (!(arg == arg_end)) + abort (); + } + else + { +# if HAVE_MBRTOWC + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + while (arg < arg_end) + { + wchar_t wc; + int count; +# if HAVE_MBRTOWC + count = mbrtowc (&wc, arg, arg_end - arg, &state); +# else + count = mbtowc (&wc, arg, arg_end - arg); +# endif + if (count <= 0) + /* mbrtowc not consistent with mbrlen, or mbtowc + not consistent with mblen. */ + abort (); + ENSURE_ALLOCATION (xsum (length, 1)); + result[length++] = wc; + arg += count; + } + } + + if (characters < width && (dp->flags & FLAG_LEFT)) + { + size_t n = width - characters; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + } +# else + /* %ls in vasnprintf. See the specification of fprintf. */ + { + const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string; + const wchar_t *arg_end; + size_t characters; +# if !DCHAR_IS_TCHAR + /* This code assumes that TCHAR_T is 'char'. */ + verify (sizeof (TCHAR_T) == 1); + TCHAR_T *tmpsrc; + DCHAR_T *tmpdst; + size_t tmpdst_len; +# endif + size_t w; + + if (has_precision) + { + /* Use only as many wide characters as needed to produce + at most PRECISION bytes, from the left. */ +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + arg_end = arg; + characters = 0; + while (precision > 0) + { + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count; + + if (*arg_end == 0) + /* Found the terminating null wide character. */ + break; + count = local_wcrtomb (cbuf, *arg_end, &state); + if (count < 0) + { + /* Cannot convert. */ + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + if (precision < (unsigned int) count) + break; + arg_end++; + characters += count; + precision -= count; + } + } +# if DCHAR_IS_TCHAR + else if (has_width) +# else + else +# endif + { + /* Use the entire string, and count the number of + bytes. */ +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + arg_end = arg; + characters = 0; + for (;;) + { + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count; + + if (*arg_end == 0) + /* Found the terminating null wide character. */ + break; + count = local_wcrtomb (cbuf, *arg_end, &state); + if (count < 0) + { + /* Cannot convert. */ + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + arg_end++; + characters += count; + } + } +# if DCHAR_IS_TCHAR + else + { + /* Use the entire string. */ + arg_end = arg + local_wcslen (arg); + /* The number of bytes doesn't matter. */ + characters = 0; + } +# endif + +# if !DCHAR_IS_TCHAR + /* Convert the string into a piece of temporary memory. */ + tmpsrc = (TCHAR_T *) malloc (characters * sizeof (TCHAR_T)); + if (tmpsrc == NULL) + goto out_of_memory; + { + TCHAR_T *tmpptr = tmpsrc; + size_t remaining; +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + for (remaining = characters; remaining > 0; ) + { + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count; + + if (*arg == 0) + abort (); + count = local_wcrtomb (cbuf, *arg, &state); + if (count <= 0) + /* Inconsistency. */ + abort (); + memcpy (tmpptr, cbuf, count); + tmpptr += count; + arg++; + remaining -= count; + } + if (!(arg == arg_end)) + abort (); + } + + /* Convert from TCHAR_T[] to DCHAR_T[]. */ + tmpdst = + DCHAR_CONV_FROM_ENCODING (locale_charset (), + iconveh_question_mark, + tmpsrc, characters, + NULL, + NULL, &tmpdst_len); + if (tmpdst == NULL) + { + int saved_errno = errno; + free (tmpsrc); + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = saved_errno; + return NULL; + } + free (tmpsrc); +# endif + + if (has_width) + { +# if ENABLE_UNISTDIO + /* Outside POSIX, it's preferable to compare the width + against the number of _characters_ of the converted + value. */ + w = DCHAR_MBSNLEN (result + length, characters); +# else + /* The width is compared against the number of _bytes_ + of the converted value, says POSIX. */ + w = characters; +# endif + } + else + /* w doesn't matter. */ + w = 0; + + if (w < width && !(dp->flags & FLAG_LEFT)) + { + size_t n = width - w; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + +# if DCHAR_IS_TCHAR + if (has_precision || has_width) + { + /* We know the number of bytes in advance. */ + size_t remaining; +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + ENSURE_ALLOCATION (xsum (length, characters)); + for (remaining = characters; remaining > 0; ) + { + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count; + + if (*arg == 0) + abort (); + count = local_wcrtomb (cbuf, *arg, &state); + if (count <= 0) + /* Inconsistency. */ + abort (); + memcpy (result + length, cbuf, count); + length += count; + arg++; + remaining -= count; + } + if (!(arg == arg_end)) + abort (); + } + else + { +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + while (arg < arg_end) + { + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count; + + if (*arg == 0) + abort (); + count = local_wcrtomb (cbuf, *arg, &state); + if (count <= 0) + { + /* Cannot convert. */ + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EILSEQ; + return NULL; + } + ENSURE_ALLOCATION (xsum (length, count)); + memcpy (result + length, cbuf, count); + length += count; + arg++; + } + } +# else + ENSURE_ALLOCATION (xsum (length, tmpdst_len)); + DCHAR_CPY (result + length, tmpdst, tmpdst_len); + free (tmpdst); + length += tmpdst_len; +# endif + + if (w < width && (dp->flags & FLAG_LEFT)) + { + size_t n = width - w; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + } +# endif + } +#endif +#if ENABLE_WCHAR_FALLBACK && HAVE_WINT_T && !WIDE_CHAR_VERSION + else if (dp->conversion == 'c' + && a.arg[dp->arg_index].type == TYPE_WIDE_CHAR) + { + /* Implement the 'lc' directive ourselves, in order to provide + the fallback that avoids EILSEQ. */ + int flags = dp->flags; + int has_width; + size_t width; + + has_width = 0; + width = 0; + if (dp->width_start != dp->width_end) + { + if (dp->width_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->width_arg_index].a.a_int; + width = arg; + if (arg < 0) + { + /* "A negative field width is taken as a '-' flag + followed by a positive field width." */ + flags |= FLAG_LEFT; + width = -width; + } + } + else + { + const FCHAR_T *digitp = dp->width_start; + + do + width = xsum (xtimes (width, 10), *digitp++ - '0'); + while (digitp != dp->width_end); + } + has_width = 1; + } + + /* %lc in vasnprintf. See the specification of fprintf. */ + { + wchar_t arg = (wchar_t) a.arg[dp->arg_index].a.a_wide_char; + size_t characters; +# if !DCHAR_IS_TCHAR + /* This code assumes that TCHAR_T is 'char'. */ + verify (sizeof (TCHAR_T) == 1); + TCHAR_T tmpsrc[64]; /* Assume MB_CUR_MAX <= 64. */ + DCHAR_T *tmpdst; + size_t tmpdst_len; +# endif + size_t w; + +# if DCHAR_IS_TCHAR + if (has_width) +# endif + { + /* Count the number of bytes. */ + characters = 0; + if (arg != 0) + { + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count; +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + + count = local_wcrtomb (cbuf, arg, &state); + if (count < 0) + /* Inconsistency. */ + abort (); + characters = count; + } + } +# if DCHAR_IS_TCHAR + else + { + /* The number of bytes doesn't matter. */ + characters = 0; + } +# endif + +# if !DCHAR_IS_TCHAR + /* Convert the string into a piece of temporary memory. */ + if (characters > 0) /* implies arg != 0 */ + { + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count; +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + + count = local_wcrtomb (cbuf, arg, &state); + if (count <= 0) + /* Inconsistency. */ + abort (); + memcpy (tmpsrc, cbuf, count); + } + + /* Convert from TCHAR_T[] to DCHAR_T[]. */ + tmpdst = + DCHAR_CONV_FROM_ENCODING (locale_charset (), + iconveh_question_mark, + tmpsrc, characters, + NULL, + NULL, &tmpdst_len); + if (tmpdst == NULL) + { + int saved_errno = errno; + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = saved_errno; + return NULL; + } +# endif + + if (has_width) + { +# if ENABLE_UNISTDIO + /* Outside POSIX, it's preferable to compare the width + against the number of _characters_ of the converted + value. */ + w = DCHAR_MBSNLEN (result + length, characters); +# else + /* The width is compared against the number of _bytes_ + of the converted value, says POSIX. */ + w = characters; +# endif + } + else + /* w doesn't matter. */ + w = 0; + + if (w < width && !(dp->flags & FLAG_LEFT)) + { + size_t n = width - w; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + +# if DCHAR_IS_TCHAR + if (has_width) + { + /* We know the number of bytes in advance. */ + ENSURE_ALLOCATION (xsum (length, characters)); + if (characters > 0) /* implies arg != 0 */ + { + int count; +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + + count = local_wcrtomb (result + length, arg, &state); + if (count <= 0) + /* Inconsistency. */ + abort (); + length += count; + } + } + else + { + if (arg != 0) + { + char cbuf[64]; /* Assume MB_CUR_MAX <= 64. */ + int count; +# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t + mbstate_t state; + memset (&state, '\0', sizeof (mbstate_t)); +# endif + + count = local_wcrtomb (cbuf, arg, &state); + if (count <= 0) + /* Inconsistency. */ + abort (); + ENSURE_ALLOCATION (xsum (length, count)); + memcpy (result + length, cbuf, count); + length += count; + } + } +# else + ENSURE_ALLOCATION (xsum (length, tmpdst_len)); + DCHAR_CPY (result + length, tmpdst, tmpdst_len); + free (tmpdst); + length += tmpdst_len; +# endif + + if (w < width && (dp->flags & FLAG_LEFT)) + { + size_t n = width - w; + ENSURE_ALLOCATION (xsum (length, n)); + DCHAR_SET (result + length, ' ', n); + length += n; + } + } + } +#endif +#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL + else if ((dp->conversion == 'a' || dp->conversion == 'A') +# if !(NEED_PRINTF_DIRECTIVE_A || (NEED_PRINTF_LONG_DOUBLE && NEED_PRINTF_DOUBLE)) + && (0 +# if NEED_PRINTF_DOUBLE + || a.arg[dp->arg_index].type == TYPE_DOUBLE +# endif +# if NEED_PRINTF_LONG_DOUBLE + || a.arg[dp->arg_index].type == TYPE_LONGDOUBLE +# endif + ) +# endif + ) + { + arg_type type = a.arg[dp->arg_index].type; + int flags = dp->flags; + size_t width; + int has_precision; + size_t precision; + size_t tmp_length; + size_t count; + DCHAR_T tmpbuf[700]; + DCHAR_T *tmp; + DCHAR_T *pad_ptr; + DCHAR_T *p; + + width = 0; + if (dp->width_start != dp->width_end) + { + if (dp->width_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->width_arg_index].a.a_int; + width = arg; + if (arg < 0) + { + /* "A negative field width is taken as a '-' flag + followed by a positive field width." */ + flags |= FLAG_LEFT; + width = -width; + } + } + else + { + const FCHAR_T *digitp = dp->width_start; + + do + width = xsum (xtimes (width, 10), *digitp++ - '0'); + while (digitp != dp->width_end); + } + } + + has_precision = 0; + precision = 0; + if (dp->precision_start != dp->precision_end) + { + if (dp->precision_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->precision_arg_index].a.a_int; + /* "A negative precision is taken as if the precision + were omitted." */ + if (arg >= 0) + { + precision = arg; + has_precision = 1; + } + } + else + { + const FCHAR_T *digitp = dp->precision_start + 1; + + precision = 0; + while (digitp != dp->precision_end) + precision = xsum (xtimes (precision, 10), *digitp++ - '0'); + has_precision = 1; + } + } + + /* Allocate a temporary buffer of sufficient size. */ + if (type == TYPE_LONGDOUBLE) + tmp_length = + (unsigned int) ((LDBL_DIG + 1) + * 0.831 /* decimal -> hexadecimal */ + ) + + 1; /* turn floor into ceil */ + else + tmp_length = + (unsigned int) ((DBL_DIG + 1) + * 0.831 /* decimal -> hexadecimal */ + ) + + 1; /* turn floor into ceil */ + if (tmp_length < precision) + tmp_length = precision; + /* Account for sign, decimal point etc. */ + tmp_length = xsum (tmp_length, 12); + + if (tmp_length < width) + tmp_length = width; + + tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */ + + if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T)) + tmp = tmpbuf; + else + { + size_t tmp_memsize = xtimes (tmp_length, sizeof (DCHAR_T)); + + if (size_overflow_p (tmp_memsize)) + /* Overflow, would lead to out of memory. */ + goto out_of_memory; + tmp = (DCHAR_T *) malloc (tmp_memsize); + if (tmp == NULL) + /* Out of memory. */ + goto out_of_memory; + } + + pad_ptr = NULL; + p = tmp; + if (type == TYPE_LONGDOUBLE) + { +# if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE + long double arg = a.arg[dp->arg_index].a.a_longdouble; + + if (isnanl (arg)) + { + if (dp->conversion == 'A') + { + *p++ = 'N'; *p++ = 'A'; *p++ = 'N'; + } + else + { + *p++ = 'n'; *p++ = 'a'; *p++ = 'n'; + } + } + else + { + int sign = 0; + DECL_LONG_DOUBLE_ROUNDING + + BEGIN_LONG_DOUBLE_ROUNDING (); + + if (signbit (arg)) /* arg < 0.0L or negative zero */ + { + sign = -1; + arg = -arg; + } + + if (sign < 0) + *p++ = '-'; + else if (flags & FLAG_SHOWSIGN) + *p++ = '+'; + else if (flags & FLAG_SPACE) + *p++ = ' '; + + if (arg > 0.0L && arg + arg == arg) + { + if (dp->conversion == 'A') + { + *p++ = 'I'; *p++ = 'N'; *p++ = 'F'; + } + else + { + *p++ = 'i'; *p++ = 'n'; *p++ = 'f'; + } + } + else + { + int exponent; + long double mantissa; + + if (arg > 0.0L) + mantissa = printf_frexpl (arg, &exponent); + else + { + exponent = 0; + mantissa = 0.0L; + } + + if (has_precision + && precision < (unsigned int) ((LDBL_DIG + 1) * 0.831) + 1) + { + /* Round the mantissa. */ + long double tail = mantissa; + size_t q; + + for (q = precision; ; q--) + { + int digit = (int) tail; + tail -= digit; + if (q == 0) + { + if (digit & 1 ? tail >= 0.5L : tail > 0.5L) + tail = 1 - tail; + else + tail = - tail; + break; + } + tail *= 16.0L; + } + if (tail != 0.0L) + for (q = precision; q > 0; q--) + tail *= 0.0625L; + mantissa += tail; + } + + *p++ = '0'; + *p++ = dp->conversion - 'A' + 'X'; + pad_ptr = p; + { + int digit; + + digit = (int) mantissa; + mantissa -= digit; + *p++ = '0' + digit; + if ((flags & FLAG_ALT) + || mantissa > 0.0L || precision > 0) + { + *p++ = decimal_point_char (); + /* This loop terminates because we assume + that FLT_RADIX is a power of 2. */ + while (mantissa > 0.0L) + { + mantissa *= 16.0L; + digit = (int) mantissa; + mantissa -= digit; + *p++ = digit + + (digit < 10 + ? '0' + : dp->conversion - 10); + if (precision > 0) + precision--; + } + while (precision > 0) + { + *p++ = '0'; + precision--; + } + } + } + *p++ = dp->conversion - 'A' + 'P'; +# if WIDE_CHAR_VERSION + { + static const wchar_t decimal_format[] = + { '%', '+', 'd', '\0' }; + SNPRINTF (p, 6 + 1, decimal_format, exponent); + } + while (*p != '\0') + p++; +# else + if (sizeof (DCHAR_T) == 1) + { + sprintf ((char *) p, "%+d", exponent); + while (*p != '\0') + p++; + } + else + { + char expbuf[6 + 1]; + const char *ep; + sprintf (expbuf, "%+d", exponent); + for (ep = expbuf; (*p = *ep) != '\0'; ep++) + p++; + } +# endif + } + + END_LONG_DOUBLE_ROUNDING (); + } +# else + abort (); +# endif + } + else + { +# if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE + double arg = a.arg[dp->arg_index].a.a_double; + + if (isnand (arg)) + { + if (dp->conversion == 'A') + { + *p++ = 'N'; *p++ = 'A'; *p++ = 'N'; + } + else + { + *p++ = 'n'; *p++ = 'a'; *p++ = 'n'; + } + } + else + { + int sign = 0; + + if (signbit (arg)) /* arg < 0.0 or negative zero */ + { + sign = -1; + arg = -arg; + } + + if (sign < 0) + *p++ = '-'; + else if (flags & FLAG_SHOWSIGN) + *p++ = '+'; + else if (flags & FLAG_SPACE) + *p++ = ' '; + + if (arg > 0.0 && arg + arg == arg) + { + if (dp->conversion == 'A') + { + *p++ = 'I'; *p++ = 'N'; *p++ = 'F'; + } + else + { + *p++ = 'i'; *p++ = 'n'; *p++ = 'f'; + } + } + else + { + int exponent; + double mantissa; + + if (arg > 0.0) + mantissa = printf_frexp (arg, &exponent); + else + { + exponent = 0; + mantissa = 0.0; + } + + if (has_precision + && precision < (unsigned int) ((DBL_DIG + 1) * 0.831) + 1) + { + /* Round the mantissa. */ + double tail = mantissa; + size_t q; + + for (q = precision; ; q--) + { + int digit = (int) tail; + tail -= digit; + if (q == 0) + { + if (digit & 1 ? tail >= 0.5 : tail > 0.5) + tail = 1 - tail; + else + tail = - tail; + break; + } + tail *= 16.0; + } + if (tail != 0.0) + for (q = precision; q > 0; q--) + tail *= 0.0625; + mantissa += tail; + } + + *p++ = '0'; + *p++ = dp->conversion - 'A' + 'X'; + pad_ptr = p; + { + int digit; + + digit = (int) mantissa; + mantissa -= digit; + *p++ = '0' + digit; + if ((flags & FLAG_ALT) + || mantissa > 0.0 || precision > 0) + { + *p++ = decimal_point_char (); + /* This loop terminates because we assume + that FLT_RADIX is a power of 2. */ + while (mantissa > 0.0) + { + mantissa *= 16.0; + digit = (int) mantissa; + mantissa -= digit; + *p++ = digit + + (digit < 10 + ? '0' + : dp->conversion - 10); + if (precision > 0) + precision--; + } + while (precision > 0) + { + *p++ = '0'; + precision--; + } + } + } + *p++ = dp->conversion - 'A' + 'P'; +# if WIDE_CHAR_VERSION + { + static const wchar_t decimal_format[] = + { '%', '+', 'd', '\0' }; + SNPRINTF (p, 6 + 1, decimal_format, exponent); + } + while (*p != '\0') + p++; +# else + if (sizeof (DCHAR_T) == 1) + { + sprintf ((char *) p, "%+d", exponent); + while (*p != '\0') + p++; + } + else + { + char expbuf[6 + 1]; + const char *ep; + sprintf (expbuf, "%+d", exponent); + for (ep = expbuf; (*p = *ep) != '\0'; ep++) + p++; + } +# endif + } + } +# else + abort (); +# endif + } + + /* The generated string now extends from tmp to p, with the + zero padding insertion point being at pad_ptr. */ + count = p - tmp; + + if (count < width) + { + size_t pad = width - count; + DCHAR_T *end = p + pad; + + if (flags & FLAG_LEFT) + { + /* Pad with spaces on the right. */ + for (; pad > 0; pad--) + *p++ = ' '; + } + else if ((flags & FLAG_ZERO) && pad_ptr != NULL) + { + /* Pad with zeroes. */ + DCHAR_T *q = end; + + while (p > pad_ptr) + *--q = *--p; + for (; pad > 0; pad--) + *p++ = '0'; + } + else + { + /* Pad with spaces on the left. */ + DCHAR_T *q = end; + + while (p > tmp) + *--q = *--p; + for (; pad > 0; pad--) + *p++ = ' '; + } + + p = end; + } + + count = p - tmp; + + if (count >= tmp_length) + /* tmp_length was incorrectly calculated - fix the + code above! */ + abort (); + + /* Make room for the result. */ + if (count >= allocated - length) + { + size_t n = xsum (length, count); + + ENSURE_ALLOCATION (n); + } + + /* Append the result. */ + memcpy (result + length, tmp, count * sizeof (DCHAR_T)); + if (tmp != tmpbuf) + free (tmp); + length += count; + } +#endif +#if (NEED_PRINTF_INFINITE_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL + else if ((dp->conversion == 'f' || dp->conversion == 'F' + || dp->conversion == 'e' || dp->conversion == 'E' + || dp->conversion == 'g' || dp->conversion == 'G' + || dp->conversion == 'a' || dp->conversion == 'A') + && (0 +# if NEED_PRINTF_DOUBLE + || a.arg[dp->arg_index].type == TYPE_DOUBLE +# elif NEED_PRINTF_INFINITE_DOUBLE + || (a.arg[dp->arg_index].type == TYPE_DOUBLE + /* The systems (mingw) which produce wrong output + for Inf, -Inf, and NaN also do so for -0.0. + Therefore we treat this case here as well. */ + && is_infinite_or_zero (a.arg[dp->arg_index].a.a_double)) +# endif +# if NEED_PRINTF_LONG_DOUBLE + || a.arg[dp->arg_index].type == TYPE_LONGDOUBLE +# elif NEED_PRINTF_INFINITE_LONG_DOUBLE + || (a.arg[dp->arg_index].type == TYPE_LONGDOUBLE + /* Some systems produce wrong output for Inf, + -Inf, and NaN. Some systems in this category + (IRIX 5.3) also do so for -0.0. Therefore we + treat this case here as well. */ + && is_infinite_or_zerol (a.arg[dp->arg_index].a.a_longdouble)) +# endif + )) + { +# if (NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE) + arg_type type = a.arg[dp->arg_index].type; +# endif + int flags = dp->flags; + size_t width; + size_t count; + int has_precision; + size_t precision; + size_t tmp_length; + DCHAR_T tmpbuf[700]; + DCHAR_T *tmp; + DCHAR_T *pad_ptr; + DCHAR_T *p; + + width = 0; + if (dp->width_start != dp->width_end) + { + if (dp->width_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->width_arg_index].a.a_int; + width = arg; + if (arg < 0) + { + /* "A negative field width is taken as a '-' flag + followed by a positive field width." */ + flags |= FLAG_LEFT; + width = -width; + } + } + else + { + const FCHAR_T *digitp = dp->width_start; + + do + width = xsum (xtimes (width, 10), *digitp++ - '0'); + while (digitp != dp->width_end); + } + } + + has_precision = 0; + precision = 0; + if (dp->precision_start != dp->precision_end) + { + if (dp->precision_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->precision_arg_index].a.a_int; + /* "A negative precision is taken as if the precision + were omitted." */ + if (arg >= 0) + { + precision = arg; + has_precision = 1; + } + } + else + { + const FCHAR_T *digitp = dp->precision_start + 1; + + precision = 0; + while (digitp != dp->precision_end) + precision = xsum (xtimes (precision, 10), *digitp++ - '0'); + has_precision = 1; + } + } + + /* POSIX specifies the default precision to be 6 for %f, %F, + %e, %E, but not for %g, %G. Implementations appear to use + the same default precision also for %g, %G. But for %a, %A, + the default precision is 0. */ + if (!has_precision) + if (!(dp->conversion == 'a' || dp->conversion == 'A')) + precision = 6; + + /* Allocate a temporary buffer of sufficient size. */ +# if NEED_PRINTF_DOUBLE && NEED_PRINTF_LONG_DOUBLE + tmp_length = (type == TYPE_LONGDOUBLE ? LDBL_DIG + 1 : DBL_DIG + 1); +# elif NEED_PRINTF_INFINITE_DOUBLE && NEED_PRINTF_LONG_DOUBLE + tmp_length = (type == TYPE_LONGDOUBLE ? LDBL_DIG + 1 : 0); +# elif NEED_PRINTF_LONG_DOUBLE + tmp_length = LDBL_DIG + 1; +# elif NEED_PRINTF_DOUBLE + tmp_length = DBL_DIG + 1; +# else + tmp_length = 0; +# endif + if (tmp_length < precision) + tmp_length = precision; +# if NEED_PRINTF_LONG_DOUBLE +# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE + if (type == TYPE_LONGDOUBLE) +# endif + if (dp->conversion == 'f' || dp->conversion == 'F') + { + long double arg = a.arg[dp->arg_index].a.a_longdouble; + if (!(isnanl (arg) || arg + arg == arg)) + { + /* arg is finite and nonzero. */ + int exponent = floorlog10l (arg < 0 ? -arg : arg); + if (exponent >= 0 && tmp_length < exponent + precision) + tmp_length = exponent + precision; + } + } +# endif +# if NEED_PRINTF_DOUBLE +# if NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE + if (type == TYPE_DOUBLE) +# endif + if (dp->conversion == 'f' || dp->conversion == 'F') + { + double arg = a.arg[dp->arg_index].a.a_double; + if (!(isnand (arg) || arg + arg == arg)) + { + /* arg is finite and nonzero. */ + int exponent = floorlog10 (arg < 0 ? -arg : arg); + if (exponent >= 0 && tmp_length < exponent + precision) + tmp_length = exponent + precision; + } + } +# endif + /* Account for sign, decimal point etc. */ + tmp_length = xsum (tmp_length, 12); + + if (tmp_length < width) + tmp_length = width; + + tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */ + + if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T)) + tmp = tmpbuf; + else + { + size_t tmp_memsize = xtimes (tmp_length, sizeof (DCHAR_T)); + + if (size_overflow_p (tmp_memsize)) + /* Overflow, would lead to out of memory. */ + goto out_of_memory; + tmp = (DCHAR_T *) malloc (tmp_memsize); + if (tmp == NULL) + /* Out of memory. */ + goto out_of_memory; + } + + pad_ptr = NULL; + p = tmp; + +# if NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE +# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE + if (type == TYPE_LONGDOUBLE) +# endif + { + long double arg = a.arg[dp->arg_index].a.a_longdouble; + + if (isnanl (arg)) + { + if (dp->conversion >= 'A' && dp->conversion <= 'Z') + { + *p++ = 'N'; *p++ = 'A'; *p++ = 'N'; + } + else + { + *p++ = 'n'; *p++ = 'a'; *p++ = 'n'; + } + } + else + { + int sign = 0; + DECL_LONG_DOUBLE_ROUNDING + + BEGIN_LONG_DOUBLE_ROUNDING (); + + if (signbit (arg)) /* arg < 0.0L or negative zero */ + { + sign = -1; + arg = -arg; + } + + if (sign < 0) + *p++ = '-'; + else if (flags & FLAG_SHOWSIGN) + *p++ = '+'; + else if (flags & FLAG_SPACE) + *p++ = ' '; + + if (arg > 0.0L && arg + arg == arg) + { + if (dp->conversion >= 'A' && dp->conversion <= 'Z') + { + *p++ = 'I'; *p++ = 'N'; *p++ = 'F'; + } + else + { + *p++ = 'i'; *p++ = 'n'; *p++ = 'f'; + } + } + else + { +# if NEED_PRINTF_LONG_DOUBLE + pad_ptr = p; + + if (dp->conversion == 'f' || dp->conversion == 'F') + { + char *digits; + size_t ndigits; + + digits = + scale10_round_decimal_long_double (arg, precision); + if (digits == NULL) + { + END_LONG_DOUBLE_ROUNDING (); + goto out_of_memory; + } + ndigits = strlen (digits); + + if (ndigits > precision) + do + { + --ndigits; + *p++ = digits[ndigits]; + } + while (ndigits > precision); + else + *p++ = '0'; + /* Here ndigits <= precision. */ + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + for (; precision > ndigits; precision--) + *p++ = '0'; + while (ndigits > 0) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + + free (digits); + } + else if (dp->conversion == 'e' || dp->conversion == 'E') + { + int exponent; + + if (arg == 0.0L) + { + exponent = 0; + *p++ = '0'; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + for (; precision > 0; precision--) + *p++ = '0'; + } + } + else + { + /* arg > 0.0L. */ + int adjusted; + char *digits; + size_t ndigits; + + exponent = floorlog10l (arg); + adjusted = 0; + for (;;) + { + digits = + scale10_round_decimal_long_double (arg, + (int)precision - exponent); + if (digits == NULL) + { + END_LONG_DOUBLE_ROUNDING (); + goto out_of_memory; + } + ndigits = strlen (digits); + + if (ndigits == precision + 1) + break; + if (ndigits < precision + || ndigits > precision + 2) + /* The exponent was not guessed + precisely enough. */ + abort (); + if (adjusted) + /* None of two values of exponent is + the right one. Prevent an endless + loop. */ + abort (); + free (digits); + if (ndigits == precision) + exponent -= 1; + else + exponent += 1; + adjusted = 1; + } + /* Here ndigits = precision+1. */ + if (is_borderline (digits, precision)) + { + /* Maybe the exponent guess was too high + and a smaller exponent can be reached + by turning a 10...0 into 9...9x. */ + char *digits2 = + scale10_round_decimal_long_double (arg, + (int)precision - exponent + 1); + if (digits2 == NULL) + { + free (digits); + END_LONG_DOUBLE_ROUNDING (); + goto out_of_memory; + } + if (strlen (digits2) == precision + 1) + { + free (digits); + digits = digits2; + exponent -= 1; + } + else + free (digits2); + } + /* Here ndigits = precision+1. */ + + *p++ = digits[--ndigits]; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + while (ndigits > 0) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + + free (digits); + } + + *p++ = dp->conversion; /* 'e' or 'E' */ +# if WIDE_CHAR_VERSION + { + static const wchar_t decimal_format[] = + { '%', '+', '.', '2', 'd', '\0' }; + SNPRINTF (p, 6 + 1, decimal_format, exponent); + } + while (*p != '\0') + p++; +# else + if (sizeof (DCHAR_T) == 1) + { + sprintf ((char *) p, "%+.2d", exponent); + while (*p != '\0') + p++; + } + else + { + char expbuf[6 + 1]; + const char *ep; + sprintf (expbuf, "%+.2d", exponent); + for (ep = expbuf; (*p = *ep) != '\0'; ep++) + p++; + } +# endif + } + else if (dp->conversion == 'g' || dp->conversion == 'G') + { + if (precision == 0) + precision = 1; + /* precision >= 1. */ + + if (arg == 0.0L) + /* The exponent is 0, >= -4, < precision. + Use fixed-point notation. */ + { + size_t ndigits = precision; + /* Number of trailing zeroes that have to be + dropped. */ + size_t nzeroes = + (flags & FLAG_ALT ? 0 : precision - 1); + + --ndigits; + *p++ = '0'; + if ((flags & FLAG_ALT) || ndigits > nzeroes) + { + *p++ = decimal_point_char (); + while (ndigits > nzeroes) + { + --ndigits; + *p++ = '0'; + } + } + } + else + { + /* arg > 0.0L. */ + int exponent; + int adjusted; + char *digits; + size_t ndigits; + size_t nzeroes; + + exponent = floorlog10l (arg); + adjusted = 0; + for (;;) + { + digits = + scale10_round_decimal_long_double (arg, + (int)(precision - 1) - exponent); + if (digits == NULL) + { + END_LONG_DOUBLE_ROUNDING (); + goto out_of_memory; + } + ndigits = strlen (digits); + + if (ndigits == precision) + break; + if (ndigits < precision - 1 + || ndigits > precision + 1) + /* The exponent was not guessed + precisely enough. */ + abort (); + if (adjusted) + /* None of two values of exponent is + the right one. Prevent an endless + loop. */ + abort (); + free (digits); + if (ndigits < precision) + exponent -= 1; + else + exponent += 1; + adjusted = 1; + } + /* Here ndigits = precision. */ + if (is_borderline (digits, precision - 1)) + { + /* Maybe the exponent guess was too high + and a smaller exponent can be reached + by turning a 10...0 into 9...9x. */ + char *digits2 = + scale10_round_decimal_long_double (arg, + (int)(precision - 1) - exponent + 1); + if (digits2 == NULL) + { + free (digits); + END_LONG_DOUBLE_ROUNDING (); + goto out_of_memory; + } + if (strlen (digits2) == precision) + { + free (digits); + digits = digits2; + exponent -= 1; + } + else + free (digits2); + } + /* Here ndigits = precision. */ + + /* Determine the number of trailing zeroes + that have to be dropped. */ + nzeroes = 0; + if ((flags & FLAG_ALT) == 0) + while (nzeroes < ndigits + && digits[nzeroes] == '0') + nzeroes++; + + /* The exponent is now determined. */ + if (exponent >= -4 + && exponent < (long)precision) + { + /* Fixed-point notation: + max(exponent,0)+1 digits, then the + decimal point, then the remaining + digits without trailing zeroes. */ + if (exponent >= 0) + { + size_t ecount = exponent + 1; + /* Note: count <= precision = ndigits. */ + for (; ecount > 0; ecount--) + *p++ = digits[--ndigits]; + if ((flags & FLAG_ALT) || ndigits > nzeroes) + { + *p++ = decimal_point_char (); + while (ndigits > nzeroes) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + } + else + { + size_t ecount = -exponent - 1; + *p++ = '0'; + *p++ = decimal_point_char (); + for (; ecount > 0; ecount--) + *p++ = '0'; + while (ndigits > nzeroes) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + } + else + { + /* Exponential notation. */ + *p++ = digits[--ndigits]; + if ((flags & FLAG_ALT) || ndigits > nzeroes) + { + *p++ = decimal_point_char (); + while (ndigits > nzeroes) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + *p++ = dp->conversion - 'G' + 'E'; /* 'e' or 'E' */ +# if WIDE_CHAR_VERSION + { + static const wchar_t decimal_format[] = + { '%', '+', '.', '2', 'd', '\0' }; + SNPRINTF (p, 6 + 1, decimal_format, exponent); + } + while (*p != '\0') + p++; +# else + if (sizeof (DCHAR_T) == 1) + { + sprintf ((char *) p, "%+.2d", exponent); + while (*p != '\0') + p++; + } + else + { + char expbuf[6 + 1]; + const char *ep; + sprintf (expbuf, "%+.2d", exponent); + for (ep = expbuf; (*p = *ep) != '\0'; ep++) + p++; + } +# endif + } + + free (digits); + } + } + else + abort (); +# else + /* arg is finite. */ + if (!(arg == 0.0L)) + abort (); + + pad_ptr = p; + + if (dp->conversion == 'f' || dp->conversion == 'F') + { + *p++ = '0'; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + for (; precision > 0; precision--) + *p++ = '0'; + } + } + else if (dp->conversion == 'e' || dp->conversion == 'E') + { + *p++ = '0'; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + for (; precision > 0; precision--) + *p++ = '0'; + } + *p++ = dp->conversion; /* 'e' or 'E' */ + *p++ = '+'; + *p++ = '0'; + *p++ = '0'; + } + else if (dp->conversion == 'g' || dp->conversion == 'G') + { + *p++ = '0'; + if (flags & FLAG_ALT) + { + size_t ndigits = + (precision > 0 ? precision - 1 : 0); + *p++ = decimal_point_char (); + for (; ndigits > 0; --ndigits) + *p++ = '0'; + } + } + else if (dp->conversion == 'a' || dp->conversion == 'A') + { + *p++ = '0'; + *p++ = dp->conversion - 'A' + 'X'; + pad_ptr = p; + *p++ = '0'; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + for (; precision > 0; precision--) + *p++ = '0'; + } + *p++ = dp->conversion - 'A' + 'P'; + *p++ = '+'; + *p++ = '0'; + } + else + abort (); +# endif + } + + END_LONG_DOUBLE_ROUNDING (); + } + } +# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE + else +# endif +# endif +# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE + { + double arg = a.arg[dp->arg_index].a.a_double; + + if (isnand (arg)) + { + if (dp->conversion >= 'A' && dp->conversion <= 'Z') + { + *p++ = 'N'; *p++ = 'A'; *p++ = 'N'; + } + else + { + *p++ = 'n'; *p++ = 'a'; *p++ = 'n'; + } + } + else + { + int sign = 0; + + if (signbit (arg)) /* arg < 0.0 or negative zero */ + { + sign = -1; + arg = -arg; + } + + if (sign < 0) + *p++ = '-'; + else if (flags & FLAG_SHOWSIGN) + *p++ = '+'; + else if (flags & FLAG_SPACE) + *p++ = ' '; + + if (arg > 0.0 && arg + arg == arg) + { + if (dp->conversion >= 'A' && dp->conversion <= 'Z') + { + *p++ = 'I'; *p++ = 'N'; *p++ = 'F'; + } + else + { + *p++ = 'i'; *p++ = 'n'; *p++ = 'f'; + } + } + else + { +# if NEED_PRINTF_DOUBLE + pad_ptr = p; + + if (dp->conversion == 'f' || dp->conversion == 'F') + { + char *digits; + size_t ndigits; + + digits = + scale10_round_decimal_double (arg, precision); + if (digits == NULL) + goto out_of_memory; + ndigits = strlen (digits); + + if (ndigits > precision) + do + { + --ndigits; + *p++ = digits[ndigits]; + } + while (ndigits > precision); + else + *p++ = '0'; + /* Here ndigits <= precision. */ + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + for (; precision > ndigits; precision--) + *p++ = '0'; + while (ndigits > 0) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + + free (digits); + } + else if (dp->conversion == 'e' || dp->conversion == 'E') + { + int exponent; + + if (arg == 0.0) + { + exponent = 0; + *p++ = '0'; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + for (; precision > 0; precision--) + *p++ = '0'; + } + } + else + { + /* arg > 0.0. */ + int adjusted; + char *digits; + size_t ndigits; + + exponent = floorlog10 (arg); + adjusted = 0; + for (;;) + { + digits = + scale10_round_decimal_double (arg, + (int)precision - exponent); + if (digits == NULL) + goto out_of_memory; + ndigits = strlen (digits); + + if (ndigits == precision + 1) + break; + if (ndigits < precision + || ndigits > precision + 2) + /* The exponent was not guessed + precisely enough. */ + abort (); + if (adjusted) + /* None of two values of exponent is + the right one. Prevent an endless + loop. */ + abort (); + free (digits); + if (ndigits == precision) + exponent -= 1; + else + exponent += 1; + adjusted = 1; + } + /* Here ndigits = precision+1. */ + if (is_borderline (digits, precision)) + { + /* Maybe the exponent guess was too high + and a smaller exponent can be reached + by turning a 10...0 into 9...9x. */ + char *digits2 = + scale10_round_decimal_double (arg, + (int)precision - exponent + 1); + if (digits2 == NULL) + { + free (digits); + goto out_of_memory; + } + if (strlen (digits2) == precision + 1) + { + free (digits); + digits = digits2; + exponent -= 1; + } + else + free (digits2); + } + /* Here ndigits = precision+1. */ + + *p++ = digits[--ndigits]; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + while (ndigits > 0) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + + free (digits); + } + + *p++ = dp->conversion; /* 'e' or 'E' */ +# if WIDE_CHAR_VERSION + { + static const wchar_t decimal_format[] = + /* Produce the same number of exponent digits + as the native printf implementation. */ +# if defined _WIN32 && ! defined __CYGWIN__ + { '%', '+', '.', '3', 'd', '\0' }; +# else + { '%', '+', '.', '2', 'd', '\0' }; +# endif + SNPRINTF (p, 6 + 1, decimal_format, exponent); + } + while (*p != '\0') + p++; +# else + { + static const char decimal_format[] = + /* Produce the same number of exponent digits + as the native printf implementation. */ +# if defined _WIN32 && ! defined __CYGWIN__ + "%+.3d"; +# else + "%+.2d"; +# endif + if (sizeof (DCHAR_T) == 1) + { + sprintf ((char *) p, decimal_format, exponent); + while (*p != '\0') + p++; + } + else + { + char expbuf[6 + 1]; + const char *ep; + sprintf (expbuf, decimal_format, exponent); + for (ep = expbuf; (*p = *ep) != '\0'; ep++) + p++; + } + } +# endif + } + else if (dp->conversion == 'g' || dp->conversion == 'G') + { + if (precision == 0) + precision = 1; + /* precision >= 1. */ + + if (arg == 0.0) + /* The exponent is 0, >= -4, < precision. + Use fixed-point notation. */ + { + size_t ndigits = precision; + /* Number of trailing zeroes that have to be + dropped. */ + size_t nzeroes = + (flags & FLAG_ALT ? 0 : precision - 1); + + --ndigits; + *p++ = '0'; + if ((flags & FLAG_ALT) || ndigits > nzeroes) + { + *p++ = decimal_point_char (); + while (ndigits > nzeroes) + { + --ndigits; + *p++ = '0'; + } + } + } + else + { + /* arg > 0.0. */ + int exponent; + int adjusted; + char *digits; + size_t ndigits; + size_t nzeroes; + + exponent = floorlog10 (arg); + adjusted = 0; + for (;;) + { + digits = + scale10_round_decimal_double (arg, + (int)(precision - 1) - exponent); + if (digits == NULL) + goto out_of_memory; + ndigits = strlen (digits); + + if (ndigits == precision) + break; + if (ndigits < precision - 1 + || ndigits > precision + 1) + /* The exponent was not guessed + precisely enough. */ + abort (); + if (adjusted) + /* None of two values of exponent is + the right one. Prevent an endless + loop. */ + abort (); + free (digits); + if (ndigits < precision) + exponent -= 1; + else + exponent += 1; + adjusted = 1; + } + /* Here ndigits = precision. */ + if (is_borderline (digits, precision - 1)) + { + /* Maybe the exponent guess was too high + and a smaller exponent can be reached + by turning a 10...0 into 9...9x. */ + char *digits2 = + scale10_round_decimal_double (arg, + (int)(precision - 1) - exponent + 1); + if (digits2 == NULL) + { + free (digits); + goto out_of_memory; + } + if (strlen (digits2) == precision) + { + free (digits); + digits = digits2; + exponent -= 1; + } + else + free (digits2); + } + /* Here ndigits = precision. */ + + /* Determine the number of trailing zeroes + that have to be dropped. */ + nzeroes = 0; + if ((flags & FLAG_ALT) == 0) + while (nzeroes < ndigits + && digits[nzeroes] == '0') + nzeroes++; + + /* The exponent is now determined. */ + if (exponent >= -4 + && exponent < (long)precision) + { + /* Fixed-point notation: + max(exponent,0)+1 digits, then the + decimal point, then the remaining + digits without trailing zeroes. */ + if (exponent >= 0) + { + size_t ecount = exponent + 1; + /* Note: ecount <= precision = ndigits. */ + for (; ecount > 0; ecount--) + *p++ = digits[--ndigits]; + if ((flags & FLAG_ALT) || ndigits > nzeroes) + { + *p++ = decimal_point_char (); + while (ndigits > nzeroes) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + } + else + { + size_t ecount = -exponent - 1; + *p++ = '0'; + *p++ = decimal_point_char (); + for (; ecount > 0; ecount--) + *p++ = '0'; + while (ndigits > nzeroes) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + } + else + { + /* Exponential notation. */ + *p++ = digits[--ndigits]; + if ((flags & FLAG_ALT) || ndigits > nzeroes) + { + *p++ = decimal_point_char (); + while (ndigits > nzeroes) + { + --ndigits; + *p++ = digits[ndigits]; + } + } + *p++ = dp->conversion - 'G' + 'E'; /* 'e' or 'E' */ +# if WIDE_CHAR_VERSION + { + static const wchar_t decimal_format[] = + /* Produce the same number of exponent digits + as the native printf implementation. */ +# if defined _WIN32 && ! defined __CYGWIN__ + { '%', '+', '.', '3', 'd', '\0' }; +# else + { '%', '+', '.', '2', 'd', '\0' }; +# endif + SNPRINTF (p, 6 + 1, decimal_format, exponent); + } + while (*p != '\0') + p++; +# else + { + static const char decimal_format[] = + /* Produce the same number of exponent digits + as the native printf implementation. */ +# if defined _WIN32 && ! defined __CYGWIN__ + "%+.3d"; +# else + "%+.2d"; +# endif + if (sizeof (DCHAR_T) == 1) + { + sprintf ((char *) p, decimal_format, exponent); + while (*p != '\0') + p++; + } + else + { + char expbuf[6 + 1]; + const char *ep; + sprintf (expbuf, decimal_format, exponent); + for (ep = expbuf; (*p = *ep) != '\0'; ep++) + p++; + } + } +# endif + } + + free (digits); + } + } + else + abort (); +# else + /* arg is finite. */ + if (!(arg == 0.0)) + abort (); + + pad_ptr = p; + + if (dp->conversion == 'f' || dp->conversion == 'F') + { + *p++ = '0'; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + for (; precision > 0; precision--) + *p++ = '0'; + } + } + else if (dp->conversion == 'e' || dp->conversion == 'E') + { + *p++ = '0'; + if ((flags & FLAG_ALT) || precision > 0) + { + *p++ = decimal_point_char (); + for (; precision > 0; precision--) + *p++ = '0'; + } + *p++ = dp->conversion; /* 'e' or 'E' */ + *p++ = '+'; + /* Produce the same number of exponent digits as + the native printf implementation. */ +# if defined _WIN32 && ! defined __CYGWIN__ + *p++ = '0'; +# endif + *p++ = '0'; + *p++ = '0'; + } + else if (dp->conversion == 'g' || dp->conversion == 'G') + { + *p++ = '0'; + if (flags & FLAG_ALT) + { + size_t ndigits = + (precision > 0 ? precision - 1 : 0); + *p++ = decimal_point_char (); + for (; ndigits > 0; --ndigits) + *p++ = '0'; + } + } + else + abort (); +# endif + } + } + } +# endif + + /* The generated string now extends from tmp to p, with the + zero padding insertion point being at pad_ptr. */ + count = p - tmp; + + if (count < width) + { + size_t pad = width - count; + DCHAR_T *end = p + pad; + + if (flags & FLAG_LEFT) + { + /* Pad with spaces on the right. */ + for (; pad > 0; pad--) + *p++ = ' '; + } + else if ((flags & FLAG_ZERO) && pad_ptr != NULL) + { + /* Pad with zeroes. */ + DCHAR_T *q = end; + + while (p > pad_ptr) + *--q = *--p; + for (; pad > 0; pad--) + *p++ = '0'; + } + else + { + /* Pad with spaces on the left. */ + DCHAR_T *q = end; + + while (p > tmp) + *--q = *--p; + for (; pad > 0; pad--) + *p++ = ' '; + } + + p = end; + } + + count = p - tmp; + + if (count >= tmp_length) + /* tmp_length was incorrectly calculated - fix the + code above! */ + abort (); + + /* Make room for the result. */ + if (count >= allocated - length) + { + size_t n = xsum (length, count); + + ENSURE_ALLOCATION (n); + } + + /* Append the result. */ + memcpy (result + length, tmp, count * sizeof (DCHAR_T)); + if (tmp != tmpbuf) + free (tmp); + length += count; + } +#endif + else + { + arg_type type = a.arg[dp->arg_index].type; + int flags = dp->flags; +#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + int has_width; +#endif +#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + size_t width; +#endif +#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION + int has_precision; + size_t precision; +#endif +#if NEED_PRINTF_UNBOUNDED_PRECISION + int prec_ourselves; +#else +# define prec_ourselves 0 +#endif +#if NEED_PRINTF_FLAG_LEFTADJUST +# define pad_ourselves 1 +#elif !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + int pad_ourselves; +#else +# define pad_ourselves 0 +#endif + TCHAR_T *fbp; + unsigned int prefix_count; + int prefixes[2] IF_LINT (= { 0 }); + int orig_errno; +#if !USE_SNPRINTF + size_t tmp_length; + TCHAR_T tmpbuf[700]; + TCHAR_T *tmp; +#endif + +#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + has_width = 0; +#endif +#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + width = 0; + if (dp->width_start != dp->width_end) + { + if (dp->width_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->width_arg_index].a.a_int; + width = arg; + if (arg < 0) + { + /* "A negative field width is taken as a '-' flag + followed by a positive field width." */ + flags |= FLAG_LEFT; + width = -width; + } + } + else + { + const FCHAR_T *digitp = dp->width_start; + + do + width = xsum (xtimes (width, 10), *digitp++ - '0'); + while (digitp != dp->width_end); + } +#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + has_width = 1; +#endif + } +#endif + +#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION + has_precision = 0; + precision = 6; + if (dp->precision_start != dp->precision_end) + { + if (dp->precision_arg_index != ARG_NONE) + { + int arg; + + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) + abort (); + arg = a.arg[dp->precision_arg_index].a.a_int; + /* "A negative precision is taken as if the precision + were omitted." */ + if (arg >= 0) + { + precision = arg; + has_precision = 1; + } + } + else + { + const FCHAR_T *digitp = dp->precision_start + 1; + + precision = 0; + while (digitp != dp->precision_end) + precision = xsum (xtimes (precision, 10), *digitp++ - '0'); + has_precision = 1; + } + } +#endif + + /* Decide whether to handle the precision ourselves. */ +#if NEED_PRINTF_UNBOUNDED_PRECISION + switch (dp->conversion) + { + case 'd': case 'i': case 'u': + case 'o': + case 'x': case 'X': case 'p': + prec_ourselves = has_precision && (precision > 0); + break; + default: + prec_ourselves = 0; + break; + } +#endif + + /* Decide whether to perform the padding ourselves. */ +#if !NEED_PRINTF_FLAG_LEFTADJUST && (!DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION) + switch (dp->conversion) + { +# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO + /* If we need conversion from TCHAR_T[] to DCHAR_T[], we need + to perform the padding after this conversion. Functions + with unistdio extensions perform the padding based on + character count rather than element count. */ + case 'c': case 's': +# endif +# if NEED_PRINTF_FLAG_ZERO + case 'f': case 'F': case 'e': case 'E': case 'g': case 'G': + case 'a': case 'A': +# endif + pad_ourselves = 1; + break; + default: + pad_ourselves = prec_ourselves; + break; + } +#endif + +#if !USE_SNPRINTF + /* Allocate a temporary buffer of sufficient size for calling + sprintf. */ + tmp_length = + MAX_ROOM_NEEDED (&a, dp->arg_index, dp->conversion, type, + flags, width, has_precision, precision, + pad_ourselves); + + if (tmp_length <= sizeof (tmpbuf) / sizeof (TCHAR_T)) + tmp = tmpbuf; + else + { + size_t tmp_memsize = xtimes (tmp_length, sizeof (TCHAR_T)); + + if (size_overflow_p (tmp_memsize)) + /* Overflow, would lead to out of memory. */ + goto out_of_memory; + tmp = (TCHAR_T *) malloc (tmp_memsize); + if (tmp == NULL) + /* Out of memory. */ + goto out_of_memory; + } +#endif + + /* Construct the format string for calling snprintf or + sprintf. */ + fbp = buf; + *fbp++ = '%'; +#if NEED_PRINTF_FLAG_GROUPING + /* The underlying implementation doesn't support the ' flag. + Produce no grouping characters in this case; this is + acceptable because the grouping is locale dependent. */ +#else + if (flags & FLAG_GROUP) + *fbp++ = '\''; +#endif + if (flags & FLAG_LEFT) + *fbp++ = '-'; + if (flags & FLAG_SHOWSIGN) + *fbp++ = '+'; + if (flags & FLAG_SPACE) + *fbp++ = ' '; + if (flags & FLAG_ALT) + *fbp++ = '#'; +#if __GLIBC__ >= 2 && !defined __UCLIBC__ + if (flags & FLAG_LOCALIZED) + *fbp++ = 'I'; +#endif + if (!pad_ourselves) + { + if (flags & FLAG_ZERO) + *fbp++ = '0'; + if (dp->width_start != dp->width_end) + { + size_t n = dp->width_end - dp->width_start; + /* The width specification is known to consist only + of standard ASCII characters. */ + if (sizeof (FCHAR_T) == sizeof (TCHAR_T)) + { + memcpy (fbp, dp->width_start, n * sizeof (TCHAR_T)); + fbp += n; + } + else + { + const FCHAR_T *mp = dp->width_start; + do + *fbp++ = *mp++; + while (--n > 0); + } + } + } + if (!prec_ourselves) + { + if (dp->precision_start != dp->precision_end) + { + size_t n = dp->precision_end - dp->precision_start; + /* The precision specification is known to consist only + of standard ASCII characters. */ + if (sizeof (FCHAR_T) == sizeof (TCHAR_T)) + { + memcpy (fbp, dp->precision_start, n * sizeof (TCHAR_T)); + fbp += n; + } + else + { + const FCHAR_T *mp = dp->precision_start; + do + *fbp++ = *mp++; + while (--n > 0); + } + } + } + + switch (type) + { + case TYPE_LONGLONGINT: + case TYPE_ULONGLONGINT: +#if defined _WIN32 && ! defined __CYGWIN__ + *fbp++ = 'I'; + *fbp++ = '6'; + *fbp++ = '4'; + break; +#else + *fbp++ = 'l'; +#endif + FALLTHROUGH; + case TYPE_LONGINT: + case TYPE_ULONGINT: +#if HAVE_WINT_T + case TYPE_WIDE_CHAR: +#endif +#if HAVE_WCHAR_T + case TYPE_WIDE_STRING: +#endif + *fbp++ = 'l'; + break; + case TYPE_LONGDOUBLE: + *fbp++ = 'L'; + break; + default: + break; + } +#if NEED_PRINTF_DIRECTIVE_F + if (dp->conversion == 'F') + *fbp = 'f'; + else +#endif + *fbp = dp->conversion; +#if USE_SNPRINTF +# if ((HAVE_SNPRINTF_RETVAL_C99 && HAVE_SNPRINTF_TRUNCATION_C99) \ + || ((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) \ + && !defined __UCLIBC__) \ + || (defined __APPLE__ && defined __MACH__) \ + || defined __ANDROID__ \ + || (defined _WIN32 && ! defined __CYGWIN__)) + /* On systems where we know that snprintf's return value + conforms to ISO C 99 (HAVE_SNPRINTF_RETVAL_C99) and that + snprintf always produces NUL-terminated strings + (HAVE_SNPRINTF_TRUNCATION_C99), it is possible to avoid + using %n. And it is desirable to do so, because more and + more platforms no longer support %n, for "security reasons". + In particular, the following platforms: + - On glibc2 systems from 2004-10-18 or newer, the use of + %n in format strings in writable memory may crash the + program (if compiled with _FORTIFY_SOURCE=2). + - On Mac OS X 10.13 or newer, the use of %n in format + strings in writable memory by default crashes the + program. + - On Android, starting on 2018-03-07, the use of %n in + format strings produces a fatal error (see + ). + On these platforms, HAVE_SNPRINTF_RETVAL_C99 and + HAVE_SNPRINTF_TRUNCATION_C99 are 1. We have listed them + explicitly in the condition above, in case of cross- + compilation (just to be sure). */ + /* On native Windows systems (such as mingw), we can avoid using + %n because: + - Although the gl_SNPRINTF_TRUNCATION_C99 test fails, + snprintf does not write more than the specified number + of bytes. (snprintf (buf, 3, "%d %d", 4567, 89) writes + '4', '5', '6' into buf, not '4', '5', '\0'.) + - Although the gl_SNPRINTF_RETVAL_C99 test fails, snprintf + allows us to recognize the case of an insufficient + buffer size: it returns -1 in this case. + On native Windows systems (such as mingw) where the OS is + Windows Vista, the use of %n in format strings by default + crashes the program. See + and + + So we should avoid %n in this situation. */ + fbp[1] = '\0'; +# else /* AIX <= 5.1, HP-UX, IRIX, OSF/1, Solaris <= 9, BeOS */ + fbp[1] = '%'; + fbp[2] = 'n'; + fbp[3] = '\0'; +# endif +#else + fbp[1] = '\0'; +#endif + + /* Construct the arguments for calling snprintf or sprintf. */ + prefix_count = 0; + if (!pad_ourselves && dp->width_arg_index != ARG_NONE) + { + if (!(a.arg[dp->width_arg_index].type == TYPE_INT)) + abort (); + prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int; + } + if (!prec_ourselves && dp->precision_arg_index != ARG_NONE) + { + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT)) + abort (); + prefixes[prefix_count++] = a.arg[dp->precision_arg_index].a.a_int; + } + +#if USE_SNPRINTF + /* The SNPRINTF result is appended after result[0..length]. + The latter is an array of DCHAR_T; SNPRINTF appends an + array of TCHAR_T to it. This is possible because + sizeof (TCHAR_T) divides sizeof (DCHAR_T) and + alignof (TCHAR_T) <= alignof (DCHAR_T). */ +# define TCHARS_PER_DCHAR (sizeof (DCHAR_T) / sizeof (TCHAR_T)) + /* Ensure that maxlen below will be >= 2. Needed on BeOS, + where an snprintf() with maxlen==1 acts like sprintf(). */ + ENSURE_ALLOCATION (xsum (length, + (2 + TCHARS_PER_DCHAR - 1) + / TCHARS_PER_DCHAR)); + /* Prepare checking whether snprintf returns the count + via %n. */ + *(TCHAR_T *) (result + length) = '\0'; +#endif + + orig_errno = errno; + + for (;;) + { + int count = -1; + +#if USE_SNPRINTF + int retcount = 0; + size_t maxlen = allocated - length; + /* SNPRINTF can fail if its second argument is + > INT_MAX. */ + if (maxlen > INT_MAX / TCHARS_PER_DCHAR) + maxlen = INT_MAX / TCHARS_PER_DCHAR; + maxlen = maxlen * TCHARS_PER_DCHAR; +# define SNPRINTF_BUF(arg) \ + switch (prefix_count) \ + { \ + case 0: \ + retcount = SNPRINTF ((TCHAR_T *) (result + length), \ + maxlen, buf, \ + arg, &count); \ + break; \ + case 1: \ + retcount = SNPRINTF ((TCHAR_T *) (result + length), \ + maxlen, buf, \ + prefixes[0], arg, &count); \ + break; \ + case 2: \ + retcount = SNPRINTF ((TCHAR_T *) (result + length), \ + maxlen, buf, \ + prefixes[0], prefixes[1], arg, \ + &count); \ + break; \ + default: \ + abort (); \ + } +#else +# define SNPRINTF_BUF(arg) \ + switch (prefix_count) \ + { \ + case 0: \ + count = sprintf (tmp, buf, arg); \ + break; \ + case 1: \ + count = sprintf (tmp, buf, prefixes[0], arg); \ + break; \ + case 2: \ + count = sprintf (tmp, buf, prefixes[0], prefixes[1],\ + arg); \ + break; \ + default: \ + abort (); \ + } +#endif + + errno = 0; + switch (type) + { + case TYPE_SCHAR: + { + int arg = a.arg[dp->arg_index].a.a_schar; + SNPRINTF_BUF (arg); + } + break; + case TYPE_UCHAR: + { + unsigned int arg = a.arg[dp->arg_index].a.a_uchar; + SNPRINTF_BUF (arg); + } + break; + case TYPE_SHORT: + { + int arg = a.arg[dp->arg_index].a.a_short; + SNPRINTF_BUF (arg); + } + break; + case TYPE_USHORT: + { + unsigned int arg = a.arg[dp->arg_index].a.a_ushort; + SNPRINTF_BUF (arg); + } + break; + case TYPE_INT: + { + int arg = a.arg[dp->arg_index].a.a_int; + SNPRINTF_BUF (arg); + } + break; + case TYPE_UINT: + { + unsigned int arg = a.arg[dp->arg_index].a.a_uint; + SNPRINTF_BUF (arg); + } + break; + case TYPE_LONGINT: + { + long int arg = a.arg[dp->arg_index].a.a_longint; + SNPRINTF_BUF (arg); + } + break; + case TYPE_ULONGINT: + { + unsigned long int arg = a.arg[dp->arg_index].a.a_ulongint; + SNPRINTF_BUF (arg); + } + break; + case TYPE_LONGLONGINT: + { + long long int arg = a.arg[dp->arg_index].a.a_longlongint; + SNPRINTF_BUF (arg); + } + break; + case TYPE_ULONGLONGINT: + { + unsigned long long int arg = a.arg[dp->arg_index].a.a_ulonglongint; + SNPRINTF_BUF (arg); + } + break; + case TYPE_DOUBLE: + { + double arg = a.arg[dp->arg_index].a.a_double; + SNPRINTF_BUF (arg); + } + break; + case TYPE_LONGDOUBLE: + { + long double arg = a.arg[dp->arg_index].a.a_longdouble; + SNPRINTF_BUF (arg); + } + break; + case TYPE_CHAR: + { + int arg = a.arg[dp->arg_index].a.a_char; + SNPRINTF_BUF (arg); + } + break; +#if HAVE_WINT_T + case TYPE_WIDE_CHAR: + { + wint_t arg = a.arg[dp->arg_index].a.a_wide_char; + SNPRINTF_BUF (arg); + } + break; +#endif + case TYPE_STRING: + { + const char *arg = a.arg[dp->arg_index].a.a_string; + SNPRINTF_BUF (arg); + } + break; +#if HAVE_WCHAR_T + case TYPE_WIDE_STRING: + { + const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string; + SNPRINTF_BUF (arg); + } + break; +#endif + case TYPE_POINTER: + { + void *arg = a.arg[dp->arg_index].a.a_pointer; + SNPRINTF_BUF (arg); + } + break; + default: + abort (); + } + +#if USE_SNPRINTF + /* Portability: Not all implementations of snprintf() + are ISO C 99 compliant. Determine the number of + bytes that snprintf() has produced or would have + produced. */ + if (count >= 0) + { + /* Verify that snprintf() has NUL-terminated its + result. */ + if ((unsigned int) count < maxlen + && ((TCHAR_T *) (result + length)) [count] != '\0') + abort (); + /* Portability hack. */ + if (retcount > count) + count = retcount; + } + else + { + /* snprintf() doesn't understand the '%n' + directive. */ + if (fbp[1] != '\0') + { + /* Don't use the '%n' directive; instead, look + at the snprintf() return value. */ + fbp[1] = '\0'; + continue; + } + else + { + /* Look at the snprintf() return value. */ + if (retcount < 0) + { +# if !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF + /* HP-UX 10.20 snprintf() is doubly deficient: + It doesn't understand the '%n' directive, + *and* it returns -1 (rather than the length + that would have been required) when the + buffer is too small. + But a failure at this point can also come + from other reasons than a too small buffer, + such as an invalid wide string argument to + the %ls directive, or possibly an invalid + floating-point argument. */ + size_t tmp_length = + MAX_ROOM_NEEDED (&a, dp->arg_index, + dp->conversion, type, flags, + width, + has_precision, + precision, pad_ourselves); + + if (maxlen < tmp_length) + { + /* Make more room. But try to do through + this reallocation only once. */ + size_t bigger_need = + xsum (length, + xsum (tmp_length, + TCHARS_PER_DCHAR - 1) + / TCHARS_PER_DCHAR); + /* And always grow proportionally. + (There may be several arguments, each + needing a little more room than the + previous one.) */ + size_t bigger_need2 = + xsum (xtimes (allocated, 2), 12); + if (bigger_need < bigger_need2) + bigger_need = bigger_need2; + ENSURE_ALLOCATION (bigger_need); + continue; + } +# endif + } + else + count = retcount; + } + } +#endif + + /* Attempt to handle failure. */ + if (count < 0) + { + /* SNPRINTF or sprintf failed. Save and use the errno + that it has set, if any. */ + int saved_errno = errno; + if (saved_errno == 0) + { + if (dp->conversion == 'c' || dp->conversion == 's') + saved_errno = EILSEQ; + else + saved_errno = EINVAL; + } + + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + + errno = saved_errno; + return NULL; + } + +#if USE_SNPRINTF + /* Handle overflow of the allocated buffer. + If such an overflow occurs, a C99 compliant snprintf() + returns a count >= maxlen. However, a non-compliant + snprintf() function returns only count = maxlen - 1. To + cover both cases, test whether count >= maxlen - 1. */ + if ((unsigned int) count + 1 >= maxlen) + { + /* If maxlen already has attained its allowed maximum, + allocating more memory will not increase maxlen. + Instead of looping, bail out. */ + if (maxlen == INT_MAX / TCHARS_PER_DCHAR) + goto overflow; + else + { + /* Need at least (count + 1) * sizeof (TCHAR_T) + bytes. (The +1 is for the trailing NUL.) + But ask for (count + 2) * sizeof (TCHAR_T) + bytes, so that in the next round, we likely get + maxlen > (unsigned int) count + 1 + and so we don't get here again. + And allocate proportionally, to avoid looping + eternally if snprintf() reports a too small + count. */ + size_t n = + xmax (xsum (length, + ((unsigned int) count + 2 + + TCHARS_PER_DCHAR - 1) + / TCHARS_PER_DCHAR), + xtimes (allocated, 2)); + + ENSURE_ALLOCATION (n); + continue; + } + } +#endif + +#if NEED_PRINTF_UNBOUNDED_PRECISION + if (prec_ourselves) + { + /* Handle the precision. */ + TCHAR_T *prec_ptr = +# if USE_SNPRINTF + (TCHAR_T *) (result + length); +# else + tmp; +# endif + size_t prefix_count; + size_t move; + + prefix_count = 0; + /* Put the additional zeroes after the sign. */ + if (count >= 1 + && (*prec_ptr == '-' || *prec_ptr == '+' + || *prec_ptr == ' ')) + prefix_count = 1; + /* Put the additional zeroes after the 0x prefix if + (flags & FLAG_ALT) || (dp->conversion == 'p'). */ + else if (count >= 2 + && prec_ptr[0] == '0' + && (prec_ptr[1] == 'x' || prec_ptr[1] == 'X')) + prefix_count = 2; + + move = count - prefix_count; + if (precision > move) + { + /* Insert zeroes. */ + size_t insert = precision - move; + TCHAR_T *prec_end; + +# if USE_SNPRINTF + size_t n = + xsum (length, + (count + insert + TCHARS_PER_DCHAR - 1) + / TCHARS_PER_DCHAR); + length += (count + TCHARS_PER_DCHAR - 1) / TCHARS_PER_DCHAR; + ENSURE_ALLOCATION (n); + length -= (count + TCHARS_PER_DCHAR - 1) / TCHARS_PER_DCHAR; + prec_ptr = (TCHAR_T *) (result + length); +# endif + + prec_end = prec_ptr + count; + prec_ptr += prefix_count; + + while (prec_end > prec_ptr) + { + prec_end--; + prec_end[insert] = prec_end[0]; + } + + prec_end += insert; + do + *--prec_end = '0'; + while (prec_end > prec_ptr); + + count += insert; + } + } +#endif + +#if !USE_SNPRINTF + if (count >= tmp_length) + /* tmp_length was incorrectly calculated - fix the + code above! */ + abort (); +#endif + +#if !DCHAR_IS_TCHAR + /* Convert from TCHAR_T[] to DCHAR_T[]. */ + if (dp->conversion == 'c' || dp->conversion == 's') + { + /* type = TYPE_CHAR or TYPE_WIDE_CHAR or TYPE_STRING + TYPE_WIDE_STRING. + The result string is not certainly ASCII. */ + const TCHAR_T *tmpsrc; + DCHAR_T *tmpdst; + size_t tmpdst_len; + /* This code assumes that TCHAR_T is 'char'. */ + verify (sizeof (TCHAR_T) == 1); +# if USE_SNPRINTF + tmpsrc = (TCHAR_T *) (result + length); +# else + tmpsrc = tmp; +# endif + tmpdst = + DCHAR_CONV_FROM_ENCODING (locale_charset (), + iconveh_question_mark, + tmpsrc, count, + NULL, + NULL, &tmpdst_len); + if (tmpdst == NULL) + { + int saved_errno = errno; + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = saved_errno; + return NULL; + } + ENSURE_ALLOCATION (xsum (length, tmpdst_len)); + DCHAR_CPY (result + length, tmpdst, tmpdst_len); + free (tmpdst); + count = tmpdst_len; + } + else + { + /* The result string is ASCII. + Simple 1:1 conversion. */ +# if USE_SNPRINTF + /* If sizeof (DCHAR_T) == sizeof (TCHAR_T), it's a + no-op conversion, in-place on the array starting + at (result + length). */ + if (sizeof (DCHAR_T) != sizeof (TCHAR_T)) +# endif + { + const TCHAR_T *tmpsrc; + DCHAR_T *tmpdst; + size_t n; + +# if USE_SNPRINTF + if (result == resultbuf) + { + tmpsrc = (TCHAR_T *) (result + length); + /* ENSURE_ALLOCATION will not move tmpsrc + (because it's part of resultbuf). */ + ENSURE_ALLOCATION (xsum (length, count)); + } + else + { + /* ENSURE_ALLOCATION will move the array + (because it uses realloc(). */ + ENSURE_ALLOCATION (xsum (length, count)); + tmpsrc = (TCHAR_T *) (result + length); + } +# else + tmpsrc = tmp; + ENSURE_ALLOCATION (xsum (length, count)); +# endif + tmpdst = result + length; + /* Copy backwards, because of overlapping. */ + tmpsrc += count; + tmpdst += count; + for (n = count; n > 0; n--) + *--tmpdst = *--tmpsrc; + } + } +#endif + +#if DCHAR_IS_TCHAR && !USE_SNPRINTF + /* Make room for the result. */ + if (count > allocated - length) + { + /* Need at least count elements. But allocate + proportionally. */ + size_t n = + xmax (xsum (length, count), xtimes (allocated, 2)); + + ENSURE_ALLOCATION (n); + } +#endif + + /* Here count <= allocated - length. */ + + /* Perform padding. */ +#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION + if (pad_ourselves && has_width) + { + size_t w; +# if ENABLE_UNISTDIO + /* Outside POSIX, it's preferable to compare the width + against the number of _characters_ of the converted + value. */ + w = DCHAR_MBSNLEN (result + length, count); +# else + /* The width is compared against the number of _bytes_ + of the converted value, says POSIX. */ + w = count; +# endif + if (w < width) + { + size_t pad = width - w; + + /* Make room for the result. */ + if (xsum (count, pad) > allocated - length) + { + /* Need at least count + pad elements. But + allocate proportionally. */ + size_t n = + xmax (xsum3 (length, count, pad), + xtimes (allocated, 2)); + +# if USE_SNPRINTF + length += count; + ENSURE_ALLOCATION (n); + length -= count; +# else + ENSURE_ALLOCATION (n); +# endif + } + /* Here count + pad <= allocated - length. */ + + { +# if !DCHAR_IS_TCHAR || USE_SNPRINTF + DCHAR_T * const rp = result + length; +# else + DCHAR_T * const rp = tmp; +# endif + DCHAR_T *p = rp + count; + DCHAR_T *end = p + pad; + DCHAR_T *pad_ptr; +# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO + if (dp->conversion == 'c' + || dp->conversion == 's') + /* No zero-padding for string directives. */ + pad_ptr = NULL; + else +# endif + { + pad_ptr = (*rp == '-' ? rp + 1 : rp); + /* No zero-padding of "inf" and "nan". */ + if ((*pad_ptr >= 'A' && *pad_ptr <= 'Z') + || (*pad_ptr >= 'a' && *pad_ptr <= 'z')) + pad_ptr = NULL; + } + /* The generated string now extends from rp to p, + with the zero padding insertion point being at + pad_ptr. */ + + count = count + pad; /* = end - rp */ + + if (flags & FLAG_LEFT) + { + /* Pad with spaces on the right. */ + for (; pad > 0; pad--) + *p++ = ' '; + } + else if ((flags & FLAG_ZERO) && pad_ptr != NULL) + { + /* Pad with zeroes. */ + DCHAR_T *q = end; + + while (p > pad_ptr) + *--q = *--p; + for (; pad > 0; pad--) + *p++ = '0'; + } + else + { + /* Pad with spaces on the left. */ + DCHAR_T *q = end; + + while (p > rp) + *--q = *--p; + for (; pad > 0; pad--) + *p++ = ' '; + } + } + } + } +#endif + + /* Here still count <= allocated - length. */ + +#if !DCHAR_IS_TCHAR || USE_SNPRINTF + /* The snprintf() result did fit. */ +#else + /* Append the sprintf() result. */ + memcpy (result + length, tmp, count * sizeof (DCHAR_T)); +#endif +#if !USE_SNPRINTF + if (tmp != tmpbuf) + free (tmp); +#endif + +#if NEED_PRINTF_DIRECTIVE_F + if (dp->conversion == 'F') + { + /* Convert the %f result to upper case for %F. */ + DCHAR_T *rp = result + length; + size_t rc; + for (rc = count; rc > 0; rc--, rp++) + if (*rp >= 'a' && *rp <= 'z') + *rp = *rp - 'a' + 'A'; + } +#endif + + length += count; + break; + } + errno = orig_errno; +#undef pad_ourselves +#undef prec_ourselves + } + } + } + + /* Add the final NUL. */ + ENSURE_ALLOCATION (xsum (length, 1)); + result[length] = '\0'; + + if (result != resultbuf && length + 1 < allocated) + { + /* Shrink the allocated memory if possible. */ + DCHAR_T *memory; + + memory = (DCHAR_T *) realloc (result, (length + 1) * sizeof (DCHAR_T)); + if (memory != NULL) + result = memory; + } + + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + *lengthp = length; + /* Note that we can produce a big string of a length > INT_MAX. POSIX + says that snprintf() fails with errno = EOVERFLOW in this case, but + that's only because snprintf() returns an 'int'. This function does + not have this limitation. */ + return result; + +#if USE_SNPRINTF + overflow: + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + CLEANUP (); + errno = EOVERFLOW; + return NULL; +#endif + + out_of_memory: + if (!(result == resultbuf || result == NULL)) + free (result); + if (buf_malloced != NULL) + free (buf_malloced); + out_of_memory_1: + CLEANUP (); + errno = ENOMEM; + return NULL; + } +} + +#undef MAX_ROOM_NEEDED +#undef TCHARS_PER_DCHAR +#undef SNPRINTF +#undef USE_SNPRINTF +#undef DCHAR_SET +#undef DCHAR_CPY +#undef PRINTF_PARSE +#undef DIRECTIVES +#undef DIRECTIVE +#undef DCHAR_IS_TCHAR +#undef TCHAR_T +#undef DCHAR_T +#undef FCHAR_T +#undef VASNPRINTF diff -Nru datamash-1.7/lib/vasnprintf.h datamash-1.8/lib/vasnprintf.h --- datamash-1.7/lib/vasnprintf.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/vasnprintf.h 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,72 @@ +/* vsprintf with automatic memory allocation. + Copyright (C) 2002-2004, 2007-2021 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 _VASNPRINTF_H +#define _VASNPRINTF_H + +/* Get va_list. */ +#include + +/* Get size_t. */ +#include + +/* Get _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD. */ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Write formatted output to a string dynamically allocated with malloc(). + You can pass a preallocated buffer for the result in RESULTBUF and its + size in *LENGTHP; otherwise you pass RESULTBUF = NULL. + If successful, return the address of the string (this may be = RESULTBUF + if no dynamic memory allocation was necessary) and set *LENGTHP to the + number of resulting bytes, excluding the trailing NUL. Upon error, set + errno and return NULL. + + When dynamic memory allocation occurs, the preallocated buffer is left + alone (with possibly modified contents). This makes it possible to use + a statically allocated or stack-allocated buffer, like this: + + char buf[100]; + size_t len = sizeof (buf); + char *output = vasnprintf (buf, &len, format, args); + if (output == NULL) + ... error handling ...; + else + { + ... use the output string ...; + if (output != buf) + free (output); + } + */ +#if REPLACE_VASNPRINTF +# define asnprintf rpl_asnprintf +# define vasnprintf rpl_vasnprintf +#endif +extern char * asnprintf (char *restrict resultbuf, size_t *lengthp, + const char *format, ...) + _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 4)); +extern char * vasnprintf (char *restrict resultbuf, size_t *lengthp, + const char *format, va_list args) + _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 0)); + +#ifdef __cplusplus +} +#endif + +#endif /* _VASNPRINTF_H */ diff -Nru datamash-1.7/lib/verify.h datamash-1.8/lib/verify.h --- datamash-1.7/lib/verify.h 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/verify.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ /* Compile-time assert-like macros. - Copyright (C) 2005-2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2006, 2009-2021 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 @@ -23,11 +23,15 @@ /* Define _GL_HAVE__STATIC_ASSERT to 1 if _Static_assert (R, DIAGNOSTIC) works as per C11. This is supported by GCC 4.6.0 and later, in C - mode. + mode, and by clang (also in C++ mode). Define _GL_HAVE__STATIC_ASSERT1 to 1 if _Static_assert (R) works as - per C2X, and define _GL_HAVE_STATIC_ASSERT1 if static_assert (R) - works as per C++17. This is supported by GCC 9.1 and later. + per C2X. This is supported by GCC 9.1 and later, and by clang in + C++1z mode. + + Define _GL_HAVE_STATIC_ASSERT1 if static_assert (R) works as per + C++17. This is supported by GCC 9.1 and later, and by clang in + C++1z mode. Support compilers claiming conformance to the relevant standard, and also support GCC when not pedantic. If we were willing to slow @@ -35,7 +39,8 @@ since this affects only the quality of diagnostics, why bother? */ #ifndef __cplusplus # if (201112L <= __STDC_VERSION__ \ - || (!defined __STRICT_ANSI__ && 4 < __GNUC__ + (6 <= __GNUC_MINOR__))) + || (!defined __STRICT_ANSI__ \ + && (4 < __GNUC__ + (6 <= __GNUC_MINOR__) || 4 <= __clang_major__))) # define _GL_HAVE__STATIC_ASSERT 1 # endif # if (202000L <= __STDC_VERSION__ \ @@ -43,7 +48,15 @@ # define _GL_HAVE__STATIC_ASSERT1 1 # endif #else -# if 201703L <= __cplusplus || 9 <= __GNUC__ +# if 4 <= __clang_major__ +# define _GL_HAVE__STATIC_ASSERT 1 +# endif +# if 4 <= __clang_major__ && 201411 <= __cpp_static_assert +# define _GL_HAVE__STATIC_ASSERT1 1 +# endif +# if 201703L <= __cplusplus \ + || 9 <= __GNUC__ \ + || (4 <= __clang_major__ && 201411 <= __cpp_static_assert) # define _GL_HAVE_STATIC_ASSERT1 1 # endif #endif @@ -277,10 +290,27 @@ #endif /* Assume that R always holds. Behavior is undefined if R is false, - fails to evaluate, or has side effects. Although assuming R can - help a compiler generate better code or diagnostics, performance - can suffer if R uses hard-to-optimize features such as function - calls not inlined by the compiler. */ + fails to evaluate, or has side effects. + + 'assume (R)' is a directive from the programmer telling the + compiler that R is true so the compiler needn't generate code to + test R. This is why 'assume' is in verify.h: it's related to + static checking (in this case, static checking done by the + programmer), not dynamic checking. + + 'assume (R)' can affect compilation of all the code, not just code + that happens to be executed after the assume (R) is "executed". + For example, if the code mistakenly does 'assert (R); assume (R);' + the compiler is entitled to optimize away the 'assert (R)'. + + Although assuming R can help a compiler generate better code or + diagnostics, performance can suffer if R uses hard-to-optimize + features such as function calls not inlined by the compiler. + + Avoid Clang's __builtin_assume, as it breaks GNU Emacs master + as of 2020-08-23T21:09:49Z!eggert@cs.ucla.edu; see + . It's not known whether this breakage + is a Clang bug or an Emacs bug; play it safe for now. */ #if _GL_HAS_BUILTIN_UNREACHABLE # define assume(R) ((R) ? (void) 0 : __builtin_unreachable ()) diff -Nru datamash-1.7/lib/version-etc.c datamash-1.8/lib/version-etc.c --- datamash-1.7/lib/version-etc.c 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/version-etc.c 2022-07-04 21:12:01.000000000 +0000 @@ -1,5 +1,5 @@ /* Print --version and bug-reporting information in a consistent format. - Copyright (C) 1999-2020 Free Software Foundation, Inc. + Copyright (C) 1999-2021 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 @@ -37,7 +37,7 @@ # define PACKAGE PACKAGE_TARNAME #endif -enum { COPYRIGHT_YEAR = 2020 }; +enum { COPYRIGHT_YEAR = 2022 }; /* The three functions below display the --version information the standard way. diff -Nru datamash-1.7/lib/version-etc.h datamash-1.8/lib/version-etc.h --- datamash-1.7/lib/version-etc.h 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/version-etc.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Print --version and bug-reporting information in a consistent format. - Copyright (C) 1999, 2003, 2005, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 1999, 2003, 2005, 2009-2021 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 @@ -22,15 +22,6 @@ # include # include -/* The 'sentinel' attribute was added in gcc 4.0. */ -#ifndef _GL_ATTRIBUTE_SENTINEL -# if 4 <= __GNUC__ -# define _GL_ATTRIBUTE_SENTINEL __attribute__ ((__sentinel__)) -# else -# define _GL_ATTRIBUTE_SENTINEL /* empty */ -# endif -#endif - extern const char version_etc_copyright[]; /* The three functions below display the --version information in the @@ -70,7 +61,7 @@ const char *command_name, const char *package, const char *version, /* const char *author1, ..., NULL */ ...) - _GL_ATTRIBUTE_SENTINEL; + _GL_ATTRIBUTE_SENTINEL ((0)); /* Display the usual "Report bugs to" stanza. */ extern void emit_bug_reporting_address (void); diff -Nru datamash-1.7/lib/waitpid.c datamash-1.8/lib/waitpid.c --- datamash-1.7/lib/waitpid.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/waitpid.c 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,30 @@ +/* Wait for process state change. + Copyright (C) 2001-2003, 2005-2021 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 . */ + +#include + +/* Specification. */ +#include + +/* Implementation for native Windows systems. */ + +#include /* for _cwait, WAIT_CHILD */ + +pid_t +waitpid (pid_t pid, int *statusp, int options) +{ + return _cwait (statusp, pid, WAIT_CHILD); +} diff -Nru datamash-1.7/lib/warn-on-use.h datamash-1.8/lib/warn-on-use.h --- datamash-1.7/lib/warn-on-use.h 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/warn-on-use.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ /* A C macro for emitting warnings if a function is used. - Copyright (C) 2010-2020 Free Software Foundation, Inc. + Copyright (C) 2010-2021 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 @@ -87,6 +87,13 @@ extern __typeof__ (function) function __attribute__ ((__warning__ (message))) # define _GL_WARN_ON_USE_ATTRIBUTE(message) \ __attribute__ ((__warning__ (message))) +# elif __clang_major__ >= 4 +/* Another compiler attribute is available in clang. */ +# define _GL_WARN_ON_USE(function, message) \ +extern __typeof__ (function) function \ + __attribute__ ((__diagnose_if__ (1, message, "warning"))) +# define _GL_WARN_ON_USE_ATTRIBUTE(message) \ + __attribute__ ((__diagnose_if__ (1, message, "warning"))) # elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING /* Verify the existence of the function. */ # define _GL_WARN_ON_USE(function, message) \ @@ -99,24 +106,35 @@ # endif #endif -/* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string") - is like _GL_WARN_ON_USE (function, "string"), except that the function is - declared with the given prototype, consisting of return type, parameters, - and attributes. +/* _GL_WARN_ON_USE_CXX (function, rettype_gcc, rettype_clang, parameters_and_attributes, "message") + is like _GL_WARN_ON_USE (function, "message"), except that in C++ mode the + function is declared with the given prototype, consisting of return type, + parameters, and attributes. This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does not work in this case. */ #ifndef _GL_WARN_ON_USE_CXX -# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) -# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ -extern rettype function parameters_and_attributes \ - __attribute__ ((__warning__ (msg))) -# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING +# if !defined __cplusplus +# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ + _GL_WARN_ON_USE (function, msg) +# else +# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) +/* A compiler attribute is available in gcc versions 4.3.0 and later. */ +# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ +extern rettype_gcc function parameters_and_attributes \ + __attribute__ ((__warning__ (msg))) +# elif __clang_major__ >= 4 +/* Another compiler attribute is available in clang. */ +# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ +extern rettype_clang function parameters_and_attributes \ + __attribute__ ((__diagnose_if__ (1, msg, "warning"))) +# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING /* Verify the existence of the function. */ -# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ -extern rettype function parameters_and_attributes -# else /* Unsupported. */ -# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \ +# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ +extern rettype_gcc function parameters_and_attributes +# else /* Unsupported. */ +# define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \ _GL_WARN_EXTERN_C int _gl_warn_on_use +# endif # endif #endif diff -Nru datamash-1.7/lib/wchar.in.h datamash-1.8/lib/wchar.in.h --- datamash-1.7/lib/wchar.in.h 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/wchar.in.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ /* A substitute for ISO C99 , for platforms that have issues. - Copyright (C) 2007-2020 Free Software Foundation, Inc. + Copyright (C) 2007-2021 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 @@ -65,20 +65,12 @@ # include /* for __GLIBC__ */ #endif -/* 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 . - In some builds of uClibc, is nonexistent and wchar_t is defined +/* In some builds of uClibc, is nonexistent and wchar_t is defined by . But avoid namespace pollution on glibc systems. */ #if !(defined __GLIBC__ && !defined __UCLIBC__) # include #endif -#ifndef __GLIBC__ -# include -# include -#endif /* Include the original if it exists. Some builds of uClibc lack it. */ @@ -94,10 +86,12 @@ /* The __attribute__ feature is available in gcc versions 2.5 and later. The attribute __pure__ was added in gcc 2.96. */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) -# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) -#else -# define _GL_ATTRIBUTE_PURE /* empty */ +#ifndef _GL_ATTRIBUTE_PURE +# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__ +# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define _GL_ATTRIBUTE_PURE /* empty */ +# endif #endif /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ @@ -622,6 +616,29 @@ #endif +/* Copy N wide characters of SRC to DEST. + Return pointer to wide characters after the last written wide character. */ +#if @GNULIB_WMEMPCPY@ +# if !@HAVE_WMEMPCPY@ +_GL_FUNCDECL_SYS (wmempcpy, wchar_t *, + (wchar_t *restrict dest, + const wchar_t *restrict src, size_t n)); +# endif +_GL_CXXALIAS_SYS (wmempcpy, wchar_t *, + (wchar_t *restrict dest, + const wchar_t *restrict src, size_t n)); +# if __GLIBC__ >= 2 +_GL_CXXALIASWARN (wmempcpy); +# endif +#elif defined GNULIB_POSIXCHECK +# undef wmempcpy +# if HAVE_RAW_DECL_WMEMPCPY +_GL_WARN_ON_USE (wmempcpy, "wmempcpy is unportable - " + "use gnulib module wmempcpy for portability"); +# endif +#endif + + /* Set N wide characters of S to C. */ #if @GNULIB_WMEMSET@ # if !@HAVE_WMEMSET@ @@ -917,10 +934,18 @@ /* Duplicate S, returning an identical malloc'd string. */ #if @GNULIB_WCSDUP@ -# if !@HAVE_WCSDUP@ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef wcsdup +# define wcsdup _wcsdup +# endif +_GL_CXXALIAS_MDA (wcsdup, wchar_t *, (const wchar_t *s)); +# else +# if !@HAVE_WCSDUP@ _GL_FUNCDECL_SYS (wcsdup, wchar_t *, (const wchar_t *s)); -# endif +# endif _GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s)); +# endif _GL_CXXALIASWARN (wcsdup); #elif defined GNULIB_POSIXCHECK # undef wcsdup @@ -928,6 +953,25 @@ _GL_WARN_ON_USE (wcsdup, "wcsdup is unportable - " "use gnulib module wcsdup for portability"); # endif +#elif @GNULIB_MDA_WCSDUP@ +/* On native Windows, map 'wcsdup' to '_wcsdup', so that -loldnames is not + required. In C++ with GNULIB_NAMESPACE, avoid differences between + platforms by defining GNULIB_NAMESPACE::wcsdup always. */ +# if defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef wcsdup +# define wcsdup _wcsdup +# endif +_GL_CXXALIAS_MDA (wcsdup, wchar_t *, (const wchar_t *s)); +# else +_GL_FUNCDECL_SYS (wcsdup, wchar_t *, (const wchar_t *s)); +# if @HAVE_DECL_WCSDUP@ +_GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s)); +# endif +# endif +# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_WCSDUP@ +_GL_CXXALIASWARN (wcsdup); +# endif #endif diff -Nru datamash-1.7/lib/wctype.in.h datamash-1.8/lib/wctype.in.h --- datamash-1.7/lib/wctype.in.h 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/wctype.in.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ /* A substitute for ISO C99 , for platforms that lack it. - Copyright (C) 2006-2020 Free Software Foundation, Inc. + Copyright (C) 2006-2021 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 @@ -45,14 +45,7 @@ #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 - . - BSD/OS 4.0.1 has a bug: , and must be - included before . */ -# include -# include -# include +/* Solaris 2.5 has a bug: must be included before . */ # include #endif diff -Nru datamash-1.7/lib/wcwidth.c datamash-1.8/lib/wcwidth.c --- datamash-1.7/lib/wcwidth.c 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/wcwidth.c 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Determine the number of screen columns needed for a character. - Copyright (C) 2006-2007, 2010-2020 Free Software Foundation, Inc. + Copyright (C) 2006-2007, 2010-2021 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.7/lib/windows-initguard.h datamash-1.8/lib/windows-initguard.h --- datamash-1.7/lib/windows-initguard.h 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/windows-initguard.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Init guards, somewhat like spinlocks (native Windows implementation). - Copyright (C) 2005-2020 Free Software Foundation, Inc. + Copyright (C) 2005-2021 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.7/lib/windows-mutex.c datamash-1.8/lib/windows-mutex.c --- datamash-1.7/lib/windows-mutex.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/windows-mutex.c 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,95 @@ +/* Plain mutexes (native Windows implementation). + Copyright (C) 2005-2021 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 Bruno Haible , 2005. + Based on GCC's gthr-win32.h. */ + +#include + +/* Specification. */ +#include "windows-mutex.h" + +#include + +void +glwthread_mutex_init (glwthread_mutex_t *mutex) +{ + InitializeCriticalSection (&mutex->lock); + mutex->guard.done = 1; +} + +int +glwthread_mutex_lock (glwthread_mutex_t *mutex) +{ + if (!mutex->guard.done) + { + if (InterlockedIncrement (&mutex->guard.started) == 0) + /* This thread is the first one to need this mutex. Initialize it. */ + glwthread_mutex_init (mutex); + else + { + /* Don't let mutex->guard.started grow and wrap around. */ + InterlockedDecrement (&mutex->guard.started); + /* Yield the CPU while waiting for another thread to finish + initializing this mutex. */ + while (!mutex->guard.done) + Sleep (0); + } + } + EnterCriticalSection (&mutex->lock); + return 0; +} + +int +glwthread_mutex_trylock (glwthread_mutex_t *mutex) +{ + if (!mutex->guard.done) + { + if (InterlockedIncrement (&mutex->guard.started) == 0) + /* This thread is the first one to need this mutex. Initialize it. */ + glwthread_mutex_init (mutex); + else + { + /* Don't let mutex->guard.started grow and wrap around. */ + InterlockedDecrement (&mutex->guard.started); + /* Let another thread finish initializing this mutex, and let it also + lock this mutex. */ + return EBUSY; + } + } + if (!TryEnterCriticalSection (&mutex->lock)) + return EBUSY; + return 0; +} + +int +glwthread_mutex_unlock (glwthread_mutex_t *mutex) +{ + if (!mutex->guard.done) + return EINVAL; + LeaveCriticalSection (&mutex->lock); + return 0; +} + +int +glwthread_mutex_destroy (glwthread_mutex_t *mutex) +{ + if (!mutex->guard.done) + return EINVAL; + DeleteCriticalSection (&mutex->lock); + mutex->guard.done = 0; + return 0; +} diff -Nru datamash-1.7/lib/windows-mutex.h datamash-1.8/lib/windows-mutex.h --- datamash-1.7/lib/windows-mutex.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/windows-mutex.h 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,51 @@ +/* Plain mutexes (native Windows implementation). + Copyright (C) 2005-2021 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 Bruno Haible , 2005. + Based on GCC's gthr-win32.h. */ + +#ifndef _WINDOWS_MUTEX_H +#define _WINDOWS_MUTEX_H + +#define WIN32_LEAN_AND_MEAN /* avoid including junk */ +#include + +#include "windows-initguard.h" + +typedef struct + { + glwthread_initguard_t guard; /* protects the initialization */ + CRITICAL_SECTION lock; + } + glwthread_mutex_t; + +#define GLWTHREAD_MUTEX_INIT { GLWTHREAD_INITGUARD_INIT } + +#ifdef __cplusplus +extern "C" { +#endif + +extern void glwthread_mutex_init (glwthread_mutex_t *mutex); +extern int glwthread_mutex_lock (glwthread_mutex_t *mutex); +extern int glwthread_mutex_trylock (glwthread_mutex_t *mutex); +extern int glwthread_mutex_unlock (glwthread_mutex_t *mutex); +extern int glwthread_mutex_destroy (glwthread_mutex_t *mutex); + +#ifdef __cplusplus +} +#endif + +#endif /* _WINDOWS_MUTEX_H */ diff -Nru datamash-1.7/lib/windows-once.c datamash-1.8/lib/windows-once.c --- datamash-1.7/lib/windows-once.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/windows-once.c 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,62 @@ +/* Once-only control (native Windows implementation). + Copyright (C) 2005-2021 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 Bruno Haible , 2005. + Based on GCC's gthr-win32.h. */ + +#include + +/* Specification. */ +#include "windows-once.h" + +#include + +void +glwthread_once (glwthread_once_t *once_control, void (*initfunction) (void)) +{ + if (once_control->inited <= 0) + { + if (InterlockedIncrement (&once_control->started) == 0) + { + /* This thread is the first one to come to this once_control. */ + InitializeCriticalSection (&once_control->lock); + EnterCriticalSection (&once_control->lock); + once_control->inited = 0; + initfunction (); + once_control->inited = 1; + LeaveCriticalSection (&once_control->lock); + } + else + { + /* Don't let once_control->started grow and wrap around. */ + InterlockedDecrement (&once_control->started); + /* Some other thread has already started the initialization. + Yield the CPU while waiting for the other thread to finish + initializing and taking the lock. */ + while (once_control->inited < 0) + Sleep (0); + if (once_control->inited <= 0) + { + /* Take the lock. This blocks until the other thread has + finished calling the initfunction. */ + EnterCriticalSection (&once_control->lock); + LeaveCriticalSection (&once_control->lock); + if (!(once_control->inited > 0)) + abort (); + } + } + } +} diff -Nru datamash-1.7/lib/windows-once.h datamash-1.8/lib/windows-once.h --- datamash-1.7/lib/windows-once.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/windows-once.h 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,47 @@ +/* Once-only control (native Windows implementation). + Copyright (C) 2005-2021 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 Bruno Haible , 2005. + Based on GCC's gthr-win32.h. */ + +#ifndef _WINDOWS_ONCE_H +#define _WINDOWS_ONCE_H + +#define WIN32_LEAN_AND_MEAN /* avoid including junk */ +#include + +typedef struct + { + volatile int inited; + volatile LONG started; + CRITICAL_SECTION lock; + } + glwthread_once_t; + +#define GLWTHREAD_ONCE_INIT { -1, -1 } + +#ifdef __cplusplus +extern "C" { +#endif + +extern void glwthread_once (glwthread_once_t *once_control, + void (*initfunction) (void)); + +#ifdef __cplusplus +} +#endif + +#endif /* _WINDOWS_ONCE_H */ diff -Nru datamash-1.7/lib/windows-recmutex.c datamash-1.8/lib/windows-recmutex.c --- datamash-1.7/lib/windows-recmutex.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/windows-recmutex.c 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,127 @@ +/* Plain recursive mutexes (native Windows implementation). + Copyright (C) 2005-2021 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 Bruno Haible , 2005. + Based on GCC's gthr-win32.h. */ + +#include + +/* Specification. */ +#include "windows-recmutex.h" + +#include + +void +glwthread_recmutex_init (glwthread_recmutex_t *mutex) +{ + mutex->owner = 0; + mutex->depth = 0; + InitializeCriticalSection (&mutex->lock); + mutex->guard.done = 1; +} + +int +glwthread_recmutex_lock (glwthread_recmutex_t *mutex) +{ + if (!mutex->guard.done) + { + if (InterlockedIncrement (&mutex->guard.started) == 0) + /* This thread is the first one to need this mutex. Initialize it. */ + glwthread_recmutex_init (mutex); + else + { + /* Don't let mutex->guard.started grow and wrap around. */ + InterlockedDecrement (&mutex->guard.started); + /* Yield the CPU while waiting for another thread to finish + initializing this mutex. */ + while (!mutex->guard.done) + Sleep (0); + } + } + { + DWORD self = GetCurrentThreadId (); + if (mutex->owner != self) + { + EnterCriticalSection (&mutex->lock); + mutex->owner = self; + } + if (++(mutex->depth) == 0) /* wraparound? */ + { + mutex->depth--; + return EAGAIN; + } + } + return 0; +} + +int +glwthread_recmutex_trylock (glwthread_recmutex_t *mutex) +{ + if (!mutex->guard.done) + { + if (InterlockedIncrement (&mutex->guard.started) == 0) + /* This thread is the first one to need this mutex. Initialize it. */ + glwthread_recmutex_init (mutex); + else + { + /* Don't let mutex->guard.started grow and wrap around. */ + InterlockedDecrement (&mutex->guard.started); + /* Let another thread finish initializing this mutex, and let it also + lock this mutex. */ + return EBUSY; + } + } + { + DWORD self = GetCurrentThreadId (); + if (mutex->owner != self) + { + if (!TryEnterCriticalSection (&mutex->lock)) + return EBUSY; + mutex->owner = self; + } + if (++(mutex->depth) == 0) /* wraparound? */ + { + mutex->depth--; + return EAGAIN; + } + } + return 0; +} + +int +glwthread_recmutex_unlock (glwthread_recmutex_t *mutex) +{ + if (mutex->owner != GetCurrentThreadId ()) + return EPERM; + if (mutex->depth == 0) + return EINVAL; + if (--(mutex->depth) == 0) + { + mutex->owner = 0; + LeaveCriticalSection (&mutex->lock); + } + return 0; +} + +int +glwthread_recmutex_destroy (glwthread_recmutex_t *mutex) +{ + if (mutex->owner != 0) + return EBUSY; + DeleteCriticalSection (&mutex->lock); + mutex->guard.done = 0; + return 0; +} diff -Nru datamash-1.7/lib/windows-recmutex.h datamash-1.8/lib/windows-recmutex.h --- datamash-1.7/lib/windows-recmutex.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/windows-recmutex.h 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,57 @@ +/* Plain recursive mutexes (native Windows implementation). + Copyright (C) 2005-2021 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 Bruno Haible , 2005. + Based on GCC's gthr-win32.h. */ + +#ifndef _WINDOWS_RECMUTEX_H +#define _WINDOWS_RECMUTEX_H + +#define WIN32_LEAN_AND_MEAN /* avoid including junk */ +#include + +#include "windows-initguard.h" + +/* The native Windows documentation says that CRITICAL_SECTION already + implements a recursive lock. But we need not rely on it: It's easy to + implement a recursive lock without this assumption. */ + +typedef struct + { + glwthread_initguard_t guard; /* protects the initialization */ + DWORD owner; + unsigned long depth; + CRITICAL_SECTION lock; + } + glwthread_recmutex_t; + +#define GLWTHREAD_RECMUTEX_INIT { GLWTHREAD_INITGUARD_INIT, 0, 0 } + +#ifdef __cplusplus +extern "C" { +#endif + +extern void glwthread_recmutex_init (glwthread_recmutex_t *mutex); +extern int glwthread_recmutex_lock (glwthread_recmutex_t *mutex); +extern int glwthread_recmutex_trylock (glwthread_recmutex_t *mutex); +extern int glwthread_recmutex_unlock (glwthread_recmutex_t *mutex); +extern int glwthread_recmutex_destroy (glwthread_recmutex_t *mutex); + +#ifdef __cplusplus +} +#endif + +#endif /* _WINDOWS_RECMUTEX_H */ diff -Nru datamash-1.7/lib/windows-rwlock.c datamash-1.8/lib/windows-rwlock.c --- datamash-1.7/lib/windows-rwlock.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/windows-rwlock.c 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,377 @@ +/* Read-write locks (native Windows implementation). + Copyright (C) 2005-2021 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 Bruno Haible , 2005. + Based on GCC's gthr-win32.h. */ + +#include + +/* Specification. */ +#include "windows-rwlock.h" + +#include +#include + +/* Don't assume that UNICODE is not defined. */ +#undef CreateEvent +#define CreateEvent CreateEventA + +/* In this file, the waitqueues are implemented as circular arrays. */ +#define glwthread_waitqueue_t glwthread_carray_waitqueue_t + +static void +glwthread_waitqueue_init (glwthread_waitqueue_t *wq) +{ + wq->array = NULL; + wq->count = 0; + wq->alloc = 0; + wq->offset = 0; +} + +/* Enqueues the current thread, represented by an event, in a wait queue. + Returns INVALID_HANDLE_VALUE if an allocation failure occurs. */ +static HANDLE +glwthread_waitqueue_add (glwthread_waitqueue_t *wq) +{ + HANDLE event; + unsigned int index; + + if (wq->count == wq->alloc) + { + unsigned int new_alloc = 2 * wq->alloc + 1; + HANDLE *new_array = + (HANDLE *) realloc (wq->array, new_alloc * sizeof (HANDLE)); + if (new_array == NULL) + /* No more memory. */ + return INVALID_HANDLE_VALUE; + /* Now is a good opportunity to rotate the array so that its contents + starts at offset 0. */ + if (wq->offset > 0) + { + unsigned int old_count = wq->count; + unsigned int old_alloc = wq->alloc; + unsigned int old_offset = wq->offset; + unsigned int i; + if (old_offset + old_count > old_alloc) + { + unsigned int limit = old_offset + old_count - old_alloc; + for (i = 0; i < limit; i++) + new_array[old_alloc + i] = new_array[i]; + } + for (i = 0; i < old_count; i++) + new_array[i] = new_array[old_offset + i]; + wq->offset = 0; + } + wq->array = new_array; + wq->alloc = new_alloc; + } + /* Whether the created event is a manual-reset one or an auto-reset one, + does not matter, since we will wait on it only once. */ + event = CreateEvent (NULL, TRUE, FALSE, NULL); + if (event == INVALID_HANDLE_VALUE) + /* No way to allocate an event. */ + return INVALID_HANDLE_VALUE; + index = wq->offset + wq->count; + if (index >= wq->alloc) + index -= wq->alloc; + wq->array[index] = event; + wq->count++; + return event; +} + +/* Notifies the first thread from a wait queue and dequeues it. */ +static void +glwthread_waitqueue_notify_first (glwthread_waitqueue_t *wq) +{ + SetEvent (wq->array[wq->offset + 0]); + wq->offset++; + wq->count--; + if (wq->count == 0 || wq->offset == wq->alloc) + wq->offset = 0; +} + +/* Notifies all threads from a wait queue and dequeues them all. */ +static void +glwthread_waitqueue_notify_all (glwthread_waitqueue_t *wq) +{ + unsigned int i; + + for (i = 0; i < wq->count; i++) + { + unsigned int index = wq->offset + i; + if (index >= wq->alloc) + index -= wq->alloc; + SetEvent (wq->array[index]); + } + wq->count = 0; + wq->offset = 0; +} + +void +glwthread_rwlock_init (glwthread_rwlock_t *lock) +{ + InitializeCriticalSection (&lock->lock); + glwthread_waitqueue_init (&lock->waiting_readers); + glwthread_waitqueue_init (&lock->waiting_writers); + lock->runcount = 0; + lock->guard.done = 1; +} + +int +glwthread_rwlock_rdlock (glwthread_rwlock_t *lock) +{ + if (!lock->guard.done) + { + if (InterlockedIncrement (&lock->guard.started) == 0) + /* This thread is the first one to need this lock. Initialize it. */ + glwthread_rwlock_init (lock); + else + { + /* Don't let lock->guard.started grow and wrap around. */ + InterlockedDecrement (&lock->guard.started); + /* Yield the CPU while waiting for another thread to finish + initializing this lock. */ + while (!lock->guard.done) + Sleep (0); + } + } + EnterCriticalSection (&lock->lock); + /* Test whether only readers are currently running, and whether the runcount + field will not overflow, and whether no writer is waiting. The latter + condition is because POSIX recommends that "write locks shall take + precedence over read locks", to avoid "writer starvation". */ + if (!(lock->runcount + 1 > 0 && lock->waiting_writers.count == 0)) + { + /* This thread has to wait for a while. Enqueue it among the + waiting_readers. */ + HANDLE event = glwthread_waitqueue_add (&lock->waiting_readers); + if (event != INVALID_HANDLE_VALUE) + { + DWORD result; + LeaveCriticalSection (&lock->lock); + /* Wait until another thread signals this event. */ + result = WaitForSingleObject (event, INFINITE); + if (result == WAIT_FAILED || result == WAIT_TIMEOUT) + abort (); + CloseHandle (event); + /* The thread which signalled the event already did the bookkeeping: + removed us from the waiting_readers, incremented lock->runcount. */ + if (!(lock->runcount > 0)) + abort (); + return 0; + } + else + { + /* Allocation failure. Weird. */ + do + { + LeaveCriticalSection (&lock->lock); + Sleep (1); + EnterCriticalSection (&lock->lock); + } + while (!(lock->runcount + 1 > 0)); + } + } + lock->runcount++; + LeaveCriticalSection (&lock->lock); + return 0; +} + +int +glwthread_rwlock_wrlock (glwthread_rwlock_t *lock) +{ + if (!lock->guard.done) + { + if (InterlockedIncrement (&lock->guard.started) == 0) + /* This thread is the first one to need this lock. Initialize it. */ + glwthread_rwlock_init (lock); + else + { + /* Don't let lock->guard.started grow and wrap around. */ + InterlockedDecrement (&lock->guard.started); + /* Yield the CPU while waiting for another thread to finish + initializing this lock. */ + while (!lock->guard.done) + Sleep (0); + } + } + EnterCriticalSection (&lock->lock); + /* Test whether no readers or writers are currently running. */ + if (!(lock->runcount == 0)) + { + /* This thread has to wait for a while. Enqueue it among the + waiting_writers. */ + HANDLE event = glwthread_waitqueue_add (&lock->waiting_writers); + if (event != INVALID_HANDLE_VALUE) + { + DWORD result; + LeaveCriticalSection (&lock->lock); + /* Wait until another thread signals this event. */ + result = WaitForSingleObject (event, INFINITE); + if (result == WAIT_FAILED || result == WAIT_TIMEOUT) + abort (); + CloseHandle (event); + /* The thread which signalled the event already did the bookkeeping: + removed us from the waiting_writers, set lock->runcount = -1. */ + if (!(lock->runcount == -1)) + abort (); + return 0; + } + else + { + /* Allocation failure. Weird. */ + do + { + LeaveCriticalSection (&lock->lock); + Sleep (1); + EnterCriticalSection (&lock->lock); + } + while (!(lock->runcount == 0)); + } + } + lock->runcount--; /* runcount becomes -1 */ + LeaveCriticalSection (&lock->lock); + return 0; +} + +int +glwthread_rwlock_tryrdlock (glwthread_rwlock_t *lock) +{ + if (!lock->guard.done) + { + if (InterlockedIncrement (&lock->guard.started) == 0) + /* This thread is the first one to need this lock. Initialize it. */ + glwthread_rwlock_init (lock); + else + { + /* Don't let lock->guard.started grow and wrap around. */ + InterlockedDecrement (&lock->guard.started); + /* Yield the CPU while waiting for another thread to finish + initializing this lock. */ + while (!lock->guard.done) + Sleep (0); + } + } + /* It's OK to wait for this critical section, because it is never taken for a + long time. */ + EnterCriticalSection (&lock->lock); + /* Test whether only readers are currently running, and whether the runcount + field will not overflow, and whether no writer is waiting. The latter + condition is because POSIX recommends that "write locks shall take + precedence over read locks", to avoid "writer starvation". */ + if (!(lock->runcount + 1 > 0 && lock->waiting_writers.count == 0)) + { + /* This thread would have to wait for a while. Return instead. */ + LeaveCriticalSection (&lock->lock); + return EBUSY; + } + lock->runcount++; + LeaveCriticalSection (&lock->lock); + return 0; +} + +int +glwthread_rwlock_trywrlock (glwthread_rwlock_t *lock) +{ + if (!lock->guard.done) + { + if (InterlockedIncrement (&lock->guard.started) == 0) + /* This thread is the first one to need this lock. Initialize it. */ + glwthread_rwlock_init (lock); + else + { + /* Don't let lock->guard.started grow and wrap around. */ + InterlockedDecrement (&lock->guard.started); + /* Yield the CPU while waiting for another thread to finish + initializing this lock. */ + while (!lock->guard.done) + Sleep (0); + } + } + /* It's OK to wait for this critical section, because it is never taken for a + long time. */ + EnterCriticalSection (&lock->lock); + /* Test whether no readers or writers are currently running. */ + if (!(lock->runcount == 0)) + { + /* This thread would have to wait for a while. Return instead. */ + LeaveCriticalSection (&lock->lock); + return EBUSY; + } + lock->runcount--; /* runcount becomes -1 */ + LeaveCriticalSection (&lock->lock); + return 0; +} + +int +glwthread_rwlock_unlock (glwthread_rwlock_t *lock) +{ + if (!lock->guard.done) + return EINVAL; + EnterCriticalSection (&lock->lock); + if (lock->runcount < 0) + { + /* Drop a writer lock. */ + if (!(lock->runcount == -1)) + abort (); + lock->runcount = 0; + } + else + { + /* Drop a reader lock. */ + if (!(lock->runcount > 0)) + { + LeaveCriticalSection (&lock->lock); + return EPERM; + } + lock->runcount--; + } + if (lock->runcount == 0) + { + /* POSIX recommends that "write locks shall take precedence over read + locks", to avoid "writer starvation". */ + if (lock->waiting_writers.count > 0) + { + /* Wake up one of the waiting writers. */ + lock->runcount--; + glwthread_waitqueue_notify_first (&lock->waiting_writers); + } + else + { + /* Wake up all waiting readers. */ + lock->runcount += lock->waiting_readers.count; + glwthread_waitqueue_notify_all (&lock->waiting_readers); + } + } + LeaveCriticalSection (&lock->lock); + return 0; +} + +int +glwthread_rwlock_destroy (glwthread_rwlock_t *lock) +{ + if (!lock->guard.done) + return EINVAL; + if (lock->runcount != 0) + return EBUSY; + DeleteCriticalSection (&lock->lock); + if (lock->waiting_readers.array != NULL) + free (lock->waiting_readers.array); + if (lock->waiting_writers.array != NULL) + free (lock->waiting_writers.array); + lock->guard.done = 0; + return 0; +} diff -Nru datamash-1.7/lib/windows-rwlock.h datamash-1.8/lib/windows-rwlock.h --- datamash-1.7/lib/windows-rwlock.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/windows-rwlock.h 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,68 @@ +/* Read-write locks (native Windows implementation). + Copyright (C) 2005-2021 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 Bruno Haible , 2005. + Based on GCC's gthr-win32.h. */ + +#ifndef _WINDOWS_RWLOCK_H +#define _WINDOWS_RWLOCK_H + +#define WIN32_LEAN_AND_MEAN /* avoid including junk */ +#include + +#include "windows-initguard.h" + +/* It is impossible to implement read-write locks using plain locks, without + introducing an extra thread dedicated to managing read-write locks. + Therefore here we need to use the low-level Event type. */ + +typedef struct + { + HANDLE *array; /* array of waiting threads, each represented by an event */ + unsigned int count; /* number of waiting threads */ + unsigned int alloc; /* length of allocated array */ + unsigned int offset; /* index of first waiting thread in array */ + } + glwthread_carray_waitqueue_t; +typedef struct + { + glwthread_initguard_t guard; /* protects the initialization */ + CRITICAL_SECTION lock; /* protects the remaining fields */ + glwthread_carray_waitqueue_t waiting_readers; /* waiting readers */ + glwthread_carray_waitqueue_t waiting_writers; /* waiting writers */ + int runcount; /* number of readers running, or -1 when a writer runs */ + } + glwthread_rwlock_t; + +#define GLWTHREAD_RWLOCK_INIT { GLWTHREAD_INITGUARD_INIT } + +#ifdef __cplusplus +extern "C" { +#endif + +extern void glwthread_rwlock_init (glwthread_rwlock_t *lock); +extern int glwthread_rwlock_rdlock (glwthread_rwlock_t *lock); +extern int glwthread_rwlock_wrlock (glwthread_rwlock_t *lock); +extern int glwthread_rwlock_tryrdlock (glwthread_rwlock_t *lock); +extern int glwthread_rwlock_trywrlock (glwthread_rwlock_t *lock); +extern int glwthread_rwlock_unlock (glwthread_rwlock_t *lock); +extern int glwthread_rwlock_destroy (glwthread_rwlock_t *lock); + +#ifdef __cplusplus +} +#endif + +#endif /* _WINDOWS_RWLOCK_H */ diff -Nru datamash-1.7/lib/xalloc-die.c datamash-1.8/lib/xalloc-die.c --- datamash-1.7/lib/xalloc-die.c 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/xalloc-die.c 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ /* Report a memory allocation failure and exit. - Copyright (C) 1997-2000, 2002-2004, 2006, 2009-2020 Free Software + Copyright (C) 1997-2000, 2002-2004, 2006, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.7/lib/xalloc.h datamash-1.8/lib/xalloc.h --- datamash-1.7/lib/xalloc.h 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/xalloc.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ /* xalloc.h -- malloc with out-of-memory checking - Copyright (C) 1990-2000, 2003-2004, 2006-2020 Free Software Foundation, Inc. + Copyright (C) 1990-2000, 2003-2004, 2006-2021 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,17 +31,13 @@ # define XALLOC_INLINE _GL_INLINE #endif + #ifdef __cplusplus extern "C" { #endif -#if ! defined __clang__ && \ - (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) -# define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args)) -#else -# define _GL_ATTRIBUTE_ALLOC_SIZE(args) -#endif +#if GNULIB_XALLOC_DIE /* This function is always triggered when memory is exhausted. It must be defined by the application, either explicitly @@ -50,6 +46,10 @@ memory allocation failure. */ /*extern*/ _Noreturn void xalloc_die (void); +#endif /* GNULIB_XALLOC_DIE */ + +#if GNULIB_XALLOC + void *xmalloc (size_t s) _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_ALLOC_SIZE ((1)); void *xzalloc (size_t s) @@ -71,23 +71,23 @@ /* Allocate an object of type T dynamically, with error checking. */ /* extern t *XMALLOC (typename t); */ -#define XMALLOC(t) ((t *) xmalloc (sizeof (t))) +# define XMALLOC(t) ((t *) xmalloc (sizeof (t))) /* Allocate memory for N elements of type T, with error checking. */ /* extern t *XNMALLOC (size_t n, typename t); */ -#define XNMALLOC(n, t) \ - ((t *) (sizeof (t) == 1 ? xmalloc (n) : xnmalloc (n, sizeof (t)))) +# define XNMALLOC(n, t) \ + ((t *) (sizeof (t) == 1 ? xmalloc (n) : xnmalloc (n, sizeof (t)))) /* Allocate an object of type T dynamically, with error checking, and zero it. */ /* extern t *XZALLOC (typename t); */ -#define XZALLOC(t) ((t *) xzalloc (sizeof (t))) +# define XZALLOC(t) ((t *) xzalloc (sizeof (t))) /* Allocate memory for N elements of type T, with error checking, and zero it. */ /* extern t *XCALLOC (size_t n, typename t); */ -#define XCALLOC(n, t) \ - ((t *) (sizeof (t) == 1 ? xzalloc (n) : xcalloc (n, sizeof (t)))) +# define XCALLOC(n, t) \ + ((t *) (sizeof (t) == 1 ? xzalloc (n) : xcalloc (n, sizeof (t)))) /* Allocate an array of N objects, each with S bytes of memory, @@ -218,8 +218,15 @@ return XNMALLOC (n, char); } +#endif /* GNULIB_XALLOC */ + + #ifdef __cplusplus } +#endif + + +#if GNULIB_XALLOC && defined __cplusplus /* C++ does not allow conversions from void * to other pointer types without a cast. Use templates to work around the problem when @@ -255,7 +262,8 @@ return (T *) xmemdup ((void const *) p, s); } -#endif +#endif /* GNULIB_XALLOC && C++ */ + _GL_INLINE_HEADER_END diff -Nru datamash-1.7/lib/xalloc-oversized.h datamash-1.8/lib/xalloc-oversized.h --- datamash-1.7/lib/xalloc-oversized.h 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/xalloc-oversized.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ /* xalloc-oversized.h -- memory allocation size checking - Copyright (C) 1990-2000, 2003-2004, 2006-2020 Free Software Foundation, Inc. + Copyright (C) 1990-2000, 2003-2004, 2006-2021 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 @@ -41,7 +41,7 @@ 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__ +#if 7 <= __GNUC__ && !defined __clang__ # define xalloc_oversized(n, s) \ __builtin_mul_overflow_p (n, s, (__xalloc_count_type) 1) #elif 5 <= __GNUC__ && !defined __ICC && !__STRICT_ANSI__ diff -Nru datamash-1.7/lib/xmalloc.c datamash-1.8/lib/xmalloc.c --- datamash-1.7/lib/xmalloc.c 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/xmalloc.c 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ /* xmalloc.c -- malloc with out of memory checking - Copyright (C) 1990-2000, 2002-2006, 2008-2020 Free Software Foundation, Inc. + Copyright (C) 1990-2000, 2002-2006, 2008-2021 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 @@ -24,14 +24,26 @@ #include #include -/* 1 if calloc is known to be compatible with GNU calloc. This - matters if we are not also using the calloc module, which defines - HAVE_CALLOC_GNU and supports the GNU API even on non-GNU platforms. */ +/* 1 if calloc, malloc and realloc are known to be compatible with GNU. + This matters if we are not also using the calloc-gnu, malloc-gnu + and realloc-gnu modules, which define HAVE_CALLOC_GNU, + HAVE_MALLOC_GNU and HAVE_REALLOC_GNU and support the GNU API even + on non-GNU platforms. */ #if defined HAVE_CALLOC_GNU || (defined __GLIBC__ && !defined __UCLIBC__) enum { HAVE_GNU_CALLOC = 1 }; #else enum { HAVE_GNU_CALLOC = 0 }; #endif +#if defined HAVE_MALLOC_GNU || (defined __GLIBC__ && !defined __UCLIBC__) +enum { HAVE_GNU_MALLOC = 1 }; +#else +enum { HAVE_GNU_MALLOC = 0 }; +#endif +#if defined HAVE_REALLOC_GNU || (defined __GLIBC__ && !defined __UCLIBC__) +enum { HAVE_GNU_REALLOC = 1 }; +#else +enum { HAVE_GNU_REALLOC = 0 }; +#endif /* Allocate N bytes of memory dynamically, with error checking. */ @@ -39,7 +51,7 @@ xmalloc (size_t n) { void *p = malloc (n); - if (!p && n != 0) + if (!p && (HAVE_GNU_MALLOC || n)) xalloc_die (); return p; } @@ -50,18 +62,17 @@ void * xrealloc (void *p, size_t n) { - if (!n && p) + if (!HAVE_GNU_REALLOC && !n && p) { - /* The GNU and C99 realloc behaviors disagree here. Act like - GNU, even if the underlying realloc is C99. */ + /* The GNU and C99 realloc behaviors disagree here. Act like GNU. */ free (p); return NULL; } - p = realloc (p, n); - if (!p && n) + void *r = realloc (p, n); + if (!r && (n || (HAVE_GNU_REALLOC && !p))) xalloc_die (); - return p; + return r; } /* If P is null, allocate a block of at least *PN bytes; otherwise, diff -Nru datamash-1.7/lib/xsize.c datamash-1.8/lib/xsize.c --- datamash-1.7/lib/xsize.c 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/xsize.c 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,3 @@ +#include +#define XSIZE_INLINE _GL_EXTERN_INLINE +#include "xsize.h" diff -Nru datamash-1.7/lib/xsize.h datamash-1.8/lib/xsize.h --- datamash-1.7/lib/xsize.h 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/lib/xsize.h 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,108 @@ +/* xsize.h -- Checked size_t computations. + + Copyright (C) 2003, 2008-2021 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 _XSIZE_H +#define _XSIZE_H + +/* Get size_t. */ +#include + +/* Get SIZE_MAX. */ +#include +#if HAVE_STDINT_H +# include +#endif + +/* Get ATTRIBUTE_PURE. */ +#include "attribute.h" + +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif +_GL_INLINE_HEADER_BEGIN +#ifndef XSIZE_INLINE +# define XSIZE_INLINE _GL_INLINE +#endif + +/* The size of memory objects is often computed through expressions of + type size_t. Example: + void* p = malloc (header_size + n * element_size). + These computations can lead to overflow. When this happens, malloc() + returns a piece of memory that is way too small, and the program then + crashes while attempting to fill the memory. + To avoid this, the functions and macros in this file check for overflow. + The convention is that SIZE_MAX represents overflow. + malloc (SIZE_MAX) is not guaranteed to fail -- think of a malloc + implementation that uses mmap --, it's recommended to use size_overflow_p() + or size_in_bounds_p() before invoking malloc(). + The example thus becomes: + size_t size = xsum (header_size, xtimes (n, element_size)); + void *p = (size_in_bounds_p (size) ? malloc (size) : NULL); +*/ + +/* Convert an arbitrary value >= 0 to type size_t. */ +#define xcast_size_t(N) \ + ((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX) + +/* Sum of two sizes, with overflow check. */ +XSIZE_INLINE size_t ATTRIBUTE_PURE +xsum (size_t size1, size_t size2) +{ + size_t sum = size1 + size2; + return (sum >= size1 ? sum : SIZE_MAX); +} + +/* Sum of three sizes, with overflow check. */ +XSIZE_INLINE size_t ATTRIBUTE_PURE +xsum3 (size_t size1, size_t size2, size_t size3) +{ + return xsum (xsum (size1, size2), size3); +} + +/* Sum of four sizes, with overflow check. */ +XSIZE_INLINE size_t ATTRIBUTE_PURE +xsum4 (size_t size1, size_t size2, size_t size3, size_t size4) +{ + return xsum (xsum (xsum (size1, size2), size3), size4); +} + +/* Maximum of two sizes, with overflow check. */ +XSIZE_INLINE size_t ATTRIBUTE_PURE +xmax (size_t size1, size_t size2) +{ + /* No explicit check is needed here, because for any n: + max (SIZE_MAX, n) == SIZE_MAX and max (n, SIZE_MAX) == SIZE_MAX. */ + return (size1 >= size2 ? size1 : size2); +} + +/* Multiplication of a count with an element size, with overflow check. + The count must be >= 0 and the element size must be > 0. + This is a macro, not a function, so that it works correctly even + when N is of a wider type and N > SIZE_MAX. */ +#define xtimes(N, ELSIZE) \ + ((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX) + +/* Check for overflow. */ +#define size_overflow_p(SIZE) \ + ((SIZE) == SIZE_MAX) +/* Check against overflow. */ +#define size_in_bounds_p(SIZE) \ + ((SIZE) != SIZE_MAX) + +_GL_INLINE_HEADER_END + +#endif /* _XSIZE_H */ diff -Nru datamash-1.7/lib/xstriconv.c datamash-1.8/lib/xstriconv.c --- datamash-1.7/lib/xstriconv.c 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/xstriconv.c 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Charset conversion with out-of-memory checking. - Copyright (C) 2001-2004, 2006, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2001-2004, 2006, 2009-2021 Free Software Foundation, Inc. Written by Bruno Haible. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.7/lib/xstriconv.h datamash-1.8/lib/xstriconv.h --- datamash-1.7/lib/xstriconv.h 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/xstriconv.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ /* Charset conversion with out-of-memory checking. - Copyright (C) 2001-2004, 2006-2007, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2001-2004, 2006-2007, 2009-2021 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.7/lib/xstrndup.c datamash-1.8/lib/xstrndup.c --- datamash-1.7/lib/xstrndup.c 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/xstrndup.c 2022-05-28 01:46:59.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-2020 Free Software Foundation, Inc. + Copyright (C) 2003, 2006-2007, 2009-2021 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.7/lib/xstrndup.h datamash-1.8/lib/xstrndup.h --- datamash-1.7/lib/xstrndup.h 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/xstrndup.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ /* Duplicate a bounded initial segment of a string, with out-of-memory checking. - Copyright (C) 2003, 2009-2020 Free Software Foundation, Inc. + Copyright (C) 2003, 2009-2021 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.7/lib/xstrtol.c datamash-1.8/lib/xstrtol.c --- datamash-1.7/lib/xstrtol.c 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/xstrtol.c 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ /* A more useful interface to strtol. - Copyright (C) 1995-1996, 1998-2001, 2003-2007, 2009-2020 Free Software + Copyright (C) 1995-1996, 1998-2001, 2003-2007, 2009-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.7/lib/xstrtol-error.c datamash-1.8/lib/xstrtol-error.c --- datamash-1.7/lib/xstrtol-error.c 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/xstrtol-error.c 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ /* A more useful interface to strtol. - Copyright (C) 1995-1996, 1998-1999, 2001-2004, 2006-2020 Free Software + Copyright (C) 1995-1996, 1998-1999, 2001-2004, 2006-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.7/lib/xstrtol-error.h datamash-1.8/lib/xstrtol-error.h --- datamash-1.7/lib/xstrtol-error.h 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/lib/xstrtol-error.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ /* Error reporting interface for xstrto* functions. - Copyright (C) 1995-1996, 1998-1999, 2001-2004, 2006-2020 Free Software + Copyright (C) 1995-1996, 1998-1999, 2001-2004, 2006-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.7/lib/xstrtol.h datamash-1.8/lib/xstrtol.h --- datamash-1.7/lib/xstrtol.h 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/lib/xstrtol.h 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ /* A more useful interface to strtol. - Copyright (C) 1995-1996, 1998-1999, 2001-2004, 2006-2020 Free Software + Copyright (C) 1995-1996, 1998-1999, 2001-2004, 2006-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify diff -Nru datamash-1.7/m4/00gnulib.m4 datamash-1.8/m4/00gnulib.m4 --- datamash-1.7/m4/00gnulib.m4 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/m4/00gnulib.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,44 +1,12 @@ -# 00gnulib.m4 serial 7 -dnl Copyright (C) 2009-2020 Free Software Foundation, Inc. +# 00gnulib.m4 serial 8 +dnl Copyright (C) 2009-2021 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 This file must be named something that sorts before all other -dnl gnulib-provided .m4 files. The first part is needed until such time -dnl as we can assume Autoconf 2.64, with its improved AC_DEFUN_ONCE and -dnl m4_divert semantics. The second part is needed until the clang fix -dnl has been included in Autoconf. - -# Until autoconf 2.63, handling of the diversion stack required m4_init -# to be called first; but this does not happen with aclocal. Wrapping -# the entire execution in another layer of the diversion stack fixes this. -# Worse, prior to autoconf 2.62, m4_wrap depended on the underlying m4 -# for whether it was FIFO or LIFO; in order to properly balance with -# m4_init, we need to undo our push just before anything wrapped within -# the m4_init body. The way to ensure this is to wrap both sides of -# m4_init with a one-shot macro that does the pop at the right time. -m4_ifndef([_m4_divert_diversion], -[m4_divert_push([KILL]) -m4_define([gl_divert_fixup], [m4_divert_pop()m4_define([$0])]) -m4_define([m4_init], - [gl_divert_fixup()]m4_defn([m4_init])[gl_divert_fixup()])]) - - -# AC_DEFUN_ONCE([NAME], VALUE) -# ---------------------------- -# Define NAME to expand to VALUE on the first use (whether by direct -# expansion, or by AC_REQUIRE), and to nothing on all subsequent uses. -# Avoid bugs in AC_REQUIRE in Autoconf 2.63 and earlier. This -# definition is slower than the version in Autoconf 2.64, because it -# can only use interfaces that existed since 2.59; but it achieves the -# same effect. Quoting is necessary to avoid confusing Automake. -m4_version_prereq([2.63.263], [], -[m4_define([AC][_DEFUN_ONCE], - [AC][_DEFUN([$1], - [AC_REQUIRE([_gl_DEFUN_ONCE([$1])], - [m4_indir([_gl_DEFUN_ONCE([$1])])])])]dnl -[AC][_DEFUN([_gl_DEFUN_ONCE([$1])], [$2])])]) +dnl gnulib-provided .m4 files. It is needed until the clang fix has +dnl been included in Autoconf. # The following definitions arrange to use a compiler option # -Werror=implicit-function-declaration in AC_CHECK_DECL, when the diff -Nru datamash-1.7/m4/absolute-header.m4 datamash-1.8/m4/absolute-header.m4 --- datamash-1.7/m4/absolute-header.m4 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/m4/absolute-header.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# absolute-header.m4 serial 16 -dnl Copyright (C) 2006-2020 Free Software Foundation, Inc. +# absolute-header.m4 serial 17 +dnl Copyright (C) 2006-2021 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,23 +22,21 @@ AC_DEFUN([gl_ABSOLUTE_HEADER], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_LANG_PREPROC_REQUIRE()dnl -dnl FIXME: gl_absolute_header and ac_header_exists must be used unquoted -dnl until we can assume autoconf 2.64 or newer. m4_foreach_w([gl_HEADER_NAME], [$1], [AS_VAR_PUSHDEF([gl_absolute_header], [gl_cv_absolute_]m4_defn([gl_HEADER_NAME]))dnl AC_CACHE_CHECK([absolute name of <]m4_defn([gl_HEADER_NAME])[>], - m4_defn([gl_absolute_header]), + [gl_absolute_header], [AS_VAR_PUSHDEF([ac_header_exists], [ac_cv_header_]m4_defn([gl_HEADER_NAME]))dnl AC_CHECK_HEADERS_ONCE(m4_defn([gl_HEADER_NAME]))dnl - if test AS_VAR_GET(ac_header_exists) = yes; then + if test AS_VAR_GET([ac_header_exists]) = yes; then gl_ABSOLUTE_HEADER_ONE(m4_defn([gl_HEADER_NAME])) fi AS_VAR_POPDEF([ac_header_exists])dnl ])dnl AC_DEFINE_UNQUOTED(AS_TR_CPP([ABSOLUTE_]m4_defn([gl_HEADER_NAME])), - ["AS_VAR_GET(gl_absolute_header)"], + ["AS_VAR_GET([gl_absolute_header])"], [Define this to an absolute name of <]m4_defn([gl_HEADER_NAME])[>.]) AS_VAR_POPDEF([gl_absolute_header])dnl ])dnl diff -Nru datamash-1.7/m4/af_alg.m4 datamash-1.8/m4/af_alg.m4 --- datamash-1.7/m4/af_alg.m4 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/m4/af_alg.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # af_alg.m4 serial 4 -dnl Copyright 2018-2020 Free Software Foundation, Inc. +dnl Copyright 2018-2021 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.7/m4/alloca.m4 datamash-1.8/m4/alloca.m4 --- datamash-1.7/m4/alloca.m4 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/m4/alloca.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# alloca.m4 serial 15 -dnl Copyright (C) 2002-2004, 2006-2007, 2009-2020 Free Software Foundation, +# alloca.m4 serial 20 +dnl Copyright (C) 2002-2004, 2006-2007, 2009-2021 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, @@ -50,13 +50,13 @@ # STACK_DIRECTION is already handled by AC_FUNC_ALLOCA. AC_DEFUN([gl_PREREQ_ALLOCA], [:]) -# This works around a bug in autoconf <= 2.68. -# See . +m4_version_prereq([2.70], [], [ -m4_version_prereq([2.69], [] ,[ - -# This is taken from the following Autoconf patch: -# https://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=6cd9f12520b0d6f76d3230d7565feba1ecf29497 +# This works around a bug in autoconf <= 2.68 and has simplifications +# from 2.70. See: +# https://lists.gnu.org/r/bug-gnulib/2011-06/msg00277.html +# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6cd9f12520b0d6f76d3230d7565feba1ecf29497 +# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=15edf7fd8094fd14a89d9891dd72a9624762597a # _AC_LIBOBJ_ALLOCA # ----------------- @@ -72,26 +72,6 @@ AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.$ac_objext])dnl AC_DEFINE(C_ALLOCA, 1, [Define to 1 if using 'alloca.c'.]) -AC_CACHE_CHECK(whether 'alloca.c' needs Cray hooks, ac_cv_os_cray, -[AC_EGREP_CPP(webecray, -[#if defined CRAY && ! defined CRAY2 -webecray -#else -wenotbecray -#endif -], ac_cv_os_cray=yes, ac_cv_os_cray=no)]) -if test $ac_cv_os_cray = yes; then - for ac_func in _getb67 GETB67 getb67; do - AC_CHECK_FUNC($ac_func, - [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func, - [Define to one of '_getb67', 'GETB67', - 'getb67' for Cray-2 and Cray-YMP - systems. This function is required for - 'alloca.c' support on those systems.]) - break]) - done -fi - AC_CACHE_CHECK([stack direction for C alloca], [ac_cv_c_stack_direction], [AC_RUN_IFELSE([AC_LANG_SOURCE( @@ -122,7 +102,7 @@ STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ -@%:@undef STACK_DIRECTION])dnl +#undef STACK_DIRECTION])dnl AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction) ])# _AC_LIBOBJ_ALLOCA ]) diff -Nru datamash-1.7/m4/arpa_inet_h.m4 datamash-1.8/m4/arpa_inet_h.m4 --- datamash-1.7/m4/arpa_inet_h.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/arpa_inet_h.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,59 @@ +# arpa_inet_h.m4 serial 14 +dnl Copyright (C) 2006, 2008-2021 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 Simon Josefsson and Bruno Haible + +AC_DEFUN([gl_HEADER_ARPA_INET], +[ + dnl Use AC_REQUIRE here, so that the default behavior below is expanded + dnl once only, before all statements that occur in other macros. + AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS]) + + AC_CHECK_HEADERS_ONCE([arpa/inet.h]) + if test $ac_cv_header_arpa_inet_h = yes; then + HAVE_ARPA_INET_H=1 + else + HAVE_ARPA_INET_H=0 + fi + AC_SUBST([HAVE_ARPA_INET_H]) + dnl is always overridden, because of GNULIB_POSIXCHECK. + gl_CHECK_NEXT_HEADERS([arpa/inet.h]) + + AC_REQUIRE([gl_FEATURES_H]) + + gl_PREREQ_SYS_H_WS2TCPIP + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[ +/* On some systems, this header is not self-consistent. */ +#if !(defined __GLIBC__ || defined __UCLIBC__) +# include +#endif +#ifdef __TANDEM +# include +#endif +#include + ]], [inet_ntop inet_pton]) +]) + +AC_DEFUN([gl_ARPA_INET_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) +]) + +AC_DEFUN([gl_ARPA_INET_H_DEFAULTS], +[ + GNULIB_INET_NTOP=0; AC_SUBST([GNULIB_INET_NTOP]) + GNULIB_INET_PTON=0; AC_SUBST([GNULIB_INET_PTON]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_DECL_INET_NTOP=1; AC_SUBST([HAVE_DECL_INET_NTOP]) + HAVE_DECL_INET_PTON=1; AC_SUBST([HAVE_DECL_INET_PTON]) + REPLACE_INET_NTOP=0; AC_SUBST([REPLACE_INET_NTOP]) + REPLACE_INET_PTON=0; AC_SUBST([REPLACE_INET_PTON]) +]) diff -Nru datamash-1.7/m4/assert.m4 datamash-1.8/m4/assert.m4 --- datamash-1.7/m4/assert.m4 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/m4/assert.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ #serial 7 -# Copyright (C) 1998-1999, 2001, 2004, 2008-2020 Free Software Foundation, Inc. +# Copyright (C) 1998-1999, 2001, 2004, 2008-2021 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.7/m4/base64.m4 datamash-1.8/m4/base64.m4 --- datamash-1.7/m4/base64.m4 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/m4/base64.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # base64.m4 serial 4 -dnl Copyright (C) 2004, 2006, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2004, 2006, 2009-2021 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.7/m4/byteswap.m4 datamash-1.8/m4/byteswap.m4 --- datamash-1.7/m4/byteswap.m4 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/m4/byteswap.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # byteswap.m4 serial 4 -dnl Copyright (C) 2005, 2007, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2007, 2009-2021 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.7/m4/calloc.m4 datamash-1.8/m4/calloc.m4 --- datamash-1.7/m4/calloc.m4 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/m4/calloc.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ -# calloc.m4 serial 20 +# calloc.m4 serial 23 -# Copyright (C) 2004-2020 Free Software Foundation, Inc. +# Copyright (C) 2004-2021 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. @@ -21,33 +21,59 @@ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([for GNU libc compatible calloc], [ac_cv_func_calloc_0_nonnull], - [AC_RUN_IFELSE( - [AC_LANG_PROGRAM( - [AC_INCLUDES_DEFAULT], - [[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; - ]])], - [ac_cv_func_calloc_0_nonnull=yes], - [ac_cv_func_calloc_0_nonnull=no], - [case "$host_os" in - # Guess yes on glibc systems. - *-gnu* | gnu*) ac_cv_func_calloc_0_nonnull="guessing yes" ;; - # Guess yes on musl systems. - *-musl*) ac_cv_func_calloc_0_nonnull="guessing yes" ;; - # Guess yes on native Windows. - mingw*) ac_cv_func_calloc_0_nonnull="guessing yes" ;; - # If we don't know, obey --enable-cross-guesses. - *) ac_cv_func_calloc_0_nonnull="$gl_cross_guess_normal" ;; - esac - ])]) + [if test $cross_compiling != yes; then + ac_cv_func_calloc_0_nonnull=yes + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [AC_INCLUDES_DEFAULT], + [[int result = 0; + char * volatile p = calloc (0, 0); + if (!p) + result |= 1; + free (p); + return result; + ]])], + [], + [ac_cv_func_calloc_0_nonnull=no]) + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [AC_INCLUDES_DEFAULT], + [[int result; + typedef struct { char c[8]; } S8; + size_t n = (size_t) -1 / sizeof (S8) + 2; + S8 * volatile s = calloc (n, sizeof (S8)); + if (s) + { + s[0].c[0] = 1; + if (s[n - 1].c[0]) + result = 0; + else + result = 2; + } + else + result = 3; + free (s); + return result; + ]])], + dnl The exit code of this program is 0 if calloc() succeeded with a + dnl wrap-around bug (which it shouldn't), 2 if calloc() succeeded in + dnl a non-flat address space, 3 if calloc() failed, or 1 if some leak + dnl sanitizer terminated the program as a result of the calloc() call. + [ac_cv_func_calloc_0_nonnull=no], + []) + else + case "$host_os" in + # Guess yes on glibc systems. + *-gnu* | gnu*) ac_cv_func_calloc_0_nonnull="guessing yes" ;; + # Guess yes on musl systems. + *-musl*) ac_cv_func_calloc_0_nonnull="guessing yes" ;; + # Guess yes on native Windows. + mingw*) ac_cv_func_calloc_0_nonnull="guessing yes" ;; + # If we don't know, obey --enable-cross-guesses. + *) ac_cv_func_calloc_0_nonnull="$gl_cross_guess_normal" ;; + esac + fi + ]) case "$ac_cv_func_calloc_0_nonnull" in *yes) $1 diff -Nru datamash-1.7/m4/ceill.m4 datamash-1.8/m4/ceill.m4 --- datamash-1.7/m4/ceill.m4 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/m4/ceill.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# ceill.m4 serial 20 -dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. +# ceill.m4 serial 22 +dnl Copyright (C) 2007, 2009-2021 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. @@ -73,32 +73,32 @@ 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. + dnl On OpenBSD 5.6 the system's native ceill() is buggy: + dnl it returns '0' for small values. Test against 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 + AC_CACHE_CHECK([whether ceill() works], + [gl_cv_func_ceill_works], + [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" ;; - # Guess no on native Windows. - mingw*) gl_cv_func_ceill_buggy="guessing no" ;; - *) gl_cv_func_ceill_buggy="guessing no" ;; - esac - ]) - LIBS="$save_LIBS" - ]) - case "$gl_cv_func_ceill_buggy" in - *yes) - REPLACE_CEILL=1 ;; + [[return (!(ceill (d) == 1)); ]])], + [gl_cv_func_ceill_works=yes], + [gl_cv_func_ceill_works=no], + [case "$host_os" in + openbsd*) gl_cv_func_ceill_works="guessing no" ;; + # Guess yes on native Windows. + mingw*) gl_cv_func_ceill_works="guessing yes" ;; + *) gl_cv_func_ceill_works="guessing yes" ;; + esac + ]) + LIBS="$save_LIBS" + ]) + case "$gl_cv_func_ceill_works" in + *yes) ;; + *) REPLACE_CEILL=1 ;; esac fi if test $HAVE_DECL_CEILL = 0 || test $REPLACE_CEILL = 1; then diff -Nru datamash-1.7/m4/ceil.m4 datamash-1.8/m4/ceil.m4 --- datamash-1.7/m4/ceil.m4 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/m4/ceil.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # ceil.m4 serial 15 -dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2021 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.7/m4/check-math-lib.m4 datamash-1.8/m4/check-math-lib.m4 --- datamash-1.7/m4/check-math-lib.m4 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/m4/check-math-lib.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # check-math-lib.m4 serial 4 -dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2021 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.7/m4/close.m4 datamash-1.8/m4/close.m4 --- datamash-1.7/m4/close.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/close.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,35 @@ +# close.m4 serial 9 +dnl Copyright (C) 2008-2021 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_CLOSE], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + m4_ifdef([gl_MSVC_INVAL], [ + AC_REQUIRE([gl_MSVC_INVAL]) + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + REPLACE_CLOSE=1 + fi + ]) + m4_ifdef([gl_PREREQ_SYS_H_WINSOCK2], [ + gl_PREREQ_SYS_H_WINSOCK2 + if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then + dnl Even if the 'socket' module is not used here, another part of the + dnl application may use it and pass file descriptors that refer to + dnl sockets to the close() function. So enable the support for sockets. + REPLACE_CLOSE=1 + fi + ]) + dnl Replace close() for supporting the gnulib-defined fchdir() function, + dnl to keep fchdir's bookkeeping up-to-date. + m4_ifdef([gl_FUNC_FCHDIR], [ + if test $REPLACE_CLOSE = 0; then + gl_TEST_FCHDIR + if test $HAVE_FCHDIR = 0; then + REPLACE_CLOSE=1 + fi + fi + ]) +]) diff -Nru datamash-1.7/m4/codeset.m4 datamash-1.8/m4/codeset.m4 --- datamash-1.7/m4/codeset.m4 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/m4/codeset.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # codeset.m4 serial 5 (gettext-0.18.2) -dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016, 2019-2020 Free Software +dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016, 2019-2021 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, diff -Nru datamash-1.7/m4/configmake.m4 datamash-1.8/m4/configmake.m4 --- datamash-1.7/m4/configmake.m4 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/m4/configmake.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# configmake.m4 serial 3 -dnl Copyright (C) 2010-2020 Free Software Foundation, Inc. +# configmake.m4 serial 4 +dnl Copyright (C) 2010-2021 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. @@ -9,7 +9,7 @@ # gl_CONFIGMAKE_PREP # ------------------ # Guarantee all of the standard directory variables, even when used with -# autoconf 2.63 (runstatedir wasn't supported before 2.70) or +# autoconf 2.64 (runstatedir wasn't supported before 2.70) or # automake 1.11 (runstatedir isn't supported even in 1.16.1). AC_DEFUN([gl_CONFIGMAKE_PREP], [ diff -Nru datamash-1.7/m4/ctype.m4 datamash-1.8/m4/ctype.m4 --- datamash-1.7/m4/ctype.m4 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/m4/ctype.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # ctype_h.m4 serial 6 -dnl Copyright (C) 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2021 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.7/m4/dirname.m4 datamash-1.8/m4/dirname.m4 --- datamash-1.7/m4/dirname.m4 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/m4/dirname.m4 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -#serial 10 -*- autoconf -*- -dnl Copyright (C) 2002-2006, 2009-2020 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_DIRNAME], -[ - AC_REQUIRE([gl_DIRNAME_LGPL]) -]) - -AC_DEFUN([gl_DIRNAME_LGPL], -[ - dnl Prerequisites of lib/dirname.h. - AC_REQUIRE([gl_DOUBLE_SLASH_ROOT]) - - dnl No prerequisites of lib/basename-lgpl.c, lib/dirname-lgpl.c, - dnl lib/stripslash.c. -]) diff -Nru datamash-1.7/m4/double-slash-root.m4 datamash-1.8/m4/double-slash-root.m4 --- datamash-1.7/m4/double-slash-root.m4 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/m4/double-slash-root.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # double-slash-root.m4 serial 4 -*- Autoconf -*- -dnl Copyright (C) 2006, 2008-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2008-2021 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.7/m4/dup2.m4 datamash-1.8/m4/dup2.m4 --- datamash-1.7/m4/dup2.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/dup2.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,105 @@ +#serial 27 +dnl Copyright (C) 2002, 2005, 2007, 2009-2021 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_DUP2], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CACHE_CHECK([whether dup2 works], [gl_cv_func_dup2_works], + [AC_RUN_IFELSE([ + AC_LANG_PROGRAM( + [[#include + #include + #include + #include + #include + ]GL_MDA_DEFINES[ + #ifndef RLIM_SAVED_CUR + # define RLIM_SAVED_CUR RLIM_INFINITY + #endif + #ifndef RLIM_SAVED_MAX + # define RLIM_SAVED_MAX RLIM_INFINITY + #endif + ]], + [[int result = 0; + int bad_fd = INT_MAX; + struct rlimit rlim; + if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 + && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX + && rlim.rlim_cur != RLIM_INFINITY + && rlim.rlim_cur != RLIM_SAVED_MAX + && rlim.rlim_cur != RLIM_SAVED_CUR) + bad_fd = rlim.rlim_cur; + #ifdef FD_CLOEXEC + if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1) + result |= 1; + #endif + if (dup2 (1, 1) != 1) + result |= 2; + #ifdef FD_CLOEXEC + if (fcntl (1, F_GETFD) != FD_CLOEXEC) + result |= 4; + #endif + close (0); + if (dup2 (0, 0) != -1) + result |= 8; + /* Many gnulib modules require POSIX conformance of EBADF. */ + if (dup2 (2, bad_fd) == -1 && errno != EBADF) + result |= 16; + /* Flush out some cygwin core dumps. */ + if (dup2 (2, -1) != -1 || errno != EBADF) + result |= 32; + dup2 (2, 255); + dup2 (2, 256); + /* On OS/2 kLIBC, dup2() does not work on a directory fd. */ + { + int fd = open (".", O_RDONLY); + if (fd == -1) + result |= 64; + else if (dup2 (fd, fd + 1) == -1) + result |= 128; + close (fd); + } + return result;]]) + ], + [gl_cv_func_dup2_works=yes], [gl_cv_func_dup2_works=no], + [case "$host_os" in + mingw*) # on this platform, dup2 always returns 0 for success + gl_cv_func_dup2_works="guessing no" ;; + cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0 + gl_cv_func_dup2_works="guessing no" ;; + aix* | freebsd*) + # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE, + # not EBADF. + gl_cv_func_dup2_works="guessing no" ;; + haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC. + gl_cv_func_dup2_works="guessing no" ;; + *-android*) # implemented using dup3(), which fails if oldfd == newfd + gl_cv_func_dup2_works="guessing no" ;; + os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd. + gl_cv_func_dup2_works="guessing no" ;; + *) gl_cv_func_dup2_works="guessing yes" ;; + esac]) + ]) + case "$gl_cv_func_dup2_works" in + *yes) ;; + *) + REPLACE_DUP2=1 + AC_CHECK_FUNCS([setdtablesize]) + ;; + esac + dnl Replace dup2() for supporting the gnulib-defined fchdir() function, + dnl to keep fchdir's bookkeeping up-to-date. + m4_ifdef([gl_FUNC_FCHDIR], [ + gl_TEST_FCHDIR + if test $HAVE_FCHDIR = 0; then + REPLACE_DUP2=1 + fi + ]) +]) + +# Prerequisites of lib/dup2.c. +AC_DEFUN([gl_PREREQ_DUP2], []) diff -Nru datamash-1.7/m4/eealloc.m4 datamash-1.8/m4/eealloc.m4 --- datamash-1.7/m4/eealloc.m4 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/m4/eealloc.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # eealloc.m4 serial 3 -dnl Copyright (C) 2003, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2009-2021 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.7/m4/errno_h.m4 datamash-1.8/m4/errno_h.m4 --- datamash-1.7/m4/errno_h.m4 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/m4/errno_h.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # errno_h.m4 serial 13 -dnl Copyright (C) 2004, 2006, 2008-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2004, 2006, 2008-2021 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.7/m4/error.m4 datamash-1.8/m4/error.m4 --- datamash-1.7/m4/error.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/error.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ #serial 14 -# Copyright (C) 1996-1998, 2001-2004, 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-1998, 2001-2004, 2009-2021 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.7/m4/expl.m4 datamash-1.8/m4/expl.m4 --- datamash-1.7/m4/expl.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/expl.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# expl.m4 serial 15 -dnl Copyright (C) 2010-2020 Free Software Foundation, Inc. +# expl.m4 serial 17 +dnl Copyright (C) 2010-2021 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,43 +54,6 @@ EXPL_LIBM=-lm fi fi - dnl On Haiku 2017 the system's native expl() is just a stub: it returns 0.0 - dnl and prints "__expl not implemented" for all arguments. - dnl On OpenBSD 5.4 the system's native expl() is buggy: - dnl it returns 'nan' for small values. Test for this anomaly. - if test $gl_cv_func_expl_no_libm = yes \ - || test $gl_cv_func_expl_in_libm = yes; then - AC_CACHE_CHECK([whether expl() breaks with small values], - [gl_cv_func_expl_buggy], - [save_LIBS="$LIBS" - LIBS="$EXPL_LIBM" - AC_RUN_IFELSE( - [AC_LANG_PROGRAM( - [[#include ]], - [[volatile long double x1 = -1.0; - volatile long double x2 = -0.8; - volatile long double x3 = -0.4; - return expl(x1) == 0.0 || isnan(expl(x1)) - || isnan(expl(x2)) || isnan(expl(x3)); - ]]) - ], - [gl_cv_func_expl_buggy=no], [gl_cv_func_expl_buggy=yes], - [case $host_os in - haiku* | openbsd*) - gl_cv_func_expl_buggy="guessing yes" ;; - # Guess no on native Windows. - mingw*) gl_cv_func_expl_buggy="guessing no" ;; - *) gl_cv_func_expl_buggy="guessing no" ;; - esac - ]) - LIBS="$save_LIBS" - ]) - case "$gl_cv_func_expl_buggy" in - *yes) - gl_cv_func_expl_in_libm=no - gl_cv_func_expl_no_libm=no ;; - esac - fi if test $gl_cv_func_expl_no_libm = yes \ || test $gl_cv_func_expl_in_libm = yes; then dnl Also check whether it's declared. @@ -150,7 +113,23 @@ { long double (* volatile my_expl) (long double) = argc ? expl : dummy; int result = 0; - /* This test fails on NetBSD 8.0. */ + /* On Haiku 2017 the system's native expl() is just a stub: it returns 0.0 + and prints "__expl not implemented" for all arguments. */ + { + volatile long double x1 = -1.0; + if (expl (x1) == 0.0) + result |= 1; + } + /* On OpenBSD 5.4 the system's native expl() is buggy: + it returns 'nan' for small values. */ + { + volatile long double x1 = -1.0; + volatile long double x2 = -0.8; + volatile long double x3 = -0.4; + if (isnan (expl (x1)) || isnan (expl (x2)) || isnan (expl (x3))) + result |= 2; + } + /* This test fails on NetBSD 9.0. */ { const long double TWO_LDBL_MANT_DIG = /* 2^LDBL_MANT_DIG */ (long double) (1U << ((LDBL_MANT_DIG - 1) / 5)) @@ -161,7 +140,7 @@ long double x = 11.358L; long double err = (my_expl (x) * my_expl (- x) - 1.0L) * TWO_LDBL_MANT_DIG; if (!(err >= -100.0L && err <= 100.0L)) - result |= 1; + result |= 4; } return result; } diff -Nru datamash-1.7/m4/exp.m4 datamash-1.8/m4/exp.m4 --- datamash-1.7/m4/exp.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/exp.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # exp.m4 serial 1 -dnl Copyright (C) 2011-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2021 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.7/m4/exponentd.m4 datamash-1.8/m4/exponentd.m4 --- datamash-1.7/m4/exponentd.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/exponentd.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # exponentd.m4 serial 3 -dnl Copyright (C) 2007-2008, 2010-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2008, 2010-2021 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.7/m4/exponentf.m4 datamash-1.8/m4/exponentf.m4 --- datamash-1.7/m4/exponentf.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/exponentf.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # exponentf.m4 serial 2 -dnl Copyright (C) 2007-2008, 2010-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2008, 2010-2021 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.7/m4/exponentl.m4 datamash-1.8/m4/exponentl.m4 --- datamash-1.7/m4/exponentl.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/exponentl.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# exponentl.m4 serial 4 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +# exponentl.m4 serial 5 +dnl Copyright (C) 2007-2021 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,14 +22,14 @@ memory_long_double; static unsigned int ored_words[NWORDS]; static unsigned int anded_words[NWORDS]; -static void add_to_ored_words (long double x) +static void add_to_ored_words (long double *x) { memory_long_double m; size_t i; /* Clear it first, in case sizeof (long double) < sizeof (memory_long_double). */ memset (&m, 0, sizeof (memory_long_double)); - m.value = x; + m.value = *x; for (i = 0; i < NWORDS; i++) { ored_words[i] |= m.word[i]; @@ -38,17 +38,15 @@ } int main () { + static long double samples[5] = { 0.25L, 0.5L, 1.0L, 2.0L, 4.0L }; 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.25L); - add_to_ored_words (0.5L); - add_to_ored_words (1.0L); - add_to_ored_words (2.0L); - add_to_ored_words (4.0L); + for (j = 0; j < 5; j++) + add_to_ored_words (&samples[j]); /* Remove bits that are common (e.g. if representation of the first mantissa bit is explicit). */ for (j = 0; j < NWORDS; j++) diff -Nru datamash-1.7/m4/extensions.m4 datamash-1.8/m4/extensions.m4 --- datamash-1.7/m4/extensions.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/extensions.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,14 +1,19 @@ -# serial 18 -*- Autoconf -*- +# serial 22 -*- Autoconf -*- # Enable extensions on systems that normally disable them. -# Copyright (C) 2003, 2006-2020 Free Software Foundation, Inc. +# Copyright (C) 2003, 2006-2021 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. +dnl Define to empty for the benefit of Autoconf 2.69 and earlier, so that +dnl AC_USE_SYSTEM_EXTENSIONS (below) can be used unchanged from Autoconf 2.70+. +m4_ifndef([AC_CHECK_INCLUDES_DEFAULT], + [AC_DEFUN([AC_CHECK_INCLUDES_DEFAULT], [])]) + # This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from git # Autoconf. Perhaps we can remove this once we can assume Autoconf -# 2.70 or later everywhere, but since Autoconf mutates rapidly +# is recent-enough everywhere, but since Autoconf mutates rapidly # enough in this area it's likely we'll need to redefine # AC_USE_SYSTEM_EXTENSIONS for quite some time. @@ -26,36 +31,27 @@ # its dependencies. This will ensure that the gl_USE_SYSTEM_EXTENSIONS # invocation occurs in gl_EARLY, not in gl_INIT. +m4_version_prereq([2.70.1], [], [ + # AC_USE_SYSTEM_EXTENSIONS # ------------------------ # Enable extensions on systems that normally disable them, # typically due to standards-conformance issues. -# -# Remember that #undef in AH_VERBATIM gets replaced with #define by -# AC_DEFINE. The goal here is to define all known feature-enabling -# macros, then, if reports of conflicts are made, disable macros that -# cause problems on some platforms (such as __EXTENSIONS__). +# We unconditionally define as many of the known feature-enabling +# as possible, reserving conditional behavior for macros that are +# known to cause problems on some platforms (such as __EXTENSIONS__). AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS], -[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl +[AC_BEFORE([$0], [AC_PREPROC_IFELSE])dnl +AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl +AC_BEFORE([$0], [AC_LINK_IFELSE])dnl AC_BEFORE([$0], [AC_RUN_IFELSE])dnl - - AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=]) - if test "$MINIX" = yes; then - AC_DEFINE([_POSIX_SOURCE], [1], - [Define to 1 if you need to in order for 'stat' and other - things to work.]) - AC_DEFINE([_POSIX_1_SOURCE], [2], - [Define to 2 if the system does not provide POSIX.1 features - except with this defined.]) - AC_DEFINE([_MINIX], [1], - [Define to 1 if on MINIX.]) - AC_DEFINE([_NETBSD_SOURCE], [1], - [Define to 1 to make NetBSD features available. MINIX 3 needs this.]) - fi - +AC_BEFORE([$0], [AC_CHECK_INCLUDES_DEFAULT])dnl +dnl #undef in AH_VERBATIM gets replaced with #define by AC_DEFINE. dnl Use a different key than __EXTENSIONS__, as that name broke existing dnl configure.ac when using autoheader 2.62. - AH_VERBATIM([USE_SYSTEM_EXTENSIONS], +dnl The macros below are in alphabetical order ignoring leading _ or __ +dnl prefixes. +AH_VERBATIM([USE_SYSTEM_EXTENSIONS], [/* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE @@ -64,19 +60,44 @@ #ifndef _DARWIN_C_SOURCE # undef _DARWIN_C_SOURCE #endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif -/* Enable NetBSD extensions on NetBSD. */ +/* Enable X/Open compliant socket functions that do not require linking + with -lxnet on HP-UX 11.11. */ +#ifndef _HPUX_ALT_XOPEN_SOCKET_API +# undef _HPUX_ALT_XOPEN_SOCKET_API +#endif +/* Identify the host operating system as Minix. + This macro does not affect the system headers' behavior. + A future release of Autoconf may stop defining this macro. */ +#ifndef _MINIX +# undef _MINIX +#endif +/* Enable general extensions on NetBSD. + Enable NetBSD compatibility extensions on Minix. */ #ifndef _NETBSD_SOURCE # undef _NETBSD_SOURCE #endif -/* Enable OpenBSD extensions on NetBSD. */ +/* Enable OpenBSD compatibility extensions on NetBSD. + Oddly enough, this does nothing on OpenBSD. */ #ifndef _OPENBSD_SOURCE # undef _OPENBSD_SOURCE #endif -/* Enable threading extensions on Solaris. */ +/* Define to 1 if needed for POSIX-compatible behavior. */ +#ifndef _POSIX_SOURCE +# undef _POSIX_SOURCE +#endif +/* Define to 2 if needed for POSIX-compatible behavior. */ +#ifndef _POSIX_1_SOURCE +# undef _POSIX_1_SOURCE +#endif +/* Enable POSIX-compatible threading on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif @@ -112,22 +133,19 @@ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif -/* Enable X/Open extensions if necessary. HP-UX 11.11 defines - mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of - whether compiling with -Ae or -D_HPUX_SOURCE=1. */ +/* Enable X/Open extensions. Define to 500 only if necessary + to make mbstate_t available. */ #ifndef _XOPEN_SOURCE # undef _XOPEN_SOURCE #endif -/* Enable X/Open compliant socket functions that do not require linking - with -lxnet on HP-UX 11.11. */ -#ifndef _HPUX_ALT_XOPEN_SOCKET_API -# undef _HPUX_ALT_XOPEN_SOCKET_API -#endif -/* Enable general extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# undef __EXTENSIONS__ -#endif -]) +])dnl + + AC_REQUIRE([AC_CHECK_INCLUDES_DEFAULT])dnl + _AC_CHECK_HEADER_ONCE([wchar.h]) + _AC_CHECK_HEADER_ONCE([minix/config.h]) + +dnl Defining __EXTENSIONS__ may break the system headers on some systems. +dnl (FIXME: Which ones?) AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__], [ac_cv_safe_to_define___extensions__], [AC_COMPILE_IFELSE( @@ -136,11 +154,33 @@ ]AC_INCLUDES_DEFAULT])], [ac_cv_safe_to_define___extensions__=yes], [ac_cv_safe_to_define___extensions__=no])]) - test $ac_cv_safe_to_define___extensions__ = yes && - AC_DEFINE([__EXTENSIONS__]) + +dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to +dnl 500, regardless of whether compiling with -Ae or -D_HPUX_SOURCE=1. +dnl But defining _XOPEN_SOURCE may turn *off* extensions on platforms +dnl not covered by turn-on-extensions macros (notably Dragonfly, Free, +dnl and OpenBSD, which don't have any equivalent of _NETBSD_SOURCE) so +dnl it should only be defined when necessary. + AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined], + [ac_cv_should_define__xopen_source], + [ac_cv_should_define__xopen_source=no + AS_IF([test $ac_cv_header_wchar_h = yes], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + #include + mbstate_t x;]])], + [], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + #define _XOPEN_SOURCE 500 + #include + mbstate_t x;]])], + [ac_cv_should_define__xopen_source=yes])])])]) + AC_DEFINE([_ALL_SOURCE]) AC_DEFINE([_DARWIN_C_SOURCE]) AC_DEFINE([_GNU_SOURCE]) + AC_DEFINE([_HPUX_ALT_XOPEN_SOCKET_API]) AC_DEFINE([_NETBSD_SOURCE]) AC_DEFINE([_OPENBSD_SOURCE]) AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) @@ -152,24 +192,18 @@ 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], - [ac_cv_should_define__xopen_source=no - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[ - #include - mbstate_t x;]])], - [], - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[ - #define _XOPEN_SOURCE 500 - #include - mbstate_t x;]])], - [ac_cv_should_define__xopen_source=yes])])]) - test $ac_cv_should_define__xopen_source = yes && - AC_DEFINE([_XOPEN_SOURCE], [500]) - AC_DEFINE([_HPUX_ALT_XOPEN_SOCKET_API]) + AS_IF([test $ac_cv_header_minix_config_h = yes], + [MINIX=yes + AC_DEFINE([_MINIX]) + AC_DEFINE([_POSIX_SOURCE]) + AC_DEFINE([_POSIX_1_SOURCE], [2])], + [MINIX=]) + AS_IF([test $ac_cv_safe_to_define___extensions__ = yes], + [AC_DEFINE([__EXTENSIONS__])]) + AS_IF([test $ac_cv_should_define__xopen_source = yes], + [AC_DEFINE([_XOPEN_SOURCE], [500])]) ])# AC_USE_SYSTEM_EXTENSIONS +]) # gl_USE_SYSTEM_EXTENSIONS # ------------------------ @@ -177,13 +211,17 @@ # typically due to standards-conformance issues. AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS], [ - dnl Require this macro before AC_USE_SYSTEM_EXTENSIONS. - dnl gnulib does not need it. But if it gets required by third-party macros - dnl after AC_USE_SYSTEM_EXTENSIONS is required, autoconf 2.62..2.63 emit a - dnl warning: "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS". - dnl Note: We can do this only for one of the macros AC_AIX, AC_GNU_SOURCE, - dnl AC_MINIX. If people still use AC_AIX or AC_MINIX, they are out of luck. - AC_REQUIRE([AC_GNU_SOURCE]) - AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + dnl On OpenBSD 6.8 with GCC, the include files contain a couple of + dnl definitions that are only activated with an explicit -D_ISOC11_SOURCE. + dnl That's because this version of GCC (4.2.1) supports the option + dnl '-std=gnu99' but not the option '-std=gnu11'. + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + openbsd*) + AC_DEFINE([_ISOC11_SOURCE], [1], + [Define to enable the declarations of ISO C 11 types and functions.]) + ;; + esac ]) diff -Nru datamash-1.7/m4/extern-inline.m4 datamash-1.8/m4/extern-inline.m4 --- datamash-1.7/m4/extern-inline.m4 2020-04-23 17:33:27.000000000 +0000 +++ datamash-1.8/m4/extern-inline.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ dnl 'extern inline' a la ISO C99. -dnl Copyright 2012-2020 Free Software Foundation, Inc. +dnl Copyright 2012-2021 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.7/m4/fabsl.m4 datamash-1.8/m4/fabsl.m4 --- datamash-1.7/m4/fabsl.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/fabsl.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # fabsl.m4 serial 3 -dnl Copyright (C) 2011-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2021 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.7/m4/fabs.m4 datamash-1.8/m4/fabs.m4 --- datamash-1.7/m4/fabs.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/fabs.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # fabs.m4 serial 1 -dnl Copyright (C) 2011-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2021 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.7/m4/fcntl_h.m4 datamash-1.8/m4/fcntl_h.m4 --- datamash-1.7/m4/fcntl_h.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/fcntl_h.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,55 @@ +# serial 17 +# Configure fcntl.h. +dnl Copyright (C) 2006-2007, 2009-2021 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 Paul Eggert. + +AC_DEFUN([gl_FCNTL_H], +[ + AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) + AC_REQUIRE([gl_FCNTL_O_FLAGS]) + gl_NEXT_HEADERS([fcntl.h]) + + dnl Ensure the type pid_t gets defined. + AC_REQUIRE([AC_TYPE_PID_T]) + + dnl Ensure the type mode_t gets defined. + AC_REQUIRE([AC_TYPE_MODE_T]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use, if it is not common + dnl enough to be declared everywhere. + gl_WARN_ON_USE_PREPARE([[#include + ]], [fcntl openat]) +]) + +AC_DEFUN([gl_FCNTL_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +AC_DEFUN([gl_FCNTL_H_DEFAULTS], +[ + GNULIB_CREAT=0; AC_SUBST([GNULIB_CREAT]) + GNULIB_FCNTL=0; AC_SUBST([GNULIB_FCNTL]) + GNULIB_NONBLOCKING=0; AC_SUBST([GNULIB_NONBLOCKING]) + GNULIB_OPEN=0; AC_SUBST([GNULIB_OPEN]) + GNULIB_OPENAT=0; AC_SUBST([GNULIB_OPENAT]) + dnl Support Microsoft deprecated alias function names by default. + GNULIB_MDA_CREAT=1; AC_SUBST([GNULIB_MDA_CREAT]) + GNULIB_MDA_OPEN=1; AC_SUBST([GNULIB_MDA_OPEN]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_FCNTL=1; AC_SUBST([HAVE_FCNTL]) + HAVE_OPENAT=1; AC_SUBST([HAVE_OPENAT]) + REPLACE_CREAT=0; AC_SUBST([REPLACE_CREAT]) + REPLACE_FCNTL=0; AC_SUBST([REPLACE_FCNTL]) + REPLACE_OPEN=0; AC_SUBST([REPLACE_OPEN]) + REPLACE_OPENAT=0; AC_SUBST([REPLACE_OPENAT]) +]) diff -Nru datamash-1.7/m4/fcntl.m4 datamash-1.8/m4/fcntl.m4 --- datamash-1.7/m4/fcntl.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/fcntl.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,151 @@ +# fcntl.m4 serial 11 +dnl Copyright (C) 2009-2021 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. + +# For now, this module ensures that fcntl() +# - supports F_DUPFD correctly +# - supports or emulates F_DUPFD_CLOEXEC +# - supports F_GETFD +# Still to be ported to mingw: +# - F_SETFD +# - F_GETFL, F_SETFL +# - F_GETOWN, F_SETOWN +# - F_GETLK, F_SETLK, F_SETLKW +AC_DEFUN([gl_FUNC_FCNTL], +[ + dnl Persuade glibc to expose F_DUPFD_CLOEXEC. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CHECK_FUNCS_ONCE([fcntl]) + if test $ac_cv_func_fcntl = no; then + gl_REPLACE_FCNTL + else + dnl cygwin 1.5.x F_DUPFD has wrong errno, and allows negative target + dnl haiku alpha 2 F_DUPFD has wrong errno + AC_CACHE_CHECK([whether fcntl handles F_DUPFD correctly], + [gl_cv_func_fcntl_f_dupfd_works], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include + #include + #include + #include + ]GL_MDA_DEFINES[ + #ifndef RLIM_SAVED_CUR + # define RLIM_SAVED_CUR RLIM_INFINITY + #endif + #ifndef RLIM_SAVED_MAX + # define RLIM_SAVED_MAX RLIM_INFINITY + #endif + ]], + [[int result = 0; + int bad_fd = INT_MAX; + struct rlimit rlim; + if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 + && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX + && rlim.rlim_cur != RLIM_INFINITY + && rlim.rlim_cur != RLIM_SAVED_MAX + && rlim.rlim_cur != RLIM_SAVED_CUR) + bad_fd = rlim.rlim_cur; + if (fcntl (0, F_DUPFD, -1) != -1) result |= 1; + if (errno != EINVAL) result |= 2; + if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4; + if (errno != EINVAL) result |= 8; + /* On OS/2 kLIBC, F_DUPFD does not work on a directory fd */ + { + int fd; + fd = open (".", O_RDONLY); + if (fd == -1) + result |= 16; + else if (fcntl (fd, F_DUPFD, STDERR_FILENO + 1) == -1) + result |= 32; + + close (fd); + } + return result;]])], + [gl_cv_func_fcntl_f_dupfd_works=yes], + [gl_cv_func_fcntl_f_dupfd_works=no], + [case $host_os in + aix* | cygwin* | haiku*) + gl_cv_func_fcntl_f_dupfd_works="guessing no" ;; + *) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;; + esac])]) + case $gl_cv_func_fcntl_f_dupfd_works in + *yes) ;; + *) gl_REPLACE_FCNTL + AC_DEFINE([FCNTL_DUPFD_BUGGY], [1], [Define this to 1 if F_DUPFD + behavior does not match POSIX]) ;; + esac + + dnl Many systems lack F_DUPFD_CLOEXEC. + dnl NetBSD 9.0 declares F_DUPFD_CLOEXEC but it works only like F_DUPFD. + AC_CACHE_CHECK([whether fcntl understands F_DUPFD_CLOEXEC], + [gl_cv_func_fcntl_f_dupfd_cloexec], + [AC_RUN_IFELSE( + [AC_LANG_SOURCE( + [[#include + #include + int main (int argc, char *argv[]) + { + if (argc == 1) + /* parent process */ + { + if (fcntl (1, F_DUPFD_CLOEXEC, 10) < 0) + return 1; + return execl ("./conftest", "./conftest", "child", NULL); + } + else + /* child process */ + return (fcntl (10, F_GETFL) < 0 ? 0 : 42); + } + ]]) + ], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#ifdef __linux__ +/* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace + it to support the semantics on older kernels that failed with EINVAL. */ +choke me +#endif + ]])], + [gl_cv_func_fcntl_f_dupfd_cloexec=yes], + [gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check"]) + ], + [gl_cv_func_fcntl_f_dupfd_cloexec=no], + [case "$host_os" in + # Guess no on NetBSD. + netbsd*) gl_cv_func_fcntl_f_dupfd_cloexec="guessing no" ;; + *) gl_cv_func_fcntl_f_dupfd_cloexec="$gl_cross_guess_normal" ;; + esac + ]) + ]) + case "$gl_cv_func_fcntl_f_dupfd_cloexec" in + *yes) ;; + *) gl_REPLACE_FCNTL + dnl No witness macro needed for this bug. + ;; + esac + fi + dnl Replace fcntl() for supporting the gnulib-defined fchdir() function, + dnl to keep fchdir's bookkeeping up-to-date. + m4_ifdef([gl_FUNC_FCHDIR], [ + gl_TEST_FCHDIR + if test $HAVE_FCHDIR = 0; then + gl_REPLACE_FCNTL + fi + ]) +]) + +AC_DEFUN([gl_REPLACE_FCNTL], +[ + AC_REQUIRE([gl_FCNTL_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([fcntl]) + if test $ac_cv_func_fcntl = no; then + HAVE_FCNTL=0 + else + REPLACE_FCNTL=1 + fi +]) diff -Nru datamash-1.7/m4/fcntl-o.m4 datamash-1.8/m4/fcntl-o.m4 --- datamash-1.7/m4/fcntl-o.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/fcntl-o.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,140 @@ +# fcntl-o.m4 serial 7 +dnl Copyright (C) 2006, 2009-2021 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 Paul Eggert. + +AC_PREREQ([2.60]) + +# Test whether the flags O_NOATIME and O_NOFOLLOW actually work. +# Define HAVE_WORKING_O_NOATIME to 1 if O_NOATIME works, or to 0 otherwise. +# Define HAVE_WORKING_O_NOFOLLOW to 1 if O_NOFOLLOW works, or to 0 otherwise. +AC_DEFUN([gl_FCNTL_O_FLAGS], +[ + dnl Persuade glibc to define O_NOATIME and O_NOFOLLOW. + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CHECK_HEADERS_ONCE([unistd.h]) + AC_CHECK_FUNCS_ONCE([symlink]) + AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h], + [AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include + #if HAVE_UNISTD_H + # include + #else /* on Windows with MSVC */ + # include + # include + # defined sleep(n) _sleep ((n) * 1000) + #endif + #include + ]GL_MDA_DEFINES[ + #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 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;]])], + [gl_cv_header_working_fcntl_h=yes], + [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], + [case "$host_os" in + # Guess 'no' on native Windows. + mingw*) gl_cv_header_working_fcntl_h='no' ;; + *) gl_cv_header_working_fcntl_h=cross-compiling ;; + esac + ]) + ]) + + case $gl_cv_header_working_fcntl_h in #( + *O_NOATIME* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOATIME], [$ac_val], + [Define to 1 if O_NOATIME works.]) + + case $gl_cv_header_working_fcntl_h in #( + *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #( + *) ac_val=1;; + esac + AC_DEFINE_UNQUOTED([HAVE_WORKING_O_NOFOLLOW], [$ac_val], + [Define to 1 if O_NOFOLLOW works.]) +]) diff -Nru datamash-1.7/m4/fflush.m4 datamash-1.8/m4/fflush.m4 --- datamash-1.7/m4/fflush.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/fflush.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ -# fflush.m4 serial 17 +# fflush.m4 serial 18 -# Copyright (C) 2007-2020 Free Software Foundation, Inc. +# Copyright (C) 2007-2021 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. @@ -38,7 +38,8 @@ #else /* on Windows with MSVC */ # include #endif - ]], [[FILE *f = fopen ("conftest.txt", "r"); + ]GL_MDA_DEFINES], + [[FILE *f = fopen ("conftest.txt", "r"); char buffer[10]; int fd; int c; diff -Nru datamash-1.7/m4/flexmember.m4 datamash-1.8/m4/flexmember.m4 --- datamash-1.7/m4/flexmember.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/flexmember.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,44 @@ +# serial 5 +# Check for flexible array member support. + +# Copyright (C) 2006, 2009-2021 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. + +# Written by Paul Eggert. + +AC_DEFUN([AC_C_FLEXIBLE_ARRAY_MEMBER], +[ + AC_CACHE_CHECK([for flexible array member], + ac_cv_c_flexmember, + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include + #include + struct m { struct m *next, **list; char name[]; }; + struct s { struct s *p; struct m *m; int n; double d[]; };]], + [[int m = getchar (); + size_t nbytes = offsetof (struct s, d) + m * sizeof (double); + nbytes += sizeof (struct s) - 1; + nbytes -= nbytes % sizeof (struct s); + struct s *p = malloc (nbytes); + p->p = p; + p->m = NULL; + p->d[0] = 0.0; + return p->d != (double *) NULL;]])], + [ac_cv_c_flexmember=yes], + [ac_cv_c_flexmember=no])]) + if test $ac_cv_c_flexmember = yes; then + AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], [], + [Define to nothing if C supports flexible array members, and to + 1 if it does not. That way, with a declaration like 'struct s + { int n; short d@<:@FLEXIBLE_ARRAY_MEMBER@:>@; };', the struct hack + can be used with pre-C99 compilers. + Use 'FLEXSIZEOF (struct s, d, N * sizeof (short))' to calculate + the size in bytes of such a struct containing an N-element array.]) + else + AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], [1]) + fi +]) diff -Nru datamash-1.7/m4/float_h.m4 datamash-1.8/m4/float_h.m4 --- datamash-1.7/m4/float_h.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/float_h.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # float_h.m4 serial 12 -dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2021 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.7/m4/floorl.m4 datamash-1.8/m4/floorl.m4 --- datamash-1.7/m4/floorl.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/floorl.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # floorl.m4 serial 11 -dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2021 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.7/m4/floor.m4 datamash-1.8/m4/floor.m4 --- datamash-1.7/m4/floor.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/floor.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # floor.m4 serial 14 -dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2021 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.7/m4/fpending.m4 datamash-1.8/m4/fpending.m4 --- datamash-1.7/m4/fpending.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/fpending.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ -# serial 22 +# serial 23 -# Copyright (C) 2000-2001, 2004-2020 Free Software Foundation, Inc. +# Copyright (C) 2000-2001, 2004-2021 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,7 +25,7 @@ AC_CACHE_CHECK([for __fpending], [gl_cv_func___fpending], [ AC_LINK_IFELSE( - [AC_LANG_PROGRAM([$fp_headers], + [AC_LANG_PROGRAM([[$fp_headers]], [[return ! __fpending (stdin);]])], [gl_cv_func___fpending=yes], [gl_cv_func___fpending=no]) diff -Nru datamash-1.7/m4/fpieee.m4 datamash-1.8/m4/fpieee.m4 --- datamash-1.7/m4/fpieee.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/fpieee.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # fpieee.m4 serial 2 -*- coding: utf-8 -*- -dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2021 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.7/m4/fpurge.m4 datamash-1.8/m4/fpurge.m4 --- datamash-1.7/m4/fpurge.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/fpurge.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# fpurge.m4 serial 10 -dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. +# fpurge.m4 serial 12 +dnl Copyright (C) 2007, 2009-2021 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. @@ -8,6 +8,7 @@ [ AC_REQUIRE([gl_STDIO_H_DEFAULTS]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CHECK_HEADERS_ONCE([stdio_ext.h]) AC_CHECK_FUNCS_ONCE([fpurge]) AC_CHECK_FUNCS_ONCE([__fpurge]) AC_CHECK_DECLS([fpurge], , , [[#include ]]) @@ -19,36 +20,36 @@ [AC_LANG_PROGRAM( [[#include ]], - [FILE *f = fopen ("conftest.txt", "w+"); - if (!f) - return 1; - if (fputc ('a', f) != 'a') - { fclose (f); return 2; } - rewind (f); - if (fgetc (f) != 'a') - { fclose (f); return 3; } - if (fgetc (f) != EOF) - { fclose (f); return 4; } - if (fpurge (f) != 0) - { fclose (f); return 5; } - if (putc ('b', f) != 'b') - { fclose (f); return 6; } - if (fclose (f) != 0) - return 7; - if ((f = fopen ("conftest.txt", "r")) == NULL) - return 8; - if (fgetc (f) != 'a') - { fclose (f); return 9; } - if (fgetc (f) != 'b') - { fclose (f); return 10; } - if (fgetc (f) != EOF) - { fclose (f); return 11; } - if (fclose (f) != 0) - return 12; - if (remove ("conftest.txt") != 0) - return 13; - return 0; - ])], + [[FILE *f = fopen ("conftest.txt", "w+"); + if (!f) + return 1; + if (fputc ('a', f) != 'a') + { fclose (f); return 2; } + rewind (f); + if (fgetc (f) != 'a') + { fclose (f); return 3; } + if (fgetc (f) != EOF) + { fclose (f); return 4; } + if (fpurge (f) != 0) + { fclose (f); return 5; } + if (putc ('b', f) != 'b') + { fclose (f); return 6; } + if (fclose (f) != 0) + return 7; + if ((f = fopen ("conftest.txt", "r")) == NULL) + return 8; + if (fgetc (f) != 'a') + { fclose (f); return 9; } + if (fgetc (f) != 'b') + { fclose (f); return 10; } + if (fgetc (f) != EOF) + { fclose (f); return 11; } + if (fclose (f) != 0) + return 12; + if (remove ("conftest.txt") != 0) + return 13; + return 0; + ]])], [gl_cv_func_fpurge_works=yes], [gl_cv_func_fpurge_works=no], [case "$host_os" in diff -Nru datamash-1.7/m4/freading.m4 datamash-1.8/m4/freading.m4 --- datamash-1.7/m4/freading.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/freading.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,10 +1,11 @@ -# freading.m4 serial 1 -dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. +# freading.m4 serial 2 +dnl Copyright (C) 2007, 2009-2021 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_FREADING], [ + AC_CHECK_HEADERS_ONCE([stdio_ext.h]) AC_CHECK_FUNCS_ONCE([__freading]) ]) diff -Nru datamash-1.7/m4/frexpl.m4 datamash-1.8/m4/frexpl.m4 --- datamash-1.7/m4/frexpl.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/frexpl.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# frexpl.m4 serial 21 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +# frexpl.m4 serial 22 +dnl Copyright (C) 2007-2021 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. @@ -150,6 +150,7 @@ "C" #endif long double frexpl (long double, int *); +long double zero = 0.0L; int main() { int result = 0; @@ -207,7 +208,8 @@ } } /* Test on infinite numbers. */ - x = 1.0L / 0.0L; + /* The Microsoft MSVC 14 compiler chokes on the expression 1.0 / 0.0. */ + x = 1.0L / zero; { int exp; long double y = frexpl (x, &exp); diff -Nru datamash-1.7/m4/frexp.m4 datamash-1.8/m4/frexp.m4 --- datamash-1.7/m4/frexp.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/frexp.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # frexp.m4 serial 16 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2021 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.7/m4/fseek.m4 datamash-1.8/m4/fseek.m4 --- datamash-1.7/m4/fseek.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/fseek.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # fseek.m4 serial 4 -dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2021 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.7/m4/fseeko.m4 datamash-1.8/m4/fseeko.m4 --- datamash-1.7/m4/fseeko.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/fseeko.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# fseeko.m4 serial 19 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +# fseeko.m4 serial 20 +dnl Copyright (C) 2007-2021 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. @@ -17,7 +17,7 @@ AC_CACHE_CHECK([for fseeko], [gl_cv_func_fseeko], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include -]], [fseeko (stdin, 0, 0);])], +]], [[fseeko (stdin, 0, 0);]])], [gl_cv_func_fseeko=yes], [gl_cv_func_fseeko=no]) ]) diff -Nru datamash-1.7/m4/fstat.m4 datamash-1.8/m4/fstat.m4 --- datamash-1.7/m4/fstat.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/fstat.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# fstat.m4 serial 6 -dnl Copyright (C) 2011-2020 Free Software Foundation, Inc. +# fstat.m4 serial 7 +dnl Copyright (C) 2011-2021 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. @@ -35,5 +35,6 @@ # Prerequisites of lib/fstat.c and lib/stat-w32.c. AC_DEFUN([gl_PREREQ_FSTAT], [ AC_REQUIRE([gl_HEADER_SYS_STAT_H]) + AC_REQUIRE([gl_PREREQ_STAT_W32]) : ]) diff -Nru datamash-1.7/m4/ftell.m4 datamash-1.8/m4/ftell.m4 --- datamash-1.7/m4/ftell.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/ftell.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # ftell.m4 serial 3 -dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2021 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.7/m4/ftello.m4 datamash-1.8/m4/ftello.m4 --- datamash-1.7/m4/ftello.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/ftello.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # ftello.m4 serial 13 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2021 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.7/m4/getdtablesize.m4 datamash-1.8/m4/getdtablesize.m4 --- datamash-1.7/m4/getdtablesize.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/getdtablesize.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,63 @@ +# getdtablesize.m4 serial 8 +dnl Copyright (C) 2008-2021 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_GETDTABLESIZE], +[ + AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_CHECK_FUNCS_ONCE([getdtablesize]) + AC_CHECK_DECLS_ONCE([getdtablesize]) + if test $ac_cv_func_getdtablesize = yes && + test $ac_cv_have_decl_getdtablesize = yes; then + AC_CACHE_CHECK([whether getdtablesize works], + [gl_cv_func_getdtablesize_works], + [dnl There are two concepts: the "maximum possible file descriptor value + 1" + dnl and the "maximum number of open file descriptors in a process". + dnl Per SUSv2 and POSIX, getdtablesize() should return the first one. + dnl On most platforms, the first and the second concept are the same. + dnl On OpenVMS, however, they are different and getdtablesize() returns + dnl the second one; thus the test below fails. But we don't care + dnl because there's no good way to write a replacement getdtablesize(). + case "$host_os" in + vms*) gl_cv_func_getdtablesize_works="no (limitation)" ;; + *) + dnl Cygwin 1.7.25 automatically increases the RLIMIT_NOFILE soft + dnl limit up to an unchangeable hard limit; all other platforms + dnl correctly require setrlimit before getdtablesize() can report + dnl a larger value. + AC_RUN_IFELSE([ + AC_LANG_PROGRAM( + [[#include ] + GL_MDA_DEFINES + ], + [[int size = getdtablesize(); + if (dup2 (0, getdtablesize()) != -1) + return 1; + if (size != getdtablesize()) + return 2; + ]])], + [gl_cv_func_getdtablesize_works=yes], + [gl_cv_func_getdtablesize_works=no], + [case "$host_os" in + cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows + gl_cv_func_getdtablesize_works="guessing no" ;; + *) gl_cv_func_getdtablesize_works="guessing yes" ;; + esac + ]) + ;; + esac + ]) + case "$gl_cv_func_getdtablesize_works" in + *yes | "no (limitation)") ;; + *) REPLACE_GETDTABLESIZE=1 ;; + esac + else + HAVE_GETDTABLESIZE=0 + fi +]) + +# Prerequisites of lib/getdtablesize.c. +AC_DEFUN([gl_PREREQ_GETDTABLESIZE], [:]) diff -Nru datamash-1.7/m4/getopt.m4 datamash-1.8/m4/getopt.m4 --- datamash-1.7/m4/getopt.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/getopt.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # getopt.m4 serial 47 -dnl Copyright (C) 2002-2006, 2008-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2008-2021 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.7/m4/getprogname.m4 datamash-1.8/m4/getprogname.m4 --- datamash-1.7/m4/getprogname.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/getprogname.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ # getprogname.m4 - check for getprogname or replacements for it -# Copyright (C) 2016-2020 Free Software Foundation, Inc. +# Copyright (C) 2016-2021 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.7/m4/gettext.m4 datamash-1.8/m4/gettext.m4 --- datamash-1.7/m4/gettext.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/gettext.m4 2022-05-28 01:46:45.000000000 +0000 @@ -1,16 +1,16 @@ -# gettext.m4 serial 70 (gettext-0.20) -dnl Copyright (C) 1995-2014, 2016, 2018, 2020 Free Software Foundation, Inc. +# gettext.m4 serial 66 (gettext-0.18.2) +dnl Copyright (C) 1995-2014 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 be used in projects which are not available under +dnl This file can 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 is covered by the GNU General Public License. +dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: @@ -20,13 +20,15 @@ dnl Macro to add for using GNU gettext. dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). -dnl INTLSYMBOL must be one of 'external', 'use-libtool'. -dnl INTLSYMBOL should be 'external' for packages other than GNU gettext, and -dnl 'use-libtool' for the packages 'gettext-runtime' and 'gettext-tools'. +dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The +dnl default (if it is not specified or empty) is 'no-libtool'. +dnl INTLSYMBOL should be 'external' for packages with no intl directory, +dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. dnl If INTLSYMBOL is 'use-libtool', then a libtool library dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, dnl depending on --{enable,disable}-{shared,static} and on the presence of -dnl AM-DISABLE-SHARED). +dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library +dnl $(top_builddir)/intl/libintl.a will be created. dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext dnl implementations (in libc or libintl) without the ngettext() function dnl will be ignored. If NEEDSYMBOL is specified and is @@ -55,17 +57,19 @@ AC_DEFUN([AM_GNU_GETTEXT], [ dnl Argument checking. - ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [use-libtool], , + ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT -])])])]) +])])])])]) ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old], - [errprint([ERROR: Use of AM_GNU_GETTEXT without [external] argument is no longer supported. -])]) + [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])]) ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT ])])])]) define([gt_included_intl], - ifelse([$1], [external], [no], [yes])) + ifelse([$1], [external], + ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]), + [yes])) + define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], [])) gt_NEEDS_INIT AM_GNU_GETTEXT_NEED([$2]) @@ -87,7 +91,8 @@ dnl again, outside any 'if'. There are two solutions: dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. - dnl Since AC_PROVIDE_IFELSE is not documented, we avoid it. + dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not + dnl documented, we avoid it. ifelse(gt_included_intl, yes, , [ AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) ]) @@ -156,18 +161,13 @@ [AC_LANG_PROGRAM( [[ #include -#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +$gt_revision_test_code 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 + __GNU_GETTEXT_SYMBOL_EXPRESSION +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings ]])], [eval "$gt_func_gnugettext_libc=yes"], [eval "$gt_func_gnugettext_libc=no"])]) @@ -193,22 +193,17 @@ [AC_LANG_PROGRAM( [[ #include -#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +$gt_revision_test_code 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 + __GNU_GETTEXT_SYMBOL_EXPRESSION +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ]])], [eval "$gt_func_gnugettext_libintl=yes"], [eval "$gt_func_gnugettext_libintl=no"]) @@ -219,22 +214,17 @@ [AC_LANG_PROGRAM( [[ #include -#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +$gt_revision_test_code 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 + __GNU_GETTEXT_SYMBOL_EXPRESSION +return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") ]])], [LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" @@ -273,8 +263,8 @@ dnl Mark actions used to generate GNU NLS library. BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes - LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LIBICONV $LIBTHREAD" - LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LTLIBICONV $LTLIBTHREAD" + LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD" + LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi @@ -342,14 +332,43 @@ fi ifelse(gt_included_intl, yes, [ - dnl In GNU gettext we have to set BUILD_INCLUDED_LIBINTL to 'yes' - dnl because some of the testsuite requires it. - BUILD_INCLUDED_LIBINTL=yes + dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL + dnl to 'yes' because some of the testsuite requires it. + if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then + BUILD_INCLUDED_LIBINTL=yes + fi dnl Make all variables we use known to autoconf. AC_SUBST([BUILD_INCLUDED_LIBINTL]) AC_SUBST([USE_INCLUDED_LIBINTL]) AC_SUBST([CATOBJEXT]) + + dnl For backward compatibility. Some configure.ins may be using this. + nls_cv_header_intl= + nls_cv_header_libgt= + + dnl For backward compatibility. Some Makefiles may be using this. + DATADIRNAME=share + AC_SUBST([DATADIRNAME]) + + dnl For backward compatibility. Some Makefiles may be using this. + INSTOBJEXT=.mo + AC_SUBST([INSTOBJEXT]) + + dnl For backward compatibility. Some Makefiles may be using this. + GENCAT=gencat + AC_SUBST([GENCAT]) + + dnl For backward compatibility. Some Makefiles may be using this. + INTLOBJS= + if test "$USE_INCLUDED_LIBINTL" = yes; then + INTLOBJS="\$(GETTOBJS)" + fi + AC_SUBST([INTLOBJS]) + + dnl Enable libtool support if the surrounding package wishes it. + INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix + AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX]) ]) dnl For backward compatibility. Some Makefiles may be using this. @@ -380,7 +399,3 @@ 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.7/m4/gl-openssl.m4 datamash-1.8/m4/gl-openssl.m4 --- datamash-1.7/m4/gl-openssl.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/gl-openssl.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# gl-openssl.m4 serial 4 -dnl Copyright (C) 2013-2020 Free Software Foundation, Inc. +# gl-openssl.m4 serial 5 +dnl Copyright (C) 2013-2021 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,12 +31,6 @@ [], [with_openssl=$with_openssl_default]) - if test "x$1" = xMD5; then - ALG_header=md5.h - else - ALG_header=sha.h - fi - AC_SUBST([LIB_CRYPTO]) if test "x$with_openssl" != xno; then if test "x$with_openssl" = xauto-gpl-compat; then @@ -55,7 +49,8 @@ if test "x$with_openssl" != xauto-gpl-compat || test "x$gl_cv_openssl_gpl_compat" = xyes; then AC_CHECK_LIB([crypto], [$1], - [AC_CHECK_HEADERS([openssl/$ALG_header], + [AC_CHECK_HEADERS( + m4_if([$1], [MD5], [openssl/md5.h], [openssl/sha.h]), [LIB_CRYPTO=-lcrypto AC_DEFINE([HAVE_OPENSSL_$1], [1], [Define to 1 if libcrypto is used for $1.])])]) diff -Nru datamash-1.7/m4/gnulib-cache.m4 datamash-1.8/m4/gnulib-cache.m4 --- datamash-1.7/m4/gnulib-cache.m4 2020-04-23 17:13:45.000000000 +0000 +++ datamash-1.8/m4/gnulib-cache.m4 2022-05-28 01:47:05.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 Free Software Foundation, Inc. +# Copyright (C) 2002-2021 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 @@ -52,6 +52,8 @@ # crypto/sha512 \ # dirname \ # do-release-commit-and-tag \ +# dup2 \ +# errno \ # error \ # expl \ # extensions \ @@ -61,7 +63,7 @@ # fpucw \ # gendocs \ # getopt-gnu \ -# gettext \ +# gettext-h \ # git-version-gen \ # gitlog-to-changelog \ # gnu-web-doc-update \ @@ -71,6 +73,8 @@ # hash-pjw \ # hash-pjw-bare \ # ignore-value \ +# inet_pton \ +# inline \ # intprops \ # inttostr \ # inttypes \ @@ -81,31 +85,42 @@ # localeconv \ # logl \ # maintainer-makefile \ -# mbsrtowcs \ # minmax \ # modfl \ # netinet_in \ # non-recursive-gnulib-prefix-hack \ +# pclose \ # pmccabe2html \ +# popen \ # progname \ # propername \ # random \ # readme-release \ # realloc-gnu \ # roundl \ +# setlocale \ +# sh-quote \ +# signbit \ # size_max \ +# snprintf \ # sqrtl \ +# std-gnu11 \ +# stdbool \ # stdint \ # stdnoreturn \ # stpcpy \ +# strcase \ +# strdup-posix \ # strsep \ +# strtold \ +# strtoll \ # sys_socket \ # unlocked-io \ # update-copyright \ # version-etc \ +# waitpid \ # warnings \ # xalloc \ -# xstrndup \ # xstrtol \ # xstrtol-error \ # xstrtoumax @@ -127,6 +142,8 @@ crypto/sha512 dirname do-release-commit-and-tag + dup2 + errno error expl extensions @@ -136,7 +153,7 @@ fpucw gendocs getopt-gnu - gettext + gettext-h git-version-gen gitlog-to-changelog gnu-web-doc-update @@ -146,6 +163,8 @@ hash-pjw hash-pjw-bare ignore-value + inet_pton + inline intprops inttostr inttypes @@ -156,31 +175,42 @@ localeconv logl maintainer-makefile - mbsrtowcs minmax modfl netinet_in non-recursive-gnulib-prefix-hack + pclose pmccabe2html + popen progname propername random readme-release realloc-gnu roundl + setlocale + sh-quote + signbit size_max + snprintf sqrtl + std-gnu11 + stdbool stdint stdnoreturn stpcpy + strcase + strdup-posix strsep + strtold + strtoll sys_socket unlocked-io update-copyright version-etc + waitpid warnings xalloc - xstrndup xstrtol xstrtol-error xstrtoumax diff -Nru datamash-1.7/m4/gnulib-common.m4 datamash-1.8/m4/gnulib-common.m4 --- datamash-1.7/m4/gnulib-common.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/gnulib-common.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# gnulib-common.m4 serial 48 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +# gnulib-common.m4 serial 63 +dnl Copyright (C) 2007-2021 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. @@ -15,6 +15,15 @@ AC_REQUIRE([gl_ZZGNULIB]) ]) AC_DEFUN([gl_COMMON_BODY], [ + AH_VERBATIM([_GL_GNUC_PREREQ], +[/* True if the compiler says it groks GNU C version MAJOR.MINOR. */ +#if defined __GNUC__ && defined __GNUC_MINOR__ +# define _GL_GNUC_PREREQ(major, minor) \ + ((major) < __GNUC__ + ((minor) <= __GNUC_MINOR__)) +#else +# define _GL_GNUC_PREREQ(major, minor) 0 +#endif +]) AH_VERBATIM([_Noreturn], [/* The _Noreturn keyword of C11. */ #ifndef _Noreturn @@ -31,12 +40,12 @@ # define _Noreturn [[noreturn]] # elif ((!defined __cplusplus || defined __clang__) \ && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \ - || 4 < __GNUC__ + (7 <= __GNUC_MINOR__) \ + || _GL_GNUC_PREREQ (4, 7) \ || (defined __apple_build_version__ \ ? 6000000 <= __apple_build_version__ \ : 3 < __clang_major__ + (5 <= __clang_minor__)))) /* _Noreturn works as-is. */ -# elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C +# elif _GL_GNUC_PREREQ (2, 8) || defined __clang__ || 0x5110 <= __SUNPRO_C # define _Noreturn __attribute__ ((__noreturn__)) # elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0) # define _Noreturn __declspec (noreturn) @@ -55,48 +64,216 @@ #if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__ # define __GNUC_STDC_INLINE__ 1 #endif]) - AH_VERBATIM([unused_parameter], -[/* Define as a marker that can be attached to declarations that might not - be used. This helps to reduce warnings, such as from - GCC -Wunused-parameter. */ -#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) -# define _GL_UNUSED __attribute__ ((__unused__)) -#else -# define _GL_UNUSED -#endif -/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name - is a misnomer outside of parameter lists. */ -#define _UNUSED_PARAMETER_ _GL_UNUSED - -/* gcc supports the "unused" attribute on possibly unused labels, and - g++ has since version 4.5. Note to support C++ as well as C, - _GL_UNUSED_LABEL should be used with a trailing ; */ -#if !defined __cplusplus || __GNUC__ > 4 \ - || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) -# define _GL_UNUSED_LABEL _GL_UNUSED + AH_VERBATIM([attribute], +[/* Attributes. */ +#ifdef __has_attribute +# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__) #else -# define _GL_UNUSED_LABEL +# define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr +# define _GL_ATTR_alloc_size _GL_GNUC_PREREQ (4, 3) +# define _GL_ATTR_always_inline _GL_GNUC_PREREQ (3, 2) +# define _GL_ATTR_artificial _GL_GNUC_PREREQ (4, 3) +# define _GL_ATTR_cold _GL_GNUC_PREREQ (4, 3) +# define _GL_ATTR_const _GL_GNUC_PREREQ (2, 95) +# define _GL_ATTR_deprecated _GL_GNUC_PREREQ (3, 1) +# define _GL_ATTR_diagnose_if 0 +# define _GL_ATTR_error _GL_GNUC_PREREQ (4, 3) +# define _GL_ATTR_externally_visible _GL_GNUC_PREREQ (4, 1) +# define _GL_ATTR_fallthrough _GL_GNUC_PREREQ (7, 0) +# define _GL_ATTR_format _GL_GNUC_PREREQ (2, 7) +# define _GL_ATTR_leaf _GL_GNUC_PREREQ (4, 6) +# ifdef _ICC +# define _GL_ATTR_may_alias 0 +# else +# define _GL_ATTR_may_alias _GL_GNUC_PREREQ (3, 3) +# endif +# define _GL_ATTR_malloc _GL_GNUC_PREREQ (3, 0) +# define _GL_ATTR_noinline _GL_GNUC_PREREQ (3, 1) +# define _GL_ATTR_nonnull _GL_GNUC_PREREQ (3, 3) +# define _GL_ATTR_nonstring _GL_GNUC_PREREQ (8, 0) +# define _GL_ATTR_nothrow _GL_GNUC_PREREQ (3, 3) +# define _GL_ATTR_packed _GL_GNUC_PREREQ (2, 7) +# define _GL_ATTR_pure _GL_GNUC_PREREQ (2, 96) +# define _GL_ATTR_returns_nonnull _GL_GNUC_PREREQ (4, 9) +# define _GL_ATTR_sentinel _GL_GNUC_PREREQ (4, 0) +# define _GL_ATTR_unused _GL_GNUC_PREREQ (2, 7) +# define _GL_ATTR_warn_unused_result _GL_GNUC_PREREQ (3, 4) #endif -/* The __pure__ attribute was added in gcc 2.96. */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) -# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +]dnl There is no _GL_ATTRIBUTE_ALIGNED; use stdalign's _Alignas instead. +[ +#if _GL_HAS_ATTRIBUTE (alloc_size) +# define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args)) +#else +# define _GL_ATTRIBUTE_ALLOC_SIZE(args) +#endif + +#if _GL_HAS_ATTRIBUTE (always_inline) +# define _GL_ATTRIBUTE_ALWAYS_INLINE __attribute__ ((__always_inline__)) #else -# define _GL_ATTRIBUTE_PURE /* empty */ +# define _GL_ATTRIBUTE_ALWAYS_INLINE #endif -/* The __const__ attribute was added in gcc 2.95. */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) +#if _GL_HAS_ATTRIBUTE (artificial) +# define _GL_ATTRIBUTE_ARTIFICIAL __attribute__ ((__artificial__)) +#else +# define _GL_ATTRIBUTE_ARTIFICIAL +#endif + +/* Avoid __attribute__ ((cold)) on MinGW; see thread starting at + . + Also, Oracle Studio 12.6 requires 'cold' not '__cold__'. */ +#if _GL_HAS_ATTRIBUTE (cold) && !defined __MINGW32__ +# ifndef __SUNPRO_C +# define _GL_ATTRIBUTE_COLD __attribute__ ((__cold__)) +# else +# define _GL_ATTRIBUTE_COLD __attribute__ ((cold)) +# endif +#else +# define _GL_ATTRIBUTE_COLD +#endif + +#if _GL_HAS_ATTRIBUTE (const) # define _GL_ATTRIBUTE_CONST __attribute__ ((__const__)) #else -# define _GL_ATTRIBUTE_CONST /* empty */ +# define _GL_ATTRIBUTE_CONST +#endif + +#if 201710L < __STDC_VERSION__ +# define _GL_ATTRIBUTE_DEPRECATED [[__deprecated__]] +#elif _GL_HAS_ATTRIBUTE (deprecated) +# define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__)) +#else +# define _GL_ATTRIBUTE_DEPRECATED +#endif + +#if _GL_HAS_ATTRIBUTE (error) +# define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__error__ (msg))) +# define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__warning__ (msg))) +#elif _GL_HAS_ATTRIBUTE (diagnose_if) +# define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__diagnose_if__ (1, msg, "error"))) +# define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__diagnose_if__ (1, msg, "warning"))) +#else +# define _GL_ATTRIBUTE_ERROR(msg) +# define _GL_ATTRIBUTE_WARNING(msg) +#endif + +#if _GL_HAS_ATTRIBUTE (externally_visible) +# define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE __attribute__ ((externally_visible)) +#else +# define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE +#endif + +/* FALLTHROUGH is special, because it always expands to something. */ +#if 201710L < __STDC_VERSION__ +# define _GL_ATTRIBUTE_FALLTHROUGH [[__fallthrough__]] +#elif _GL_HAS_ATTRIBUTE (fallthrough) +# define _GL_ATTRIBUTE_FALLTHROUGH __attribute__ ((__fallthrough__)) +#else +# define _GL_ATTRIBUTE_FALLTHROUGH ((void) 0) +#endif + +#if _GL_HAS_ATTRIBUTE (format) +# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec)) +#else +# define _GL_ATTRIBUTE_FORMAT(spec) +#endif + +#if _GL_HAS_ATTRIBUTE (leaf) +# define _GL_ATTRIBUTE_LEAF __attribute__ ((__leaf__)) +#else +# define _GL_ATTRIBUTE_LEAF +#endif + +/* Oracle Studio 12.6 mishandles may_alias despite __has_attribute OK. */ +#if _GL_HAS_ATTRIBUTE (may_alias) && !defined __SUNPRO_C +# define _GL_ATTRIBUTE_MAY_ALIAS __attribute__ ((__may_alias__)) +#else +# define _GL_ATTRIBUTE_MAY_ALIAS +#endif + +#if 201710L < __STDC_VERSION__ +# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]] +#elif _GL_HAS_ATTRIBUTE (unused) +# define _GL_ATTRIBUTE_MAYBE_UNUSED __attribute__ ((__unused__)) +#else +# define _GL_ATTRIBUTE_MAYBE_UNUSED #endif +/* Earlier spellings of this macro. */ +#define _GL_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED +#define _UNUSED_PARAMETER_ _GL_ATTRIBUTE_MAYBE_UNUSED -/* The __malloc__ attribute was added in gcc 3. */ -#if 3 <= __GNUC__ +#if _GL_HAS_ATTRIBUTE (malloc) # define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__)) #else -# define _GL_ATTRIBUTE_MALLOC /* empty */ +# define _GL_ATTRIBUTE_MALLOC +#endif + +#if 201710L < __STDC_VERSION__ +# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]] +#elif _GL_HAS_ATTRIBUTE (warn_unused_result) +# define _GL_ATTRIBUTE_NODISCARD __attribute__ ((__warn_unused_result__)) +#else +# define _GL_ATTRIBUTE_NODISCARD +#endif + +#if _GL_HAS_ATTRIBUTE (noinline) +# define _GL_ATTRIBUTE_NOINLINE __attribute__ ((__noinline__)) +#else +# define _GL_ATTRIBUTE_NOINLINE +#endif + +#if _GL_HAS_ATTRIBUTE (nonnull) +# define _GL_ATTRIBUTE_NONNULL(args) __attribute__ ((__nonnull__ args)) +#else +# define _GL_ATTRIBUTE_NONNULL(args) +#endif + +#if _GL_HAS_ATTRIBUTE (nonstring) +# define _GL_ATTRIBUTE_NONSTRING __attribute__ ((__nonstring__)) +#else +# define _GL_ATTRIBUTE_NONSTRING +#endif + +/* There is no _GL_ATTRIBUTE_NORETURN; use _Noreturn instead. */ + +#if _GL_HAS_ATTRIBUTE (nothrow) && !defined __cplusplus +# define _GL_ATTRIBUTE_NOTHROW __attribute__ ((__nothrow__)) +#else +# define _GL_ATTRIBUTE_NOTHROW +#endif + +#if _GL_HAS_ATTRIBUTE (packed) +# define _GL_ATTRIBUTE_PACKED __attribute__ ((__packed__)) +#else +# define _GL_ATTRIBUTE_PACKED +#endif + +#if _GL_HAS_ATTRIBUTE (pure) +# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__)) +#else +# define _GL_ATTRIBUTE_PURE +#endif + +#if _GL_HAS_ATTRIBUTE (returns_nonnull) +# define _GL_ATTRIBUTE_RETURNS_NONNULL __attribute__ ((__returns_nonnull__)) +#else +# define _GL_ATTRIBUTE_RETURNS_NONNULL +#endif + +#if _GL_HAS_ATTRIBUTE (sentinel) +# define _GL_ATTRIBUTE_SENTINEL(pos) __attribute__ ((__sentinel__ pos)) +#else +# define _GL_ATTRIBUTE_SENTINEL(pos) +#endif + +]dnl There is no _GL_ATTRIBUTE_VISIBILITY; see m4/visibility.m4 instead. +[ +/* To support C++ as well as C, use _GL_UNUSED_LABEL with trailing ';'. */ +#if !defined __cplusplus || _GL_GNUC_PREREQ (4, 5) +# define _GL_UNUSED_LABEL _GL_ATTRIBUTE_MAYBE_UNUSED +#else +# define _GL_UNUSED_LABEL #endif ]) AH_VERBATIM([async_safe], @@ -126,6 +303,22 @@ errno. */ #define _GL_ASYNC_SAFE ]) + AH_VERBATIM([micro_optimizations], +[/* _GL_CMP (n1, n2) performs a three-valued comparison on n1 vs. n2, where + n1 and n2 are expressions without side effects, that evaluate to real + numbers (excluding NaN). + It returns + 1 if n1 > n2 + 0 if n1 == n2 + -1 if n1 < n2 + The naïve code (n1 > n2 ? 1 : n1 < n2 ? -1 : 0) produces a conditional + jump with nearly all GCC versions up to GCC 10. + This variant (n1 < n2 ? -1 : n1 > n2) produces a conditional with many + GCC versions up to GCC 9. + The better code (n1 > n2) - (n1 < n2) from Hacker's Delight § 2-9 + avoids conditional jumps in all GCC versions >= 3.4. */ +#define _GL_CMP(n1, n2) (((n1) > (n2)) - ((n1) < (n2))) +]) dnl Hint which direction to take regarding cross-compilation guesses: dnl When a user installs a program on a platform they are not intimately dnl familiar with, --enable-cross-guesses=conservative is the appropriate @@ -287,34 +480,20 @@ AC_SUBST([HAVE_FEATURES_H]) ]) -# AS_VAR_IF(VAR, VALUE, [IF-MATCH], [IF-NOT-MATCH]) -# ---------------------------------------------------- -# Backport of autoconf-2.63b's macro. -# Remove this macro when we can assume autoconf >= 2.64. -m4_ifndef([AS_VAR_IF], -[m4_define([AS_VAR_IF], -[AS_IF([test x"AS_VAR_GET([$1])" = x""$2], [$3], [$4])])]) - # gl_PROG_CC_C99 # Modifies the value of the shell variable CC in an attempt to make $CC # understand ISO C99 source code. -# This is like AC_PROG_CC_C99, except that -# - AC_PROG_CC_C99 does not mix well with AC_PROG_CC_STDC -# , -# but many more packages use AC_PROG_CC_STDC than AC_PROG_CC_C99 -# . -# Remaining problems: -# - When AC_PROG_CC_STDC is invoked twice, it adds the C99 enabling options -# to CC twice -# . -# - AC_PROG_CC_STDC is likely to change now that C11 is an ISO standard. AC_DEFUN([gl_PROG_CC_C99], [ - dnl Change that version number to the minimum Autoconf version that supports - dnl mixing AC_PROG_CC_C99 calls with AC_PROG_CC_STDC calls. - m4_version_prereq([9.0], - [AC_REQUIRE([AC_PROG_CC_C99])], - [AC_REQUIRE([AC_PROG_CC_STDC])]) + dnl Just use AC_PROG_CC_C99. + dnl When AC_PROG_CC_C99 and AC_PROG_CC_STDC are used together, the substituted + dnl value of CC will contain the C99 enabling options twice. But this is only + dnl a cosmetic problem. + dnl With Autoconf >= 2.70, use AC_PROG_CC since it implies AC_PROG_CC_C99; + dnl this avoids a "warning: The macro `AC_PROG_CC_C99' is obsolete." + m4_version_prereq([2.70], + [AC_REQUIRE([AC_PROG_CC])], + [AC_REQUIRE([AC_PROG_CC_C99])]) ]) # gl_PROG_AR_RANLIB @@ -388,16 +567,16 @@ ]) # AC_C_RESTRICT -# This definition is copied from post-2.69 Autoconf and overrides the -# AC_C_RESTRICT macro from autoconf 2.60..2.69. It can be removed -# once autoconf >= 2.70 can be assumed. It's painful to check version -# numbers, and in practice this macro is more up-to-date than Autoconf -# is, so override Autoconf unconditionally. +# This definition is copied from post-2.70 Autoconf and overrides the +# AC_C_RESTRICT macro from autoconf 2.60..2.70. +m4_version_prereq([2.70.1], [], [ AC_DEFUN([AC_C_RESTRICT], [AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict], [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 + # Put '__restrict__' first, to avoid problems with glibc and non-GCC; see: + # https://lists.gnu.org/archive/html/bug-autoconf/2016-02/msg00006.html + # Put 'restrict' last, because C++ lacks it. + for ac_kw in __restrict__ __restrict _Restrict restrict; do AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[typedef int *int_ptr; @@ -417,7 +596,7 @@ AH_VERBATIM([restrict], [/* Define to the equivalent of the C99 'restrict' keyword, or to nothing if this is not supported. Do not define if restrict is - supported directly. */ + supported only directly. */ #undef restrict /* Work around a bug in older versions of Sun C++, which did not #define __restrict__ or support _Restrict or __restrict__ @@ -435,6 +614,7 @@ *) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;; esac ])# AC_C_RESTRICT +]) # gl_BIGENDIAN # is like AC_C_BIGENDIAN, except that it can be AC_REQUIREd. @@ -445,6 +625,22 @@ AC_C_BIGENDIAN ]) +# A temporary file descriptor. +# Must be less than 10, because dash 0.5.8 does not support redirections +# with multi-digit file descriptors. +m4_define([GL_TMP_FD], 9) + +# gl_SILENT(command) +# executes command, but without the normal configure output. +# This is useful when you want to invoke AC_CACHE_CHECK (or AC_CHECK_FUNC etc.) +# inside another AC_CACHE_CHECK. +AC_DEFUN([gl_SILENT], +[ + exec GL_TMP_FD>&AS_MESSAGE_FD AS_MESSAGE_FD>/dev/null + $1 + exec AS_MESSAGE_FD>&GL_TMP_FD GL_TMP_FD>&- +]) + # gl_CACHE_VAL_SILENT(cache-id, command-to-set-it) # is like AC_CACHE_VAL(cache-id, command-to-set-it), except that it does not # output a spurious "(cached)" mark in the midst of other configure output. @@ -452,12 +648,77 @@ # by an AC_MSG_CHECKING/AC_MSG_RESULT pair. AC_DEFUN([gl_CACHE_VAL_SILENT], [ - saved_as_echo_n="$as_echo_n" - as_echo_n=':' - AC_CACHE_VAL([$1], [$2]) - as_echo_n="$saved_as_echo_n" + gl_SILENT([ + AC_CACHE_VAL([$1], [$2]) + ]) ]) -# AS_VAR_COPY was added in autoconf 2.63b -m4_define_default([AS_VAR_COPY], -[AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])]) +dnl Expands to some code for use in .c programs that, on native Windows, defines +dnl the Microsoft deprecated alias function names to the underscore-prefixed +dnl actual function names. With this macro, these function names are available +dnl without linking with '-loldnames' and without generating warnings. +dnl Usage: Use it after all system header files are included. +dnl #include <...> +dnl #include <...> +dnl ]GL_MDA_DEFINES[ +dnl ... +AC_DEFUN([GL_MDA_DEFINES],[ +AC_REQUIRE([_GL_MDA_DEFINES]) +[$gl_mda_defines] +]) +AC_DEFUN([_GL_MDA_DEFINES], +[gl_mda_defines=' +#if defined _WIN32 && !defined __CYGWIN__ +#define access _access +#define chdir _chdir +#define chmod _chmod +#define close _close +#define creat _creat +#define dup _dup +#define dup2 _dup2 +#define ecvt _ecvt +#define execl _execl +#define execle _execle +#define execlp _execlp +#define execv _execv +#define execve _execve +#define execvp _execvp +#define execvpe _execvpe +#define fcloseall _fcloseall +#define fcvt _fcvt +#define fdopen _fdopen +#define fileno _fileno +#define gcvt _gcvt +#define getcwd _getcwd +#define getpid _getpid +#define getw _getw +#define isatty _isatty +#define j0 _j0 +#define j1 _j1 +#define jn _jn +#define lfind _lfind +#define lsearch _lsearch +#define lseek _lseek +#define memccpy _memccpy +#define mkdir _mkdir +#define mktemp _mktemp +#define open _open +#define putenv _putenv +#define putw _putw +#define read _read +#define rmdir _rmdir +#define strdup _strdup +#define swab _swab +#define tempnam _tempnam +#define tzset _tzset +#define umask _umask +#define unlink _unlink +#define utime _utime +#define wcsdup _wcsdup +#define write _write +#define y0 _y0 +#define y1 _y1 +#define yn _yn +#endif +' +]) diff -Nru datamash-1.7/m4/gnulib-comp.m4 datamash-1.8/m4/gnulib-comp.m4 --- datamash-1.7/m4/gnulib-comp.m4 2020-04-23 17:13:49.000000000 +0000 +++ datamash-1.8/m4/gnulib-comp.m4 2022-05-28 01:47:06.000000000 +0000 @@ -1,5 +1,5 @@ # DO NOT EDIT! GENERATED AUTOMATICALLY! -# Copyright (C) 2002-2020 Free Software Foundation, Inc. +# Copyright (C) 2002-2021 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 @@ -46,9 +46,12 @@ # Code from module absolute-header: # Code from module alloca-opt: # Code from module announce-gen: + # Code from module arpa_inet: # Code from module assert: # Code from module assure: + # Code from module attribute: # Code from module base64: + # Code from module basename-lgpl: # Code from module bitrotate: # Code from module byteswap: # Code from module c-ctype: @@ -59,6 +62,8 @@ # Code from module calloc-posix: # Code from module ceil: # Code from module ceill: + # Code from module cloexec: + # Code from module close: # Code from module close-stream: # Code from module closeout: # Code from module configmake: @@ -75,8 +80,8 @@ # 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 dup2: # Code from module errno: # Code from module error: # Code from module exitfail: @@ -86,9 +91,14 @@ # Code from module extern-inline: # Code from module fabs: # Code from module fabsl: + # Code from module fcntl: + # Code from module fcntl-h: + # Code from module fd-hook: # Code from module fdl: # Code from module fflush: AC_REQUIRE([gl_SET_LARGEFILE_SOURCE]) + # Code from module filename: + # Code from module flexmember: # Code from module float: # Code from module floor: # Code from module floorl: @@ -108,10 +118,10 @@ # Code from module ftello: AC_REQUIRE([gl_SET_LARGEFILE_SOURCE]) # Code from module gendocs: + # Code from module getdtablesize: # 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: @@ -129,6 +139,7 @@ # Code from module iconv_open: # Code from module ignore-value: # Code from module include_next: + # Code from module inet_pton: # Code from module inline: # Code from module intprops: # Code from module inttostr: @@ -144,6 +155,7 @@ # Code from module iswblank: # Code from module iswdigit: # Code from module iswxdigit: + # Code from module langinfo: # Code from module largefile: AC_REQUIRE([AC_SYS_LARGEFILE]) # Code from module ldexp: @@ -154,6 +166,8 @@ # Code from module localcharset: # Code from module locale: # Code from module localeconv: + # Code from module localename: + # Code from module lock: # Code from module log: # Code from module logl: # Code from module lseek: @@ -166,7 +180,6 @@ # 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: @@ -179,8 +192,11 @@ # Code from module netinet_in: # Code from module nocrash: # Code from module non-recursive-gnulib-prefix-hack: + # Code from module open: # Code from module pathmax: + # Code from module pclose: # Code from module pmccabe2html: + # Code from module popen: # Code from module progname: # Code from module propername: # Code from module quotearg: @@ -192,7 +208,9 @@ # Code from module realloc-posix: # Code from module round: # Code from module roundl: + # Code from module setlocale: # Code from module setlocale-null: + # Code from module sh-quote: # Code from module signbit: # Code from module size_max: # Code from module snippet/_Noreturn: @@ -200,10 +218,12 @@ # Code from module snippet/c++defs: # Code from module snippet/unused-parameter: # Code from module snippet/warn-on-use: + # Code from module snprintf: # Code from module socklen: # Code from module sqrt: # Code from module sqrtl: # Code from module ssize_t: + # Code from module stat: # Code from module stat-time: # Code from module std-gnu11: # Code from module stdalign: @@ -218,21 +238,31 @@ # Code from module stdlib: # Code from module stdnoreturn: # Code from module stpcpy: + # Code from module strcase: + # Code from module strdup-posix: # Code from module streq: # Code from module strerror: # Code from module strerror-override: # Code from module striconv: # Code from module string: + # Code from module strings: # Code from module strndup: # Code from module strnlen: # Code from module strnlen1: # Code from module strsep: + # Code from module strtod: + # Code from module strtold: + # Code from module strtoll: # Code from module strtoull: # Code from module strtoumax: # Code from module sys_socket: # Code from module sys_stat: # Code from module sys_types: # Code from module sys_uio: + # Code from module sys_wait: + # Code from module thread-optim: + # Code from module threadlib: + gl_THREADLIB_EARLY # Code from module time: # Code from module trim: # Code from module trunc: @@ -248,16 +278,23 @@ # Code from module unlocked-io: # Code from module update-copyright: # Code from module useless-if-before-free: + # Code from module vasnprintf: # Code from module vc-list-files: # Code from module verify: # Code from module version-etc: + # Code from module waitpid: # Code from module warnings: # Code from module wchar: # Code from module wctype-h: # Code from module wcwidth: + # Code from module windows-mutex: + # Code from module windows-once: + # Code from module windows-recmutex: + # Code from module windows-rwlock: # Code from module xalloc: # Code from module xalloc-die: # Code from module xalloc-oversized: + # Code from module xsize: # Code from module xstriconv: # Code from module xstrndup: # Code from module xstrtol: @@ -282,6 +319,8 @@ gl_COMMON gl_source_base='lib' gl_FUNC_ALLOCA + gl_HEADER_ARPA_INET + AC_PROG_MKDIR_P gl_ASSERT gl_FUNC_BASE64 gl_BYTESWAP @@ -305,6 +344,12 @@ AC_LIBOBJ([ceill]) fi gl_MATH_MODULE_INDICATOR([ceill]) + gl_MODULE_INDICATOR_FOR_TESTS([cloexec]) + gl_FUNC_CLOSE + if test $REPLACE_CLOSE = 1; then + AC_LIBOBJ([close]) + fi + gl_UNISTD_MODULE_INDICATOR([close]) gl_MODULE_INDICATOR([close-stream]) gl_CONFIGMAKE_PREP gl_AF_ALG @@ -321,10 +366,14 @@ AC_REQUIRE([AC_C_RESTRICT]) gl_SHA512 gl_CTYPE_H - gl_DIRNAME gl_MODULE_INDICATOR([dirname]) - gl_DIRNAME_LGPL gl_DOUBLE_SLASH_ROOT + gl_FUNC_DUP2 + if test $REPLACE_DUP2 = 1; then + AC_LIBOBJ([dup2]) + gl_PREREQ_DUP2 + fi + gl_UNISTD_MODULE_INDICATOR([dup2]) gl_HEADER_ERRNO_H gl_ERROR if test $ac_cv_lib_error_at_line = no; then @@ -348,6 +397,12 @@ AC_LIBOBJ([fabsl]) fi gl_MATH_MODULE_INDICATOR([fabsl]) + gl_FUNC_FCNTL + if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then + AC_LIBOBJ([fcntl]) + fi + gl_FCNTL_MODULE_INDICATOR([fcntl]) + gl_FCNTL_H gl_FUNC_FFLUSH if test $REPLACE_FFLUSH = 1; then AC_LIBOBJ([fflush]) @@ -355,6 +410,7 @@ fi gl_MODULE_INDICATOR([fflush]) gl_STDIO_MODULE_INDICATOR([fflush]) + AC_C_FLEXIBLE_ARRAY_MEMBER gl_FLOAT_H if test $REPLACE_FLOAT_LDBL = 1; then AC_LIBOBJ([float]) @@ -425,6 +481,12 @@ gl_PREREQ_FTELLO fi gl_STDIO_MODULE_INDICATOR([ftello]) + gl_FUNC_GETDTABLESIZE + if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then + AC_LIBOBJ([getdtablesize]) + gl_PREREQ_GETDTABLESIZE + fi + gl_UNISTD_MODULE_INDICATOR([getdtablesize]) gl_FUNC_GETOPT_GNU dnl Because of the way gl_FUNC_GETOPT_GNU is implemented (the gl_getopt_required dnl mechanism), there is no need to do any AC_LIBOBJ or AC_SUBST here; they are @@ -439,8 +501,6 @@ AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT]) gl_UNISTD_MODULE_INDICATOR([getopt-posix]) gl_FUNC_GETPROGNAME - dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac. - AM_GNU_GETTEXT_VERSION([0.20]) AC_SUBST([LIBINTL]) AC_SUBST([LTLIBINTL]) # Autoconf 2.61a.99 and earlier don't support linking a file only @@ -456,6 +516,7 @@ AC_REQUIRE([gl_FUNC_SETLOCALE_NULL]) LIB_HARD_LOCALE="$LIB_SETLOCALE_NULL" AC_SUBST([LIB_HARD_LOCALE]) + AC_DEFUN([gl_HAVE_MODULE_HAVELIB]) AM_ICONV m4_ifdef([gl_ICONV_MODULE_INDICATOR], [gl_ICONV_MODULE_INDICATOR([iconv])]) @@ -468,6 +529,12 @@ AC_LIBOBJ([iconv]) AC_LIBOBJ([iconv_close]) fi + gl_FUNC_INET_PTON + if test $HAVE_INET_PTON = 0 || test $REPLACE_INET_PTON = 1; then + AC_LIBOBJ([inet_pton]) + gl_PREREQ_INET_PTON + fi + gl_ARPA_INET_MODULE_INDICATOR([inet_pton]) gl_INLINE gl_INTTOSTR gl_INTTYPES_H @@ -539,6 +606,7 @@ fi fi gl_WCTYPE_MODULE_INDICATOR([iswxdigit]) + gl_LANGINFO_H AC_REQUIRE([gl_LARGEFILE]) gl_FUNC_LDEXP gl_FUNC_LDEXPL @@ -559,6 +627,10 @@ gl_PREREQ_LOCALECONV fi gl_LOCALE_MODULE_INDICATOR([localeconv]) + gl_LOCALENAME + gl_LOCALE_MODULE_INDICATOR([localename]) + gl_LOCK + gl_MODULE_INDICATOR([lock]) AC_REQUIRE([gl_FUNC_LOG]) if test $REPLACE_LOG = 1; then AC_LIBOBJ([log]) @@ -606,17 +678,10 @@ gl_WCHAR_MODULE_INDICATOR([mbsinit]) gl_FUNC_MBSLEN gl_STRING_MODULE_INDICATOR([mbslen]) - gl_FUNC_MBSRTOWCS - if test $HAVE_MBSRTOWCS = 0 || test $REPLACE_MBSRTOWCS = 1; then - AC_LIBOBJ([mbsrtowcs]) - AC_LIBOBJ([mbsrtowcs-state]) - gl_PREREQ_MBSRTOWCS - fi - gl_WCHAR_MODULE_INDICATOR([mbsrtowcs]) gl_STRING_MODULE_INDICATOR([mbsstr]) gl_MBITER gl_FUNC_MEMCHR - if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then + if test $REPLACE_MEMCHR = 1; then AC_LIBOBJ([memchr]) gl_PREREQ_MEMCHR fi @@ -652,8 +717,26 @@ dnl generated in m4/non-recursive-gnulib-prefix-hack.m4 gl_NON_RECURSIVE_GNULIB_PREFIX_HACK([lib]) ]) + gl_FUNC_OPEN + if test $REPLACE_OPEN = 1; then + AC_LIBOBJ([open]) + gl_PREREQ_OPEN + fi + gl_FCNTL_MODULE_INDICATOR([open]) gl_PATHMAX + gl_FUNC_PCLOSE + if test $HAVE_PCLOSE = 0; then + AC_LIBOBJ([pclose]) + gl_PREREQ_PCLOSE + fi + gl_STDIO_MODULE_INDICATOR([pclose]) AC_PATH_PROG([PMCCABE], [pmccabe], [false]) + gl_FUNC_POPEN + if test $HAVE_POPEN = 0 || test $REPLACE_POPEN = 1; then + AC_LIBOBJ([popen]) + gl_PREREQ_POPEN + fi + gl_STDIO_MODULE_INDICATOR([popen]) AC_CHECK_DECLS([program_invocation_name], [], [], [#include ]) AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include ]) m4_ifdef([AM_XGETTEXT_OPTION], @@ -692,12 +775,19 @@ AC_LIBOBJ([roundl]) fi gl_MATH_MODULE_INDICATOR([roundl]) + gl_FUNC_SETLOCALE + if test $REPLACE_SETLOCALE = 1; then + AC_LIBOBJ([setlocale]) + gl_PREREQ_SETLOCALE + fi + gl_LOCALE_MODULE_INDICATOR([setlocale]) gl_FUNC_SETLOCALE_NULL if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then AC_LIBOBJ([setlocale-lock]) gl_PREREQ_SETLOCALE_LOCK fi gl_LOCALE_MODULE_INDICATOR([setlocale_null]) + AC_REQUIRE([AC_C_RESTRICT]) gl_SIGNBIT if test $REPLACE_SIGNBIT = 1; then AC_LIBOBJ([signbitf]) @@ -706,6 +796,9 @@ fi gl_MATH_MODULE_INDICATOR([signbit]) gl_SIZE_MAX + gl_FUNC_SNPRINTF + gl_STDIO_MODULE_INDICATOR([snprintf]) + gl_MODULE_INDICATOR([snprintf]) gl_TYPE_SOCKLEN_T gl_FUNC_SQRT gl_FUNC_SQRTL @@ -714,6 +807,17 @@ fi gl_MATH_MODULE_INDICATOR([sqrtl]) gt_TYPE_SSIZE_T + gl_FUNC_STAT + if test $REPLACE_STAT = 1; then + AC_LIBOBJ([stat]) + case "$host_os" in + mingw*) + AC_LIBOBJ([stat-w32]) + ;; + esac + gl_PREREQ_STAT + fi + gl_SYS_STAT_MODULE_INDICATOR([stat]) gl_STAT_TIME gl_STAT_BIRTHTIME gl_STDALIGN_H @@ -730,6 +834,21 @@ gl_PREREQ_STPCPY fi gl_STRING_MODULE_INDICATOR([stpcpy]) + gl_STRCASE + if test $HAVE_STRCASECMP = 0; then + AC_LIBOBJ([strcasecmp]) + gl_PREREQ_STRCASECMP + fi + if test $HAVE_STRNCASECMP = 0; then + AC_LIBOBJ([strncasecmp]) + gl_PREREQ_STRNCASECMP + fi + gl_FUNC_STRDUP_POSIX + if test $REPLACE_STRDUP = 1; then + AC_LIBOBJ([strdup]) + gl_PREREQ_STRDUP + fi + gl_STRING_MODULE_INDICATOR([strdup]) gl_FUNC_STRERROR if test $REPLACE_STRERROR = 1; then AC_LIBOBJ([strerror]) @@ -747,6 +866,7 @@ gl_libdeps="$gl_libdeps $LIBICONV" fi gl_HEADER_STRING_H + gl_HEADER_STRINGS_H gl_FUNC_STRNDUP if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then AC_LIBOBJ([strndup]) @@ -764,6 +884,24 @@ gl_PREREQ_STRSEP fi gl_STRING_MODULE_INDICATOR([strsep]) + gl_FUNC_STRTOD + if test $HAVE_STRTOD = 0 || test $REPLACE_STRTOD = 1; then + AC_LIBOBJ([strtod]) + gl_PREREQ_STRTOD + fi + gl_STDLIB_MODULE_INDICATOR([strtod]) + gl_FUNC_STRTOLD + if test $HAVE_STRTOLD = 0 || test $REPLACE_STRTOLD = 1; then + AC_LIBOBJ([strtold]) + gl_PREREQ_STRTOLD + fi + gl_STDLIB_MODULE_INDICATOR([strtold]) + gl_FUNC_STRTOLL + if test $HAVE_STRTOLL = 0; then + AC_LIBOBJ([strtoll]) + gl_PREREQ_STRTOLL + fi + gl_STDLIB_MODULE_INDICATOR([strtoll]) gl_FUNC_STRTOULL if test $HAVE_STRTOULL = 0; then AC_LIBOBJ([strtoull]) @@ -784,6 +922,10 @@ AC_PROG_MKDIR_P gl_HEADER_SYS_UIO AC_PROG_MKDIR_P + gl_SYS_WAIT_H + AC_PROG_MKDIR_P + AC_CHECK_HEADERS([sys/single_threaded.h]) + AC_REQUIRE([gl_THREADLIB]) gl_HEADER_TIME_H gl_FUNC_TRUNC if test $HAVE_DECL_TRUNC = 0 || test $REPLACE_TRUNC = 1; then @@ -805,7 +947,14 @@ gl_LIBUNISTRING_LIBHEADER([0.9.4], [uniwidth.h]) gl_LIBUNISTRING_MODULE([0.9.8], [uniwidth/width]) gl_FUNC_GLIBC_UNLOCKED_IO + AC_REQUIRE([AC_C_RESTRICT]) + gl_FUNC_VASNPRINTF gl_VERSION_ETC + gl_FUNC_WAITPID + if test $HAVE_WAITPID = 0; then + AC_LIBOBJ([waitpid]) + fi + gl_SYS_WAIT_MODULE_INDICATOR([waitpid]) gl_WCHAR_H gl_WCTYPE_H gl_FUNC_WCWIDTH @@ -814,7 +963,34 @@ gl_PREREQ_WCWIDTH fi gl_WCHAR_MODULE_INDICATOR([wcwidth]) + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + mingw*) + AC_LIBOBJ([windows-mutex]) + ;; + esac + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + mingw*) + AC_LIBOBJ([windows-once]) + ;; + esac + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + mingw*) + AC_LIBOBJ([windows-recmutex]) + ;; + esac + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + mingw*) + AC_LIBOBJ([windows-rwlock]) + ;; + esac gl_XALLOC + gl_MODULE_INDICATOR([xalloc]) + gl_MODULE_INDICATOR([xalloc-die]) + gl_XSIZE gl_XSTRNDUP gl_XSTRTOL # End of code from modules @@ -980,10 +1156,14 @@ lib/alloca.in.h lib/anytostr.c lib/arg-nonnull.h + lib/arpa_inet.in.h + lib/asnprintf.c lib/assure.h + lib/attribute.h lib/base64.c lib/base64.h lib/basename-lgpl.c + lib/basename-lgpl.h lib/basename.c lib/bitrotate.c lib/bitrotate.h @@ -999,15 +1179,18 @@ lib/cdefs.h lib/ceil.c lib/ceill.c + lib/cloexec.c + lib/cloexec.h lib/close-stream.c lib/close-stream.h + lib/close.c lib/closeout.c lib/closeout.h lib/ctype.in.h lib/dirname-lgpl.c lib/dirname.c lib/dirname.h - lib/dosname.h + lib/dup2.c lib/errno.in.h lib/error.c lib/error.h @@ -1016,7 +1199,13 @@ lib/expl-table.c lib/expl.c lib/fabsl.c + lib/fcntl.c + lib/fcntl.in.h + lib/fd-hook.c + lib/fd-hook.h lib/fflush.c + lib/filename.h + lib/flexmember.h lib/float+.h lib/float.c lib/float.in.h @@ -1035,6 +1224,7 @@ lib/fstat.c lib/ftell.c lib/ftello.c + lib/getdtablesize.c lib/getopt-cdefs.in.h lib/getopt-core.h lib/getopt-ext.h @@ -1048,6 +1238,9 @@ lib/getprogname.h lib/gettext.h lib/gl_openssl.h + lib/glthread/lock.c + lib/glthread/lock.h + lib/glthread/threadlib.c lib/hard-locale.c lib/hard-locale.h lib/hash-pjw-bare.c @@ -1068,6 +1261,7 @@ lib/iconv_open.c lib/ignore-value.h lib/imaxtostr.c + lib/inet_pton.c lib/intprops.h lib/inttostr.c lib/inttostr.h @@ -1086,6 +1280,7 @@ lib/iswdigit.c lib/iswxdigit.c lib/itold.c + lib/langinfo.in.h lib/lc-charset-dispatch.c lib/lc-charset-dispatch.h lib/ldexpl.c @@ -1097,6 +1292,10 @@ lib/localcharset.h lib/locale.in.h lib/localeconv.c + lib/localename-table.c + lib/localename-table.h + lib/localename.c + lib/localename.h lib/log.c lib/logl.c lib/lseek.c @@ -1114,9 +1313,6 @@ lib/mbrtowc.c lib/mbsinit.c lib/mbslen.c - lib/mbsrtowcs-impl.h - lib/mbsrtowcs-state.c - lib/mbsrtowcs.c lib/mbsstr.c lib/mbtowc-lock.c lib/mbtowc-lock.h @@ -1135,7 +1331,14 @@ lib/msvc-nothrow.h lib/netinet_in.in.h lib/offtostr.c + lib/open.c lib/pathmax.h + lib/pclose.c + lib/popen.c + lib/printf-args.c + lib/printf-args.h + lib/printf-parse.c + lib/printf-parse.h lib/progname.c lib/progname.h lib/propername.c @@ -1149,8 +1352,11 @@ lib/round.c lib/roundl.c lib/setlocale-lock.c + lib/setlocale.c lib/setlocale_null.c lib/setlocale_null.h + lib/sh-quote.c + lib/sh-quote.h lib/sha1.c lib/sha1.h lib/sha256.c @@ -1161,11 +1367,13 @@ lib/signbitf.c lib/signbitl.c lib/size_max.h + lib/snprintf.c lib/sqrtl.c lib/stat-time.c lib/stat-time.h lib/stat-w32.c lib/stat-w32.h + lib/stat.c lib/stdalign.in.h lib/stdarg.in.h lib/stdbool.in.h @@ -1177,6 +1385,8 @@ lib/stdnoreturn.in.h lib/stpcpy.c lib/str-kmp.h + lib/strcasecmp.c + lib/strdup.c lib/streq.h lib/strerror-override.c lib/strerror-override.h @@ -1184,14 +1394,19 @@ lib/striconv.c lib/striconv.h lib/string.in.h + lib/strings.in.h lib/stripslash.c + lib/strncasecmp.c lib/strndup.c lib/strnlen.c lib/strnlen1.c lib/strnlen1.h lib/strsep.c + lib/strtod.c lib/strtoimax.c lib/strtol.c + lib/strtold.c + lib/strtoll.c lib/strtoul.c lib/strtoull.c lib/strtoumax.c @@ -1201,6 +1416,8 @@ lib/sys_stat.in.h lib/sys_types.in.h lib/sys_uio.in.h + lib/sys_wait.in.h + lib/thread-optim.h lib/time.in.h lib/trim.c lib/trim.h @@ -1222,19 +1439,32 @@ lib/uniwidth/width.c lib/unlocked-io.h lib/unused-parameter.h + lib/vasnprintf.c + lib/vasnprintf.h lib/verify.h lib/version-etc.c lib/version-etc.h + lib/waitpid.c lib/warn-on-use.h lib/wchar.in.h lib/wctype-h.c lib/wctype.in.h lib/wcwidth.c lib/windows-initguard.h + lib/windows-mutex.c + lib/windows-mutex.h + lib/windows-once.c + lib/windows-once.h + lib/windows-recmutex.c + lib/windows-recmutex.h + lib/windows-rwlock.c + lib/windows-rwlock.h lib/xalloc-die.c lib/xalloc-oversized.h lib/xalloc.h lib/xmalloc.c + lib/xsize.c + lib/xsize.h lib/xstriconv.c lib/xstriconv.h lib/xstrndup.c @@ -1250,6 +1480,7 @@ m4/absolute-header.m4 m4/af_alg.m4 m4/alloca.m4 + m4/arpa_inet_h.m4 m4/assert.m4 m4/base64.m4 m4/byteswap.m4 @@ -1257,11 +1488,12 @@ m4/ceil.m4 m4/ceill.m4 m4/check-math-lib.m4 + m4/close.m4 m4/codeset.m4 m4/configmake.m4 m4/ctype.m4 - m4/dirname.m4 m4/double-slash-root.m4 + m4/dup2.m4 m4/eealloc.m4 m4/errno_h.m4 m4/error.m4 @@ -1274,7 +1506,11 @@ m4/extern-inline.m4 m4/fabs.m4 m4/fabsl.m4 + m4/fcntl-o.m4 + m4/fcntl.m4 + m4/fcntl_h.m4 m4/fflush.m4 + m4/flexmember.m4 m4/float_h.m4 m4/floor.m4 m4/floorl.m4 @@ -1289,9 +1525,9 @@ m4/fstat.m4 m4/ftell.m4 m4/ftello.m4 + m4/getdtablesize.m4 m4/getopt.m4 m4/getprogname.m4 - m4/gettext.m4 m4/gl-openssl.m4 m4/gnulib-common.m4 m4/host-cpu-c-abi.m4 @@ -1299,12 +1535,14 @@ m4/iconv_h.m4 m4/iconv_open.m4 m4/include_next.m4 + m4/inet_pton.m4 m4/inline.m4 m4/intl-thread-locale.m4 m4/intlmacosx.m4 + m4/intmax_t.m4 m4/inttostr.m4 - m4/inttypes-pri.m4 m4/inttypes.m4 + m4/inttypes_h.m4 m4/isblank.m4 m4/isfinite.m4 m4/isinf.m4 @@ -1314,7 +1552,9 @@ m4/iswblank.m4 m4/iswdigit.m4 m4/iswxdigit.m4 + m4/langinfo_h.m4 m4/largefile.m4 + m4/lcmessage.m4 m4/ldexp.m4 m4/ldexpl.m4 m4/lib-ld.m4 @@ -1328,6 +1568,8 @@ m4/locale-zh.m4 m4/locale_h.m4 m4/localeconv.m4 + m4/localename.m4 + m4/lock.m4 m4/log.m4 m4/logl.m4 m4/lseek.m4 @@ -1340,72 +1582,90 @@ m4/mbrtowc.m4 m4/mbsinit.m4 m4/mbslen.m4 - m4/mbsrtowcs.m4 m4/mbstate_t.m4 m4/md5.m4 m4/memchr.m4 m4/minmax.m4 m4/mmap-anon.m4 + m4/mode_t.m4 m4/modf.m4 m4/modfl.m4 m4/msvc-inval.m4 m4/msvc-nothrow.m4 m4/multiarch.m4 m4/netinet_in_h.m4 - m4/nls.m4 m4/nocrash.m4 m4/non-recursive-gnulib-prefix-hack.m4 m4/off_t.m4 + m4/open-cloexec.m4 + m4/open-slash.m4 + m4/open.m4 m4/pathmax.m4 - m4/po.m4 - m4/progtest.m4 + m4/pclose.m4 + m4/pid_t.m4 + m4/popen.m4 + m4/printf.m4 + m4/pthread_rwlock_rdlock.m4 m4/quotearg.m4 m4/random.m4 m4/random_r.m4 m4/realloc.m4 m4/round.m4 m4/roundl.m4 + m4/setlocale.m4 m4/setlocale_null.m4 m4/sha1.m4 m4/sha256.m4 m4/sha512.m4 m4/signbit.m4 m4/size_max.m4 + m4/snprintf.m4 m4/socklen.m4 m4/sockpfaf.m4 m4/sqrt.m4 m4/sqrtl.m4 m4/ssize_t.m4 m4/stat-time.m4 + m4/stat.m4 m4/std-gnu11.m4 m4/stdalign.m4 m4/stdarg.m4 m4/stdbool.m4 m4/stddef_h.m4 m4/stdint.m4 + m4/stdint_h.m4 m4/stdio_h.m4 m4/stdlib_h.m4 m4/stdnoreturn.m4 m4/stpcpy.m4 + m4/strcase.m4 + m4/strdup.m4 m4/strerror.m4 m4/string_h.m4 + m4/strings_h.m4 m4/strndup.m4 m4/strnlen.m4 m4/strsep.m4 + m4/strtod.m4 + m4/strtold.m4 + m4/strtoll.m4 m4/strtoull.m4 m4/strtoumax.m4 m4/sys_socket_h.m4 m4/sys_stat_h.m4 m4/sys_types_h.m4 m4/sys_uio_h.m4 + m4/sys_wait_h.m4 m4/threadlib.m4 m4/time_h.m4 m4/trunc.m4 m4/truncl.m4 m4/unistd_h.m4 m4/unlocked-io.m4 + m4/vasnprintf.m4 m4/version-etc.m4 m4/visibility.m4 + m4/waitpid.m4 m4/warn-on-use.m4 m4/warnings.m4 m4/wchar_h.m4 @@ -1414,6 +1674,7 @@ m4/wcwidth.m4 m4/wint_t.m4 m4/xalloc.m4 + m4/xsize.m4 m4/xstrndup.m4 m4/xstrtol.m4 m4/zzgnulib.m4 diff -Nru datamash-1.7/m4/host-cpu-c-abi.m4 datamash-1.8/m4/host-cpu-c-abi.m4 --- datamash-1.7/m4/host-cpu-c-abi.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/host-cpu-c-abi.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # host-cpu-c-abi.m4 serial 13 -dnl Copyright (C) 2002-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2021 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.7/m4/iconv_h.m4 datamash-1.8/m4/iconv_h.m4 --- datamash-1.7/m4/iconv_h.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/iconv_h.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # iconv_h.m4 serial 12 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2021 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.7/m4/iconv.m4 datamash-1.8/m4/iconv.m4 --- datamash-1.7/m4/iconv.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/iconv.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# iconv.m4 serial 21 -dnl Copyright (C) 2000-2002, 2007-2014, 2016-2020 Free Software Foundation, +# iconv.m4 serial 24 +dnl Copyright (C) 2000-2002, 2007-2014, 2016-2021 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, @@ -7,6 +7,12 @@ dnl From Bruno Haible. +AC_PREREQ([2.64]) + +dnl Note: AM_ICONV is documented in the GNU gettext manual +dnl . +dnl Don't make changes that are incompatible with that documentation! + AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. @@ -86,8 +92,9 @@ #endif ]], [[int result = 0; - /* Test against AIX 5.1 bug: Failures are not distinguishable from successful - returns. */ + /* Test against AIX 5.1...7.2 bug: Failures are not distinguishable from + successful returns. This is even documented in + */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) @@ -225,8 +232,7 @@ AC_SUBST([LTLIBICONV]) ]) -dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to -dnl avoid warnings like +dnl Define AM_ICONV using AC_DEFUN_ONCE, in order to avoid warnings like dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required". dnl This is tricky because of the way 'aclocal' is implemented: dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN. @@ -234,54 +240,43 @@ dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions. dnl Otherwise aclocal would emit many "Use of uninitialized value $1" dnl warnings. -m4_define([gl_iconv_AC_DEFUN], - m4_version_prereq([2.64], - [[AC_DEFUN_ONCE( - [$1], [$2])]], - [m4_ifdef([gl_00GNULIB], - [[AC_DEFUN_ONCE( - [$1], [$2])]], - [[AC_DEFUN( - [$1], [$2])]])])) -gl_iconv_AC_DEFUN([AM_ICONV], +AC_DEFUN_ONCE([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then - AC_MSG_CHECKING([for iconv declaration]) - AC_CACHE_VAL([am_cv_proto_iconv], [ - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[ + AC_CACHE_CHECK([whether iconv is compatible with its POSIX signature], + [gl_cv_iconv_nonconst], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ #include #include extern #ifdef __cplusplus "C" #endif -#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); -#else -size_t iconv(); -#endif - ]], - [[]])], - [am_cv_proto_iconv_arg1=""], - [am_cv_proto_iconv_arg1="const"]) - am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) - am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` - AC_MSG_RESULT([ - $am_cv_proto_iconv]) + ]], + [[]])], + [gl_cv_iconv_nonconst=yes], + [gl_cv_iconv_nonconst=no]) + ]) 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="" + gl_cv_iconv_nonconst=yes + fi + if test $gl_cv_iconv_nonconst = yes; then + iconv_arg1="" + else + iconv_arg1="const" fi - AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1], + AC_DEFINE_UNQUOTED([ICONV_CONST], [$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 + if test $gl_cv_iconv_nonconst != yes; then ICONV_CONST="const" fi ]) diff -Nru datamash-1.7/m4/iconv_open.m4 datamash-1.8/m4/iconv_open.m4 --- datamash-1.7/m4/iconv_open.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/iconv_open.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # iconv_open.m4 serial 16 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2021 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.7/m4/include_next.m4 datamash-1.8/m4/include_next.m4 --- datamash-1.7/m4/include_next.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/include_next.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# include_next.m4 serial 24 -dnl Copyright (C) 2006-2020 Free Software Foundation, Inc. +# include_next.m4 serial 26 +dnl Copyright (C) 2006-2021 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. @@ -106,19 +106,21 @@ AC_SUBST([INCLUDE_NEXT]) AC_SUBST([INCLUDE_NEXT_AS_FIRST_DIRECTIVE]) AC_SUBST([PRAGMA_SYSTEM_HEADER]) - AC_CACHE_CHECK([whether system header files limit the line length], - [gl_cv_pragma_columns], - [dnl HP NonStop systems, which define __TANDEM, have this misfeature. - AC_EGREP_CPP([choke me], + + dnl HP NonStop systems, which define __TANDEM, limit the line length + dnl after including some system header files. + AC_CACHE_CHECK([whether source code line length is unlimited], + [gl_cv_source_line_length_unlimited], + [AC_EGREP_CPP([choke me], [ #ifdef __TANDEM choke me #endif ], - [gl_cv_pragma_columns=yes], - [gl_cv_pragma_columns=no]) + [gl_cv_source_line_length_unlimited=no], + [gl_cv_source_line_length_unlimited=yes]) ]) - if test $gl_cv_pragma_columns = yes; then + if test $gl_cv_source_line_length_unlimited = no; then PRAGMA_COLUMNS="#pragma COLUMNS 10000" else PRAGMA_COLUMNS= @@ -176,42 +178,40 @@ [AC_CHECK_HEADERS_ONCE([$1]) ]) -dnl FIXME: gl_next_header and gl_header_exists must be used unquoted -dnl until we can assume autoconf 2.64 or newer. m4_foreach_w([gl_HEADER_NAME], [$1], [AS_VAR_PUSHDEF([gl_next_header], [gl_cv_next_]m4_defn([gl_HEADER_NAME])) if test $gl_cv_have_include_next = yes; then - AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>']) + AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>']) else AC_CACHE_CHECK( [absolute name of <]m4_defn([gl_HEADER_NAME])[>], - m4_defn([gl_next_header]), + [gl_next_header], [m4_if([$2], [check], [AS_VAR_PUSHDEF([gl_header_exists], [ac_cv_header_]m4_defn([gl_HEADER_NAME])) - if test AS_VAR_GET(gl_header_exists) = yes; then + if test AS_VAR_GET([gl_header_exists]) = yes; then AS_VAR_POPDEF([gl_header_exists]) ]) gl_ABSOLUTE_HEADER_ONE(gl_HEADER_NAME) AS_VAR_COPY([gl_header], [gl_cv_absolute_]AS_TR_SH(gl_HEADER_NAME)) - AS_VAR_SET(gl_next_header, ['"'$gl_header'"']) + AS_VAR_SET([gl_next_header], ['"'$gl_header'"']) m4_if([$2], [check], [else - AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>']) + AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>']) fi ]) ]) fi AC_SUBST( AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])), - [AS_VAR_GET(gl_next_header)]) + [AS_VAR_GET([gl_next_header])]) 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='<'gl_HEADER_NAME'>' else # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' - gl_next_as_first_directive=AS_VAR_GET(gl_next_header) + gl_next_as_first_directive=AS_VAR_GET([gl_next_header]) fi AC_SUBST( AS_TR_CPP([NEXT_AS_FIRST_DIRECTIVE_]m4_defn([gl_HEADER_NAME])), diff -Nru datamash-1.7/m4/inet_pton.m4 datamash-1.8/m4/inet_pton.m4 --- datamash-1.7/m4/inet_pton.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/inet_pton.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,70 @@ +# inet_pton.m4 serial 19 +dnl Copyright (C) 2006, 2008-2021 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_INET_PTON], +[ + AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS]) + + dnl Persuade Solaris to declare inet_pton. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + + AC_REQUIRE([AC_C_RESTRICT]) + + dnl Most platforms that provide inet_pton define it in libc. + dnl Solaris 8..10 provide inet_pton in libnsl instead. + dnl Solaris 2.6..7 provide inet_pton in libresolv instead. + dnl Haiku provides it in -lnetwork. + dnl Native Windows provides it in -lws2_32 instead, with a declaration in + dnl , and it uses stdcall calling convention, not cdecl + dnl (hence we cannot use AC_CHECK_FUNCS, AC_SEARCH_LIBS to find it). + HAVE_INET_PTON=1 + INET_PTON_LIB= + gl_PREREQ_SYS_H_WINSOCK2 + if test $HAVE_WINSOCK2_H = 1; then + dnl It needs to be overridden, because the stdcall calling convention + dnl is not compliant with POSIX. Set REPLACE_INET_PTON in order to avoid + dnl a name conflict at the linker level, even though the header file + dnl declares inet_pton only if _WIN32_WINNT >= 0x0600. + REPLACE_INET_PTON=1 + AC_CHECK_DECLS([inet_pton],,, [[#include ]]) + if test $ac_cv_have_decl_inet_pton = yes; then + INET_PTON_LIB="-lws2_32" + else + HAVE_DECL_INET_PTON=0 + fi + else + gl_save_LIBS=$LIBS + AC_SEARCH_LIBS([inet_pton], [nsl resolv network], [], + [AC_CHECK_FUNCS([inet_pton]) + if test $ac_cv_func_inet_pton = no; then + HAVE_INET_PTON=0 + fi + ]) + LIBS=$gl_save_LIBS + + if test "$ac_cv_search_inet_pton" != "no" \ + && test "$ac_cv_search_inet_pton" != "none required"; then + INET_PTON_LIB="$ac_cv_search_inet_pton" + fi + + AC_CHECK_HEADERS_ONCE([netdb.h]) + AC_CHECK_DECLS([inet_pton],,, + [[#include + #if HAVE_NETDB_H + # include + #endif + ]]) + if test $ac_cv_have_decl_inet_pton = no; then + HAVE_DECL_INET_PTON=0 + fi + fi + AC_SUBST([INET_PTON_LIB]) +]) + +# Prerequisites of lib/inet_pton.c. +AC_DEFUN([gl_PREREQ_INET_PTON], [ + AC_REQUIRE([gl_SOCKET_FAMILIES]) +]) diff -Nru datamash-1.7/m4/__inline.m4 datamash-1.8/m4/__inline.m4 --- datamash-1.7/m4/__inline.m4 2020-04-23 04:03:36.000000000 +0000 +++ datamash-1.8/m4/__inline.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # Test for __inline keyword -dnl Copyright 2017-2020 Free Software Foundation, Inc. +dnl Copyright 2017-2021 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.7/m4/inline.m4 datamash-1.8/m4/inline.m4 --- datamash-1.7/m4/inline.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/inline.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # inline.m4 serial 4 -dnl Copyright (C) 2006, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2009-2021 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.7/m4/intlmacosx.m4 datamash-1.8/m4/intlmacosx.m4 --- datamash-1.7/m4/intlmacosx.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/intlmacosx.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,15 +1,15 @@ -# intlmacosx.m4 serial 7 (gettext-0.20.2) -dnl Copyright (C) 2004-2014, 2016, 2019-2020 Free Software Foundation, Inc. +# intlmacosx.m4 serial 8 (gettext-0.20.2) +dnl Copyright (C) 2004-2014, 2016, 2019-2021 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 be used in projects which are not available under -dnl the GNU General Public License or the GNU Library General Public +dnl the GNU General Public License or the GNU Lesser 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 by the GNU Lesser General Public License, and the rest of the GNU dnl gettext package is covered by the GNU General Public License. dnl They are *not* in the public domain. diff -Nru datamash-1.7/m4/intl-thread-locale.m4 datamash-1.8/m4/intl-thread-locale.m4 --- datamash-1.7/m4/intl-thread-locale.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/intl-thread-locale.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,188 @@ +# intl-thread-locale.m4 serial 8 +dnl Copyright (C) 2015-2021 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 be used in projects which are not available under +dnl the GNU General Public License or the GNU Lesser 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 Lesser General Public License, and the rest of the GNU +dnl gettext package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Check how to retrieve the name of a per-thread locale (POSIX locale_t). +dnl Sets gt_nameless_locales. +AC_DEFUN([gt_INTL_THREAD_LOCALE_NAME], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + + dnl Persuade Solaris to define 'locale_t'. + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + dnl Test whether uselocale() exists and works at all. + gt_FUNC_USELOCALE + + dnl On OpenBSD >= 6.2, the locale_t type and the uselocale(), newlocale(), + dnl duplocale(), freelocale() functions exist but are effectively useless, + dnl because the locale_t value depends only on the LC_CTYPE category of the + dnl locale and furthermore contains only one bit of information (it + dnl distinguishes the "C" locale from the *.UTF-8 locales). See + dnl . + dnl In the setlocale() implementation they have thought about the programs + dnl that use the API ("Even though only LC_CTYPE has any effect in the + dnl OpenBSD base system, store complete information about the global locale, + dnl such that third-party software can access it"), but for uselocale() + dnl they did not think about the programs. + dnl In this situation, even the HAVE_NAMELESS_LOCALES support does not work. + dnl So, define HAVE_FAKE_LOCALES and disable all locale_t support. + case "$gt_cv_func_uselocale_works" in + *yes) + AC_CHECK_HEADERS_ONCE([xlocale.h]) + AC_CACHE_CHECK([for fake locale system (OpenBSD)], + [gt_cv_locale_fake], + [AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#if HAVE_XLOCALE_H +# include +#endif +int main () +{ + locale_t loc1, loc2; + if (setlocale (LC_ALL, "de_DE.UTF-8") == NULL) return 1; + if (setlocale (LC_ALL, "fr_FR.UTF-8") == NULL) return 1; + loc1 = newlocale (LC_ALL_MASK, "de_DE.UTF-8", (locale_t)0); + loc2 = newlocale (LC_ALL_MASK, "fr_FR.UTF-8", (locale_t)0); + return !(loc1 == loc2); +}]])], + [gt_cv_locale_fake=yes], + [gt_cv_locale_fake=no], + [dnl Guess the locale system is fake only on OpenBSD. + case "$host_os" in + openbsd*) gt_cv_locale_fake="guessing yes" ;; + *) gt_cv_locale_fake="guessing no" ;; + esac + ]) + ]) + ;; + *) gt_cv_locale_fake=no ;; + esac + case "$gt_cv_locale_fake" in + *yes) + AC_DEFINE([HAVE_FAKE_LOCALES], [1], + [Define if the locale_t type contains insufficient information, as on OpenBSD.]) + ;; + esac + + case "$gt_cv_func_uselocale_works" in + *yes) + AC_CACHE_CHECK([for Solaris 11.4 locale system], + [gt_cv_locale_solaris114], + [case "$host_os" in + solaris*) + dnl Test whether defines locale_t as a typedef of + dnl 'struct _LC_locale_t **' (whereas Illumos defines it as a + dnl typedef of 'struct _locale *'). + dnl Another possible test would be to include + dnl and test whether it defines the _LC_core_data_locale_t type. + dnl This type was added in Solaris 11.4. + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + #include + struct _LC_locale_t *x; + locale_t y; + ]], + [[*y = x;]])], + [gt_cv_locale_solaris114=yes], + [gt_cv_locale_solaris114=no]) + ;; + *) gt_cv_locale_solaris114=no ;; + esac + ]) + ;; + *) gt_cv_locale_solaris114=no ;; + esac + if test $gt_cv_locale_solaris114 = yes; then + AC_DEFINE([HAVE_SOLARIS114_LOCALES], [1], + [Define if the locale_t type is as on Solaris 11.4.]) + fi + + dnl Solaris 12 will maybe provide getlocalename_l. If it does, it will + dnl improve the implementation of gl_locale_name_thread(), by removing + dnl the use of undocumented structures. + case "$gt_cv_func_uselocale_works" in + *yes) + AC_CHECK_FUNCS([getlocalename_l]) + ;; + esac + + dnl This code is for platforms where the locale_t type does not provide access + dnl to the name of each locale category. This code has the drawback that it + dnl requires the gnulib overrides of 'newlocale', 'duplocale', 'freelocale', + dnl which is a problem for GNU libunistring. Therefore try hard to avoid + dnl enabling this code! + gt_nameless_locales=no + case "$host_os" in + dnl It's needed on AIX 7.2. + aix*) + gt_nameless_locales=yes + AC_DEFINE([HAVE_NAMELESS_LOCALES], [1], + [Define if the locale_t type does not contain the name of each locale category.]) + ;; + esac +]) + +dnl Tests whether uselocale() exists and is usable. +dnl Sets gt_cv_func_uselocale_works. Defines HAVE_WORKING_USELOCALE. +AC_DEFUN([gt_FUNC_USELOCALE], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + + dnl Persuade glibc and Solaris to define 'locale_t'. + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + AC_CHECK_FUNCS_ONCE([uselocale]) + + dnl On AIX 7.2, the uselocale() function is not documented and leads to + dnl crashes in subsequent setlocale() invocations. + dnl In 2019, some versions of z/OS lack the locale_t type and have a broken + dnl uselocale function. + if test $ac_cv_func_uselocale = yes; then + AC_CHECK_HEADERS_ONCE([xlocale.h]) + AC_CACHE_CHECK([whether uselocale works], + [gt_cv_func_uselocale_works], + [AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#if HAVE_XLOCALE_H +# include +#endif +locale_t loc1; +int main () +{ + uselocale (NULL); + setlocale (LC_ALL, "en_US.UTF-8"); + return 0; +}]])], + [gt_cv_func_uselocale_works=yes], + [gt_cv_func_uselocale_works=no], + [# Guess no on AIX and z/OS, yes otherwise. + case "$host_os" in + aix* | openedition*) gt_cv_func_uselocale_works="guessing no" ;; + *) gt_cv_func_uselocale_works="guessing yes" ;; + esac + ]) + ]) + else + gt_cv_func_uselocale_works=no + fi + case "$gt_cv_func_uselocale_works" in + *yes) + AC_DEFINE([HAVE_WORKING_USELOCALE], [1], + [Define if the uselocale function exists any may safely be called.]) + ;; + esac +]) diff -Nru datamash-1.7/m4/intmax_t.m4 datamash-1.8/m4/intmax_t.m4 --- datamash-1.7/m4/intmax_t.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/intmax_t.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,59 @@ +# intmax_t.m4 serial 9 +dnl Copyright (C) 1997-2004, 2006-2007, 2009-2021 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. + +dnl From Paul Eggert. + +AC_PREREQ([2.53]) + +# Define intmax_t to 'long' or 'long long' +# if it is not already defined in or . + +AC_DEFUN([gl_AC_TYPE_INTMAX_T], +[ + dnl For simplicity, we assume that a header file defines 'intmax_t' if and + dnl only if it defines 'uintmax_t'. + AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) + AC_REQUIRE([gl_AC_HEADER_STDINT_H]) + if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then + AC_DEFINE_UNQUOTED([intmax_t], [long long], + [Define to long or long long if and don't define.]) + else + AC_DEFINE([HAVE_INTMAX_T], [1], + [Define if you have the 'intmax_t' type in or .]) + fi +]) + +dnl An alternative would be to explicitly test for 'intmax_t'. + +AC_DEFUN([gt_AC_TYPE_INTMAX_T], +[ + AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) + AC_REQUIRE([gl_AC_HEADER_STDINT_H]) + AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#include +#if HAVE_STDINT_H_WITH_UINTMAX +#include +#endif +#if HAVE_INTTYPES_H_WITH_UINTMAX +#include +#endif + ]], + [[intmax_t x = -1; return !x;]])], + [gt_cv_c_intmax_t=yes], + [gt_cv_c_intmax_t=no])]) + if test $gt_cv_c_intmax_t = yes; then + AC_DEFINE([HAVE_INTMAX_T], [1], + [Define if you have the 'intmax_t' type in or .]) + else + AC_DEFINE_UNQUOTED([intmax_t], [long long], + [Define to long or long long if and don't define.]) + fi +]) diff -Nru datamash-1.7/m4/inttostr.m4 datamash-1.8/m4/inttostr.m4 --- datamash-1.7/m4/inttostr.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/inttostr.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ #serial 8 -dnl Copyright (C) 2004-2006, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2004-2006, 2009-2021 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.7/m4/inttypes_h.m4 datamash-1.8/m4/inttypes_h.m4 --- datamash-1.7/m4/inttypes_h.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/inttypes_h.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,29 @@ +# inttypes_h.m4 serial 10 +dnl Copyright (C) 1997-2004, 2006, 2008-2021 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. + +# Define HAVE_INTTYPES_H_WITH_UINTMAX if exists, +# doesn't clash with , and declares uintmax_t. + +AC_DEFUN([gl_AC_HEADER_INTTYPES_H], +[ + AC_CACHE_CHECK([for inttypes.h], [gl_cv_header_inttypes_h], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#include + ]], + [[uintmax_t i = (uintmax_t) -1; return !i;]])], + [gl_cv_header_inttypes_h=yes], + [gl_cv_header_inttypes_h=no])]) + if test $gl_cv_header_inttypes_h = yes; then + AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1], + [Define if exists, doesn't clash with , + and declares uintmax_t. ]) + fi +]) diff -Nru datamash-1.7/m4/inttypes.m4 datamash-1.8/m4/inttypes.m4 --- datamash-1.7/m4/inttypes.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/inttypes.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# inttypes.m4 serial 29 -dnl Copyright (C) 2006-2020 Free Software Foundation, Inc. +# inttypes.m4 serial 32 +dnl Copyright (C) 2006-2021 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. @@ -35,12 +35,19 @@ # Ensure that the PRI* and SCN* macros are defined appropriately. AC_DEFUN([gl_INTTYPES_PRI_SCN], [ - AC_REQUIRE([gt_INTTYPES_PRI]) - PRIPTR_PREFIX= if test -n "$STDINT_H"; then - dnl Using the gnulib . It always defines intptr_t to 'long'. - PRIPTR_PREFIX='"l"' + dnl Using the gnulib . It defines intptr_t to 'long' or + dnl 'long long', depending on _WIN64. + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + #ifdef _WIN64 + LLP64 + #endif + ]]) + ], + [PRIPTR_PREFIX='"l"'], + [PRIPTR_PREFIX='"ll"']) else dnl Using the system's . for glpfx in '' l ll I64; do @@ -152,7 +159,6 @@ REPLACE_STRTOUMAX=0; AC_SUBST([REPLACE_STRTOUMAX]) INT32_MAX_LT_INTMAX_MAX=1; AC_SUBST([INT32_MAX_LT_INTMAX_MAX]) INT64_MAX_EQ_LONG_MAX='defined _LP64'; AC_SUBST([INT64_MAX_EQ_LONG_MAX]) - PRI_MACROS_BROKEN=0; AC_SUBST([PRI_MACROS_BROKEN]) PRIPTR_PREFIX=__PRIPTR_PREFIX; AC_SUBST([PRIPTR_PREFIX]) UINT32_MAX_LT_UINTMAX_MAX=1; AC_SUBST([UINT32_MAX_LT_UINTMAX_MAX]) UINT64_MAX_EQ_ULONG_MAX='defined _LP64'; AC_SUBST([UINT64_MAX_EQ_ULONG_MAX]) diff -Nru datamash-1.7/m4/inttypes-pri.m4 datamash-1.8/m4/inttypes-pri.m4 --- datamash-1.7/m4/inttypes-pri.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/inttypes-pri.m4 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -# inttypes-pri.m4 serial 7 (gettext-0.18.2) -dnl Copyright (C) 1997-2002, 2006, 2008-2020 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. - -AC_PREREQ([2.53]) - -# Define PRI_MACROS_BROKEN if exists and defines the PRI* -# macros to non-string values. This is the case on AIX 4.3.3. - -AC_DEFUN([gt_INTTYPES_PRI], -[ - AC_CHECK_HEADERS([inttypes.h]) - if test $ac_cv_header_inttypes_h = yes; then - AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken], - [gt_cv_inttypes_pri_broken], - [ - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM( - [[ -#include -#ifdef PRId32 -char *p = PRId32; -#endif - ]], - [[]])], - [gt_cv_inttypes_pri_broken=no], - [gt_cv_inttypes_pri_broken=yes]) - ]) - fi - if test "$gt_cv_inttypes_pri_broken" = yes; then - AC_DEFINE_UNQUOTED([PRI_MACROS_BROKEN], [1], - [Define if exists and defines unusable PRI* macros.]) - PRI_MACROS_BROKEN=1 - else - PRI_MACROS_BROKEN=0 - fi - AC_SUBST([PRI_MACROS_BROKEN]) -]) diff -Nru datamash-1.7/m4/isblank.m4 datamash-1.8/m4/isblank.m4 --- datamash-1.7/m4/isblank.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/isblank.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # isblank.m4 serial 3 -dnl Copyright (C) 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2009-2021 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.7/m4/isfinite.m4 datamash-1.8/m4/isfinite.m4 --- datamash-1.7/m4/isfinite.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/isfinite.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # isfinite.m4 serial 17 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2021 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.7/m4/isinf.m4 datamash-1.8/m4/isinf.m4 --- datamash-1.7/m4/isinf.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/isinf.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # isinf.m4 serial 13 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2021 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.7/m4/isnand.m4 datamash-1.8/m4/isnand.m4 --- datamash-1.7/m4/isnand.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/isnand.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# isnand.m4 serial 11 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +# isnand.m4 serial 12 +dnl Copyright (C) 2007-2021 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. @@ -58,7 +58,7 @@ AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include - #if __GNUC__ >= 4 + #if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnand # define isnand(x) __builtin_isnan ((double)(x)) #elif defined isnan @@ -81,7 +81,7 @@ AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include - #if __GNUC__ >= 4 + #if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnand # define isnand(x) __builtin_isnan ((double)(x)) #else diff -Nru datamash-1.7/m4/isnanf.m4 datamash-1.8/m4/isnanf.m4 --- datamash-1.7/m4/isnanf.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/isnanf.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# isnanf.m4 serial 15 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +# isnanf.m4 serial 18 +dnl Copyright (C) 2007-2021 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. @@ -74,9 +74,9 @@ AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include - #if __GNUC__ >= 4 + #if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnanf - # define isnanf(x) __builtin_isnanf ((float)(x)) + # define isnanf(x) __builtin_isnan ((float)(x)) #elif defined isnan # undef isnanf # define isnanf(x) isnan ((float)(x)) @@ -99,9 +99,9 @@ AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include - #if __GNUC__ >= 4 + #if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnanf - # define isnanf(x) __builtin_isnanf ((float)(x)) + # define isnanf(x) __builtin_isnan ((float)(x)) #elif defined isnan # undef isnanf # define isnanf(x) isnan ((float)(x)) @@ -127,9 +127,9 @@ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include -#if __GNUC__ >= 4 +#if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnanf -# define isnanf(x) __builtin_isnanf ((float)(x)) +# define isnanf(x) __builtin_isnan ((float)(x)) #elif defined isnan # undef isnanf # define isnanf(x) isnan ((float)(x)) @@ -169,7 +169,7 @@ m.value = NaN (); /* Set the bits below the exponent to 01111...111. */ m.word[0] &= -1U << FLT_EXPBIT0_BIT; - m.word[0] |= 1U << (FLT_EXPBIT0_BIT - 1) - 1; + m.word[0] |= (1U << (FLT_EXPBIT0_BIT - 1)) - 1; if (!isnanf (m.value)) result |= 4; } diff -Nru datamash-1.7/m4/isnanl.m4 datamash-1.8/m4/isnanl.m4 --- datamash-1.7/m4/isnanl.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/isnanl.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# isnanl.m4 serial 20 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +# isnanl.m4 serial 22 +dnl Copyright (C) 2007-2021 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. @@ -68,9 +68,9 @@ AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include - #if __GNUC__ >= 4 + #if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnanl - # define isnanl(x) __builtin_isnanl ((long double)(x)) + # define isnanl(x) __builtin_isnan ((long double)(x)) #elif defined isnan # undef isnanl # define isnanl(x) isnan ((long double)(x)) @@ -93,9 +93,9 @@ AC_LINK_IFELSE( [AC_LANG_PROGRAM( [[#include - #if __GNUC__ >= 4 + #if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnanl - # define isnanl(x) __builtin_isnanl ((long double)(x)) + # define isnanl(x) __builtin_isnan ((long double)(x)) #elif defined isnan # undef isnanl # define isnanl(x) isnan ((long double)(x)) @@ -123,9 +123,9 @@ #include #include #include -#if __GNUC__ >= 4 +#if (__GNUC__ >= 4) || (__clang_major__ >= 4) # undef isnanl -# define isnanl(x) __builtin_isnanl ((long double)(x)) +# define isnanl(x) __builtin_isnan ((long double)(x)) #elif defined isnan # undef isnanl # define isnanl(x) isnan ((long double)(x)) diff -Nru datamash-1.7/m4/iswblank.m4 datamash-1.8/m4/iswblank.m4 --- datamash-1.7/m4/iswblank.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/iswblank.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# iswblank.m4 serial 4 -dnl Copyright (C) 2011-2020 Free Software Foundation, Inc. +# iswblank.m4 serial 5 +dnl Copyright (C) 2011-2021 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. @@ -12,16 +12,9 @@ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_CHECK_FUNCS_ONCE([iswblank]) AC_CHECK_DECLS([iswblank], , , [[ -/* 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 -]]) + #include + #include + ]]) if test $ac_cv_func_iswblank = no; then HAVE_ISWBLANK=0 if test $ac_cv_have_decl_iswblank = yes; then diff -Nru datamash-1.7/m4/iswdigit.m4 datamash-1.8/m4/iswdigit.m4 --- datamash-1.7/m4/iswdigit.m4 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/m4/iswdigit.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# iswdigit.m4 serial 1 -dnl Copyright (C) 2020 Free Software Foundation, Inc. +# iswdigit.m4 serial 2 +dnl Copyright (C) 2020-2021 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. @@ -37,13 +37,6 @@ #include #include #include -/* 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 diff -Nru datamash-1.7/m4/iswxdigit.m4 datamash-1.8/m4/iswxdigit.m4 --- datamash-1.7/m4/iswxdigit.m4 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/m4/iswxdigit.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# iswxdigit.m4 serial 1 -dnl Copyright (C) 2020 Free Software Foundation, Inc. +# iswxdigit.m4 serial 2 +dnl Copyright (C) 2020-2021 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. @@ -36,13 +36,6 @@ #include #include #include -/* 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 diff -Nru datamash-1.7/m4/langinfo_h.m4 datamash-1.8/m4/langinfo_h.m4 --- datamash-1.7/m4/langinfo_h.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/langinfo_h.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,122 @@ +# langinfo_h.m4 serial 9 +dnl Copyright (C) 2009-2021 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_LANGINFO_H], +[ + AC_REQUIRE([gl_LANGINFO_H_DEFAULTS]) + + dnl Persuade glibc-2.0.6 to define CODESET. + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + + dnl is always overridden, because of GNULIB_POSIXCHECK. + gl_CHECK_NEXT_HEADERS([langinfo.h]) + + dnl Determine whether exists. It is missing on mingw and BeOS. + HAVE_LANGINFO_CODESET=0 + HAVE_LANGINFO_T_FMT_AMPM=0 + HAVE_LANGINFO_ALTMON=0 + HAVE_LANGINFO_ERA=0 + HAVE_LANGINFO_YESEXPR=0 + AC_CHECK_HEADERS_ONCE([langinfo.h]) + if test $ac_cv_header_langinfo_h = yes; then + HAVE_LANGINFO_H=1 + dnl Determine what defines. + dnl CODESET is missing on OpenBSD 3.8. + dnl ERA etc. are missing on OpenBSD 6.7. + dnl T_FMT_AMPM and YESEXPR, NOEXPR are missing on IRIX 5.3. + dnl ALTMON_* are missing on glibc 2.26 and many other systems. + AC_CACHE_CHECK([whether langinfo.h defines CODESET], + [gl_cv_header_langinfo_codeset], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include +int a = CODESET; +]])], + [gl_cv_header_langinfo_codeset=yes], + [gl_cv_header_langinfo_codeset=no]) + ]) + if test $gl_cv_header_langinfo_codeset = yes; then + HAVE_LANGINFO_CODESET=1 + fi + AC_CACHE_CHECK([whether langinfo.h defines T_FMT_AMPM], + [gl_cv_header_langinfo_t_fmt_ampm], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include +int a = T_FMT_AMPM; +]])], + [gl_cv_header_langinfo_t_fmt_ampm=yes], + [gl_cv_header_langinfo_t_fmt_ampm=no]) + ]) + if test $gl_cv_header_langinfo_t_fmt_ampm = yes; then + HAVE_LANGINFO_T_FMT_AMPM=1 + fi + AC_CACHE_CHECK([whether langinfo.h defines ALTMON_1], + [gl_cv_header_langinfo_altmon], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include +int a = ALTMON_1; +]])], + [gl_cv_header_langinfo_altmon=yes], + [gl_cv_header_langinfo_altmon=no]) + ]) + if test $gl_cv_header_langinfo_altmon = yes; then + HAVE_LANGINFO_ALTMON=1 + fi + AC_CACHE_CHECK([whether langinfo.h defines ERA], + [gl_cv_header_langinfo_era], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include +int a = ERA; +]])], + [gl_cv_header_langinfo_era=yes], + [gl_cv_header_langinfo_era=no]) + ]) + if test $gl_cv_header_langinfo_era = yes; then + HAVE_LANGINFO_ERA=1 + fi + AC_CACHE_CHECK([whether langinfo.h defines YESEXPR], + [gl_cv_header_langinfo_yesexpr], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include +int a = YESEXPR; +]])], + [gl_cv_header_langinfo_yesexpr=yes], + [gl_cv_header_langinfo_yesexpr=no]) + ]) + if test $gl_cv_header_langinfo_yesexpr = yes; then + HAVE_LANGINFO_YESEXPR=1 + fi + else + HAVE_LANGINFO_H=0 + fi + AC_SUBST([HAVE_LANGINFO_H]) + AC_SUBST([HAVE_LANGINFO_CODESET]) + AC_SUBST([HAVE_LANGINFO_T_FMT_AMPM]) + AC_SUBST([HAVE_LANGINFO_ALTMON]) + AC_SUBST([HAVE_LANGINFO_ERA]) + AC_SUBST([HAVE_LANGINFO_YESEXPR]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[#include + ]], [nl_langinfo]) +]) + +AC_DEFUN([gl_LANGINFO_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_LANGINFO_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +AC_DEFUN([gl_LANGINFO_H_DEFAULTS], +[ + GNULIB_NL_LANGINFO=0; AC_SUBST([GNULIB_NL_LANGINFO]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_NL_LANGINFO=1; AC_SUBST([HAVE_NL_LANGINFO]) + REPLACE_NL_LANGINFO=0; AC_SUBST([REPLACE_NL_LANGINFO]) +]) diff -Nru datamash-1.7/m4/largefile.m4 datamash-1.8/m4/largefile.m4 --- datamash-1.7/m4/largefile.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/largefile.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,7 +1,7 @@ # Enable large files on systems where this is not the default. # Enable support for files on Linux file systems with 64-bit inode numbers. -# Copyright 1992-1996, 1998-2020 Free Software Foundation, Inc. +# Copyright 1992-1996, 1998-2021 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,17 +25,17 @@ # The following implementation works around a problem in autoconf <= 2.69; # AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5, # or configures them incorrectly in some cases. -m4_version_prereq([2.70], [] ,[ +m4_version_prereq([2.70], [], [ # _AC_SYS_LARGEFILE_TEST_INCLUDES # ------------------------------- m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES], -[@%:@include +[#include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -@%:@define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]];[]dnl @@ -54,7 +54,7 @@ [AC_LANG_PROGRAM([$5], [$6])], [$3=no; break]) m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])( - [AC_LANG_PROGRAM([@%:@define $1 $2 + [AC_LANG_PROGRAM([#define $1 $2 $5], [$6])], [$3=$2; break]) $3=unknown diff -Nru datamash-1.7/m4/lcmessage.m4 datamash-1.8/m4/lcmessage.m4 --- datamash-1.7/m4/lcmessage.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/lcmessage.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,35 @@ +# lcmessage.m4 serial 8 +dnl Copyright (C) 1995-2002, 2004-2005, 2008-2014, 2016, 2019-2021 Free +dnl 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 be used in projects which are not available under +dnl the GNU General Public License or the GNU Lesser 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 Lesser General Public License, and the rest of the GNU +dnl gettext package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper , 1995. + +# Check whether LC_MESSAGES is available in . + +AC_DEFUN([gt_LC_MESSAGES], +[ + AC_CACHE_CHECK([for LC_MESSAGES], [gt_cv_val_LC_MESSAGES], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[return LC_MESSAGES]])], + [gt_cv_val_LC_MESSAGES=yes], + [gt_cv_val_LC_MESSAGES=no])]) + if test $gt_cv_val_LC_MESSAGES = yes; then + AC_DEFINE([HAVE_LC_MESSAGES], [1], + [Define if your file defines LC_MESSAGES.]) + fi +]) diff -Nru datamash-1.7/m4/ldexpl.m4 datamash-1.8/m4/ldexpl.m4 --- datamash-1.7/m4/ldexpl.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/ldexpl.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # ldexpl.m4 serial 17 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2021 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.7/m4/ldexp.m4 datamash-1.8/m4/ldexp.m4 --- datamash-1.7/m4/ldexp.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/ldexp.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # ldexp.m4 serial 1 -dnl Copyright (C) 2010-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2010-2021 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.7/m4/lib-ld.m4 datamash-1.8/m4/lib-ld.m4 --- datamash-1.7/m4/lib-ld.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/lib-ld.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # lib-ld.m4 serial 9 -dnl Copyright (C) 1996-2003, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 1996-2003, 2009-2021 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.7/m4/lib-link.m4 datamash-1.8/m4/lib-link.m4 --- datamash-1.7/m4/lib-link.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/lib-link.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# lib-link.m4 serial 31 -dnl Copyright (C) 2001-2020 Free Software Foundation, Inc. +# lib-link.m4 serial 32 +dnl Copyright (C) 2001-2021 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. @@ -631,7 +631,20 @@ ;; -l*) dnl Handle this in the next round. - names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` + dnl But on GNU systems, ignore -lc options, because + dnl - linking with libc is the default anyway, + dnl - linking with libc.a may produce an error + dnl "/usr/bin/ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in `/usr/lib/libc.a(strcmp.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie" + dnl or may produce an executable that always crashes, see + dnl . + dep=`echo "X$dep" | sed -e 's/^X-l//'` + if test "X$dep" != Xc \ + || case $host_os in + linux* | gnu* | k*bsd*-gnu) false ;; + *) true ;; + esac; then + names_next_round="$names_next_round $dep" + fi ;; *.la) dnl Handle this in the next round. Throw away the .la's diff -Nru datamash-1.7/m4/lib-prefix.m4 datamash-1.8/m4/lib-prefix.m4 --- datamash-1.7/m4/lib-prefix.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/lib-prefix.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# lib-prefix.m4 serial 17 -dnl Copyright (C) 2001-2005, 2008-2020 Free Software Foundation, Inc. +# lib-prefix.m4 serial 19 +dnl Copyright (C) 2001-2005, 2008-2021 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. @@ -180,8 +180,8 @@ ], [gl_cv_elf=yes], [gl_cv_elf=no]) - ]) - if test $gl_cv_elf; then + ]) + if test $gl_cv_elf = yes; then # Extract the ELF class of a file (5th byte) in decimal. # Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header if od -A x < /dev/null >/dev/null 2>/dev/null; then @@ -198,20 +198,23 @@ echo } fi + # Use 'expr', not 'test', to compare the values of func_elfclass, because on + # Solaris 11 OpenIndiana and Solaris 11 OmniOS, the result is 001 or 002, + # not 1 or 2. changequote(,)dnl case $HOST_CPU_C_ABI_32BIT in yes) # 32-bit ABI. acl_is_expected_elfclass () { - test "`func_elfclass | sed -e 's/[ ]//g'`" = 1 + expr "`func_elfclass | sed -e 's/[ ]//g'`" = 1 > /dev/null } ;; no) # 64-bit ABI. acl_is_expected_elfclass () { - test "`func_elfclass | sed -e 's/[ ]//g'`" = 2 + expr "`func_elfclass | sed -e 's/[ ]//g'`" = 2 > /dev/null } ;; *) diff -Nru datamash-1.7/m4/libunistring-base.m4 datamash-1.8/m4/libunistring-base.m4 --- datamash-1.7/m4/libunistring-base.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/libunistring-base.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # libunistring-base.m4 serial 5 -dnl Copyright (C) 2010-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2010-2021 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.7/m4/limits-h.m4 datamash-1.8/m4/limits-h.m4 --- datamash-1.7/m4/limits-h.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/limits-h.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ dnl Check whether limits.h has needed features. -dnl Copyright 2016-2020 Free Software Foundation, Inc. +dnl Copyright 2016-2021 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.7/m4/localcharset.m4 datamash-1.8/m4/localcharset.m4 --- datamash-1.7/m4/localcharset.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/localcharset.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # localcharset.m4 serial 8 -dnl Copyright (C) 2002, 2004, 2006, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2004, 2006, 2009-2021 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.7/m4/localeconv.m4 datamash-1.8/m4/localeconv.m4 --- datamash-1.7/m4/localeconv.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/localeconv.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # localeconv.m4 serial 1 -dnl Copyright (C) 2012-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2012-2021 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.7/m4/locale-fr.m4 datamash-1.8/m4/locale-fr.m4 --- datamash-1.7/m4/locale-fr.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/locale-fr.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# locale-fr.m4 serial 19 -dnl Copyright (C) 2003, 2005-2020 Free Software Foundation, Inc. +# locale-fr.m4 serial 20 +dnl Copyright (C) 2003, 2005-2021 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. @@ -12,8 +12,7 @@ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AM_LANGINFO_CODESET]) AC_CACHE_CHECK([for a traditional french locale], [gt_cv_locale_fr], [ - AC_LANG_CONFTEST([AC_LANG_SOURCE([ -changequote(,)dnl + AC_LANG_CONFTEST([AC_LANG_SOURCE([[ #include #include #if HAVE_LANGINFO_CODESET @@ -78,8 +77,7 @@ return 0; #endif } -changequote([,])dnl - ])]) + ]])]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then case "$host_os" in # Handle native Windows specially, because there setlocale() interprets @@ -143,8 +141,7 @@ [ AC_REQUIRE([AM_LANGINFO_CODESET]) AC_CACHE_CHECK([for a french Unicode locale], [gt_cv_locale_fr_utf8], [ - AC_LANG_CONFTEST([AC_LANG_SOURCE([ -changequote(,)dnl + AC_LANG_CONFTEST([AC_LANG_SOURCE([[ #include #include #if HAVE_LANGINFO_CODESET @@ -206,8 +203,7 @@ #endif return 0; } -changequote([,])dnl - ])]) + ]])]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then case "$host_os" in # Handle native Windows specially, because there setlocale() interprets diff -Nru datamash-1.7/m4/locale_h.m4 datamash-1.8/m4/locale_h.m4 --- datamash-1.7/m4/locale_h.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/locale_h.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # locale_h.m4 serial 24 -dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2021 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.7/m4/locale-ja.m4 datamash-1.8/m4/locale-ja.m4 --- datamash-1.7/m4/locale-ja.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/locale-ja.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# locale-ja.m4 serial 14 -dnl Copyright (C) 2003, 2005-2020 Free Software Foundation, Inc. +# locale-ja.m4 serial 15 +dnl Copyright (C) 2003, 2005-2021 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. @@ -12,8 +12,7 @@ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AM_LANGINFO_CODESET]) AC_CACHE_CHECK([for a traditional japanese locale], [gt_cv_locale_ja], [ - AC_LANG_CONFTEST([AC_LANG_SOURCE([ -changequote(,)dnl + AC_LANG_CONFTEST([AC_LANG_SOURCE([[ #include #include #if HAVE_LANGINFO_CODESET @@ -82,8 +81,7 @@ return 0; #endif } -changequote([,])dnl - ])]) + ]])]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then case "$host_os" in # Handle native Windows specially, because there setlocale() interprets diff -Nru datamash-1.7/m4/localename.m4 datamash-1.8/m4/localename.m4 --- datamash-1.7/m4/localename.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/localename.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,41 @@ +# localename.m4 serial 7 +dnl Copyright (C) 2007, 2009-2021 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_LOCALENAME], +[ + AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) + AC_REQUIRE([gl_LOCALE_T]) + AC_REQUIRE([gt_LC_MESSAGES]) + AC_REQUIRE([gt_INTL_THREAD_LOCALE_NAME]) + AC_REQUIRE([gt_INTL_MACOSX]) + AC_CHECK_HEADERS_ONCE([langinfo.h]) + if test $HAVE_LOCALE_T = 1; then + AC_CHECK_FUNCS_ONCE([newlocale duplocale freelocale]) + gl_func_newlocale="$ac_cv_func_newlocale" + gl_func_duplocale="$ac_cv_func_duplocale" + gl_func_freelocale="$ac_cv_func_freelocale" + else + dnl In 2019, some versions of z/OS lack the locale_t type and have broken + dnl newlocale, duplocale, freelocale functions. + gl_func_newlocale=no + gl_func_duplocale=no + gl_func_freelocale=no + fi + if test $gl_func_newlocale != yes; then + HAVE_NEWLOCALE=0 + fi + if test $gl_func_duplocale != yes; then + HAVE_DUPLOCALE=0 + fi + if test $gl_func_freelocale != yes; then + HAVE_FREELOCALE=0 + fi + if test $gt_nameless_locales = yes; then + REPLACE_NEWLOCALE=1 + REPLACE_DUPLOCALE=1 + REPLACE_FREELOCALE=1 + fi +]) diff -Nru datamash-1.7/m4/locale-zh.m4 datamash-1.8/m4/locale-zh.m4 --- datamash-1.7/m4/locale-zh.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/locale-zh.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# locale-zh.m4 serial 14 -dnl Copyright (C) 2003, 2005-2020 Free Software Foundation, Inc. +# locale-zh.m4 serial 15 +dnl Copyright (C) 2003, 2005-2021 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. @@ -12,8 +12,7 @@ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AM_LANGINFO_CODESET]) AC_CACHE_CHECK([for a transitional chinese locale], [gt_cv_locale_zh_CN], [ - AC_LANG_CONFTEST([AC_LANG_SOURCE([ -changequote(,)dnl + AC_LANG_CONFTEST([AC_LANG_SOURCE([[ #include #include #include @@ -83,8 +82,7 @@ return 0; #endif } -changequote([,])dnl - ])]) + ]])]) if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then case "$host_os" in # Handle native Windows specially, because there setlocale() interprets diff -Nru datamash-1.7/m4/lock.m4 datamash-1.8/m4/lock.m4 --- datamash-1.7/m4/lock.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/lock.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,47 @@ +# lock.m4 serial 14 +dnl Copyright (C) 2005-2021 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. + +AC_DEFUN([gl_LOCK], +[ + AC_REQUIRE([gl_THREADLIB]) + if test "$gl_threads_api" = posix; then + # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the + # pthread_rwlock_* functions. + has_rwlock=false + AC_CHECK_TYPE([pthread_rwlock_t], + [has_rwlock=true + AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1], + [Define if the POSIX multithreading library has read/write locks.])], + [], + [#include ]) + if $has_rwlock; then + gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER + fi + # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro. + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM( + [[#include ]], + [[ +#if __FreeBSD__ == 4 +error "No, in FreeBSD 4.0 recursive mutexes actually don't work." +#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \ + && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070) +error "No, in Mac OS X < 10.7 recursive mutexes actually don't work." +#else +int x = (int)PTHREAD_MUTEX_RECURSIVE; +return !x; +#endif + ]])], + [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], [1], + [Define if the defines PTHREAD_MUTEX_RECURSIVE.])]) + fi + gl_PREREQ_LOCK +]) + +# Prerequisites of lib/glthread/lock.c. +AC_DEFUN([gl_PREREQ_LOCK], [:]) diff -Nru datamash-1.7/m4/logl.m4 datamash-1.8/m4/logl.m4 --- datamash-1.7/m4/logl.m4 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/m4/logl.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# logl.m4 serial 13 -dnl Copyright (C) 2010-2020 Free Software Foundation, Inc. +# logl.m4 serial 14 +dnl Copyright (C) 2010-2021 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. @@ -103,7 +103,7 @@ dnl Test whether logl() works. dnl On OSF/1 5.1, logl(-0.0L) is NaN. -dnl On NetBSD 8.0, the result is accurate to only 16 digits. +dnl On NetBSD 9.0, the result is accurate to only 16 digits. AC_DEFUN([gl_FUNC_LOGL_WORKS], [ AC_REQUIRE([AC_PROG_CC]) @@ -166,7 +166,7 @@ if (!(gy + gy == gy)) result |= 1; } - /* This test fails on NetBSD 8.0. */ + /* This test fails on NetBSD 9.0. */ { const long double TWO_LDBL_MANT_DIG = /* 2^LDBL_MANT_DIG */ (long double) (1U << ((LDBL_MANT_DIG - 1) / 5)) diff -Nru datamash-1.7/m4/log.m4 datamash-1.8/m4/log.m4 --- datamash-1.7/m4/log.m4 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/m4/log.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # log.m4 serial 11 -dnl Copyright (C) 2011-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2021 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.7/m4/lseek.m4 datamash-1.8/m4/lseek.m4 --- datamash-1.7/m4/lseek.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/lseek.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# lseek.m4 serial 10 -dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. +# lseek.m4 serial 11 +dnl Copyright (C) 2007, 2009-2021 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. @@ -32,7 +32,8 @@ #else /* on Windows with MSVC */ # include #endif -]], [[ +]GL_MDA_DEFINES], +[[ /* Exit with success only if stdin is seekable. */ return lseek (0, (off_t)0, SEEK_CUR) < 0; ]])], diff -Nru datamash-1.7/m4/malloca.m4 datamash-1.8/m4/malloca.m4 --- datamash-1.7/m4/malloca.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/malloca.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # malloca.m4 serial 2 -dnl Copyright (C) 2003-2004, 2006-2007, 2009-2020 Free Software Foundation, +dnl Copyright (C) 2003-2004, 2006-2007, 2009-2021 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.7/m4/malloc.m4 datamash-1.8/m4/malloc.m4 --- datamash-1.7/m4/malloc.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/malloc.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# malloc.m4 serial 20 -dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. +# malloc.m4 serial 21 +dnl Copyright (C) 2007, 2009-2021 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. @@ -8,18 +8,12 @@ # https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c AC_DEFUN([_AC_FUNC_MALLOC_IF], [ - AC_REQUIRE([AC_HEADER_STDC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles - AC_CHECK_HEADERS([stdlib.h]) AC_CACHE_CHECK([for GNU libc compatible malloc], [ac_cv_func_malloc_0_nonnull], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( - [[#if defined STDC_HEADERS || defined HAVE_STDLIB_H - # include - #else - char *malloc (); - #endif + [[#include ]], [[char *p = malloc (0); int result = !p; diff -Nru datamash-1.7/m4/mathfunc.m4 datamash-1.8/m4/mathfunc.m4 --- datamash-1.7/m4/mathfunc.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/mathfunc.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # mathfunc.m4 serial 12 -dnl Copyright (C) 2010-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2010-2021 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.7/m4/math_h.m4 datamash-1.8/m4/math_h.m4 --- datamash-1.7/m4/math_h.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/math_h.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# math_h.m4 serial 119 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +# math_h.m4 serial 122 +dnl Copyright (C) 2007-2021 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 @@ gl_CHECK_NEXT_HEADERS([math.h]) AC_CACHE_CHECK([whether NAN macro works], [gl_cv_header_math_nan_works], - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[/* Solaris 10 has a broken definition of NAN. Other platforms fail to provide NAN, or provide it only in C99 mode; this test only needs to fail when NAN is provided but wrong. */ @@ -25,7 +25,7 @@ REPLACE_NAN=1 fi AC_CACHE_CHECK([whether HUGE_VAL works], [gl_cv_header_math_huge_val_works], - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include ]], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[/* Solaris 10 has a broken definition of HUGE_VAL. */ double d = HUGE_VAL; return d == 0;]])], @@ -159,182 +159,189 @@ GNULIB_TRUNC=0; AC_SUBST([GNULIB_TRUNC]) GNULIB_TRUNCF=0; AC_SUBST([GNULIB_TRUNCF]) GNULIB_TRUNCL=0; AC_SUBST([GNULIB_TRUNCL]) + dnl Support Microsoft deprecated alias function names by default. + GNULIB_MDA_J0=1; AC_SUBST([GNULIB_MDA_J0]) + GNULIB_MDA_J1=1; AC_SUBST([GNULIB_MDA_J1]) + GNULIB_MDA_JN=1; AC_SUBST([GNULIB_MDA_JN]) + GNULIB_MDA_Y0=1; AC_SUBST([GNULIB_MDA_Y0]) + GNULIB_MDA_Y1=1; AC_SUBST([GNULIB_MDA_Y1]) + GNULIB_MDA_YN=1; AC_SUBST([GNULIB_MDA_YN]) dnl Assume proper GNU behavior unless another module says otherwise. - HAVE_ACOSF=1; AC_SUBST([HAVE_ACOSF]) - HAVE_ACOSL=1; AC_SUBST([HAVE_ACOSL]) - HAVE_ASINF=1; AC_SUBST([HAVE_ASINF]) - HAVE_ASINL=1; AC_SUBST([HAVE_ASINL]) - HAVE_ATANF=1; AC_SUBST([HAVE_ATANF]) - HAVE_ATANL=1; AC_SUBST([HAVE_ATANL]) - HAVE_ATAN2F=1; AC_SUBST([HAVE_ATAN2F]) - HAVE_CBRT=1; AC_SUBST([HAVE_CBRT]) - HAVE_CBRTF=1; AC_SUBST([HAVE_CBRTF]) - HAVE_CBRTL=1; AC_SUBST([HAVE_CBRTL]) - HAVE_COPYSIGN=1; AC_SUBST([HAVE_COPYSIGN]) - HAVE_COPYSIGNL=1; AC_SUBST([HAVE_COPYSIGNL]) - HAVE_COSF=1; AC_SUBST([HAVE_COSF]) - HAVE_COSL=1; AC_SUBST([HAVE_COSL]) - HAVE_COSHF=1; AC_SUBST([HAVE_COSHF]) - HAVE_EXPF=1; AC_SUBST([HAVE_EXPF]) - HAVE_EXPL=1; AC_SUBST([HAVE_EXPL]) - HAVE_EXPM1=1; AC_SUBST([HAVE_EXPM1]) - HAVE_EXPM1F=1; AC_SUBST([HAVE_EXPM1F]) - HAVE_FABSF=1; AC_SUBST([HAVE_FABSF]) - HAVE_FABSL=1; AC_SUBST([HAVE_FABSL]) - HAVE_FMA=1; AC_SUBST([HAVE_FMA]) - HAVE_FMAF=1; AC_SUBST([HAVE_FMAF]) - HAVE_FMAL=1; AC_SUBST([HAVE_FMAL]) - HAVE_FMODF=1; AC_SUBST([HAVE_FMODF]) - HAVE_FMODL=1; AC_SUBST([HAVE_FMODL]) - HAVE_FREXPF=1; AC_SUBST([HAVE_FREXPF]) - HAVE_HYPOTF=1; AC_SUBST([HAVE_HYPOTF]) - HAVE_HYPOTL=1; AC_SUBST([HAVE_HYPOTL]) - HAVE_ILOGB=1; AC_SUBST([HAVE_ILOGB]) - HAVE_ILOGBF=1; AC_SUBST([HAVE_ILOGBF]) - HAVE_ILOGBL=1; AC_SUBST([HAVE_ILOGBL]) - HAVE_ISNANF=1; AC_SUBST([HAVE_ISNANF]) - HAVE_ISNAND=1; AC_SUBST([HAVE_ISNAND]) - HAVE_ISNANL=1; AC_SUBST([HAVE_ISNANL]) - HAVE_LDEXPF=1; AC_SUBST([HAVE_LDEXPF]) - HAVE_LOGF=1; AC_SUBST([HAVE_LOGF]) - HAVE_LOGL=1; AC_SUBST([HAVE_LOGL]) - HAVE_LOG10F=1; AC_SUBST([HAVE_LOG10F]) - HAVE_LOG10L=1; AC_SUBST([HAVE_LOG10L]) - HAVE_LOG1P=1; AC_SUBST([HAVE_LOG1P]) - HAVE_LOG1PF=1; AC_SUBST([HAVE_LOG1PF]) - HAVE_LOG1PL=1; AC_SUBST([HAVE_LOG1PL]) - HAVE_LOGBF=1; AC_SUBST([HAVE_LOGBF]) - HAVE_LOGBL=1; AC_SUBST([HAVE_LOGBL]) - HAVE_MODFF=1; AC_SUBST([HAVE_MODFF]) - HAVE_MODFL=1; AC_SUBST([HAVE_MODFL]) - HAVE_POWF=1; AC_SUBST([HAVE_POWF]) - HAVE_REMAINDER=1; AC_SUBST([HAVE_REMAINDER]) - HAVE_REMAINDERF=1; AC_SUBST([HAVE_REMAINDERF]) - HAVE_RINT=1; AC_SUBST([HAVE_RINT]) - HAVE_RINTL=1; AC_SUBST([HAVE_RINTL]) - HAVE_SINF=1; AC_SUBST([HAVE_SINF]) - HAVE_SINL=1; AC_SUBST([HAVE_SINL]) - HAVE_SINHF=1; AC_SUBST([HAVE_SINHF]) - HAVE_SQRTF=1; AC_SUBST([HAVE_SQRTF]) - HAVE_SQRTL=1; AC_SUBST([HAVE_SQRTL]) - HAVE_TANF=1; AC_SUBST([HAVE_TANF]) - HAVE_TANL=1; AC_SUBST([HAVE_TANL]) - HAVE_TANHF=1; AC_SUBST([HAVE_TANHF]) - HAVE_DECL_ACOSL=1; AC_SUBST([HAVE_DECL_ACOSL]) - HAVE_DECL_ASINL=1; AC_SUBST([HAVE_DECL_ASINL]) - HAVE_DECL_ATANL=1; AC_SUBST([HAVE_DECL_ATANL]) - HAVE_DECL_CBRTF=1; AC_SUBST([HAVE_DECL_CBRTF]) - HAVE_DECL_CBRTL=1; AC_SUBST([HAVE_DECL_CBRTL]) - HAVE_DECL_CEILF=1; AC_SUBST([HAVE_DECL_CEILF]) - HAVE_DECL_CEILL=1; AC_SUBST([HAVE_DECL_CEILL]) - HAVE_DECL_COPYSIGNF=1; AC_SUBST([HAVE_DECL_COPYSIGNF]) - HAVE_DECL_COSL=1; AC_SUBST([HAVE_DECL_COSL]) - HAVE_DECL_EXPL=1; AC_SUBST([HAVE_DECL_EXPL]) - HAVE_DECL_EXP2=1; AC_SUBST([HAVE_DECL_EXP2]) - HAVE_DECL_EXP2F=1; AC_SUBST([HAVE_DECL_EXP2F]) - HAVE_DECL_EXP2L=1; AC_SUBST([HAVE_DECL_EXP2L]) - HAVE_DECL_EXPM1L=1; AC_SUBST([HAVE_DECL_EXPM1L]) - HAVE_DECL_FLOORF=1; AC_SUBST([HAVE_DECL_FLOORF]) - HAVE_DECL_FLOORL=1; AC_SUBST([HAVE_DECL_FLOORL]) - HAVE_DECL_FREXPL=1; AC_SUBST([HAVE_DECL_FREXPL]) - HAVE_DECL_LDEXPL=1; AC_SUBST([HAVE_DECL_LDEXPL]) - HAVE_DECL_LOGL=1; AC_SUBST([HAVE_DECL_LOGL]) - HAVE_DECL_LOG10L=1; AC_SUBST([HAVE_DECL_LOG10L]) - HAVE_DECL_LOG2=1; AC_SUBST([HAVE_DECL_LOG2]) - HAVE_DECL_LOG2F=1; AC_SUBST([HAVE_DECL_LOG2F]) - HAVE_DECL_LOG2L=1; AC_SUBST([HAVE_DECL_LOG2L]) - HAVE_DECL_LOGB=1; AC_SUBST([HAVE_DECL_LOGB]) - HAVE_DECL_REMAINDER=1; AC_SUBST([HAVE_DECL_REMAINDER]) - HAVE_DECL_REMAINDERL=1; AC_SUBST([HAVE_DECL_REMAINDERL]) - HAVE_DECL_RINTF=1; AC_SUBST([HAVE_DECL_RINTF]) - HAVE_DECL_ROUND=1; AC_SUBST([HAVE_DECL_ROUND]) - HAVE_DECL_ROUNDF=1; AC_SUBST([HAVE_DECL_ROUNDF]) - HAVE_DECL_ROUNDL=1; AC_SUBST([HAVE_DECL_ROUNDL]) - HAVE_DECL_SINL=1; AC_SUBST([HAVE_DECL_SINL]) - HAVE_DECL_SQRTL=1; AC_SUBST([HAVE_DECL_SQRTL]) - HAVE_DECL_TANL=1; AC_SUBST([HAVE_DECL_TANL]) - 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_EXPL=0; AC_SUBST([REPLACE_EXPL]) - REPLACE_EXPM1=0; AC_SUBST([REPLACE_EXPM1]) - REPLACE_EXPM1F=0; AC_SUBST([REPLACE_EXPM1F]) - REPLACE_EXPM1L=0; AC_SUBST([REPLACE_EXPM1L]) - REPLACE_EXP2=0; AC_SUBST([REPLACE_EXP2]) - REPLACE_EXP2L=0; AC_SUBST([REPLACE_EXP2L]) - REPLACE_FABSL=0; AC_SUBST([REPLACE_FABSL]) - REPLACE_FLOOR=0; AC_SUBST([REPLACE_FLOOR]) - REPLACE_FLOORF=0; AC_SUBST([REPLACE_FLOORF]) - REPLACE_FLOORL=0; AC_SUBST([REPLACE_FLOORL]) - REPLACE_FMA=0; AC_SUBST([REPLACE_FMA]) - REPLACE_FMAF=0; AC_SUBST([REPLACE_FMAF]) - REPLACE_FMAL=0; AC_SUBST([REPLACE_FMAL]) - REPLACE_FMOD=0; AC_SUBST([REPLACE_FMOD]) - REPLACE_FMODF=0; AC_SUBST([REPLACE_FMODF]) - REPLACE_FMODL=0; AC_SUBST([REPLACE_FMODL]) - REPLACE_FREXPF=0; AC_SUBST([REPLACE_FREXPF]) - REPLACE_FREXP=0; AC_SUBST([REPLACE_FREXP]) - REPLACE_FREXPL=0; AC_SUBST([REPLACE_FREXPL]) - REPLACE_HUGE_VAL=0; AC_SUBST([REPLACE_HUGE_VAL]) - REPLACE_HYPOT=0; AC_SUBST([REPLACE_HYPOT]) - REPLACE_HYPOTF=0; AC_SUBST([REPLACE_HYPOTF]) - REPLACE_HYPOTL=0; AC_SUBST([REPLACE_HYPOTL]) - REPLACE_ILOGB=0; AC_SUBST([REPLACE_ILOGB]) - REPLACE_ILOGBF=0; AC_SUBST([REPLACE_ILOGBF]) - REPLACE_ILOGBL=0; AC_SUBST([REPLACE_ILOGBL]) - REPLACE_ISFINITE=0; AC_SUBST([REPLACE_ISFINITE]) - REPLACE_ISINF=0; AC_SUBST([REPLACE_ISINF]) - REPLACE_ISNAN=0; AC_SUBST([REPLACE_ISNAN]) - REPLACE_LDEXPL=0; AC_SUBST([REPLACE_LDEXPL]) - REPLACE_LOG=0; AC_SUBST([REPLACE_LOG]) - REPLACE_LOGF=0; AC_SUBST([REPLACE_LOGF]) - REPLACE_LOGL=0; AC_SUBST([REPLACE_LOGL]) - REPLACE_LOG10=0; AC_SUBST([REPLACE_LOG10]) - REPLACE_LOG10F=0; AC_SUBST([REPLACE_LOG10F]) - REPLACE_LOG10L=0; AC_SUBST([REPLACE_LOG10L]) - REPLACE_LOG1P=0; AC_SUBST([REPLACE_LOG1P]) - REPLACE_LOG1PF=0; AC_SUBST([REPLACE_LOG1PF]) - REPLACE_LOG1PL=0; AC_SUBST([REPLACE_LOG1PL]) - REPLACE_LOG2=0; AC_SUBST([REPLACE_LOG2]) - REPLACE_LOG2F=0; AC_SUBST([REPLACE_LOG2F]) - REPLACE_LOG2L=0; AC_SUBST([REPLACE_LOG2L]) - REPLACE_LOGB=0; AC_SUBST([REPLACE_LOGB]) - REPLACE_LOGBF=0; AC_SUBST([REPLACE_LOGBF]) - REPLACE_LOGBL=0; AC_SUBST([REPLACE_LOGBL]) - REPLACE_MODF=0; AC_SUBST([REPLACE_MODF]) - REPLACE_MODFF=0; AC_SUBST([REPLACE_MODFF]) - REPLACE_MODFL=0; AC_SUBST([REPLACE_MODFL]) - REPLACE_NAN=0; AC_SUBST([REPLACE_NAN]) - REPLACE_REMAINDER=0; AC_SUBST([REPLACE_REMAINDER]) - REPLACE_REMAINDERF=0; AC_SUBST([REPLACE_REMAINDERF]) - REPLACE_REMAINDERL=0; AC_SUBST([REPLACE_REMAINDERL]) - REPLACE_RINTL=0; AC_SUBST([REPLACE_RINTL]) - REPLACE_ROUND=0; AC_SUBST([REPLACE_ROUND]) - REPLACE_ROUNDF=0; AC_SUBST([REPLACE_ROUNDF]) - 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]) + HAVE_ACOSF=1; AC_SUBST([HAVE_ACOSF]) + HAVE_ACOSL=1; AC_SUBST([HAVE_ACOSL]) + HAVE_ASINF=1; AC_SUBST([HAVE_ASINF]) + HAVE_ASINL=1; AC_SUBST([HAVE_ASINL]) + HAVE_ATANF=1; AC_SUBST([HAVE_ATANF]) + HAVE_ATANL=1; AC_SUBST([HAVE_ATANL]) + HAVE_ATAN2F=1; AC_SUBST([HAVE_ATAN2F]) + HAVE_CBRT=1; AC_SUBST([HAVE_CBRT]) + HAVE_CBRTF=1; AC_SUBST([HAVE_CBRTF]) + HAVE_CBRTL=1; AC_SUBST([HAVE_CBRTL]) + HAVE_COPYSIGN=1; AC_SUBST([HAVE_COPYSIGN]) + HAVE_COPYSIGNL=1; AC_SUBST([HAVE_COPYSIGNL]) + HAVE_COSF=1; AC_SUBST([HAVE_COSF]) + HAVE_COSL=1; AC_SUBST([HAVE_COSL]) + HAVE_COSHF=1; AC_SUBST([HAVE_COSHF]) + HAVE_EXPF=1; AC_SUBST([HAVE_EXPF]) + HAVE_EXPL=1; AC_SUBST([HAVE_EXPL]) + HAVE_EXPM1=1; AC_SUBST([HAVE_EXPM1]) + HAVE_EXPM1F=1; AC_SUBST([HAVE_EXPM1F]) + HAVE_FABSF=1; AC_SUBST([HAVE_FABSF]) + HAVE_FABSL=1; AC_SUBST([HAVE_FABSL]) + HAVE_FMA=1; AC_SUBST([HAVE_FMA]) + HAVE_FMAF=1; AC_SUBST([HAVE_FMAF]) + HAVE_FMAL=1; AC_SUBST([HAVE_FMAL]) + HAVE_FMODF=1; AC_SUBST([HAVE_FMODF]) + HAVE_FMODL=1; AC_SUBST([HAVE_FMODL]) + HAVE_FREXPF=1; AC_SUBST([HAVE_FREXPF]) + HAVE_HYPOTF=1; AC_SUBST([HAVE_HYPOTF]) + HAVE_HYPOTL=1; AC_SUBST([HAVE_HYPOTL]) + HAVE_ILOGB=1; AC_SUBST([HAVE_ILOGB]) + HAVE_ILOGBF=1; AC_SUBST([HAVE_ILOGBF]) + HAVE_ILOGBL=1; AC_SUBST([HAVE_ILOGBL]) + HAVE_ISNANF=1; AC_SUBST([HAVE_ISNANF]) + HAVE_ISNAND=1; AC_SUBST([HAVE_ISNAND]) + HAVE_ISNANL=1; AC_SUBST([HAVE_ISNANL]) + HAVE_LDEXPF=1; AC_SUBST([HAVE_LDEXPF]) + HAVE_LOGF=1; AC_SUBST([HAVE_LOGF]) + HAVE_LOGL=1; AC_SUBST([HAVE_LOGL]) + HAVE_LOG10F=1; AC_SUBST([HAVE_LOG10F]) + HAVE_LOG10L=1; AC_SUBST([HAVE_LOG10L]) + HAVE_LOG1P=1; AC_SUBST([HAVE_LOG1P]) + HAVE_LOG1PF=1; AC_SUBST([HAVE_LOG1PF]) + HAVE_LOG1PL=1; AC_SUBST([HAVE_LOG1PL]) + HAVE_LOGBF=1; AC_SUBST([HAVE_LOGBF]) + HAVE_LOGBL=1; AC_SUBST([HAVE_LOGBL]) + HAVE_MODFF=1; AC_SUBST([HAVE_MODFF]) + HAVE_MODFL=1; AC_SUBST([HAVE_MODFL]) + HAVE_POWF=1; AC_SUBST([HAVE_POWF]) + HAVE_REMAINDER=1; AC_SUBST([HAVE_REMAINDER]) + HAVE_REMAINDERF=1; AC_SUBST([HAVE_REMAINDERF]) + HAVE_RINT=1; AC_SUBST([HAVE_RINT]) + HAVE_RINTL=1; AC_SUBST([HAVE_RINTL]) + HAVE_SINF=1; AC_SUBST([HAVE_SINF]) + HAVE_SINL=1; AC_SUBST([HAVE_SINL]) + HAVE_SINHF=1; AC_SUBST([HAVE_SINHF]) + HAVE_SQRTF=1; AC_SUBST([HAVE_SQRTF]) + HAVE_SQRTL=1; AC_SUBST([HAVE_SQRTL]) + HAVE_TANF=1; AC_SUBST([HAVE_TANF]) + HAVE_TANL=1; AC_SUBST([HAVE_TANL]) + HAVE_TANHF=1; AC_SUBST([HAVE_TANHF]) + HAVE_DECL_ACOSL=1; AC_SUBST([HAVE_DECL_ACOSL]) + HAVE_DECL_ASINL=1; AC_SUBST([HAVE_DECL_ASINL]) + HAVE_DECL_ATANL=1; AC_SUBST([HAVE_DECL_ATANL]) + HAVE_DECL_CBRTF=1; AC_SUBST([HAVE_DECL_CBRTF]) + HAVE_DECL_CBRTL=1; AC_SUBST([HAVE_DECL_CBRTL]) + HAVE_DECL_CEILF=1; AC_SUBST([HAVE_DECL_CEILF]) + HAVE_DECL_CEILL=1; AC_SUBST([HAVE_DECL_CEILL]) + HAVE_DECL_COPYSIGNF=1; AC_SUBST([HAVE_DECL_COPYSIGNF]) + HAVE_DECL_COSL=1; AC_SUBST([HAVE_DECL_COSL]) + HAVE_DECL_EXPL=1; AC_SUBST([HAVE_DECL_EXPL]) + HAVE_DECL_EXP2=1; AC_SUBST([HAVE_DECL_EXP2]) + HAVE_DECL_EXP2F=1; AC_SUBST([HAVE_DECL_EXP2F]) + HAVE_DECL_EXP2L=1; AC_SUBST([HAVE_DECL_EXP2L]) + HAVE_DECL_EXPM1L=1; AC_SUBST([HAVE_DECL_EXPM1L]) + HAVE_DECL_FLOORF=1; AC_SUBST([HAVE_DECL_FLOORF]) + HAVE_DECL_FLOORL=1; AC_SUBST([HAVE_DECL_FLOORL]) + HAVE_DECL_FREXPL=1; AC_SUBST([HAVE_DECL_FREXPL]) + HAVE_DECL_LDEXPL=1; AC_SUBST([HAVE_DECL_LDEXPL]) + HAVE_DECL_LOGL=1; AC_SUBST([HAVE_DECL_LOGL]) + HAVE_DECL_LOG10L=1; AC_SUBST([HAVE_DECL_LOG10L]) + HAVE_DECL_LOG2=1; AC_SUBST([HAVE_DECL_LOG2]) + HAVE_DECL_LOG2F=1; AC_SUBST([HAVE_DECL_LOG2F]) + HAVE_DECL_LOG2L=1; AC_SUBST([HAVE_DECL_LOG2L]) + HAVE_DECL_LOGB=1; AC_SUBST([HAVE_DECL_LOGB]) + HAVE_DECL_REMAINDER=1; AC_SUBST([HAVE_DECL_REMAINDER]) + HAVE_DECL_REMAINDERL=1; AC_SUBST([HAVE_DECL_REMAINDERL]) + HAVE_DECL_RINTF=1; AC_SUBST([HAVE_DECL_RINTF]) + HAVE_DECL_ROUND=1; AC_SUBST([HAVE_DECL_ROUND]) + HAVE_DECL_ROUNDF=1; AC_SUBST([HAVE_DECL_ROUNDF]) + HAVE_DECL_ROUNDL=1; AC_SUBST([HAVE_DECL_ROUNDL]) + HAVE_DECL_SINL=1; AC_SUBST([HAVE_DECL_SINL]) + HAVE_DECL_SQRTL=1; AC_SUBST([HAVE_DECL_SQRTL]) + HAVE_DECL_TANL=1; AC_SUBST([HAVE_DECL_TANL]) + 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_EXPL=0; AC_SUBST([REPLACE_EXPL]) + REPLACE_EXPM1=0; AC_SUBST([REPLACE_EXPM1]) + REPLACE_EXPM1F=0; AC_SUBST([REPLACE_EXPM1F]) + REPLACE_EXPM1L=0; AC_SUBST([REPLACE_EXPM1L]) + REPLACE_EXP2=0; AC_SUBST([REPLACE_EXP2]) + REPLACE_EXP2L=0; AC_SUBST([REPLACE_EXP2L]) + REPLACE_FABSL=0; AC_SUBST([REPLACE_FABSL]) + REPLACE_FLOOR=0; AC_SUBST([REPLACE_FLOOR]) + REPLACE_FLOORF=0; AC_SUBST([REPLACE_FLOORF]) + REPLACE_FLOORL=0; AC_SUBST([REPLACE_FLOORL]) + REPLACE_FMA=0; AC_SUBST([REPLACE_FMA]) + REPLACE_FMAF=0; AC_SUBST([REPLACE_FMAF]) + REPLACE_FMAL=0; AC_SUBST([REPLACE_FMAL]) + REPLACE_FMOD=0; AC_SUBST([REPLACE_FMOD]) + REPLACE_FMODF=0; AC_SUBST([REPLACE_FMODF]) + REPLACE_FMODL=0; AC_SUBST([REPLACE_FMODL]) + REPLACE_FREXPF=0; AC_SUBST([REPLACE_FREXPF]) + REPLACE_FREXP=0; AC_SUBST([REPLACE_FREXP]) + REPLACE_FREXPL=0; AC_SUBST([REPLACE_FREXPL]) + REPLACE_HUGE_VAL=0; AC_SUBST([REPLACE_HUGE_VAL]) + REPLACE_HYPOT=0; AC_SUBST([REPLACE_HYPOT]) + REPLACE_HYPOTF=0; AC_SUBST([REPLACE_HYPOTF]) + REPLACE_HYPOTL=0; AC_SUBST([REPLACE_HYPOTL]) + REPLACE_ILOGB=0; AC_SUBST([REPLACE_ILOGB]) + REPLACE_ILOGBF=0; AC_SUBST([REPLACE_ILOGBF]) + REPLACE_ILOGBL=0; AC_SUBST([REPLACE_ILOGBL]) + REPLACE_ISFINITE=0; AC_SUBST([REPLACE_ISFINITE]) + REPLACE_ISINF=0; AC_SUBST([REPLACE_ISINF]) + REPLACE_ISNAN=0; AC_SUBST([REPLACE_ISNAN]) + REPLACE_LDEXPL=0; AC_SUBST([REPLACE_LDEXPL]) + REPLACE_LOG=0; AC_SUBST([REPLACE_LOG]) + REPLACE_LOGF=0; AC_SUBST([REPLACE_LOGF]) + REPLACE_LOGL=0; AC_SUBST([REPLACE_LOGL]) + REPLACE_LOG10=0; AC_SUBST([REPLACE_LOG10]) + REPLACE_LOG10F=0; AC_SUBST([REPLACE_LOG10F]) + REPLACE_LOG10L=0; AC_SUBST([REPLACE_LOG10L]) + REPLACE_LOG1P=0; AC_SUBST([REPLACE_LOG1P]) + REPLACE_LOG1PF=0; AC_SUBST([REPLACE_LOG1PF]) + REPLACE_LOG1PL=0; AC_SUBST([REPLACE_LOG1PL]) + REPLACE_LOG2=0; AC_SUBST([REPLACE_LOG2]) + REPLACE_LOG2F=0; AC_SUBST([REPLACE_LOG2F]) + REPLACE_LOG2L=0; AC_SUBST([REPLACE_LOG2L]) + REPLACE_LOGB=0; AC_SUBST([REPLACE_LOGB]) + REPLACE_LOGBF=0; AC_SUBST([REPLACE_LOGBF]) + REPLACE_LOGBL=0; AC_SUBST([REPLACE_LOGBL]) + REPLACE_MODF=0; AC_SUBST([REPLACE_MODF]) + REPLACE_MODFF=0; AC_SUBST([REPLACE_MODFF]) + REPLACE_MODFL=0; AC_SUBST([REPLACE_MODFL]) + REPLACE_NAN=0; AC_SUBST([REPLACE_NAN]) + REPLACE_REMAINDER=0; AC_SUBST([REPLACE_REMAINDER]) + REPLACE_REMAINDERF=0; AC_SUBST([REPLACE_REMAINDERF]) + REPLACE_REMAINDERL=0; AC_SUBST([REPLACE_REMAINDERL]) + REPLACE_RINTL=0; AC_SUBST([REPLACE_RINTL]) + REPLACE_ROUND=0; AC_SUBST([REPLACE_ROUND]) + REPLACE_ROUNDF=0; AC_SUBST([REPLACE_ROUNDF]) + REPLACE_ROUNDL=0; AC_SUBST([REPLACE_ROUNDL]) + REPLACE_SIGNBIT=0; AC_SUBST([REPLACE_SIGNBIT]) + REPLACE_SIGNBIT_USING_BUILTINS=0; AC_SUBST([REPLACE_SIGNBIT_USING_BUILTINS]) + 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]) ]) # gl_LONG_DOUBLE_VS_DOUBLE diff -Nru datamash-1.7/m4/mbchar.m4 datamash-1.8/m4/mbchar.m4 --- datamash-1.7/m4/mbchar.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/mbchar.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # mbchar.m4 serial 9 -dnl Copyright (C) 2005-2007, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2007, 2009-2021 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.7/m4/mbiter.m4 datamash-1.8/m4/mbiter.m4 --- datamash-1.7/m4/mbiter.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/mbiter.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # mbiter.m4 serial 7 -dnl Copyright (C) 2005, 2008-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2008-2021 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.7/m4/mbrtowc.m4 datamash-1.8/m4/mbrtowc.m4 --- datamash-1.7/m4/mbrtowc.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/mbrtowc.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# mbrtowc.m4 serial 37 -*- coding: utf-8 -*- -dnl Copyright (C) 2001-2002, 2004-2005, 2008-2020 Free Software Foundation, +# mbrtowc.m4 serial 38 -*- coding: utf-8 -*- +dnl Copyright (C) 2001-2002, 2004-2005, 2008-2021 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, @@ -18,15 +18,8 @@ if test $ac_cv_func_mbrtowc = no; then HAVE_MBRTOWC=0 AC_CHECK_DECLS([mbrtowc],,, [[ -/* 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 + ]]) if test $ac_cv_have_decl_mbrtowc = yes; then dnl On Minix 3.1.8, the system's declares mbrtowc() although dnl it does not have the function. Avoid a collision with gnulib's @@ -181,13 +174,6 @@ [AC_LANG_SOURCE([[ #include #include -/* 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 main () { @@ -213,13 +199,6 @@ [AC_LANG_SOURCE([[ #include #include -/* 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 main () { @@ -271,13 +250,6 @@ #include #include #include -/* 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 main () { @@ -331,13 +303,6 @@ #include #include #include -/* 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 main () { @@ -400,13 +365,6 @@ [AC_LANG_SOURCE([[ #include #include -/* 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 main () { @@ -462,13 +420,6 @@ [AC_LANG_SOURCE([[ #include #include -/* 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 main () { @@ -590,13 +541,6 @@ [AC_LANG_SOURCE([[ #include #include -/* 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 main () { @@ -644,13 +588,6 @@ [AC_LANG_SOURCE([[ #include #include -/* 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 main () { @@ -708,13 +645,6 @@ [AC_LANG_SOURCE([[ #include #include -/* 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 main () { @@ -845,14 +775,7 @@ [gl_cv_func_mbrtowc], [AC_LINK_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 . */ - #include - #include - #include - #include ]], + [[#include ]], [[wchar_t wc; char const s[] = ""; size_t n = 1; diff -Nru datamash-1.7/m4/mbsinit.m4 datamash-1.8/m4/mbsinit.m4 --- datamash-1.7/m4/mbsinit.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/mbsinit.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# mbsinit.m4 serial 8 -dnl Copyright (C) 2008, 2010-2020 Free Software Foundation, Inc. +# mbsinit.m4 serial 9 +dnl Copyright (C) 2008, 2010-2021 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. @@ -16,15 +16,8 @@ if test $ac_cv_func_mbsinit = no; then HAVE_MBSINIT=0 AC_CHECK_DECLS([mbsinit],,, [[ -/* 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 + ]]) if test $ac_cv_have_decl_mbsinit = yes; then dnl On Minix 3.1.8, the system's declares mbsinit() although dnl it does not have the function. Avoid a collision with gnulib's diff -Nru datamash-1.7/m4/mbslen.m4 datamash-1.8/m4/mbslen.m4 --- datamash-1.7/m4/mbslen.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/mbslen.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # mbslen.m4 serial 2 -dnl Copyright (C) 2010-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2010-2021 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.7/m4/mbsrtowcs.m4 datamash-1.8/m4/mbsrtowcs.m4 --- datamash-1.7/m4/mbsrtowcs.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/mbsrtowcs.m4 1970-01-01 00:00:00.000000000 +0000 @@ -1,155 +0,0 @@ -# mbsrtowcs.m4 serial 13 -dnl Copyright (C) 2008-2020 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_MBSRTOWCS], -[ - AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) - - AC_REQUIRE([AC_TYPE_MBSTATE_T]) - gl_MBSTATE_T_BROKEN - - AC_CHECK_FUNCS_ONCE([mbsrtowcs]) - if test $ac_cv_func_mbsrtowcs = no; then - HAVE_MBSRTOWCS=0 - AC_CHECK_DECLS([mbsrtowcs],,, [[ -/* 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 test $ac_cv_have_decl_mbsrtowcs = yes; then - dnl On Minix 3.1.8, the system's declares mbsrtowcs() although - dnl it does not have the function. Avoid a collision with gnulib's - dnl replacement. - REPLACE_MBSRTOWCS=1 - fi - else - if test $REPLACE_MBSTATE_T = 1; then - REPLACE_MBSRTOWCS=1 - else - gl_MBSRTOWCS_WORKS - case "$gl_cv_func_mbsrtowcs_works" in - *yes) ;; - *) REPLACE_MBSRTOWCS=1 ;; - esac - fi - fi -]) - -dnl Test whether mbsrtowcs works. -dnl Result is gl_cv_func_mbsrtowcs_works. - -AC_DEFUN([gl_MBSRTOWCS_WORKS], -[ - AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([gt_LOCALE_FR]) - AC_REQUIRE([gt_LOCALE_FR_UTF8]) - AC_REQUIRE([gt_LOCALE_JA]) - AC_REQUIRE([gt_LOCALE_ZH_CN]) - AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles - AC_CACHE_CHECK([whether mbsrtowcs works], - [gl_cv_func_mbsrtowcs_works], - [ - dnl Initial guess, used when cross-compiling or when no suitable locale - dnl is present. -changequote(,)dnl - case "$host_os" in - # Guess no on HP-UX, Solaris, mingw. - hpux* | solaris* | mingw*) gl_cv_func_mbsrtowcs_works="guessing no" ;; - # Guess yes otherwise. - *) gl_cv_func_mbsrtowcs_works="guessing yes" ;; - esac -changequote([,])dnl - if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then - AC_RUN_IFELSE( - [AC_LANG_SOURCE([[ -#include -#include -/* 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 main () -{ - int result = 0; - /* Test whether the function supports a NULL destination argument. - This fails on native Windows. */ - if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) - { - const char input[] = "\337er"; - const char *src = input; - mbstate_t state; - - memset (&state, '\0', sizeof (mbstate_t)); - if (mbsrtowcs (NULL, &src, 1, &state) != 3 - || src != input) - result |= 1; - } - /* Test whether the function works when started with a conversion state - in non-initial state. This fails on HP-UX 11.11 and Solaris 10. */ - if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) - { - const char input[] = "B\303\274\303\237er"; - 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 |= 2; - } - } - if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) - { - const char input[] = "<\306\374\313\334\270\354>"; - mbstate_t state; - - memset (&state, '\0', sizeof (mbstate_t)); - if (mbrtowc (NULL, input + 3, 1, &state) == (size_t)(-2)) - if (!mbsinit (&state)) - { - const char *src = input + 4; - if (mbsrtowcs (NULL, &src, 10, &state) != 3) - result |= 4; - } - } - if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) - { - 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; -}]])], - [gl_cv_func_mbsrtowcs_works=yes], - [gl_cv_func_mbsrtowcs_works=no], - [:]) - fi - ]) -]) - -# Prerequisites of lib/mbsrtowcs.c. -AC_DEFUN([gl_PREREQ_MBSRTOWCS], [ - : -]) diff -Nru datamash-1.7/m4/mbstate_t.m4 datamash-1.8/m4/mbstate_t.m4 --- datamash-1.7/m4/mbstate_t.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/mbstate_t.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# mbstate_t.m4 serial 13 -dnl Copyright (C) 2000-2002, 2008-2020 Free Software Foundation, Inc. +# mbstate_t.m4 serial 14 +dnl Copyright (C) 2000-2002, 2008-2021 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. @@ -20,14 +20,7 @@ [AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [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 ]], [[mbstate_t x; return sizeof x;]])], [ac_cv_type_mbstate_t=yes], [ac_cv_type_mbstate_t=no])]) diff -Nru datamash-1.7/m4/md5.m4 datamash-1.8/m4/md5.m4 --- datamash-1.7/m4/md5.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/md5.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # md5.m4 serial 14 -dnl Copyright (C) 2002-2006, 2008-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2008-2021 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.7/m4/memchr.m4 datamash-1.8/m4/memchr.m4 --- datamash-1.7/m4/memchr.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/memchr.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# memchr.m4 serial 15 -dnl Copyright (C) 2002-2004, 2009-2020 Free Software Foundation, Inc. +# memchr.m4 serial 17 +dnl Copyright (C) 2002-2004, 2009-2021 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. @@ -14,26 +14,17 @@ AC_CHECK_FUNCS_ONCE([mprotect]) AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) - m4_ifdef([gl_FUNC_MEMCHR_OBSOLETE], [ - dnl These days, we assume memchr is present. But if support for old - dnl platforms is desired: - AC_CHECK_FUNCS_ONCE([memchr]) - if test $ac_cv_func_memchr = no; then - HAVE_MEMCHR=0 - fi - ]) - if test $HAVE_MEMCHR = 1; then - # Detect platform-specific bugs in some versions of glibc: - # memchr should not dereference anything with length 0 - # https://bugzilla.redhat.com/show_bug.cgi?id=499689 - # memchr should not dereference overestimated length after a match - # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737 - # https://sourceware.org/bugzilla/show_bug.cgi?id=10162 - # memchr should cast the second argument to 'unsigned char'. - # This bug exists in Android 4.3. - # Assume that memchr works on platforms that lack mprotect. - AC_CACHE_CHECK([whether memchr works], [gl_cv_func_memchr_works], - [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ + # Detect platform-specific bugs in some versions of glibc: + # memchr should not dereference anything with length 0 + # https://bugzilla.redhat.com/show_bug.cgi?id=499689 + # memchr should not dereference overestimated length after a match + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737 + # https://sourceware.org/bugzilla/show_bug.cgi?id=10162 + # memchr should cast the second argument to 'unsigned char'. + # This bug exists in Android 4.3. + # Assume that memchr works on platforms that lack mprotect. + AC_CACHE_CHECK([whether memchr works], [gl_cv_func_memchr_works], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include #if HAVE_SYS_MMAN_H # include @@ -68,6 +59,7 @@ #endif if (fence) { + /* Test against bugs on glibc systems. */ if (memchr (fence, 0, 0)) result |= 1; strcpy (fence - 9, "12345678"); @@ -75,6 +67,9 @@ result |= 2; if (memchr (fence - 1, 0, 3) != fence - 1) result |= 4; + /* Test against bug on AIX 7.2. */ + if (memchr (fence - 4, '6', 16) != fence - 4) + result |= 8; } /* Test against bug on Android 4.3. */ { @@ -83,27 +78,26 @@ input[1] = 'b'; input[2] = 'c'; if (memchr (input, 0x789abc00 | 'b', 3) != input + 1) - result |= 8; + result |= 16; } return result; ]])], - [gl_cv_func_memchr_works=yes], - [gl_cv_func_memchr_works=no], - [case "$host_os" in - # Guess no on Android. - linux*-android*) gl_cv_func_memchr_works="guessing no" ;; - # Guess yes on native Windows. - mingw*) gl_cv_func_memchr_works="guessing yes" ;; - # If we don't know, obey --enable-cross-guesses. - *) gl_cv_func_memchr_works="$gl_cross_guess_normal" ;; - esac - ]) - ]) - case "$gl_cv_func_memchr_works" in - *yes) ;; - *) REPLACE_MEMCHR=1 ;; - esac - fi + [gl_cv_func_memchr_works=yes], + [gl_cv_func_memchr_works=no], + [case "$host_os" in + # Guess no on Android. + linux*-android*) gl_cv_func_memchr_works="guessing no" ;; + # Guess yes on native Windows. + mingw*) gl_cv_func_memchr_works="guessing yes" ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_memchr_works="$gl_cross_guess_normal" ;; + esac + ]) + ]) + case "$gl_cv_func_memchr_works" in + *yes) ;; + *) REPLACE_MEMCHR=1 ;; + esac ]) # Prerequisites of lib/memchr.c. diff -Nru datamash-1.7/m4/minmax.m4 datamash-1.8/m4/minmax.m4 --- datamash-1.7/m4/minmax.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/minmax.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # minmax.m4 serial 4 -dnl Copyright (C) 2005, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2009-2021 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.7/m4/mmap-anon.m4 datamash-1.8/m4/mmap-anon.m4 --- datamash-1.7/m4/mmap-anon.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/mmap-anon.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# mmap-anon.m4 serial 10 -dnl Copyright (C) 2005, 2007, 2009-2020 Free Software Foundation, Inc. +# mmap-anon.m4 serial 11 +dnl Copyright (C) 2005, 2007, 2009-2021 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. @@ -9,7 +9,7 @@ # - On Linux, AIX, OSF/1, Solaris, Cygwin, Interix, Haiku, both MAP_ANONYMOUS # and MAP_ANON exist and have the same value. # - On HP-UX, only MAP_ANONYMOUS exists. -# - On Mac OS X, FreeBSD, NetBSD, OpenBSD, only MAP_ANON exists. +# - On Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, only MAP_ANON exists. # - On IRIX, neither exists, and a file descriptor opened to /dev/zero must be # used. diff -Nru datamash-1.7/m4/mode_t.m4 datamash-1.8/m4/mode_t.m4 --- datamash-1.7/m4/mode_t.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/mode_t.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,26 @@ +# mode_t.m4 serial 2 +dnl Copyright (C) 2009-2021 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. + +# For using mode_t, it's sufficient to use AC_TYPE_MODE_T and +# include . + +# Define PROMOTED_MODE_T to the type that is the result of "default argument +# promotion" (ISO C 6.5.2.2.(6)) of the type mode_t. +AC_DEFUN([gl_PROMOTED_TYPE_MODE_T], +[ + AC_REQUIRE([AC_TYPE_MODE_T]) + AC_CACHE_CHECK([for promoted mode_t type], [gl_cv_promoted_mode_t], [ + dnl Assume mode_t promotes to 'int' if and only if it is smaller than 'int', + dnl and to itself otherwise. This assumption is not guaranteed by the ISO C + dnl standard, but we don't know of any real-world counterexamples. + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1];]])], + [gl_cv_promoted_mode_t='int'], + [gl_cv_promoted_mode_t='mode_t']) + ]) + AC_DEFINE_UNQUOTED([PROMOTED_MODE_T], [$gl_cv_promoted_mode_t], + [Define to the type that is the result of default argument promotions of type mode_t.]) +]) diff -Nru datamash-1.7/m4/modfl.m4 datamash-1.8/m4/modfl.m4 --- datamash-1.7/m4/modfl.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/modfl.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # modfl.m4 serial 8 -dnl Copyright (C) 2011-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2021 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.7/m4/modf.m4 datamash-1.8/m4/modf.m4 --- datamash-1.7/m4/modf.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/modf.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# modf.m4 serial 8 -dnl Copyright (C) 2011-2020 Free Software Foundation, Inc. +# modf.m4 serial 9 +dnl Copyright (C) 2011-2021 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. @@ -51,7 +51,7 @@ 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. */ + This test fails on FreeBSD 6.4, OpenBSD 6.7, 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; diff -Nru datamash-1.7/m4/msvc-inval.m4 datamash-1.8/m4/msvc-inval.m4 --- datamash-1.7/m4/msvc-inval.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/msvc-inval.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # msvc-inval.m4 serial 1 -dnl Copyright (C) 2011-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2021 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.7/m4/msvc-nothrow.m4 datamash-1.8/m4/msvc-nothrow.m4 --- datamash-1.7/m4/msvc-nothrow.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/msvc-nothrow.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # msvc-nothrow.m4 serial 1 -dnl Copyright (C) 2011-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2021 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.7/m4/multiarch.m4 datamash-1.8/m4/multiarch.m4 --- datamash-1.7/m4/multiarch.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/multiarch.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# multiarch.m4 serial 7 -dnl Copyright (C) 2008-2020 Free Software Foundation, Inc. +# multiarch.m4 serial 9 +dnl Copyright (C) 2008-2021 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,37 +21,40 @@ AC_DEFUN_ONCE([gl_MULTIARCH], [ dnl Code similar to autoconf-2.63 AC_C_BIGENDIAN. - gl_cv_c_multiarch=no - AC_COMPILE_IFELSE( - [AC_LANG_SOURCE( - [[#ifndef __APPLE_CC__ - not a universal capable compiler - #endif - typedef int dummy; - ]])], - [ - dnl Check for potential -arch flags. It is not universal unless - dnl there are at least two -arch flags with different values. - arch= - prev= - for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do - if test -n "$prev"; then - case $word in - i?86 | x86_64 | ppc | ppc64) - if test -z "$arch" || test "$arch" = "$word"; then - arch="$word" - else - gl_cv_c_multiarch=yes - fi - ;; - esac - prev= - else - if test "x$word" = "x-arch"; then - prev=arch - fi - fi - done + AC_CACHE_CHECK([whether the compiler produces multi-arch binaries], + [gl_cv_c_multiarch], + [gl_cv_c_multiarch=no + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + ]])], + [ + dnl Check for potential -arch flags. It is not universal unless + dnl there are at least two -arch flags with different values. + arch= + prev= + for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do + if test -n "$prev"; then + case $word in + i?86 | x86_64 | ppc | ppc64 | arm | arm64) + if test -z "$arch" || test "$arch" = "$word"; then + arch="$word" + else + gl_cv_c_multiarch=yes + fi + ;; + esac + prev= + else + if test "x$word" = "x-arch"; then + prev=arch + fi + fi + done + ]) ]) if test $gl_cv_c_multiarch = yes; then APPLE_UNIVERSAL_BUILD=1 diff -Nru datamash-1.7/m4/netinet_in_h.m4 datamash-1.8/m4/netinet_in_h.m4 --- datamash-1.7/m4/netinet_in_h.m4 2020-04-23 17:13:30.000000000 +0000 +++ datamash-1.8/m4/netinet_in_h.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # netinet_in_h.m4 serial 5 -dnl Copyright (C) 2006-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2021 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.7/m4/nls.m4 datamash-1.8/m4/nls.m4 --- datamash-1.7/m4/nls.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/nls.m4 2022-05-28 01:46:45.000000000 +0000 @@ -1,17 +1,17 @@ # nls.m4 serial 5 (gettext-0.18) -dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014, 2016, 2019-2020 Free -dnl Software Foundation, Inc. +dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014 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. dnl -dnl This file can be used in projects which are not available under +dnl This file can 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 is covered by the GNU General Public License. +dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: diff -Nru datamash-1.7/m4/nocrash.m4 datamash-1.8/m4/nocrash.m4 --- datamash-1.7/m4/nocrash.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/nocrash.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # nocrash.m4 serial 5 -dnl Copyright (C) 2005, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2009-2021 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.7/m4/non-recursive-gnulib-prefix-hack.m4 datamash-1.8/m4/non-recursive-gnulib-prefix-hack.m4 --- datamash-1.7/m4/non-recursive-gnulib-prefix-hack.m4 2020-04-23 04:03:37.000000000 +0000 +++ datamash-1.8/m4/non-recursive-gnulib-prefix-hack.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,4 +1,4 @@ -dnl Copyright (C) 2012-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2012-2021 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.7/m4/off_t.m4 datamash-1.8/m4/off_t.m4 --- datamash-1.7/m4/off_t.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/off_t.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # off_t.m4 serial 1 -dnl Copyright (C) 2012-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2012-2021 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.7/m4/open-cloexec.m4 datamash-1.8/m4/open-cloexec.m4 --- datamash-1.7/m4/open-cloexec.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/open-cloexec.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,21 @@ +# Test whether O_CLOEXEC is defined. + +dnl Copyright 2017-2021 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_PREPROC_O_CLOEXEC], +[ + AC_CACHE_CHECK([for O_CLOEXEC], + [gl_cv_macro_O_CLOEXEC], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include + #ifndef O_CLOEXEC + choke me; + #endif + ]], + [[return O_CLOEXEC;]])], + [gl_cv_macro_O_CLOEXEC=yes], + [gl_cv_macro_O_CLOEXEC=no])]) +]) diff -Nru datamash-1.7/m4/open.m4 datamash-1.8/m4/open.m4 --- datamash-1.7/m4/open.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/open.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,56 @@ +# open.m4 serial 15 +dnl Copyright (C) 2007-2021 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_OPEN], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([gl_PREPROC_O_CLOEXEC]) + case "$host_os" in + mingw* | pw*) + REPLACE_OPEN=1 + ;; + *) + dnl open("foo/") should not create a file when the file name has a + dnl trailing slash. FreeBSD only has the problem on symlinks. + AC_CHECK_FUNCS_ONCE([lstat]) + if test "$gl_cv_macro_O_CLOEXEC" != yes; then + REPLACE_OPEN=1 + fi + gl_OPEN_TRAILING_SLASH_BUG + case "$gl_cv_func_open_slash" in + *no) + REPLACE_OPEN=1 + ;; + esac + ;; + esac + dnl Replace open() for supporting the gnulib-defined fchdir() function, + dnl to keep fchdir's bookkeeping up-to-date. + m4_ifdef([gl_FUNC_FCHDIR], [ + if test $REPLACE_OPEN = 0; then + gl_TEST_FCHDIR + if test $HAVE_FCHDIR = 0; then + REPLACE_OPEN=1 + fi + fi + ]) + dnl Replace open() for supporting the gnulib-defined O_NONBLOCK flag. + m4_ifdef([gl_NONBLOCKING_IO], [ + if test $REPLACE_OPEN = 0; then + gl_NONBLOCKING_IO + if test $gl_cv_have_open_O_NONBLOCK != yes; then + REPLACE_OPEN=1 + fi + fi + ]) +]) + +# Prerequisites of lib/open.c. +AC_DEFUN([gl_PREREQ_OPEN], +[ + AC_REQUIRE([gl_PROMOTED_TYPE_MODE_T]) + : +]) diff -Nru datamash-1.7/m4/open-slash.m4 datamash-1.8/m4/open-slash.m4 --- datamash-1.7/m4/open-slash.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/open-slash.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,60 @@ +# open-slash.m4 serial 2 +dnl Copyright (C) 2007-2021 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 Tests whether open() and creat() recognize a trailing slash. +dnl Sets gl_cv_func_open_slash. +AC_DEFUN([gl_OPEN_TRAILING_SLASH_BUG], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + dnl open("foo/") should not create a file when the file name has a + dnl trailing slash. FreeBSD only has the problem on symlinks. + AC_CHECK_FUNCS_ONCE([lstat]) + AC_CACHE_CHECK([whether open recognizes a trailing slash], + [gl_cv_func_open_slash], + [# Assume that if we have lstat, we can also check symlinks. + if test $ac_cv_func_lstat = yes; then + touch conftest.tmp + ln -s conftest.tmp conftest.lnk + fi + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#if HAVE_UNISTD_H +# include +#endif +]GL_MDA_DEFINES[ +int main () +{ + int result = 0; +#if HAVE_LSTAT + if (open ("conftest.lnk/", O_RDONLY) != -1) + result |= 1; +#endif + if (open ("conftest.sl/", O_CREAT, 0600) >= 0) + result |= 2; + return result; +}]])], + [gl_cv_func_open_slash=yes], + [gl_cv_func_open_slash=no], + [ +changequote(,)dnl + case "$host_os" in + freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*) + gl_cv_func_open_slash="guessing no" ;; + *) + gl_cv_func_open_slash="guessing yes" ;; + esac +changequote([,])dnl + ]) + rm -f conftest.sl conftest.tmp conftest.lnk + ]) + case "$gl_cv_func_open_slash" in + *no) + AC_DEFINE([OPEN_TRAILING_SLASH_BUG], [1], + [Define to 1 if open() fails to recognize a trailing slash.]) + ;; + esac +]) diff -Nru datamash-1.7/m4/pathmax.m4 datamash-1.8/m4/pathmax.m4 --- datamash-1.7/m4/pathmax.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/pathmax.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # pathmax.m4 serial 11 -dnl Copyright (C) 2002-2003, 2005-2006, 2009-2020 Free Software Foundation, +dnl Copyright (C) 2002-2003, 2005-2006, 2009-2021 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.7/m4/pclose.m4 datamash-1.8/m4/pclose.m4 --- datamash-1.7/m4/pclose.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/pclose.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,20 @@ +# pclose.m4 serial 1 +dnl Copyright (C) 2011-2021 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_PCLOSE], +[ + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([pclose]) + if test $ac_cv_func_pclose = no; then + HAVE_PCLOSE=0 + fi +]) + +# Prerequisites of lib/pclose.c. +AC_DEFUN([gl_PREREQ_PCLOSE], +[ + : +]) diff -Nru datamash-1.7/m4/pid_t.m4 datamash-1.8/m4/pid_t.m4 --- datamash-1.7/m4/pid_t.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/pid_t.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,38 @@ +# pid_t.m4 serial 4 +dnl Copyright (C) 2020-2021 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. + +# The following implementation works around a problem in autoconf <= 2.69. +m4_version_prereq([2.70], [], [ + +dnl Define pid_t if the headers don't define it. +AC_DEFUN([AC_TYPE_PID_T], +[ + AC_CHECK_TYPE([pid_t], + [], + [dnl On 64-bit native Windows, define it to the equivalent of 'intptr_t' + dnl (= 'long long' = '__int64'), because that is the return type + dnl of the _spawnv* functions + dnl + dnl and the argument type of the _cwait function + dnl . + dnl Otherwise (on 32-bit Windows and on old Unix platforms), define it + dnl to 'int'. + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + #if defined _WIN64 && !defined __CYGWIN__ + LLP64 + #endif + ]]) + ], + [gl_pid_type='int'], + [gl_pid_type='__int64']) + AC_DEFINE_UNQUOTED([pid_t], [$gl_pid_type], + [Define as a signed integer type capable of holding a process identifier.]) + ], + [AC_INCLUDES_DEFAULT]) +]) + +])# m4_version_prereq 2.70 diff -Nru datamash-1.7/m4/po.m4 datamash-1.8/m4/po.m4 --- datamash-1.7/m4/po.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/po.m4 2022-05-28 01:46:45.000000000 +0000 @@ -1,16 +1,16 @@ -# po.m4 serial 30 (gettext-0.20) -dnl Copyright (C) 1995-2014, 2016, 2018-2020 Free Software Foundation, Inc. +# po.m4 serial 24 (gettext-0.19) +dnl Copyright (C) 1995-2014 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 be used in projects which are not available under +dnl This file can 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 is covered by the GNU General Public License. +dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: @@ -30,7 +30,7 @@ dnl Release version of the gettext macros. This is used to ensure that dnl the gettext macros and po/Makefile.in.in are in sync. - AC_SUBST([GETTEXT_MACRO_VERSION], [0.20]) + AC_SUBST([GETTEXT_MACRO_VERSION], [0.19]) dnl Perform the following tests also if --disable-nls has been given, dnl because they are needed for "make dist" to work. @@ -46,6 +46,13 @@ dnl Test whether it is GNU msgfmt >= 0.15. changequote(,)dnl + case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; + *) MSGFMT_015=$MSGFMT ;; + esac +changequote([,])dnl + AC_SUBST([MSGFMT_015]) +changequote(,)dnl case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; @@ -76,21 +83,11 @@ AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) - dnl Test whether it is GNU msgmerge >= 0.20. - if LC_ALL=C $MSGMERGE --help | grep ' --for-msgfmt ' >/dev/null; then - MSGMERGE_FOR_MSGFMT_OPTION='--for-msgfmt' - else - dnl Test whether it is GNU msgmerge >= 0.12. - if LC_ALL=C $MSGMERGE --help | grep ' --no-fuzzy-matching ' >/dev/null; then - MSGMERGE_FOR_MSGFMT_OPTION='--no-fuzzy-matching --no-location --quiet' - else - dnl With these old versions, $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) is - dnl slow. But this is not a big problem, as such old gettext versions are - dnl hardly in use any more. - MSGMERGE_FOR_MSGFMT_OPTION='--no-location --quiet' - fi - fi - AC_SUBST([MSGMERGE_FOR_MSGFMT_OPTION]) + dnl Installation directories. + dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we + dnl have to define it here, so that it can be used in po/Makefile. + test -n "$localedir" || localedir='${datadir}/locale' + AC_SUBST([localedir]) dnl Support for AM_XGETTEXT_OPTION. test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= @@ -133,11 +130,14 @@ if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi - ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` + ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` + # Hide the ALL_LINGUAS assignment from automake < 1.5. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. - ALL_LINGUAS=$OBSOLETE_ALL_LINGUAS + # Hide the ALL_LINGUAS assignment from automake < 1.5. + eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) @@ -208,8 +208,9 @@ esac done]], [# Capture the value of obsolete ALL_LINGUAS because we need it to compute - # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. - OBSOLETE_ALL_LINGUAS="$ALL_LINGUAS" + # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it + # from automake < 1.5. + eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" ]) @@ -310,13 +311,15 @@ fi if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then # The LINGUAS file contains the set of available languages. - ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` + ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS. sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'` - ALL_LINGUAS=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"` + ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"` fi + # Hide the ALL_LINGUAS assignment from automake < 1.5. + eval 'ALL_LINGUAS''=$ALL_LINGUAS_' # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) # Compute UPDATEPOFILES @@ -326,9 +329,9 @@ # Compute GMOFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) # Compute PROPERTIESFILES - # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).properties) + # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties) # Compute CLASSFILES - # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(DOMAIN)_$(lang).class) + # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class) # Compute QMFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm) # Compute MSGFILES @@ -353,8 +356,8 @@ UPDATEPOFILES="$UPDATEPOFILES $lang.po-update" DUMMYPOFILES="$DUMMYPOFILES $lang.nop" GMOFILES="$GMOFILES $srcdirpre$lang.gmo" - PROPERTIESFILES="$PROPERTIESFILES \$(srcdir)/\$(DOMAIN)_$lang.properties" - CLASSFILES="$CLASSFILES \$(srcdir)/\$(DOMAIN)_$lang.class" + PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties" + CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class" QMFILES="$QMFILES $srcdirpre$lang.qm" frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'` MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg" diff -Nru datamash-1.7/m4/popen.m4 datamash-1.8/m4/popen.m4 --- datamash-1.7/m4/popen.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/popen.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,54 @@ +# popen.m4 serial 6 +dnl Copyright (C) 2009-2021 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_POPEN], +[ + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CHECK_FUNCS_ONCE([popen]) + if test $ac_cv_func_popen = no; then + HAVE_POPEN=0 + else + AC_CACHE_CHECK([whether popen works with closed stdin], + [gl_cv_func_popen_works], + [ + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[int result = 0; + FILE *child; + fclose (stdin); + fclose (stdout); + child = popen ("echo a", "r"); + if (fgetc (child) != 'a') + result |= 1; + if (pclose (child) != 0) + result |= 2; + return result; + ]])], + [gl_cv_func_popen_works=yes], + [gl_cv_func_popen_works=no], + [case "$host_os" in + # For now, only cygwin 1.5 or older is known to be broken. + cygwin*) gl_cv_func_popen_works="guessing no" ;; + # Guess yes on native Windows. + mingw*) gl_cv_func_popen_works="guessing yes" ;; + *) gl_cv_func_popen_works="guessing yes" ;; + esac + ]) + ]) + case "$gl_cv_func_popen_works" in + *yes) ;; + *) REPLACE_POPEN=1 ;; + esac + fi +]) + +# Prerequisites of lib/popen.c. +AC_DEFUN([gl_PREREQ_POPEN], +[ + : +]) diff -Nru datamash-1.7/m4/printf.m4 datamash-1.8/m4/printf.m4 --- datamash-1.7/m4/printf.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/printf.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,1719 @@ +# printf.m4 serial 71 +dnl Copyright (C) 2003, 2007-2021 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 Test whether the *printf family of functions supports the 'j', 'z', 't', +dnl 'L' size specifiers. (ISO C99, POSIX:2001) +dnl Result is gl_cv_func_printf_sizes_c99. + +AC_DEFUN([gl_PRINTF_SIZES_C99], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gl_AC_HEADER_STDINT_H]) + AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports size specifiers as in C99], + [gl_cv_func_printf_sizes_c99], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +#include +#include +#if HAVE_STDINT_H_WITH_UINTMAX +# include +#endif +#if HAVE_INTTYPES_H_WITH_UINTMAX +# include +#endif +static char buf[100]; +int main () +{ + int result = 0; +#if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX + buf[0] = '\0'; + if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0 + || strcmp (buf, "12345671 33") != 0) + result |= 1; +#else + result |= 1; +#endif + buf[0] = '\0'; + if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0 + || strcmp (buf, "12345672 33") != 0) + result |= 2; + buf[0] = '\0'; + if (sprintf (buf, "%tu %d", (ptrdiff_t) 12345673, 33, 44, 55) < 0 + || strcmp (buf, "12345673 33") != 0) + result |= 4; + buf[0] = '\0'; + if (sprintf (buf, "%Lg %d", (long double) 1.5, 33, 44, 55) < 0 + || strcmp (buf, "1.5 33") != 0) + result |= 8; + return result; +}]])], + [gl_cv_func_printf_sizes_c99=yes], + [gl_cv_func_printf_sizes_c99=no], + [ + case "$host_os" in +changequote(,)dnl + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on musl systems. + *-musl*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_printf_sizes_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_printf_sizes_c99="guessing no";; + darwin*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on OpenBSD >= 3.9. + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) + gl_cv_func_printf_sizes_c99="guessing no";; + openbsd*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on Solaris >= 2.10. + solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";; + solaris*) gl_cv_func_printf_sizes_c99="guessing no";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_printf_sizes_c99="guessing no";; + netbsd*) gl_cv_func_printf_sizes_c99="guessing yes";; + # Guess yes on Android. + linux*-android*) gl_cv_func_printf_sizes_c99="guessing yes";; +changequote([,])dnl + # Guess yes on MSVC, no on mingw. + mingw*) AC_EGREP_CPP([Known], [ +#ifdef _MSC_VER + Known +#endif + ], + [gl_cv_func_printf_sizes_c99="guessing yes"], + [gl_cv_func_printf_sizes_c99="guessing no"]) + ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_printf_sizes_c99="$gl_cross_guess_normal";; + esac + ]) + ]) +]) + +dnl Test whether the *printf family of functions supports 'long double' +dnl arguments together with the 'L' size specifier. (ISO C99, POSIX:2001) +dnl Result is gl_cv_func_printf_long_double. + +AC_DEFUN([gl_PRINTF_LONG_DOUBLE], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports 'long double' arguments], + [gl_cv_func_printf_long_double], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +static char buf[10000]; +int main () +{ + int result = 0; + buf[0] = '\0'; + if (sprintf (buf, "%Lf %d", 1.75L, 33, 44, 55) < 0 + || strcmp (buf, "1.750000 33") != 0) + result |= 1; + buf[0] = '\0'; + if (sprintf (buf, "%Le %d", 1.75L, 33, 44, 55) < 0 + || strcmp (buf, "1.750000e+00 33") != 0) + result |= 2; + buf[0] = '\0'; + if (sprintf (buf, "%Lg %d", 1.75L, 33, 44, 55) < 0 + || strcmp (buf, "1.75 33") != 0) + result |= 4; + return result; +}]])], + [gl_cv_func_printf_long_double=yes], + [gl_cv_func_printf_long_double=no], + [case "$host_os" in + # Guess no on BeOS. + beos*) gl_cv_func_printf_long_double="guessing no";; + # Guess yes on Android. + linux*-android*) gl_cv_func_printf_long_double="guessing yes";; + # Guess yes on MSVC, no on mingw. + mingw*) AC_EGREP_CPP([Known], [ +#ifdef _MSC_VER + Known +#endif + ], + [gl_cv_func_printf_long_double="guessing yes"], + [gl_cv_func_printf_long_double="guessing no"]) + ;; + *) gl_cv_func_printf_long_double="guessing yes";; + esac + ]) + ]) +]) + +dnl Test whether the *printf family of functions supports infinite and NaN +dnl 'double' arguments and negative zero arguments in the %f, %e, %g +dnl directives. (ISO C99, POSIX:2001) +dnl Result is gl_cv_func_printf_infinite. + +AC_DEFUN([gl_PRINTF_INFINITE], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports infinite 'double' arguments], + [gl_cv_func_printf_infinite], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +static int +strisnan (const char *string, size_t start_index, size_t end_index) +{ + if (start_index < end_index) + { + if (string[start_index] == '-') + start_index++; + if (start_index + 3 <= end_index + && memcmp (string + start_index, "nan", 3) == 0) + { + start_index += 3; + if (start_index == end_index + || (string[start_index] == '(' && string[end_index - 1] == ')')) + return 1; + } + } + return 0; +} +static int +have_minus_zero () +{ + static double plus_zero = 0.0; + double minus_zero = - plus_zero; + return memcmp (&plus_zero, &minus_zero, sizeof (double)) != 0; +} +static char buf[10000]; +static double zero = 0.0; +int main () +{ + int result = 0; + if (sprintf (buf, "%f", 1.0 / zero) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + result |= 1; + if (sprintf (buf, "%f", -1.0 / zero) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + result |= 1; + if (sprintf (buf, "%f", zero / zero) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 2; + if (sprintf (buf, "%e", 1.0 / zero) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + result |= 4; + if (sprintf (buf, "%e", -1.0 / zero) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + result |= 4; + if (sprintf (buf, "%e", zero / zero) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 8; + if (sprintf (buf, "%g", 1.0 / zero) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + result |= 16; + if (sprintf (buf, "%g", -1.0 / zero) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + result |= 16; + if (sprintf (buf, "%g", zero / zero) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 32; + /* This test fails on HP-UX 10.20. */ + if (have_minus_zero ()) + if (sprintf (buf, "%g", - zero) < 0 + || strcmp (buf, "-0") != 0) + result |= 64; + return result; +}]])], + [gl_cv_func_printf_infinite=yes], + [gl_cv_func_printf_infinite=no], + [ + case "$host_os" in +changequote(,)dnl + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on musl systems. + *-musl*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on FreeBSD >= 6. + freebsd[1-5].*) gl_cv_func_printf_infinite="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_printf_infinite="guessing no";; + darwin*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on HP-UX >= 11. + hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";; + hpux*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_printf_infinite="guessing no";; + netbsd*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on OpenBSD >= 6.0. + openbsd[1-5].*) gl_cv_func_printf_infinite="guessing no";; + openbsd*) gl_cv_func_printf_infinite="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_printf_infinite="guessing yes";; + # Guess no on Android. + linux*-android*) gl_cv_func_printf_infinite="guessing no";; +changequote([,])dnl + # Guess yes on MSVC, no on mingw. + mingw*) AC_EGREP_CPP([Known], [ +#ifdef _MSC_VER + Known +#endif + ], + [gl_cv_func_printf_infinite="guessing yes"], + [gl_cv_func_printf_infinite="guessing no"]) + ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_printf_infinite="$gl_cross_guess_normal";; + esac + ]) + ]) +]) + +dnl Test whether the *printf family of functions supports infinite and NaN +dnl 'long double' arguments in the %f, %e, %g directives. (ISO C99, POSIX:2001) +dnl Result is gl_cv_func_printf_infinite_long_double. + +AC_DEFUN([gl_PRINTF_INFINITE_LONG_DOUBLE], +[ + AC_REQUIRE([gl_PRINTF_LONG_DOUBLE]) + 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 + dnl The user can set or unset the variable gl_printf_safe to indicate + dnl that he wishes a safe handling of non-IEEE-754 'long double' values. + if test -n "$gl_printf_safe"; then + AC_DEFINE([CHECK_PRINTF_SAFE], [1], + [Define if you wish *printf() functions that have a safe handling of + non-IEEE-754 'long double' values.]) + fi + case "$gl_cv_func_printf_long_double" in + *yes) + AC_CACHE_CHECK([whether printf supports infinite 'long double' arguments], + [gl_cv_func_printf_infinite_long_double], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +]GL_NOCRASH[ +#include +#include +#include +static int +strisnan (const char *string, size_t start_index, size_t end_index) +{ + if (start_index < end_index) + { + if (string[start_index] == '-') + start_index++; + if (start_index + 3 <= end_index + && memcmp (string + start_index, "nan", 3) == 0) + { + start_index += 3; + if (start_index == end_index + || (string[start_index] == '(' && string[end_index - 1] == ')')) + return 1; + } + } + return 0; +} +static char buf[10000]; +static long double zeroL = 0.0L; +int main () +{ + int result = 0; + nocrash_init(); + if (sprintf (buf, "%Lf", 1.0L / zeroL) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + result |= 1; + if (sprintf (buf, "%Lf", -1.0L / zeroL) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + result |= 1; + if (sprintf (buf, "%Lf", zeroL / zeroL) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 1; + if (sprintf (buf, "%Le", 1.0L / zeroL) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + result |= 1; + if (sprintf (buf, "%Le", -1.0L / zeroL) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + result |= 1; + if (sprintf (buf, "%Le", zeroL / zeroL) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 1; + if (sprintf (buf, "%Lg", 1.0L / zeroL) < 0 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0)) + result |= 1; + if (sprintf (buf, "%Lg", -1.0L / zeroL) < 0 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0)) + result |= 1; + if (sprintf (buf, "%Lg", zeroL / zeroL) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 1; +#if CHECK_PRINTF_SAFE && ((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 union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 2; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 2; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 2; + } + { + /* Signalling NaN. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 2; + if (sprintf (buf, "%Le", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 2; + if (sprintf (buf, "%Lg", x.value) < 0 + || !strisnan (buf, 0, strlen (buf))) + result |= 2; + } + { /* Pseudo-NaN. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) <= 0) + result |= 4; + if (sprintf (buf, "%Le", x.value) <= 0) + result |= 4; + if (sprintf (buf, "%Lg", x.value) <= 0) + result |= 4; + } + { /* Pseudo-Infinity. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) <= 0) + result |= 8; + if (sprintf (buf, "%Le", x.value) <= 0) + result |= 8; + if (sprintf (buf, "%Lg", x.value) <= 0) + result |= 8; + } + { /* Pseudo-Zero. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) <= 0) + result |= 16; + if (sprintf (buf, "%Le", x.value) <= 0) + result |= 16; + if (sprintf (buf, "%Lg", x.value) <= 0) + result |= 16; + } + { /* Unnormalized number. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) <= 0) + result |= 32; + if (sprintf (buf, "%Le", x.value) <= 0) + result |= 32; + if (sprintf (buf, "%Lg", x.value) <= 0) + result |= 32; + } + { /* Pseudo-Denormal. */ + static union { unsigned int word[4]; long double value; } x = + { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) }; + if (sprintf (buf, "%Lf", x.value) <= 0) + result |= 64; + if (sprintf (buf, "%Le", x.value) <= 0) + result |= 64; + if (sprintf (buf, "%Lg", x.value) <= 0) + result |= 64; + } +#endif + return result; +}]])], + [gl_cv_func_printf_infinite_long_double=yes], + [gl_cv_func_printf_infinite_long_double=no], + [case "$host_cpu" in + # Guess no on ia64, x86_64, i386. + ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";; + *) + case "$host_os" in +changequote(,)dnl + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # Guess yes on musl systems. + *-musl*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # Guess yes on FreeBSD >= 6. + freebsd[1-5].*) gl_cv_func_printf_infinite_long_double="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # Guess yes on HP-UX >= 11. + hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";; + hpux*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # Guess yes on OpenBSD >= 6.0. + openbsd[1-5].*) gl_cv_func_printf_infinite_long_double="guessing no";; + openbsd*) gl_cv_func_printf_infinite_long_double="guessing yes";; + # Guess no on Android. + linux*-android*) gl_cv_func_printf_infinite_long_double="guessing no";; +changequote([,])dnl + # Guess yes on MSVC, no on mingw. + mingw*) AC_EGREP_CPP([Known], [ +#ifdef _MSC_VER + Known +#endif + ], + [gl_cv_func_printf_infinite_long_double="guessing yes"], + [gl_cv_func_printf_infinite_long_double="guessing no"]) + ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_printf_infinite_long_double="$gl_cross_guess_normal";; + esac + ;; + esac + ]) + ]) + ;; + *) + gl_cv_func_printf_infinite_long_double="irrelevant" + ;; + esac +]) + +dnl Test whether the *printf family of functions supports the 'a' and 'A' +dnl conversion specifier for hexadecimal output of floating-point numbers. +dnl (ISO C99, POSIX:2001) +dnl Result is gl_cv_func_printf_directive_a. + +AC_DEFUN([gl_PRINTF_DIRECTIVE_A], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports the 'a' and 'A' directives], + [gl_cv_func_printf_directive_a], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +static char buf[100]; +static double zero = 0.0; +int main () +{ + int result = 0; + if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0 + || (strcmp (buf, "0x1.922p+1 33") != 0 + && strcmp (buf, "0x3.244p+0 33") != 0 + && strcmp (buf, "0x6.488p-1 33") != 0 + && strcmp (buf, "0xc.91p-2 33") != 0)) + result |= 1; + if (sprintf (buf, "%A %d", -3.1416015625, 33, 44, 55) < 0 + || (strcmp (buf, "-0X1.922P+1 33") != 0 + && strcmp (buf, "-0X3.244P+0 33") != 0 + && strcmp (buf, "-0X6.488P-1 33") != 0 + && strcmp (buf, "-0XC.91P-2 33") != 0)) + result |= 2; + /* This catches a FreeBSD 6.1 bug: it doesn't round. */ + if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0 + || (strcmp (buf, "0x1.83p+0 33") != 0 + && strcmp (buf, "0x3.05p-1 33") != 0 + && strcmp (buf, "0x6.0ap-2 33") != 0 + && strcmp (buf, "0xc.14p-3 33") != 0)) + result |= 4; + /* This catches a Mac OS X 10.12.4 (Darwin 16.5) bug: it doesn't round. */ + if (sprintf (buf, "%.0a %d", 1.51, 33, 44, 55) < 0 + || (strcmp (buf, "0x2p+0 33") != 0 + && strcmp (buf, "0x3p-1 33") != 0 + && strcmp (buf, "0x6p-2 33") != 0 + && strcmp (buf, "0xcp-3 33") != 0)) + result |= 4; + /* This catches a FreeBSD 6.1 bug. See + */ + if (sprintf (buf, "%010a %d", 1.0 / zero, 33, 44, 55) < 0 + || buf[0] == '0') + result |= 8; + /* This catches a Mac OS X 10.3.9 (Darwin 7.9) bug. */ + if (sprintf (buf, "%.1a", 1.999) < 0 + || (strcmp (buf, "0x1.0p+1") != 0 + && strcmp (buf, "0x2.0p+0") != 0 + && strcmp (buf, "0x4.0p-1") != 0 + && strcmp (buf, "0x8.0p-2") != 0)) + result |= 16; + /* This catches the same Mac OS X 10.3.9 (Darwin 7.9) bug and also a + glibc 2.4 bug . */ + if (sprintf (buf, "%.1La", 1.999L) < 0 + || (strcmp (buf, "0x1.0p+1") != 0 + && strcmp (buf, "0x2.0p+0") != 0 + && strcmp (buf, "0x4.0p-1") != 0 + && strcmp (buf, "0x8.0p-2") != 0)) + result |= 32; + return result; +}]])], + [gl_cv_func_printf_directive_a=yes], + [gl_cv_func_printf_directive_a=no], + [ + case "$host_os" in + # Guess yes on glibc >= 2.5 systems. + *-gnu* | gnu*) + AC_EGREP_CPP([BZ2908], [ + #include + #ifdef __GNU_LIBRARY__ + #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)) && !defined __UCLIBC__ + BZ2908 + #endif + #endif + ], + [gl_cv_func_printf_directive_a="guessing yes"], + [gl_cv_func_printf_directive_a="guessing no"]) + ;; + # Guess yes on musl systems. + *-musl*) gl_cv_func_printf_directive_a="guessing yes";; + # Guess no on Android. + linux*-android*) gl_cv_func_printf_directive_a="guessing no";; + # Guess no on native Windows. + mingw*) gl_cv_func_printf_directive_a="guessing no";; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_printf_directive_a="$gl_cross_guess_normal";; + esac + ]) + ]) +]) + +dnl Test whether the *printf family of functions supports the %F format +dnl directive. (ISO C99, POSIX:2001) +dnl Result is gl_cv_func_printf_directive_f. + +AC_DEFUN([gl_PRINTF_DIRECTIVE_F], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports the 'F' directive], + [gl_cv_func_printf_directive_f], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +static char buf[100]; +static double zero = 0.0; +int main () +{ + int result = 0; + if (sprintf (buf, "%F %d", 1234567.0, 33, 44, 55) < 0 + || strcmp (buf, "1234567.000000 33") != 0) + result |= 1; + if (sprintf (buf, "%F", 1.0 / zero) < 0 + || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0)) + result |= 2; + /* This catches a Cygwin 1.5.x bug. */ + if (sprintf (buf, "%.F", 1234.0) < 0 + || strcmp (buf, "1234") != 0) + result |= 4; + return result; +}]])], + [gl_cv_func_printf_directive_f=yes], + [gl_cv_func_printf_directive_f=no], + [ + case "$host_os" in +changequote(,)dnl + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_printf_directive_f="guessing yes";; + # Guess yes on musl systems. + *-musl*) gl_cv_func_printf_directive_f="guessing yes";; + # Guess yes on FreeBSD >= 6. + freebsd[1-5].*) gl_cv_func_printf_directive_f="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_printf_directive_f="guessing no";; + darwin*) gl_cv_func_printf_directive_f="guessing yes";; + # Guess yes on OpenBSD >= 6.0. + openbsd[1-5].*) gl_cv_func_printf_directive_f="guessing no";; + openbsd*) gl_cv_func_printf_directive_f="guessing yes";; + # Guess yes on Solaris >= 2.10. + solaris2.[1-9][0-9]*) gl_cv_func_printf_directive_f="guessing yes";; + solaris*) gl_cv_func_printf_directive_f="guessing no";; + # Guess no on Android. + linux*-android*) gl_cv_func_printf_directive_f="guessing no";; +changequote([,])dnl + # Guess yes on MSVC, no on mingw. + mingw*) AC_EGREP_CPP([Known], [ +#ifdef _MSC_VER + Known +#endif + ], + [gl_cv_func_printf_directive_f="guessing yes"], + [gl_cv_func_printf_directive_f="guessing no"]) + ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_printf_directive_f="$gl_cross_guess_normal";; + esac + ]) + ]) +]) + +dnl Test whether the *printf family of functions supports the %n format +dnl directive. (ISO C99, POSIX:2001) +dnl Result is gl_cv_func_printf_directive_n. + +AC_DEFUN([gl_PRINTF_DIRECTIVE_N], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports the 'n' directive], + [gl_cv_func_printf_directive_n], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +#include +#ifdef _MSC_VER +#include +/* See page about "Parameter Validation" on msdn.microsoft.com. + + */ +static void cdecl +invalid_parameter_handler (const wchar_t *expression, + const wchar_t *function, + const wchar_t *file, unsigned int line, + uintptr_t dummy) +{ + exit (1); +} +#endif +static char fmtstring[10]; +static char buf[100]; +int main () +{ + int count = -1; +#ifdef _MSC_VER + _set_invalid_parameter_handler (invalid_parameter_handler); +#endif + /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2) + support %n in format strings in read-only memory but not in writable + memory. */ + strcpy (fmtstring, "%d %n"); + if (sprintf (buf, fmtstring, 123, &count, 33, 44, 55) < 0 + || strcmp (buf, "123 ") != 0 + || count != 4) + return 1; + return 0; +}]])], + [gl_cv_func_printf_directive_n=yes], + [gl_cv_func_printf_directive_n=no], + [case "$host_os" in + # Guess no on glibc when _FORTIFY_SOURCE >= 2. + *-gnu* | gnu*) AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if _FORTIFY_SOURCE >= 2 + error fail + #endif + ]])], + [gl_cv_func_printf_directive_n="guessing yes"], + [gl_cv_func_printf_directive_n="guessing no"]) + ;; + # Guess no on Android. + linux*-android*) gl_cv_func_printf_directive_n="guessing no";; + # Guess no on native Windows. + mingw*) gl_cv_func_printf_directive_n="guessing no";; + *) gl_cv_func_printf_directive_n="guessing yes";; + esac + ]) + ]) +]) + +dnl Test whether the *printf family of functions supports the %ls format +dnl directive and in particular, when a precision is specified, whether +dnl the functions stop converting the wide string argument when the number +dnl of bytes that have been produced by this conversion equals or exceeds +dnl the precision. +dnl Result is gl_cv_func_printf_directive_ls. + +AC_DEFUN([gl_PRINTF_DIRECTIVE_LS], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports the 'ls' directive], + [gl_cv_func_printf_directive_ls], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +#include +int main () +{ + int result = 0; + char buf[100]; + /* Test whether %ls works at all. + This test fails on OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, but not on + Cygwin 1.5. */ + { + static const wchar_t wstring[] = { 'a', 'b', 'c', 0 }; + buf[0] = '\0'; + if (sprintf (buf, "%ls", wstring) < 0 + || strcmp (buf, "abc") != 0) + result |= 1; + } + /* This test fails on IRIX 6.5, Solaris 2.6, Cygwin 1.5, Haiku (with an + assertion failure inside libc), but not on OpenBSD 4.0. */ + { + static const wchar_t wstring[] = { 'a', 0 }; + buf[0] = '\0'; + if (sprintf (buf, "%ls", wstring) < 0 + || strcmp (buf, "a") != 0) + result |= 2; + } + /* Test whether precisions in %ls are supported as specified in ISO C 99 + section 7.19.6.1: + "If a precision is specified, no more than that many bytes are written + (including shift sequences, if any), and the array shall contain a + null wide character if, to equal the multibyte character sequence + length given by the precision, the function would need to access a + wide character one past the end of the array." + This test fails on Solaris 10. */ + { + static const wchar_t wstring[] = { 'a', 'b', (wchar_t) 0xfdfdfdfd, 0 }; + buf[0] = '\0'; + if (sprintf (buf, "%.2ls", wstring) < 0 + || strcmp (buf, "ab") != 0) + result |= 8; + } + return result; +}]])], + [gl_cv_func_printf_directive_ls=yes], + [gl_cv_func_printf_directive_ls=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on OpenBSD >= 6.0. + openbsd[1-5].*) gl_cv_func_printf_directive_ls="guessing no";; + openbsd*) gl_cv_func_printf_directive_ls="guessing yes";; + irix*) gl_cv_func_printf_directive_ls="guessing no";; + solaris*) gl_cv_func_printf_directive_ls="guessing no";; + cygwin*) gl_cv_func_printf_directive_ls="guessing no";; + beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";; + # Guess no on Android. + linux*-android*) gl_cv_func_printf_directive_ls="guessing no";; + # Guess yes on native Windows. + mingw*) gl_cv_func_printf_directive_ls="guessing yes";; + *) gl_cv_func_printf_directive_ls="guessing yes";; + esac +changequote([,])dnl + ]) + ]) +]) + +dnl Test whether the *printf family of functions supports POSIX/XSI format +dnl strings with positions. (POSIX:2001) +dnl Result is gl_cv_func_printf_positions. + +AC_DEFUN([gl_PRINTF_POSITIONS], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports POSIX/XSI format strings with positions], + [gl_cv_func_printf_positions], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +/* The string "%2$d %1$d", with dollar characters protected from the shell's + dollar expansion (possibly an autoconf bug). */ +static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; +static char buf[100]; +int main () +{ + sprintf (buf, format, 33, 55); + return (strcmp (buf, "55 33") != 0); +}]])], + [gl_cv_func_printf_positions=yes], + [gl_cv_func_printf_positions=no], + [ +changequote(,)dnl + case "$host_os" in + netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*) + gl_cv_func_printf_positions="guessing no";; + beos*) gl_cv_func_printf_positions="guessing no";; + # Guess yes on Android. + linux*-android*) gl_cv_func_printf_positions="guessing yes";; + # Guess no on native Windows. + mingw* | pw*) gl_cv_func_printf_positions="guessing no";; + *) gl_cv_func_printf_positions="guessing yes";; + esac +changequote([,])dnl + ]) + ]) +]) + +dnl Test whether the *printf family of functions supports POSIX/XSI format +dnl strings with the ' flag for grouping of decimal digits. (POSIX:2001) +dnl Result is gl_cv_func_printf_flag_grouping. + +AC_DEFUN([gl_PRINTF_FLAG_GROUPING], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports the grouping flag], + [gl_cv_func_printf_flag_grouping], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +static char buf[100]; +int main () +{ + if (sprintf (buf, "%'d %d", 1234567, 99) < 0 + || buf[strlen (buf) - 1] != '9') + return 1; + return 0; +}]])], + [gl_cv_func_printf_flag_grouping=yes], + [gl_cv_func_printf_flag_grouping=no], + [ +changequote(,)dnl + case "$host_os" in + cygwin*) gl_cv_func_printf_flag_grouping="guessing no";; + netbsd*) gl_cv_func_printf_flag_grouping="guessing no";; + # Guess no on Android. + linux*-android*) gl_cv_func_printf_flag_grouping="guessing no";; + # Guess no on native Windows. + mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";; + *) gl_cv_func_printf_flag_grouping="guessing yes";; + esac +changequote([,])dnl + ]) + ]) +]) + +dnl Test whether the *printf family of functions supports the - flag correctly. +dnl (ISO C99.) See +dnl +dnl Result is gl_cv_func_printf_flag_leftadjust. + +AC_DEFUN([gl_PRINTF_FLAG_LEFTADJUST], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports the left-adjust flag correctly], + [gl_cv_func_printf_flag_leftadjust], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +static char buf[100]; +int main () +{ + /* Check that a '-' flag is not annihilated by a negative width. */ + if (sprintf (buf, "a%-*sc", -3, "b") < 0 + || strcmp (buf, "ab c") != 0) + return 1; + return 0; +}]])], + [gl_cv_func_printf_flag_leftadjust=yes], + [gl_cv_func_printf_flag_leftadjust=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on HP-UX 11. + hpux11*) gl_cv_func_printf_flag_leftadjust="guessing yes";; + # Guess no on HP-UX 10 and older. + hpux*) gl_cv_func_printf_flag_leftadjust="guessing no";; + # Guess yes on Android. + linux*-android*) gl_cv_func_printf_flag_leftadjust="guessing yes";; + # Guess yes on native Windows. + mingw*) gl_cv_func_printf_flag_leftadjust="guessing yes";; + # Guess yes otherwise. + *) gl_cv_func_printf_flag_leftadjust="guessing yes";; + esac +changequote([,])dnl + ]) + ]) +]) + +dnl Test whether the *printf family of functions supports padding of non-finite +dnl values with the 0 flag correctly. (ISO C99 + TC1 + TC2.) See +dnl +dnl Result is gl_cv_func_printf_flag_zero. + +AC_DEFUN([gl_PRINTF_FLAG_ZERO], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports the zero flag correctly], + [gl_cv_func_printf_flag_zero], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +static char buf[100]; +static double zero = 0.0; +int main () +{ + if (sprintf (buf, "%010f", 1.0 / zero, 33, 44, 55) < 0 + || (strcmp (buf, " inf") != 0 + && strcmp (buf, " infinity") != 0)) + return 1; + return 0; +}]])], + [gl_cv_func_printf_flag_zero=yes], + [gl_cv_func_printf_flag_zero=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_printf_flag_zero="guessing yes";; + # Guess yes on musl systems. + *-musl*) gl_cv_func_printf_flag_zero="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_printf_flag_zero="guessing yes";; + # Guess no on Android. + linux*-android*) gl_cv_func_printf_flag_zero="guessing no";; + # Guess no on native Windows. + mingw*) gl_cv_func_printf_flag_zero="guessing no";; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_printf_flag_zero="$gl_cross_guess_normal";; + esac +changequote([,])dnl + ]) + ]) +]) + +dnl Test whether the *printf family of functions supports large precisions. +dnl On mingw, precisions larger than 512 are treated like 512, in integer, +dnl floating-point or pointer output. On Solaris 10/x86, precisions larger +dnl than 510 in floating-point output crash the program. On Solaris 10/SPARC, +dnl precisions larger than 510 in floating-point output yield wrong results. +dnl On AIX 7.1, precisions larger than 998 in floating-point output yield +dnl wrong results. On BeOS, precisions larger than 1044 crash the program. +dnl Result is gl_cv_func_printf_precision. + +AC_DEFUN([gl_PRINTF_PRECISION], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports large precisions], + [gl_cv_func_printf_precision], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +static char buf[5000]; +int main () +{ + int result = 0; +#ifdef __BEOS__ + /* On BeOS, this would crash and show a dialog box. Avoid the crash. */ + return 1; +#endif + if (sprintf (buf, "%.4000d %d", 1, 33, 44) < 4000 + 3) + result |= 1; + if (sprintf (buf, "%.4000f %d", 1.0, 33, 44) < 4000 + 5) + result |= 2; + if (sprintf (buf, "%.511f %d", 1.0, 33, 44) < 511 + 5 + || buf[0] != '1') + result |= 4; + if (sprintf (buf, "%.999f %d", 1.0, 33, 44) < 999 + 5 + || buf[0] != '1') + result |= 4; + return result; +}]])], + [gl_cv_func_printf_precision=yes], + [gl_cv_func_printf_precision=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess no only on Solaris, native Windows, and BeOS systems. + solaris*) gl_cv_func_printf_precision="guessing no" ;; + mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;; + beos*) gl_cv_func_printf_precision="guessing no" ;; + # Guess yes on Android. + linux*-android*) gl_cv_func_printf_precision="guessing yes" ;; + *) gl_cv_func_printf_precision="guessing yes" ;; + esac +changequote([,])dnl + ]) + ]) +]) + +dnl Test whether the *printf family of functions recovers gracefully in case +dnl of an out-of-memory condition, or whether it crashes the entire program. +dnl Result is gl_cv_func_printf_enomem. + +AC_DEFUN([gl_PRINTF_ENOMEM], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([gl_MULTIARCH]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf survives out-of-memory conditions], + [gl_cv_func_printf_enomem], + [ + gl_cv_func_printf_enomem="guessing no" + if test "$cross_compiling" = no; then + if test $APPLE_UNIVERSAL_BUILD = 0; then + AC_LANG_CONFTEST([AC_LANG_SOURCE([[ +]GL_NOCRASH[ +#include +#include +#include +#include +#include +int main() +{ + struct rlimit limit; + int ret; + nocrash_init (); + /* Some printf implementations allocate temporary space with malloc. */ + /* On BSD systems, malloc() is limited by RLIMIT_DATA. */ +#ifdef RLIMIT_DATA + if (getrlimit (RLIMIT_DATA, &limit) < 0) + return 77; + if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000) + limit.rlim_max = 5000000; + limit.rlim_cur = limit.rlim_max; + if (setrlimit (RLIMIT_DATA, &limit) < 0) + return 77; +#endif + /* On Linux systems, malloc() is limited by RLIMIT_AS. */ +#ifdef RLIMIT_AS + if (getrlimit (RLIMIT_AS, &limit) < 0) + return 77; + if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000) + limit.rlim_max = 5000000; + limit.rlim_cur = limit.rlim_max; + if (setrlimit (RLIMIT_AS, &limit) < 0) + return 77; +#endif + /* Some printf implementations allocate temporary space on the stack. */ +#ifdef RLIMIT_STACK + if (getrlimit (RLIMIT_STACK, &limit) < 0) + return 77; + if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000) + limit.rlim_max = 5000000; + limit.rlim_cur = limit.rlim_max; + if (setrlimit (RLIMIT_STACK, &limit) < 0) + return 77; +#endif + ret = printf ("%.5000000f", 1.0); + return !(ret == 5000002 || (ret < 0 && errno == ENOMEM)); +} + ]])]) + if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then + (./conftest 2>&AS_MESSAGE_LOG_FD + result=$? + _AS_ECHO_LOG([\$? = $result]) + if test $result != 0 && test $result != 77; then result=1; fi + exit $result + ) >/dev/null 2>/dev/null + case $? in + 0) gl_cv_func_printf_enomem="yes" ;; + 77) gl_cv_func_printf_enomem="guessing no" ;; + *) gl_cv_func_printf_enomem="no" ;; + esac + else + gl_cv_func_printf_enomem="guessing no" + fi + rm -fr conftest* + else + dnl A universal build on Apple Mac OS X platforms. + dnl The result would be 'no' in 32-bit mode and 'yes' in 64-bit mode. + dnl But we need a configuration result that is valid in both modes. + gl_cv_func_printf_enomem="guessing no" + fi + fi + if test "$gl_cv_func_printf_enomem" = "guessing no"; then +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on Solaris. + solaris*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on AIX. + aix*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on HP-UX/hppa. + hpux*) case "$host_cpu" in + hppa*) gl_cv_func_printf_enomem="guessing yes";; + *) gl_cv_func_printf_enomem="guessing no";; + esac + ;; + # Guess yes on IRIX. + irix*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on OSF/1. + osf*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_printf_enomem="guessing yes";; + # Guess yes on Haiku. + haiku*) gl_cv_func_printf_enomem="guessing yes";; + # Guess no on Android. + linux*-android*) gl_cv_func_printf_enomem="guessing no";; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_printf_enomem="$gl_cross_guess_normal";; + esac +changequote([,])dnl + fi + ]) +]) + +dnl Test whether the snprintf function exists. (ISO C99, POSIX:2001) +dnl Result is ac_cv_func_snprintf. + +AC_DEFUN([gl_SNPRINTF_PRESENCE], +[ + AC_CHECK_FUNCS_ONCE([snprintf]) +]) + +dnl Test whether the string produced by the snprintf function is always NUL +dnl terminated. (ISO C99, POSIX:2001) +dnl Result is gl_cv_func_snprintf_truncation_c99. + +AC_DEFUN_ONCE([gl_SNPRINTF_TRUNCATION_C99], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([gl_SNPRINTF_PRESENCE]) + AC_CACHE_CHECK([whether snprintf truncates the result as in C99], + [gl_cv_func_snprintf_truncation_c99], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +static char buf[100]; +int main () +{ + strcpy (buf, "ABCDEF"); + my_snprintf (buf, 3, "%d %d", 4567, 89); + if (memcmp (buf, "45\0DEF", 6) != 0) + return 1; + return 0; +}]])], + [gl_cv_func_snprintf_truncation_c99=yes], + [gl_cv_func_snprintf_truncation_c99=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on musl systems. + *-musl*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_snprintf_truncation_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_snprintf_truncation_c99="guessing no";; + darwin*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on OpenBSD >= 3.9. + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) + gl_cv_func_snprintf_truncation_c99="guessing no";; + openbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on Solaris >= 2.6. + solaris2.[0-5] | solaris2.[0-5].*) + gl_cv_func_snprintf_truncation_c99="guessing no";; + solaris*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_snprintf_truncation_c99="guessing no";; + aix*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on HP-UX >= 11. + hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";; + hpux*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on IRIX >= 6.5. + irix6.5) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on OSF/1 >= 5. + osf[3-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";; + osf*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_snprintf_truncation_c99="guessing no";; + netbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess yes on Android. + linux*-android*) gl_cv_func_snprintf_truncation_c99="guessing yes";; + # Guess no on native Windows. + mingw*) gl_cv_func_snprintf_truncation_c99="guessing no";; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_snprintf_truncation_c99="$gl_cross_guess_normal";; + esac +changequote([,])dnl + ]) + ]) +]) + +dnl Test whether the return value of the snprintf function is the number +dnl of bytes (excluding the terminating NUL) that would have been produced +dnl if the buffer had been large enough. (ISO C99, POSIX:2001) +dnl For example, this test program fails on IRIX 6.5: +dnl --------------------------------------------------------------------- +dnl #include +dnl int main() +dnl { +dnl static char buf[8]; +dnl int retval = snprintf (buf, 3, "%d", 12345); +dnl return retval >= 0 && retval < 3; +dnl } +dnl --------------------------------------------------------------------- +dnl Result is gl_cv_func_snprintf_retval_c99. + +AC_DEFUN_ONCE([gl_SNPRINTF_RETVAL_C99], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([gl_SNPRINTF_PRESENCE]) + AC_CACHE_CHECK([whether snprintf returns a byte count as in C99], + [gl_cv_func_snprintf_retval_c99], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +static char buf[100]; +int main () +{ + strcpy (buf, "ABCDEF"); + if (my_snprintf (buf, 3, "%d %d", 4567, 89) != 7) + return 1; + if (my_snprintf (buf, 0, "%d %d", 4567, 89) != 7) + return 2; + if (my_snprintf (NULL, 0, "%d %d", 4567, 89) != 7) + return 3; + return 0; +}]])], + [gl_cv_func_snprintf_retval_c99=yes], + [gl_cv_func_snprintf_retval_c99=no], + [case "$host_os" in +changequote(,)dnl + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on musl systems. + *-musl*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_snprintf_retval_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";; + darwin*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on OpenBSD >= 3.9. + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*) + gl_cv_func_snprintf_retval_c99="guessing no";; + openbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on Solaris >= 2.10. + solaris2.[1-9][0-9]*) gl_cv_func_printf_sizes_c99="guessing yes";; + solaris*) gl_cv_func_printf_sizes_c99="guessing no";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_snprintf_retval_c99="guessing no";; + aix*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_snprintf_retval_c99="guessing no";; + netbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_snprintf_retval_c99="guessing yes";; + # Guess yes on Android. + linux*-android*) gl_cv_func_snprintf_retval_c99="guessing yes";; +changequote([,])dnl + # Guess yes on MSVC, no on mingw. + mingw*) AC_EGREP_CPP([Known], [ +#ifdef _MSC_VER + Known +#endif + ], + [gl_cv_func_snprintf_retval_c99="guessing yes"], + [gl_cv_func_snprintf_retval_c99="guessing no"]) + ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_snprintf_retval_c99="$gl_cross_guess_normal";; + esac + ]) + ]) +]) + +dnl Test whether the snprintf function supports the %n format directive +dnl also in truncated portions of the format string. (ISO C99, POSIX:2001) +dnl Result is gl_cv_func_snprintf_directive_n. + +AC_DEFUN([gl_SNPRINTF_DIRECTIVE_N], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([gl_SNPRINTF_PRESENCE]) + AC_CACHE_CHECK([whether snprintf fully supports the 'n' directive], + [gl_cv_func_snprintf_directive_n], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +static char fmtstring[10]; +static char buf[100]; +int main () +{ + int count = -1; + /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2) + support %n in format strings in read-only memory but not in writable + memory. */ + strcpy (fmtstring, "%d %n"); + my_snprintf (buf, 4, fmtstring, 12345, &count, 33, 44, 55); + if (count != 6) + return 1; + return 0; +}]])], + [gl_cv_func_snprintf_directive_n=yes], + [gl_cv_func_snprintf_directive_n=no], + [ + case "$host_os" in + # Guess no on glibc when _FORTIFY_SOURCE >= 2. + *-gnu* | gnu*) AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if _FORTIFY_SOURCE >= 2 + error fail + #endif + ]])], + [gl_cv_func_snprintf_directive_n="guessing yes"], + [gl_cv_func_snprintf_directive_n="guessing no"]) + ;; +changequote(,)dnl + # Guess yes on musl systems. + *-musl*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_snprintf_directive_n="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_snprintf_directive_n="guessing no";; + darwin*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on Solaris >= 2.6. + solaris2.[0-5] | solaris2.[0-5].*) + gl_cv_func_snprintf_directive_n="guessing no";; + solaris*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_snprintf_directive_n="guessing no";; + aix*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on IRIX >= 6.5. + irix6.5) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on OSF/1 >= 5. + osf[3-4]*) gl_cv_func_snprintf_directive_n="guessing no";; + osf*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_snprintf_directive_n="guessing no";; + netbsd*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_snprintf_directive_n="guessing yes";; + # Guess no on Android. + linux*-android*) gl_cv_func_snprintf_directive_n="guessing no";; + # Guess no on native Windows. + mingw*) gl_cv_func_snprintf_directive_n="guessing no";; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_snprintf_directive_n="$gl_cross_guess_normal";; +changequote([,])dnl + esac + ]) + ]) +]) + +dnl Test whether the snprintf function, when passed a size = 1, writes any +dnl output without bounds in this case, behaving like sprintf. This is the +dnl case on Linux libc5. +dnl Result is gl_cv_func_snprintf_size1. + +AC_DEFUN([gl_SNPRINTF_SIZE1], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_REQUIRE([gl_SNPRINTF_PRESENCE]) + AC_CACHE_CHECK([whether snprintf respects a size of 1], + [gl_cv_func_snprintf_size1], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#if HAVE_SNPRINTF +# define my_snprintf snprintf +#else +# include +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +#endif +int main() +{ + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; + my_snprintf (buf, 1, "%d", 12345); + return buf[1] != 'E'; +}]])], + [gl_cv_func_snprintf_size1=yes], + [gl_cv_func_snprintf_size1=no], + [case "$host_os" in + # Guess yes on Android. + linux*-android*) gl_cv_func_snprintf_size1="guessing yes" ;; + # Guess yes on native Windows. + mingw*) gl_cv_func_snprintf_size1="guessing yes" ;; + *) gl_cv_func_snprintf_size1="guessing yes" ;; + esac + ]) + ]) +]) + +dnl Test whether the vsnprintf function, when passed a zero size, produces no +dnl output. (ISO C99, POSIX:2001) +dnl For example, snprintf nevertheless writes a NUL byte in this case +dnl on OSF/1 5.1: +dnl --------------------------------------------------------------------- +dnl #include +dnl int main() +dnl { +dnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; +dnl snprintf (buf, 0, "%d", 12345); +dnl return buf[0] != 'D'; +dnl } +dnl --------------------------------------------------------------------- +dnl And vsnprintf writes any output without bounds in this case, behaving like +dnl vsprintf, on HP-UX 11 and OSF/1 5.1: +dnl --------------------------------------------------------------------- +dnl #include +dnl #include +dnl static int my_snprintf (char *buf, int size, const char *format, ...) +dnl { +dnl va_list args; +dnl int ret; +dnl va_start (args, format); +dnl ret = vsnprintf (buf, size, format, args); +dnl va_end (args); +dnl return ret; +dnl } +dnl int main() +dnl { +dnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; +dnl my_snprintf (buf, 0, "%d", 12345); +dnl return buf[0] != 'D'; +dnl } +dnl --------------------------------------------------------------------- +dnl Result is gl_cv_func_vsnprintf_zerosize_c99. + +AC_DEFUN([gl_VSNPRINTF_ZEROSIZE_C99], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether vsnprintf respects a zero size as in C99], + [gl_cv_func_vsnprintf_zerosize_c99], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +static int my_snprintf (char *buf, int size, const char *format, ...) +{ + va_list args; + int ret; + va_start (args, format); + ret = vsnprintf (buf, size, format, args); + va_end (args); + return ret; +} +int main() +{ + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; + my_snprintf (buf, 0, "%d", 12345); + return buf[0] != 'D'; +}]])], + [gl_cv_func_vsnprintf_zerosize_c99=yes], + [gl_cv_func_vsnprintf_zerosize_c99=no], + [ +changequote(,)dnl + case "$host_os" in + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on musl systems. + *-musl*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on FreeBSD >= 5. + freebsd[1-4].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on Mac OS X >= 10.3. + darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + darwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on Cygwin. + cygwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on Solaris >= 2.6. + solaris2.[0-5] | solaris2.[0-5].*) + gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + solaris*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on AIX >= 4. + aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + aix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on IRIX >= 6.5. + irix6.5) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on NetBSD >= 3. + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) + gl_cv_func_vsnprintf_zerosize_c99="guessing no";; + netbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on BeOS. + beos*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on Android. + linux*-android*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # Guess yes on native Windows. + mingw* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_vsnprintf_zerosize_c99="$gl_cross_guess_normal";; + esac +changequote([,])dnl + ]) + ]) +]) + +dnl The results of these tests on various platforms are: +dnl +dnl 1 = gl_PRINTF_SIZES_C99 +dnl 2 = gl_PRINTF_LONG_DOUBLE +dnl 3 = gl_PRINTF_INFINITE +dnl 4 = gl_PRINTF_INFINITE_LONG_DOUBLE +dnl 5 = gl_PRINTF_DIRECTIVE_A +dnl 6 = gl_PRINTF_DIRECTIVE_F +dnl 7 = gl_PRINTF_DIRECTIVE_N +dnl 8 = gl_PRINTF_DIRECTIVE_LS +dnl 9 = gl_PRINTF_POSITIONS +dnl 10 = gl_PRINTF_FLAG_GROUPING +dnl 11 = gl_PRINTF_FLAG_LEFTADJUST +dnl 12 = gl_PRINTF_FLAG_ZERO +dnl 13 = gl_PRINTF_PRECISION +dnl 14 = gl_PRINTF_ENOMEM +dnl 15 = gl_SNPRINTF_PRESENCE +dnl 16 = gl_SNPRINTF_TRUNCATION_C99 +dnl 17 = gl_SNPRINTF_RETVAL_C99 +dnl 18 = gl_SNPRINTF_DIRECTIVE_N +dnl 19 = gl_SNPRINTF_SIZE1 +dnl 20 = gl_VSNPRINTF_ZEROSIZE_C99 +dnl +dnl 1 = checking whether printf supports size specifiers as in C99... +dnl 2 = checking whether printf supports 'long double' arguments... +dnl 3 = checking whether printf supports infinite 'double' arguments... +dnl 4 = checking whether printf supports infinite 'long double' arguments... +dnl 5 = checking whether printf supports the 'a' and 'A' directives... +dnl 6 = checking whether printf supports the 'F' directive... +dnl 7 = checking whether printf supports the 'n' directive... +dnl 8 = checking whether printf supports the 'ls' directive... +dnl 9 = checking whether printf supports POSIX/XSI format strings with positions... +dnl 10 = checking whether printf supports the grouping flag... +dnl 11 = checking whether printf supports the left-adjust flag correctly... +dnl 12 = checking whether printf supports the zero flag correctly... +dnl 13 = checking whether printf supports large precisions... +dnl 14 = checking whether printf survives out-of-memory conditions... +dnl 15 = checking for snprintf... +dnl 16 = checking whether snprintf truncates the result as in C99... +dnl 17 = checking whether snprintf returns a byte count as in C99... +dnl 18 = checking whether snprintf fully supports the 'n' directive... +dnl 19 = checking whether snprintf respects a size of 1... +dnl 20 = checking whether vsnprintf respects a zero size as in C99... +dnl +dnl . = yes, # = no. +dnl +dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 +dnl glibc 2.5 . . . . . . . . . . . . . . . . . . . . +dnl glibc 2.3.6 . . . . # . . . . . . . . . . . . . . . +dnl FreeBSD 5.4, 6.1 . . . . # . . . . . . # . # . . . . . . +dnl Mac OS X 10.13.5 . . . # # . # . . . . . . . . . . # . . +dnl Mac OS X 10.5.8 . . . # # . . . . . . # . . . . . . . . +dnl Mac OS X 10.3.9 . . . . # . . . . . . # . # . . . . . . +dnl OpenBSD 6.0, 6.7 . . . . # . . . . . . . . # . . . . . . +dnl OpenBSD 3.9, 4.0 . . # # # # . # . # . # . # . . . . . . +dnl Cygwin 1.7.0 (2009) . . . # . . . ? . . . . . ? . . . . . . +dnl Cygwin 1.5.25 (2008) . . . # # . . # . . . . . # . . . . . . +dnl Cygwin 1.5.19 (2006) # . . # # # . # . # . # # # . . . . . . +dnl Solaris 11.4 . . # # # . . # . . . # . . . . . . . . +dnl Solaris 11.3 . . . . # . . # . . . . . . . . . . . . +dnl Solaris 11.0 . . # # # . . # . . . # . . . . . . . . +dnl Solaris 10 . . # # # . . # . . . # # . . . . . . . +dnl Solaris 2.6 ... 9 # . # # # # . # . . . # # . . . # . . . +dnl Solaris 2.5.1 # . # # # # . # . . . # . . # # # # # # +dnl AIX 7.1 . . # # # . . . . . . # # . . . . . . . +dnl AIX 5.2 . . # # # . . . . . . # . . . . . . . . +dnl AIX 4.3.2, 5.1 # . # # # # . . . . . # . . . . # . . . +dnl HP-UX 11.31 . . . . # . . . . . . # . . . . # # . . +dnl HP-UX 11.{00,11,23} # . . . # # . . . . . # . . . . # # . # +dnl HP-UX 10.20 # . # . # # . ? . . # # . . . . # # ? # +dnl IRIX 6.5 # . # # # # . # . . . # . . . . # . . . +dnl OSF/1 5.1 # . # # # # . . . . . # . . . . # . . # +dnl OSF/1 4.0d # . # # # # . . . . . # . . # # # # # # +dnl NetBSD 9.0 . . . . # . . . . . . . . . . . . . . . +dnl NetBSD 5.0 . . . # # . . . . . . # . # . . . . . . +dnl NetBSD 4.0 . ? ? ? ? ? . ? . ? ? ? ? ? . . . ? ? ? +dnl NetBSD 3.0 . . . . # # . ? # # ? # . # . . . . . . +dnl Haiku . . . # # # . # . . . . . ? . . ? . . . +dnl BeOS # # . # # # . ? # . ? . # ? . . ? . . . +dnl Android 4.3 . . # # # # # # . # . # . # . . . # . . +dnl old mingw / msvcrt # # # # # # . . # # . # # ? . # # # . . +dnl MSVC 9 # # # # # # # . # # . # # ? # # # # . . +dnl mingw 2009-2011 . # . # . . . . # # . . . ? . . . . . . +dnl mingw-w64 2011 # # # # # # . . # # . # # ? . # # # . . diff -Nru datamash-1.7/m4/progtest.m4 datamash-1.8/m4/progtest.m4 --- datamash-1.7/m4/progtest.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/progtest.m4 2022-05-28 01:46:45.000000000 +0000 @@ -1,16 +1,16 @@ # progtest.m4 serial 7 (gettext-0.18.2) -dnl Copyright (C) 1996-2003, 2005, 2008-2020 Free Software Foundation, Inc. +dnl Copyright (C) 1996-2003, 2005, 2008-2014 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 be used in projects which are not available under +dnl This file can 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 is covered by the GNU General Public License. +dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. dnl Authors: diff -Nru datamash-1.7/m4/pthread_rwlock_rdlock.m4 datamash-1.8/m4/pthread_rwlock_rdlock.m4 --- datamash-1.7/m4/pthread_rwlock_rdlock.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/pthread_rwlock_rdlock.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,185 @@ +# pthread_rwlock_rdlock.m4 serial 4 +dnl Copyright (C) 2017-2021 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 Inspired by +dnl https://github.com/linux-test-project/ltp/blob/master/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-2.c +dnl by Intel Corporation. + +dnl Test whether in a situation where +dnl - an rwlock is taken by a reader and has a writer waiting, +dnl - an additional reader requests the lock, +dnl - the waiting writer and the requesting reader threads have the same +dnl priority, +dnl the requesting reader thread gets blocked, so that at some point the +dnl waiting writer can acquire the lock. +dnl Without such a guarantee, when there a N readers and each of the readers +dnl spends more than 1/Nth of the time with the lock held, there is a high +dnl probability that the waiting writer will not get the lock in a given finite +dnl time, a phenomenon called "writer starvation". +dnl Without such a guarantee, applications have a hard time avoiding writer +dnl starvation. +dnl +dnl POSIX:2017 makes this requirement only for implementations that support TPS +dnl (Thread Priority Scheduling) and only for the scheduling policies SCHED_FIFO +dnl and SCHED_RR, see +dnl https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_rwlock_rdlock.html +dnl but this test verifies the guarantee regardless of TPS and regardless of +dnl scheduling policy. +dnl Glibc does not provide this guarantee (and never will on Linux), see +dnl https://sourceware.org/bugzilla/show_bug.cgi?id=13701 +dnl https://bugzilla.redhat.com/show_bug.cgi?id=1410052 +AC_DEFUN([gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER], +[ + AC_REQUIRE([gl_THREADLIB_EARLY]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether pthread_rwlock_rdlock prefers a writer to a reader], + [gl_cv_pthread_rwlock_rdlock_prefer_writer], + [save_LIBS="$LIBS" + LIBS="$LIBS $LIBMULTITHREAD" + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +#include +#include +#include + +#define SUCCEED() exit (0) +#define FAILURE() exit (1) +#define UNEXPECTED(n) (exit (10 + (n))) + +/* The main thread creates the waiting writer and the requesting reader threads + in the default way; this guarantees that they have the same priority. + We can reuse the main thread as first reader thread. */ + +static pthread_rwlock_t lock; +static pthread_t reader1; +static pthread_t writer; +static pthread_t reader2; +static pthread_t timer; +/* Used to pass control from writer to reader2 and from reader2 to timer, + as in a relay race. + Passing control from one running thread to another running thread + is most likely faster than to create the second thread. */ +static pthread_mutex_t baton; + +static void * +timer_func (void *ignored) +{ + /* Step 13 (can be before or after step 12): + The timer thread takes the baton, then waits a moment to make sure + it can tell whether the second reader thread is blocked at step 12. */ + if (pthread_mutex_lock (&baton)) + UNEXPECTED (13); + usleep (100000); + /* By the time we get here, it's clear that the second reader thread is + blocked at step 12. This is the desired behaviour. */ + SUCCEED (); +} + +static void * +reader2_func (void *ignored) +{ + int err; + + /* Step 8 (can be before or after step 7): + The second reader thread takes the baton, then waits a moment to make sure + the writer thread has reached step 7. */ + if (pthread_mutex_lock (&baton)) + UNEXPECTED (8); + usleep (100000); + /* Step 9: The second reader thread requests the lock. */ + err = pthread_rwlock_tryrdlock (&lock); + if (err == 0) + FAILURE (); + else if (err != EBUSY) + UNEXPECTED (9); + /* Step 10: Launch a timer, to test whether the next call blocks. */ + if (pthread_create (&timer, NULL, timer_func, NULL)) + UNEXPECTED (10); + /* Step 11: Release the baton. */ + if (pthread_mutex_unlock (&baton)) + UNEXPECTED (11); + /* Step 12: The second reader thread requests the lock. */ + err = pthread_rwlock_rdlock (&lock); + if (err == 0) + FAILURE (); + else + UNEXPECTED (12); +} + +static void * +writer_func (void *ignored) +{ + /* Step 4: Take the baton, so that the second reader thread does not go ahead + too early. */ + if (pthread_mutex_lock (&baton)) + UNEXPECTED (4); + /* Step 5: Create the second reader thread. */ + if (pthread_create (&reader2, NULL, reader2_func, NULL)) + UNEXPECTED (5); + /* Step 6: Release the baton. */ + if (pthread_mutex_unlock (&baton)) + UNEXPECTED (6); + /* Step 7: The writer thread requests the lock. */ + if (pthread_rwlock_wrlock (&lock)) + UNEXPECTED (7); + return NULL; +} + +int +main () +{ + reader1 = pthread_self (); + + /* Step 1: The main thread initializes the lock and the baton. */ + if (pthread_rwlock_init (&lock, NULL)) + UNEXPECTED (1); + if (pthread_mutex_init (&baton, NULL)) + UNEXPECTED (1); + /* Step 2: The main thread acquires the lock as a reader. */ + if (pthread_rwlock_rdlock (&lock)) + UNEXPECTED (2); + /* Step 3: Create the writer thread. */ + if (pthread_create (&writer, NULL, writer_func, NULL)) + UNEXPECTED (3); + /* Job done. Go to sleep. */ + for (;;) + { + sleep (1); + } +} +]])], + [gl_cv_pthread_rwlock_rdlock_prefer_writer=yes], + [gl_cv_pthread_rwlock_rdlock_prefer_writer=no], + [case "$host_os" in + # Guess no on glibc systems. + *-gnu* | gnu*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;; + # Guess no on musl systems. + *-musl*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;; + # Guess no on bionic systems. + *-android*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;; + # Guess yes on native Windows with the mingw-w64 winpthreads library. + # Guess no on native Windows with the gnulib windows-rwlock module. + mingw*) if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then + gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing yes" + else + gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" + fi + ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_pthread_rwlock_rdlock_prefer_writer="$gl_cross_guess_normal" ;; + esac + ]) + LIBS="$save_LIBS" + ]) + case "$gl_cv_pthread_rwlock_rdlock_prefer_writer" in + *yes) + AC_DEFINE([HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER], [1], + [Define if the 'pthread_rwlock_rdlock' function prefers a writer to a reader.]) + ;; + esac +]) diff -Nru datamash-1.7/m4/quotearg.m4 datamash-1.8/m4/quotearg.m4 --- datamash-1.7/m4/quotearg.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/quotearg.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # quotearg.m4 serial 10 -dnl Copyright (C) 2002, 2004-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2004-2021 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.7/m4/random.m4 datamash-1.8/m4/random.m4 --- datamash-1.7/m4/random.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/random.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # random.m4 serial 4 -dnl Copyright (C) 2012-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2012-2021 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.7/m4/random_r.m4 datamash-1.8/m4/random_r.m4 --- datamash-1.7/m4/random_r.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/random_r.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # serial 5 -dnl Copyright (C) 2008-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2008-2021 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.7/m4/realloc.m4 datamash-1.8/m4/realloc.m4 --- datamash-1.7/m4/realloc.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/realloc.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# realloc.m4 serial 18 -dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. +# realloc.m4 serial 19 +dnl Copyright (C) 2007, 2009-2021 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. @@ -8,18 +8,12 @@ # https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c AC_DEFUN([_AC_FUNC_REALLOC_IF], [ - AC_REQUIRE([AC_HEADER_STDC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles - AC_CHECK_HEADERS([stdlib.h]) AC_CACHE_CHECK([for GNU libc compatible realloc], [ac_cv_func_realloc_0_nonnull], [AC_RUN_IFELSE( [AC_LANG_PROGRAM( - [[#if defined STDC_HEADERS || defined HAVE_STDLIB_H - # include - #else - char *realloc (); - #endif + [[#include ]], [[char *p = realloc (0, 0); int result = !p; diff -Nru datamash-1.7/m4/roundl.m4 datamash-1.8/m4/roundl.m4 --- datamash-1.7/m4/roundl.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/roundl.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # roundl.m4 serial 20 -dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2009-2021 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.7/m4/round.m4 datamash-1.8/m4/round.m4 --- datamash-1.7/m4/round.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/round.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# round.m4 serial 22 -dnl Copyright (C) 2007, 2009-2020 Free Software Foundation, Inc. +# round.m4 serial 23 +dnl Copyright (C) 2007, 2009-2021 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. @@ -41,7 +41,7 @@ "C" #endif double round (double); -#ifdef _MSC_VER +#if defined _MSC_VER && !defined __clang__ # pragma fenv_access (off) #endif int main() diff -Nru datamash-1.7/m4/setlocale.m4 datamash-1.8/m4/setlocale.m4 --- datamash-1.7/m4/setlocale.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/setlocale.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,85 @@ +# setlocale.m4 serial 7 +dnl Copyright (C) 2011-2021 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_SETLOCALE], +[ + AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) + AC_REQUIRE([gl_FUNC_SETLOCALE_NULL]) + AC_REQUIRE([AC_CANONICAL_HOST]) + + dnl Test whether we need to improve on the general working of setlocale. + NEED_SETLOCALE_IMPROVED=0 + case "$host_os" in + dnl On native Windows systems, setlocale(category,NULL) does not look at + dnl the environment variables LC_ALL, category, and LANG. + mingw*) NEED_SETLOCALE_IMPROVED=1 ;; + dnl On Cygwin 1.5.x, setlocale always succeeds but setlocale(LC_CTYPE,NULL) + dnl is then still "C". + cygwin*) + case `uname -r` in + 1.5.*) NEED_SETLOCALE_IMPROVED=1 ;; + esac + ;; + dnl On Android 4.3, setlocale(category,"C") always fails. + *) + AC_CACHE_CHECK([whether setlocale supports the C locale], + [gl_cv_func_setlocale_works], + [AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +int main () +{ + return setlocale (LC_ALL, "C") == NULL; +}]])], + [gl_cv_func_setlocale_works=yes], + [gl_cv_func_setlocale_works=no], + [case "$host_os" in + # Guess no on Android. + linux*-android*) gl_cv_func_setlocale_works="guessing no";; + # Guess yes otherwise. + *) gl_cv_func_setlocale_works="guessing yes";; + esac + ]) + ]) + case "$gl_cv_func_setlocale_works" in + *yes) ;; + *) NEED_SETLOCALE_IMPROVED=1 ;; + esac + ;; + esac + AC_DEFINE_UNQUOTED([NEED_SETLOCALE_IMPROVED], [$NEED_SETLOCALE_IMPROVED], + [Define to 1 to enable general improvements of setlocale.]) + + dnl Test whether we need a multithread-safe setlocale(category,NULL). + NEED_SETLOCALE_MTSAFE=0 + if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then + NEED_SETLOCALE_MTSAFE=1 + fi + AC_DEFINE_UNQUOTED([NEED_SETLOCALE_MTSAFE], [$NEED_SETLOCALE_MTSAFE], + [Define to 1 to enable a multithread-safety fix of setlocale.]) + + if test $NEED_SETLOCALE_IMPROVED = 1 || test $NEED_SETLOCALE_MTSAFE = 1; then + REPLACE_SETLOCALE=1 + fi + + if test $NEED_SETLOCALE_MTSAFE = 1; then + LIB_SETLOCALE="$LIB_SETLOCALE_NULL" + else + LIB_SETLOCALE= + fi + dnl LIB_SETLOCALE is expected to be '-pthread' or '-lpthread' on AIX with gcc + dnl or xlc, and empty otherwise. + AC_SUBST([LIB_SETLOCALE]) +]) + +# Prerequisites of lib/setlocale.c. +AC_DEFUN([gl_PREREQ_SETLOCALE], +[ + dnl No need to check for CFLocaleCopyPreferredLanguages and + dnl CFPreferencesCopyAppValue because lib/setlocale.c is not used on Mac OS X. + dnl (The Mac OS X specific code is only used in libintl.) + : +]) diff -Nru datamash-1.7/m4/setlocale_null.m4 datamash-1.8/m4/setlocale_null.m4 --- datamash-1.7/m4/setlocale_null.m4 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/m4/setlocale_null.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# setlocale_null.m4 serial 2 -dnl Copyright (C) 2019-2020 Free Software Foundation, Inc. +# setlocale_null.m4 serial 4 +dnl Copyright (C) 2019-2021 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.7/m4/sha1.m4 datamash-1.8/m4/sha1.m4 --- datamash-1.7/m4/sha1.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/sha1.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # sha1.m4 serial 12 -dnl Copyright (C) 2002-2006, 2008-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2008-2021 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.7/m4/sha256.m4 datamash-1.8/m4/sha256.m4 --- datamash-1.7/m4/sha256.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/sha256.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # sha256.m4 serial 8 -dnl Copyright (C) 2005, 2008-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2008-2021 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.7/m4/sha512.m4 datamash-1.8/m4/sha512.m4 --- datamash-1.7/m4/sha512.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/sha512.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # sha512.m4 serial 9 -dnl Copyright (C) 2005-2006, 2008-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2006, 2008-2021 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.7/m4/signbit.m4 datamash-1.8/m4/signbit.m4 --- datamash-1.7/m4/signbit.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/signbit.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# signbit.m4 serial 19 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +# signbit.m4 serial 20 +dnl Copyright (C) 2007-2021 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. @@ -40,15 +40,16 @@ esac ]) ]) - dnl GCC 4.0 and newer provides three built-ins for signbit. + dnl GCC >= 4.0 and clang provide three built-ins for signbit. dnl They can be used without warnings, also in C++, regardless of . dnl But they may expand to calls to functions, which may or may not be in dnl libc. - AC_CACHE_CHECK([for signbit compiler built-ins], [gl_cv_func_signbit_gcc], + AC_CACHE_CHECK([for signbit compiler built-ins], + [gl_cv_func_signbit_builtins], [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ -#if __GNUC__ >= 4 +#if (__GNUC__ >= 4) || (__clang_major__ >= 4) # define signbit(x) \ (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \ sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \ @@ -59,30 +60,30 @@ #include ]gl_SIGNBIT_TEST_PROGRAM ])], - [gl_cv_func_signbit_gcc=yes], - [gl_cv_func_signbit_gcc=no], + [gl_cv_func_signbit_builtins=yes], + [gl_cv_func_signbit_builtins=no], [case "$host_os" in # Guess yes on glibc systems. - *-gnu* | gnu*) gl_cv_func_signbit_gcc="guessing yes" ;; + *-gnu* | gnu*) gl_cv_func_signbit_builtins="guessing yes" ;; # Guess yes on musl systems. - *-musl*) gl_cv_func_signbit_gcc="guessing yes" ;; + *-musl*) gl_cv_func_signbit_builtins="guessing yes" ;; # Guess yes on mingw, no on MSVC. mingw*) if test -n "$GCC"; then - gl_cv_func_signbit_gcc="guessing yes" + gl_cv_func_signbit_builtins="guessing yes" else - gl_cv_func_signbit_gcc="guessing no" + gl_cv_func_signbit_builtins="guessing no" fi ;; # If we don't know, obey --enable-cross-guesses. - *) gl_cv_func_signbit_gcc="$gl_cross_guess_normal" ;; + *) gl_cv_func_signbit_builtins="$gl_cross_guess_normal" ;; esac ]) ]) dnl Use the compiler built-ins whenever possible, because they are more dnl efficient than the system library functions (if they exist). - case "$gl_cv_func_signbit_gcc" in + case "$gl_cv_func_signbit_builtins" in *yes) - REPLACE_SIGNBIT_USING_GCC=1 + REPLACE_SIGNBIT_USING_BUILTINS=1 ;; *) case "$gl_cv_func_signbit" in diff -Nru datamash-1.7/m4/size_max.m4 datamash-1.8/m4/size_max.m4 --- datamash-1.7/m4/size_max.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/size_max.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# size_max.m4 serial 11 -dnl Copyright (C) 2003, 2005-2006, 2008-2020 Free Software Foundation, Inc. +# size_max.m4 serial 12 +dnl Copyright (C) 2003, 2005-2006, 2008-2021 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. @@ -13,7 +13,7 @@ AC_CHECK_HEADERS([stdint.h]) dnl First test whether the system already has SIZE_MAX. AC_CACHE_CHECK([for SIZE_MAX], [gl_cv_size_max], [ - gl_cv_size_max= + gl_cv_size_max=no AC_EGREP_CPP([Found it], [ #include #if HAVE_STDINT_H @@ -23,7 +23,7 @@ Found it #endif ], [gl_cv_size_max=yes]) - if test -z "$gl_cv_size_max"; then + if test $gl_cv_size_max != yes; then dnl Define it ourselves. Here we assume that the type 'size_t' is not wider dnl than the type 'unsigned long'. Try hard to find a definition that can dnl be used in a preprocessor #if, i.e. doesn't contain a cast. diff -Nru datamash-1.7/m4/snprintf.m4 datamash-1.8/m4/snprintf.m4 --- datamash-1.7/m4/snprintf.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/snprintf.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,62 @@ +# snprintf.m4 serial 7 +dnl Copyright (C) 2002-2004, 2007-2021 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 Libintl 0.17 will replace snprintf only if it does not support %1$s, +dnl but defers to any gnulib snprintf replacements. Therefore, gnulib +dnl must guarantee that the decision for replacing snprintf is a superset +dnl of the reasons checked by libintl. +AC_DEFUN([gl_FUNC_SNPRINTF], +[ + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + gl_cv_func_snprintf_usable=no + AC_CHECK_FUNCS([snprintf]) + if test $ac_cv_func_snprintf = yes; then + gl_SNPRINTF_SIZE1 + case "$gl_cv_func_snprintf_size1" in + *yes) + gl_SNPRINTF_RETVAL_C99 + case "$gl_cv_func_snprintf_retval_c99" in + *yes) + gl_PRINTF_POSITIONS + case "$gl_cv_func_printf_positions" in + *yes) + gl_cv_func_snprintf_usable=yes + ;; + esac + ;; + esac + ;; + esac + fi + if test $gl_cv_func_snprintf_usable = no; then + gl_REPLACE_SNPRINTF + fi + AC_CHECK_DECLS_ONCE([snprintf]) + if test $ac_cv_have_decl_snprintf = no; then + HAVE_DECL_SNPRINTF=0 + fi +]) + +AC_DEFUN([gl_REPLACE_SNPRINTF], +[ + AC_REQUIRE([gl_STDIO_H_DEFAULTS]) + AC_LIBOBJ([snprintf]) + if test $ac_cv_func_snprintf = yes; then + REPLACE_SNPRINTF=1 + else + AC_CHECK_DECLS_ONCE([snprintf]) + if test $ac_cv_have_decl_snprintf = yes; then + dnl If the function is declared but does not appear to exist, it may be + dnl defined as an inline function. In order to avoid a conflict, we have + dnl to define rpl_snprintf, not snprintf. + REPLACE_SNPRINTF=1 + fi + fi + gl_PREREQ_SNPRINTF +]) + +# Prerequisites of lib/snprintf.c. +AC_DEFUN([gl_PREREQ_SNPRINTF], [:]) diff -Nru datamash-1.7/m4/socklen.m4 datamash-1.8/m4/socklen.m4 --- datamash-1.7/m4/socklen.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/socklen.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # socklen.m4 serial 11 -dnl Copyright (C) 2005-2007, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2007, 2009-2021 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.7/m4/sockpfaf.m4 datamash-1.8/m4/sockpfaf.m4 --- datamash-1.7/m4/sockpfaf.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/sockpfaf.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,84 @@ +# sockpfaf.m4 serial 9 +dnl Copyright (C) 2004, 2006, 2009-2021 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 Test for some common socket protocol families (PF_INET, PF_INET6, ...) +dnl and some common address families (AF_INET, AF_INET6, ...). +dnl This test assumes that a system supports an address family if and only if +dnl it supports the corresponding protocol family. + +dnl From Bruno Haible. + +AC_DEFUN([gl_SOCKET_FAMILIES], +[ + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + AC_CHECK_HEADERS_ONCE([netinet/in.h]) + + AC_CACHE_CHECK([for IPv4 sockets], + [gl_cv_socket_ipv4], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_WINSOCK2_H +#include +#endif]], +[[int x = AF_INET; struct in_addr y; struct sockaddr_in z; + if (&x && &y && &z) return 0;]])], + gl_cv_socket_ipv4=yes, gl_cv_socket_ipv4=no)]) + if test $gl_cv_socket_ipv4 = yes; then + AC_DEFINE([HAVE_IPV4], [1], [Define to 1 if defines AF_INET.]) + fi + + AC_CACHE_CHECK([for IPv6 sockets], + [gl_cv_socket_ipv6], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_WINSOCK2_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#endif]], +[[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z; + if (&x && &y && &z) return 0;]])], + gl_cv_socket_ipv6=yes, gl_cv_socket_ipv6=no)]) + if test $gl_cv_socket_ipv6 = yes; then + AC_DEFINE([HAVE_IPV6], [1], [Define to 1 if defines AF_INET6.]) + fi +]) + +AC_DEFUN([gl_SOCKET_FAMILY_UNIX], +[ + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + AC_CHECK_HEADERS_ONCE([sys/un.h]) + + AC_CACHE_CHECK([for UNIX domain sockets], + [gl_cv_socket_unix], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_SYS_UN_H +#include +#endif +#ifdef HAVE_WINSOCK2_H +#include +#endif]], +[[int x = AF_UNIX; struct sockaddr_un y; + if (&x && &y) return 0;]])], + gl_cv_socket_unix=yes, gl_cv_socket_unix=no)]) + if test $gl_cv_socket_unix = yes; then + AC_DEFINE([HAVE_UNIXSOCKET], [1], [Define to 1 if defines AF_UNIX.]) + fi +]) diff -Nru datamash-1.7/m4/sqrtl.m4 datamash-1.8/m4/sqrtl.m4 --- datamash-1.7/m4/sqrtl.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/sqrtl.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # sqrtl.m4 serial 11 -dnl Copyright (C) 2010-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2010-2021 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.7/m4/sqrt.m4 datamash-1.8/m4/sqrt.m4 --- datamash-1.7/m4/sqrt.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/sqrt.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # sqrt.m4 serial 3 -dnl Copyright (C) 2010-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2010-2021 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.7/m4/ssize_t.m4 datamash-1.8/m4/ssize_t.m4 --- datamash-1.7/m4/ssize_t.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/ssize_t.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # ssize_t.m4 serial 5 (gettext-0.18.2) -dnl Copyright (C) 2001-2003, 2006, 2010-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2001-2003, 2006, 2010-2021 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.7/m4/stat.m4 datamash-1.8/m4/stat.m4 --- datamash-1.7/m4/stat.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/stat.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,85 @@ +# serial 17 + +# Copyright (C) 2009-2021 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. + +AC_DEFUN([gl_FUNC_STAT], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) + AC_CHECK_FUNCS_ONCE([lstat]) + case "$host_os" in + mingw*) + dnl On this platform, the original stat() returns st_atime, st_mtime, + dnl st_ctime values that are affected by the time zone. + REPLACE_STAT=1 + ;; + *) + dnl AIX 7.1, Solaris 9, mingw64 mistakenly succeed on stat("file/"). + dnl (For mingw, this is due to a broken stat() override in libmingwex.a.) + dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/"). + AC_CACHE_CHECK([whether stat handles trailing slashes on files], + [gl_cv_func_stat_file_slash], + [touch conftest.tmp + # Assume that if we have lstat, we can also check symlinks. + if test $ac_cv_func_lstat = yes; then + ln -s conftest.tmp conftest.lnk + fi + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include +]], [[int result = 0; + struct stat st; + if (!stat ("conftest.tmp/", &st)) + result |= 1; +#if HAVE_LSTAT + if (!stat ("conftest.lnk/", &st)) + result |= 2; +#endif + return result; + ]])], + [gl_cv_func_stat_file_slash=yes], [gl_cv_func_stat_file_slash=no], + [case "$host_os" in + # Guess yes on Linux systems. + linux-* | linux) gl_cv_func_stat_file_slash="guessing yes" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_stat_file_slash="guessing yes" ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_stat_file_slash="$gl_cross_guess_normal" ;; + esac + ]) + rm -f conftest.tmp conftest.lnk]) + case $gl_cv_func_stat_file_slash in + *no) + REPLACE_STAT=1 + AC_DEFINE([REPLACE_FUNC_STAT_FILE], [1], [Define to 1 if stat needs + help when passed a file name with a trailing slash]);; + esac + case $host_os in + dnl Solaris stat can return a negative tv_nsec. + solaris*) + REPLACE_FSTAT=1 ;; + esac + ;; + esac +]) + +# Prerequisites of lib/stat.c and lib/stat-w32.c. +AC_DEFUN([gl_PREREQ_STAT], [ + AC_REQUIRE([gl_HEADER_SYS_STAT_H]) + AC_REQUIRE([gl_PREREQ_STAT_W32]) + : +]) + +# Prerequisites of lib/stat-w32.c. +AC_DEFUN([gl_PREREQ_STAT_W32], [ + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + mingw*) + AC_CHECK_HEADERS([sdkddkver.h]) + ;; + esac +]) diff -Nru datamash-1.7/m4/stat-time.m4 datamash-1.8/m4/stat-time.m4 --- datamash-1.7/m4/stat-time.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/stat-time.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ # Checks for stat-related time functions. -# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2020 Free Software +# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2021 Free Software # Foundation, Inc. # This file is free software; the Free Software Foundation diff -Nru datamash-1.7/m4/stdalign.m4 datamash-1.8/m4/stdalign.m4 --- datamash-1.7/m4/stdalign.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/stdalign.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ # Check for stdalign.h that conforms to C11. -dnl Copyright 2011-2020 Free Software Foundation, Inc. +dnl Copyright 2011-2021 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.7/m4/stdarg.m4 datamash-1.8/m4/stdarg.m4 --- datamash-1.7/m4/stdarg.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/stdarg.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # stdarg.m4 serial 7 -dnl Copyright (C) 2006, 2008-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2008-2021 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.7/m4/stdbool.m4 datamash-1.8/m4/stdbool.m4 --- datamash-1.7/m4/stdbool.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/stdbool.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ # Check for stdbool.h that conforms to C99. -dnl Copyright (C) 2002-2006, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009-2021 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.7/m4/stddef_h.m4 datamash-1.8/m4/stddef_h.m4 --- datamash-1.7/m4/stddef_h.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/stddef_h.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,14 +1,19 @@ -dnl A placeholder for , for platforms that have issues. -# stddef_h.m4 serial 6 -dnl Copyright (C) 2009-2020 Free Software Foundation, Inc. +# stddef_h.m4 serial 9 +dnl Copyright (C) 2009-2021 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 A placeholder for , for platforms that have issues. + AC_DEFUN([gl_STDDEF_H], [ AC_REQUIRE([gl_STDDEF_H_DEFAULTS]) AC_REQUIRE([gt_TYPE_WCHAR_T]) + + dnl Persuade OpenBSD to declare max_align_t. + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + STDDEF_H= dnl Test whether the type max_align_t exists and whether its alignment @@ -19,10 +24,17 @@ [AC_LANG_PROGRAM( [[#include unsigned int s = sizeof (max_align_t); - #if defined __GNUC__ || defined __IBM__ALIGNOF__ + #if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__ int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1]; int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1]; #endif + typedef struct { char a; max_align_t b; } max_helper; + typedef struct { char a; long b; } long_helper; + typedef struct { char a; double b; } double_helper; + typedef struct { char a; long double b; } long_double_helper; + int check3[2 * (offsetof (long_helper, b) <= offsetof (max_helper, b)) - 1]; + int check4[2 * (offsetof (double_helper, b) <= offsetof (max_helper, b)) - 1]; + int check5[2 * (offsetof (long_double_helper, b) <= offsetof (max_helper, b)) - 1]; ]])], [gl_cv_type_max_align_t=yes], [gl_cv_type_max_align_t=no]) diff -Nru datamash-1.7/m4/std-gnu11.m4 datamash-1.8/m4/std-gnu11.m4 --- datamash-1.7/m4/std-gnu11.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/std-gnu11.m4 2022-05-28 01:46:59.000000000 +0000 @@ -6,8 +6,10 @@ # This implementation will be obsolete once we can assume Autoconf 2.70 # or later is installed everywhere a Gnulib program might be developed. +m4_version_prereq([2.70], [], [ -# Copyright (C) 2001-2020 Free Software Foundation, Inc. + +# Copyright (C) 2001-2021 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 @@ -70,7 +72,7 @@ set X $ac_compile ac_compiler=$[2] for ac_option in --version -v -V -qversion -version; do - m4_ifdef([_AC_DO_LIMIT],[_AC_DO_LIMIT],[_AC_DO])([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD]) + _AC_DO_LIMIT([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD]) done m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl @@ -135,7 +137,7 @@ set X $ac_compile ac_compiler=$[2] for ac_option in --version -v -V -qversion; do - m4_ifdef([_AC_DO_LIMIT],[_AC_DO_LIMIT],[_AC_DO])([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD]) + _AC_DO_LIMIT([$ac_compiler $ac_option >&AS_MESSAGE_LOG_FD]) done m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl @@ -822,3 +824,6 @@ dnl with extended modes being tried first. [[-std=gnu++11 -std=c++11 -std=gnu++0x -std=c++0x -qlanglvl=extended0x -AA]], [$1], [$2])[]dnl ])# _AC_PROG_CXX_CXX11 + + +])# m4_version_prereq diff -Nru datamash-1.7/m4/stdint_h.m4 datamash-1.8/m4/stdint_h.m4 --- datamash-1.7/m4/stdint_h.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/stdint_h.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,27 @@ +# stdint_h.m4 serial 9 +dnl Copyright (C) 1997-2004, 2006, 2008-2021 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. + +# Define HAVE_STDINT_H_WITH_UINTMAX if exists, +# doesn't clash with , and declares uintmax_t. + +AC_DEFUN([gl_AC_HEADER_STDINT_H], +[ + AC_CACHE_CHECK([for stdint.h], [gl_cv_header_stdint_h], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + #include ]], + [[uintmax_t i = (uintmax_t) -1; return !i;]])], + [gl_cv_header_stdint_h=yes], + [gl_cv_header_stdint_h=no])]) + if test $gl_cv_header_stdint_h = yes; then + AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1], + [Define if exists, doesn't clash with , + and declares uintmax_t. ]) + fi +]) diff -Nru datamash-1.7/m4/stdint.m4 datamash-1.8/m4/stdint.m4 --- datamash-1.7/m4/stdint.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/stdint.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# stdint.m4 serial 54 -dnl Copyright (C) 2001-2020 Free Software Foundation, Inc. +# stdint.m4 serial 58 +dnl Copyright (C) 2001-2021 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. @@ -34,7 +34,7 @@ AC_SUBST([HAVE_WCHAR_H]) dnl Check for . - dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h. + AC_CHECK_HEADERS_ONCE([inttypes.h]) if test $ac_cv_header_inttypes_h = yes; then HAVE_INTTYPES_H=1 else @@ -43,7 +43,7 @@ AC_SUBST([HAVE_INTTYPES_H]) dnl Check for . - dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_sys_types_h. + AC_CHECK_HEADERS_ONCE([sys/types.h]) if test $ac_cv_header_sys_types_h = yes; then HAVE_SYS_TYPES_H=1 else @@ -152,7 +152,7 @@ /* 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__ \ +#elif (2 <= __GNUC__ || 4 <= __clang_major__ || defined __IBM__TYPEOF__ \ || (0x5110 <= __SUNPRO_C && !__STDC__)) extern size_t k; extern __typeof__ (SIZE_MAX) k; @@ -302,9 +302,10 @@ 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 + dnl If not, there would be problems when stdint.h is included from C++. + AC_CACHE_CHECK([whether stdint.h works without ISO C predefines], + [gl_cv_header_stdint_without_STDC_macros], + [gl_cv_header_stdint_without_STDC_macros=no AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */ @@ -315,13 +316,14 @@ intmax_t im = INTMAX_MAX; int32_t i32 = INT32_C (0x7fffffff); ]])], - [gl_cv_header_stdint_predates_cxx11_h=no])]) + [gl_cv_header_stdint_without_STDC_macros=yes]) + ]) - if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then + if test $gl_cv_header_stdint_without_STDC_macros = no; then AC_DEFINE([__STDC_CONSTANT_MACROS], [1], - [Define to 1 if the system predates C++11.]) + [Define to 1 if the system predates C++11.]) AC_DEFINE([__STDC_LIMIT_MACROS], [1], - [Define to 1 if the system predates C++11.]) + [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], @@ -491,13 +493,9 @@ dnl gl_STDINT_INCLUDES AC_DEFUN([gl_STDINT_INCLUDES], [[ - /* BSD/OS 4.0.1 has a bug: , and must be - included before . */ #include #include #if HAVE_WCHAR_H - # include - # include # include #endif ]]) diff -Nru datamash-1.7/m4/stdio_h.m4 datamash-1.8/m4/stdio_h.m4 --- datamash-1.7/m4/stdio_h.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/stdio_h.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# stdio_h.m4 serial 50 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +# stdio_h.m4 serial 52 +dnl Copyright (C) 2007-2021 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. @@ -109,6 +109,11 @@ renameat snprintf tmpfile vdprintf vsnprintf]) AC_REQUIRE([AC_C_RESTRICT]) + + AC_CHECK_DECLS_ONCE([fcloseall]) + if test $ac_cv_have_decl_fcloseall = no; then + HAVE_DECL_FCLOSEALL=0 + fi ]) AC_DEFUN([gl_STDIO_MODULE_INDICATOR], @@ -175,7 +180,15 @@ GNULIB_VPRINTF_POSIX=0; AC_SUBST([GNULIB_VPRINTF_POSIX]) GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF]) GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX]) + dnl Support Microsoft deprecated alias function names by default. + GNULIB_MDA_FCLOSEALL=1; AC_SUBST([GNULIB_MDA_FCLOSEALL]) + GNULIB_MDA_FDOPEN=1; AC_SUBST([GNULIB_MDA_FDOPEN]) + GNULIB_MDA_FILENO=1; AC_SUBST([GNULIB_MDA_FILENO]) + GNULIB_MDA_GETW=1; AC_SUBST([GNULIB_MDA_GETW]) + GNULIB_MDA_PUTW=1; AC_SUBST([GNULIB_MDA_PUTW]) + GNULIB_MDA_TEMPNAM=1; AC_SUBST([GNULIB_MDA_TEMPNAM]) dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_DECL_FCLOSEALL=1; AC_SUBST([HAVE_DECL_FCLOSEALL]) HAVE_DECL_FPURGE=1; AC_SUBST([HAVE_DECL_FPURGE]) HAVE_DECL_FSEEKO=1; AC_SUBST([HAVE_DECL_FSEEKO]) HAVE_DECL_FTELLO=1; AC_SUBST([HAVE_DECL_FTELLO]) diff -Nru datamash-1.7/m4/stdlib_h.m4 datamash-1.8/m4/stdlib_h.m4 --- datamash-1.7/m4/stdlib_h.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/stdlib_h.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# stdlib_h.m4 serial 49 -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +# stdlib_h.m4 serial 55 +dnl Copyright (C) 2007-2021 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,13 +22,28 @@ #if HAVE_RANDOM_H # include #endif - ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt + ]], [_Exit aligned_alloc atoll canonicalize_file_name free + getloadavg getsubopt grantpt initstate initstate_r mbtowc mkdtemp mkostemp mkostemps mkstemp mkstemps - posix_openpt ptsname ptsname_r qsort_r random random_r reallocarray - realpath rpmatch secure_getenv setenv setstate setstate_r srandom - srandom_r strtod strtold strtoll strtoull unlockpt unsetenv]) + posix_memalign posix_openpt ptsname ptsname_r qsort_r + random random_r reallocarray realpath rpmatch secure_getenv setenv + setstate setstate_r srandom srandom_r + strtod strtold strtoll strtoull unlockpt unsetenv]) AC_REQUIRE([AC_C_RESTRICT]) + + AC_CHECK_DECLS_ONCE([ecvt]) + if test $ac_cv_have_decl_ecvt = no; then + HAVE_DECL_ECVT=0 + fi + AC_CHECK_DECLS_ONCE([fcvt]) + if test $ac_cv_have_decl_fcvt = no; then + HAVE_DECL_FCVT=0 + fi + AC_CHECK_DECLS_ONCE([gcvt]) + if test $ac_cv_have_decl_gcvt = no; then + HAVE_DECL_GCVT=0 + fi ]) AC_DEFUN([gl_STDLIB_MODULE_INDICATOR], @@ -43,9 +58,11 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], [ GNULIB__EXIT=0; AC_SUBST([GNULIB__EXIT]) + GNULIB_ALIGNED_ALLOC=0; AC_SUBST([GNULIB_ALIGNED_ALLOC]) GNULIB_ATOLL=0; AC_SUBST([GNULIB_ATOLL]) GNULIB_CALLOC_POSIX=0; AC_SUBST([GNULIB_CALLOC_POSIX]) GNULIB_CANONICALIZE_FILE_NAME=0; AC_SUBST([GNULIB_CANONICALIZE_FILE_NAME]) + GNULIB_FREE_POSIX=0; AC_SUBST([GNULIB_FREE_POSIX]) GNULIB_GETLOADAVG=0; AC_SUBST([GNULIB_GETLOADAVG]) GNULIB_GETSUBOPT=0; AC_SUBST([GNULIB_GETSUBOPT]) GNULIB_GRANTPT=0; AC_SUBST([GNULIB_GRANTPT]) @@ -56,6 +73,7 @@ GNULIB_MKOSTEMPS=0; AC_SUBST([GNULIB_MKOSTEMPS]) GNULIB_MKSTEMP=0; AC_SUBST([GNULIB_MKSTEMP]) GNULIB_MKSTEMPS=0; AC_SUBST([GNULIB_MKSTEMPS]) + GNULIB_POSIX_MEMALIGN=0;AC_SUBST([GNULIB_POSIX_MEMALIGN]) GNULIB_POSIX_OPENPT=0; AC_SUBST([GNULIB_POSIX_OPENPT]) GNULIB_PTSNAME=0; AC_SUBST([GNULIB_PTSNAME]) GNULIB_PTSNAME_R=0; AC_SUBST([GNULIB_PTSNAME_R]) @@ -77,10 +95,20 @@ GNULIB_UNLOCKPT=0; AC_SUBST([GNULIB_UNLOCKPT]) GNULIB_UNSETENV=0; AC_SUBST([GNULIB_UNSETENV]) GNULIB_WCTOMB=0; AC_SUBST([GNULIB_WCTOMB]) + dnl Support Microsoft deprecated alias function names by default. + GNULIB_MDA_ECVT=1; AC_SUBST([GNULIB_MDA_ECVT]) + GNULIB_MDA_FCVT=1; AC_SUBST([GNULIB_MDA_FCVT]) + GNULIB_MDA_GCVT=1; AC_SUBST([GNULIB_MDA_GCVT]) + GNULIB_MDA_MKTEMP=1; AC_SUBST([GNULIB_MDA_MKTEMP]) + GNULIB_MDA_PUTENV=1; AC_SUBST([GNULIB_MDA_PUTENV]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE__EXIT=1; AC_SUBST([HAVE__EXIT]) + HAVE_ALIGNED_ALLOC=1; AC_SUBST([HAVE_ALIGNED_ALLOC]) HAVE_ATOLL=1; AC_SUBST([HAVE_ATOLL]) HAVE_CANONICALIZE_FILE_NAME=1; AC_SUBST([HAVE_CANONICALIZE_FILE_NAME]) + HAVE_DECL_ECVT=1; AC_SUBST([HAVE_DECL_ECVT]) + HAVE_DECL_FCVT=1; AC_SUBST([HAVE_DECL_FCVT]) + HAVE_DECL_GCVT=1; AC_SUBST([HAVE_DECL_GCVT]) HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG]) HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT]) HAVE_GRANTPT=1; AC_SUBST([HAVE_GRANTPT]) @@ -92,6 +120,7 @@ HAVE_MKOSTEMPS=1; AC_SUBST([HAVE_MKOSTEMPS]) HAVE_MKSTEMP=1; AC_SUBST([HAVE_MKSTEMP]) HAVE_MKSTEMPS=1; AC_SUBST([HAVE_MKSTEMPS]) + HAVE_POSIX_MEMALIGN=1; AC_SUBST([HAVE_POSIX_MEMALIGN]) 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]) @@ -115,12 +144,15 @@ HAVE_SYS_LOADAVG_H=0; AC_SUBST([HAVE_SYS_LOADAVG_H]) HAVE_UNLOCKPT=1; AC_SUBST([HAVE_UNLOCKPT]) HAVE_DECL_UNSETENV=1; AC_SUBST([HAVE_DECL_UNSETENV]) + REPLACE_ALIGNED_ALLOC=0; AC_SUBST([REPLACE_ALIGNED_ALLOC]) REPLACE_CALLOC=0; AC_SUBST([REPLACE_CALLOC]) REPLACE_CANONICALIZE_FILE_NAME=0; AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME]) + REPLACE_FREE=0; AC_SUBST([REPLACE_FREE]) REPLACE_INITSTATE=0; AC_SUBST([REPLACE_INITSTATE]) REPLACE_MALLOC=0; AC_SUBST([REPLACE_MALLOC]) REPLACE_MBTOWC=0; AC_SUBST([REPLACE_MBTOWC]) REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP]) + REPLACE_POSIX_MEMALIGN=0; AC_SUBST([REPLACE_POSIX_MEMALIGN]) REPLACE_PTSNAME=0; AC_SUBST([REPLACE_PTSNAME]) REPLACE_PTSNAME_R=0; AC_SUBST([REPLACE_PTSNAME_R]) REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV]) diff -Nru datamash-1.7/m4/stdnoreturn.m4 datamash-1.8/m4/stdnoreturn.m4 --- datamash-1.7/m4/stdnoreturn.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/stdnoreturn.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ # Check for stdnoreturn.h that conforms to C11. -dnl Copyright 2012-2020 Free Software Foundation, Inc. +dnl Copyright 2012-2021 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. @@ -24,6 +24,9 @@ [AC_LANG_PROGRAM( [[#include #include + #if defined _WIN32 && !defined __CYGWIN__ + # include + #endif /* Do not check for 'noreturn' after the return type. C11 allows it, but it's rarely done that way and circa-2012 bleeding-edge GCC rejects it when given diff -Nru datamash-1.7/m4/stpcpy.m4 datamash-1.8/m4/stpcpy.m4 --- datamash-1.7/m4/stpcpy.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/stpcpy.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # stpcpy.m4 serial 8 -dnl Copyright (C) 2002, 2007, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2007, 2009-2021 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.7/m4/strcase.m4 datamash-1.8/m4/strcase.m4 --- datamash-1.7/m4/strcase.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/strcase.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,45 @@ +# strcase.m4 serial 11 +dnl Copyright (C) 2002, 2005-2021 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_STRCASE], +[ + gl_FUNC_STRCASECMP + gl_FUNC_STRNCASECMP +]) + +AC_DEFUN([gl_FUNC_STRCASECMP], +[ + AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS]) + AC_CHECK_FUNCS([strcasecmp]) + if test $ac_cv_func_strcasecmp = no; then + HAVE_STRCASECMP=0 + fi +]) + +AC_DEFUN([gl_FUNC_STRNCASECMP], +[ + AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS]) + AC_CHECK_FUNCS([strncasecmp]) + if test $ac_cv_func_strncasecmp = yes; then + HAVE_STRNCASECMP=1 + else + HAVE_STRNCASECMP=0 + fi + AC_CHECK_DECLS([strncasecmp]) + if test $ac_cv_have_decl_strncasecmp = no; then + HAVE_DECL_STRNCASECMP=0 + fi +]) + +# Prerequisites of lib/strcasecmp.c. +AC_DEFUN([gl_PREREQ_STRCASECMP], [ + : +]) + +# Prerequisites of lib/strncasecmp.c. +AC_DEFUN([gl_PREREQ_STRNCASECMP], [ + : +]) diff -Nru datamash-1.7/m4/strdup.m4 datamash-1.8/m4/strdup.m4 --- datamash-1.7/m4/strdup.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/strdup.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,32 @@ +# strdup.m4 serial 14 + +dnl Copyright (C) 2002-2021 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_STRDUP], +[ + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_CHECK_DECLS_ONCE([strdup]) + if test $ac_cv_have_decl_strdup = no; then + HAVE_DECL_STRDUP=0 + fi +]) + +AC_DEFUN([gl_FUNC_STRDUP_POSIX], +[ + AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REQUIRE([gl_CHECK_MALLOC_POSIX]) + if test $gl_cv_func_malloc_posix != yes; then + REPLACE_STRDUP=1 + fi + AC_CHECK_DECLS_ONCE([strdup]) + if test $ac_cv_have_decl_strdup = no; then + HAVE_DECL_STRDUP=0 + fi +]) + +# Prerequisites of lib/strdup.c. +AC_DEFUN([gl_PREREQ_STRDUP], [:]) diff -Nru datamash-1.7/m4/strerror.m4 datamash-1.8/m4/strerror.m4 --- datamash-1.7/m4/strerror.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/strerror.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # strerror.m4 serial 21 -dnl Copyright (C) 2002, 2007-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2007-2021 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.7/m4/string_h.m4 datamash-1.8/m4/string_h.m4 --- datamash-1.7/m4/string_h.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/string_h.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,11 +1,11 @@ # Configure a GNU-like replacement for . -# Copyright (C) 2007-2020 Free Software Foundation, Inc. +# Copyright (C) 2007-2021 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 23 +# serial 29 # Written by Paul Eggert. @@ -28,7 +28,7 @@ ]], [ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r - strerror_r strsignal strverscmp]) + strerror_r strerrorname_np sigabbrev_np sigdescr_np strsignal strverscmp]) AC_REQUIRE([AC_C_RESTRICT]) ]) @@ -44,50 +44,55 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], [ - GNULIB_EXPLICIT_BZERO=0; AC_SUBST([GNULIB_EXPLICIT_BZERO]) - GNULIB_FFSL=0; AC_SUBST([GNULIB_FFSL]) - GNULIB_FFSLL=0; AC_SUBST([GNULIB_FFSLL]) - GNULIB_MEMCHR=0; AC_SUBST([GNULIB_MEMCHR]) - GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM]) - GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY]) - GNULIB_MEMRCHR=0; AC_SUBST([GNULIB_MEMRCHR]) - GNULIB_RAWMEMCHR=0; AC_SUBST([GNULIB_RAWMEMCHR]) - GNULIB_STPCPY=0; AC_SUBST([GNULIB_STPCPY]) - GNULIB_STPNCPY=0; AC_SUBST([GNULIB_STPNCPY]) - GNULIB_STRCHRNUL=0; AC_SUBST([GNULIB_STRCHRNUL]) - GNULIB_STRDUP=0; AC_SUBST([GNULIB_STRDUP]) - GNULIB_STRNCAT=0; AC_SUBST([GNULIB_STRNCAT]) - GNULIB_STRNDUP=0; AC_SUBST([GNULIB_STRNDUP]) - GNULIB_STRNLEN=0; AC_SUBST([GNULIB_STRNLEN]) - GNULIB_STRPBRK=0; AC_SUBST([GNULIB_STRPBRK]) - GNULIB_STRSEP=0; AC_SUBST([GNULIB_STRSEP]) - GNULIB_STRSTR=0; AC_SUBST([GNULIB_STRSTR]) - GNULIB_STRCASESTR=0; AC_SUBST([GNULIB_STRCASESTR]) - GNULIB_STRTOK_R=0; AC_SUBST([GNULIB_STRTOK_R]) - GNULIB_MBSLEN=0; AC_SUBST([GNULIB_MBSLEN]) - GNULIB_MBSNLEN=0; AC_SUBST([GNULIB_MBSNLEN]) - GNULIB_MBSCHR=0; AC_SUBST([GNULIB_MBSCHR]) - GNULIB_MBSRCHR=0; AC_SUBST([GNULIB_MBSRCHR]) - GNULIB_MBSSTR=0; AC_SUBST([GNULIB_MBSSTR]) - GNULIB_MBSCASECMP=0; AC_SUBST([GNULIB_MBSCASECMP]) - GNULIB_MBSNCASECMP=0; AC_SUBST([GNULIB_MBSNCASECMP]) - GNULIB_MBSPCASECMP=0; AC_SUBST([GNULIB_MBSPCASECMP]) - GNULIB_MBSCASESTR=0; AC_SUBST([GNULIB_MBSCASESTR]) - GNULIB_MBSCSPN=0; AC_SUBST([GNULIB_MBSCSPN]) - GNULIB_MBSPBRK=0; AC_SUBST([GNULIB_MBSPBRK]) - GNULIB_MBSSPN=0; AC_SUBST([GNULIB_MBSSPN]) - GNULIB_MBSSEP=0; AC_SUBST([GNULIB_MBSSEP]) - GNULIB_MBSTOK_R=0; AC_SUBST([GNULIB_MBSTOK_R]) - GNULIB_STRERROR=0; AC_SUBST([GNULIB_STRERROR]) - GNULIB_STRERROR_R=0; AC_SUBST([GNULIB_STRERROR_R]) - GNULIB_STRSIGNAL=0; AC_SUBST([GNULIB_STRSIGNAL]) - GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP]) - HAVE_MBSLEN=0; AC_SUBST([HAVE_MBSLEN]) + GNULIB_EXPLICIT_BZERO=0; AC_SUBST([GNULIB_EXPLICIT_BZERO]) + GNULIB_FFSL=0; AC_SUBST([GNULIB_FFSL]) + GNULIB_FFSLL=0; AC_SUBST([GNULIB_FFSLL]) + GNULIB_MEMCHR=0; AC_SUBST([GNULIB_MEMCHR]) + GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM]) + GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY]) + GNULIB_MEMRCHR=0; AC_SUBST([GNULIB_MEMRCHR]) + GNULIB_RAWMEMCHR=0; AC_SUBST([GNULIB_RAWMEMCHR]) + GNULIB_STPCPY=0; AC_SUBST([GNULIB_STPCPY]) + GNULIB_STPNCPY=0; AC_SUBST([GNULIB_STPNCPY]) + GNULIB_STRCHRNUL=0; AC_SUBST([GNULIB_STRCHRNUL]) + GNULIB_STRDUP=0; AC_SUBST([GNULIB_STRDUP]) + GNULIB_STRNCAT=0; AC_SUBST([GNULIB_STRNCAT]) + GNULIB_STRNDUP=0; AC_SUBST([GNULIB_STRNDUP]) + GNULIB_STRNLEN=0; AC_SUBST([GNULIB_STRNLEN]) + GNULIB_STRPBRK=0; AC_SUBST([GNULIB_STRPBRK]) + GNULIB_STRSEP=0; AC_SUBST([GNULIB_STRSEP]) + GNULIB_STRSTR=0; AC_SUBST([GNULIB_STRSTR]) + GNULIB_STRCASESTR=0; AC_SUBST([GNULIB_STRCASESTR]) + GNULIB_STRTOK_R=0; AC_SUBST([GNULIB_STRTOK_R]) + GNULIB_MBSLEN=0; AC_SUBST([GNULIB_MBSLEN]) + GNULIB_MBSNLEN=0; AC_SUBST([GNULIB_MBSNLEN]) + GNULIB_MBSCHR=0; AC_SUBST([GNULIB_MBSCHR]) + GNULIB_MBSRCHR=0; AC_SUBST([GNULIB_MBSRCHR]) + GNULIB_MBSSTR=0; AC_SUBST([GNULIB_MBSSTR]) + GNULIB_MBSCASECMP=0; AC_SUBST([GNULIB_MBSCASECMP]) + GNULIB_MBSNCASECMP=0; AC_SUBST([GNULIB_MBSNCASECMP]) + GNULIB_MBSPCASECMP=0; AC_SUBST([GNULIB_MBSPCASECMP]) + GNULIB_MBSCASESTR=0; AC_SUBST([GNULIB_MBSCASESTR]) + GNULIB_MBSCSPN=0; AC_SUBST([GNULIB_MBSCSPN]) + GNULIB_MBSPBRK=0; AC_SUBST([GNULIB_MBSPBRK]) + GNULIB_MBSSPN=0; AC_SUBST([GNULIB_MBSSPN]) + GNULIB_MBSSEP=0; AC_SUBST([GNULIB_MBSSEP]) + GNULIB_MBSTOK_R=0; AC_SUBST([GNULIB_MBSTOK_R]) + GNULIB_STRERROR=0; AC_SUBST([GNULIB_STRERROR]) + GNULIB_STRERROR_R=0; AC_SUBST([GNULIB_STRERROR_R]) + GNULIB_STRERRORNAME_NP=0; AC_SUBST([GNULIB_STRERRORNAME_NP]) + GNULIB_SIGABBREV_NP=0; AC_SUBST([GNULIB_SIGABBREV_NP]) + GNULIB_SIGDESCR_NP=0; AC_SUBST([GNULIB_SIGDESCR_NP]) + GNULIB_STRSIGNAL=0; AC_SUBST([GNULIB_STRSIGNAL]) + GNULIB_STRVERSCMP=0; AC_SUBST([GNULIB_STRVERSCMP]) + HAVE_MBSLEN=0; AC_SUBST([HAVE_MBSLEN]) + dnl Support Microsoft deprecated alias function names by default. + GNULIB_MDA_MEMCCPY=1; AC_SUBST([GNULIB_MDA_MEMCCPY]) + GNULIB_MDA_STRDUP=1; AC_SUBST([GNULIB_MDA_STRDUP]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_EXPLICIT_BZERO=1; AC_SUBST([HAVE_EXPLICIT_BZERO]) HAVE_FFSL=1; AC_SUBST([HAVE_FFSL]) HAVE_FFSLL=1; AC_SUBST([HAVE_FFSLL]) - HAVE_MEMCHR=1; AC_SUBST([HAVE_MEMCHR]) HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM]) HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY]) HAVE_DECL_MEMRCHR=1; AC_SUBST([HAVE_DECL_MEMRCHR]) @@ -103,8 +108,12 @@ HAVE_STRCASESTR=1; AC_SUBST([HAVE_STRCASESTR]) HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R]) HAVE_DECL_STRERROR_R=1; AC_SUBST([HAVE_DECL_STRERROR_R]) + HAVE_STRERRORNAME_NP=1; AC_SUBST([HAVE_STRERRORNAME_NP]) + HAVE_SIGABBREV_NP=1; AC_SUBST([HAVE_SIGABBREV_NP]) + HAVE_SIGDESCR_NP=1; AC_SUBST([HAVE_SIGDESCR_NP]) HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL]) HAVE_STRVERSCMP=1; AC_SUBST([HAVE_STRVERSCMP]) + REPLACE_FFSLL=0; AC_SUBST([REPLACE_FFSLL]) REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR]) REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM]) REPLACE_STPNCPY=0; AC_SUBST([REPLACE_STPNCPY]) @@ -118,6 +127,7 @@ REPLACE_STRTOK_R=0; AC_SUBST([REPLACE_STRTOK_R]) REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR]) REPLACE_STRERROR_R=0; AC_SUBST([REPLACE_STRERROR_R]) + REPLACE_STRERRORNAME_NP=0; AC_SUBST([REPLACE_STRERRORNAME_NP]) REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL]) UNDEFINE_STRTOK_R=0; AC_SUBST([UNDEFINE_STRTOK_R]) ]) diff -Nru datamash-1.7/m4/strings_h.m4 datamash-1.8/m4/strings_h.m4 --- datamash-1.7/m4/strings_h.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/strings_h.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,52 @@ +# Configure a replacement for . +# serial 6 + +# Copyright (C) 2007, 2009-2021 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. + +AC_DEFUN([gl_HEADER_STRINGS_H], +[ + dnl Use AC_REQUIRE here, so that the default behavior below is expanded + dnl once only, before all statements that occur in other macros. + AC_REQUIRE([gl_HEADER_STRINGS_H_BODY]) +]) + +AC_DEFUN([gl_HEADER_STRINGS_H_BODY], +[ + AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS]) + + gl_CHECK_NEXT_HEADERS([strings.h]) + if test $ac_cv_header_strings_h = yes; then + HAVE_STRINGS_H=1 + else + HAVE_STRINGS_H=0 + fi + AC_SUBST([HAVE_STRINGS_H]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[ + /* Minix 3.1.8 has a bug: must be included before + . */ + #include + #include + ]], [ffs strcasecmp strncasecmp]) +]) + +AC_DEFUN([gl_STRINGS_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_HEADER_STRINGS_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) +]) + +AC_DEFUN([gl_HEADER_STRINGS_H_DEFAULTS], +[ + GNULIB_FFS=0; AC_SUBST([GNULIB_FFS]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_FFS=1; AC_SUBST([HAVE_FFS]) + HAVE_STRCASECMP=1; AC_SUBST([HAVE_STRCASECMP]) + HAVE_DECL_STRNCASECMP=1; AC_SUBST([HAVE_DECL_STRNCASECMP]) +]) diff -Nru datamash-1.7/m4/strndup.m4 datamash-1.8/m4/strndup.m4 --- datamash-1.7/m4/strndup.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/strndup.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # strndup.m4 serial 22 -dnl Copyright (C) 2002-2003, 2005-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2003, 2005-2021 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.7/m4/strnlen.m4 datamash-1.8/m4/strnlen.m4 --- datamash-1.7/m4/strnlen.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/strnlen.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # strnlen.m4 serial 13 -dnl Copyright (C) 2002-2003, 2005-2007, 2009-2020 Free Software Foundation, +dnl Copyright (C) 2002-2003, 2005-2007, 2009-2021 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.7/m4/strsep.m4 datamash-1.8/m4/strsep.m4 --- datamash-1.7/m4/strsep.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/strsep.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # strsep.m4 serial 10 -dnl Copyright (C) 2002-2004, 2007, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2004, 2007, 2009-2021 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.7/m4/strtod.m4 datamash-1.8/m4/strtod.m4 --- datamash-1.7/m4/strtod.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/strtod.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,144 @@ +# strtod.m4 serial 26 +dnl Copyright (C) 2002-2003, 2006-2021 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_STRTOD], +[ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + m4_ifdef([gl_FUNC_STRTOD_OBSOLETE], [ + dnl Test whether strtod is declared. + dnl Don't call AC_FUNC_STRTOD, because it does not have the right guess + dnl when cross-compiling. + dnl Don't call AC_CHECK_FUNCS([strtod]) because it would collide with the + dnl ac_cv_func_strtod variable set by the AC_FUNC_STRTOD macro. + AC_CHECK_DECLS_ONCE([strtod]) + if test $ac_cv_have_decl_strtod != yes; then + HAVE_STRTOD=0 + fi + ]) + if test $HAVE_STRTOD = 1; then + AC_CACHE_CHECK([whether strtod obeys C99], [gl_cv_func_strtod_works], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ +#include +#include +#include +/* 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; +} +]], [[ + int result = 0; + { + /* In some old versions of Linux (2000 or before), strtod mis-parses + strings with leading '+'. */ + const char *string = " +69"; + char *term; + double value = strtod (string, &term); + if (value != 69 || term != (string + 4)) + result |= 1; + } + { + /* Under Solaris 2.4, strtod returns the wrong value for the + terminating character under some conditions. */ + const char *string = "NaN"; + char *term; + strtod (string, &term); + if (term != string && *(term - 1) == 0) + result |= 2; + } + { + /* Older glibc and Cygwin mis-parse "-0x". */ + const char *string = "-0x"; + char *term; + double value = strtod (string, &term); + double zero = 0.0; + if (1.0 / value != -1.0 / zero || term != (string + 2)) + result |= 4; + } + { + /* Many platforms do not parse hex floats. */ + const char *string = "0XaP+1"; + char *term; + double value = strtod (string, &term); + if (value != 20.0 || term != (string + 6)) + result |= 8; + } + { + /* Many platforms do not parse infinities. HP-UX 11.31 parses inf, + but mistakenly sets errno. */ + const char *string = "inf"; + char *term; + double value; + errno = 0; + value = strtod (string, &term); + if (value != HUGE_VAL || term != (string + 3) || errno) + result |= 16; + } + { + /* glibc 2.7 and cygwin 1.5.24 misparse "nan()". */ + const char *string = "nan()"; + char *term; + double value = strtod (string, &term); + if (numeric_equal (value, value) || term != (string + 5)) + result |= 32; + } + { + /* darwin 10.6.1 misparses "nan(". */ + const char *string = "nan("; + char *term; + double value = strtod (string, &term); + if (numeric_equal (value, value) || term != (string + 3)) + result |= 64; + } + return result; +]])], + [gl_cv_func_strtod_works=yes], + [gl_cv_func_strtod_works=no], + [dnl The last known bugs in glibc strtod(), as of this writing, + dnl were fixed in version 2.8 + AC_EGREP_CPP([Lucky user], + [ +#include +#ifdef __GNU_LIBRARY__ + #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8) || (__GLIBC__ > 2)) \ + && !defined __UCLIBC__ + Lucky user + #endif +#endif + ], + [gl_cv_func_strtod_works="guessing yes"], + [case "$host_os" in + # Guess yes on musl systems. + *-musl*) gl_cv_func_strtod_works="guessing yes" ;; + # Guess yes on native Windows. + mingw*) gl_cv_func_strtod_works="guessing yes" ;; + *) gl_cv_func_strtod_works="$gl_cross_guess_normal" ;; + esac + ]) + ]) + ]) + case "$gl_cv_func_strtod_works" in + *yes) ;; + *) + REPLACE_STRTOD=1 + ;; + esac + fi +]) + +# Prerequisites of lib/strtod.c. +AC_DEFUN([gl_PREREQ_STRTOD], [ + AC_REQUIRE([gl_CHECK_LDEXP_NO_LIBM]) + if test $gl_cv_func_ldexp_no_libm = yes; then + AC_DEFINE([HAVE_LDEXP_IN_LIBC], [1], + [Define if the ldexp function is available in libc.]) + fi + AC_CHECK_FUNCS([nl_langinfo]) +]) diff -Nru datamash-1.7/m4/strtold.m4 datamash-1.8/m4/strtold.m4 --- datamash-1.7/m4/strtold.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/strtold.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,149 @@ +# strtold.m4 serial 7 +dnl Copyright (C) 2002-2003, 2006-2021 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_STRTOLD], +[ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CHECK_FUNCS_ONCE([strtold]) + if test $ac_cv_func_strtold != yes; then + HAVE_STRTOLD=0 + else + AC_CACHE_CHECK([whether strtold obeys POSIX], [gl_cv_func_strtold_works], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ +#include +#include +#include +/* 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; +} +]], [[ + int result = 0; + { + /* Under Solaris 2.4, strtod returns the wrong value for the + terminating character under some conditions. */ + const char *string = "NaN"; + char *term; + strtold (string, &term); + if (term != string && *(term - 1) == 0) + result |= 1; + } + { + /* Older glibc and Cygwin mis-parse "-0x". */ + const char *string = "-0x"; + char *term; + long double value = strtold (string, &term); + long double zero = 0.0L; + if (1.0L / value != -1.0L / zero || term != (string + 2)) + result |= 2; + } + { + /* IRIX 6.5, mingw do not parse hex floats. */ + const char *string = "0XaP+1"; + char *term; + long double value = strtold (string, &term); + if (value != 20.0L || term != (string + 6)) + result |= 4; + } + { + /* IRIX 6.5 does not parse infinities. HP-UX 11.31/ia64 parses inf, + but mistakenly sets errno. */ + const char *string = "inf"; + char *term; + long double value; + errno = 0; + value = strtold (string, &term); + if (value != HUGE_VAL || term != (string + 3) || errno) + result |= 8; + } + { + /* glibc-2.3.2, IRIX 6.5, mingw, Haiku misparse "nan()". */ + const char *string = "nan()"; + char *term; + long double value = strtold (string, &term); + if (numeric_equal (value, value) || term != (string + 5)) + result |= 16; + } + { + /* Mac OS X 10.5, IRIX 6.5 misparse "nan(". */ + const char *string = "nan("; + char *term; + long double value = strtold (string, &term); + if (numeric_equal (value, value) || term != (string + 3)) + result |= 32; + } + { + /* In Cygwin 2.9, strtold does not set errno upon underflow. */ + const char *string = "1E-100000"; + char *term; + long double value; + errno = 0; + value = strtold (string, &term); + if (term != (string + 9) || (value == 0.0L && errno != ERANGE)) + result |= 64; + } + return result; +]])], + [gl_cv_func_strtold_works=yes], + [if expr $? '>=' 64 >/dev/null; then + gl_cv_func_strtold_works="no (underflow problem)" + else + gl_cv_func_strtold_works=no + fi + ], + [dnl The last known bugs in glibc strtold(), as of this writing, + dnl were fixed in version 2.8 + AC_EGREP_CPP([Lucky user], + [ +#include +#ifdef __GNU_LIBRARY__ + #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8) || (__GLIBC__ > 2)) \ + && !defined __UCLIBC__ + Lucky user + #endif +#endif + ], + [gl_cv_func_strtold_works="guessing yes"], + [case "$host_os" in + # Guess yes on musl systems. + *-musl*) gl_cv_func_strtold_works="guessing yes" ;; + # Guess 'no (underflow problem)' on Cygwin. + cygwin*) gl_cv_func_strtold_works="guessing no (underflow problem)" ;; + *) gl_cv_func_strtold_works="$gl_cross_guess_normal" ;; + esac + ]) + ]) + ]) + case "$gl_cv_func_strtold_works" in + *yes) ;; + *) + REPLACE_STRTOLD=1 + case "$gl_cv_func_strtold_works" in + *"no (underflow problem)") + AC_DEFINE([STRTOLD_HAS_UNDERFLOW_BUG], [1], + [Define to 1 if strtold does not set errno upon underflow.]) + ;; + esac + ;; + esac + fi +]) + +# Prerequisites of lib/strtold.c. +AC_DEFUN([gl_PREREQ_STRTOLD], [ + AC_REQUIRE([gl_CHECK_LDEXPL_NO_LIBM]) + if test $gl_cv_func_ldexpl_no_libm = yes; then + AC_DEFINE([HAVE_LDEXPL_IN_LIBC], [1], + [Define if the ldexpl function is available in libc.]) + fi + AC_CHECK_FUNCS([nl_langinfo]) +]) diff -Nru datamash-1.7/m4/strtoll.m4 datamash-1.8/m4/strtoll.m4 --- datamash-1.7/m4/strtoll.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/strtoll.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,19 @@ +# strtoll.m4 serial 8 +dnl Copyright (C) 2002, 2004, 2006, 2008-2021 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_STRTOLL], +[ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + AC_CHECK_FUNCS([strtoll]) + if test $ac_cv_func_strtoll = no; then + HAVE_STRTOLL=0 + fi +]) + +# Prerequisites of lib/strtoll.c. +AC_DEFUN([gl_PREREQ_STRTOLL], [ + : +]) diff -Nru datamash-1.7/m4/strtoull.m4 datamash-1.8/m4/strtoull.m4 --- datamash-1.7/m4/strtoull.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/strtoull.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # strtoull.m4 serial 8 -dnl Copyright (C) 2002, 2004, 2006, 2008-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2002, 2004, 2006, 2008-2021 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.7/m4/strtoumax.m4 datamash-1.8/m4/strtoumax.m4 --- datamash-1.7/m4/strtoumax.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/strtoumax.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # strtoumax.m4 serial 13 -dnl Copyright (C) 2002-2004, 2006, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2004, 2006, 2009-2021 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.7/m4/sys_socket_h.m4 datamash-1.8/m4/sys_socket_h.m4 --- datamash-1.7/m4/sys_socket_h.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/sys_socket_h.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # sys_socket_h.m4 serial 25 -dnl Copyright (C) 2005-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2005-2021 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.7/m4/sys_stat_h.m4 datamash-1.8/m4/sys_stat_h.m4 --- datamash-1.7/m4/sys_stat_h.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/sys_stat_h.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# sys_stat_h.m4 serial 33 -*- Autoconf -*- -dnl Copyright (C) 2006-2020 Free Software Foundation, Inc. +# sys_stat_h.m4 serial 38 -*- Autoconf -*- +dnl Copyright (C) 2006-2021 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. @@ -46,8 +46,8 @@ dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[#include - ]], [fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat - mknod mknodat stat utimensat]) + ]], [fchmodat fstat fstatat futimens getumask lchmod lstat + mkdirat mkfifo mkfifoat mknod mknodat stat utimensat]) AC_REQUIRE([AC_C_RESTRICT]) ]) @@ -68,8 +68,10 @@ GNULIB_FSTAT=0; AC_SUBST([GNULIB_FSTAT]) GNULIB_FSTATAT=0; AC_SUBST([GNULIB_FSTATAT]) GNULIB_FUTIMENS=0; AC_SUBST([GNULIB_FUTIMENS]) + GNULIB_GETUMASK=0; AC_SUBST([GNULIB_GETUMASK]) GNULIB_LCHMOD=0; AC_SUBST([GNULIB_LCHMOD]) GNULIB_LSTAT=0; AC_SUBST([GNULIB_LSTAT]) + GNULIB_MKDIR=0; AC_SUBST([GNULIB_MKDIR]) GNULIB_MKDIRAT=0; AC_SUBST([GNULIB_MKDIRAT]) GNULIB_MKFIFO=0; AC_SUBST([GNULIB_MKFIFO]) GNULIB_MKFIFOAT=0; AC_SUBST([GNULIB_MKFIFOAT]) @@ -78,10 +80,15 @@ GNULIB_STAT=0; AC_SUBST([GNULIB_STAT]) GNULIB_UTIMENSAT=0; AC_SUBST([GNULIB_UTIMENSAT]) GNULIB_OVERRIDES_STRUCT_STAT=0; AC_SUBST([GNULIB_OVERRIDES_STRUCT_STAT]) + dnl Support Microsoft deprecated alias function names by default. + GNULIB_MDA_CHMOD=1; AC_SUBST([GNULIB_MDA_CHMOD]) + GNULIB_MDA_MKDIR=1; AC_SUBST([GNULIB_MDA_MKDIR]) + GNULIB_MDA_UMASK=1; AC_SUBST([GNULIB_MDA_UMASK]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_FCHMODAT=1; AC_SUBST([HAVE_FCHMODAT]) HAVE_FSTATAT=1; AC_SUBST([HAVE_FSTATAT]) HAVE_FUTIMENS=1; AC_SUBST([HAVE_FUTIMENS]) + HAVE_GETUMASK=1; AC_SUBST([HAVE_GETUMASK]) HAVE_LCHMOD=1; AC_SUBST([HAVE_LCHMOD]) HAVE_LSTAT=1; AC_SUBST([HAVE_LSTAT]) HAVE_MKDIRAT=1; AC_SUBST([HAVE_MKDIRAT]) @@ -97,7 +104,9 @@ REPLACE_LSTAT=0; AC_SUBST([REPLACE_LSTAT]) REPLACE_MKDIR=0; AC_SUBST([REPLACE_MKDIR]) REPLACE_MKFIFO=0; AC_SUBST([REPLACE_MKFIFO]) + REPLACE_MKFIFOAT=0; AC_SUBST([REPLACE_MKFIFOAT]) REPLACE_MKNOD=0; AC_SUBST([REPLACE_MKNOD]) + REPLACE_MKNODAT=0; AC_SUBST([REPLACE_MKNODAT]) REPLACE_STAT=0; AC_SUBST([REPLACE_STAT]) REPLACE_UTIMENSAT=0; AC_SUBST([REPLACE_UTIMENSAT]) ]) diff -Nru datamash-1.7/m4/sys_types_h.m4 datamash-1.8/m4/sys_types_h.m4 --- datamash-1.7/m4/sys_types_h.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/sys_types_h.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# sys_types_h.m4 serial 9 -dnl Copyright (C) 2011-2020 Free Software Foundation, Inc. +# sys_types_h.m4 serial 11 +dnl Copyright (C) 2011-2021 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. @@ -36,25 +36,23 @@ # This works around a buggy version in autoconf <= 2.69. # See +# The 2.70 version isn't quoted properly, so override it too. -m4_version_prereq([2.70], [], [ - -# This is taken from the following Autoconf patch: -# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=e17a30e987d7ee695fb4294a82d987ec3dc9b974 +m4_version_prereq([2.70.1], [], [ 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 - .])]) + [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 - .])]) + [AC_DEFINE([MAJOR_IN_SYSMACROS], [1], + [Define to 1 if `major', `minor', and `makedev' + are declared in .])]) fi -]) +])# AC_HEADER_MAJOR ]) diff -Nru datamash-1.7/m4/sys_uio_h.m4 datamash-1.8/m4/sys_uio_h.m4 --- datamash-1.7/m4/sys_uio_h.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/sys_uio_h.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # sys_uio_h.m4 serial 1 -dnl Copyright (C) 2011-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2011-2021 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.7/m4/sys_wait_h.m4 datamash-1.8/m4/sys_wait_h.m4 --- datamash-1.7/m4/sys_wait_h.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/sys_wait_h.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,36 @@ +# sys_wait_h.m4 serial 6 +dnl Copyright (C) 2008-2021 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_SYS_WAIT_H], +[ + AC_REQUIRE([gl_SYS_WAIT_H_DEFAULTS]) + + dnl is always overridden, because of GNULIB_POSIXCHECK. + gl_CHECK_NEXT_HEADERS([sys/wait.h]) + + dnl Ensure the type pid_t gets defined. + AC_REQUIRE([AC_TYPE_PID_T]) + + dnl Check for declarations of anything we want to poison if the + dnl corresponding gnulib module is not in use. + gl_WARN_ON_USE_PREPARE([[#include ]], + [waitpid]) +]) + +AC_DEFUN([gl_SYS_WAIT_MODULE_INDICATOR], +[ + dnl Use AC_REQUIRE here, so that the default settings are expanded once only. + AC_REQUIRE([gl_SYS_WAIT_H_DEFAULTS]) + gl_MODULE_INDICATOR_SET_VARIABLE([$1]) + dnl Define it also as a C macro, for the benefit of the unit tests. + gl_MODULE_INDICATOR_FOR_TESTS([$1]) +]) + +AC_DEFUN([gl_SYS_WAIT_H_DEFAULTS], +[ + GNULIB_WAITPID=0; AC_SUBST([GNULIB_WAITPID]) + dnl Assume proper GNU behavior unless another module says otherwise. +]) diff -Nru datamash-1.7/m4/threadlib.m4 datamash-1.8/m4/threadlib.m4 --- datamash-1.7/m4/threadlib.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/threadlib.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# threadlib.m4 serial 27 -dnl Copyright (C) 2005-2020 Free Software Foundation, Inc. +# threadlib.m4 serial 29 +dnl Copyright (C) 2005-2021 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. @@ -398,8 +398,8 @@ [m4_divert_text([DEFAULTS], [gl_use_threads_default=])]) m4_divert_text([DEFAULTS], [gl_use_winpthreads_default=]) AC_ARG_ENABLE([threads], -AC_HELP_STRING([--enable-threads={isoc|posix|isoc+posix|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [ -AC_HELP_STRING([--disable-threads], [build without multithread safety])]), +AS_HELP_STRING([--enable-threads={isoc|posix|isoc+posix|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [ +AS_HELP_STRING([--disable-threads], [build without multithread safety])]), [gl_use_threads=$enableval], [if test -n "$gl_use_threads_default"; then gl_use_threads="$gl_use_threads_default" @@ -486,6 +486,17 @@ AC_DEFINE([USE_POSIX_THREADS_WEAK], [1], [Define if references to the POSIX multithreading library should be made weak.]) LIBTHREAD= LTLIBTHREAD= + else + case "$host_os" in + freebsd* | dragonfly*) + if test "x$LIBTHREAD" != "x$LIBMULTITHREAD"; then + dnl If weak symbols can't tell whether pthread_create(), pthread_key_create() + dnl etc. will succeed, we need a runtime test. + AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1], + [Define if the pthread_in_use() detection is hard.]) + fi + ;; + esac fi fi fi diff -Nru datamash-1.7/m4/time_h.m4 datamash-1.8/m4/time_h.m4 --- datamash-1.7/m4/time_h.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/time_h.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,8 +1,8 @@ # Configure a more-standard replacement for . -# Copyright (C) 2000-2001, 2003-2007, 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 2000-2001, 2003-2007, 2009-2021 Free Software Foundation, Inc. -# serial 12 +# serial 15 # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -25,6 +25,22 @@ AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC]) AC_REQUIRE([AC_C_RESTRICT]) + + AC_CACHE_CHECK([for TIME_UTC in ], + [gl_cv_time_h_has_TIME_UTC], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + ]], + [[static int x = TIME_UTC; x++;]])], + [gl_cv_time_h_has_TIME_UTC=yes], + [gl_cv_time_h_has_TIME_UTC=no])]) + if test $gl_cv_time_h_has_TIME_UTC = yes; then + TIME_H_DEFINES_TIME_UTC=1 + else + TIME_H_DEFINES_TIME_UTC=0 + fi + AC_SUBST([TIME_H_DEFINES_TIME_UTC]) ]) dnl Check whether 'struct timespec' is declared @@ -113,15 +129,18 @@ GNULIB_STRFTIME=0; AC_SUBST([GNULIB_STRFTIME]) GNULIB_STRPTIME=0; AC_SUBST([GNULIB_STRPTIME]) GNULIB_TIMEGM=0; AC_SUBST([GNULIB_TIMEGM]) + GNULIB_TIMESPEC_GET=0; AC_SUBST([GNULIB_TIMESPEC_GET]) GNULIB_TIME_R=0; AC_SUBST([GNULIB_TIME_R]) GNULIB_TIME_RZ=0; AC_SUBST([GNULIB_TIME_RZ]) GNULIB_TZSET=0; AC_SUBST([GNULIB_TZSET]) + dnl Support Microsoft deprecated alias function names by default. + GNULIB_MDA_TZSET=1; AC_SUBST([GNULIB_MDA_TZSET]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_DECL_LOCALTIME_R=1; AC_SUBST([HAVE_DECL_LOCALTIME_R]) HAVE_NANOSLEEP=1; AC_SUBST([HAVE_NANOSLEEP]) HAVE_STRPTIME=1; AC_SUBST([HAVE_STRPTIME]) HAVE_TIMEGM=1; AC_SUBST([HAVE_TIMEGM]) - HAVE_TZSET=1; AC_SUBST([HAVE_TZSET]) + HAVE_TIMESPEC_GET=1; AC_SUBST([HAVE_TIMESPEC_GET]) dnl Even GNU libc does not have timezone_t yet. HAVE_TIMEZONE_T=0; AC_SUBST([HAVE_TIMEZONE_T]) dnl If another module says to replace or to not replace, do that. diff -Nru datamash-1.7/m4/truncl.m4 datamash-1.8/m4/truncl.m4 --- datamash-1.7/m4/truncl.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/truncl.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # truncl.m4 serial 17 -dnl Copyright (C) 2007-2008, 2010-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2008, 2010-2021 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.7/m4/trunc.m4 datamash-1.8/m4/trunc.m4 --- datamash-1.7/m4/trunc.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/trunc.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # trunc.m4 serial 15 -dnl Copyright (C) 2007, 2010-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007, 2010-2021 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.7/m4/unistd_h.m4 datamash-1.8/m4/unistd_h.m4 --- datamash-1.7/m4/unistd_h.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/unistd_h.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# unistd_h.m4 serial 78 -dnl Copyright (C) 2006-2020 Free Software Foundation, Inc. +# unistd_h.m4 serial 85 +dnl Copyright (C) 2006-2021 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. @@ -41,15 +41,22 @@ # include # endif #endif - ]], [access chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir + ]], [access chdir chown copy_file_range dup dup2 dup3 environ euidaccess + execl execle execlp execv execve execvp execvpe + faccessat fchdir fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize - getgroups gethostname getlogin getlogin_r getpagesize getpass + getentropy getgroups gethostname getlogin getlogin_r getpagesize getpass getusershell setusershell endusershell group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite readlink readlinkat rmdir sethostname sleep symlink symlinkat truncate ttyname_r unlink unlinkat usleep]) AC_REQUIRE([AC_C_RESTRICT]) + + AC_CHECK_DECLS_ONCE([execvpe]) + if test $ac_cv_have_decl_execvpe = no; then + HAVE_DECL_EXECVPE=0 + fi ]) AC_DEFUN([gl_UNISTD_MODULE_INDICATOR], @@ -73,6 +80,13 @@ GNULIB_DUP3=0; AC_SUBST([GNULIB_DUP3]) GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON]) GNULIB_EUIDACCESS=0; AC_SUBST([GNULIB_EUIDACCESS]) + GNULIB_EXECL=0; AC_SUBST([GNULIB_EXECL]) + GNULIB_EXECLE=0; AC_SUBST([GNULIB_EXECLE]) + GNULIB_EXECLP=0; AC_SUBST([GNULIB_EXECLP]) + GNULIB_EXECV=0; AC_SUBST([GNULIB_EXECV]) + GNULIB_EXECVE=0; AC_SUBST([GNULIB_EXECVE]) + GNULIB_EXECVP=0; AC_SUBST([GNULIB_EXECVP]) + GNULIB_EXECVPE=0; AC_SUBST([GNULIB_EXECVPE]) GNULIB_FACCESSAT=0; AC_SUBST([GNULIB_FACCESSAT]) GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR]) GNULIB_FCHOWNAT=0; AC_SUBST([GNULIB_FCHOWNAT]) @@ -82,6 +96,7 @@ GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD]) GNULIB_GETDOMAINNAME=0; AC_SUBST([GNULIB_GETDOMAINNAME]) GNULIB_GETDTABLESIZE=0; AC_SUBST([GNULIB_GETDTABLESIZE]) + GNULIB_GETENTROPY=0; AC_SUBST([GNULIB_GETENTROPY]) GNULIB_GETGROUPS=0; AC_SUBST([GNULIB_GETGROUPS]) GNULIB_GETHOSTNAME=0; AC_SUBST([GNULIB_GETHOSTNAME]) GNULIB_GETLOGIN=0; AC_SUBST([GNULIB_GETLOGIN]) @@ -116,12 +131,34 @@ GNULIB_UNLINKAT=0; AC_SUBST([GNULIB_UNLINKAT]) GNULIB_USLEEP=0; AC_SUBST([GNULIB_USLEEP]) GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE]) + dnl Support Microsoft deprecated alias function names by default. + GNULIB_MDA_ACCESS=1; AC_SUBST([GNULIB_MDA_ACCESS]) + GNULIB_MDA_CHDIR=1; AC_SUBST([GNULIB_MDA_CHDIR]) + GNULIB_MDA_CLOSE=1; AC_SUBST([GNULIB_MDA_CLOSE]) + GNULIB_MDA_DUP=1; AC_SUBST([GNULIB_MDA_DUP]) + GNULIB_MDA_DUP2=1; AC_SUBST([GNULIB_MDA_DUP2]) + GNULIB_MDA_EXECL=1; AC_SUBST([GNULIB_MDA_EXECL]) + GNULIB_MDA_EXECLE=1; AC_SUBST([GNULIB_MDA_EXECLE]) + GNULIB_MDA_EXECLP=1; AC_SUBST([GNULIB_MDA_EXECLP]) + GNULIB_MDA_EXECV=1; AC_SUBST([GNULIB_MDA_EXECV]) + GNULIB_MDA_EXECVE=1; AC_SUBST([GNULIB_MDA_EXECVE]) + GNULIB_MDA_EXECVP=1; AC_SUBST([GNULIB_MDA_EXECVP]) + GNULIB_MDA_EXECVPE=1; AC_SUBST([GNULIB_MDA_EXECVPE]) + GNULIB_MDA_GETCWD=1; AC_SUBST([GNULIB_MDA_GETCWD]) + GNULIB_MDA_GETPID=1; AC_SUBST([GNULIB_MDA_GETPID]) + GNULIB_MDA_ISATTY=1; AC_SUBST([GNULIB_MDA_ISATTY]) + GNULIB_MDA_LSEEK=1; AC_SUBST([GNULIB_MDA_LSEEK]) + GNULIB_MDA_READ=1; AC_SUBST([GNULIB_MDA_READ]) + GNULIB_MDA_RMDIR=1; AC_SUBST([GNULIB_MDA_RMDIR]) + GNULIB_MDA_SWAB=1; AC_SUBST([GNULIB_MDA_SWAB]) + GNULIB_MDA_UNLINK=1; AC_SUBST([GNULIB_MDA_UNLINK]) + GNULIB_MDA_WRITE=1; AC_SUBST([GNULIB_MDA_WRITE]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_CHOWN=1; AC_SUBST([HAVE_CHOWN]) HAVE_COPY_FILE_RANGE=1; AC_SUBST([HAVE_COPY_FILE_RANGE]) - HAVE_DUP2=1; AC_SUBST([HAVE_DUP2]) HAVE_DUP3=1; AC_SUBST([HAVE_DUP3]) HAVE_EUIDACCESS=1; AC_SUBST([HAVE_EUIDACCESS]) + HAVE_EXECVPE=1; AC_SUBST([HAVE_EXECVPE]) HAVE_FACCESSAT=1; AC_SUBST([HAVE_FACCESSAT]) HAVE_FCHDIR=1; AC_SUBST([HAVE_FCHDIR]) HAVE_FCHOWNAT=1; AC_SUBST([HAVE_FCHOWNAT]) @@ -129,6 +166,7 @@ HAVE_FSYNC=1; AC_SUBST([HAVE_FSYNC]) HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE]) HAVE_GETDTABLESIZE=1; AC_SUBST([HAVE_GETDTABLESIZE]) + HAVE_GETENTROPY=1; AC_SUBST([HAVE_GETENTROPY]) HAVE_GETGROUPS=1; AC_SUBST([HAVE_GETGROUPS]) HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME]) HAVE_GETLOGIN=1; AC_SUBST([HAVE_GETLOGIN]) @@ -151,6 +189,7 @@ HAVE_UNLINKAT=1; AC_SUBST([HAVE_UNLINKAT]) HAVE_USLEEP=1; AC_SUBST([HAVE_USLEEP]) HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON]) + HAVE_DECL_EXECVPE=1; AC_SUBST([HAVE_DECL_EXECVPE]) 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]) @@ -168,6 +207,13 @@ REPLACE_CLOSE=0; AC_SUBST([REPLACE_CLOSE]) REPLACE_DUP=0; AC_SUBST([REPLACE_DUP]) REPLACE_DUP2=0; AC_SUBST([REPLACE_DUP2]) + REPLACE_EXECL=0; AC_SUBST([REPLACE_EXECL]) + REPLACE_EXECLE=0; AC_SUBST([REPLACE_EXECLE]) + REPLACE_EXECLP=0; AC_SUBST([REPLACE_EXECLP]) + REPLACE_EXECV=0; AC_SUBST([REPLACE_EXECV]) + REPLACE_EXECVE=0; AC_SUBST([REPLACE_EXECVE]) + REPLACE_EXECVP=0; AC_SUBST([REPLACE_EXECVP]) + REPLACE_EXECVPE=0; AC_SUBST([REPLACE_EXECVPE]) REPLACE_FACCESSAT=0; AC_SUBST([REPLACE_FACCESSAT]) REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT]) REPLACE_FTRUNCATE=0; AC_SUBST([REPLACE_FTRUNCATE]) @@ -198,6 +244,7 @@ REPLACE_UNLINKAT=0; AC_SUBST([REPLACE_UNLINKAT]) REPLACE_USLEEP=0; AC_SUBST([REPLACE_USLEEP]) REPLACE_WRITE=0; AC_SUBST([REPLACE_WRITE]) + UNISTD_H_HAVE_SYS_RANDOM_H=0; AC_SUBST([UNISTD_H_HAVE_SYS_RANDOM_H]) UNISTD_H_HAVE_WINSOCK2_H=0; AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H]) UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0; AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS]) diff -Nru datamash-1.7/m4/unlocked-io.m4 datamash-1.8/m4/unlocked-io.m4 --- datamash-1.7/m4/unlocked-io.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/unlocked-io.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,6 +1,6 @@ # unlocked-io.m4 serial 15 -# Copyright (C) 1998-2006, 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 1998-2006, 2009-2021 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.7/m4/vasnprintf.m4 datamash-1.8/m4/vasnprintf.m4 --- datamash-1.7/m4/vasnprintf.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/vasnprintf.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,298 @@ +# vasnprintf.m4 serial 38 +dnl Copyright (C) 2002-2004, 2006-2021 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_VASNPRINTF], +[ + AC_CHECK_FUNCS_ONCE([vasnprintf]) + if test $ac_cv_func_vasnprintf = no; then + gl_REPLACE_VASNPRINTF + fi +]) + +AC_DEFUN([gl_REPLACE_VASNPRINTF], +[ + AC_CHECK_FUNCS_ONCE([vasnprintf]) + AC_LIBOBJ([vasnprintf]) + AC_LIBOBJ([printf-args]) + AC_LIBOBJ([printf-parse]) + AC_LIBOBJ([asnprintf]) + if test $ac_cv_func_vasnprintf = yes; then + AC_DEFINE([REPLACE_VASNPRINTF], [1], + [Define if vasnprintf exists but is overridden by gnulib.]) + fi + gl_PREREQ_PRINTF_ARGS + gl_PREREQ_PRINTF_PARSE + gl_PREREQ_VASNPRINTF + gl_PREREQ_ASNPRINTF +]) + +# Prerequisites of lib/printf-args.h, lib/printf-args.c. +AC_DEFUN([gl_PREREQ_PRINTF_ARGS], +[ + AC_REQUIRE([gt_TYPE_WCHAR_T]) + AC_REQUIRE([gt_TYPE_WINT_T]) +]) + +# Prerequisites of lib/printf-parse.h, lib/printf-parse.c. +AC_DEFUN([gl_PREREQ_PRINTF_PARSE], +[ + AC_REQUIRE([gl_FEATURES_H]) + AC_REQUIRE([gt_TYPE_WCHAR_T]) + AC_REQUIRE([gt_TYPE_WINT_T]) + AC_REQUIRE([AC_TYPE_SIZE_T]) + AC_CHECK_TYPE([ptrdiff_t], , + [AC_DEFINE([ptrdiff_t], [long], + [Define as the type of the result of subtracting two pointers, if the system doesn't define it.]) + ]) + AC_REQUIRE([gt_AC_TYPE_INTMAX_T]) +]) + +# Prerequisites of lib/vasnprintf.c. +AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF], +[ + AC_REQUIRE([AC_FUNC_ALLOCA]) + AC_REQUIRE([gt_TYPE_WCHAR_T]) + AC_REQUIRE([gt_TYPE_WINT_T]) + AC_CHECK_FUNCS([snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb]) + dnl Use the _snprintf function only if it is declared (because on NetBSD it + dnl is defined as a weak alias of snprintf; we prefer to use the latter). + AC_CHECK_DECLS([_snprintf], , , [[#include ]]) + dnl Knowing DBL_EXPBIT0_WORD and DBL_EXPBIT0_BIT enables an optimization + dnl in the code for NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE. + AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION]) + dnl We can avoid a lot of code by assuming that snprintf's return value + dnl conforms to ISO C99. So check that. + AC_REQUIRE([gl_SNPRINTF_RETVAL_C99]) + case "$gl_cv_func_snprintf_retval_c99" in + *yes) + AC_DEFINE([HAVE_SNPRINTF_RETVAL_C99], [1], + [Define if the return value of the snprintf function is the number of + of bytes (excluding the terminating NUL) that would have been produced + if the buffer had been large enough.]) + ;; + esac + dnl Additionally, the use of %n can be eliminated by assuming that snprintf + dnl always produces NUL-terminated strings (no truncation). + AC_REQUIRE([gl_SNPRINTF_TRUNCATION_C99]) + case "$gl_cv_func_snprintf_truncation_c99" in + *yes) + AC_DEFINE([HAVE_SNPRINTF_TRUNCATION_C99], [1], + [Define if the string produced by the snprintf function is always NUL + terminated.]) + ;; + esac +]) + +# Extra prerequisites of lib/vasnprintf.c for supporting 'long double' +# arguments. +AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF_LONG_DOUBLE], +[ + AC_REQUIRE([gl_PRINTF_LONG_DOUBLE]) + case "$gl_cv_func_printf_long_double" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], + [Define if the vasnprintf implementation needs special code for + 'long double' arguments.]) + ;; + esac +]) + +# Extra prerequisites of lib/vasnprintf.c for supporting infinite 'double' +# arguments. +AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE], +[ + AC_REQUIRE([gl_PRINTF_INFINITE]) + case "$gl_cv_func_printf_infinite" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_INFINITE_DOUBLE], [1], + [Define if the vasnprintf implementation needs special code for + infinite 'double' arguments.]) + ;; + esac +]) + +# Extra prerequisites of lib/vasnprintf.c for supporting infinite 'long double' +# arguments. +AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE], +[ + AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE]) + dnl There is no need to set NEED_PRINTF_INFINITE_LONG_DOUBLE if + dnl NEED_PRINTF_LONG_DOUBLE is already set. + AC_REQUIRE([gl_PREREQ_VASNPRINTF_LONG_DOUBLE]) + case "$gl_cv_func_printf_long_double" in + *yes) + case "$gl_cv_func_printf_infinite_long_double" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_INFINITE_LONG_DOUBLE], [1], + [Define if the vasnprintf implementation needs special code for + infinite 'long double' arguments.]) + ;; + esac + ;; + esac +]) + +# Extra prerequisites of lib/vasnprintf.c for supporting the 'a' directive. +AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_A], +[ + AC_REQUIRE([gl_PRINTF_DIRECTIVE_A]) + case "$gl_cv_func_printf_directive_a" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], [1], + [Define if the vasnprintf implementation needs special code for + the 'a' and 'A' directives.]) + AC_CHECK_FUNCS([nl_langinfo]) + ;; + esac +]) + +# Extra prerequisites of lib/vasnprintf.c for supporting the 'F' directive. +AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_F], +[ + AC_REQUIRE([gl_PRINTF_DIRECTIVE_F]) + case "$gl_cv_func_printf_directive_f" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_DIRECTIVE_F], [1], + [Define if the vasnprintf implementation needs special code for + the 'F' directive.]) + ;; + esac +]) + +# Extra prerequisites of lib/vasnprintf.c for supporting the 'ls' directive. +AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_LS], +[ + AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS]) + case "$gl_cv_func_printf_directive_ls" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_DIRECTIVE_LS], [1], + [Define if the vasnprintf implementation needs special code for + the 'ls' directive.]) + ;; + esac +]) + +# Extra prerequisites of lib/vasnprintf.c for supporting the ' flag. +AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_GROUPING], +[ + AC_REQUIRE([gl_PRINTF_FLAG_GROUPING]) + case "$gl_cv_func_printf_flag_grouping" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_FLAG_GROUPING], [1], + [Define if the vasnprintf implementation needs special code for the + ' flag.]) + ;; + esac +]) + +# Extra prerequisites of lib/vasnprintf.c for supporting the '-' flag. +AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST], +[ + AC_REQUIRE([gl_PRINTF_FLAG_LEFTADJUST]) + case "$gl_cv_func_printf_flag_leftadjust" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_FLAG_LEFTADJUST], [1], + [Define if the vasnprintf implementation needs special code for the + '-' flag.]) + ;; + esac +]) + +# Extra prerequisites of lib/vasnprintf.c for supporting the 0 flag. +AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ZERO], +[ + AC_REQUIRE([gl_PRINTF_FLAG_ZERO]) + case "$gl_cv_func_printf_flag_zero" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_FLAG_ZERO], [1], + [Define if the vasnprintf implementation needs special code for the + 0 flag.]) + ;; + esac +]) + +# Extra prerequisites of lib/vasnprintf.c for supporting large precisions. +AC_DEFUN([gl_PREREQ_VASNPRINTF_PRECISION], +[ + AC_REQUIRE([gl_PRINTF_PRECISION]) + case "$gl_cv_func_printf_precision" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_UNBOUNDED_PRECISION], [1], + [Define if the vasnprintf implementation needs special code for + supporting large precisions without arbitrary bounds.]) + AC_DEFINE([NEED_PRINTF_DOUBLE], [1], + [Define if the vasnprintf implementation needs special code for + 'double' arguments.]) + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], + [Define if the vasnprintf implementation needs special code for + 'long double' arguments.]) + ;; + esac +]) + +# Extra prerequisites of lib/vasnprintf.c for surviving out-of-memory +# conditions. +AC_DEFUN([gl_PREREQ_VASNPRINTF_ENOMEM], +[ + AC_REQUIRE([gl_PRINTF_ENOMEM]) + case "$gl_cv_func_printf_enomem" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_ENOMEM], [1], + [Define if the vasnprintf implementation needs special code for + surviving out-of-memory conditions.]) + AC_DEFINE([NEED_PRINTF_DOUBLE], [1], + [Define if the vasnprintf implementation needs special code for + 'double' arguments.]) + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], + [Define if the vasnprintf implementation needs special code for + 'long double' arguments.]) + ;; + esac +]) + +# Prerequisites of lib/vasnprintf.c including all extras for POSIX compliance. +AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_EXTRAS], +[ + AC_REQUIRE([gl_PREREQ_VASNPRINTF]) + gl_PREREQ_VASNPRINTF_LONG_DOUBLE + gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE + gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE + gl_PREREQ_VASNPRINTF_DIRECTIVE_A + gl_PREREQ_VASNPRINTF_DIRECTIVE_F + gl_PREREQ_VASNPRINTF_DIRECTIVE_LS + gl_PREREQ_VASNPRINTF_FLAG_GROUPING + gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST + gl_PREREQ_VASNPRINTF_FLAG_ZERO + gl_PREREQ_VASNPRINTF_PRECISION + gl_PREREQ_VASNPRINTF_ENOMEM +]) + +# Prerequisites of lib/asnprintf.c. +AC_DEFUN([gl_PREREQ_ASNPRINTF], +[ +]) diff -Nru datamash-1.7/m4/version-etc.m4 datamash-1.8/m4/version-etc.m4 --- datamash-1.7/m4/version-etc.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/version-etc.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # version-etc.m4 serial 1 -# Copyright (C) 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 2009-2021 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.7/m4/visibility.m4 datamash-1.8/m4/visibility.m4 --- datamash-1.7/m4/visibility.m4 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/m4/visibility.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # visibility.m4 serial 6 -dnl Copyright (C) 2005, 2008, 2010-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2005, 2008, 2010-2021 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.7/m4/waitpid.m4 datamash-1.8/m4/waitpid.m4 --- datamash-1.7/m4/waitpid.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/waitpid.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,14 @@ +# waitpid.m4 serial 2 +dnl Copyright (C) 2010-2021 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_WAITPID], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + HAVE_WAITPID=1 + case $host_os in + mingw*) HAVE_WAITPID=0 ;; + esac +]) diff -Nru datamash-1.7/m4/warnings.m4 datamash-1.8/m4/warnings.m4 --- datamash-1.7/m4/warnings.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/warnings.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# warnings.m4 serial 14 -dnl Copyright (C) 2008-2020 Free Software Foundation, Inc. +# warnings.m4 serial 16 +dnl Copyright (C) 2008-2021 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. @@ -23,8 +23,6 @@ # The effects of this macro depend on the current language (_AC_LANG). AC_DEFUN([gl_COMPILER_OPTION_IF], [ -dnl FIXME: gl_Warn must be used unquoted until we can assume Autoconf -dnl 2.64 or newer. AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_[]_AC_LANG_ABBREV[]_$1])dnl AS_VAR_PUSHDEF([gl_Flags], [_AC_LANG_PREFIX[]FLAGS])dnl AS_LITERAL_IF([$1], @@ -34,13 +32,13 @@ -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;; esac m4_pushdef([gl_Positive], [$gl_positive])])dnl -AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], m4_defn([gl_Warn]), [ +AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], [gl_Warn], [ gl_save_compiler_FLAGS="$gl_Flags" gl_AS_VAR_APPEND(m4_defn([gl_Flags]), [" $gl_unknown_warnings_are_errors ]m4_defn([gl_Positive])["]) - AC_LINK_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([])])], - [AS_VAR_SET(gl_Warn, [yes])], - [AS_VAR_SET(gl_Warn, [no])]) + AC_LINK_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([[]])])], + [AS_VAR_SET([gl_Warn], [yes])], + [AS_VAR_SET([gl_Warn], [no])]) gl_Flags="$gl_save_compiler_FLAGS" ]) AS_VAR_IF(gl_Warn, [yes], [$2], [$3]) @@ -59,8 +57,7 @@ [_AC_LANG_DISPATCH([$0], _AC_LANG, $@)]) # Specialization for _AC_LANG = C. This macro can be AC_REQUIREd. -# Use of m4_defun rather than AC_DEFUN works around a bug in autoconf < 2.63b. -m4_defun([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C)], +AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C)], [ AC_LANG_PUSH([C]) gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL @@ -68,8 +65,7 @@ ]) # Specialization for _AC_LANG = C++. This macro can be AC_REQUIREd. -# Use of m4_defun rather than AC_DEFUN works around a bug in autoconf < 2.63b. -m4_defun([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C++)], +AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C++)], [ AC_LANG_PUSH([C++]) gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL @@ -77,8 +73,7 @@ ]) # Specialization for _AC_LANG = Objective C. This macro can be AC_REQUIREd. -# Use of m4_defun rather than AC_DEFUN works around a bug in autoconf < 2.63b. -m4_defun([gl_UNKNOWN_WARNINGS_ARE_ERRORS(Objective C)], +AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS(Objective C)], [ AC_LANG_PUSH([Objective C]) gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL diff -Nru datamash-1.7/m4/warn-on-use.m4 datamash-1.8/m4/warn-on-use.m4 --- datamash-1.7/m4/warn-on-use.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/warn-on-use.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# warn-on-use.m4 serial 6 -dnl Copyright (C) 2010-2020 Free Software Foundation, Inc. +# warn-on-use.m4 serial 9 +dnl Copyright (C) 2010-2021 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. @@ -30,17 +30,15 @@ [AH_TEMPLATE([HAVE_RAW_DECL_]AS_TR_CPP(m4_defn([gl_decl])), [Define to 1 if ]m4_defn([gl_decl])[ is declared even after undefining macros.])])dnl -dnl FIXME: gl_Symbol must be used unquoted until we can assume -dnl autoconf 2.64 or newer. for gl_func in m4_flatten([$2]); do AS_VAR_PUSHDEF([gl_Symbol], [gl_cv_have_raw_decl_$gl_func])dnl AC_CACHE_CHECK([whether $gl_func is declared without a macro], - gl_Symbol, + [gl_Symbol], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$1], -[@%:@undef $gl_func - (void) $gl_func;])], - [AS_VAR_SET(gl_Symbol, [yes])], [AS_VAR_SET(gl_Symbol, [no])])]) - AS_VAR_IF(gl_Symbol, [yes], +[[#undef $gl_func + (void) $gl_func;]])], + [AS_VAR_SET([gl_Symbol], [yes])], [AS_VAR_SET([gl_Symbol], [no])])]) + AS_VAR_IF([gl_Symbol], [yes], [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1]) dnl shortcut - if the raw declaration exists, then set a cache dnl variable to allow skipping any later AC_CHECK_DECL efforts diff -Nru datamash-1.7/m4/wchar_h.m4 datamash-1.8/m4/wchar_h.m4 --- datamash-1.7/m4/wchar_h.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/wchar_h.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,13 +1,13 @@ dnl A placeholder for ISO C99 , for platforms that have issues. -dnl Copyright (C) 2007-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2007-2021 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 45 +# wchar_h.m4 serial 50 AC_DEFUN([gl_WCHAR_H], [ @@ -40,25 +40,24 @@ dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[ -/* 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 + #include ]], [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb - wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset + wcsrtombs wcsnrtombs wcwidth + wmemchr wmemcmp wmemcpy wmemmove wmempcpy wmemset wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth wcsftime ]) AC_REQUIRE([AC_C_RESTRICT]) + + AC_CHECK_DECLS([wcsdup], [], [], [[ + #include + ]]) + if test $ac_cv_have_decl_wcsdup = no; then + HAVE_DECL_WCSDUP=0 + fi ]) dnl Check whether is usable at all. @@ -69,56 +68,49 @@ dnl and . In summary, dnl glibc version 2.5 or older, together with gcc version 4.3 or newer and dnl the option -std=c99 or -std=gnu99, leads to a broken . + AC_REQUIRE([AC_CANONICAL_HOST]) AC_CACHE_CHECK([whether uses 'inline' correctly], [gl_cv_header_wchar_h_correct_inline], [gl_cv_header_wchar_h_correct_inline=yes - AC_LANG_CONFTEST([ - AC_LANG_SOURCE([[#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(); } -]])]) - 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 echo '#include "conftest.c"' >conftest1.c && - AC_TRY_EVAL([ac_compile]); then - AC_LANG_CONFTEST([ - AC_LANG_SOURCE([[#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; } -]])]) - dnl See note above about renaming object files. - ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/` - if echo '#include "conftest.c"' >conftest2.c && - AC_TRY_EVAL([ac_compile]); then - if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then - : - else - gl_cv_header_wchar_h_correct_inline=no + case "$host_os" in + *-gnu* | gnu*) + AC_LANG_CONFTEST([ + AC_LANG_SOURCE([[ + #define wcstod renamed_wcstod + #include + 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 echo '#include "conftest.c"' >conftest1.c \ + && AC_TRY_EVAL([ac_compile]); then + AC_LANG_CONFTEST([ + AC_LANG_SOURCE([[ + #define wcstod renamed_wcstod + #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 echo '#include "conftest.c"' >conftest2.c \ + && AC_TRY_EVAL([ac_compile]); then + if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then + : + else + gl_cv_header_wchar_h_correct_inline=no + fi + fi fi - fi - fi - ac_compile="$save_ac_compile" - rm -f conftest[12].c conftest[12].$ac_objext conftest$ac_exeext + ac_compile="$save_ac_compile" + rm -f conftest[12].c conftest[12].$ac_objext conftest$ac_exeext + ;; + esac ]) if test $gl_cv_header_wchar_h_correct_inline = no; then AC_MSG_ERROR([ cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS). @@ -159,6 +151,7 @@ GNULIB_WMEMCMP=0; AC_SUBST([GNULIB_WMEMCMP]) GNULIB_WMEMCPY=0; AC_SUBST([GNULIB_WMEMCPY]) GNULIB_WMEMMOVE=0; AC_SUBST([GNULIB_WMEMMOVE]) + GNULIB_WMEMPCPY=0; AC_SUBST([GNULIB_WMEMPCPY]) GNULIB_WMEMSET=0; AC_SUBST([GNULIB_WMEMSET]) GNULIB_WCSLEN=0; AC_SUBST([GNULIB_WCSLEN]) GNULIB_WCSNLEN=0; AC_SUBST([GNULIB_WCSNLEN]) @@ -184,6 +177,8 @@ GNULIB_WCSTOK=0; AC_SUBST([GNULIB_WCSTOK]) GNULIB_WCSWIDTH=0; AC_SUBST([GNULIB_WCSWIDTH]) GNULIB_WCSFTIME=0; AC_SUBST([GNULIB_WCSFTIME]) + dnl Support Microsoft deprecated alias function names by default. + GNULIB_MDA_WCSDUP=1; AC_SUBST([GNULIB_MDA_WCSDUP]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_BTOWC=1; AC_SUBST([HAVE_BTOWC]) HAVE_MBSINIT=1; AC_SUBST([HAVE_MBSINIT]) @@ -198,6 +193,7 @@ HAVE_WMEMCMP=1; AC_SUBST([HAVE_WMEMCMP]) HAVE_WMEMCPY=1; AC_SUBST([HAVE_WMEMCPY]) HAVE_WMEMMOVE=1; AC_SUBST([HAVE_WMEMMOVE]) + HAVE_WMEMPCPY=1; AC_SUBST([HAVE_WMEMPCPY]) HAVE_WMEMSET=1; AC_SUBST([HAVE_WMEMSET]) HAVE_WCSLEN=1; AC_SUBST([HAVE_WCSLEN]) HAVE_WCSNLEN=1; AC_SUBST([HAVE_WCSNLEN]) @@ -224,6 +220,7 @@ HAVE_WCSWIDTH=1; AC_SUBST([HAVE_WCSWIDTH]) HAVE_WCSFTIME=1; AC_SUBST([HAVE_WCSFTIME]) HAVE_DECL_WCTOB=1; AC_SUBST([HAVE_DECL_WCTOB]) + HAVE_DECL_WCSDUP=1; AC_SUBST([HAVE_DECL_WCSDUP]) HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH]) REPLACE_MBSTATE_T=0; AC_SUBST([REPLACE_MBSTATE_T]) REPLACE_BTOWC=0; AC_SUBST([REPLACE_BTOWC]) diff -Nru datamash-1.7/m4/wchar_t.m4 datamash-1.8/m4/wchar_t.m4 --- datamash-1.7/m4/wchar_t.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/wchar_t.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # wchar_t.m4 serial 4 (gettext-0.18.2) -dnl Copyright (C) 2002-2003, 2008-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2003, 2008-2021 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.7/m4/wctype_h.m4 datamash-1.8/m4/wctype_h.m4 --- datamash-1.7/m4/wctype_h.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/wctype_h.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,8 +1,8 @@ -# wctype_h.m4 serial 24 +# wctype_h.m4 serial 26 dnl A placeholder for ISO C99 , for platforms that lack it. -dnl Copyright (C) 2006-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2006-2021 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. @@ -41,13 +41,6 @@ [ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ - /* 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; } @@ -57,7 +50,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #if __GNU_LIBRARY__ == 1 Linux libc5 i18n is broken. - #endif]], [])], + #endif]], [[]])], [gl_cv_func_iswcntrl_works="guessing yes"], [gl_cv_func_iswcntrl_works="guessing no"]) ]) @@ -92,14 +85,7 @@ REPLACE_TOWLOWER=0 else AC_CHECK_DECLS([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 + [[#include #if HAVE_WCTYPE_H # include #endif @@ -128,14 +114,7 @@ AC_CACHE_CHECK([for wctype_t], [gl_cv_type_wctype_t], [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 . */ - #include - #include - #include - #include + [[#include #if HAVE_WCTYPE_H # include #endif @@ -154,14 +133,7 @@ AC_CACHE_CHECK([for wctrans_t], [gl_cv_type_wctrans_t], [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 . */ - #include - #include - #include - #include + [[#include #include wctrans_t a; ]], @@ -176,14 +148,7 @@ dnl Check for declarations of anything we want to poison if the dnl corresponding gnulib module is not in use. gl_WARN_ON_USE_PREPARE([[ -/* 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 diff -Nru datamash-1.7/m4/wcwidth.m4 datamash-1.8/m4/wcwidth.m4 --- datamash-1.7/m4/wcwidth.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/wcwidth.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# wcwidth.m4 serial 30 -dnl Copyright (C) 2006-2020 Free Software Foundation, Inc. +# wcwidth.m4 serial 33 +dnl Copyright (C) 2006-2021 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. @@ -19,17 +19,8 @@ AC_CHECK_FUNCS_ONCE([wcwidth]) AC_CHECK_DECLS([wcwidth], [], [], [[ -/* AIX 3.2.5 declares wcwidth in . */ -#include -/* 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 + ]]) if test $ac_cv_have_decl_wcwidth != yes; then HAVE_DECL_WCWIDTH=0 fi @@ -50,8 +41,8 @@ if test $ac_cv_func_wcwidth = yes || test $gl_cv_func_wcwidth_macro = yes; then HAVE_WCWIDTH=1 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 NetBSD 9.0, OpenBSD 5.0, wcwidth(0x05B0) (HEBREW POINT SHEVA) returns 1. + dnl On NetBSD 9.0, 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). dnl On Solaris 11.4, wcwidth(0x2202) (PARTIAL DIFFERENTIAL) returns 2, @@ -62,15 +53,6 @@ AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include -/* AIX 3.2.5 declares wcwidth in . */ -#include -/* 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_DECL_WCWIDTH extern diff -Nru datamash-1.7/m4/wint_t.m4 datamash-1.8/m4/wint_t.m4 --- datamash-1.7/m4/wint_t.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/wint_t.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ -# wint_t.m4 serial 7 -dnl Copyright (C) 2003, 2007-2020 Free Software Foundation, Inc. +# wint_t.m4 serial 10 +dnl Copyright (C) 2003, 2007-2021 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. @@ -14,15 +14,7 @@ AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t], [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 . */ -#include -#include -#include -#include + [[#include wint_t foo = (wchar_t)'\0';]], [[]])], [gt_cv_c_wint_t=yes], @@ -32,25 +24,16 @@ 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_CACHE_CHECK([whether wint_t is large enough], + [gl_cv_type_wint_t_large_enough], [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 + [AC_LANG_PROGRAM( + [[#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 + ]])], + [gl_cv_type_wint_t_large_enough=yes], + [gl_cv_type_wint_t_large_enough=no])]) + if test $gl_cv_type_wint_t_large_enough = no; then GNULIB_OVERRIDES_WINT_T=1 else GNULIB_OVERRIDES_WINT_T=0 diff -Nru datamash-1.7/m4/xalloc.m4 datamash-1.8/m4/xalloc.m4 --- datamash-1.7/m4/xalloc.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/xalloc.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # xalloc.m4 serial 18 -dnl Copyright (C) 2002-2006, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009-2021 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.7/m4/xsize.m4 datamash-1.8/m4/xsize.m4 --- datamash-1.7/m4/xsize.m4 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/m4/xsize.m4 2022-05-28 01:46:59.000000000 +0000 @@ -0,0 +1,12 @@ +# xsize.m4 serial 5 +dnl Copyright (C) 2003-2004, 2008-2021 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_XSIZE], +[ + dnl Prerequisites of lib/xsize.h. + AC_REQUIRE([gl_SIZE_MAX]) + AC_CHECK_HEADERS([stdint.h]) +]) diff -Nru datamash-1.7/m4/xstrndup.m4 datamash-1.8/m4/xstrndup.m4 --- datamash-1.7/m4/xstrndup.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/xstrndup.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # xstrndup.m4 serial 2 -dnl Copyright (C) 2003, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2003, 2009-2021 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.7/m4/xstrtol.m4 datamash-1.8/m4/xstrtol.m4 --- datamash-1.7/m4/xstrtol.m4 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/m4/xstrtol.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ #serial 11 -dnl Copyright (C) 2002-2007, 2009-2020 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2007, 2009-2021 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.7/m4/zzgnulib.m4 datamash-1.8/m4/zzgnulib.m4 --- datamash-1.7/m4/zzgnulib.m4 2020-04-23 04:03:29.000000000 +0000 +++ datamash-1.8/m4/zzgnulib.m4 2022-05-28 01:46:59.000000000 +0000 @@ -1,5 +1,5 @@ # zzgnulib.m4 serial 1 -dnl Copyright (C) 2020 Free Software Foundation, Inc. +dnl Copyright (C) 2020-2021 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.7/maint.mk datamash-1.8/maint.mk --- datamash-1.7/maint.mk 2020-04-23 04:03:38.000000000 +0000 +++ datamash-1.8/maint.mk 2022-07-23 02:00:28.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-2020 Free Software Foundation, Inc. +## Copyright (C) 2001-2021 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 @@ -163,7 +163,7 @@ _cfg_mk := $(wildcard $(srcdir)/cfg.mk) # Collect the names of rules starting with 'sc_'. -syntax-check-rules := $(sort $(shell $(SED) -n \ +syntax-check-rules := $(sort $(shell env LC_ALL=C $(SED) -n \ 's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' $(srcdir)/$(ME) $(_cfg_mk))) .PHONY: $(syntax-check-rules) @@ -442,7 +442,7 @@ $(SED) -ne '/Makefile/{s/\.in$$//;p;}' | \ while read m; do \ $(MAKE) -qp -f $$m .DUMMY-TARGET 2>/dev/null | \ - $(AWK) -v file=$$m -e '$($@_awk_)' || exit 1; \ + $(AWK) -v file=$$m -e '$($@_awk_)' || exit 1; \ done; \ fi @@ -915,7 +915,7 @@ dummy /dev/null \ && { printf '$(ME): define the above' \ ' via some gnulib .h file\n' 1>&2; \ - exit 1; } \ + exit 1; } \ || :; \ fi # ================================================================== @@ -1150,10 +1150,10 @@ # Ensure that we don't accidentally insert an entry into an old NEWS block. sc_immutable_NEWS: - @if test -f $(srcdir)/NEWS; then \ - test "$(NEWS_hash)" = '$(old_NEWS_hash)' && : || \ - { echo '$(ME): you have modified old NEWS' 1>&2; exit 1; }; \ - fi +# @if test -f $(srcdir)/NEWS; then \ +# test "$(NEWS_hash)" = '$(old_NEWS_hash)' && : || \ +# { echo '$(ME): you have modified old NEWS' 1>&2; exit 1; }; \ +# fi # Update the hash stored above. Do this after each release and # for any corrections to old entries. @@ -1364,14 +1364,14 @@ $(_sc_search_regexp) vc-diff-check: - $(AM_V_GEN)(unset CDPATH; cd $(srcdir) && $(VC) diff) > vc-diffs || : - $(AM_V_at)if test -s vc-diffs; then \ - cat vc-diffs; \ - echo "Some files are locally modified:" 1>&2; \ - exit 1; \ - else \ - rm vc-diffs; \ - fi +# $(AM_V_GEN)(unset CDPATH; cd $(srcdir) && $(VC) diff) > vc-diffs || : +# $(AM_V_at)if test -s vc-diffs; then \ +# cat vc-diffs; \ +# echo "Some files are locally modified:" 1>&2; \ +# exit 1; \ +# else \ +# rm vc-diffs; \ +# fi rel-files = $(DIST_ARCHIVES) diff -Nru datamash-1.7/Makefile.am datamash-1.8/Makefile.am --- datamash-1.7/Makefile.am 2020-04-23 17:11:14.000000000 +0000 +++ datamash-1.8/Makefile.am 2022-06-24 20:23:10.000000000 +0000 @@ -1,4 +1,4 @@ -# Copyright (C) 2013-2020 Assaf Gordon +# Copyright (C) 2013-2021 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 @@ -61,9 +61,11 @@ $(LIB_CRYPTO) \ $(LIB_HARD_LOCALE) \ $(LIB_MBRTOWC) \ + $(LIB_SETLOCALE) \ $(LIB_SETLOCALE_NULL) \ $(LIBICONV) \ $(LIBINTL) \ + $(LIBTHREAD) \ $(LOG_LIBM) \ $(LOGL_LIBM) \ $(MODF_LIBM) \ @@ -73,7 +75,8 @@ $(SQRT_LIBM) \ $(SQRTL_LIBM) \ $(TRUNC_LIBM) \ - $(TRUNCL_LIBM) + $(TRUNCL_LIBM) \ + $(INTL_MACOSX_LIBS) decorate_SOURCES = src/decorate.c \ src/key-compare.c src/key-compare.h \ @@ -89,8 +92,10 @@ -DKEY_COMPARE_VERSION decorate_LDADD = lib/lib$(PACKAGE).a \ + $(INET_PTON_LIB) \ $(LIBICONV) \ - $(LIBINTL) + $(LIBINTL) \ + $(LIB_MBRTOWC) # Add LOCALDIR for gettext localedir = $(datadir)/locale @@ -152,7 +157,9 @@ TESTS = \ tests/datamash-show-env.sh \ tests/datamash-tests.pl \ + tests/datamash-tests-deprecated.pl \ tests/datamash-tests-2.pl \ + tests/datamash-tests-2-deprecated.pl \ tests/datamash-parser.pl \ tests/datamash-error-msgs.pl \ tests/datamash-md5.pl \ @@ -165,9 +172,12 @@ tests/datamash-pair-tests.pl \ tests/datamash-check-tabular.pl \ tests/datamash-output-format.pl \ - tests/datamash-sort-header.sh \ + tests/datamash-i18n-de.pl \ + tests/datamash-sort-header.pl \ + tests/datamash-sort-header-deprecated.pl \ tests/datamash-sort-errors.sh \ tests/datamash-io-errors.sh \ + tests/datamash-io-errors-cheap.sh \ tests/datamash-strbin.sh \ tests/datamash-valgrind.sh \ tests/decorate-tests.pl \ diff -Nru datamash-1.7/Makefile.in datamash-1.8/Makefile.in --- datamash-1.7/Makefile.in 2020-04-23 17:34:04.000000000 +0000 +++ datamash-1.8/Makefile.in 2022-06-24 20:24:04.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,7 +14,7 @@ @SET_MAKE@ -# Copyright (C) 2013-2020 Assaf Gordon +# Copyright (C) 2013-2021 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-2020 Assaf Gordon +# Copyright (C) 2014-2021 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-2020 Free Software Foundation, Inc. +# Copyright (C) 2002-2021 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 @@ -81,6 +81,8 @@ # crypto/sha512 \ # dirname \ # do-release-commit-and-tag \ +# dup2 \ +# errno \ # error \ # expl \ # extensions \ @@ -90,7 +92,7 @@ # fpucw \ # gendocs \ # getopt-gnu \ -# gettext \ +# gettext-h \ # git-version-gen \ # gitlog-to-changelog \ # gnu-web-doc-update \ @@ -100,6 +102,8 @@ # hash-pjw \ # hash-pjw-bare \ # ignore-value \ +# inet_pton \ +# inline \ # intprops \ # inttostr \ # inttypes \ @@ -110,31 +114,42 @@ # localeconv \ # logl \ # maintainer-makefile \ -# mbsrtowcs \ # minmax \ # modfl \ # netinet_in \ # non-recursive-gnulib-prefix-hack \ +# pclose \ # pmccabe2html \ +# popen \ # progname \ # propername \ # random \ # readme-release \ # realloc-gnu \ # roundl \ +# setlocale \ +# sh-quote \ +# signbit \ # size_max \ +# snprintf \ # sqrtl \ +# std-gnu11 \ +# stdbool \ # stdint \ # stdnoreturn \ # stpcpy \ +# strcase \ +# strdup-posix \ # strsep \ +# strtold \ +# strtoll \ # sys_socket \ # unlocked-io \ # update-copyright \ # version-etc \ +# waitpid \ # warnings \ # xalloc \ -# xstrndup \ # xstrtol \ # xstrtol-error \ # xstrtoumax @@ -148,7 +163,7 @@ # Software Foundation, Inc. # Modifications for GNU Datamash are -# Copyright (C) 2014-2020 Assaf Gordon +# Copyright (C) 2014-2021 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 @@ -248,20 +263,23 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ $(top_srcdir)/m4/__inline.m4 \ $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/af_alg.m4 \ - $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/assert.m4 \ - $(top_srcdir)/m4/base64.m4 $(top_srcdir)/m4/byteswap.m4 \ - $(top_srcdir)/m4/calloc.m4 $(top_srcdir)/m4/ceil.m4 \ - $(top_srcdir)/m4/ceill.m4 $(top_srcdir)/m4/check-math-lib.m4 \ + $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/arpa_inet_h.m4 \ + $(top_srcdir)/m4/assert.m4 $(top_srcdir)/m4/base64.m4 \ + $(top_srcdir)/m4/byteswap.m4 $(top_srcdir)/m4/calloc.m4 \ + $(top_srcdir)/m4/ceil.m4 $(top_srcdir)/m4/ceill.m4 \ + $(top_srcdir)/m4/check-math-lib.m4 $(top_srcdir)/m4/close.m4 \ $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/configmake.m4 \ - $(top_srcdir)/m4/ctype.m4 $(top_srcdir)/m4/dirname.m4 \ - $(top_srcdir)/m4/double-slash-root.m4 \ + $(top_srcdir)/m4/ctype.m4 \ + $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup2.m4 \ $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/errno_h.m4 \ $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/exp.m4 \ $(top_srcdir)/m4/expl.m4 $(top_srcdir)/m4/exponentd.m4 \ $(top_srcdir)/m4/exponentf.m4 $(top_srcdir)/m4/exponentl.m4 \ $(top_srcdir)/m4/extensions.m4 \ $(top_srcdir)/m4/extern-inline.m4 $(top_srcdir)/m4/fabs.m4 \ - $(top_srcdir)/m4/fabsl.m4 $(top_srcdir)/m4/fflush.m4 \ + $(top_srcdir)/m4/fabsl.m4 $(top_srcdir)/m4/fcntl-o.m4 \ + $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \ + $(top_srcdir)/m4/fflush.m4 $(top_srcdir)/m4/flexmember.m4 \ $(top_srcdir)/m4/float_h.m4 $(top_srcdir)/m4/floor.m4 \ $(top_srcdir)/m4/floorl.m4 $(top_srcdir)/m4/fpending.m4 \ $(top_srcdir)/m4/fpieee.m4 $(top_srcdir)/m4/fpurge.m4 \ @@ -269,74 +287,92 @@ $(top_srcdir)/m4/frexpl.m4 $(top_srcdir)/m4/fseek.m4 \ $(top_srcdir)/m4/fseeko.m4 $(top_srcdir)/m4/fstat.m4 \ $(top_srcdir)/m4/ftell.m4 $(top_srcdir)/m4/ftello.m4 \ - $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/getprogname.m4 \ - $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gl-openssl.m4 \ + $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \ + $(top_srcdir)/m4/getprogname.m4 $(top_srcdir)/m4/gettext.m4 \ + $(top_srcdir)/m4/gl-openssl.m4 \ $(top_srcdir)/m4/gnulib-common.m4 \ $(top_srcdir)/m4/gnulib-comp.m4 \ $(top_srcdir)/m4/host-cpu-c-abi.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/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/iswdigit.m4 \ - $(top_srcdir)/m4/iswxdigit.m4 $(top_srcdir)/m4/largefile.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/include_next.m4 $(top_srcdir)/m4/inet_pton.m4 \ + $(top_srcdir)/m4/inline.m4 \ + $(top_srcdir)/m4/intl-thread-locale.m4 \ + $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intmax_t.m4 \ + $(top_srcdir)/m4/inttostr.m4 $(top_srcdir)/m4/inttypes.m4 \ + $(top_srcdir)/m4/inttypes_h.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/iswdigit.m4 $(top_srcdir)/m4/iswxdigit.m4 \ + $(top_srcdir)/m4/langinfo_h.m4 $(top_srcdir)/m4/largefile.m4 \ + $(top_srcdir)/m4/lcmessage.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/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/log.m4 \ + $(top_srcdir)/m4/localeconv.m4 $(top_srcdir)/m4/localename.m4 \ + $(top_srcdir)/m4/lock.m4 $(top_srcdir)/m4/log.m4 \ $(top_srcdir)/m4/logl.m4 $(top_srcdir)/m4/lseek.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/mbslen.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/mode_t.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/netinet_in_h.m4 $(top_srcdir)/m4/nls.m4 \ $(top_srcdir)/m4/nocrash.m4 \ $(top_srcdir)/m4/non-recursive-gnulib-prefix-hack.m4 \ - $(top_srcdir)/m4/off_t.m4 $(top_srcdir)/m4/pathmax.m4 \ - $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/off_t.m4 $(top_srcdir)/m4/open-cloexec.m4 \ + $(top_srcdir)/m4/open-slash.m4 $(top_srcdir)/m4/open.m4 \ + $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/pclose.m4 \ + $(top_srcdir)/m4/pid_t.m4 $(top_srcdir)/m4/po.m4 \ + $(top_srcdir)/m4/popen.m4 $(top_srcdir)/m4/printf.m4 \ + $(top_srcdir)/m4/progtest.m4 \ + $(top_srcdir)/m4/pthread_rwlock_rdlock.m4 \ $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/random.m4 \ $(top_srcdir)/m4/random_r.m4 $(top_srcdir)/m4/realloc.m4 \ $(top_srcdir)/m4/round.m4 $(top_srcdir)/m4/roundl.m4 \ + $(top_srcdir)/m4/setlocale.m4 \ $(top_srcdir)/m4/setlocale_null.m4 $(top_srcdir)/m4/sha1.m4 \ $(top_srcdir)/m4/sha256.m4 $(top_srcdir)/m4/sha512.m4 \ $(top_srcdir)/m4/signbit.m4 $(top_srcdir)/m4/size_max.m4 \ - $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/sqrt.m4 \ + $(top_srcdir)/m4/snprintf.m4 $(top_srcdir)/m4/socklen.m4 \ + $(top_srcdir)/m4/sockpfaf.m4 $(top_srcdir)/m4/sqrt.m4 \ $(top_srcdir)/m4/sqrtl.m4 $(top_srcdir)/m4/ssize_t.m4 \ - $(top_srcdir)/m4/stat-time.m4 $(top_srcdir)/m4/std-gnu11.m4 \ - $(top_srcdir)/m4/stdalign.m4 $(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/stat-time.m4 $(top_srcdir)/m4/stat.m4 \ + $(top_srcdir)/m4/std-gnu11.m4 $(top_srcdir)/m4/stdalign.m4 \ + $(top_srcdir)/m4/stdarg.m4 $(top_srcdir)/m4/stdbool.m4 \ + $(top_srcdir)/m4/stddef_h.m4 $(top_srcdir)/m4/stdint.m4 \ + $(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/stdio_h.m4 \ $(top_srcdir)/m4/stdlib_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/stpcpy.m4 $(top_srcdir)/m4/strcase.m4 \ + $(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strerror.m4 \ + $(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strings_h.m4 \ + $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \ + $(top_srcdir)/m4/strsep.m4 $(top_srcdir)/m4/strtod.m4 \ + $(top_srcdir)/m4/strtold.m4 $(top_srcdir)/m4/strtoll.m4 \ $(top_srcdir)/m4/strtoull.m4 $(top_srcdir)/m4/strtoumax.m4 \ $(top_srcdir)/m4/sys_socket_h.m4 \ $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_types_h.m4 \ - $(top_srcdir)/m4/sys_uio_h.m4 $(top_srcdir)/m4/threadlib.m4 \ - $(top_srcdir)/m4/time_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/visibility.m4 \ + $(top_srcdir)/m4/sys_uio_h.m4 $(top_srcdir)/m4/sys_wait_h.m4 \ + $(top_srcdir)/m4/threadlib.m4 $(top_srcdir)/m4/time_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/vasnprintf.m4 $(top_srcdir)/m4/version-etc.m4 \ + $(top_srcdir)/m4/visibility.m4 $(top_srcdir)/m4/waitpid.m4 \ $(top_srcdir)/m4/warn-on-use.m4 $(top_srcdir)/m4/warnings.m4 \ $(top_srcdir)/m4/wchar_h.m4 $(top_srcdir)/m4/wchar_t.m4 \ $(top_srcdir)/m4/wctype_h.m4 $(top_srcdir)/m4/wcwidth.m4 \ $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xalloc.m4 \ - $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/m4/xstrtol.m4 \ - $(top_srcdir)/m4/zzgnulib.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \ + $(top_srcdir)/m4/xstrtol.m4 $(top_srcdir)/m4/zzgnulib.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ @@ -361,65 +397,71 @@ lib_libdatamash_a_AR = $(AR) $(ARFLAGS) am__DEPENDENCIES_1 = am__lib_libdatamash_a_SOURCES_DIST = 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/af_alg.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/freading.c \ + lib/basename-lgpl.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/cloexec.c lib/close-stream.c \ + lib/closeout.c lib/af_alg.c lib/md5.c lib/sha1.c lib/sha256.c \ + lib/sha512.c lib/dirname.c lib/basename.c lib/dirname-lgpl.c \ + lib/stripslash.c lib/exitfail.c lib/fd-hook.c lib/freading.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.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/setlocale_null.c lib/size_max.h lib/stat-time.c \ - lib/striconv.h lib/striconv.c lib/strnlen1.h lib/strnlen1.c \ - lib/sys_socket.c lib/trim.c lib/u64.c lib/unistd.c \ + lib/localename.c lib/localename-table.c lib/glthread/lock.h \ + lib/glthread/lock.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/setlocale_null.c lib/sh-quote.h \ + lib/sh-quote.c lib/size_max.h lib/stat-time.c lib/striconv.h \ + lib/striconv.c lib/strnlen1.h lib/strnlen1.c lib/sys_socket.c \ + lib/glthread/threadlib.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/xmalloc.c lib/xalloc-die.c lib/xsize.h lib/xsize.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) \ @LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE@ lib/unistr/u8-uctomb-aux.$(OBJEXT) @LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE@am__objects_3 = lib/uniwidth/width.$(OBJEXT) am_lib_libdatamash_a_OBJECTS = lib/base64.$(OBJEXT) \ - lib/bitrotate.$(OBJEXT) lib/c-ctype.$(OBJEXT) \ - lib/c-strcasecmp.$(OBJEXT) lib/c-strncasecmp.$(OBJEXT) \ + lib/basename-lgpl.$(OBJEXT) lib/bitrotate.$(OBJEXT) \ + lib/c-ctype.$(OBJEXT) lib/c-strcasecmp.$(OBJEXT) \ + lib/c-strncasecmp.$(OBJEXT) lib/cloexec.$(OBJEXT) \ lib/close-stream.$(OBJEXT) lib/closeout.$(OBJEXT) \ lib/af_alg.$(OBJEXT) lib/md5.$(OBJEXT) lib/sha1.$(OBJEXT) \ lib/sha256.$(OBJEXT) lib/sha512.$(OBJEXT) \ lib/dirname.$(OBJEXT) lib/basename.$(OBJEXT) \ - lib/dirname-lgpl.$(OBJEXT) lib/basename-lgpl.$(OBJEXT) \ - lib/stripslash.$(OBJEXT) lib/exitfail.$(OBJEXT) \ + lib/dirname-lgpl.$(OBJEXT) lib/stripslash.$(OBJEXT) \ + lib/exitfail.$(OBJEXT) lib/fd-hook.$(OBJEXT) \ lib/freading.$(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) \ - lib/localcharset.$(OBJEXT) lib/malloca.$(OBJEXT) \ - lib/math.$(OBJEXT) lib/mbchar.$(OBJEXT) lib/mbiter.$(OBJEXT) \ - lib/mbslen.$(OBJEXT) lib/mbsstr.$(OBJEXT) \ + lib/localcharset.$(OBJEXT) lib/localename.$(OBJEXT) \ + lib/localename-table.$(OBJEXT) lib/glthread/lock.$(OBJEXT) \ + lib/malloca.$(OBJEXT) lib/math.$(OBJEXT) lib/mbchar.$(OBJEXT) \ + lib/mbiter.$(OBJEXT) lib/mbslen.$(OBJEXT) lib/mbsstr.$(OBJEXT) \ lib/mbuiter.$(OBJEXT) lib/progname.$(OBJEXT) \ lib/propername.$(OBJEXT) lib/quotearg.$(OBJEXT) \ - lib/setlocale_null.$(OBJEXT) lib/stat-time.$(OBJEXT) \ - lib/striconv.$(OBJEXT) lib/strnlen1.$(OBJEXT) \ - lib/sys_socket.$(OBJEXT) lib/trim.$(OBJEXT) lib/u64.$(OBJEXT) \ - lib/unistd.$(OBJEXT) $(am__objects_1) $(am__objects_2) \ - $(am__objects_3) lib/version-etc.$(OBJEXT) \ + lib/setlocale_null.$(OBJEXT) lib/sh-quote.$(OBJEXT) \ + lib/stat-time.$(OBJEXT) lib/striconv.$(OBJEXT) \ + lib/strnlen1.$(OBJEXT) lib/sys_socket.$(OBJEXT) \ + lib/glthread/threadlib.$(OBJEXT) lib/trim.$(OBJEXT) \ + lib/u64.$(OBJEXT) lib/unistd.$(OBJEXT) $(am__objects_1) \ + $(am__objects_2) $(am__objects_3) lib/version-etc.$(OBJEXT) \ lib/wctype-h.$(OBJEXT) lib/xmalloc.$(OBJEXT) \ - lib/xalloc-die.$(OBJEXT) lib/xstriconv.$(OBJEXT) \ - lib/xstrndup.$(OBJEXT) lib/xstrtol.$(OBJEXT) \ - lib/xstrtoul.$(OBJEXT) lib/xstrtol-error.$(OBJEXT) \ - lib/xstrtoumax.$(OBJEXT) + lib/xalloc-die.$(OBJEXT) lib/xsize.$(OBJEXT) \ + lib/xstriconv.$(OBJEXT) lib/xstrndup.$(OBJEXT) \ + lib/xstrtol.$(OBJEXT) lib/xstrtoul.$(OBJEXT) \ + lib/xstrtol-error.$(OBJEXT) lib/xstrtoumax.$(OBJEXT) lib_libdatamash_a_OBJECTS = $(am_lib_libdatamash_a_OBJECTS) am_datamash_OBJECTS = src/datamash-text-options.$(OBJEXT) \ src/datamash-utils.$(OBJEXT) src/datamash-text-lines.$(OBJEXT) \ @@ -446,7 +488,9 @@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) datamash_LINK = $(CCLD) $(datamash_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ am_decorate_OBJECTS = src/decorate-decorate.$(OBJEXT) \ @@ -454,6 +498,7 @@ src/decorate-decorate-functions.$(OBJEXT) decorate_OBJECTS = $(am_decorate_OBJECTS) decorate_DEPENDENCIES = lib/lib$(PACKAGE).a $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) decorate_LINK = $(CCLD) $(decorate_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ @@ -473,16 +518,19 @@ depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = lib/$(DEPDIR)/af_alg.Po \ - lib/$(DEPDIR)/anytostr.Po lib/$(DEPDIR)/base64.Po \ - lib/$(DEPDIR)/basename-lgpl.Po lib/$(DEPDIR)/basename.Po \ - lib/$(DEPDIR)/bitrotate.Po lib/$(DEPDIR)/c-ctype.Po \ - lib/$(DEPDIR)/c-strcasecmp.Po lib/$(DEPDIR)/c-strncasecmp.Po \ - lib/$(DEPDIR)/calloc.Po lib/$(DEPDIR)/ceil.Po \ - lib/$(DEPDIR)/ceill.Po lib/$(DEPDIR)/close-stream.Po \ - lib/$(DEPDIR)/closeout.Po lib/$(DEPDIR)/dirname-lgpl.Po \ - lib/$(DEPDIR)/dirname.Po lib/$(DEPDIR)/error.Po \ + lib/$(DEPDIR)/anytostr.Po lib/$(DEPDIR)/asnprintf.Po \ + lib/$(DEPDIR)/base64.Po lib/$(DEPDIR)/basename-lgpl.Po \ + lib/$(DEPDIR)/basename.Po lib/$(DEPDIR)/bitrotate.Po \ + lib/$(DEPDIR)/c-ctype.Po lib/$(DEPDIR)/c-strcasecmp.Po \ + lib/$(DEPDIR)/c-strncasecmp.Po lib/$(DEPDIR)/calloc.Po \ + lib/$(DEPDIR)/ceil.Po lib/$(DEPDIR)/ceill.Po \ + lib/$(DEPDIR)/cloexec.Po lib/$(DEPDIR)/close-stream.Po \ + lib/$(DEPDIR)/close.Po lib/$(DEPDIR)/closeout.Po \ + lib/$(DEPDIR)/dirname-lgpl.Po lib/$(DEPDIR)/dirname.Po \ + lib/$(DEPDIR)/dup2.Po lib/$(DEPDIR)/error.Po \ lib/$(DEPDIR)/exitfail.Po lib/$(DEPDIR)/expl-table.Po \ lib/$(DEPDIR)/expl.Po lib/$(DEPDIR)/fabsl.Po \ + lib/$(DEPDIR)/fcntl.Po lib/$(DEPDIR)/fd-hook.Po \ lib/$(DEPDIR)/fflush.Po lib/$(DEPDIR)/float.Po \ lib/$(DEPDIR)/floor.Po lib/$(DEPDIR)/floorl.Po \ lib/$(DEPDIR)/fpending.Po lib/$(DEPDIR)/fpurge.Po \ @@ -490,12 +538,13 @@ lib/$(DEPDIR)/frexpl.Po lib/$(DEPDIR)/fseek.Po \ lib/$(DEPDIR)/fseeko.Po lib/$(DEPDIR)/fstat.Po \ lib/$(DEPDIR)/ftell.Po lib/$(DEPDIR)/ftello.Po \ - lib/$(DEPDIR)/getopt.Po lib/$(DEPDIR)/getopt1.Po \ - lib/$(DEPDIR)/getprogname.Po lib/$(DEPDIR)/hard-locale.Po \ - lib/$(DEPDIR)/hash-pjw-bare.Po lib/$(DEPDIR)/hash-pjw.Po \ - lib/$(DEPDIR)/hash.Po lib/$(DEPDIR)/iconv.Po \ - lib/$(DEPDIR)/iconv_close.Po lib/$(DEPDIR)/iconv_open.Po \ - lib/$(DEPDIR)/imaxtostr.Po lib/$(DEPDIR)/inttostr.Po \ + lib/$(DEPDIR)/getdtablesize.Po lib/$(DEPDIR)/getopt.Po \ + lib/$(DEPDIR)/getopt1.Po lib/$(DEPDIR)/getprogname.Po \ + lib/$(DEPDIR)/hard-locale.Po lib/$(DEPDIR)/hash-pjw-bare.Po \ + lib/$(DEPDIR)/hash-pjw.Po lib/$(DEPDIR)/hash.Po \ + lib/$(DEPDIR)/iconv.Po lib/$(DEPDIR)/iconv_close.Po \ + lib/$(DEPDIR)/iconv_open.Po lib/$(DEPDIR)/imaxtostr.Po \ + lib/$(DEPDIR)/inet_pton.Po lib/$(DEPDIR)/inttostr.Po \ lib/$(DEPDIR)/isblank.Po lib/$(DEPDIR)/isfinite.Po \ lib/$(DEPDIR)/isinf.Po lib/$(DEPDIR)/isnan.Po \ lib/$(DEPDIR)/isnand.Po lib/$(DEPDIR)/isnanf.Po \ @@ -504,44 +553,58 @@ lib/$(DEPDIR)/itold.Po lib/$(DEPDIR)/lc-charset-dispatch.Po \ lib/$(DEPDIR)/ldexpl.Po lib/$(DEPDIR)/linebuffer.Po \ lib/$(DEPDIR)/localcharset.Po lib/$(DEPDIR)/localeconv.Po \ + lib/$(DEPDIR)/localename-table.Po lib/$(DEPDIR)/localename.Po \ lib/$(DEPDIR)/log.Po lib/$(DEPDIR)/logl.Po \ lib/$(DEPDIR)/lseek.Po lib/$(DEPDIR)/malloc.Po \ lib/$(DEPDIR)/malloca.Po lib/$(DEPDIR)/math.Po \ lib/$(DEPDIR)/mbchar.Po lib/$(DEPDIR)/mbiter.Po \ lib/$(DEPDIR)/mbrtowc.Po lib/$(DEPDIR)/mbsinit.Po \ - lib/$(DEPDIR)/mbslen.Po lib/$(DEPDIR)/mbsrtowcs-state.Po \ - lib/$(DEPDIR)/mbsrtowcs.Po lib/$(DEPDIR)/mbsstr.Po \ + lib/$(DEPDIR)/mbslen.Po lib/$(DEPDIR)/mbsstr.Po \ lib/$(DEPDIR)/mbtowc-lock.Po lib/$(DEPDIR)/mbuiter.Po \ lib/$(DEPDIR)/md5.Po lib/$(DEPDIR)/memchr.Po \ lib/$(DEPDIR)/modf.Po lib/$(DEPDIR)/modfl.Po \ lib/$(DEPDIR)/msvc-inval.Po lib/$(DEPDIR)/msvc-nothrow.Po \ - lib/$(DEPDIR)/offtostr.Po lib/$(DEPDIR)/progname.Po \ - lib/$(DEPDIR)/propername.Po lib/$(DEPDIR)/quotearg.Po \ - lib/$(DEPDIR)/random.Po lib/$(DEPDIR)/random_r.Po \ - lib/$(DEPDIR)/realloc.Po lib/$(DEPDIR)/round.Po \ - lib/$(DEPDIR)/roundl.Po lib/$(DEPDIR)/setlocale-lock.Po \ - lib/$(DEPDIR)/setlocale_null.Po lib/$(DEPDIR)/sha1.Po \ - lib/$(DEPDIR)/sha256.Po lib/$(DEPDIR)/sha512.Po \ - lib/$(DEPDIR)/signbitd.Po lib/$(DEPDIR)/signbitf.Po \ - lib/$(DEPDIR)/signbitl.Po lib/$(DEPDIR)/sqrtl.Po \ + lib/$(DEPDIR)/offtostr.Po lib/$(DEPDIR)/open.Po \ + lib/$(DEPDIR)/pclose.Po lib/$(DEPDIR)/popen.Po \ + lib/$(DEPDIR)/printf-args.Po lib/$(DEPDIR)/printf-parse.Po \ + lib/$(DEPDIR)/progname.Po lib/$(DEPDIR)/propername.Po \ + lib/$(DEPDIR)/quotearg.Po lib/$(DEPDIR)/random.Po \ + lib/$(DEPDIR)/random_r.Po lib/$(DEPDIR)/realloc.Po \ + lib/$(DEPDIR)/round.Po lib/$(DEPDIR)/roundl.Po \ + lib/$(DEPDIR)/setlocale-lock.Po lib/$(DEPDIR)/setlocale.Po \ + lib/$(DEPDIR)/setlocale_null.Po lib/$(DEPDIR)/sh-quote.Po \ + lib/$(DEPDIR)/sha1.Po lib/$(DEPDIR)/sha256.Po \ + lib/$(DEPDIR)/sha512.Po lib/$(DEPDIR)/signbitd.Po \ + lib/$(DEPDIR)/signbitf.Po lib/$(DEPDIR)/signbitl.Po \ + lib/$(DEPDIR)/snprintf.Po lib/$(DEPDIR)/sqrtl.Po \ lib/$(DEPDIR)/stat-time.Po lib/$(DEPDIR)/stat-w32.Po \ - lib/$(DEPDIR)/stpcpy.Po lib/$(DEPDIR)/strerror-override.Po \ - lib/$(DEPDIR)/strerror.Po lib/$(DEPDIR)/striconv.Po \ - lib/$(DEPDIR)/stripslash.Po lib/$(DEPDIR)/strndup.Po \ + lib/$(DEPDIR)/stat.Po lib/$(DEPDIR)/stpcpy.Po \ + lib/$(DEPDIR)/strcasecmp.Po lib/$(DEPDIR)/strdup.Po \ + lib/$(DEPDIR)/strerror-override.Po lib/$(DEPDIR)/strerror.Po \ + lib/$(DEPDIR)/striconv.Po lib/$(DEPDIR)/stripslash.Po \ + lib/$(DEPDIR)/strncasecmp.Po lib/$(DEPDIR)/strndup.Po \ lib/$(DEPDIR)/strnlen.Po lib/$(DEPDIR)/strnlen1.Po \ - lib/$(DEPDIR)/strsep.Po lib/$(DEPDIR)/strtoimax.Po \ - lib/$(DEPDIR)/strtol.Po lib/$(DEPDIR)/strtoul.Po \ - lib/$(DEPDIR)/strtoull.Po lib/$(DEPDIR)/strtoumax.Po \ - lib/$(DEPDIR)/sys_socket.Po lib/$(DEPDIR)/trim.Po \ - lib/$(DEPDIR)/trunc.Po lib/$(DEPDIR)/truncl.Po \ - lib/$(DEPDIR)/u64.Po lib/$(DEPDIR)/uinttostr.Po \ - lib/$(DEPDIR)/umaxtostr.Po lib/$(DEPDIR)/unistd.Po \ - lib/$(DEPDIR)/version-etc.Po lib/$(DEPDIR)/wctype-h.Po \ - lib/$(DEPDIR)/wcwidth.Po lib/$(DEPDIR)/xalloc-die.Po \ - lib/$(DEPDIR)/xmalloc.Po lib/$(DEPDIR)/xstriconv.Po \ - lib/$(DEPDIR)/xstrndup.Po lib/$(DEPDIR)/xstrtol-error.Po \ - lib/$(DEPDIR)/xstrtol.Po lib/$(DEPDIR)/xstrtoul.Po \ - lib/$(DEPDIR)/xstrtoumax.Po lib/unistr/$(DEPDIR)/u8-mbtoucr.Po \ + lib/$(DEPDIR)/strsep.Po lib/$(DEPDIR)/strtod.Po \ + lib/$(DEPDIR)/strtoimax.Po lib/$(DEPDIR)/strtol.Po \ + lib/$(DEPDIR)/strtold.Po lib/$(DEPDIR)/strtoll.Po \ + lib/$(DEPDIR)/strtoul.Po lib/$(DEPDIR)/strtoull.Po \ + lib/$(DEPDIR)/strtoumax.Po lib/$(DEPDIR)/sys_socket.Po \ + lib/$(DEPDIR)/trim.Po lib/$(DEPDIR)/trunc.Po \ + lib/$(DEPDIR)/truncl.Po lib/$(DEPDIR)/u64.Po \ + lib/$(DEPDIR)/uinttostr.Po lib/$(DEPDIR)/umaxtostr.Po \ + lib/$(DEPDIR)/unistd.Po lib/$(DEPDIR)/vasnprintf.Po \ + lib/$(DEPDIR)/version-etc.Po lib/$(DEPDIR)/waitpid.Po \ + lib/$(DEPDIR)/wctype-h.Po lib/$(DEPDIR)/wcwidth.Po \ + lib/$(DEPDIR)/windows-mutex.Po lib/$(DEPDIR)/windows-once.Po \ + lib/$(DEPDIR)/windows-recmutex.Po \ + lib/$(DEPDIR)/windows-rwlock.Po lib/$(DEPDIR)/xalloc-die.Po \ + lib/$(DEPDIR)/xmalloc.Po lib/$(DEPDIR)/xsize.Po \ + lib/$(DEPDIR)/xstriconv.Po lib/$(DEPDIR)/xstrndup.Po \ + lib/$(DEPDIR)/xstrtol-error.Po lib/$(DEPDIR)/xstrtol.Po \ + lib/$(DEPDIR)/xstrtoul.Po lib/$(DEPDIR)/xstrtoumax.Po \ + lib/glthread/$(DEPDIR)/lock.Po \ + lib/glthread/$(DEPDIR)/threadlib.Po \ + lib/unistr/$(DEPDIR)/u8-mbtoucr.Po \ lib/unistr/$(DEPDIR)/u8-uctomb-aux.Po \ lib/unistr/$(DEPDIR)/u8-uctomb.Po \ lib/uniwidth/$(DEPDIR)/width.Po \ @@ -676,8 +739,8 @@ AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope check recheck distdir distdir-am dist dist-all \ distcheck -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ - $(LISP)config.in +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ + config.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. @@ -694,9 +757,6 @@ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -CSCOPE = cscope am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no @@ -852,6 +912,7 @@ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) TEST_SUITE_LOG = test-suite.log am__test_logs1 = $(TESTS:=.log) @@ -885,8 +946,7 @@ $(top_srcdir)/build-aux/test-driver \ $(top_srcdir)/build-aux/texinfo.tex $(top_srcdir)/doc/local.mk \ $(top_srcdir)/lib/local.mk ABOUT-NLS AUTHORS COPYING ChangeLog \ - INSTALL NEWS README THANKS TODO build-aux/ar-lib \ - build-aux/compile build-aux/config.guess \ + INSTALL NEWS README THANKS 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 @@ -928,6 +988,8 @@ DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip +# Exists only to be overridden by the user if desired. +AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' @@ -960,6 +1022,8 @@ CONFIG_INCLUDE = @CONFIG_INCLUDE@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ DEPDIR = @DEPDIR@ @@ -974,6 +1038,7 @@ EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ ERRNO_H = @ERRNO_H@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ EXPL_LIBM = @EXPL_LIBM@ EXP_LIBM = @EXP_LIBM@ @@ -994,6 +1059,7 @@ GNULIB_ACCESS = @GNULIB_ACCESS@ GNULIB_ACOSF = @GNULIB_ACOSF@ GNULIB_ACOSL = @GNULIB_ACOSL@ +GNULIB_ALIGNED_ALLOC = @GNULIB_ALIGNED_ALLOC@ GNULIB_ASINF = @GNULIB_ASINF@ GNULIB_ASINL = @GNULIB_ASINL@ GNULIB_ATAN2F = @GNULIB_ATAN2F@ @@ -1021,6 +1087,7 @@ GNULIB_COSF = @GNULIB_COSF@ GNULIB_COSHF = @GNULIB_COSHF@ GNULIB_COSL = @GNULIB_COSL@ +GNULIB_CREAT = @GNULIB_CREAT@ GNULIB_CTIME = @GNULIB_CTIME@ GNULIB_DPRINTF = @GNULIB_DPRINTF@ GNULIB_DUP = @GNULIB_DUP@ @@ -1029,6 +1096,13 @@ GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@ GNULIB_ENVIRON = @GNULIB_ENVIRON@ GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@ +GNULIB_EXECL = @GNULIB_EXECL@ +GNULIB_EXECLE = @GNULIB_EXECLE@ +GNULIB_EXECLP = @GNULIB_EXECLP@ +GNULIB_EXECV = @GNULIB_EXECV@ +GNULIB_EXECVE = @GNULIB_EXECVE@ +GNULIB_EXECVP = @GNULIB_EXECVP@ +GNULIB_EXECVPE = @GNULIB_EXECVPE@ GNULIB_EXP2 = @GNULIB_EXP2@ GNULIB_EXP2F = @GNULIB_EXP2F@ GNULIB_EXP2L = @GNULIB_EXP2L@ @@ -1045,9 +1119,11 @@ GNULIB_FCHMODAT = @GNULIB_FCHMODAT@ GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@ GNULIB_FCLOSE = @GNULIB_FCLOSE@ +GNULIB_FCNTL = @GNULIB_FCNTL@ GNULIB_FDATASYNC = @GNULIB_FDATASYNC@ GNULIB_FDOPEN = @GNULIB_FDOPEN@ GNULIB_FFLUSH = @GNULIB_FFLUSH@ +GNULIB_FFS = @GNULIB_FFS@ GNULIB_FFSL = @GNULIB_FFSL@ GNULIB_FFSLL = @GNULIB_FFSLL@ GNULIB_FGETC = @GNULIB_FGETC@ @@ -1068,6 +1144,7 @@ GNULIB_FPUTC = @GNULIB_FPUTC@ GNULIB_FPUTS = @GNULIB_FPUTS@ GNULIB_FREAD = @GNULIB_FREAD@ +GNULIB_FREE_POSIX = @GNULIB_FREE_POSIX@ GNULIB_FREOPEN = @GNULIB_FREOPEN@ GNULIB_FREXP = @GNULIB_FREXP@ GNULIB_FREXPF = @GNULIB_FREXPF@ @@ -1089,6 +1166,7 @@ GNULIB_GETDELIM = @GNULIB_GETDELIM@ GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@ GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@ +GNULIB_GETENTROPY = @GNULIB_GETENTROPY@ GNULIB_GETGROUPS = @GNULIB_GETGROUPS@ GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@ GNULIB_GETLINE = @GNULIB_GETLINE@ @@ -1103,6 +1181,7 @@ GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@ GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@ GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@ +GNULIB_GETUMASK = @GNULIB_GETUMASK@ GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@ GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@ GNULIB_GRANTPT = @GNULIB_GRANTPT@ @@ -1116,6 +1195,8 @@ GNULIB_ILOGBL = @GNULIB_ILOGBL@ GNULIB_IMAXABS = @GNULIB_IMAXABS@ GNULIB_IMAXDIV = @GNULIB_IMAXDIV@ +GNULIB_INET_NTOP = @GNULIB_INET_NTOP@ +GNULIB_INET_PTON = @GNULIB_INET_PTON@ GNULIB_ISATTY = @GNULIB_ISATTY@ GNULIB_ISBLANK = @GNULIB_ISBLANK@ GNULIB_ISFINITE = @GNULIB_ISFINITE@ @@ -1176,10 +1257,58 @@ GNULIB_MBSSTR = @GNULIB_MBSSTR@ GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@ GNULIB_MBTOWC = @GNULIB_MBTOWC@ +GNULIB_MDA_ACCESS = @GNULIB_MDA_ACCESS@ +GNULIB_MDA_CHDIR = @GNULIB_MDA_CHDIR@ +GNULIB_MDA_CHMOD = @GNULIB_MDA_CHMOD@ +GNULIB_MDA_CLOSE = @GNULIB_MDA_CLOSE@ +GNULIB_MDA_CREAT = @GNULIB_MDA_CREAT@ +GNULIB_MDA_DUP = @GNULIB_MDA_DUP@ +GNULIB_MDA_DUP2 = @GNULIB_MDA_DUP2@ +GNULIB_MDA_ECVT = @GNULIB_MDA_ECVT@ +GNULIB_MDA_EXECL = @GNULIB_MDA_EXECL@ +GNULIB_MDA_EXECLE = @GNULIB_MDA_EXECLE@ +GNULIB_MDA_EXECLP = @GNULIB_MDA_EXECLP@ +GNULIB_MDA_EXECV = @GNULIB_MDA_EXECV@ +GNULIB_MDA_EXECVE = @GNULIB_MDA_EXECVE@ +GNULIB_MDA_EXECVP = @GNULIB_MDA_EXECVP@ +GNULIB_MDA_EXECVPE = @GNULIB_MDA_EXECVPE@ +GNULIB_MDA_FCLOSEALL = @GNULIB_MDA_FCLOSEALL@ +GNULIB_MDA_FCVT = @GNULIB_MDA_FCVT@ +GNULIB_MDA_FDOPEN = @GNULIB_MDA_FDOPEN@ +GNULIB_MDA_FILENO = @GNULIB_MDA_FILENO@ +GNULIB_MDA_GCVT = @GNULIB_MDA_GCVT@ +GNULIB_MDA_GETCWD = @GNULIB_MDA_GETCWD@ +GNULIB_MDA_GETPID = @GNULIB_MDA_GETPID@ +GNULIB_MDA_GETW = @GNULIB_MDA_GETW@ +GNULIB_MDA_ISATTY = @GNULIB_MDA_ISATTY@ +GNULIB_MDA_J0 = @GNULIB_MDA_J0@ +GNULIB_MDA_J1 = @GNULIB_MDA_J1@ +GNULIB_MDA_JN = @GNULIB_MDA_JN@ +GNULIB_MDA_LSEEK = @GNULIB_MDA_LSEEK@ +GNULIB_MDA_MEMCCPY = @GNULIB_MDA_MEMCCPY@ +GNULIB_MDA_MKDIR = @GNULIB_MDA_MKDIR@ +GNULIB_MDA_MKTEMP = @GNULIB_MDA_MKTEMP@ +GNULIB_MDA_OPEN = @GNULIB_MDA_OPEN@ +GNULIB_MDA_PUTENV = @GNULIB_MDA_PUTENV@ +GNULIB_MDA_PUTW = @GNULIB_MDA_PUTW@ +GNULIB_MDA_READ = @GNULIB_MDA_READ@ +GNULIB_MDA_RMDIR = @GNULIB_MDA_RMDIR@ +GNULIB_MDA_STRDUP = @GNULIB_MDA_STRDUP@ +GNULIB_MDA_SWAB = @GNULIB_MDA_SWAB@ +GNULIB_MDA_TEMPNAM = @GNULIB_MDA_TEMPNAM@ +GNULIB_MDA_TZSET = @GNULIB_MDA_TZSET@ +GNULIB_MDA_UMASK = @GNULIB_MDA_UMASK@ +GNULIB_MDA_UNLINK = @GNULIB_MDA_UNLINK@ +GNULIB_MDA_WCSDUP = @GNULIB_MDA_WCSDUP@ +GNULIB_MDA_WRITE = @GNULIB_MDA_WRITE@ +GNULIB_MDA_Y0 = @GNULIB_MDA_Y0@ +GNULIB_MDA_Y1 = @GNULIB_MDA_Y1@ +GNULIB_MDA_YN = @GNULIB_MDA_YN@ GNULIB_MEMCHR = @GNULIB_MEMCHR@ GNULIB_MEMMEM = @GNULIB_MEMMEM@ GNULIB_MEMPCPY = @GNULIB_MEMPCPY@ GNULIB_MEMRCHR = @GNULIB_MEMRCHR@ +GNULIB_MKDIR = @GNULIB_MKDIR@ GNULIB_MKDIRAT = @GNULIB_MKDIRAT@ GNULIB_MKDTEMP = @GNULIB_MKDTEMP@ GNULIB_MKFIFO = @GNULIB_MKFIFO@ @@ -1195,8 +1324,12 @@ GNULIB_MODFF = @GNULIB_MODFF@ GNULIB_MODFL = @GNULIB_MODFL@ GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@ +GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@ +GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@ GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@ +GNULIB_OPEN = @GNULIB_OPEN@ +GNULIB_OPENAT = @GNULIB_OPENAT@ GNULIB_OVERRIDES_STRUCT_STAT = @GNULIB_OVERRIDES_STRUCT_STAT@ GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@ GNULIB_PCLOSE = @GNULIB_PCLOSE@ @@ -1204,6 +1337,7 @@ GNULIB_PIPE = @GNULIB_PIPE@ GNULIB_PIPE2 = @GNULIB_PIPE2@ GNULIB_POPEN = @GNULIB_POPEN@ +GNULIB_POSIX_MEMALIGN = @GNULIB_POSIX_MEMALIGN@ GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@ GNULIB_POWF = @GNULIB_POWF@ GNULIB_PREAD = @GNULIB_PREAD@ @@ -1252,6 +1386,8 @@ GNULIB_SETLOCALE_NULL = @GNULIB_SETLOCALE_NULL@ GNULIB_SETSOCKOPT = @GNULIB_SETSOCKOPT@ GNULIB_SHUTDOWN = @GNULIB_SHUTDOWN@ +GNULIB_SIGABBREV_NP = @GNULIB_SIGABBREV_NP@ +GNULIB_SIGDESCR_NP = @GNULIB_SIGDESCR_NP@ GNULIB_SIGNBIT = @GNULIB_SIGNBIT@ GNULIB_SINF = @GNULIB_SINF@ GNULIB_SINHF = @GNULIB_SINHF@ @@ -1271,6 +1407,7 @@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@ GNULIB_STRDUP = @GNULIB_STRDUP@ GNULIB_STRERROR = @GNULIB_STRERROR@ +GNULIB_STRERRORNAME_NP = @GNULIB_STRERRORNAME_NP@ GNULIB_STRERROR_R = @GNULIB_STRERROR_R@ GNULIB_STRFTIME = @GNULIB_STRFTIME@ GNULIB_STRNCAT = @GNULIB_STRNCAT@ @@ -1296,6 +1433,7 @@ GNULIB_TANHF = @GNULIB_TANHF@ GNULIB_TANL = @GNULIB_TANL@ GNULIB_TIMEGM = @GNULIB_TIMEGM@ +GNULIB_TIMESPEC_GET = @GNULIB_TIMESPEC_GET@ GNULIB_TIME_R = @GNULIB_TIME_R@ GNULIB_TIME_RZ = @GNULIB_TIME_RZ@ GNULIB_TMPFILE = @GNULIB_TMPFILE@ @@ -1324,6 +1462,7 @@ GNULIB_VSCANF = @GNULIB_VSCANF@ GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@ GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@ +GNULIB_WAITPID = @GNULIB_WAITPID@ GNULIB_WCPCPY = @GNULIB_WCPCPY@ GNULIB_WCPNCPY = @GNULIB_WCPNCPY@ GNULIB_WCRTOMB = @GNULIB_WCRTOMB@ @@ -1360,6 +1499,7 @@ GNULIB_WMEMCMP = @GNULIB_WMEMCMP@ GNULIB_WMEMCPY = @GNULIB_WMEMCPY@ GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@ +GNULIB_WMEMPCPY = @GNULIB_WMEMPCPY@ GNULIB_WMEMSET = @GNULIB_WMEMSET@ GNULIB_WRITE = @GNULIB_WRITE@ GNULIB__EXIT = @GNULIB__EXIT@ @@ -1367,7 +1507,9 @@ HAVE_ACCEPT4 = @HAVE_ACCEPT4@ HAVE_ACOSF = @HAVE_ACOSF@ HAVE_ACOSL = @HAVE_ACOSL@ +HAVE_ALIGNED_ALLOC = @HAVE_ALIGNED_ALLOC@ HAVE_ALLOCA_H = @HAVE_ALLOCA_H@ +HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@ HAVE_ASINF = @HAVE_ASINF@ HAVE_ASINL = @HAVE_ASINL@ HAVE_ATAN2F = @HAVE_ATAN2F@ @@ -1397,13 +1539,17 @@ HAVE_DECL_CEILL = @HAVE_DECL_CEILL@ HAVE_DECL_COPYSIGNF = @HAVE_DECL_COPYSIGNF@ HAVE_DECL_COSL = @HAVE_DECL_COSL@ +HAVE_DECL_ECVT = @HAVE_DECL_ECVT@ HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@ +HAVE_DECL_EXECVPE = @HAVE_DECL_EXECVPE@ HAVE_DECL_EXP2 = @HAVE_DECL_EXP2@ HAVE_DECL_EXP2F = @HAVE_DECL_EXP2F@ HAVE_DECL_EXP2L = @HAVE_DECL_EXP2L@ HAVE_DECL_EXPL = @HAVE_DECL_EXPL@ HAVE_DECL_EXPM1L = @HAVE_DECL_EXPM1L@ HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@ +HAVE_DECL_FCLOSEALL = @HAVE_DECL_FCLOSEALL@ +HAVE_DECL_FCVT = @HAVE_DECL_FCVT@ HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@ HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@ HAVE_DECL_FLOORL = @HAVE_DECL_FLOORL@ @@ -1411,6 +1557,7 @@ HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@ HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@ HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@ +HAVE_DECL_GCVT = @HAVE_DECL_GCVT@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@ HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@ HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@ @@ -1421,6 +1568,8 @@ HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@ HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@ HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@ +HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@ +HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@ HAVE_DECL_INITSTATE = @HAVE_DECL_INITSTATE@ HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@ HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@ @@ -1447,6 +1596,7 @@ HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@ HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@ HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@ +HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@ HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@ HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ @@ -1461,13 +1611,14 @@ HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@ +HAVE_DECL_WCSDUP = @HAVE_DECL_WCSDUP@ HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@ HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@ HAVE_DPRINTF = @HAVE_DPRINTF@ -HAVE_DUP2 = @HAVE_DUP2@ HAVE_DUP3 = @HAVE_DUP3@ HAVE_DUPLOCALE = @HAVE_DUPLOCALE@ HAVE_EUIDACCESS = @HAVE_EUIDACCESS@ +HAVE_EXECVPE = @HAVE_EXECVPE@ HAVE_EXPF = @HAVE_EXPF@ HAVE_EXPL = @HAVE_EXPL@ HAVE_EXPLICIT_BZERO = @HAVE_EXPLICIT_BZERO@ @@ -1479,8 +1630,10 @@ HAVE_FCHDIR = @HAVE_FCHDIR@ HAVE_FCHMODAT = @HAVE_FCHMODAT@ HAVE_FCHOWNAT = @HAVE_FCHOWNAT@ +HAVE_FCNTL = @HAVE_FCNTL@ HAVE_FDATASYNC = @HAVE_FDATASYNC@ HAVE_FEATURES_H = @HAVE_FEATURES_H@ +HAVE_FFS = @HAVE_FFS@ HAVE_FFSL = @HAVE_FFSL@ HAVE_FFSLL = @HAVE_FFSLL@ HAVE_FMA = @HAVE_FMA@ @@ -1497,6 +1650,7 @@ HAVE_FTRUNCATE = @HAVE_FTRUNCATE@ HAVE_FUTIMENS = @HAVE_FUTIMENS@ HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@ +HAVE_GETENTROPY = @HAVE_GETENTROPY@ HAVE_GETGROUPS = @HAVE_GETGROUPS@ HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@ HAVE_GETLOGIN = @HAVE_GETLOGIN@ @@ -1504,6 +1658,7 @@ HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@ HAVE_GETPASS = @HAVE_GETPASS@ HAVE_GETSUBOPT = @HAVE_GETSUBOPT@ +HAVE_GETUMASK = @HAVE_GETUMASK@ HAVE_GRANTPT = @HAVE_GRANTPT@ HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@ HAVE_HYPOTF = @HAVE_HYPOTF@ @@ -1520,6 +1675,12 @@ HAVE_ISNANL = @HAVE_ISNANL@ HAVE_ISWBLANK = @HAVE_ISWBLANK@ HAVE_ISWCNTRL = @HAVE_ISWCNTRL@ +HAVE_LANGINFO_ALTMON = @HAVE_LANGINFO_ALTMON@ +HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@ +HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@ +HAVE_LANGINFO_H = @HAVE_LANGINFO_H@ +HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@ +HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@ HAVE_LCHMOD = @HAVE_LCHMOD@ HAVE_LCHOWN = @HAVE_LCHOWN@ HAVE_LDEXPF = @HAVE_LDEXPF@ @@ -1543,7 +1704,6 @@ HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@ HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@ HAVE_MBTOWC = @HAVE_MBTOWC@ -HAVE_MEMCHR = @HAVE_MEMCHR@ HAVE_MEMPCPY = @HAVE_MEMPCPY@ HAVE_MKDIRAT = @HAVE_MKDIRAT@ HAVE_MKDTEMP = @HAVE_MKDTEMP@ @@ -1561,11 +1721,14 @@ HAVE_NANOSLEEP = @HAVE_NANOSLEEP@ HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@ HAVE_NEWLOCALE = @HAVE_NEWLOCALE@ +HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@ +HAVE_OPENAT = @HAVE_OPENAT@ HAVE_OS_H = @HAVE_OS_H@ HAVE_PCLOSE = @HAVE_PCLOSE@ HAVE_PIPE = @HAVE_PIPE@ HAVE_PIPE2 = @HAVE_PIPE2@ HAVE_POPEN = @HAVE_POPEN@ +HAVE_POSIX_MEMALIGN = @HAVE_POSIX_MEMALIGN@ HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@ HAVE_POWF = @HAVE_POWF@ HAVE_PREAD = @HAVE_PREAD@ @@ -1593,6 +1756,8 @@ HAVE_SETENV = @HAVE_SETENV@ HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@ HAVE_SETSTATE = @HAVE_SETSTATE@ +HAVE_SIGABBREV_NP = @HAVE_SIGABBREV_NP@ +HAVE_SIGDESCR_NP = @HAVE_SIGDESCR_NP@ HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@ HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@ HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@ @@ -1605,8 +1770,11 @@ HAVE_STDINT_H = @HAVE_STDINT_H@ HAVE_STPCPY = @HAVE_STPCPY@ HAVE_STPNCPY = @HAVE_STPNCPY@ +HAVE_STRCASECMP = @HAVE_STRCASECMP@ HAVE_STRCASESTR = @HAVE_STRCASESTR@ HAVE_STRCHRNUL = @HAVE_STRCHRNUL@ +HAVE_STRERRORNAME_NP = @HAVE_STRERRORNAME_NP@ +HAVE_STRINGS_H = @HAVE_STRINGS_H@ HAVE_STRPBRK = @HAVE_STRPBRK@ HAVE_STRPTIME = @HAVE_STRPTIME@ HAVE_STRSEP = @HAVE_STRSEP@ @@ -1632,8 +1800,8 @@ HAVE_TANHF = @HAVE_TANHF@ HAVE_TANL = @HAVE_TANL@ HAVE_TIMEGM = @HAVE_TIMEGM@ +HAVE_TIMESPEC_GET = @HAVE_TIMESPEC_GET@ HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@ -HAVE_TZSET = @HAVE_TZSET@ HAVE_UNISTD_H = @HAVE_UNISTD_H@ HAVE_UNLINKAT = @HAVE_UNLINKAT@ HAVE_UNLOCKPT = @HAVE_UNLOCKPT@ @@ -1680,6 +1848,7 @@ HAVE_WMEMCMP = @HAVE_WMEMCMP@ HAVE_WMEMCPY = @HAVE_WMEMCPY@ HAVE_WMEMMOVE = @HAVE_WMEMMOVE@ +HAVE_WMEMPCPY = @HAVE_WMEMPCPY@ HAVE_WMEMSET = @HAVE_WMEMSET@ HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@ HAVE_XLOCALE_H = @HAVE_XLOCALE_H@ @@ -1689,6 +1858,7 @@ ICONV_H = @ICONV_H@ INCLUDE_NEXT = @INCLUDE_NEXT@ INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ +INET_PTON_LIB = @INET_PTON_LIB@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -1708,10 +1878,13 @@ LIBDATAMASH_LTLIBDEPS = @LIBDATAMASH_LTLIBDEPS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ +LIBMULTITHREAD = @LIBMULTITHREAD@ LIBOBJS = @LIBOBJS@ LIBPMULTITHREAD = @LIBPMULTITHREAD@ LIBPTHREAD = @LIBPTHREAD@ LIBS = @LIBS@ +LIBSTDTHREAD = @LIBSTDTHREAD@ +LIBTHREAD = @LIBTHREAD@ LIBUNISTRING_UNISTR_H = @LIBUNISTRING_UNISTR_H@ LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@ LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@ @@ -1719,6 +1892,7 @@ LIB_HARD_LOCALE = @LIB_HARD_LOCALE@ LIB_MBRTOWC = @LIB_MBRTOWC@ LIB_SCHED_YIELD = @LIB_SCHED_YIELD@ +LIB_SETLOCALE = @LIB_SETLOCALE@ LIB_SETLOCALE_NULL = @LIB_SETLOCALE_NULL@ LIMITS_H = @LIMITS_H@ LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@ @@ -1730,21 +1904,27 @@ LOG_LIBM = @LOG_LIBM@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ +LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ LTLIBOBJS = @LTLIBOBJS@ +LTLIBTHREAD = @LTLIBTHREAD@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODFL_LIBM = @MODFL_LIBM@ MODF_LIBM = @MODF_LIBM@ MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ -MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ NETINET_IN_H = @NETINET_IN_H@ +NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@ +NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@ NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_H@ NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@ +NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@ NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@ 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_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_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@ @@ -1754,21 +1934,25 @@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@ NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@ NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@ +NEXT_AS_FIRST_DIRECTIVE_STRINGS_H = @NEXT_AS_FIRST_DIRECTIVE_STRINGS_H@ NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@ +NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H@ NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@ NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@ NEXT_CTYPE_H = @NEXT_CTYPE_H@ NEXT_ERRNO_H = @NEXT_ERRNO_H@ +NEXT_FCNTL_H = @NEXT_FCNTL_H@ NEXT_FLOAT_H = @NEXT_FLOAT_H@ NEXT_GETOPT_H = @NEXT_GETOPT_H@ NEXT_ICONV_H = @NEXT_ICONV_H@ NEXT_INTTYPES_H = @NEXT_INTTYPES_H@ +NEXT_LANGINFO_H = @NEXT_LANGINFO_H@ NEXT_LIMITS_H = @NEXT_LIMITS_H@ NEXT_LOCALE_H = @NEXT_LOCALE_H@ NEXT_MATH_H = @NEXT_MATH_H@ @@ -1778,11 +1962,13 @@ NEXT_STDINT_H = @NEXT_STDINT_H@ NEXT_STDIO_H = @NEXT_STDIO_H@ NEXT_STDLIB_H = @NEXT_STDLIB_H@ +NEXT_STRINGS_H = @NEXT_STRINGS_H@ NEXT_STRING_H = @NEXT_STRING_H@ NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@ NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@ +NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@ NEXT_TIME_H = @NEXT_TIME_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_WCHAR_H = @NEXT_WCHAR_H@ @@ -1806,12 +1992,12 @@ PRAGMA_COLUMNS = @PRAGMA_COLUMNS@ PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ PRIPTR_PREFIX = @PRIPTR_PREFIX@ -PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@ PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@ RANLIB = @RANLIB@ REPLACE_ACCESS = @REPLACE_ACCESS@ REPLACE_ACOSF = @REPLACE_ACOSF@ +REPLACE_ALIGNED_ALLOC = @REPLACE_ALIGNED_ALLOC@ REPLACE_ASINF = @REPLACE_ASINF@ REPLACE_ATAN2F = @REPLACE_ATAN2F@ REPLACE_ATANF = @REPLACE_ATANF@ @@ -1827,11 +2013,19 @@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_COSF = @REPLACE_COSF@ REPLACE_COSHF = @REPLACE_COSHF@ +REPLACE_CREAT = @REPLACE_CREAT@ REPLACE_CTIME = @REPLACE_CTIME@ REPLACE_DPRINTF = @REPLACE_DPRINTF@ REPLACE_DUP = @REPLACE_DUP@ REPLACE_DUP2 = @REPLACE_DUP2@ REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@ +REPLACE_EXECL = @REPLACE_EXECL@ +REPLACE_EXECLE = @REPLACE_EXECLE@ +REPLACE_EXECLP = @REPLACE_EXECLP@ +REPLACE_EXECV = @REPLACE_EXECV@ +REPLACE_EXECVE = @REPLACE_EXECVE@ +REPLACE_EXECVP = @REPLACE_EXECVP@ +REPLACE_EXECVPE = @REPLACE_EXECVPE@ REPLACE_EXP2 = @REPLACE_EXP2@ REPLACE_EXP2L = @REPLACE_EXP2L@ REPLACE_EXPF = @REPLACE_EXPF@ @@ -1844,8 +2038,10 @@ REPLACE_FCHMODAT = @REPLACE_FCHMODAT@ REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@ REPLACE_FCLOSE = @REPLACE_FCLOSE@ +REPLACE_FCNTL = @REPLACE_FCNTL@ REPLACE_FDOPEN = @REPLACE_FDOPEN@ REPLACE_FFLUSH = @REPLACE_FFLUSH@ +REPLACE_FFSLL = @REPLACE_FFSLL@ REPLACE_FLOOR = @REPLACE_FLOOR@ REPLACE_FLOORF = @REPLACE_FLOORF@ REPLACE_FLOORL = @REPLACE_FLOORL@ @@ -1858,6 +2054,7 @@ REPLACE_FOPEN = @REPLACE_FOPEN@ REPLACE_FPRINTF = @REPLACE_FPRINTF@ REPLACE_FPURGE = @REPLACE_FPURGE@ +REPLACE_FREE = @REPLACE_FREE@ REPLACE_FREELOCALE = @REPLACE_FREELOCALE@ REPLACE_FREOPEN = @REPLACE_FREOPEN@ REPLACE_FREXP = @REPLACE_FREXP@ @@ -1891,6 +2088,8 @@ REPLACE_ILOGB = @REPLACE_ILOGB@ REPLACE_ILOGBF = @REPLACE_ILOGBF@ REPLACE_ILOGBL = @REPLACE_ILOGBL@ +REPLACE_INET_NTOP = @REPLACE_INET_NTOP@ +REPLACE_INET_PTON = @REPLACE_INET_PTON@ REPLACE_INITSTATE = @REPLACE_INITSTATE@ REPLACE_ISATTY = @REPLACE_ISATTY@ REPLACE_ISFINITE = @REPLACE_ISFINITE@ @@ -1937,7 +2136,9 @@ REPLACE_MEMMEM = @REPLACE_MEMMEM@ REPLACE_MKDIR = @REPLACE_MKDIR@ REPLACE_MKFIFO = @REPLACE_MKFIFO@ +REPLACE_MKFIFOAT = @REPLACE_MKFIFOAT@ REPLACE_MKNOD = @REPLACE_MKNOD@ +REPLACE_MKNODAT = @REPLACE_MKNODAT@ REPLACE_MKSTEMP = @REPLACE_MKSTEMP@ REPLACE_MKTIME = @REPLACE_MKTIME@ REPLACE_MODF = @REPLACE_MODF@ @@ -1946,10 +2147,14 @@ REPLACE_NAN = @REPLACE_NAN@ REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ REPLACE_NEWLOCALE = @REPLACE_NEWLOCALE@ +REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@ REPLACE_NULL = @REPLACE_NULL@ REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@ +REPLACE_OPEN = @REPLACE_OPEN@ +REPLACE_OPENAT = @REPLACE_OPENAT@ REPLACE_PERROR = @REPLACE_PERROR@ REPLACE_POPEN = @REPLACE_POPEN@ +REPLACE_POSIX_MEMALIGN = @REPLACE_POSIX_MEMALIGN@ REPLACE_PREAD = @REPLACE_PREAD@ REPLACE_PRINTF = @REPLACE_PRINTF@ REPLACE_PTSNAME = @REPLACE_PTSNAME@ @@ -1979,7 +2184,7 @@ REPLACE_SETLOCALE = @REPLACE_SETLOCALE@ REPLACE_SETSTATE = @REPLACE_SETSTATE@ REPLACE_SIGNBIT = @REPLACE_SIGNBIT@ -REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@ +REPLACE_SIGNBIT_USING_BUILTINS = @REPLACE_SIGNBIT_USING_BUILTINS@ REPLACE_SINF = @REPLACE_SINF@ REPLACE_SINHF = @REPLACE_SINHF@ REPLACE_SLEEP = @REPLACE_SLEEP@ @@ -1995,6 +2200,7 @@ REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@ REPLACE_STRDUP = @REPLACE_STRDUP@ REPLACE_STRERROR = @REPLACE_STRERROR@ +REPLACE_STRERRORNAME_NP = @REPLACE_STRERRORNAME_NP@ REPLACE_STRERROR_R = @REPLACE_STRERROR_R@ REPLACE_STRFTIME = @REPLACE_STRFTIME@ REPLACE_STRNCAT = @REPLACE_STRNCAT@ @@ -2049,6 +2255,7 @@ SHELL = @SHELL@ SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@ SIZE_T_SUFFIX = @SIZE_T_SUFFIX@ +SORT_PATH = @SORT_PATH@ SQRTL_LIBM = @SQRTL_LIBM@ SQRT_LIBM = @SQRT_LIBM@ STDALIGN_H = @STDALIGN_H@ @@ -2060,12 +2267,14 @@ STRIP = @STRIP@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ +TIME_H_DEFINES_TIME_UTC = @TIME_H_DEFINES_TIME_UTC@ 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@ UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@ +UNISTD_H_HAVE_SYS_RANDOM_H = @UNISTD_H_HAVE_SYS_RANDOM_H@ UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@ UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ USE_NLS = @USE_NLS@ @@ -2143,17 +2352,6 @@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = -I m4 AM_CPPFLAGS = -Ilib -I$(top_srcdir)/lib -Isrc -I$(top_srcdir)/src - -# If your project uses "gettextize --intl" to put a source-code -# copy of libintl into the package, every Makefile.am needs -# -I$(top_builddir)/intl, so that can be found in this directory. -# Here's one way to do this: -#AM_CPPFLAGS += -I$(top_builddir)/intl -# This option has no effect when the user disables NLS (because then -# the intl directory contains no libintl.h file). This option is not -# enabled by default because the intl directory might not exist if -# your project does not use "gettext --intl", and some compilers -# complain about -I options applied to nonexistent directories. EXTRA_DIST = build-aux/make_bin_dist.sh build-aux/prerelease-checks.sh \ build-aux/git-log-fix build-aux/create_small_file_system.sh \ build-aux/create_corrupted_file_system.sh \ @@ -2162,28 +2360,29 @@ tests/no-perl tests/Coreutils.pm tests/CuSkip.pm \ tests/CuTmpdir.pm tests/init.sh init.cfg $(TESTS) cfg.mk \ $(dist_examples_DATA) lib/alloca.in.h \ - $(top_srcdir)/build-aux/announce-gen lib/assure.h \ + $(top_srcdir)/build-aux/announce-gen lib/arpa_inet.in.h \ + lib/assure.h lib/attribute.h lib/basename-lgpl.h \ lib/byteswap.in.h lib/c-strcaseeq.h lib/calloc.c lib/calloc.c \ - lib/ceil.c lib/ceil.c lib/ceill.c lib/close-stream.h \ - lib/closeout.h lib/af_alg.h lib/sys-limits.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/fflush.c lib/stdio-impl.h lib/float.c lib/float.in.h \ + lib/ceil.c lib/ceil.c lib/ceill.c lib/cloexec.h lib/close.c \ + lib/close-stream.h lib/closeout.h lib/af_alg.h \ + lib/sys-limits.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/dup2.c \ + lib/errno.in.h lib/error.c lib/error.h lib/exitfail.h \ + lib/expl-table.c lib/expl.c lib/fabsl.c lib/fcntl.c \ + lib/fcntl.in.h lib/fd-hook.h lib/fflush.c lib/stdio-impl.h \ + lib/filename.h lib/flexmember.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/fpurge.c lib/stdio-impl.h lib/freading.h lib/stdio-impl.h \ lib/frexp.c lib/frexp.c lib/frexpl.c lib/fseek.c lib/fseeko.c \ lib/stdio-impl.h lib/fstat.c lib/stat-w32.c lib/stat-w32.h \ lib/ftell.c lib/ftello.c lib/stdio-impl.h \ - $(top_srcdir)/build-aux/gendocs.sh lib/getopt-cdefs.in.h \ - lib/getopt-core.h lib/getopt-ext.h lib/getopt-pfx-core.h \ - lib/getopt-pfx-ext.h lib/getopt.c lib/getopt.in.h \ - lib/getopt1.c lib/getopt_int.h \ - $(top_srcdir)/build-aux/config.rpath \ + $(top_srcdir)/build-aux/gendocs.sh lib/getdtablesize.c \ + lib/getopt-cdefs.in.h lib/getopt-core.h lib/getopt-ext.h \ + lib/getopt-pfx-core.h lib/getopt-pfx-ext.h lib/getopt.c \ + lib/getopt.in.h lib/getopt1.c lib/getopt_int.h \ $(top_srcdir)/build-aux/git-version-gen \ $(top_srcdir)/build-aux/gitlog-to-changelog \ $(top_srcdir)/build-aux/gnu-web-doc-update \ @@ -2197,50 +2396,63 @@ lib/iconv_open-hpux.gperf lib/iconv_open-irix.gperf \ lib/iconv_open-osf.gperf lib/iconv_open-solaris.gperf \ lib/iconv_open-zos.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/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/inet_pton.c lib/intprops.h lib/anytostr.c 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/iswdigit.c \ - lib/iswxdigit.c lib/ldexpl.c lib/cdefs.h lib/libc-config.h \ - lib/limits.in.h lib/localcharset.h lib/locale.in.h \ - lib/localeconv.c lib/log.c lib/logl.c lib/lseek.c \ + lib/iswxdigit.c lib/langinfo.in.h lib/ldexpl.c lib/cdefs.h \ + lib/libc-config.h lib/limits.in.h lib/localcharset.h \ + lib/locale.in.h lib/localeconv.c lib/localename-table.h \ + lib/localename.h lib/log.c lib/logl.c lib/lseek.c \ $(top_srcdir)/maint.mk lib/malloc.c lib/malloca.h \ lib/math.in.h lib/mbchar.h lib/lc-charset-dispatch.c \ lib/lc-charset-dispatch.h lib/mbrtowc-impl-utf8.h \ lib/mbrtowc-impl.h lib/mbrtowc.c lib/mbtowc-lock.c \ lib/mbtowc-lock.h lib/windows-initguard.h 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/modf.c \ lib/modfl.c lib/msvc-inval.c lib/msvc-inval.h \ lib/msvc-nothrow.c lib/msvc-nothrow.h lib/netinet_in.in.h \ - $(top_srcdir)/build-aux/prefix-gnulib-mk lib/pathmax.h \ + $(top_srcdir)/build-aux/prefix-gnulib-mk lib/open.c \ + lib/pathmax.h lib/pclose.c \ $(top_srcdir)/build-aux/pmccabe2html \ - $(top_srcdir)/build-aux/pmccabe.css lib/quote.h lib/quotearg.h \ - lib/random.c lib/random_r.c lib/realloc.c lib/realloc.c \ - lib/round.c lib/round.c lib/roundl.c lib/setlocale-lock.c \ - lib/setlocale_null.h lib/windows-initguard.h lib/float+.h \ - lib/signbitd.c lib/signbitf.c lib/signbitl.c lib/_Noreturn.h \ + $(top_srcdir)/build-aux/pmccabe.css lib/popen.c lib/quote.h \ + lib/quotearg.h lib/random.c lib/random_r.c lib/realloc.c \ + lib/realloc.c lib/round.c lib/round.c lib/roundl.c \ + lib/setlocale.c lib/setlocale-lock.c lib/setlocale_null.h \ + lib/windows-initguard.h lib/float+.h lib/signbitd.c \ + lib/signbitf.c lib/signbitl.c lib/_Noreturn.h \ lib/arg-nonnull.h lib/c++defs.h lib/unused-parameter.h \ - lib/warn-on-use.h lib/sqrtl.c lib/stat-time.h \ - 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/stpcpy.c lib/streq.h lib/strerror.c \ + lib/warn-on-use.h lib/snprintf.c lib/sqrtl.c lib/stat-w32.c \ + lib/stat-w32.h lib/stat.c lib/stat-time.h 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/stpcpy.c lib/strcasecmp.c \ + lib/strncasecmp.c lib/strdup.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_socket.in.h lib/sys_stat.in.h \ - lib/sys_types.in.h lib/sys_uio.in.h lib/time.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/xstrtol-error.h \ - doc/datamash-texinfo.css + lib/string.in.h lib/strings.in.h lib/strndup.c lib/strnlen.c \ + lib/strsep.c lib/strtod.c lib/strtod.c lib/strtold.c \ + lib/strtol.c lib/strtoll.c lib/strtol.c lib/strtoul.c \ + lib/strtoull.c lib/strtoimax.c lib/strtoumax.c \ + lib/sys_socket.in.h lib/sys_stat.in.h lib/sys_types.in.h \ + lib/sys_uio.in.h lib/sys_wait.in.h lib/thread-optim.h \ + lib/time.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 lib/asnprintf.c \ + lib/float+.h lib/printf-args.c lib/printf-args.h \ + lib/printf-parse.c lib/printf-parse.h lib/vasnprintf.c \ + lib/vasnprintf.h $(top_srcdir)/build-aux/vc-list-files \ + lib/verify.h lib/waitpid.c lib/wchar.in.h lib/wctype.in.h \ + lib/wcwidth.c lib/windows-initguard.h lib/windows-mutex.c \ + lib/windows-mutex.h lib/windows-once.c lib/windows-once.h \ + lib/windows-initguard.h lib/windows-recmutex.c \ + lib/windows-recmutex.h lib/windows-initguard.h \ + lib/windows-rwlock.c lib/windows-rwlock.h lib/xalloc.h \ + lib/xalloc.h lib/xalloc-oversized.h lib/xstrtol.h \ + lib/xstrtol-error.h doc/datamash-texinfo.css SUBDIRS = po datamash_SOURCES = src/system.h \ src/die.h \ @@ -2275,9 +2487,11 @@ $(LIB_CRYPTO) \ $(LIB_HARD_LOCALE) \ $(LIB_MBRTOWC) \ + $(LIB_SETLOCALE) \ $(LIB_SETLOCALE_NULL) \ $(LIBICONV) \ $(LIBINTL) \ + $(LIBTHREAD) \ $(LOG_LIBM) \ $(LOGL_LIBM) \ $(MODF_LIBM) \ @@ -2287,7 +2501,8 @@ $(SQRT_LIBM) \ $(SQRTL_LIBM) \ $(TRUNC_LIBM) \ - $(TRUNCL_LIBM) + $(TRUNCL_LIBM) \ + $(INTL_MACOSX_LIBS) decorate_SOURCES = src/decorate.c \ src/key-compare.c src/key-compare.h \ @@ -2304,8 +2519,10 @@ -DKEY_COMPARE_VERSION decorate_LDADD = lib/lib$(PACKAGE).a \ + $(INET_PTON_LIB) \ $(LIBICONV) \ - $(LIBINTL) + $(LIBINTL) \ + $(LIB_MBRTOWC) man_MANS = datamash.1 decorate.1 CLEANFILES = $(am__append_1) lib/configmake.h lib/configmake.h-t @@ -2315,7 +2532,9 @@ TESTS = \ tests/datamash-show-env.sh \ tests/datamash-tests.pl \ + tests/datamash-tests-deprecated.pl \ tests/datamash-tests-2.pl \ + tests/datamash-tests-2-deprecated.pl \ tests/datamash-parser.pl \ tests/datamash-error-msgs.pl \ tests/datamash-md5.pl \ @@ -2328,9 +2547,12 @@ tests/datamash-pair-tests.pl \ tests/datamash-check-tabular.pl \ tests/datamash-output-format.pl \ - tests/datamash-sort-header.sh \ + tests/datamash-i18n-de.pl \ + tests/datamash-sort-header.pl \ + tests/datamash-sort-header-deprecated.pl \ tests/datamash-sort-errors.sh \ tests/datamash-io-errors.sh \ + tests/datamash-io-errors-cheap.sh \ tests/datamash-strbin.sh \ tests/datamash-valgrind.sh \ tests/decorate-tests.pl \ @@ -2363,40 +2585,44 @@ # No GNU Make output. noinst_LIBRARIES = lib/libdatamash.a MOSTLYCLEANFILES = lib/core lib/*.stackdump lib/alloca.h \ - lib/alloca.h-t lib/byteswap.h lib/byteswap.h-t lib/ctype.h \ - lib/ctype.h-t lib/errno.h lib/errno.h-t lib/float.h \ - lib/float.h-t lib/getopt.h lib/getopt.h-t lib/getopt-cdefs.h \ - lib/getopt-cdefs.h-t lib/iconv.h lib/iconv.h-t \ - lib/iconv_open-aix.h-t lib/iconv_open-hpux.h-t \ + lib/alloca.h-t lib/arpa/inet.h lib/arpa/inet.h-t \ + lib/byteswap.h lib/byteswap.h-t lib/ctype.h lib/ctype.h-t \ + lib/errno.h lib/errno.h-t lib/fcntl.h lib/fcntl.h-t \ + lib/float.h lib/float.h-t lib/getopt.h lib/getopt.h-t \ + lib/getopt-cdefs.h lib/getopt-cdefs.h-t lib/iconv.h \ + lib/iconv.h-t 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/iconv_open-zos.h-t \ - lib/inttypes.h lib/inttypes.h-t lib/limits.h lib/limits.h-t \ - lib/locale.h lib/locale.h-t lib/math.h lib/math.h-t \ - lib/netinet/in.h lib/netinet/in.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 lib/stdint.h \ - lib/stdint.h-t lib/stdio.h lib/stdio.h-t lib/stdlib.h \ - lib/stdlib.h-t lib/stdnoreturn.h lib/stdnoreturn.h-t \ - lib/string.h lib/string.h-t lib/sys/socket.h \ + lib/inttypes.h lib/inttypes.h-t lib/langinfo.h \ + lib/langinfo.h-t lib/limits.h lib/limits.h-t lib/locale.h \ + lib/locale.h-t lib/math.h lib/math.h-t lib/netinet/in.h \ + lib/netinet/in.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 lib/stdint.h lib/stdint.h-t \ + lib/stdio.h lib/stdio.h-t lib/stdlib.h lib/stdlib.h-t \ + lib/stdnoreturn.h lib/stdnoreturn.h-t lib/string.h \ + lib/string.h-t lib/strings.h lib/strings.h-t lib/sys/socket.h \ lib/sys/socket.h-t lib/sys/stat.h lib/sys/stat.h-t \ lib/sys/types.h lib/sys/types.h-t lib/sys/uio.h \ - lib/sys/uio.h-t lib/time.h lib/time.h-t lib/unistd.h \ - lib/unistd.h-t lib/unistr.h lib/unistr.h-t lib/unitypes.h \ - lib/unitypes.h-t lib/uniwidth.h lib/uniwidth.h-t lib/wchar.h \ - lib/wchar.h-t lib/wctype.h lib/wctype.h-t -MOSTLYCLEANDIRS = lib/netinet lib/sys lib/sys lib/sys -BUILT_SOURCES = $(ALLOCA_H) $(BYTESWAP_H) lib/configmake.h lib/ctype.h \ - $(ERRNO_H) $(FLOAT_H) $(GETOPT_H) $(GETOPT_CDEFS_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/iconv_open-zos.h lib/inttypes.h \ - $(LIMITS_H) lib/locale.h lib/math.h $(NETINET_IN_H) \ - $(STDALIGN_H) $(STDARG_H) $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) \ - lib/stdio.h lib/stdlib.h $(STDNORETURN_H) lib/string.h \ + lib/sys/uio.h-t lib/sys/wait.h lib/sys/wait.h-t lib/time.h \ + lib/time.h-t lib/unistd.h lib/unistd.h-t lib/unistr.h \ + lib/unistr.h-t lib/unitypes.h lib/unitypes.h-t lib/uniwidth.h \ + lib/uniwidth.h-t lib/wchar.h lib/wchar.h-t lib/wctype.h \ + lib/wctype.h-t +MOSTLYCLEANDIRS = lib/arpa lib/netinet lib/sys lib/sys lib/sys lib/sys +BUILT_SOURCES = $(ALLOCA_H) lib/arpa/inet.h $(BYTESWAP_H) \ + lib/configmake.h lib/ctype.h $(ERRNO_H) lib/fcntl.h $(FLOAT_H) \ + $(GETOPT_H) $(GETOPT_CDEFS_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/iconv_open-zos.h lib/inttypes.h lib/langinfo.h $(LIMITS_H) \ + lib/locale.h lib/math.h $(NETINET_IN_H) $(STDALIGN_H) \ + $(STDARG_H) $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) lib/stdio.h \ + lib/stdlib.h $(STDNORETURN_H) lib/string.h lib/strings.h \ lib/sys/socket.h lib/sys/stat.h lib/sys/types.h lib/sys/uio.h \ - lib/time.h lib/unistd.h $(LIBUNISTRING_UNISTR_H) \ - $(LIBUNISTRING_UNITYPES_H) $(LIBUNISTRING_UNIWIDTH_H) \ - lib/wchar.h lib/wctype.h + lib/sys/wait.h lib/time.h lib/unistd.h \ + $(LIBUNISTRING_UNISTR_H) $(LIBUNISTRING_UNITYPES_H) \ + $(LIBUNISTRING_UNIWIDTH_H) lib/wchar.h lib/wctype.h gendocs = build-aux/gendocs.sh gendocs_envvars = GENDOCS_TEMPLATE_DIR=doc # @@ -2411,60 +2637,71 @@ 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_libdatamash_a_SOURCES = lib/base64.h lib/base64.c \ + lib/basename-lgpl.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/cloexec.c lib/close-stream.c \ lib/closeout.c lib/af_alg.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/freading.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.c lib/malloca.c lib/math.c lib/mbchar.c \ + lib/stripslash.c lib/exitfail.c lib/fd-hook.c lib/freading.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.c \ + lib/localename.c lib/localename-table.c lib/glthread/lock.h \ + lib/glthread/lock.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/setlocale_null.c lib/size_max.h \ - lib/stat-time.c lib/striconv.h lib/striconv.c lib/strnlen1.h \ - lib/strnlen1.c lib/sys_socket.c lib/trim.c lib/u64.c \ - lib/unistd.c $(am__append_2) $(am__append_3) $(am__append_4) \ + lib/quotearg.c lib/setlocale_null.c lib/sh-quote.h \ + lib/sh-quote.c lib/size_max.h lib/stat-time.c lib/striconv.h \ + lib/striconv.c lib/strnlen1.h lib/strnlen1.c lib/sys_socket.c \ + lib/glthread/threadlib.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/xmalloc.c lib/xalloc-die.c lib/xsize.h lib/xsize.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/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/fflush.c \ - lib/float.c lib/itold.c lib/floor.c lib/floor.c lib/floorl.c \ - lib/fpending.c lib/fpurge.c lib/frexp.c lib/frexp.c \ - lib/frexpl.c lib/fseek.c lib/fseeko.c lib/fstat.c \ - lib/stat-w32.c lib/ftell.c lib/ftello.c lib/getopt.c \ - lib/getopt1.c lib/iconv.c lib/iconv_close.c lib/iconv_open.c \ + lib/ceil.c lib/ceill.c lib/close.c lib/stripslash.c lib/dup2.c \ + lib/error.c lib/expl-table.c lib/expl.c lib/fabsl.c \ + lib/fcntl.c lib/fflush.c lib/float.c lib/itold.c lib/floor.c \ + lib/floor.c lib/floorl.c lib/fpending.c lib/fpurge.c \ + lib/frexp.c lib/frexp.c lib/frexpl.c lib/fseek.c lib/fseeko.c \ + lib/fstat.c lib/stat-w32.c lib/ftell.c lib/ftello.c \ + lib/getdtablesize.c lib/getopt.c lib/getopt1.c lib/iconv.c \ + lib/iconv_close.c lib/iconv_open.c lib/inet_pton.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/iswdigit.c lib/iswxdigit.c lib/ldexpl.c lib/localeconv.c \ lib/log.c lib/logl.c lib/lseek.c lib/malloc.c \ lib/lc-charset-dispatch.c lib/mbrtowc.c lib/mbtowc-lock.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/mbsinit.c lib/memchr.c lib/modf.c lib/modfl.c \ + lib/msvc-inval.c lib/msvc-nothrow.c lib/open.c lib/pclose.c \ + lib/popen.c lib/random.c lib/random_r.c lib/realloc.c \ lib/realloc.c lib/round.c lib/round.c lib/roundl.c \ - lib/setlocale-lock.c lib/signbitd.c lib/signbitf.c \ - lib/signbitl.c lib/sqrtl.c lib/stpcpy.c lib/strerror.c \ + lib/setlocale.c lib/setlocale-lock.c lib/signbitd.c \ + lib/signbitf.c lib/signbitl.c lib/snprintf.c lib/sqrtl.c \ + lib/stat-w32.c lib/stat.c lib/stpcpy.c lib/strcasecmp.c \ + lib/strncasecmp.c lib/strdup.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 + lib/strsep.c lib/strtod.c lib/strtod.c lib/strtold.c \ + lib/strtol.c lib/strtoll.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/asnprintf.c lib/printf-args.c \ + lib/printf-parse.c lib/vasnprintf.c lib/waitpid.c \ + lib/wcwidth.c lib/windows-mutex.c lib/windows-once.c \ + lib/windows-recmutex.c lib/windows-rwlock.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 = (__GNUC__ || 60000000 <= __DECC_VER) +HAVE_INCLUDE_NEXT = (__GNUC__ || __clang__ || 60000000 <= __DECC_VER) GPERF = gperf V_GPERF = $(V_GPERF_@AM_V@) V_GPERF_ = $(V_GPERF_@AM_DEFAULT_V@) @@ -2614,6 +2851,8 @@ @: > lib/$(DEPDIR)/$(am__dirstamp) lib/base64.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) +lib/basename-lgpl.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) lib/bitrotate.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) lib/c-ctype.$(OBJEXT): lib/$(am__dirstamp) \ @@ -2622,6 +2861,8 @@ lib/$(DEPDIR)/$(am__dirstamp) lib/c-strncasecmp.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) +lib/cloexec.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) lib/close-stream.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) lib/closeout.$(OBJEXT): lib/$(am__dirstamp) \ @@ -2640,12 +2881,12 @@ lib/$(DEPDIR)/$(am__dirstamp) lib/dirname-lgpl.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) -lib/basename-lgpl.$(OBJEXT): lib/$(am__dirstamp) \ - lib/$(DEPDIR)/$(am__dirstamp) lib/stripslash.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) lib/exitfail.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) +lib/fd-hook.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) lib/freading.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) lib/getprogname.$(OBJEXT): lib/$(am__dirstamp) \ @@ -2671,6 +2912,18 @@ lib/$(DEPDIR)/$(am__dirstamp) lib/localcharset.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) +lib/localename.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/localename-table.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/glthread/$(am__dirstamp): + @$(MKDIR_P) lib/glthread + @: > lib/glthread/$(am__dirstamp) +lib/glthread/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) lib/glthread/$(DEPDIR) + @: > lib/glthread/$(DEPDIR)/$(am__dirstamp) +lib/glthread/lock.$(OBJEXT): lib/glthread/$(am__dirstamp) \ + lib/glthread/$(DEPDIR)/$(am__dirstamp) lib/malloca.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) lib/math.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) @@ -2692,6 +2945,8 @@ lib/$(DEPDIR)/$(am__dirstamp) lib/setlocale_null.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) +lib/sh-quote.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) lib/stat-time.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) lib/striconv.$(OBJEXT): lib/$(am__dirstamp) \ @@ -2700,6 +2955,8 @@ lib/$(DEPDIR)/$(am__dirstamp) lib/sys_socket.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) +lib/glthread/threadlib.$(OBJEXT): lib/glthread/$(am__dirstamp) \ + lib/glthread/$(DEPDIR)/$(am__dirstamp) lib/trim.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) lib/u64.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) lib/unistd.$(OBJEXT): lib/$(am__dirstamp) \ @@ -2732,6 +2989,7 @@ lib/$(DEPDIR)/$(am__dirstamp) lib/xalloc-die.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) +lib/xsize.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) lib/xstriconv.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) lib/xstrndup.$(OBJEXT): lib/$(am__dirstamp) \ @@ -2748,11 +3006,14 @@ 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/close.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/dup2.$(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) lib/expl.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) lib/fabsl.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/fcntl.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) lib/fflush.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) lib/float.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) @@ -2776,6 +3037,8 @@ lib/ftell.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) lib/ftello.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) +lib/getdtablesize.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) lib/getopt.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) lib/getopt1.$(OBJEXT): lib/$(am__dirstamp) \ @@ -2785,6 +3048,8 @@ lib/$(DEPDIR)/$(am__dirstamp) lib/iconv_open.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) +lib/inet_pton.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) lib/anytostr.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) lib/isblank.$(OBJEXT): lib/$(am__dirstamp) \ @@ -2822,10 +3087,6 @@ lib/$(DEPDIR)/$(am__dirstamp) lib/mbsinit.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) -lib/mbsrtowcs-state.$(OBJEXT): lib/$(am__dirstamp) \ - lib/$(DEPDIR)/$(am__dirstamp) -lib/mbsrtowcs.$(OBJEXT): lib/$(am__dirstamp) \ - lib/$(DEPDIR)/$(am__dirstamp) lib/memchr.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) lib/modf.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) @@ -2834,6 +3095,10 @@ lib/$(DEPDIR)/$(am__dirstamp) lib/msvc-nothrow.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) +lib/open.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/pclose.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/popen.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) lib/random.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) lib/random_r.$(OBJEXT): lib/$(am__dirstamp) \ @@ -2843,6 +3108,8 @@ lib/round.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) lib/roundl.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) +lib/setlocale.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) lib/setlocale-lock.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) lib/signbitd.$(OBJEXT): lib/$(am__dirstamp) \ @@ -2851,9 +3118,18 @@ lib/$(DEPDIR)/$(am__dirstamp) lib/signbitl.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) +lib/snprintf.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) lib/sqrtl.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) +lib/stat.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) lib/stpcpy.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) +lib/strcasecmp.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/strncasecmp.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/strdup.$(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) \ @@ -2864,8 +3140,14 @@ lib/$(DEPDIR)/$(am__dirstamp) lib/strsep.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) +lib/strtod.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/strtold.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) lib/strtol.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) +lib/strtoll.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) lib/strtoul.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) lib/strtoull.$(OBJEXT): lib/$(am__dirstamp) \ @@ -2877,8 +3159,26 @@ lib/trunc.$(OBJEXT): lib/$(am__dirstamp) lib/$(DEPDIR)/$(am__dirstamp) lib/truncl.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) +lib/asnprintf.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/printf-args.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/printf-parse.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/vasnprintf.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/waitpid.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) lib/wcwidth.$(OBJEXT): lib/$(am__dirstamp) \ lib/$(DEPDIR)/$(am__dirstamp) +lib/windows-mutex.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/windows-once.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/windows-recmutex.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) +lib/windows-rwlock.$(OBJEXT): lib/$(am__dirstamp) \ + lib/$(DEPDIR)/$(am__dirstamp) lib/libdatamash.a: $(lib_libdatamash_a_OBJECTS) $(lib_libdatamash_a_DEPENDENCIES) $(EXTRA_lib_libdatamash_a_DEPENDENCIES) lib/$(am__dirstamp) $(AM_V_at)-rm -f lib/libdatamash.a @@ -2930,6 +3230,7 @@ mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f lib/*.$(OBJEXT) + -rm -f lib/glthread/*.$(OBJEXT) -rm -f lib/unistr/*.$(OBJEXT) -rm -f lib/uniwidth/*.$(OBJEXT) -rm -f src/*.$(OBJEXT) @@ -2939,6 +3240,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/af_alg.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/anytostr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/asnprintf.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/base64.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/basename-lgpl.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/basename.Po@am__quote@ # am--include-marker @@ -2949,15 +3251,20 @@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/calloc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/ceil.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/ceill.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/cloexec.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/close-stream.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/close.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/closeout.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/dirname-lgpl.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/dirname.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/dup2.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/error.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/exitfail.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/expl-table.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/expl.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fabsl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fcntl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fd-hook.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fflush.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/float.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/floor.Po@am__quote@ # am--include-marker @@ -2972,6 +3279,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/fstat.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/ftell.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/ftello.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/getdtablesize.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/getopt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/getopt1.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/getprogname.Po@am__quote@ # am--include-marker @@ -2983,6 +3291,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/iconv_close.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/iconv_open.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/imaxtostr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/inet_pton.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/inttostr.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/isblank.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/isfinite.Po@am__quote@ # am--include-marker @@ -3000,6 +3309,8 @@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/linebuffer.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/localcharset.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/localeconv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/localename-table.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/localename.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/log.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/logl.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/lseek.Po@am__quote@ # am--include-marker @@ -3011,8 +3322,6 @@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/mbrtowc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/mbsinit.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/mbslen.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/mbsrtowcs-state.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/mbsrtowcs.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/mbsstr.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/mbtowc-lock.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/mbuiter.Po@am__quote@ # am--include-marker @@ -3023,6 +3332,11 @@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/msvc-inval.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/msvc-nothrow.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/offtostr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/open.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/pclose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/popen.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/printf-args.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/printf-parse.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/progname.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/propername.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/quotearg.Po@am__quote@ # am--include-marker @@ -3032,27 +3346,37 @@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/round.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/roundl.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/setlocale-lock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/setlocale.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/setlocale_null.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/sh-quote.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/sha1.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/sha256.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/sha512.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/signbitd.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/signbitf.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/signbitl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/snprintf.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/sqrtl.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/stat-time.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/stat-w32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/stat.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/stpcpy.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strcasecmp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strdup.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strerror-override.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strerror.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/striconv.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/stripslash.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strncasecmp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strndup.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strnlen.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strnlen1.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strsep.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strtod.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strtoimax.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strtol.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strtold.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strtoll.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strtoul.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strtoull.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/strtoumax.Po@am__quote@ # am--include-marker @@ -3064,17 +3388,26 @@ @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/uinttostr.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/umaxtostr.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/unistd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/vasnprintf.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/version-etc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/waitpid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/wctype-h.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/wcwidth.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/windows-mutex.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/windows-once.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/windows-recmutex.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/windows-rwlock.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/xalloc-die.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/xmalloc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/xsize.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/xstriconv.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/xstrndup.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/xstrtol-error.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/xstrtol.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/xstrtoul.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/$(DEPDIR)/xstrtoumax.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/glthread/$(DEPDIR)/lock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@lib/glthread/$(DEPDIR)/threadlib.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/unistr/$(DEPDIR)/u8-mbtoucr.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/unistr/$(DEPDIR)/u8-uctomb-aux.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@lib/unistr/$(DEPDIR)/u8-uctomb.Po@am__quote@ # am--include-marker @@ -3771,7 +4104,7 @@ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ - echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ @@ -3833,7 +4166,6 @@ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_SH_LOG_DRIVER_FLAGS) $(SH_LOG_DRIVER_FLAGS) -- $(SH_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -3920,6 +4252,10 @@ tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) +dist-zstd: distdir + tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst + $(am__post_remove_distdir) + dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @@ -3962,6 +4298,8 @@ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ + *.tar.zst*) \ + zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) @@ -3977,7 +4315,7 @@ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ @@ -4041,7 +4379,8 @@ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-recursive -install-exec: install-exec-recursive +install-exec: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive @@ -4074,6 +4413,8 @@ -rm -f doc/$(am__dirstamp) -rm -f lib/$(DEPDIR)/$(am__dirstamp) -rm -f lib/$(am__dirstamp) + -rm -f lib/glthread/$(DEPDIR)/$(am__dirstamp) + -rm -f lib/glthread/$(am__dirstamp) -rm -f lib/unistr/$(DEPDIR)/$(am__dirstamp) -rm -f lib/unistr/$(am__dirstamp) -rm -f lib/uniwidth/$(DEPDIR)/$(am__dirstamp) @@ -4095,6 +4436,7 @@ -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f lib/$(DEPDIR)/af_alg.Po -rm -f lib/$(DEPDIR)/anytostr.Po + -rm -f lib/$(DEPDIR)/asnprintf.Po -rm -f lib/$(DEPDIR)/base64.Po -rm -f lib/$(DEPDIR)/basename-lgpl.Po -rm -f lib/$(DEPDIR)/basename.Po @@ -4105,15 +4447,20 @@ -rm -f lib/$(DEPDIR)/calloc.Po -rm -f lib/$(DEPDIR)/ceil.Po -rm -f lib/$(DEPDIR)/ceill.Po + -rm -f lib/$(DEPDIR)/cloexec.Po -rm -f lib/$(DEPDIR)/close-stream.Po + -rm -f lib/$(DEPDIR)/close.Po -rm -f lib/$(DEPDIR)/closeout.Po -rm -f lib/$(DEPDIR)/dirname-lgpl.Po -rm -f lib/$(DEPDIR)/dirname.Po + -rm -f lib/$(DEPDIR)/dup2.Po -rm -f lib/$(DEPDIR)/error.Po -rm -f lib/$(DEPDIR)/exitfail.Po -rm -f lib/$(DEPDIR)/expl-table.Po -rm -f lib/$(DEPDIR)/expl.Po -rm -f lib/$(DEPDIR)/fabsl.Po + -rm -f lib/$(DEPDIR)/fcntl.Po + -rm -f lib/$(DEPDIR)/fd-hook.Po -rm -f lib/$(DEPDIR)/fflush.Po -rm -f lib/$(DEPDIR)/float.Po -rm -f lib/$(DEPDIR)/floor.Po @@ -4128,6 +4475,7 @@ -rm -f lib/$(DEPDIR)/fstat.Po -rm -f lib/$(DEPDIR)/ftell.Po -rm -f lib/$(DEPDIR)/ftello.Po + -rm -f lib/$(DEPDIR)/getdtablesize.Po -rm -f lib/$(DEPDIR)/getopt.Po -rm -f lib/$(DEPDIR)/getopt1.Po -rm -f lib/$(DEPDIR)/getprogname.Po @@ -4139,6 +4487,7 @@ -rm -f lib/$(DEPDIR)/iconv_close.Po -rm -f lib/$(DEPDIR)/iconv_open.Po -rm -f lib/$(DEPDIR)/imaxtostr.Po + -rm -f lib/$(DEPDIR)/inet_pton.Po -rm -f lib/$(DEPDIR)/inttostr.Po -rm -f lib/$(DEPDIR)/isblank.Po -rm -f lib/$(DEPDIR)/isfinite.Po @@ -4156,6 +4505,8 @@ -rm -f lib/$(DEPDIR)/linebuffer.Po -rm -f lib/$(DEPDIR)/localcharset.Po -rm -f lib/$(DEPDIR)/localeconv.Po + -rm -f lib/$(DEPDIR)/localename-table.Po + -rm -f lib/$(DEPDIR)/localename.Po -rm -f lib/$(DEPDIR)/log.Po -rm -f lib/$(DEPDIR)/logl.Po -rm -f lib/$(DEPDIR)/lseek.Po @@ -4167,8 +4518,6 @@ -rm -f lib/$(DEPDIR)/mbrtowc.Po -rm -f lib/$(DEPDIR)/mbsinit.Po -rm -f lib/$(DEPDIR)/mbslen.Po - -rm -f lib/$(DEPDIR)/mbsrtowcs-state.Po - -rm -f lib/$(DEPDIR)/mbsrtowcs.Po -rm -f lib/$(DEPDIR)/mbsstr.Po -rm -f lib/$(DEPDIR)/mbtowc-lock.Po -rm -f lib/$(DEPDIR)/mbuiter.Po @@ -4179,6 +4528,11 @@ -rm -f lib/$(DEPDIR)/msvc-inval.Po -rm -f lib/$(DEPDIR)/msvc-nothrow.Po -rm -f lib/$(DEPDIR)/offtostr.Po + -rm -f lib/$(DEPDIR)/open.Po + -rm -f lib/$(DEPDIR)/pclose.Po + -rm -f lib/$(DEPDIR)/popen.Po + -rm -f lib/$(DEPDIR)/printf-args.Po + -rm -f lib/$(DEPDIR)/printf-parse.Po -rm -f lib/$(DEPDIR)/progname.Po -rm -f lib/$(DEPDIR)/propername.Po -rm -f lib/$(DEPDIR)/quotearg.Po @@ -4188,27 +4542,37 @@ -rm -f lib/$(DEPDIR)/round.Po -rm -f lib/$(DEPDIR)/roundl.Po -rm -f lib/$(DEPDIR)/setlocale-lock.Po + -rm -f lib/$(DEPDIR)/setlocale.Po -rm -f lib/$(DEPDIR)/setlocale_null.Po + -rm -f lib/$(DEPDIR)/sh-quote.Po -rm -f lib/$(DEPDIR)/sha1.Po -rm -f lib/$(DEPDIR)/sha256.Po -rm -f lib/$(DEPDIR)/sha512.Po -rm -f lib/$(DEPDIR)/signbitd.Po -rm -f lib/$(DEPDIR)/signbitf.Po -rm -f lib/$(DEPDIR)/signbitl.Po + -rm -f lib/$(DEPDIR)/snprintf.Po -rm -f lib/$(DEPDIR)/sqrtl.Po -rm -f lib/$(DEPDIR)/stat-time.Po -rm -f lib/$(DEPDIR)/stat-w32.Po + -rm -f lib/$(DEPDIR)/stat.Po -rm -f lib/$(DEPDIR)/stpcpy.Po + -rm -f lib/$(DEPDIR)/strcasecmp.Po + -rm -f lib/$(DEPDIR)/strdup.Po -rm -f lib/$(DEPDIR)/strerror-override.Po -rm -f lib/$(DEPDIR)/strerror.Po -rm -f lib/$(DEPDIR)/striconv.Po -rm -f lib/$(DEPDIR)/stripslash.Po + -rm -f lib/$(DEPDIR)/strncasecmp.Po -rm -f lib/$(DEPDIR)/strndup.Po -rm -f lib/$(DEPDIR)/strnlen.Po -rm -f lib/$(DEPDIR)/strnlen1.Po -rm -f lib/$(DEPDIR)/strsep.Po + -rm -f lib/$(DEPDIR)/strtod.Po -rm -f lib/$(DEPDIR)/strtoimax.Po -rm -f lib/$(DEPDIR)/strtol.Po + -rm -f lib/$(DEPDIR)/strtold.Po + -rm -f lib/$(DEPDIR)/strtoll.Po -rm -f lib/$(DEPDIR)/strtoul.Po -rm -f lib/$(DEPDIR)/strtoull.Po -rm -f lib/$(DEPDIR)/strtoumax.Po @@ -4220,17 +4584,26 @@ -rm -f lib/$(DEPDIR)/uinttostr.Po -rm -f lib/$(DEPDIR)/umaxtostr.Po -rm -f lib/$(DEPDIR)/unistd.Po + -rm -f lib/$(DEPDIR)/vasnprintf.Po -rm -f lib/$(DEPDIR)/version-etc.Po + -rm -f lib/$(DEPDIR)/waitpid.Po -rm -f lib/$(DEPDIR)/wctype-h.Po -rm -f lib/$(DEPDIR)/wcwidth.Po + -rm -f lib/$(DEPDIR)/windows-mutex.Po + -rm -f lib/$(DEPDIR)/windows-once.Po + -rm -f lib/$(DEPDIR)/windows-recmutex.Po + -rm -f lib/$(DEPDIR)/windows-rwlock.Po -rm -f lib/$(DEPDIR)/xalloc-die.Po -rm -f lib/$(DEPDIR)/xmalloc.Po + -rm -f lib/$(DEPDIR)/xsize.Po -rm -f lib/$(DEPDIR)/xstriconv.Po -rm -f lib/$(DEPDIR)/xstrndup.Po -rm -f lib/$(DEPDIR)/xstrtol-error.Po -rm -f lib/$(DEPDIR)/xstrtol.Po -rm -f lib/$(DEPDIR)/xstrtoul.Po -rm -f lib/$(DEPDIR)/xstrtoumax.Po + -rm -f lib/glthread/$(DEPDIR)/lock.Po + -rm -f lib/glthread/$(DEPDIR)/threadlib.Po -rm -f lib/unistr/$(DEPDIR)/u8-mbtoucr.Po -rm -f lib/unistr/$(DEPDIR)/u8-uctomb-aux.Po -rm -f lib/unistr/$(DEPDIR)/u8-uctomb.Po @@ -4390,6 +4763,7 @@ -rm -rf $(top_srcdir)/autom4te.cache -rm -f lib/$(DEPDIR)/af_alg.Po -rm -f lib/$(DEPDIR)/anytostr.Po + -rm -f lib/$(DEPDIR)/asnprintf.Po -rm -f lib/$(DEPDIR)/base64.Po -rm -f lib/$(DEPDIR)/basename-lgpl.Po -rm -f lib/$(DEPDIR)/basename.Po @@ -4400,15 +4774,20 @@ -rm -f lib/$(DEPDIR)/calloc.Po -rm -f lib/$(DEPDIR)/ceil.Po -rm -f lib/$(DEPDIR)/ceill.Po + -rm -f lib/$(DEPDIR)/cloexec.Po -rm -f lib/$(DEPDIR)/close-stream.Po + -rm -f lib/$(DEPDIR)/close.Po -rm -f lib/$(DEPDIR)/closeout.Po -rm -f lib/$(DEPDIR)/dirname-lgpl.Po -rm -f lib/$(DEPDIR)/dirname.Po + -rm -f lib/$(DEPDIR)/dup2.Po -rm -f lib/$(DEPDIR)/error.Po -rm -f lib/$(DEPDIR)/exitfail.Po -rm -f lib/$(DEPDIR)/expl-table.Po -rm -f lib/$(DEPDIR)/expl.Po -rm -f lib/$(DEPDIR)/fabsl.Po + -rm -f lib/$(DEPDIR)/fcntl.Po + -rm -f lib/$(DEPDIR)/fd-hook.Po -rm -f lib/$(DEPDIR)/fflush.Po -rm -f lib/$(DEPDIR)/float.Po -rm -f lib/$(DEPDIR)/floor.Po @@ -4423,6 +4802,7 @@ -rm -f lib/$(DEPDIR)/fstat.Po -rm -f lib/$(DEPDIR)/ftell.Po -rm -f lib/$(DEPDIR)/ftello.Po + -rm -f lib/$(DEPDIR)/getdtablesize.Po -rm -f lib/$(DEPDIR)/getopt.Po -rm -f lib/$(DEPDIR)/getopt1.Po -rm -f lib/$(DEPDIR)/getprogname.Po @@ -4434,6 +4814,7 @@ -rm -f lib/$(DEPDIR)/iconv_close.Po -rm -f lib/$(DEPDIR)/iconv_open.Po -rm -f lib/$(DEPDIR)/imaxtostr.Po + -rm -f lib/$(DEPDIR)/inet_pton.Po -rm -f lib/$(DEPDIR)/inttostr.Po -rm -f lib/$(DEPDIR)/isblank.Po -rm -f lib/$(DEPDIR)/isfinite.Po @@ -4451,6 +4832,8 @@ -rm -f lib/$(DEPDIR)/linebuffer.Po -rm -f lib/$(DEPDIR)/localcharset.Po -rm -f lib/$(DEPDIR)/localeconv.Po + -rm -f lib/$(DEPDIR)/localename-table.Po + -rm -f lib/$(DEPDIR)/localename.Po -rm -f lib/$(DEPDIR)/log.Po -rm -f lib/$(DEPDIR)/logl.Po -rm -f lib/$(DEPDIR)/lseek.Po @@ -4462,8 +4845,6 @@ -rm -f lib/$(DEPDIR)/mbrtowc.Po -rm -f lib/$(DEPDIR)/mbsinit.Po -rm -f lib/$(DEPDIR)/mbslen.Po - -rm -f lib/$(DEPDIR)/mbsrtowcs-state.Po - -rm -f lib/$(DEPDIR)/mbsrtowcs.Po -rm -f lib/$(DEPDIR)/mbsstr.Po -rm -f lib/$(DEPDIR)/mbtowc-lock.Po -rm -f lib/$(DEPDIR)/mbuiter.Po @@ -4474,6 +4855,11 @@ -rm -f lib/$(DEPDIR)/msvc-inval.Po -rm -f lib/$(DEPDIR)/msvc-nothrow.Po -rm -f lib/$(DEPDIR)/offtostr.Po + -rm -f lib/$(DEPDIR)/open.Po + -rm -f lib/$(DEPDIR)/pclose.Po + -rm -f lib/$(DEPDIR)/popen.Po + -rm -f lib/$(DEPDIR)/printf-args.Po + -rm -f lib/$(DEPDIR)/printf-parse.Po -rm -f lib/$(DEPDIR)/progname.Po -rm -f lib/$(DEPDIR)/propername.Po -rm -f lib/$(DEPDIR)/quotearg.Po @@ -4483,27 +4869,37 @@ -rm -f lib/$(DEPDIR)/round.Po -rm -f lib/$(DEPDIR)/roundl.Po -rm -f lib/$(DEPDIR)/setlocale-lock.Po + -rm -f lib/$(DEPDIR)/setlocale.Po -rm -f lib/$(DEPDIR)/setlocale_null.Po + -rm -f lib/$(DEPDIR)/sh-quote.Po -rm -f lib/$(DEPDIR)/sha1.Po -rm -f lib/$(DEPDIR)/sha256.Po -rm -f lib/$(DEPDIR)/sha512.Po -rm -f lib/$(DEPDIR)/signbitd.Po -rm -f lib/$(DEPDIR)/signbitf.Po -rm -f lib/$(DEPDIR)/signbitl.Po + -rm -f lib/$(DEPDIR)/snprintf.Po -rm -f lib/$(DEPDIR)/sqrtl.Po -rm -f lib/$(DEPDIR)/stat-time.Po -rm -f lib/$(DEPDIR)/stat-w32.Po + -rm -f lib/$(DEPDIR)/stat.Po -rm -f lib/$(DEPDIR)/stpcpy.Po + -rm -f lib/$(DEPDIR)/strcasecmp.Po + -rm -f lib/$(DEPDIR)/strdup.Po -rm -f lib/$(DEPDIR)/strerror-override.Po -rm -f lib/$(DEPDIR)/strerror.Po -rm -f lib/$(DEPDIR)/striconv.Po -rm -f lib/$(DEPDIR)/stripslash.Po + -rm -f lib/$(DEPDIR)/strncasecmp.Po -rm -f lib/$(DEPDIR)/strndup.Po -rm -f lib/$(DEPDIR)/strnlen.Po -rm -f lib/$(DEPDIR)/strnlen1.Po -rm -f lib/$(DEPDIR)/strsep.Po + -rm -f lib/$(DEPDIR)/strtod.Po -rm -f lib/$(DEPDIR)/strtoimax.Po -rm -f lib/$(DEPDIR)/strtol.Po + -rm -f lib/$(DEPDIR)/strtold.Po + -rm -f lib/$(DEPDIR)/strtoll.Po -rm -f lib/$(DEPDIR)/strtoul.Po -rm -f lib/$(DEPDIR)/strtoull.Po -rm -f lib/$(DEPDIR)/strtoumax.Po @@ -4515,17 +4911,26 @@ -rm -f lib/$(DEPDIR)/uinttostr.Po -rm -f lib/$(DEPDIR)/umaxtostr.Po -rm -f lib/$(DEPDIR)/unistd.Po + -rm -f lib/$(DEPDIR)/vasnprintf.Po -rm -f lib/$(DEPDIR)/version-etc.Po + -rm -f lib/$(DEPDIR)/waitpid.Po -rm -f lib/$(DEPDIR)/wctype-h.Po -rm -f lib/$(DEPDIR)/wcwidth.Po + -rm -f lib/$(DEPDIR)/windows-mutex.Po + -rm -f lib/$(DEPDIR)/windows-once.Po + -rm -f lib/$(DEPDIR)/windows-recmutex.Po + -rm -f lib/$(DEPDIR)/windows-rwlock.Po -rm -f lib/$(DEPDIR)/xalloc-die.Po -rm -f lib/$(DEPDIR)/xmalloc.Po + -rm -f lib/$(DEPDIR)/xsize.Po -rm -f lib/$(DEPDIR)/xstriconv.Po -rm -f lib/$(DEPDIR)/xstrndup.Po -rm -f lib/$(DEPDIR)/xstrtol-error.Po -rm -f lib/$(DEPDIR)/xstrtol.Po -rm -f lib/$(DEPDIR)/xstrtoul.Po -rm -f lib/$(DEPDIR)/xstrtoumax.Po + -rm -f lib/glthread/$(DEPDIR)/lock.Po + -rm -f lib/glthread/$(DEPDIR)/threadlib.Po -rm -f lib/unistr/$(DEPDIR)/u8-mbtoucr.Po -rm -f lib/unistr/$(DEPDIR)/u8-uctomb-aux.Po -rm -f lib/unistr/$(DEPDIR)/u8-uctomb.Po @@ -4569,15 +4974,15 @@ uninstall-man: uninstall-man1 .MAKE: $(am__recursive_targets) all check check-am install install-am \ - install-strip + install-exec install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles am--refresh check check-TESTS check-am clean \ clean-aminfo clean-binPROGRAMS clean-cscope clean-generic \ clean-noinstLIBRARIES cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-hook dist-info dist-lzip \ - dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \ - distclean-compile distclean-generic distclean-hdr \ + dist-shar dist-tarZ dist-xz dist-zip dist-zstd distcheck \ + distclean distclean-compile distclean-generic distclean-hdr \ distclean-local distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ @@ -4652,6 +5057,33 @@ @GL_GENERATE_ALLOCA_H_FALSE@lib/alloca.h: $(top_builddir)/config.status @GL_GENERATE_ALLOCA_H_FALSE@ rm -f $@ +# We need the following in order to create when the system +# doesn't have one. +lib/arpa/inet.h: lib/arpa_inet.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H) + $(AM_V_at)$(MKDIR_P) lib/arpa + $(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|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \ + -e 's|@''NEXT_ARPA_INET_H''@|$(NEXT_ARPA_INET_H)|g' \ + -e 's|@''HAVE_ARPA_INET_H''@|$(HAVE_ARPA_INET_H)|g' \ + -e 's/@''GNULIB_INET_NTOP''@/$(GNULIB_INET_NTOP)/g' \ + -e 's/@''GNULIB_INET_PTON''@/$(GNULIB_INET_PTON)/g' \ + -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \ + -e 's|@''HAVE_DECL_INET_NTOP''@|$(HAVE_DECL_INET_NTOP)|g' \ + -e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \ + -e 's|@''REPLACE_INET_NTOP''@|$(REPLACE_INET_NTOP)|g' \ + -e 's|@''REPLACE_INET_PTON''@|$(REPLACE_INET_PTON)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(top_srcdir)/lib/arpa_inet.in.h; \ + } > $@-t && \ + mv $@-t $@ + # We need the following in order to create when the system # doesn't have one. @GL_GENERATE_BYTESWAP_H_TRUE@lib/byteswap.h: lib/byteswap.in.h $(top_builddir)/config.status @@ -4744,6 +5176,36 @@ @GL_GENERATE_ERRNO_H_FALSE@lib/errno.h: $(top_builddir)/config.status @GL_GENERATE_ERRNO_H_FALSE@ rm -f $@ +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +lib/fcntl.h: lib/fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) + $(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_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \ + -e 's/@''GNULIB_CREAT''@/$(GNULIB_CREAT)/g' \ + -e 's/@''GNULIB_FCNTL''@/$(GNULIB_FCNTL)/g' \ + -e 's/@''GNULIB_NONBLOCKING''@/$(GNULIB_NONBLOCKING)/g' \ + -e 's/@''GNULIB_OPEN''@/$(GNULIB_OPEN)/g' \ + -e 's/@''GNULIB_OPENAT''@/$(GNULIB_OPENAT)/g' \ + -e 's/@''GNULIB_MDA_CREAT''@/$(GNULIB_MDA_CREAT)/g' \ + -e 's/@''GNULIB_MDA_OPEN''@/$(GNULIB_MDA_OPEN)/g' \ + -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \ + -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \ + -e 's|@''REPLACE_CREAT''@|$(REPLACE_CREAT)|g' \ + -e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \ + -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \ + -e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(top_srcdir)/lib/fcntl.in.h; \ + } > $@-t && \ + mv $@-t $@ + # We need the following in order to create when the system # doesn't have one that works with the given compiler. @GL_GENERATE_FLOAT_H_TRUE@lib/float.h: lib/float.in.h $(top_builddir)/config.status @@ -4841,7 +5303,6 @@ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_INTTYPES_H''@|$(NEXT_INTTYPES_H)|g' \ - -e 's/@''PRI_MACROS_BROKEN''@/$(PRI_MACROS_BROKEN)/g' \ -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \ -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \ -e 's/@''GNULIB_IMAXABS''@/$(GNULIB_IMAXABS)/g' \ @@ -4866,6 +5327,31 @@ } > $@-t && \ mv $@-t $@ +# We need the following in order to create an empty placeholder for +# when the system doesn't have one. +lib/langinfo.h: lib/langinfo.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_LANGINFO_H''@|$(HAVE_LANGINFO_H)|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_LANGINFO_H''@|$(NEXT_LANGINFO_H)|g' \ + -e 's/@''GNULIB_NL_LANGINFO''@/$(GNULIB_NL_LANGINFO)/g' \ + -e 's|@''HAVE_LANGINFO_CODESET''@|$(HAVE_LANGINFO_CODESET)|g' \ + -e 's|@''HAVE_LANGINFO_T_FMT_AMPM''@|$(HAVE_LANGINFO_T_FMT_AMPM)|g' \ + -e 's|@''HAVE_LANGINFO_ALTMON''@|$(HAVE_LANGINFO_ALTMON)|g' \ + -e 's|@''HAVE_LANGINFO_ERA''@|$(HAVE_LANGINFO_ERA)|g' \ + -e 's|@''HAVE_LANGINFO_YESEXPR''@|$(HAVE_LANGINFO_YESEXPR)|g' \ + -e 's|@''HAVE_NL_LANGINFO''@|$(HAVE_NL_LANGINFO)|g' \ + -e 's|@''REPLACE_NL_LANGINFO''@|$(REPLACE_NL_LANGINFO)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(top_srcdir)/lib/langinfo.in.h; \ + } > $@-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 @@ -5020,6 +5506,12 @@ -e 's/@''GNULIB_TRUNC''@/$(GNULIB_TRUNC)/g' \ -e 's/@''GNULIB_TRUNCF''@/$(GNULIB_TRUNCF)/g' \ -e 's/@''GNULIB_TRUNCL''@/$(GNULIB_TRUNCL)/g' \ + -e 's/@''GNULIB_MDA_J0''@/$(GNULIB_MDA_J0)/g' \ + -e 's/@''GNULIB_MDA_J1''@/$(GNULIB_MDA_J1)/g' \ + -e 's/@''GNULIB_MDA_JN''@/$(GNULIB_MDA_JN)/g' \ + -e 's/@''GNULIB_MDA_Y0''@/$(GNULIB_MDA_Y0)/g' \ + -e 's/@''GNULIB_MDA_Y1''@/$(GNULIB_MDA_Y1)/g' \ + -e 's/@''GNULIB_MDA_YN''@/$(GNULIB_MDA_YN)/g' \ | \ sed -e 's|@''HAVE_ACOSF''@|$(HAVE_ACOSF)|g' \ -e 's|@''HAVE_ACOSL''@|$(HAVE_ACOSL)|g' \ @@ -5188,7 +5680,7 @@ -e 's|@''REPLACE_ROUNDF''@|$(REPLACE_ROUNDF)|g' \ -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_SIGNBIT_USING_BUILTINS''@|$(REPLACE_SIGNBIT_USING_BUILTINS)|g' \ -e 's|@''REPLACE_SINF''@|$(REPLACE_SINF)|g' \ -e 's|@''REPLACE_SINHF''@|$(REPLACE_SINHF)|g' \ -e 's|@''REPLACE_SQRTF''@|$(REPLACE_SQRTF)|g' \ @@ -5380,8 +5872,15 @@ -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GNULIB_VPRINTF_POSIX)/g' \ -e 's/@''GNULIB_VSNPRINTF''@/$(GNULIB_VSNPRINTF)/g' \ -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GNULIB_VSPRINTF_POSIX)/g' \ + -e 's/@''GNULIB_MDA_FCLOSEALL''@/$(GNULIB_MDA_FCLOSEALL)/g' \ + -e 's/@''GNULIB_MDA_FDOPEN''@/$(GNULIB_MDA_FDOPEN)/g' \ + -e 's/@''GNULIB_MDA_FILENO''@/$(GNULIB_MDA_FILENO)/g' \ + -e 's/@''GNULIB_MDA_GETW''@/$(GNULIB_MDA_GETW)/g' \ + -e 's/@''GNULIB_MDA_PUTW''@/$(GNULIB_MDA_PUTW)/g' \ + -e 's/@''GNULIB_MDA_TEMPNAM''@/$(GNULIB_MDA_TEMPNAM)/g' \ < $(top_srcdir)/lib/stdio.in.h | \ - sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \ + sed -e 's|@''HAVE_DECL_FCLOSEALL''@|$(HAVE_DECL_FCLOSEALL)|g' \ + -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \ -e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \ -e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \ -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \ @@ -5448,9 +5947,11 @@ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \ -e 's/@''GNULIB__EXIT''@/$(GNULIB__EXIT)/g' \ + -e 's/@''GNULIB_ALIGNED_ALLOC''@/$(GNULIB_ALIGNED_ALLOC)/g' \ -e 's/@''GNULIB_ATOLL''@/$(GNULIB_ATOLL)/g' \ -e 's/@''GNULIB_CALLOC_POSIX''@/$(GNULIB_CALLOC_POSIX)/g' \ -e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GNULIB_CANONICALIZE_FILE_NAME)/g' \ + -e 's/@''GNULIB_FREE_POSIX''@/$(GNULIB_FREE_POSIX)/g' \ -e 's/@''GNULIB_GETLOADAVG''@/$(GNULIB_GETLOADAVG)/g' \ -e 's/@''GNULIB_GETSUBOPT''@/$(GNULIB_GETSUBOPT)/g' \ -e 's/@''GNULIB_GRANTPT''@/$(GNULIB_GRANTPT)/g' \ @@ -5461,6 +5962,7 @@ -e 's/@''GNULIB_MKOSTEMPS''@/$(GNULIB_MKOSTEMPS)/g' \ -e 's/@''GNULIB_MKSTEMP''@/$(GNULIB_MKSTEMP)/g' \ -e 's/@''GNULIB_MKSTEMPS''@/$(GNULIB_MKSTEMPS)/g' \ + -e 's/@''GNULIB_POSIX_MEMALIGN''@/$(GNULIB_POSIX_MEMALIGN)/g' \ -e 's/@''GNULIB_POSIX_OPENPT''@/$(GNULIB_POSIX_OPENPT)/g' \ -e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \ -e 's/@''GNULIB_PTSNAME_R''@/$(GNULIB_PTSNAME_R)/g' \ @@ -5482,10 +5984,19 @@ -e 's/@''GNULIB_UNLOCKPT''@/$(GNULIB_UNLOCKPT)/g' \ -e 's/@''GNULIB_UNSETENV''@/$(GNULIB_UNSETENV)/g' \ -e 's/@''GNULIB_WCTOMB''@/$(GNULIB_WCTOMB)/g' \ + -e 's/@''GNULIB_MDA_ECVT''@/$(GNULIB_MDA_ECVT)/g' \ + -e 's/@''GNULIB_MDA_FCVT''@/$(GNULIB_MDA_FCVT)/g' \ + -e 's/@''GNULIB_MDA_GCVT''@/$(GNULIB_MDA_GCVT)/g' \ + -e 's/@''GNULIB_MDA_MKTEMP''@/$(GNULIB_MDA_MKTEMP)/g' \ + -e 's/@''GNULIB_MDA_PUTENV''@/$(GNULIB_MDA_PUTENV)/g' \ < $(top_srcdir)/lib/stdlib.in.h | \ sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \ + -e 's|@''HAVE_ALIGNED_ALLOC''@|$(HAVE_ALIGNED_ALLOC)|g' \ -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \ -e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \ + -e 's|@''HAVE_DECL_ECVT''@|$(HAVE_DECL_ECVT)|g' \ + -e 's|@''HAVE_DECL_FCVT''@|$(HAVE_DECL_FCVT)|g' \ + -e 's|@''HAVE_DECL_GCVT''@|$(HAVE_DECL_GCVT)|g' \ -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \ -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \ -e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \ @@ -5497,6 +6008,7 @@ -e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \ -e 's|@''HAVE_MKSTEMP''@|$(HAVE_MKSTEMP)|g' \ -e 's|@''HAVE_MKSTEMPS''@|$(HAVE_MKSTEMPS)|g' \ + -e 's|@''HAVE_POSIX_MEMALIGN''@|$(HAVE_POSIX_MEMALIGN)|g' \ -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' \ @@ -5519,12 +6031,15 @@ -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \ -e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \ -e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \ + -e 's|@''REPLACE_ALIGNED_ALLOC''@|$(REPLACE_ALIGNED_ALLOC)|g' \ -e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \ -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \ + -e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \ -e 's|@''REPLACE_INITSTATE''@|$(REPLACE_INITSTATE)|g' \ -e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \ -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \ -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ + -e 's|@''REPLACE_POSIX_MEMALIGN''@|$(REPLACE_POSIX_MEMALIGN)|g' \ -e 's|@''REPLACE_PTSNAME''@|$(REPLACE_PTSNAME)|g' \ -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \ -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ @@ -5604,14 +6119,18 @@ -e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \ -e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \ -e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \ + -e 's/@''GNULIB_STRERRORNAME_NP''@/$(GNULIB_STRERRORNAME_NP)/g' \ + -e 's/@''GNULIB_SIGABBREV_NP''@/$(GNULIB_SIGABBREV_NP)/g' \ + -e 's/@''GNULIB_SIGDESCR_NP''@/$(GNULIB_SIGDESCR_NP)/g' \ -e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \ -e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \ + -e 's/@''GNULIB_MDA_MEMCCPY''@/$(GNULIB_MDA_MEMCCPY)/g' \ + -e 's/@''GNULIB_MDA_STRDUP''@/$(GNULIB_MDA_STRDUP)/g' \ < $(top_srcdir)/lib/string.in.h | \ sed -e 's|@''HAVE_EXPLICIT_BZERO''@|$(HAVE_EXPLICIT_BZERO)|g' \ -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \ -e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \ -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \ - -e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|g' \ -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \ -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \ -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \ @@ -5627,8 +6146,12 @@ -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \ -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \ -e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \ + -e 's|@''HAVE_STRERRORNAME_NP''@|$(HAVE_STRERRORNAME_NP)|g' \ + -e 's|@''HAVE_SIGABBREV_NP''@|$(HAVE_SIGABBREV_NP)|g' \ + -e 's|@''HAVE_SIGDESCR_NP''@|$(HAVE_SIGDESCR_NP)|g' \ -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \ -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \ + -e 's|@''REPLACE_FFSLL''@|$(REPLACE_FFSLL)|g' \ -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \ -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \ -e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \ @@ -5642,6 +6165,7 @@ -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \ -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \ -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \ + -e 's|@''REPLACE_STRERRORNAME_NP''@|$(REPLACE_STRERRORNAME_NP)|g' \ -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \ -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ @@ -5651,6 +6175,28 @@ } > $@-t && \ mv $@-t $@ +# We need the following in order to create when the system +# doesn't have one that works with the given compiler. +lib/strings.h: lib/strings.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H) + $(AM_V_GEN)rm -f $@-t $@ && \ + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_STRINGS_H''@|$(HAVE_STRINGS_H)|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_STRINGS_H''@|$(NEXT_STRINGS_H)|g' \ + -e 's/@''GNULIB_FFS''@/$(GNULIB_FFS)/g' \ + -e 's|@''HAVE_FFS''@|$(HAVE_FFS)|g' \ + -e 's|@''HAVE_STRCASECMP''@|$(HAVE_STRCASECMP)|g' \ + -e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(top_srcdir)/lib/strings.in.h; \ + } > $@-t && \ + mv $@-t $@ + # We need the following in order to create when the system # doesn't have one that works with the given compiler. lib/sys/socket.h: lib/sys_socket.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H) @@ -5709,8 +6255,10 @@ -e 's/@''GNULIB_FSTAT''@/$(GNULIB_FSTAT)/g' \ -e 's/@''GNULIB_FSTATAT''@/$(GNULIB_FSTATAT)/g' \ -e 's/@''GNULIB_FUTIMENS''@/$(GNULIB_FUTIMENS)/g' \ + -e 's/@''GNULIB_GETUMASK''@/$(GNULIB_GETUMASK)/g' \ -e 's/@''GNULIB_LCHMOD''@/$(GNULIB_LCHMOD)/g' \ -e 's/@''GNULIB_LSTAT''@/$(GNULIB_LSTAT)/g' \ + -e 's/@''GNULIB_MKDIR''@/$(GNULIB_MKDIR)/g' \ -e 's/@''GNULIB_MKDIRAT''@/$(GNULIB_MKDIRAT)/g' \ -e 's/@''GNULIB_MKFIFO''@/$(GNULIB_MKFIFO)/g' \ -e 's/@''GNULIB_MKFIFOAT''@/$(GNULIB_MKFIFOAT)/g' \ @@ -5719,9 +6267,13 @@ -e 's/@''GNULIB_STAT''@/$(GNULIB_STAT)/g' \ -e 's/@''GNULIB_UTIMENSAT''@/$(GNULIB_UTIMENSAT)/g' \ -e 's/@''GNULIB_OVERRIDES_STRUCT_STAT''@/$(GNULIB_OVERRIDES_STRUCT_STAT)/g' \ + -e 's/@''GNULIB_MDA_CHMOD''@/$(GNULIB_MDA_CHMOD)/g' \ + -e 's/@''GNULIB_MDA_MKDIR''@/$(GNULIB_MDA_MKDIR)/g' \ + -e 's/@''GNULIB_MDA_UMASK''@/$(GNULIB_MDA_UMASK)/g' \ -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \ -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \ -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \ + -e 's|@''HAVE_GETUMASK''@|$(HAVE_GETUMASK)|g' \ -e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \ -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \ -e 's|@''HAVE_MKDIRAT''@|$(HAVE_MKDIRAT)|g' \ @@ -5737,7 +6289,9 @@ -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \ -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \ -e 's|@''REPLACE_MKFIFO''@|$(REPLACE_MKFIFO)|g' \ + -e 's|@''REPLACE_MKFIFOAT''@|$(REPLACE_MKFIFOAT)|g' \ -e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \ + -e 's|@''REPLACE_MKNODAT''@|$(REPLACE_MKNODAT)|g' \ -e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \ -e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ @@ -5780,6 +6334,24 @@ } > $@-t && \ mv -f $@-t $@ +# We need the following in order to create when the system +# has one that is incomplete. +lib/sys/wait.h: lib/sys_wait.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) + $(AM_V_at)$(MKDIR_P) lib/sys + $(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_SYS_WAIT_H''@|$(NEXT_SYS_WAIT_H)|g' \ + -e 's/@''GNULIB_WAITPID''@/$(GNULIB_WAITPID)/g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + < $(top_srcdir)/lib/sys_wait.in.h; \ + } > $@-t && \ + mv $@-t $@ + # We need the following in order to create when the system # doesn't have one that works with the given compiler. lib/time.h: lib/time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) @@ -5797,15 +6369,17 @@ -e 's/@''GNULIB_STRFTIME''@/$(GNULIB_STRFTIME)/g' \ -e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \ -e 's/@''GNULIB_TIMEGM''@/$(GNULIB_TIMEGM)/g' \ + -e 's/@''GNULIB_TIMESPEC_GET''@/$(GNULIB_TIMESPEC_GET)/g' \ -e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \ -e 's/@''GNULIB_TIME_RZ''@/$(GNULIB_TIME_RZ)/g' \ -e 's/@''GNULIB_TZSET''@/$(GNULIB_TZSET)/g' \ + -e 's/@''GNULIB_MDA_TZSET''@/$(GNULIB_MDA_TZSET)/g' \ -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \ -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \ -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \ -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \ + -e 's|@''HAVE_TIMESPEC_GET''@|$(HAVE_TIMESPEC_GET)|g' \ -e 's|@''HAVE_TIMEZONE_T''@|$(HAVE_TIMEZONE_T)|g' \ - -e 's|@''HAVE_TZSET''@|$(HAVE_TZSET)|g' \ -e 's|@''REPLACE_CTIME''@|$(REPLACE_CTIME)|g' \ -e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \ -e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \ @@ -5819,6 +6393,7 @@ -e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ -e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \ -e 's|@''UNISTD_H_DEFINES_STRUCT_TIMESPEC''@|$(UNISTD_H_DEFINES_STRUCT_TIMESPEC)|g' \ + -e 's|@''TIME_H_DEFINES_TIME_UTC''@|$(TIME_H_DEFINES_TIME_UTC)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \ -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ @@ -5848,6 +6423,13 @@ -e 's/@''GNULIB_DUP3''@/$(GNULIB_DUP3)/g' \ -e 's/@''GNULIB_ENVIRON''@/$(GNULIB_ENVIRON)/g' \ -e 's/@''GNULIB_EUIDACCESS''@/$(GNULIB_EUIDACCESS)/g' \ + -e 's/@''GNULIB_EXECL''@/$(GNULIB_EXECL)/g' \ + -e 's/@''GNULIB_EXECLE''@/$(GNULIB_EXECLE)/g' \ + -e 's/@''GNULIB_EXECLP''@/$(GNULIB_EXECLP)/g' \ + -e 's/@''GNULIB_EXECV''@/$(GNULIB_EXECV)/g' \ + -e 's/@''GNULIB_EXECVE''@/$(GNULIB_EXECVE)/g' \ + -e 's/@''GNULIB_EXECVP''@/$(GNULIB_EXECVP)/g' \ + -e 's/@''GNULIB_EXECVPE''@/$(GNULIB_EXECVPE)/g' \ -e 's/@''GNULIB_FACCESSAT''@/$(GNULIB_FACCESSAT)/g' \ -e 's/@''GNULIB_FCHDIR''@/$(GNULIB_FCHDIR)/g' \ -e 's/@''GNULIB_FCHOWNAT''@/$(GNULIB_FCHOWNAT)/g' \ @@ -5857,6 +6439,7 @@ -e 's/@''GNULIB_GETCWD''@/$(GNULIB_GETCWD)/g' \ -e 's/@''GNULIB_GETDOMAINNAME''@/$(GNULIB_GETDOMAINNAME)/g' \ -e 's/@''GNULIB_GETDTABLESIZE''@/$(GNULIB_GETDTABLESIZE)/g' \ + -e 's/@''GNULIB_GETENTROPY''@/$(GNULIB_GETENTROPY)/g' \ -e 's/@''GNULIB_GETGROUPS''@/$(GNULIB_GETGROUPS)/g' \ -e 's/@''GNULIB_GETHOSTNAME''@/$(GNULIB_GETHOSTNAME)/g' \ -e 's/@''GNULIB_GETLOGIN''@/$(GNULIB_GETLOGIN)/g' \ @@ -5892,12 +6475,33 @@ -e 's/@''GNULIB_UNLINKAT''@/$(GNULIB_UNLINKAT)/g' \ -e 's/@''GNULIB_USLEEP''@/$(GNULIB_USLEEP)/g' \ -e 's/@''GNULIB_WRITE''@/$(GNULIB_WRITE)/g' \ + -e 's/@''GNULIB_MDA_ACCESS''@/$(GNULIB_MDA_ACCESS)/g' \ + -e 's/@''GNULIB_MDA_CHDIR''@/$(GNULIB_MDA_CHDIR)/g' \ + -e 's/@''GNULIB_MDA_CLOSE''@/$(GNULIB_MDA_CLOSE)/g' \ + -e 's/@''GNULIB_MDA_DUP''@/$(GNULIB_MDA_DUP)/g' \ + -e 's/@''GNULIB_MDA_DUP2''@/$(GNULIB_MDA_DUP2)/g' \ + -e 's/@''GNULIB_MDA_EXECL''@/$(GNULIB_MDA_EXECL)/g' \ + -e 's/@''GNULIB_MDA_EXECLE''@/$(GNULIB_MDA_EXECLE)/g' \ + -e 's/@''GNULIB_MDA_EXECLP''@/$(GNULIB_MDA_EXECLP)/g' \ + -e 's/@''GNULIB_MDA_EXECV''@/$(GNULIB_MDA_EXECV)/g' \ + -e 's/@''GNULIB_MDA_EXECVE''@/$(GNULIB_MDA_EXECVE)/g' \ + -e 's/@''GNULIB_MDA_EXECVP''@/$(GNULIB_MDA_EXECVP)/g' \ + -e 's/@''GNULIB_MDA_EXECVPE''@/$(GNULIB_MDA_EXECVPE)/g' \ + -e 's/@''GNULIB_MDA_GETCWD''@/$(GNULIB_MDA_GETCWD)/g' \ + -e 's/@''GNULIB_MDA_GETPID''@/$(GNULIB_MDA_GETPID)/g' \ + -e 's/@''GNULIB_MDA_ISATTY''@/$(GNULIB_MDA_ISATTY)/g' \ + -e 's/@''GNULIB_MDA_LSEEK''@/$(GNULIB_MDA_LSEEK)/g' \ + -e 's/@''GNULIB_MDA_READ''@/$(GNULIB_MDA_READ)/g' \ + -e 's/@''GNULIB_MDA_RMDIR''@/$(GNULIB_MDA_RMDIR)/g' \ + -e 's/@''GNULIB_MDA_SWAB''@/$(GNULIB_MDA_SWAB)/g' \ + -e 's/@''GNULIB_MDA_UNLINK''@/$(GNULIB_MDA_UNLINK)/g' \ + -e 's/@''GNULIB_MDA_WRITE''@/$(GNULIB_MDA_WRITE)/g' \ < $(top_srcdir)/lib/unistd.in.h | \ sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \ -e 's|@''HAVE_COPY_FILE_RANGE''@|$(HAVE_COPY_FILE_RANGE)|g' \ - -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \ -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \ -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \ + -e 's|@''HAVE_EXECVPE''@|$(HAVE_EXECVPE)|g' \ -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \ -e 's|@''HAVE_FCHDIR''@|$(HAVE_FCHDIR)|g' \ -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \ @@ -5905,6 +6509,7 @@ -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \ -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \ -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \ + -e 's|@''HAVE_GETENTROPY''@|$(HAVE_GETENTROPY)|g' \ -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \ -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ @@ -5926,6 +6531,7 @@ -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \ -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \ -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ + -e 's|@''HAVE_DECL_EXECVPE''@|$(HAVE_DECL_EXECVPE)|g' \ -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' \ @@ -5944,6 +6550,13 @@ -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \ -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \ -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \ + -e 's|@''REPLACE_EXECL''@|$(REPLACE_EXECL)|g' \ + -e 's|@''REPLACE_EXECLE''@|$(REPLACE_EXECLE)|g' \ + -e 's|@''REPLACE_EXECLP''@|$(REPLACE_EXECLP)|g' \ + -e 's|@''REPLACE_EXECV''@|$(REPLACE_EXECV)|g' \ + -e 's|@''REPLACE_EXECVE''@|$(REPLACE_EXECVE)|g' \ + -e 's|@''REPLACE_EXECVP''@|$(REPLACE_EXECVP)|g' \ + -e 's|@''REPLACE_EXECVPE''@|$(REPLACE_EXECVPE)|g' \ -e 's|@''REPLACE_FACCESSAT''@|$(REPLACE_FACCESSAT)|g' \ -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \ -e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \ @@ -5974,6 +6587,7 @@ -e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \ -e 's|@''REPLACE_USLEEP''@|$(REPLACE_USLEEP)|g' \ -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \ + -e 's|@''UNISTD_H_HAVE_SYS_RANDOM_H''@|$(UNISTD_H_HAVE_SYS_RANDOM_H)|g' \ -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \ -e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ @@ -6032,6 +6646,7 @@ -e 's/@''GNULIB_WMEMCMP''@/$(GNULIB_WMEMCMP)/g' \ -e 's/@''GNULIB_WMEMCPY''@/$(GNULIB_WMEMCPY)/g' \ -e 's/@''GNULIB_WMEMMOVE''@/$(GNULIB_WMEMMOVE)/g' \ + -e 's/@''GNULIB_WMEMPCPY''@/$(GNULIB_WMEMPCPY)/g' \ -e 's/@''GNULIB_WMEMSET''@/$(GNULIB_WMEMSET)/g' \ -e 's/@''GNULIB_WCSLEN''@/$(GNULIB_WCSLEN)/g' \ -e 's/@''GNULIB_WCSNLEN''@/$(GNULIB_WCSNLEN)/g' \ @@ -6057,6 +6672,7 @@ -e 's/@''GNULIB_WCSTOK''@/$(GNULIB_WCSTOK)/g' \ -e 's/@''GNULIB_WCSWIDTH''@/$(GNULIB_WCSWIDTH)/g' \ -e 's/@''GNULIB_WCSFTIME''@/$(GNULIB_WCSFTIME)/g' \ + -e 's/@''GNULIB_MDA_WCSDUP''@/$(GNULIB_MDA_WCSDUP)/g' \ < $(top_srcdir)/lib/wchar.in.h | \ sed -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \ -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \ @@ -6072,6 +6688,7 @@ -e 's|@''HAVE_WMEMCMP''@|$(HAVE_WMEMCMP)|g' \ -e 's|@''HAVE_WMEMCPY''@|$(HAVE_WMEMCPY)|g' \ -e 's|@''HAVE_WMEMMOVE''@|$(HAVE_WMEMMOVE)|g' \ + -e 's|@''HAVE_WMEMPCPY''@|$(HAVE_WMEMPCPY)|g' \ -e 's|@''HAVE_WMEMSET''@|$(HAVE_WMEMSET)|g' \ -e 's|@''HAVE_WCSLEN''@|$(HAVE_WCSLEN)|g' \ -e 's|@''HAVE_WCSNLEN''@|$(HAVE_WCSNLEN)|g' \ @@ -6098,6 +6715,7 @@ -e 's|@''HAVE_WCSWIDTH''@|$(HAVE_WCSWIDTH)|g' \ -e 's|@''HAVE_WCSFTIME''@|$(HAVE_WCSFTIME)|g' \ -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \ + -e 's|@''HAVE_DECL_WCSDUP''@|$(HAVE_DECL_WCSDUP)|g' \ -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \ | \ sed -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \ diff -Nru datamash-1.7/man/datamash.x datamash-1.8/man/datamash.x --- datamash-1.7/man/datamash.x 2020-04-23 04:02:11.000000000 +0000 +++ datamash-1.8/man/datamash.x 2022-07-10 20:28:17.000000000 +0000 @@ -1,5 +1,5 @@ ." GNU Datamash - manual page -." Copyright (C) 2014-2020 Assaf Gordon +." Copyright (C) 2014-2021 Assaf Gordon [NAME] datamash - command-line calculations @@ -10,11 +10,9 @@ .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. +primary operation must be listed first. 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" @@ -79,7 +77,7 @@ .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 +floor (round down), ceil (ceiling, round up), trunc (truncate, round towards zero), frac (fraction, return fraction part of a decimal-point value). .TP @@ -101,8 +99,9 @@ n/i/d/p/h/o (see examples below). .TP -.B cut +.B cut/echo copy input field to output field (similar to cut(1)). +The echo command is simply an alias to cut. .PP @@ -152,8 +151,9 @@ one random value from the group .TP -.B unique +.B unique/uniq comma-separated sorted list of unique values +The uniq command is simply an alias to unique. .TP .B collapse @@ -166,7 +166,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). @@ -191,6 +191,14 @@ to \fBmedian\fR). .TP +.B ms +mean square of the values + +.TP +.B rms +root mean square of the values + +.TP .B median median value @@ -337,7 +345,7 @@ .SS "Header lines" .PP -Use \fB\-h\fR \fB(\-\-headers)\fR if the input file has a header line: +Use \fB\-H\fR \fB(\-\-headers)\fR if the input file has a header line: .PP .nf .RS @@ -349,7 +357,7 @@ Christian Business 88 Derek Arts 60 -# Calculate the mean and standard devian for each major +# Calculate the mean and standard deviation for each major $ \fBdatamash\fR \-\-sort \-\-headers \-\-group 2 mean 3 pstdev 3 < scores_h.txt (or use short form) @@ -388,8 +396,8 @@ .SS "Skipping comment lines" -Use \fB\-C\fR \fB(\-\-skip\-comments)\fR to skip lines starting with \'#\' -or \'\;\' characters (and optional whitespace before them): +Use \fB\-C\fR \fB(\-\-skip\-comments)\fR to skip lines starting with '#' +or '\;' characters (and optional whitespace before them): .PP .nf .RS @@ -614,9 +622,9 @@ $ ( echo X ; seq \-10 2.5 10 ) \\ | \fBdatamash\fR \-H \-\-full bin:5 1 X bin(X) -\-10.0 \-15 +\-10.0 \-10 \-7.5 \-10 - \-5.0 \-10 + \-5.0 \-5 \-2.5 \-5 0.0 0 2.5 0 diff -Nru datamash-1.7/man/decorate.x datamash-1.8/man/decorate.x --- datamash-1.7/man/decorate.x 2020-04-23 16:39:59.000000000 +0000 +++ datamash-1.8/man/decorate.x 2022-06-01 21:08:00.000000000 +0000 @@ -1,10 +1,10 @@ ." GNU decorate - manual page -." Copyright (C) 2014-2020 Assaf Gordon +." Copyright (C) 2014-2021 Assaf Gordon [NAME] -decorate - command-line calculations +decorate - convert fields of various formats -[>OVERVIEW] +[>DESCRIPTION] The \fBdecorate\fR program allows sorting input according to various ordering, e.g. IP addresses, roman numerals, etc. It works in tandem with sort(1) to perform the actual sorting. @@ -19,6 +19,7 @@ .br 3. Undecorate: remove the inserted fields +[=EXAMPLES] Example of preparing to sort by roman numerals: .PP .nf @@ -71,7 +72,6 @@ -[=EXAMPLES] [ADDITIONAL INFORMATION] See diff -Nru datamash-1.7/NEWS datamash-1.8/NEWS --- datamash-1.7/NEWS 2020-04-23 17:30:36.000000000 +0000 +++ datamash-1.8/NEWS 2022-07-23 02:19:59.000000000 +0000 @@ -1,3 +1,75 @@ +* Noteworthy changes in release 1.8 (2022-07-23) [stable] + +** Changes in Behavior + + Schedule -f/--full combined with non-linewise operations for deprecation. + In a future release, -f/--full will only be usable with operations where + it makes sense. For now, we print a warning to stderr when -f/--full is + used with non-linewise operations, and such usage will no longer be + supported. + + The bin operation now uses more intuitive bins. Previously, a command + such as `datamash bin 1 <<< -0` would output -100; and -100 did not fall + in its own bin. We now require all bins to take the form `[nx,(n+1)x)` + with integer n and bin width x. We discard the sign on -0 and gate such + inputs into the [0,x) bin. + + Operations taking more than one argument now provide more complete output + with --header-out. Previously, an operation such as `pcov x:y` would + produce an output header like `pcov(y)`, discarding the `x`. The new + behavior will output header `pcov(x,y)`. + + datamash(1) no longer ignores --output-delimiter with the rmdup operation. + +** New Features + + New datamash option --sort-cmd argument to specify the program used + by the -s option to sort input, plus enhancements to the security and + portability of building sort command lines. + + New datamash option -c/--collapse-delimiter=X argument uses character + X instead of comma between values in collapse and unique lists. + + New datamash operations: mean square (ms) and root mean square (rms). + + Decorate now supports sorting IP addresses of both versions 4 and 6 + together. IPv4 addresses are logically converted to IPv6 addresses, + either as IPv4-Mapped (ipv6v4map) or IPv4-Compatible (ipv6v4comp) + addresses. + + Add two command aliases: + 'echo' may now be used instead of 'cut'. + 'uniq' may now be used instead of 'unique'. + +** Improvements + + Updated the bash completion script to reflect recent additions. + +** Bug Fixes + + Datamash now passes the -z/--zero-terminated flag to the sort(1) child + process when used with "--sort --zero-terminated". Additionally, + if the system's sort(1) does not support -z, datamash reports the error + and exits. Previously it would omit the "-z" when running sort(1), + resulting in incorrect results. + + Documentation fixes and spelling corrections. + + Incorrect format in a decorate(1) error breaking compilation on some + systems. + + datamash(1), decorate(1): Fix some minor memory leaks. + + datamash(1) no longer crashes when the unique or countunique operations + are used with input data containing NUL bytes. The problem was reported + in https://lists.gnu.org/archive/html/bug-datamash/2020-11/msg00001.html + by Catalin Patulea. + + datamash(1) no longer crashes when crosstab with --header-in is called + by field name instead of index. I.e. `datamash --header-in ct x,y` now + works as expected. + + * Noteworthy changes in release 1.7 (2020-04-23) [testing] ** New Features Binary files /tmp/tmpk9ju3y2l/uqkwDqQpWf/datamash-1.7/po/da.gmo and /tmp/tmpk9ju3y2l/ut88G7BZjZ/datamash-1.8/po/da.gmo differ diff -Nru datamash-1.7/po/da.po datamash-1.8/po/da.po --- datamash-1.7/po/da.po 2020-04-23 17:34:23.000000000 +0000 +++ datamash-1.8/po/da.po 2022-07-23 01:57:18.000000000 +0000 @@ -10,7 +10,7 @@ msgstr "" "Project-Id-Version: GNU datamash 1.1.1.19\n" "Report-Msgid-Bugs-To: bug-datamash@gnu.org\n" -"POT-Creation-Date: 2020-04-23 11:34-0600\n" +"POT-Creation-Date: 2022-07-23 11:57+1000\n" "PO-Revision-Date: 2018-06-05 18:00+0200\n" "Last-Translator: Joe Hansen \n" "Language-Team: Danish \n" @@ -85,11 +85,11 @@ #. If you don't know what to put here, please see #. #. and use glyphs suitable for your language. -#: lib/quotearg.c:362 +#: lib/quotearg.c:355 msgid "`" msgstr "»" -#: lib/quotearg.c:363 +#: lib/quotearg.c:356 msgid "'" msgstr "«" @@ -113,13 +113,6 @@ #. TRANSLATORS: The %s placeholder is the web address of the GPL license. #: lib/version-etc.c:88 #, fuzzy, c-format -#| 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" msgid "" "License GPLv3+: GNU GPL version 3 or later <%s>.\n" "This is free software: you are free to change and redistribute it.\n" @@ -247,9 +240,6 @@ #. bugs (typically your translation team's web or email address). #: lib/version-etc.c:249 #, fuzzy, c-format -#| msgid "" -#| "\n" -#| "Report bugs to: %s\n" msgid "Report bugs to: %s\n" msgstr "" "\n" @@ -267,7 +257,6 @@ #: lib/version-etc.c:260 #, fuzzy, c-format -#| msgid "General help using GNU software: \n" msgid "General help using GNU software: <%s>\n" msgstr "" "Generel hjælp til brugen af GNU-programmer: \n" @@ -292,25 +281,25 @@ msgstr "%s%s-argument »%s« er for stor" #. This is a proper name. See the gettext manual, section Names. -#: src/datamash.c:65 src/decorate.c:41 -msgid "Assaf Gordon" -msgstr "Assaf Gordon" +#: src/datamash.c:66 +msgid "Assaf Gordon, Tim Rice, Shawn Wagner, Erik Auerswald" +msgstr "" -#: src/datamash.c:161 src/datamash.c:504 +#: src/datamash.c:169 src/datamash.c:539 #, 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:182 #, c-format 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:185 msgid "Performs numeric/string operations on input from stdin." msgstr "Udfører numerisk/streng-operationer på inddata fra standardind." -#: src/datamash.c:180 +#: src/datamash.c:188 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" @@ -318,7 +307,7 @@ "»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:183 +#: src/datamash.c:191 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" @@ -326,7 +315,7 @@ "»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:186 +#: src/datamash.c:194 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" @@ -336,49 +325,56 @@ "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:191 +#: src/datamash.c:199 msgid "Primary operations:\n" msgstr "Primære operationer:\n" -#: src/datamash.c:194 +#: src/datamash.c:202 msgid "Line-Filtering operations:\n" msgstr "Linjefiltreringsoperationer:\n" -#: src/datamash.c:197 +#: src/datamash.c:205 msgid "Per-Line operations:\n" msgstr "Per linje-operationer:\n" -#: src/datamash.c:203 +#: src/datamash.c:211 msgid "Numeric Grouping operations:\n" msgstr "Numerisk grupperingsoperationer:\n" -#: src/datamash.c:206 +#: src/datamash.c:214 msgid "Textual/Numeric Grouping operations:\n" msgstr "Tekstmæssig/numerisk grupperingsoperationer:\n" -#: src/datamash.c:210 +#: src/datamash.c:218 msgid "Statistical Grouping operations:\n" msgstr "Statistiske grupperingsoperationer:\n" -#: src/datamash.c:219 +#: src/datamash.c:227 src/decorate.c:179 +#, fuzzy +msgid "Options:\n" +msgstr "Generelle tilvalg:\n" + +#: src/datamash.c:229 msgid "Grouping Options:\n" msgstr "Grupperingsindstillinger:\n" -#: src/datamash.c:220 +#: src/datamash.c:230 msgid "" " -C, --skip-comments skip comment lines (starting with '#' or ';'\n" " and optional whitespace)\n" msgstr "" -#: src/datamash.c:224 +#: src/datamash.c:234 msgid "" " -f, --full print entire input line before op results\n" " (default: print only the grouped keys)\n" +" This option is only sensible for linewise\n" +" operations. Other uses are deprecated and\n" +" will be removed in a future version of GNU\n" +" Datamash.\n" msgstr "" -" -f, --full udskriv hel inddatalinje før op-resultater\n" -" (standard: udskriv kun grupperede nøgler)\n" -#: src/datamash.c:228 +#: src/datamash.c:242 msgid "" " -g, --group=X[,Y,Z] group via fields X,[Y,Z];\n" " equivalent to primary operation 'groupby'\n" @@ -386,21 +382,21 @@ " -g, --group=X[,Y,Z] gruppér via felter X,[Y,Z];\n" " svarer til primære operation »groupby«\n" -#: src/datamash.c:232 +#: src/datamash.c:246 msgid " --header-in first input line is column headers\n" msgstr "" " --header-in første inddatalinje er kolonneteksthoveder\n" -#: src/datamash.c:235 +#: src/datamash.c:249 msgid " --header-out print column headers as first line\n" msgstr "" " --header-out udskriv kolonneteksthoveder som første linje\n" -#: src/datamash.c:238 +#: src/datamash.c:252 msgid " -H, --headers same as '--header-in --header-out'\n" msgstr " -H, --headers samme som »--header-in --header-out«\n" -#: src/datamash.c:241 +#: src/datamash.c:255 msgid "" " -i, --ignore-case ignore upper/lower case when comparing text;\n" " this affects grouping, and string operations\n" @@ -410,7 +406,7 @@ " dette påvirker gruppering, og " "strengoperationer\n" -#: src/datamash.c:245 +#: src/datamash.c:259 msgid "" " -s, --sort sort the input before grouping; this removes " "the\n" @@ -422,51 +418,57 @@ "igennem\n" " kanalen »sort«\n" -#: src/datamash.c:250 +#: src/datamash.c:263 +msgid "" +" -c, --collapse-delimiter=X use X to separate elements in collapse and\n" +" unique lists (default: comma)\n" +msgstr "" + +#: src/datamash.c:268 msgid "File Operation Options:\n" msgstr "Tilvalg for filoperationer:\n" -#: src/datamash.c:251 +#: src/datamash.c:269 msgid " --no-strict allow lines with varying number of fields\n" msgstr "" " --no-strict tillad linjer med varierende antal felter\n" -#: src/datamash.c:254 +#: src/datamash.c:272 #, 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" -#: src/datamash.c:259 src/decorate.c:174 +#: src/datamash.c:277 src/decorate.c:185 msgid "General Options:\n" msgstr "Generelle tilvalg:\n" -#: src/datamash.c:260 +#: src/datamash.c:278 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" -#: src/datamash.c:263 +#: src/datamash.c:281 msgid "" " --format=FORMAT print numeric values with printf style\n" " floating-point FORMAT.\n" msgstr "" -#: src/datamash.c:267 +#: src/datamash.c:285 msgid "" " --output-delimiter=X use X instead as output field delimiter\n" " (default: use same delimiter as -t/-W)\n" msgstr "" -#: src/datamash.c:271 +#: src/datamash.c:289 msgid " --narm skip NA/NaN values\n" msgstr " --narm udelad NA/NaN-værdier\n" -#: src/datamash.c:274 +#: src/datamash.c:292 msgid " -R, --round=N round numeric output to N decimal places\n" msgstr "" -#: src/datamash.c:277 +#: src/datamash.c:295 msgid "" " -W, --whitespace use whitespace (one or more spaces and/or tabs)\n" " for field delimiters\n" @@ -475,31 +477,43 @@ "tabulatorer)\n" " for feltafgrænsere\n" -#: src/datamash.c:281 +#: src/datamash.c:299 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:290 +#: src/datamash.c:302 src/decorate.c:219 +msgid " --sort-cmd=/path/to/sort Alternative sort(1) to use.\n" +msgstr "" + +#: src/datamash.c:311 +msgid "Environment:" +msgstr "" + +#: src/datamash.c:313 +msgid " LC_NUMERIC decimal-point character and thousands separator\n" +msgstr "" + +#: src/datamash.c:319 msgid "Examples:" msgstr "Eksempler:" -#: src/datamash.c:292 +#: src/datamash.c:321 msgid "Print the sum and the mean of values from column 1:" msgstr "Udskriv summen og middelværdierne fra kolonne 1:" -#: src/datamash.c:297 +#: src/datamash.c:326 msgid "Transpose input:" msgstr "Omdan inddata:" -#: src/datamash.c:304 src/decorate.c:287 +#: src/datamash.c:333 src/decorate.c:302 msgid "For detailed usage information and examples, see\n" msgstr "For detaljeret brugsinformation og eksempler, se\n" -#: src/datamash.c:306 src/decorate.c:289 +#: src/datamash.c:335 src/decorate.c:304 msgid "The manual and more examples are available at\n" msgstr "Manualen og flere eksempler er tilgængelige på\n" -#: src/datamash.c:315 +#: src/datamash.c:344 #, c-format msgid "" "invalid input: field % requested, line % has only " @@ -508,12 +522,18 @@ "ugyldige inddata: der blev anmodt om feltet %, linje % har " "kun % felter" -#: src/datamash.c:385 +#: src/datamash.c:414 #, c-format msgid "%s in line % field %: '%s'" msgstr "%s i linje % felt %: »%s«" -#: src/datamash.c:713 +#: src/datamash.c:656 +msgid "" +"datamash: Using -f/--full with non-linewise operations is deprecated and " +"will be disabled in a future release.\n" +msgstr "" + +#: src/datamash.c:752 #, c-format msgid "" "transpose input error: line % has % fields (previous lines " @@ -524,7 +544,7 @@ "havde %);\n" "se --help for at deaktivere strict-tilstand" -#: src/datamash.c:770 +#: src/datamash.c:809 #, c-format msgid "" "reverse-field input error: line % has % fields (previous " @@ -536,7 +556,7 @@ "%);\n" "se --help for at deaktivere strict-tilstand" -#: src/datamash.c:879 src/datamash.c:896 src/datamash.c:902 +#: src/datamash.c:918 src/datamash.c:935 src/datamash.c:941 #, c-format msgid "" "line % (% fields):\n" @@ -545,7 +565,7 @@ "linje % (% felter):\n" " " -#: src/datamash.c:885 +#: src/datamash.c:924 #, c-format msgid "" "check failed: line % has % fields (expecting %)" @@ -553,7 +573,7 @@ "kontrol mislykkedes: linje % har % felter (forventer " "%)" -#: src/datamash.c:908 +#: src/datamash.c:947 #, c-format msgid "" "check failed: line % has % fields (previous line had " @@ -562,75 +582,71 @@ "kontrol mislykkedes: linje % har % felter (tidligere linje " "havde %)" -#: src/datamash.c:922 +#: src/datamash.c:961 #, c-format msgid "check failed: input had % lines (expecting %)" msgstr "" "kontrol mislykkedes: inddata havde % linjer (forventer %)" -#: src/datamash.c:928 +#: src/datamash.c:967 #, c-format msgid "% line" msgid_plural "% lines" msgstr[0] "% linje" msgstr[1] "% linjer" -#: src/datamash.c:931 +#: src/datamash.c:970 #, c-format msgid "% field" msgid_plural "% fields" msgstr[0] "% felt" msgstr[1] "% felter" -#: src/datamash.c:1032 +#: src/datamash.c:1080 msgid "hash memory allocation error" msgstr "allokeringsfejl for hash-hukommelsen" -#: src/datamash.c:1099 -msgid "sort command too-long (please report this bug)" +#: src/datamash.c:1147 +msgid "-s and -z cannot be combined on this system" msgstr "" -"sorteringskommandoen er for lang (rapporter venligst dette som en fejl)" -#: src/datamash.c:1105 +#: src/datamash.c:1181 msgid "failed to run 'sort': popen failed" msgstr "kunne ikke køre »sort«: popen mislykkedes" -#: src/datamash.c:1121 +#: src/datamash.c:1197 msgid "read error" msgstr "læsefejl" -#: src/datamash.c:1129 +#: src/datamash.c:1205 msgid "read error (on close)" msgstr "læsefejl (ved lukning)" -#: src/datamash.c:1222 src/datamash.c:1229 +#: src/datamash.c:1300 src/datamash.c:1307 src/datamash.c:1323 msgid "the delimiter must be a single character" msgstr "afgrænseren skal være et enkelt tegn" -#: src/datamash.c:1265 +#: src/datamash.c:1354 #, c-format msgid "missing operation specifiers" msgstr "manglende operationspecifikationer" -#: src/datamash.c:1283 +#: src/datamash.c:1372 msgid "-H or --header-in must be used with named columns" msgstr "-H eller --header-in skal bruges med navngivne kolonner" #: src/decorate-functions.c:76 #, fuzzy, c-format -#| msgid "invalid numeric value" msgid "invalid empty roman numeral" msgstr "ugyldig numerisk værdi" #: src/decorate-functions.c:84 #, fuzzy, c-format -#| msgid "invalid numeric value '%s'" msgid "invalid roman numeral '%c' in %s" msgstr "ugyldig numerisk værdi »%s«" #: src/decorate-functions.c:120 #, fuzzy, c-format -#| msgid "invalid operand %s" msgid "invalid IPv4 address %s" msgstr "ugyldig operand %s" @@ -649,11 +665,24 @@ #: src/decorate-functions.c:165 #, fuzzy, c-format -#| msgid "invalid operand %s" msgid "invalid IPv6 address %s" msgstr "ugyldig operand %s" -#: src/decorate.c:140 +#: src/decorate-functions.c:192 +msgid "inet_pton failed for AF_INET and AF_INET6" +msgstr "" + +#: src/decorate-functions.c:196 +#, fuzzy, c-format +msgid "invalid IP address %s" +msgstr "ugyldig operand %s" + +#. This is a proper name. See the gettext manual, section Names. +#: src/decorate.c:42 +msgid "Assaf Gordon, Shawn Wagner and Erik Auerswald" +msgstr "" + +#: src/decorate.c:145 #, c-format msgid "" "Usage: %s [OPTION]... [INPUT]\n" @@ -662,29 +691,29 @@ "\n" msgstr "" -#: src/decorate.c:147 +#: src/decorate.c:152 msgid "Converts (and optionally sorts) fields of various formats\n" msgstr "" -#: src/decorate.c:153 +#: src/decorate.c:158 msgid "" "With --decorate: adds the converted fields to the start\n" "of each line and prints and prints it to STDOUT; does not sort.\n" msgstr "" -#: src/decorate.c:160 +#: src/decorate.c:165 msgid "" "With --undecorate: removes the first N fields from the input;\n" "Use as post-processing step after sort(1).\n" msgstr "" -#: src/decorate.c:167 +#: src/decorate.c:172 msgid "" "Without --decorate and --undecorate: automatically decorates the input,\n" "runs sort(1) and undecorates the result; This is the easiest method to use.\n" msgstr "" -#: src/decorate.c:179 +#: src/decorate.c:190 msgid "" " --decorate decorate/convert the specified fields and " "print\n" @@ -693,13 +722,13 @@ " sort(1) or undecorates the output\n" msgstr "" -#: src/decorate.c:184 +#: src/decorate.c:195 msgid "" " --header=N does not decorate or sort the first N lines\n" " -H same as --header=N\n" msgstr "" -#: src/decorate.c:188 +#: src/decorate.c:199 msgid "" " -k, --key=KEYDEF key/field to sort; same syntax as sort(1),\n" " optionally followed by ':method' to convert\n" @@ -708,17 +737,15 @@ " and available conversion below\n" msgstr "" -#: src/decorate.c:194 +#: src/decorate.c:205 #, fuzzy -#| msgid "" -#| " -t, --field-separator=X use X instead of TAB as field delimiter\n" msgid "" " -t, --field-separator=SEP use SEP instead of non-blank to blank " "transition\n" msgstr "" " -t, --field-separator=X brug X i stedet for TABULATOR som feltafgrænser\n" -#: src/decorate.c:197 +#: src/decorate.c:208 msgid "" " --print-sort-args print adjusted parameters for sort(1); Useful\n" " when using --decorate and then manually " @@ -726,25 +753,24 @@ " sort(1)\n" msgstr "" -#: src/decorate.c:202 +#: src/decorate.c:213 #, fuzzy -#| msgid "" -#| " --no-strict allow lines with varying number of fields\n" msgid " --undecorate=N removes the first N fields\n" msgstr "" " --no-strict tillad linjer med varierende antal felter\n" -#: src/decorate.c:205 +#: src/decorate.c:216 #, fuzzy -#| msgid " -z, --zero-terminated end lines with 0 byte, not newline\n" msgid " -z, --zero-terminated line delimiter is NUL, not newline\n" msgstr " -z, --zero-terminated afslut linjer med 0 byte, ikke nylinje\n" -#: src/decorate.c:213 -msgid "The following options are passed to sort(1) as-is:\n" +#: src/decorate.c:227 +msgid "" +"The following options are passed to sort as-is (Most of them assume GNU " +"sort):\n" msgstr "" -#: src/decorate.c:219 +#: src/decorate.c:234 msgid "" " -c, --check\n" " --compress-program\n" @@ -757,226 +783,219 @@ " --parallel\n" msgstr "" -#: src/decorate.c:234 +#: src/decorate.c:249 msgid "Available conversions methods (use with -k):\n" msgstr "" -#: src/decorate.c:246 +#: src/decorate.c:261 #, fuzzy -#| msgid "Examples:" msgid "Examples:\n" msgstr "Eksempler:" -#: src/decorate.c:252 +#: src/decorate.c:267 msgid "The following two invocations are equivalent:\n" msgstr "" -#: src/decorate.c:267 +#: src/decorate.c:282 msgid "Decorated output of roman numerals:\n" msgstr "" -#: src/decorate.c:431 +#: src/decorate.c:446 msgid "fwrite (header line) failed" msgstr "" -#: src/decorate.c:439 +#: src/decorate.c:454 msgid "fflush (header line) failed" msgstr "" -#: src/decorate.c:445 +#: src/decorate.c:460 #, c-format -msgid "conversion failed in line %zu" +msgid "conversion failed in line %" msgstr "" -#: src/decorate.c:451 +#: src/decorate.c:467 msgid "decorate: fwrite failed" msgstr "" -#: src/decorate.c:457 src/decorate.c:519 +#: src/decorate.c:473 src/decorate.c:535 #, c-format msgid "error reading %s" msgstr "" -#: src/decorate.c:538 +#: src/decorate.c:554 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number at field start" msgstr "ugyldig numerisk værdi »%s«" -#: src/decorate.c:543 src/decorate.c:571 +#: src/decorate.c:559 src/decorate.c:587 msgid "field number is zero" msgstr "" -#: src/decorate.c:548 src/decorate.c:576 +#: src/decorate.c:564 src/decorate.c:592 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number after '.'" msgstr "ugyldig numerisk værdi »%s«" -#: src/decorate.c:552 +#: src/decorate.c:568 msgid "character offset is zero" msgstr "" -#: src/decorate.c:567 +#: src/decorate.c:583 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number after ','" msgstr "ugyldig numerisk værdi »%s«" -#: src/decorate.c:603 +#: src/decorate.c:619 msgid "missing external conversion command" msgstr "" -#: src/decorate.c:618 +#: src/decorate.c:634 msgid "missing internal conversion function" msgstr "" -#: src/decorate.c:630 +#: src/decorate.c:646 #, fuzzy -#| msgid "invalid field pair for operation %s" msgid "invalid built-in conversion option" msgstr "ugyldigt feltpar for operation %s" -#: src/decorate.c:641 +#: src/decorate.c:657 msgid "" "ordering flags (b/d/i/h/n/g/M/R/V) cannot be combined with a conversion " "function" msgstr "" -#: src/decorate.c:671 +#: src/decorate.c:687 #, fuzzy -#| msgid "invalid operation %s" msgid "invalid key specification" msgstr "ugyldig operation %s" -#: src/decorate.c:853 +#: src/decorate.c:890 #, fuzzy, c-format -#| msgid "invalid numeric value '%s'" msgid "invalid number of header lines %s" msgstr "ugyldig numerisk værdi »%s«" -#: src/decorate.c:907 +#: src/decorate.c:948 msgid "empty tab" msgstr "" -#: src/decorate.c:918 +#: src/decorate.c:959 #, c-format msgid "multi-character tab %s" msgstr "" -#: src/decorate.c:923 +#: src/decorate.c:964 msgid "incompatible tabs" msgstr "" -#: src/decorate.c:945 +#: src/decorate.c:986 #, fuzzy, c-format -#| msgid "invalid field '%s' for operation %s" msgid "invalid number of fields to undecorate %s" msgstr "ugyldig felt »%s« for operation %s" -#: src/decorate.c:968 +#: src/decorate.c:1009 msgid "--decorate and --undecorate options are mutually exclusive" msgstr "" -#: src/decorate.c:972 +#: src/decorate.c:1013 msgid "--undecorate cannot be used with --keys or --decorate" msgstr "" -#: src/decorate.c:976 +#: src/decorate.c:1017 msgid "missing -k/--key decoration or --undecorate options" msgstr "" -#: src/decorate.c:985 +#: src/decorate.c:1026 msgid "no decorated keys specified. use sort instead" msgstr "" -#: src/decorate.c:1024 +#: src/decorate.c:1060 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to create dec-sort pipe" msgstr "kunne ikke køre »sort«: popen mislykkedes" -#: src/decorate.c:1026 +#: src/decorate.c:1062 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to create sort-undec pipe" msgstr "kunne ikke køre »sort«: popen mislykkedes" -#: src/decorate.c:1033 +#: src/decorate.c:1069 msgid "failed to fork-1" msgstr "" -#: src/decorate.c:1040 +#: src/decorate.c:1076 msgid "failed to fork-2" msgstr "" -#: src/decorate.c:1052 src/decorate.c:1101 +#: src/decorate.c:1088 src/decorate.c:1137 msgid "failed to close sort-undec read-pipe" msgstr "" -#: src/decorate.c:1055 src/decorate.c:1140 +#: src/decorate.c:1091 src/decorate.c:1176 msgid "failed to close sort-undec write-pipe" msgstr "" -#: src/decorate.c:1057 src/decorate.c:1135 +#: src/decorate.c:1093 src/decorate.c:1171 msgid "failed to close dec-sort read-pipe" msgstr "" -#: src/decorate.c:1066 +#: src/decorate.c:1102 msgid "failed to dup STDOUT fd" msgstr "" -#: src/decorate.c:1069 +#: src/decorate.c:1105 msgid "fdopen (dup (stdout)) failed" msgstr "" -#: src/decorate.c:1074 +#: src/decorate.c:1110 msgid "failed to reassign dec-sort STDOUT" msgstr "" -#: src/decorate.c:1098 src/decorate.c:1137 +#: src/decorate.c:1134 src/decorate.c:1173 msgid "failed to close dec-sort write-pipe" msgstr "" -#: src/decorate.c:1106 +#: src/decorate.c:1142 msgid "failed to reassign dec-sort STDIN" msgstr "" -#: src/decorate.c:1112 +#: src/decorate.c:1148 msgid "failed to reassign sort-undec STDOUT" msgstr "" -#: src/decorate.c:1126 +#: src/decorate.c:1162 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to run the sort command" msgstr "kunne ikke køre »sort«: popen mislykkedes" -#: src/decorate.c:1144 +#: src/decorate.c:1180 msgid "failed to reassign sort-undec STDIN" msgstr "" -#: src/double-format.c:49 +#: src/double-format.c:45 +msgid "numeric format too large" +msgstr "" + +#: src/double-format.c:54 #, c-format msgid "format %s has no %% directive" msgstr "" -#: src/double-format.c:62 +#: src/double-format.c:67 #, c-format msgid "format %s missing valid type after '%%'" msgstr "" -#: src/double-format.c:66 +#: src/double-format.c:71 #, c-format msgid "format %s has unknown/invalid type %%%c directive" msgstr "" -#: src/double-format.c:79 +#: src/double-format.c:84 #, c-format msgid "format %s has too many %% directives" msgstr "" -#: src/field-ops.c:346 +#: src/field-ops.c:351 #, c-format msgid "" "input error for operation %s: fields %,% have different " @@ -985,17 +1004,16 @@ "inddatafejl for operation %s: felterne %,% har forskelligt " "antal elementer" -#: src/field-ops.c:1176 +#: src/field-ops.c:1199 msgid "invalid numeric value" msgstr "ugyldig numerisk værdi" -#: src/field-ops.c:1178 +#: src/field-ops.c:1201 msgid "invalid base64 value" msgstr "ugyldig base64-værdi" #: src/key-compare.c:305 #, fuzzy, c-format -#| msgid "invalid field pair for operation %s" msgid "%s: invalid field specification %s" msgstr "ugyldigt feltpar for operation %s" @@ -1026,7 +1044,6 @@ #: src/op-parser.c:243 #, fuzzy, c-format -#| msgid "invalid numeric value '%s'" msgid "invalid getnum type '%c'" msgstr "ugyldig numerisk værdi »%s«" @@ -1081,7 +1098,7 @@ msgid "conflicting operation %s" msgstr "modstridende operation %s" -#: src/op-parser.c:499 src/op-parser.c:752 +#: src/op-parser.c:499 src/op-parser.c:758 #, c-format msgid "invalid operation %s" msgstr "ugyldig operation %s" @@ -1123,21 +1140,21 @@ msgid "crosstab requires exactly 2 fields, found %" msgstr "crosstab kræver præcis 2 felter, fandt %" -#: src/op-parser.c:705 +#: src/op-parser.c:711 #, c-format msgid "crosstab supports one operation, found %" msgstr "crosstab understøtter netop en operation, fandt %" -#: src/op-parser.c:714 +#: src/op-parser.c:720 msgid "missing operation" msgstr "manglende operation" -#: src/op-parser.c:728 +#: src/op-parser.c:734 #, c-format msgid "extra operand %s" msgstr "ekstra operand %s" -#: src/op-parser.c:865 src/op-scanner.c:237 +#: src/op-parser.c:874 src/op-scanner.c:237 msgid "missing script (among arguments)" msgstr "manglende skript (blandt argumenter)" @@ -1177,17 +1194,29 @@ msgid "Try '%s --help' for more information.\n" msgstr "Prøv »%s --help« for yderligere information.\n" -#: src/text-options.c:111 +#: src/text-options.c:109 msgid "missing rounding digits value" msgstr "" -#: src/text-options.c:116 +#: src/text-options.c:114 #, fuzzy, c-format -#| msgid "invalid numeric value '%s'" msgid "invalid rounding digits value %s" msgstr "ugyldig numerisk værdi »%s«" -#, fuzzy -#~| msgid "%s home page: \n" -#~ msgid "%s home page: \n" +#~ msgid "Assaf Gordon" +#~ msgstr "Assaf Gordon" + +#~ msgid "" +#~ " -f, --full print entire input line before op results\n" +#~ " (default: print only the grouped keys)\n" +#~ msgstr "" +#~ " -f, --full udskriv hel inddatalinje før op-resultater\n" +#~ " (standard: udskriv kun grupperede nøgler)\n" + +#, c-format +#~ msgid "%s home page: \n" #~ msgstr "%s hjemmeside: \n" + +#~ msgid "sort command too-long (please report this bug)" +#~ msgstr "" +#~ "sorteringskommandoen er for lang (rapporter venligst dette som en fejl)" diff -Nru datamash-1.7/po/datamash.pot datamash-1.8/po/datamash.pot --- datamash-1.7/po/datamash.pot 2020-04-23 17:34:23.000000000 +0000 +++ datamash-1.8/po/datamash.pot 2022-07-23 01:57:18.000000000 +0000 @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: GNU datamash 1.7\n" +"Project-Id-Version: GNU datamash 1.8-dirty\n" "Report-Msgid-Bugs-To: bug-datamash@gnu.org\n" -"POT-Creation-Date: 2020-04-23 11:34-0600\n" +"POT-Creation-Date: 2022-07-23 11:57+1000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -82,11 +82,11 @@ #. If you don't know what to put here, please see #. #. and use glyphs suitable for your language. -#: lib/quotearg.c:362 +#: lib/quotearg.c:355 msgid "`" msgstr "" -#: lib/quotearg.c:363 +#: lib/quotearg.c:356 msgid "'" msgstr "" @@ -251,108 +251,116 @@ msgstr "" #. This is a proper name. See the gettext manual, section Names. -#: src/datamash.c:65 src/decorate.c:41 -msgid "Assaf Gordon" +#: src/datamash.c:66 +msgid "Assaf Gordon, Tim Rice, Shawn Wagner, Erik Auerswald" msgstr "" -#: src/datamash.c:161 src/datamash.c:504 +#: src/datamash.c:169 src/datamash.c:539 #, c-format msgid "column name %s not found in input file" msgstr "" -#: src/datamash.c:174 +#: src/datamash.c:182 #, c-format msgid "Usage: %s [OPTION] op [fld] [op fld ...]\n" msgstr "" -#: src/datamash.c:177 +#: src/datamash.c:185 msgid "Performs numeric/string operations on input from stdin." msgstr "" -#: src/datamash.c:180 +#: src/datamash.c:188 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:183 +#: src/datamash.c:191 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 "" -#: src/datamash.c:186 +#: src/datamash.c:194 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:191 +#: src/datamash.c:199 msgid "Primary operations:\n" msgstr "" -#: src/datamash.c:194 +#: src/datamash.c:202 msgid "Line-Filtering operations:\n" msgstr "" -#: src/datamash.c:197 +#: src/datamash.c:205 msgid "Per-Line operations:\n" msgstr "" -#: src/datamash.c:203 +#: src/datamash.c:211 msgid "Numeric Grouping operations:\n" msgstr "" -#: src/datamash.c:206 +#: src/datamash.c:214 msgid "Textual/Numeric Grouping operations:\n" msgstr "" -#: src/datamash.c:210 +#: src/datamash.c:218 msgid "Statistical Grouping operations:\n" msgstr "" -#: src/datamash.c:219 +#: src/datamash.c:227 src/decorate.c:179 +msgid "Options:\n" +msgstr "" + +#: src/datamash.c:229 msgid "Grouping Options:\n" msgstr "" -#: src/datamash.c:220 +#: src/datamash.c:230 msgid "" " -C, --skip-comments skip comment lines (starting with '#' or ';'\n" " and optional whitespace)\n" msgstr "" -#: src/datamash.c:224 +#: src/datamash.c:234 msgid "" " -f, --full print entire input line before op results\n" " (default: print only the grouped keys)\n" +" This option is only sensible for linewise\n" +" operations. Other uses are deprecated and\n" +" will be removed in a future version of GNU\n" +" Datamash.\n" msgstr "" -#: src/datamash.c:228 +#: src/datamash.c:242 msgid "" " -g, --group=X[,Y,Z] group via fields X,[Y,Z];\n" " equivalent to primary operation 'groupby'\n" msgstr "" -#: src/datamash.c:232 +#: src/datamash.c:246 msgid " --header-in first input line is column headers\n" msgstr "" -#: src/datamash.c:235 +#: src/datamash.c:249 msgid " --header-out print column headers as first line\n" msgstr "" -#: src/datamash.c:238 +#: src/datamash.c:252 msgid " -H, --headers same as '--header-in --header-out'\n" msgstr "" -#: src/datamash.c:241 +#: src/datamash.c:255 msgid "" " -i, --ignore-case ignore upper/lower case when comparing text;\n" " this affects grouping, and string operations\n" msgstr "" -#: src/datamash.c:245 +#: src/datamash.c:259 msgid "" " -s, --sort sort the input before grouping; this removes " "the\n" @@ -360,90 +368,114 @@ "'sort'\n" msgstr "" -#: src/datamash.c:250 +#: src/datamash.c:263 +msgid "" +" -c, --collapse-delimiter=X use X to separate elements in collapse and\n" +" unique lists (default: comma)\n" +msgstr "" + +#: src/datamash.c:268 msgid "File Operation Options:\n" msgstr "" -#: src/datamash.c:251 +#: src/datamash.c:269 msgid " --no-strict allow lines with varying number of fields\n" msgstr "" -#: src/datamash.c:254 +#: src/datamash.c:272 #, c-format msgid " --filler=X fill missing values with X (default %s)\n" msgstr "" -#: src/datamash.c:259 src/decorate.c:174 +#: src/datamash.c:277 src/decorate.c:185 msgid "General Options:\n" msgstr "" -#: src/datamash.c:260 +#: src/datamash.c:278 msgid " -t, --field-separator=X use X instead of TAB as field delimiter\n" msgstr "" -#: src/datamash.c:263 +#: src/datamash.c:281 msgid "" " --format=FORMAT print numeric values with printf style\n" " floating-point FORMAT.\n" msgstr "" -#: src/datamash.c:267 +#: src/datamash.c:285 msgid "" " --output-delimiter=X use X instead as output field delimiter\n" " (default: use same delimiter as -t/-W)\n" msgstr "" -#: src/datamash.c:271 +#: src/datamash.c:289 msgid " --narm skip NA/NaN values\n" msgstr "" -#: src/datamash.c:274 +#: src/datamash.c:292 msgid " -R, --round=N round numeric output to N decimal places\n" msgstr "" -#: src/datamash.c:277 +#: src/datamash.c:295 msgid "" " -W, --whitespace use whitespace (one or more spaces and/or tabs)\n" " for field delimiters\n" msgstr "" -#: src/datamash.c:281 +#: src/datamash.c:299 msgid " -z, --zero-terminated end lines with 0 byte, not newline\n" msgstr "" -#: src/datamash.c:290 +#: src/datamash.c:302 src/decorate.c:219 +msgid " --sort-cmd=/path/to/sort Alternative sort(1) to use.\n" +msgstr "" + +#: src/datamash.c:311 +msgid "Environment:" +msgstr "" + +#: src/datamash.c:313 +msgid " LC_NUMERIC decimal-point character and thousands separator\n" +msgstr "" + +#: src/datamash.c:319 msgid "Examples:" msgstr "" -#: src/datamash.c:292 +#: src/datamash.c:321 msgid "Print the sum and the mean of values from column 1:" msgstr "" -#: src/datamash.c:297 +#: src/datamash.c:326 msgid "Transpose input:" msgstr "" -#: src/datamash.c:304 src/decorate.c:287 +#: src/datamash.c:333 src/decorate.c:302 msgid "For detailed usage information and examples, see\n" msgstr "" -#: src/datamash.c:306 src/decorate.c:289 +#: src/datamash.c:335 src/decorate.c:304 msgid "The manual and more examples are available at\n" msgstr "" -#: src/datamash.c:315 +#: src/datamash.c:344 #, c-format msgid "" "invalid input: field % requested, line % has only " "% fields" msgstr "" -#: src/datamash.c:385 +#: src/datamash.c:414 #, c-format msgid "%s in line % field %: '%s'" msgstr "" -#: src/datamash.c:713 +#: src/datamash.c:656 +msgid "" +"datamash: Using -f/--full with non-linewise operations is deprecated and " +"will be disabled in a future release.\n" +msgstr "" + +#: src/datamash.c:752 #, c-format msgid "" "transpose input error: line % has % fields (previous lines " @@ -451,7 +483,7 @@ "see --help to disable strict mode" msgstr "" -#: src/datamash.c:770 +#: src/datamash.c:809 #, c-format msgid "" "reverse-field input error: line % has % fields (previous " @@ -459,75 +491,75 @@ "see --help to disable strict mode" msgstr "" -#: src/datamash.c:879 src/datamash.c:896 src/datamash.c:902 +#: src/datamash.c:918 src/datamash.c:935 src/datamash.c:941 #, c-format msgid "" "line % (% fields):\n" " " msgstr "" -#: src/datamash.c:885 +#: src/datamash.c:924 #, c-format msgid "" "check failed: line % has % fields (expecting %)" msgstr "" -#: src/datamash.c:908 +#: src/datamash.c:947 #, c-format msgid "" "check failed: line % has % fields (previous line had " "%)" msgstr "" -#: src/datamash.c:922 +#: src/datamash.c:961 #, c-format msgid "check failed: input had % lines (expecting %)" msgstr "" -#: src/datamash.c:928 +#: src/datamash.c:967 #, c-format msgid "% line" msgid_plural "% lines" msgstr[0] "" msgstr[1] "" -#: src/datamash.c:931 +#: src/datamash.c:970 #, c-format msgid "% field" msgid_plural "% fields" msgstr[0] "" msgstr[1] "" -#: src/datamash.c:1032 +#: src/datamash.c:1080 msgid "hash memory allocation error" msgstr "" -#: src/datamash.c:1099 -msgid "sort command too-long (please report this bug)" +#: src/datamash.c:1147 +msgid "-s and -z cannot be combined on this system" msgstr "" -#: src/datamash.c:1105 +#: src/datamash.c:1181 msgid "failed to run 'sort': popen failed" msgstr "" -#: src/datamash.c:1121 +#: src/datamash.c:1197 msgid "read error" msgstr "" -#: src/datamash.c:1129 +#: src/datamash.c:1205 msgid "read error (on close)" msgstr "" -#: src/datamash.c:1222 src/datamash.c:1229 +#: src/datamash.c:1300 src/datamash.c:1307 src/datamash.c:1323 msgid "the delimiter must be a single character" msgstr "" -#: src/datamash.c:1265 +#: src/datamash.c:1354 #, c-format msgid "missing operation specifiers" msgstr "" -#: src/datamash.c:1283 +#: src/datamash.c:1372 msgid "-H or --header-in must be used with named columns" msgstr "" @@ -564,7 +596,21 @@ msgid "invalid IPv6 address %s" msgstr "" -#: src/decorate.c:140 +#: src/decorate-functions.c:192 +msgid "inet_pton failed for AF_INET and AF_INET6" +msgstr "" + +#: src/decorate-functions.c:196 +#, c-format +msgid "invalid IP address %s" +msgstr "" + +#. This is a proper name. See the gettext manual, section Names. +#: src/decorate.c:42 +msgid "Assaf Gordon, Shawn Wagner and Erik Auerswald" +msgstr "" + +#: src/decorate.c:145 #, c-format msgid "" "Usage: %s [OPTION]... [INPUT]\n" @@ -573,29 +619,29 @@ "\n" msgstr "" -#: src/decorate.c:147 +#: src/decorate.c:152 msgid "Converts (and optionally sorts) fields of various formats\n" msgstr "" -#: src/decorate.c:153 +#: src/decorate.c:158 msgid "" "With --decorate: adds the converted fields to the start\n" "of each line and prints and prints it to STDOUT; does not sort.\n" msgstr "" -#: src/decorate.c:160 +#: src/decorate.c:165 msgid "" "With --undecorate: removes the first N fields from the input;\n" "Use as post-processing step after sort(1).\n" msgstr "" -#: src/decorate.c:167 +#: src/decorate.c:172 msgid "" "Without --decorate and --undecorate: automatically decorates the input,\n" "runs sort(1) and undecorates the result; This is the easiest method to use.\n" msgstr "" -#: src/decorate.c:179 +#: src/decorate.c:190 msgid "" " --decorate decorate/convert the specified fields and " "print\n" @@ -604,13 +650,13 @@ " sort(1) or undecorates the output\n" msgstr "" -#: src/decorate.c:184 +#: src/decorate.c:195 msgid "" " --header=N does not decorate or sort the first N lines\n" " -H same as --header=N\n" msgstr "" -#: src/decorate.c:188 +#: src/decorate.c:199 msgid "" " -k, --key=KEYDEF key/field to sort; same syntax as sort(1),\n" " optionally followed by ':method' to convert\n" @@ -619,13 +665,13 @@ " and available conversion below\n" msgstr "" -#: src/decorate.c:194 +#: src/decorate.c:205 msgid "" " -t, --field-separator=SEP use SEP instead of non-blank to blank " "transition\n" msgstr "" -#: src/decorate.c:197 +#: src/decorate.c:208 msgid "" " --print-sort-args print adjusted parameters for sort(1); Useful\n" " when using --decorate and then manually " @@ -633,19 +679,21 @@ " sort(1)\n" msgstr "" -#: src/decorate.c:202 +#: src/decorate.c:213 msgid " --undecorate=N removes the first N fields\n" msgstr "" -#: src/decorate.c:205 +#: src/decorate.c:216 msgid " -z, --zero-terminated line delimiter is NUL, not newline\n" msgstr "" -#: src/decorate.c:213 -msgid "The following options are passed to sort(1) as-is:\n" +#: src/decorate.c:227 +msgid "" +"The following options are passed to sort as-is (Most of them assume GNU " +"sort):\n" msgstr "" -#: src/decorate.c:219 +#: src/decorate.c:234 msgid "" " -c, --check\n" " --compress-program\n" @@ -658,217 +706,221 @@ " --parallel\n" msgstr "" -#: src/decorate.c:234 +#: src/decorate.c:249 msgid "Available conversions methods (use with -k):\n" msgstr "" -#: src/decorate.c:246 +#: src/decorate.c:261 msgid "Examples:\n" msgstr "" -#: src/decorate.c:252 +#: src/decorate.c:267 msgid "The following two invocations are equivalent:\n" msgstr "" -#: src/decorate.c:267 +#: src/decorate.c:282 msgid "Decorated output of roman numerals:\n" msgstr "" -#: src/decorate.c:431 +#: src/decorate.c:446 msgid "fwrite (header line) failed" msgstr "" -#: src/decorate.c:439 +#: src/decorate.c:454 msgid "fflush (header line) failed" msgstr "" -#: src/decorate.c:445 +#: src/decorate.c:460 #, c-format -msgid "conversion failed in line %zu" +msgid "conversion failed in line %" msgstr "" -#: src/decorate.c:451 +#: src/decorate.c:467 msgid "decorate: fwrite failed" msgstr "" -#: src/decorate.c:457 src/decorate.c:519 +#: src/decorate.c:473 src/decorate.c:535 #, c-format msgid "error reading %s" msgstr "" -#: src/decorate.c:538 +#: src/decorate.c:554 msgid "invalid number at field start" msgstr "" -#: src/decorate.c:543 src/decorate.c:571 +#: src/decorate.c:559 src/decorate.c:587 msgid "field number is zero" msgstr "" -#: src/decorate.c:548 src/decorate.c:576 +#: src/decorate.c:564 src/decorate.c:592 msgid "invalid number after '.'" msgstr "" -#: src/decorate.c:552 +#: src/decorate.c:568 msgid "character offset is zero" msgstr "" -#: src/decorate.c:567 +#: src/decorate.c:583 msgid "invalid number after ','" msgstr "" -#: src/decorate.c:603 +#: src/decorate.c:619 msgid "missing external conversion command" msgstr "" -#: src/decorate.c:618 +#: src/decorate.c:634 msgid "missing internal conversion function" msgstr "" -#: src/decorate.c:630 +#: src/decorate.c:646 msgid "invalid built-in conversion option" msgstr "" -#: src/decorate.c:641 +#: src/decorate.c:657 msgid "" "ordering flags (b/d/i/h/n/g/M/R/V) cannot be combined with a conversion " "function" msgstr "" -#: src/decorate.c:671 +#: src/decorate.c:687 msgid "invalid key specification" msgstr "" -#: src/decorate.c:853 +#: src/decorate.c:890 #, c-format msgid "invalid number of header lines %s" msgstr "" -#: src/decorate.c:907 +#: src/decorate.c:948 msgid "empty tab" msgstr "" -#: src/decorate.c:918 +#: src/decorate.c:959 #, c-format msgid "multi-character tab %s" msgstr "" -#: src/decorate.c:923 +#: src/decorate.c:964 msgid "incompatible tabs" msgstr "" -#: src/decorate.c:945 +#: src/decorate.c:986 #, c-format msgid "invalid number of fields to undecorate %s" msgstr "" -#: src/decorate.c:968 +#: src/decorate.c:1009 msgid "--decorate and --undecorate options are mutually exclusive" msgstr "" -#: src/decorate.c:972 +#: src/decorate.c:1013 msgid "--undecorate cannot be used with --keys or --decorate" msgstr "" -#: src/decorate.c:976 +#: src/decorate.c:1017 msgid "missing -k/--key decoration or --undecorate options" msgstr "" -#: src/decorate.c:985 +#: src/decorate.c:1026 msgid "no decorated keys specified. use sort instead" msgstr "" -#: src/decorate.c:1024 +#: src/decorate.c:1060 msgid "failed to create dec-sort pipe" msgstr "" -#: src/decorate.c:1026 +#: src/decorate.c:1062 msgid "failed to create sort-undec pipe" msgstr "" -#: src/decorate.c:1033 +#: src/decorate.c:1069 msgid "failed to fork-1" msgstr "" -#: src/decorate.c:1040 +#: src/decorate.c:1076 msgid "failed to fork-2" msgstr "" -#: src/decorate.c:1052 src/decorate.c:1101 +#: src/decorate.c:1088 src/decorate.c:1137 msgid "failed to close sort-undec read-pipe" msgstr "" -#: src/decorate.c:1055 src/decorate.c:1140 +#: src/decorate.c:1091 src/decorate.c:1176 msgid "failed to close sort-undec write-pipe" msgstr "" -#: src/decorate.c:1057 src/decorate.c:1135 +#: src/decorate.c:1093 src/decorate.c:1171 msgid "failed to close dec-sort read-pipe" msgstr "" -#: src/decorate.c:1066 +#: src/decorate.c:1102 msgid "failed to dup STDOUT fd" msgstr "" -#: src/decorate.c:1069 +#: src/decorate.c:1105 msgid "fdopen (dup (stdout)) failed" msgstr "" -#: src/decorate.c:1074 +#: src/decorate.c:1110 msgid "failed to reassign dec-sort STDOUT" msgstr "" -#: src/decorate.c:1098 src/decorate.c:1137 +#: src/decorate.c:1134 src/decorate.c:1173 msgid "failed to close dec-sort write-pipe" msgstr "" -#: src/decorate.c:1106 +#: src/decorate.c:1142 msgid "failed to reassign dec-sort STDIN" msgstr "" -#: src/decorate.c:1112 +#: src/decorate.c:1148 msgid "failed to reassign sort-undec STDOUT" msgstr "" -#: src/decorate.c:1126 +#: src/decorate.c:1162 msgid "failed to run the sort command" msgstr "" -#: src/decorate.c:1144 +#: src/decorate.c:1180 msgid "failed to reassign sort-undec STDIN" msgstr "" -#: src/double-format.c:49 +#: src/double-format.c:45 +msgid "numeric format too large" +msgstr "" + +#: src/double-format.c:54 #, c-format msgid "format %s has no %% directive" msgstr "" -#: src/double-format.c:62 +#: src/double-format.c:67 #, c-format msgid "format %s missing valid type after '%%'" msgstr "" -#: src/double-format.c:66 +#: src/double-format.c:71 #, c-format msgid "format %s has unknown/invalid type %%%c directive" msgstr "" -#: src/double-format.c:79 +#: src/double-format.c:84 #, c-format msgid "format %s has too many %% directives" msgstr "" -#: src/field-ops.c:346 +#: src/field-ops.c:351 #, c-format msgid "" "input error for operation %s: fields %,% have different " "number of items" msgstr "" -#: src/field-ops.c:1176 +#: src/field-ops.c:1199 msgid "invalid numeric value" msgstr "" -#: src/field-ops.c:1178 +#: src/field-ops.c:1201 msgid "invalid base64 value" msgstr "" @@ -958,7 +1010,7 @@ msgid "conflicting operation %s" msgstr "" -#: src/op-parser.c:499 src/op-parser.c:752 +#: src/op-parser.c:499 src/op-parser.c:758 #, c-format msgid "invalid operation %s" msgstr "" @@ -996,21 +1048,21 @@ msgid "crosstab requires exactly 2 fields, found %" msgstr "" -#: src/op-parser.c:705 +#: src/op-parser.c:711 #, c-format msgid "crosstab supports one operation, found %" msgstr "" -#: src/op-parser.c:714 +#: src/op-parser.c:720 msgid "missing operation" msgstr "" -#: src/op-parser.c:728 +#: src/op-parser.c:734 #, c-format msgid "extra operand %s" msgstr "" -#: src/op-parser.c:865 src/op-scanner.c:237 +#: src/op-parser.c:874 src/op-scanner.c:237 msgid "missing script (among arguments)" msgstr "" @@ -1050,11 +1102,11 @@ msgid "Try '%s --help' for more information.\n" msgstr "" -#: src/text-options.c:111 +#: src/text-options.c:109 msgid "missing rounding digits value" msgstr "" -#: src/text-options.c:116 +#: src/text-options.c:114 #, c-format msgid "invalid rounding digits value %s" msgstr "" Binary files /tmp/tmpk9ju3y2l/uqkwDqQpWf/datamash-1.7/po/de.gmo and /tmp/tmpk9ju3y2l/ut88G7BZjZ/datamash-1.8/po/de.gmo differ diff -Nru datamash-1.7/po/de.po datamash-1.8/po/de.po --- datamash-1.7/po/de.po 2020-04-23 17:34:24.000000000 +0000 +++ datamash-1.8/po/de.po 2022-07-23 01:57:18.000000000 +0000 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: GNU datamash 1.4.12.1\n" "Report-Msgid-Bugs-To: bug-datamash@gnu.org\n" -"POT-Creation-Date: 2020-04-23 11:34-0600\n" +"POT-Creation-Date: 2022-07-23 11:57+1000\n" "PO-Revision-Date: 2019-09-01 15:49+0200\n" "Last-Translator: Mario Blättermann \n" "Language-Team: German \n" @@ -84,11 +84,11 @@ #. If you don't know what to put here, please see #. #. and use glyphs suitable for your language. -#: lib/quotearg.c:362 +#: lib/quotearg.c:355 msgid "`" msgstr "»" -#: lib/quotearg.c:363 +#: lib/quotearg.c:356 msgid "'" msgstr "«" @@ -272,27 +272,27 @@ msgstr "%s%s Argument »%s« zu groß" #. This is a proper name. See the gettext manual, section Names. -#: src/datamash.c:65 src/decorate.c:41 -msgid "Assaf Gordon" -msgstr "Assaf Gordon" +#: src/datamash.c:66 +msgid "Assaf Gordon, Tim Rice, Shawn Wagner, Erik Auerswald" +msgstr "" -#: src/datamash.c:161 src/datamash.c:504 +#: src/datamash.c:169 src/datamash.c:539 #, 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:182 #, c-format 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:185 msgid "Performs numeric/string operations on input from stdin." msgstr "" "Führt numerische bzw. Stringoperationen für Eingaben aus der Standardeingabe " "aus." -#: src/datamash.c:180 +#: src/datamash.c:188 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" @@ -302,7 +302,7 @@ "diese zuerst angegeben werden, gefolgt von anderen (optionalen) " "Operationen.\n" -#: src/datamash.c:183 +#: src/datamash.c:191 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" @@ -311,7 +311,7 @@ "(1=erstes Feld), oder ein Feldname, wenn die Optionen -H oder --header-in\n" "verwendet werden.\n" -#: src/datamash.c:186 +#: src/datamash.c:194 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" @@ -321,35 +321,40 @@ "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:191 +#: src/datamash.c:199 msgid "Primary operations:\n" msgstr "Primäre Operationen:\n" -#: src/datamash.c:194 +#: src/datamash.c:202 msgid "Line-Filtering operations:\n" msgstr "Operationen zur Zeilenfilterung:\n" -#: src/datamash.c:197 +#: src/datamash.c:205 msgid "Per-Line operations:\n" msgstr "Zeilenweise Operationen:\n" -#: src/datamash.c:203 +#: src/datamash.c:211 msgid "Numeric Grouping operations:\n" msgstr "Optionen zur numerischen Gruppierung:\n" -#: src/datamash.c:206 +#: src/datamash.c:214 msgid "Textual/Numeric Grouping operations:\n" msgstr "Optionen zur textuellen/numerischen Gruppierung:\n" -#: src/datamash.c:210 +#: src/datamash.c:218 msgid "Statistical Grouping operations:\n" msgstr "Optionen zur statistischen Gruppierung:\n" -#: src/datamash.c:219 +#: src/datamash.c:227 src/decorate.c:179 +#, fuzzy +msgid "Options:\n" +msgstr "Allgemeine Optionen:\n" + +#: src/datamash.c:229 msgid "Grouping Options:\n" msgstr "Gruppierungsoptionen:\n" -#: src/datamash.c:220 +#: src/datamash.c:230 msgid "" " -C, --skip-comments skip comment lines (starting with '#' or ';'\n" " and optional whitespace)\n" @@ -357,17 +362,17 @@ " -C, --skip-comments überspringt Kommentarzeilen (beginnend mit »#«\n" " oder »;« und optionalem Leerraum)\n" -#: src/datamash.c:224 +#: src/datamash.c:234 msgid "" " -f, --full print entire input line before op results\n" " (default: print only the grouped keys)\n" +" This option is only sensible for linewise\n" +" operations. Other uses are deprecated and\n" +" will be removed in a future version of GNU\n" +" Datamash.\n" msgstr "" -" -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:228 +#: src/datamash.c:242 msgid "" " -g, --group=X[,Y,Z] group via fields X,[Y,Z];\n" " equivalent to primary operation 'groupby'\n" @@ -376,21 +381,21 @@ " gleichbedeutend mit der primären Operation " "»groupby«\n" -#: src/datamash.c:232 +#: src/datamash.c:246 msgid " --header-in first input line is column headers\n" msgstr "" " --header-in erste Eingabezeile ist die Spaltenüberschrift\n" -#: src/datamash.c:235 +#: src/datamash.c:249 msgid " --header-out print column headers as first line\n" msgstr "" " --header-out gibt Spaltenüberschriften als erste Zeile aus\n" -#: src/datamash.c:238 +#: src/datamash.c:252 msgid " -H, --headers same as '--header-in --header-out'\n" msgstr " -H, --headers gleich wie »--header-in --header-out«\n" -#: src/datamash.c:241 +#: src/datamash.c:255 msgid "" " -i, --ignore-case ignore upper/lower case when comparing text;\n" " this affects grouping, and string operations\n" @@ -401,7 +406,7 @@ "Stringoperationen\n" " wirksam\n" -#: src/datamash.c:245 +#: src/datamash.c:259 msgid "" " -s, --sort sort the input before grouping; this removes " "the\n" @@ -414,33 +419,42 @@ "»sort«\n" " nicht mehr nötig\n" -#: src/datamash.c:250 +#: src/datamash.c:263 +#, fuzzy +msgid "" +" -c, --collapse-delimiter=X use X to separate elements in collapse and\n" +" unique lists (default: comma)\n" +msgstr "" +" --output-delimiter=X verwendet X als Trenner für Ausgabefelder\n" +" (Vorgabe: gleicher Trenner wie -t/-W)\n" + +#: src/datamash.c:268 msgid "File Operation Options:\n" msgstr "Optionen für Dateioperationen:\n" -#: src/datamash.c:251 +#: src/datamash.c:269 msgid " --no-strict allow lines with varying number of fields\n" msgstr "" " --no-strict erlaubt Zeilen mit unterschiedlicher Feldanzahl\n" -#: src/datamash.c:254 +#: src/datamash.c:272 #, 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:259 src/decorate.c:174 +#: src/datamash.c:277 src/decorate.c:185 msgid "General Options:\n" msgstr "Allgemeine Optionen:\n" -#: src/datamash.c:260 +#: src/datamash.c:278 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:263 +#: src/datamash.c:281 msgid "" " --format=FORMAT print numeric values with printf style\n" " floating-point FORMAT.\n" @@ -448,7 +462,7 @@ " --format=FORMAT gibt numerische Werte im Printf-artigen\n" " Fließkomma-FORMAT aus.\n" -#: src/datamash.c:267 +#: src/datamash.c:285 msgid "" " --output-delimiter=X use X instead as output field delimiter\n" " (default: use same delimiter as -t/-W)\n" @@ -456,17 +470,17 @@ " --output-delimiter=X verwendet X als Trenner für Ausgabefelder\n" " (Vorgabe: gleicher Trenner wie -t/-W)\n" -#: src/datamash.c:271 +#: src/datamash.c:289 msgid " --narm skip NA/NaN values\n" msgstr " --narm NA/NaN-Werte überspringen\n" -#: src/datamash.c:274 +#: src/datamash.c:292 msgid " -R, --round=N round numeric output to N decimal places\n" msgstr "" " -R, --round=N rundet die numerische Ausgabe\n" " auf N Dezimalstellen\n" -#: src/datamash.c:277 +#: src/datamash.c:295 msgid "" " -W, --whitespace use whitespace (one or more spaces and/or tabs)\n" " for field delimiters\n" @@ -475,35 +489,47 @@ "Leerzeichen\n" " und/oder Tabulatoren) für Feldtrenner\n" -#: src/datamash.c:281 +#: src/datamash.c:299 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:290 +#: src/datamash.c:302 src/decorate.c:219 +msgid " --sort-cmd=/path/to/sort Alternative sort(1) to use.\n" +msgstr "" + +#: src/datamash.c:311 +msgid "Environment:" +msgstr "" + +#: src/datamash.c:313 +msgid " LC_NUMERIC decimal-point character and thousands separator\n" +msgstr "" + +#: src/datamash.c:319 msgid "Examples:" msgstr "Beispiele:" -#: src/datamash.c:292 +#: src/datamash.c:321 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:297 +#: src/datamash.c:326 msgid "Transpose input:" msgstr "Transponierte Eingabe:" -#: src/datamash.c:304 src/decorate.c:287 +#: src/datamash.c:333 src/decorate.c:302 msgid "For detailed usage information and examples, see\n" msgstr "" "Detaillierte Informationen zur Verwendung und Beispiele\n" "finden Sie unter\n" -#: src/datamash.c:306 src/decorate.c:289 +#: src/datamash.c:335 src/decorate.c:304 msgid "The manual and more examples are available at\n" msgstr "Das Handbuch und weitere Beispiele sind verfügbar auf\n" -#: src/datamash.c:315 +#: src/datamash.c:344 #, c-format msgid "" "invalid input: field % requested, line % has only " @@ -512,12 +538,18 @@ "Ungültige Eingabe: Feld % angefragt, Zeile % hat aber nur " "% Felder" -#: src/datamash.c:385 +#: src/datamash.c:414 #, c-format msgid "%s in line % field %: '%s'" msgstr "%s in Zeile %, Feld %: »%s«" -#: src/datamash.c:713 +#: src/datamash.c:656 +msgid "" +"datamash: Using -f/--full with non-linewise operations is deprecated and " +"will be disabled in a future release.\n" +msgstr "" + +#: src/datamash.c:752 #, c-format msgid "" "transpose input error: line % has % fields (previous lines " @@ -528,7 +560,7 @@ "(vorherige Zeilen hatten % Felder);\n" "siehe --help für den strikten Modus" -#: src/datamash.c:770 +#: src/datamash.c:809 #, c-format msgid "" "reverse-field input error: line % has % fields (previous " @@ -540,7 +572,7 @@ "Zeilen hatten %) Felder);\n" "siehe --help für den strikten Modus" -#: src/datamash.c:879 src/datamash.c:896 src/datamash.c:902 +#: src/datamash.c:918 src/datamash.c:935 src/datamash.c:941 #, c-format msgid "" "line % (% fields):\n" @@ -549,7 +581,7 @@ "Zeile % (% Felder):\n" " " -#: src/datamash.c:885 +#: src/datamash.c:924 #, c-format msgid "" "check failed: line % has % fields (expecting %)" @@ -557,7 +589,7 @@ "Überprüfung fehlgeschlagen: Zeile % hat % Felder " "(% wurde erwartet)" -#: src/datamash.c:908 +#: src/datamash.c:947 #, c-format msgid "" "check failed: line % has % fields (previous line had " @@ -566,75 +598,72 @@ "Überprüfung fehlgeschlagen: Zeile % hat % Felder (vorige " "Zeile hatte %)" -#: src/datamash.c:922 +#: src/datamash.c:961 #, c-format msgid "check failed: input had % lines (expecting %)" msgstr "" "Überprüfung fehlgeschlagen: Eingabe hatte % Zeilen (% " "wurde erwartet)" -#: src/datamash.c:928 +#: src/datamash.c:967 #, c-format msgid "% line" msgid_plural "% lines" msgstr[0] "% Zeile" msgstr[1] "% Zeilen" -#: src/datamash.c:931 +#: src/datamash.c:970 #, c-format msgid "% field" msgid_plural "% fields" msgstr[0] "% Feld" msgstr[1] "% Felder" -#: src/datamash.c:1032 +#: src/datamash.c:1080 msgid "hash memory allocation error" msgstr "Speicherreservierung gescheitert" -#: src/datamash.c:1099 -msgid "sort command too-long (please report this bug)" -msgstr "Sortierbefehl ist zu lang (bitte melden Sie dies als Fehler)" +#: src/datamash.c:1147 +msgid "-s and -z cannot be combined on this system" +msgstr "" -#: src/datamash.c:1105 +#: src/datamash.c:1181 msgid "failed to run 'sort': popen failed" msgstr "»sort« kann nicht gestartet werden: »popen« fehlgeschlagen" -#: src/datamash.c:1121 +#: src/datamash.c:1197 msgid "read error" msgstr "Lesefehler" -#: src/datamash.c:1129 +#: src/datamash.c:1205 msgid "read error (on close)" msgstr "Lesefehler (beim Schließen)" -#: src/datamash.c:1222 src/datamash.c:1229 +#: src/datamash.c:1300 src/datamash.c:1307 src/datamash.c:1323 msgid "the delimiter must be a single character" msgstr "Trennzeichen muss ein einzelnes Zeichen sein" -#: src/datamash.c:1265 +#: src/datamash.c:1354 #, c-format msgid "missing operation specifiers" msgstr "Operationsbezeichner fehlen" -#: src/datamash.c:1283 +#: src/datamash.c:1372 msgid "-H or --header-in must be used with named columns" msgstr "-H oder --header-in muss mit benannten Spalten verwendet werden" #: src/decorate-functions.c:76 #, fuzzy, c-format -#| msgid "invalid numeric value" msgid "invalid empty roman numeral" msgstr "Ungültiger numerischer Wert" #: src/decorate-functions.c:84 #, fuzzy, c-format -#| msgid "invalid numeric value '%s'" msgid "invalid roman numeral '%c' in %s" msgstr "Ungültiger numerischer Wert »%s«" #: src/decorate-functions.c:120 #, fuzzy, c-format -#| msgid "invalid operand %s" msgid "invalid IPv4 address %s" msgstr "Ungültiger Operand %s" @@ -653,11 +682,24 @@ #: src/decorate-functions.c:165 #, fuzzy, c-format -#| msgid "invalid operand %s" msgid "invalid IPv6 address %s" msgstr "Ungültiger Operand %s" -#: src/decorate.c:140 +#: src/decorate-functions.c:192 +msgid "inet_pton failed for AF_INET and AF_INET6" +msgstr "" + +#: src/decorate-functions.c:196 +#, fuzzy, c-format +msgid "invalid IP address %s" +msgstr "Ungültiger Operand %s" + +#. This is a proper name. See the gettext manual, section Names. +#: src/decorate.c:42 +msgid "Assaf Gordon, Shawn Wagner and Erik Auerswald" +msgstr "" + +#: src/decorate.c:145 #, c-format msgid "" "Usage: %s [OPTION]... [INPUT]\n" @@ -666,29 +708,29 @@ "\n" msgstr "" -#: src/decorate.c:147 +#: src/decorate.c:152 msgid "Converts (and optionally sorts) fields of various formats\n" msgstr "" -#: src/decorate.c:153 +#: src/decorate.c:158 msgid "" "With --decorate: adds the converted fields to the start\n" "of each line and prints and prints it to STDOUT; does not sort.\n" msgstr "" -#: src/decorate.c:160 +#: src/decorate.c:165 msgid "" "With --undecorate: removes the first N fields from the input;\n" "Use as post-processing step after sort(1).\n" msgstr "" -#: src/decorate.c:167 +#: src/decorate.c:172 msgid "" "Without --decorate and --undecorate: automatically decorates the input,\n" "runs sort(1) and undecorates the result; This is the easiest method to use.\n" msgstr "" -#: src/decorate.c:179 +#: src/decorate.c:190 msgid "" " --decorate decorate/convert the specified fields and " "print\n" @@ -697,13 +739,13 @@ " sort(1) or undecorates the output\n" msgstr "" -#: src/decorate.c:184 +#: src/decorate.c:195 msgid "" " --header=N does not decorate or sort the first N lines\n" " -H same as --header=N\n" msgstr "" -#: src/decorate.c:188 +#: src/decorate.c:199 msgid "" " -k, --key=KEYDEF key/field to sort; same syntax as sort(1),\n" " optionally followed by ':method' to convert\n" @@ -712,10 +754,8 @@ " and available conversion below\n" msgstr "" -#: src/decorate.c:194 +#: src/decorate.c:205 #, fuzzy -#| msgid "" -#| " -t, --field-separator=X use X instead of TAB as field delimiter\n" msgid "" " -t, --field-separator=SEP use SEP instead of non-blank to blank " "transition\n" @@ -723,7 +763,7 @@ " -t, --field-separator=X verwendet X anstelle von Tabulatoren\n" " als Feldtrenner\n" -#: src/decorate.c:197 +#: src/decorate.c:208 msgid "" " --print-sort-args print adjusted parameters for sort(1); Useful\n" " when using --decorate and then manually " @@ -731,27 +771,26 @@ " sort(1)\n" msgstr "" -#: src/decorate.c:202 +#: src/decorate.c:213 #, fuzzy -#| msgid "" -#| " --no-strict allow lines with varying number of fields\n" msgid " --undecorate=N removes the first N fields\n" msgstr "" " --no-strict erlaubt Zeilen mit unterschiedlicher Feldanzahl\n" -#: src/decorate.c:205 +#: src/decorate.c:216 #, fuzzy -#| msgid " -z, --zero-terminated end lines with 0 byte, not newline\n" msgid " -z, --zero-terminated line delimiter is NUL, not newline\n" msgstr "" " -z, --zero-terminated beendet Zeilen mit einem Null-Byte, nicht\n" " mit einem Zeilenumbruch\n" -#: src/decorate.c:213 -msgid "The following options are passed to sort(1) as-is:\n" +#: src/decorate.c:227 +msgid "" +"The following options are passed to sort as-is (Most of them assume GNU " +"sort):\n" msgstr "" -#: src/decorate.c:219 +#: src/decorate.c:234 msgid "" " -c, --check\n" " --compress-program\n" @@ -764,226 +803,219 @@ " --parallel\n" msgstr "" -#: src/decorate.c:234 +#: src/decorate.c:249 msgid "Available conversions methods (use with -k):\n" msgstr "" -#: src/decorate.c:246 +#: src/decorate.c:261 #, fuzzy -#| msgid "Examples:" msgid "Examples:\n" msgstr "Beispiele:" -#: src/decorate.c:252 +#: src/decorate.c:267 msgid "The following two invocations are equivalent:\n" msgstr "" -#: src/decorate.c:267 +#: src/decorate.c:282 msgid "Decorated output of roman numerals:\n" msgstr "" -#: src/decorate.c:431 +#: src/decorate.c:446 msgid "fwrite (header line) failed" msgstr "" -#: src/decorate.c:439 +#: src/decorate.c:454 msgid "fflush (header line) failed" msgstr "" -#: src/decorate.c:445 +#: src/decorate.c:460 #, c-format -msgid "conversion failed in line %zu" +msgid "conversion failed in line %" msgstr "" -#: src/decorate.c:451 +#: src/decorate.c:467 msgid "decorate: fwrite failed" msgstr "" -#: src/decorate.c:457 src/decorate.c:519 +#: src/decorate.c:473 src/decorate.c:535 #, c-format msgid "error reading %s" msgstr "" -#: src/decorate.c:538 +#: src/decorate.c:554 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number at field start" msgstr "Ungültiger numerischer Wert »%s«" -#: src/decorate.c:543 src/decorate.c:571 +#: src/decorate.c:559 src/decorate.c:587 msgid "field number is zero" msgstr "" -#: src/decorate.c:548 src/decorate.c:576 +#: src/decorate.c:564 src/decorate.c:592 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number after '.'" msgstr "Ungültiger numerischer Wert »%s«" -#: src/decorate.c:552 +#: src/decorate.c:568 msgid "character offset is zero" msgstr "" -#: src/decorate.c:567 +#: src/decorate.c:583 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number after ','" msgstr "Ungültiger numerischer Wert »%s«" -#: src/decorate.c:603 +#: src/decorate.c:619 msgid "missing external conversion command" msgstr "" -#: src/decorate.c:618 +#: src/decorate.c:634 msgid "missing internal conversion function" msgstr "" -#: src/decorate.c:630 +#: src/decorate.c:646 #, fuzzy -#| msgid "invalid field pair for operation %s" msgid "invalid built-in conversion option" msgstr "Ungültiges Feldpaar für die Operation %s" -#: src/decorate.c:641 +#: src/decorate.c:657 msgid "" "ordering flags (b/d/i/h/n/g/M/R/V) cannot be combined with a conversion " "function" msgstr "" -#: src/decorate.c:671 +#: src/decorate.c:687 #, fuzzy -#| msgid "invalid operation %s" msgid "invalid key specification" msgstr "Ungültige Operation %s" -#: src/decorate.c:853 +#: src/decorate.c:890 #, fuzzy, c-format -#| msgid "invalid numeric value '%s'" msgid "invalid number of header lines %s" msgstr "Ungültiger numerischer Wert »%s«" -#: src/decorate.c:907 +#: src/decorate.c:948 msgid "empty tab" msgstr "" -#: src/decorate.c:918 +#: src/decorate.c:959 #, c-format msgid "multi-character tab %s" msgstr "" -#: src/decorate.c:923 +#: src/decorate.c:964 msgid "incompatible tabs" msgstr "" -#: src/decorate.c:945 +#: src/decorate.c:986 #, fuzzy, c-format -#| msgid "invalid field '%s' for operation %s" msgid "invalid number of fields to undecorate %s" msgstr "Ungültiges Feld »%s« für die Operation %s" -#: src/decorate.c:968 +#: src/decorate.c:1009 msgid "--decorate and --undecorate options are mutually exclusive" msgstr "" -#: src/decorate.c:972 +#: src/decorate.c:1013 msgid "--undecorate cannot be used with --keys or --decorate" msgstr "" -#: src/decorate.c:976 +#: src/decorate.c:1017 msgid "missing -k/--key decoration or --undecorate options" msgstr "" -#: src/decorate.c:985 +#: src/decorate.c:1026 msgid "no decorated keys specified. use sort instead" msgstr "" -#: src/decorate.c:1024 +#: src/decorate.c:1060 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to create dec-sort pipe" msgstr "»sort« kann nicht gestartet werden: »popen« fehlgeschlagen" -#: src/decorate.c:1026 +#: src/decorate.c:1062 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to create sort-undec pipe" msgstr "»sort« kann nicht gestartet werden: »popen« fehlgeschlagen" -#: src/decorate.c:1033 +#: src/decorate.c:1069 msgid "failed to fork-1" msgstr "" -#: src/decorate.c:1040 +#: src/decorate.c:1076 msgid "failed to fork-2" msgstr "" -#: src/decorate.c:1052 src/decorate.c:1101 +#: src/decorate.c:1088 src/decorate.c:1137 msgid "failed to close sort-undec read-pipe" msgstr "" -#: src/decorate.c:1055 src/decorate.c:1140 +#: src/decorate.c:1091 src/decorate.c:1176 msgid "failed to close sort-undec write-pipe" msgstr "" -#: src/decorate.c:1057 src/decorate.c:1135 +#: src/decorate.c:1093 src/decorate.c:1171 msgid "failed to close dec-sort read-pipe" msgstr "" -#: src/decorate.c:1066 +#: src/decorate.c:1102 msgid "failed to dup STDOUT fd" msgstr "" -#: src/decorate.c:1069 +#: src/decorate.c:1105 msgid "fdopen (dup (stdout)) failed" msgstr "" -#: src/decorate.c:1074 +#: src/decorate.c:1110 msgid "failed to reassign dec-sort STDOUT" msgstr "" -#: src/decorate.c:1098 src/decorate.c:1137 +#: src/decorate.c:1134 src/decorate.c:1173 msgid "failed to close dec-sort write-pipe" msgstr "" -#: src/decorate.c:1106 +#: src/decorate.c:1142 msgid "failed to reassign dec-sort STDIN" msgstr "" -#: src/decorate.c:1112 +#: src/decorate.c:1148 msgid "failed to reassign sort-undec STDOUT" msgstr "" -#: src/decorate.c:1126 +#: src/decorate.c:1162 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to run the sort command" msgstr "»sort« kann nicht gestartet werden: »popen« fehlgeschlagen" -#: src/decorate.c:1144 +#: src/decorate.c:1180 msgid "failed to reassign sort-undec STDIN" msgstr "" -#: src/double-format.c:49 +#: src/double-format.c:45 +msgid "numeric format too large" +msgstr "" + +#: src/double-format.c:54 #, c-format msgid "format %s has no %% directive" msgstr "Format %s hat keine %%-Anweisung" -#: src/double-format.c:62 +#: src/double-format.c:67 #, c-format msgid "format %s missing valid type after '%%'" msgstr "Format %s hat keinen gültigen Typ nach »%%«" -#: src/double-format.c:66 +#: src/double-format.c:71 #, c-format msgid "format %s has unknown/invalid type %%%c directive" msgstr "Format %s hat einen unbekannten/ungültigen Typ der %%%c-Anweisung" -#: src/double-format.c:79 +#: src/double-format.c:84 #, c-format msgid "format %s has too many %% directives" msgstr "Format %s hat zu viele %%-Anweisungen" -#: src/field-ops.c:346 +#: src/field-ops.c:351 #, c-format msgid "" "input error for operation %s: fields %,% have different " @@ -992,17 +1024,16 @@ "Eingabefehler für Operation %s: Felder %,% haben " "unterschiedliche Anzahl der Einträge" -#: src/field-ops.c:1176 +#: src/field-ops.c:1199 msgid "invalid numeric value" msgstr "Ungültiger numerischer Wert" -#: src/field-ops.c:1178 +#: src/field-ops.c:1201 msgid "invalid base64 value" msgstr "Ungültiger Base64-Wert" #: src/key-compare.c:305 #, fuzzy, c-format -#| msgid "invalid field pair for operation %s" msgid "%s: invalid field specification %s" msgstr "Ungültiges Feldpaar für die Operation %s" @@ -1087,7 +1118,7 @@ msgid "conflicting operation %s" msgstr "Operationskonflikt für %s" -#: src/op-parser.c:499 src/op-parser.c:752 +#: src/op-parser.c:499 src/op-parser.c:758 #, c-format msgid "invalid operation %s" msgstr "Ungültige Operation %s" @@ -1129,21 +1160,21 @@ msgid "crosstab requires exactly 2 fields, found %" msgstr "Crosstab benötigt genau zwei Felder, % wurden gefunden" -#: src/op-parser.c:705 +#: src/op-parser.c:711 #, c-format msgid "crosstab supports one operation, found %" msgstr "Crosstab unterstützt eine Operation, % wurden gefunden" -#: src/op-parser.c:714 +#: src/op-parser.c:720 msgid "missing operation" msgstr "Operation fehlt" -#: src/op-parser.c:728 +#: src/op-parser.c:734 #, c-format msgid "extra operand %s" msgstr "Zusätzlicher Operand %s" -#: src/op-parser.c:865 src/op-scanner.c:237 +#: src/op-parser.c:874 src/op-scanner.c:237 msgid "missing script (among arguments)" msgstr "Fehlendes Skript (zwischen Argumenten)" @@ -1183,14 +1214,29 @@ msgid "Try '%s --help' for more information.\n" msgstr "»%s --help« gibt weitere Informationen.\n" -#: src/text-options.c:111 +#: src/text-options.c:109 msgid "missing rounding digits value" msgstr "Fehlende Stellenanzahl für Rundung" -#: src/text-options.c:116 +#: src/text-options.c:114 #, c-format msgid "invalid rounding digits value %s" msgstr "Ungültige Stellenanzahl %s für Rundung" +#~ msgid "Assaf Gordon" +#~ msgstr "Assaf Gordon" + +#~ 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" +#~ " ergebnissen aus (Voreinstellung: nur die\n" +#~ " gruppierten Schlüssel werden ausgegeben)\n" + +#~ msgid "sort command too-long (please report this bug)" +#~ msgstr "Sortierbefehl ist zu lang (bitte melden Sie dies als Fehler)" + #~ msgid "%s home page: \n" #~ msgstr "Webseite von %s: \n" Binary files /tmp/tmpk9ju3y2l/uqkwDqQpWf/datamash-1.7/po/eo.gmo and /tmp/tmpk9ju3y2l/ut88G7BZjZ/datamash-1.8/po/eo.gmo differ diff -Nru datamash-1.7/po/eo.po datamash-1.8/po/eo.po --- datamash-1.7/po/eo.po 2020-04-23 17:34:24.000000000 +0000 +++ datamash-1.8/po/eo.po 2022-07-23 01:57:18.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: datamash 1.4.12.1\n" "Report-Msgid-Bugs-To: bug-datamash@gnu.org\n" -"POT-Creation-Date: 2020-04-23 11:34-0600\n" +"POT-Creation-Date: 2022-07-23 11:57+1000\n" "PO-Revision-Date: 2019-12-24 15:16-0300\n" "Last-Translator: Felipe Castro \n" "Language-Team: Esperanto \n" @@ -84,11 +84,11 @@ #. If you don't know what to put here, please see #. #. and use glyphs suitable for your language. -#: lib/quotearg.c:362 +#: lib/quotearg.c:355 msgid "`" msgstr "‘" -#: lib/quotearg.c:363 +#: lib/quotearg.c:356 msgid "'" msgstr "’" @@ -274,25 +274,25 @@ msgstr "%s%s-argumento '%s' tro larĝas" #. This is a proper name. See the gettext manual, section Names. -#: src/datamash.c:65 src/decorate.c:41 -msgid "Assaf Gordon" -msgstr "Assaf Gordon" +#: src/datamash.c:66 +msgid "Assaf Gordon, Tim Rice, Shawn Wagner, Erik Auerswald" +msgstr "" -#: src/datamash.c:161 src/datamash.c:504 +#: src/datamash.c:169 src/datamash.c:539 #, 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:182 #, c-format 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:185 msgid "Performs numeric/string operations on input from stdin." msgstr "Faras numerajn/ĉenajn operaciojn sur la enigo el la ĉefenigujo." -#: src/datamash.c:180 +#: src/datamash.c:188 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" @@ -300,7 +300,7 @@ "'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:183 +#: src/datamash.c:191 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" @@ -309,7 +309,7 @@ "kampo),\n" "aŭ kamp-nomo dum uzo de modifiloj -H aŭ --header-in.\n" -#: src/datamash.c:186 +#: src/datamash.c:194 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" @@ -319,35 +319,39 @@ "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:191 +#: src/datamash.c:199 msgid "Primary operations:\n" msgstr "Unua-rangaj operacioj:\n" -#: src/datamash.c:194 +#: src/datamash.c:202 msgid "Line-Filtering operations:\n" msgstr "Lini-filtraj operacioj:\n" -#: src/datamash.c:197 +#: src/datamash.c:205 msgid "Per-Line operations:\n" msgstr "Po-liniaj operacioj:\n" -#: src/datamash.c:203 +#: src/datamash.c:211 msgid "Numeric Grouping operations:\n" msgstr "Numeraj grupigaj operacioj:\n" -#: src/datamash.c:206 +#: src/datamash.c:214 msgid "Textual/Numeric Grouping operations:\n" msgstr "Tekstaj/numeraj grupigaj operacioj:\n" -#: src/datamash.c:210 +#: src/datamash.c:218 msgid "Statistical Grouping operations:\n" msgstr "Statistikaj grupigaj operacioj:\n" -#: src/datamash.c:219 +#: src/datamash.c:227 src/decorate.c:179 +msgid "Options:\n" +msgstr "Modifiloj:\n" + +#: src/datamash.c:229 msgid "Grouping Options:\n" msgstr "Grupigaj modifiloj:\n" -#: src/datamash.c:220 +#: src/datamash.c:230 msgid "" " -C, --skip-comments skip comment lines (starting with '#' or ';'\n" " and optional whitespace)\n" @@ -356,16 +360,17 @@ "aŭ ';'\n" " kaj malnepra blankspaco)\n" -#: src/datamash.c:224 +#: src/datamash.c:234 msgid "" " -f, --full print entire input line before op results\n" " (default: print only the grouped keys)\n" +" This option is only sensible for linewise\n" +" operations. Other uses are deprecated and\n" +" will be removed in a future version of GNU\n" +" Datamash.\n" msgstr "" -" -f, --full montri la tutan enig-linion antaŭ ol op-" -"rezultoj\n" -" (apriore: montri nur la grupitajn ŝlosilojn)\n" -#: src/datamash.c:228 +#: src/datamash.c:242 msgid "" " -g, --group=X[,Y,Z] group via fields X,[Y,Z];\n" " equivalent to primary operation 'groupby'\n" @@ -373,20 +378,20 @@ " -g, --group=X[,Y,Z] grupigi laŭ kampoj X,[Y,Z];\n" " ekvivalenta al unua-ranga operacio 'groupby'\n" -#: src/datamash.c:232 +#: src/datamash.c:246 msgid " --header-in first input line is column headers\n" msgstr " --header-in unua enig-linio estas la kolumnaj kapoj\n" -#: src/datamash.c:235 +#: src/datamash.c:249 msgid " --header-out print column headers as first line\n" msgstr "" " --header-out montri kolumnajn kapojn kiel unuan linion\n" -#: src/datamash.c:238 +#: src/datamash.c:252 msgid " -H, --headers same as '--header-in --header-out'\n" msgstr " -H, --headers same ol '--header-in --header-out'\n" -#: src/datamash.c:241 +#: src/datamash.c:255 msgid "" " -i, --ignore-case ignore upper/lower case when comparing text;\n" " this affects grouping, and string operations\n" @@ -395,7 +400,7 @@ " tio ĉi influas grupigon, kaj ĉenajn " "operaciojn\n" -#: src/datamash.c:245 +#: src/datamash.c:259 msgid "" " -s, --sort sort the input before grouping; this removes " "the\n" @@ -406,31 +411,40 @@ "forigas la\n" " neceson mem dukti la enigon tra 'sort'\n" -#: src/datamash.c:250 +#: src/datamash.c:263 +#, fuzzy +msgid "" +" -c, --collapse-delimiter=X use X to separate elements in collapse and\n" +" unique lists (default: comma)\n" +msgstr "" +" --output-delimiter=X uzi X anstataŭe kiel elig-kampa limigilo\n" +" (apriore: uzi saman limigilon kiel -t/-W)\n" + +#: src/datamash.c:268 msgid "File Operation Options:\n" msgstr "Dosier-operaciaj modifiloj:\n" -#: src/datamash.c:251 +#: src/datamash.c:269 msgid " --no-strict allow lines with varying number of fields\n" msgstr "" " --no-strict permesas liniojn kun variebla nombro da kampoj\n" -#: src/datamash.c:254 +#: src/datamash.c:272 #, c-format msgid " --filler=X fill missing values with X (default %s)\n" msgstr "" " --filler=X kompletigas mankantajn valorojn per X (aprioras " "%s)\n" -#: src/datamash.c:259 src/decorate.c:174 +#: src/datamash.c:277 src/decorate.c:185 msgid "General Options:\n" msgstr "Ĝeneralaj modifiloj:\n" -#: src/datamash.c:260 +#: src/datamash.c:278 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:263 +#: src/datamash.c:281 msgid "" " --format=FORMAT print numeric values with printf style\n" " floating-point FORMAT.\n" @@ -438,7 +452,7 @@ " --format=FORMO printi ciferajn valorojn laŭ stilo de printf\n" " per glitkoma FORMO.\n" -#: src/datamash.c:267 +#: src/datamash.c:285 msgid "" " --output-delimiter=X use X instead as output field delimiter\n" " (default: use same delimiter as -t/-W)\n" @@ -446,16 +460,16 @@ " --output-delimiter=X uzi X anstataŭe kiel elig-kampa limigilo\n" " (apriore: uzi saman limigilon kiel -t/-W)\n" -#: src/datamash.c:271 +#: src/datamash.c:289 msgid " --narm skip NA/NaN values\n" msgstr " --narm pretersalti valorojn NA/NaN\n" -#: src/datamash.c:274 +#: src/datamash.c:292 msgid " -R, --round=N round numeric output to N decimal places\n" msgstr "" " -R, --round=N rondigi ciferecan eligon al N dekumaj lokoj\n" -#: src/datamash.c:277 +#: src/datamash.c:295 msgid "" " -W, --whitespace use whitespace (one or more spaces and/or tabs)\n" " for field delimiters\n" @@ -464,32 +478,44 @@ "aŭ taboj)\n" " por kamp-disigiloj\n" -#: src/datamash.c:281 +#: src/datamash.c:299 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" -#: src/datamash.c:290 +#: src/datamash.c:302 src/decorate.c:219 +msgid " --sort-cmd=/path/to/sort Alternative sort(1) to use.\n" +msgstr "" + +#: src/datamash.c:311 +msgid "Environment:" +msgstr "" + +#: src/datamash.c:313 +msgid " LC_NUMERIC decimal-point character and thousands separator\n" +msgstr "" + +#: src/datamash.c:319 msgid "Examples:" msgstr "Ekzemploj:" -#: src/datamash.c:292 +#: src/datamash.c:321 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:297 +#: src/datamash.c:326 msgid "Transpose input:" msgstr "Transponi la enigon:" -#: src/datamash.c:304 src/decorate.c:287 +#: src/datamash.c:333 src/decorate.c:302 msgid "For detailed usage information and examples, see\n" msgstr "Por detala uzmaniera informo kaj ekzemploj, konsultu\n" -#: src/datamash.c:306 src/decorate.c:289 +#: src/datamash.c:335 src/decorate.c:304 msgid "The manual and more examples are available at\n" msgstr "La gvidilo kaj pli ekzemploj disponeblas ĉe\n" -#: src/datamash.c:315 +#: src/datamash.c:344 #, c-format msgid "" "invalid input: field % requested, line % has only " @@ -498,12 +524,18 @@ "malvalida enigo: kampo % postulata, linio % havas nur " "% kampojn" -#: src/datamash.c:385 +#: src/datamash.c:414 #, c-format msgid "%s in line % field %: '%s'" msgstr "%s en linio % kampo %: '%s'" -#: src/datamash.c:713 +#: src/datamash.c:656 +msgid "" +"datamash: Using -f/--full with non-linewise operations is deprecated and " +"will be disabled in a future release.\n" +msgstr "" + +#: src/datamash.c:752 #, c-format msgid "" "transpose input error: line % has % fields (previous lines " @@ -514,7 +546,7 @@ "linioj havis %);\n" "konsultu --help por malebligi severan reĝimon" -#: src/datamash.c:770 +#: src/datamash.c:809 #, c-format msgid "" "reverse-field input error: line % has % fields (previous " @@ -525,7 +557,7 @@ "linioj havis %);\n" "konsultu --help por malebligi severan reĝimon" -#: src/datamash.c:879 src/datamash.c:896 src/datamash.c:902 +#: src/datamash.c:918 src/datamash.c:935 src/datamash.c:941 #, c-format msgid "" "line % (% fields):\n" @@ -534,7 +566,7 @@ "linio % (% kampoj):\n" " " -#: src/datamash.c:885 +#: src/datamash.c:924 #, c-format msgid "" "check failed: line % has % fields (expecting %)" @@ -542,7 +574,7 @@ "kontrolo malsukcesis: linio % havas % kampojn (atendite " "%)" -#: src/datamash.c:908 +#: src/datamash.c:947 #, c-format msgid "" "check failed: line % has % fields (previous line had " @@ -551,74 +583,71 @@ "kontrolo malsukcesis: linio % havas % kampojn (antaŭa " "linio havis %)" -#: src/datamash.c:922 +#: src/datamash.c:961 #, c-format msgid "check failed: input had % lines (expecting %)" msgstr "" "kontrolo malsukcesis: enigo havis % liniojn (atendite %)" -#: src/datamash.c:928 +#: src/datamash.c:967 #, c-format msgid "% line" msgid_plural "% lines" msgstr[0] "% linio" msgstr[1] "% linioj" -#: src/datamash.c:931 +#: src/datamash.c:970 #, c-format msgid "% field" msgid_plural "% fields" msgstr[0] "% kampo" msgstr[1] "% kampoj" -#: src/datamash.c:1032 +#: src/datamash.c:1080 msgid "hash memory allocation error" msgstr "eraro de rezervo por haket-memoro" -#: src/datamash.c:1099 -msgid "sort command too-long (please report this bug)" -msgstr "ordiga komando tro longas (bonvole raportu tiun ĉi program-mison)" +#: src/datamash.c:1147 +msgid "-s and -z cannot be combined on this system" +msgstr "" -#: src/datamash.c:1105 +#: src/datamash.c:1181 msgid "failed to run 'sort': popen failed" msgstr "malsukcesis lanĉi 'sort': popen fiaskis" -#: src/datamash.c:1121 +#: src/datamash.c:1197 msgid "read error" msgstr "leg-eraro" -#: src/datamash.c:1129 +#: src/datamash.c:1205 msgid "read error (on close)" msgstr "leg-eraro (dum fermo)" -#: src/datamash.c:1222 src/datamash.c:1229 +#: src/datamash.c:1300 src/datamash.c:1307 src/datamash.c:1323 msgid "the delimiter must be a single character" msgstr "la disigilo devas esti ununura signo" -#: src/datamash.c:1265 +#: src/datamash.c:1354 #, c-format msgid "missing operation specifiers" msgstr "mankas operaciaj indikiloj" -#: src/datamash.c:1283 +#: src/datamash.c:1372 msgid "-H or --header-in must be used with named columns" msgstr "-H aŭ --header-in devas esti uzataj kun nomigitaj kolumnoj" #: src/decorate-functions.c:76 #, fuzzy, c-format -#| msgid "invalid empty grouping parameter" msgid "invalid empty roman numeral" msgstr "malvalida malplena grupiga parametro" #: src/decorate-functions.c:84 #, fuzzy, c-format -#| msgid "invalid numeric value '%s'" msgid "invalid roman numeral '%c' in %s" msgstr "malvalida cifera valoro '%s'" #: src/decorate-functions.c:120 #, fuzzy, c-format -#| msgid "invalid operand %s" msgid "invalid IPv4 address %s" msgstr "malvalida operando %s" @@ -637,11 +666,24 @@ #: src/decorate-functions.c:165 #, fuzzy, c-format -#| msgid "invalid operand %s" msgid "invalid IPv6 address %s" msgstr "malvalida operando %s" -#: src/decorate.c:140 +#: src/decorate-functions.c:192 +msgid "inet_pton failed for AF_INET and AF_INET6" +msgstr "" + +#: src/decorate-functions.c:196 +#, fuzzy, c-format +msgid "invalid IP address %s" +msgstr "malvalida operando %s" + +#. This is a proper name. See the gettext manual, section Names. +#: src/decorate.c:42 +msgid "Assaf Gordon, Shawn Wagner and Erik Auerswald" +msgstr "" + +#: src/decorate.c:145 #, c-format msgid "" "Usage: %s [OPTION]... [INPUT]\n" @@ -650,29 +692,29 @@ "\n" msgstr "" -#: src/decorate.c:147 +#: src/decorate.c:152 msgid "Converts (and optionally sorts) fields of various formats\n" msgstr "" -#: src/decorate.c:153 +#: src/decorate.c:158 msgid "" "With --decorate: adds the converted fields to the start\n" "of each line and prints and prints it to STDOUT; does not sort.\n" msgstr "" -#: src/decorate.c:160 +#: src/decorate.c:165 msgid "" "With --undecorate: removes the first N fields from the input;\n" "Use as post-processing step after sort(1).\n" msgstr "" -#: src/decorate.c:167 +#: src/decorate.c:172 msgid "" "Without --decorate and --undecorate: automatically decorates the input,\n" "runs sort(1) and undecorates the result; This is the easiest method to use.\n" msgstr "" -#: src/decorate.c:179 +#: src/decorate.c:190 msgid "" " --decorate decorate/convert the specified fields and " "print\n" @@ -681,13 +723,13 @@ " sort(1) or undecorates the output\n" msgstr "" -#: src/decorate.c:184 +#: src/decorate.c:195 msgid "" " --header=N does not decorate or sort the first N lines\n" " -H same as --header=N\n" msgstr "" -#: src/decorate.c:188 +#: src/decorate.c:199 msgid "" " -k, --key=KEYDEF key/field to sort; same syntax as sort(1),\n" " optionally followed by ':method' to convert\n" @@ -696,16 +738,14 @@ " and available conversion below\n" msgstr "" -#: src/decorate.c:194 +#: src/decorate.c:205 #, fuzzy -#| msgid "" -#| " -t, --field-separator=X use X instead of TAB as field delimiter\n" msgid "" " -t, --field-separator=SEP use SEP instead of non-blank to blank " "transition\n" msgstr " -t, --field-separator=X uzu X antataŭ TAB kiel kamp-disigilo\n" -#: src/decorate.c:197 +#: src/decorate.c:208 msgid "" " --print-sort-args print adjusted parameters for sort(1); Useful\n" " when using --decorate and then manually " @@ -713,26 +753,25 @@ " sort(1)\n" msgstr "" -#: src/decorate.c:202 +#: src/decorate.c:213 #, fuzzy -#| msgid "" -#| " --no-strict allow lines with varying number of fields\n" msgid " --undecorate=N removes the first N fields\n" msgstr "" " --no-strict permesas liniojn kun variebla nombro da kampoj\n" -#: src/decorate.c:205 +#: src/decorate.c:216 #, fuzzy -#| msgid " -z, --zero-terminated end lines with 0 byte, not newline\n" msgid " -z, --zero-terminated line delimiter is NUL, not newline\n" msgstr "" " -z, --zero-terminated fini liniojn per la bajto 0, ne novlini-signo\n" -#: src/decorate.c:213 -msgid "The following options are passed to sort(1) as-is:\n" +#: src/decorate.c:227 +msgid "" +"The following options are passed to sort as-is (Most of them assume GNU " +"sort):\n" msgstr "" -#: src/decorate.c:219 +#: src/decorate.c:234 msgid "" " -c, --check\n" " --compress-program\n" @@ -745,226 +784,219 @@ " --parallel\n" msgstr "" -#: src/decorate.c:234 +#: src/decorate.c:249 msgid "Available conversions methods (use with -k):\n" msgstr "" -#: src/decorate.c:246 +#: src/decorate.c:261 #, fuzzy -#| msgid "Examples:" msgid "Examples:\n" msgstr "Ekzemploj:" -#: src/decorate.c:252 +#: src/decorate.c:267 msgid "The following two invocations are equivalent:\n" msgstr "" -#: src/decorate.c:267 +#: src/decorate.c:282 msgid "Decorated output of roman numerals:\n" msgstr "" -#: src/decorate.c:431 +#: src/decorate.c:446 msgid "fwrite (header line) failed" msgstr "" -#: src/decorate.c:439 +#: src/decorate.c:454 msgid "fflush (header line) failed" msgstr "" -#: src/decorate.c:445 +#: src/decorate.c:460 #, c-format -msgid "conversion failed in line %zu" +msgid "conversion failed in line %" msgstr "" -#: src/decorate.c:451 +#: src/decorate.c:467 msgid "decorate: fwrite failed" msgstr "" -#: src/decorate.c:457 src/decorate.c:519 +#: src/decorate.c:473 src/decorate.c:535 #, c-format msgid "error reading %s" msgstr "" -#: src/decorate.c:538 +#: src/decorate.c:554 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number at field start" msgstr "malvalida cifera valoro '%s'" -#: src/decorate.c:543 src/decorate.c:571 +#: src/decorate.c:559 src/decorate.c:587 msgid "field number is zero" msgstr "" -#: src/decorate.c:548 src/decorate.c:576 +#: src/decorate.c:564 src/decorate.c:592 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number after '.'" msgstr "malvalida cifera valoro '%s'" -#: src/decorate.c:552 +#: src/decorate.c:568 msgid "character offset is zero" msgstr "" -#: src/decorate.c:567 +#: src/decorate.c:583 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number after ','" msgstr "malvalida cifera valoro '%s'" -#: src/decorate.c:603 +#: src/decorate.c:619 msgid "missing external conversion command" msgstr "" -#: src/decorate.c:618 +#: src/decorate.c:634 msgid "missing internal conversion function" msgstr "" -#: src/decorate.c:630 +#: src/decorate.c:646 #, fuzzy -#| msgid "invalid field pair for operation %s" msgid "invalid built-in conversion option" msgstr "malvalida paro da kampoj por la operacio %s" -#: src/decorate.c:641 +#: src/decorate.c:657 msgid "" "ordering flags (b/d/i/h/n/g/M/R/V) cannot be combined with a conversion " "function" msgstr "" -#: src/decorate.c:671 +#: src/decorate.c:687 #, fuzzy -#| msgid "invalid operation %s" msgid "invalid key specification" msgstr "malvalida operacio %s" -#: src/decorate.c:853 +#: src/decorate.c:890 #, fuzzy, c-format -#| msgid "invalid numeric value '%s'" msgid "invalid number of header lines %s" msgstr "malvalida cifera valoro '%s'" -#: src/decorate.c:907 +#: src/decorate.c:948 msgid "empty tab" msgstr "" -#: src/decorate.c:918 +#: src/decorate.c:959 #, c-format msgid "multi-character tab %s" msgstr "" -#: src/decorate.c:923 +#: src/decorate.c:964 msgid "incompatible tabs" msgstr "" -#: src/decorate.c:945 +#: src/decorate.c:986 #, fuzzy, c-format -#| msgid "invalid field '%s' for operation %s" msgid "invalid number of fields to undecorate %s" msgstr "malvalida kampo '%s' por la operacio %s" -#: src/decorate.c:968 +#: src/decorate.c:1009 msgid "--decorate and --undecorate options are mutually exclusive" msgstr "" -#: src/decorate.c:972 +#: src/decorate.c:1013 msgid "--undecorate cannot be used with --keys or --decorate" msgstr "" -#: src/decorate.c:976 +#: src/decorate.c:1017 msgid "missing -k/--key decoration or --undecorate options" msgstr "" -#: src/decorate.c:985 +#: src/decorate.c:1026 msgid "no decorated keys specified. use sort instead" msgstr "" -#: src/decorate.c:1024 +#: src/decorate.c:1060 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to create dec-sort pipe" msgstr "malsukcesis lanĉi 'sort': popen fiaskis" -#: src/decorate.c:1026 +#: src/decorate.c:1062 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to create sort-undec pipe" msgstr "malsukcesis lanĉi 'sort': popen fiaskis" -#: src/decorate.c:1033 +#: src/decorate.c:1069 msgid "failed to fork-1" msgstr "" -#: src/decorate.c:1040 +#: src/decorate.c:1076 msgid "failed to fork-2" msgstr "" -#: src/decorate.c:1052 src/decorate.c:1101 +#: src/decorate.c:1088 src/decorate.c:1137 msgid "failed to close sort-undec read-pipe" msgstr "" -#: src/decorate.c:1055 src/decorate.c:1140 +#: src/decorate.c:1091 src/decorate.c:1176 msgid "failed to close sort-undec write-pipe" msgstr "" -#: src/decorate.c:1057 src/decorate.c:1135 +#: src/decorate.c:1093 src/decorate.c:1171 msgid "failed to close dec-sort read-pipe" msgstr "" -#: src/decorate.c:1066 +#: src/decorate.c:1102 msgid "failed to dup STDOUT fd" msgstr "" -#: src/decorate.c:1069 +#: src/decorate.c:1105 msgid "fdopen (dup (stdout)) failed" msgstr "" -#: src/decorate.c:1074 +#: src/decorate.c:1110 msgid "failed to reassign dec-sort STDOUT" msgstr "" -#: src/decorate.c:1098 src/decorate.c:1137 +#: src/decorate.c:1134 src/decorate.c:1173 msgid "failed to close dec-sort write-pipe" msgstr "" -#: src/decorate.c:1106 +#: src/decorate.c:1142 msgid "failed to reassign dec-sort STDIN" msgstr "" -#: src/decorate.c:1112 +#: src/decorate.c:1148 msgid "failed to reassign sort-undec STDOUT" msgstr "" -#: src/decorate.c:1126 +#: src/decorate.c:1162 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to run the sort command" msgstr "malsukcesis lanĉi 'sort': popen fiaskis" -#: src/decorate.c:1144 +#: src/decorate.c:1180 msgid "failed to reassign sort-undec STDIN" msgstr "" -#: src/double-format.c:49 +#: src/double-format.c:45 +msgid "numeric format too large" +msgstr "" + +#: src/double-format.c:54 #, c-format msgid "format %s has no %% directive" msgstr "la formo %s ne havas iun ajn %% kiel direktivo" -#: src/double-format.c:62 +#: src/double-format.c:67 #, c-format msgid "format %s missing valid type after '%%'" msgstr "la formo %s malhavas validan tipon post '%%'" -#: src/double-format.c:66 +#: src/double-format.c:71 #, c-format msgid "format %s has unknown/invalid type %%%c directive" msgstr "la formo %s havas nekonata/malvalida direktiva tipo %%%c" -#: src/double-format.c:79 +#: src/double-format.c:84 #, c-format msgid "format %s has too many %% directives" msgstr "la formo %s havas tro da direktivoj" -#: src/field-ops.c:346 +#: src/field-ops.c:351 #, c-format msgid "" "input error for operation %s: fields %,% have different " @@ -973,17 +1005,16 @@ "eniga eraro por operacio %s: kampoj %,% havas malsamaj " "numbro da eroj" -#: src/field-ops.c:1176 +#: src/field-ops.c:1199 msgid "invalid numeric value" msgstr "malvalida cifera valoro" -#: src/field-ops.c:1178 +#: src/field-ops.c:1201 msgid "invalid base64 value" msgstr "malvalida valoro base64" #: src/key-compare.c:305 #, fuzzy, c-format -#| msgid "invalid field pair for operation %s" msgid "%s: invalid field specification %s" msgstr "malvalida paro da kampoj por la operacio %s" @@ -1068,7 +1099,7 @@ msgid "conflicting operation %s" msgstr "malakorda operacio %s" -#: src/op-parser.c:499 src/op-parser.c:752 +#: src/op-parser.c:499 src/op-parser.c:758 #, c-format msgid "invalid operation %s" msgstr "malvalida operacio %s" @@ -1108,21 +1139,21 @@ msgid "crosstab requires exactly 2 fields, found %" msgstr "'crosstab' postulas precize 2 kampojn, ni trovis %" -#: src/op-parser.c:705 +#: src/op-parser.c:711 #, c-format msgid "crosstab supports one operation, found %" msgstr "'crosstab' subtenas unu operacion, ni trovis %" -#: src/op-parser.c:714 +#: src/op-parser.c:720 msgid "missing operation" msgstr "mankas operacion" -#: src/op-parser.c:728 +#: src/op-parser.c:734 #, c-format msgid "extra operand %s" msgstr "kroma operando %s" -#: src/op-parser.c:865 src/op-scanner.c:237 +#: src/op-parser.c:874 src/op-scanner.c:237 msgid "missing script (among arguments)" msgstr "mankas skripto (inter argumentoj)" @@ -1162,15 +1193,30 @@ msgid "Try '%s --help' for more information.\n" msgstr "Provu '%s --help' por pli da informo.\n" -#: src/text-options.c:111 +#: src/text-options.c:109 msgid "missing rounding digits value" msgstr "mankas valoro por rondig-ciferoj" -#: src/text-options.c:116 +#: src/text-options.c:114 #, c-format msgid "invalid rounding digits value %s" msgstr "malvalida valoro por rondig-ciferoj %s" +#~ msgid "Assaf Gordon" +#~ msgstr "Assaf Gordon" + +#~ 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" +#~ " (apriore: montri nur la grupitajn " +#~ "ŝlosilojn)\n" + +#~ msgid "sort command too-long (please report this bug)" +#~ msgstr "ordiga komando tro longas (bonvole raportu tiun ĉi program-mison)" + #~ msgid "%s home page: \n" #~ msgstr "%s hejm-paĝo: \n" @@ -1195,9 +1241,6 @@ #~ 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" Binary files /tmp/tmpk9ju3y2l/uqkwDqQpWf/datamash-1.7/po/es.gmo and /tmp/tmpk9ju3y2l/ut88G7BZjZ/datamash-1.8/po/es.gmo differ diff -Nru datamash-1.7/po/es.po datamash-1.8/po/es.po --- datamash-1.7/po/es.po 2020-04-23 17:34:24.000000000 +0000 +++ datamash-1.8/po/es.po 2022-07-23 01:57:18.000000000 +0000 @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: datamash 1.1.1.19\n" "Report-Msgid-Bugs-To: bug-datamash@gnu.org\n" -"POT-Creation-Date: 2020-04-23 11:34-0600\n" +"POT-Creation-Date: 2022-07-23 11:57+1000\n" "PO-Revision-Date: 2018-03-29 09:24+0200\n" "Last-Translator: Francisco Javier Serrador \n" "Language-Team: Spanish \n" @@ -83,11 +83,11 @@ #. If you don't know what to put here, please see #. #. and use glyphs suitable for your language. -#: lib/quotearg.c:362 +#: lib/quotearg.c:355 msgid "`" msgstr "«" -#: lib/quotearg.c:363 +#: lib/quotearg.c:356 msgid "'" msgstr "»" @@ -111,13 +111,6 @@ #. TRANSLATORS: The %s placeholder is the web address of the GPL license. #: lib/version-etc.c:88 #, fuzzy, c-format -#| 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" msgid "" "License GPLv3+: GNU GPL version 3 or later <%s>.\n" "This is free software: you are free to change and redistribute it.\n" @@ -244,9 +237,6 @@ #. bugs (typically your translation team's web or email address). #: lib/version-etc.c:249 #, fuzzy, c-format -#| msgid "" -#| "\n" -#| "Report bugs to: %s\n" msgid "Report bugs to: %s\n" msgstr "" "\n" @@ -264,7 +254,6 @@ #: lib/version-etc.c:260 #, fuzzy, c-format -#| msgid "General help using GNU software: \n" msgid "General help using GNU software: <%s>\n" msgstr "Ayuda general utilizando software GNU: \n" @@ -288,25 +277,25 @@ msgstr "%s%s: argumento «%s» demasiado grande" #. This is a proper name. See the gettext manual, section Names. -#: src/datamash.c:65 src/decorate.c:41 -msgid "Assaf Gordon" -msgstr "Assaf Gordon" +#: src/datamash.c:66 +msgid "Assaf Gordon, Tim Rice, Shawn Wagner, Erik Auerswald" +msgstr "" -#: src/datamash.c:161 src/datamash.c:504 +#: src/datamash.c:169 src/datamash.c:539 #, c-format msgid "column name %s not found in input file" msgstr "nombre de columna %s no encontrado en fichero entrada" -#: src/datamash.c:174 +#: src/datamash.c:182 #, c-format msgid "Usage: %s [OPTION] op [fld] [op fld ...]\n" msgstr "Modo de empleo: %s [OPCIÓN] hasta [fld] [op fld] ...]\n" -#: src/datamash.c:177 +#: src/datamash.c:185 msgid "Performs numeric/string operations on input from stdin." msgstr "Realiza operaciones numéricas/cadena por entrada desde stdin." -#: src/datamash.c:180 +#: src/datamash.c:188 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" @@ -314,7 +303,7 @@ "'op' es la operación para realizar. Si una primera operación es utilizada,\n" "debe ser listada primero, opcionalmente seguida por otras operaciones.\n" -#: src/datamash.c:183 +#: src/datamash.c:191 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" @@ -323,7 +312,7 @@ "(1=primer campo),\n" "o un campo nombrado cuando utilice las opciones -H o --header-in.\n" -#: src/datamash.c:186 +#: src/datamash.c:194 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" @@ -334,50 +323,56 @@ "dos puntos para operaciones las cuales requieran un par de campos\n" "(p.e 'pcov 2:6').\n" -#: src/datamash.c:191 +#: src/datamash.c:199 msgid "Primary operations:\n" msgstr "Operaciones primarias:\n" -#: src/datamash.c:194 +#: src/datamash.c:202 msgid "Line-Filtering operations:\n" msgstr "Operaciones lineales filtradas:\n" -#: src/datamash.c:197 +#: src/datamash.c:205 msgid "Per-Line operations:\n" msgstr "Operaciones por línea:\n" -#: src/datamash.c:203 +#: src/datamash.c:211 msgid "Numeric Grouping operations:\n" msgstr "Operaciones Agrupadoras Numéricas:\n" -#: src/datamash.c:206 +#: src/datamash.c:214 msgid "Textual/Numeric Grouping operations:\n" msgstr "Textual/Numérico Agrupando operaciones:\n" -#: src/datamash.c:210 +#: src/datamash.c:218 msgid "Statistical Grouping operations:\n" msgstr "Operaciones de Agrupamiento Estadístico:\n" -#: src/datamash.c:219 +#: src/datamash.c:227 src/decorate.c:179 +#, fuzzy +msgid "Options:\n" +msgstr "Opciones comunes:\n" + +#: src/datamash.c:229 msgid "Grouping Options:\n" msgstr "Opciones de agrupamiento:\n" -#: src/datamash.c:220 +#: src/datamash.c:230 msgid "" " -C, --skip-comments skip comment lines (starting with '#' or ';'\n" " and optional whitespace)\n" msgstr "" -#: src/datamash.c:224 +#: src/datamash.c:234 msgid "" " -f, --full print entire input line before op results\n" " (default: print only the grouped keys)\n" +" This option is only sensible for linewise\n" +" operations. Other uses are deprecated and\n" +" will be removed in a future version of GNU\n" +" Datamash.\n" msgstr "" -" -f, --full escribe línea de entrada completa antes de " -"resultados op\n" -" (por omisión: solo escribe claves agrupadas)\n" -#: src/datamash.c:228 +#: src/datamash.c:242 msgid "" " -g, --group=X[,Y,Z] group via fields X,[Y,Z];\n" " equivalent to primary operation 'groupby'\n" @@ -385,22 +380,22 @@ " -g, --group=X[,Y,Z] grupo vía campos X,[Y,Z];\n" " equivalente a operación «groupby» primario\n" -#: src/datamash.c:232 +#: src/datamash.c:246 msgid " --header-in first input line is column headers\n" msgstr "" " --header-in primera línea entrante es columna de cabeceras\n" -#: src/datamash.c:235 +#: src/datamash.c:249 msgid " --header-out print column headers as first line\n" msgstr "" " --header-out escribe cabeceras de columnas como primera " "línea\n" -#: src/datamash.c:238 +#: src/datamash.c:252 msgid " -H, --headers same as '--header-in --header-out'\n" msgstr " -H, --headers igual como '--header-in --header-out'\n" -#: src/datamash.c:241 +#: src/datamash.c:255 msgid "" " -i, --ignore-case ignore upper/lower case when comparing text;\n" " this affects grouping, and string operations\n" @@ -410,7 +405,7 @@ " esto afecta agrupando, y operaciones de cadena " "textual\n" -#: src/datamash.c:245 +#: src/datamash.c:259 msgid "" " -s, --sort sort the input before grouping; this removes " "the\n" @@ -422,52 +417,58 @@ " para manualmente crear tubería de entrada a " "través de 'sort'\n" -#: src/datamash.c:250 +#: src/datamash.c:263 +msgid "" +" -c, --collapse-delimiter=X use X to separate elements in collapse and\n" +" unique lists (default: comma)\n" +msgstr "" + +#: src/datamash.c:268 msgid "File Operation Options:\n" msgstr "Fichero de opciones operativas:\n" -#: src/datamash.c:251 +#: src/datamash.c:269 msgid " --no-strict allow lines with varying number of fields\n" msgstr "" " --no-strict permite líneas con número variable de campos\n" -#: src/datamash.c:254 +#: src/datamash.c:272 #, c-format msgid " --filler=X fill missing values with X (default %s)\n" msgstr "" " --filler=X valores de relleno ausente con X (predeterminado " "%s)\n" -#: src/datamash.c:259 src/decorate.c:174 +#: src/datamash.c:277 src/decorate.c:185 msgid "General Options:\n" msgstr "Opciones comunes:\n" -#: src/datamash.c:260 +#: src/datamash.c:278 msgid " -t, --field-separator=X use X instead of TAB as field delimiter\n" msgstr "" " -t, --field-separator=X utiliza X en vez de TAB como campo delimitador\n" -#: src/datamash.c:263 +#: src/datamash.c:281 msgid "" " --format=FORMAT print numeric values with printf style\n" " floating-point FORMAT.\n" msgstr "" -#: src/datamash.c:267 +#: src/datamash.c:285 msgid "" " --output-delimiter=X use X instead as output field delimiter\n" " (default: use same delimiter as -t/-W)\n" msgstr "" -#: src/datamash.c:271 +#: src/datamash.c:289 msgid " --narm skip NA/NaN values\n" msgstr " --narm omite valores NA/NaN\n" -#: src/datamash.c:274 +#: src/datamash.c:292 msgid " -R, --round=N round numeric output to N decimal places\n" msgstr "" -#: src/datamash.c:277 +#: src/datamash.c:295 msgid "" " -W, --whitespace use whitespace (one or more spaces and/or tabs)\n" " for field delimiters\n" @@ -476,32 +477,44 @@ "o tabulaciones)\n" " para delimitaciones de campo\n" -#: src/datamash.c:281 +#: src/datamash.c:299 msgid " -z, --zero-terminated end lines with 0 byte, not newline\n" msgstr "" " -z, --zero-terminated finaliza líneas con 0 byte, no líneas nuevas\n" -#: src/datamash.c:290 +#: src/datamash.c:302 src/decorate.c:219 +msgid " --sort-cmd=/path/to/sort Alternative sort(1) to use.\n" +msgstr "" + +#: src/datamash.c:311 +msgid "Environment:" +msgstr "" + +#: src/datamash.c:313 +msgid " LC_NUMERIC decimal-point character and thousands separator\n" +msgstr "" + +#: src/datamash.c:319 msgid "Examples:" msgstr "Ejemplos:" -#: src/datamash.c:292 +#: src/datamash.c:321 msgid "Print the sum and the mean of values from column 1:" msgstr "Escribe el sumatorio y el sisgificado de valores desde columna1:" -#: src/datamash.c:297 +#: src/datamash.c:326 msgid "Transpose input:" msgstr "Traspone entrada:" -#: src/datamash.c:304 src/decorate.c:287 +#: src/datamash.c:333 src/decorate.c:302 msgid "For detailed usage information and examples, see\n" msgstr "Para información de utilización detallada y ejemplos, vea\n" -#: src/datamash.c:306 src/decorate.c:289 +#: src/datamash.c:335 src/decorate.c:304 msgid "The manual and more examples are available at\n" msgstr "El manual y más ejemplos están disponibles desde\n" -#: src/datamash.c:315 +#: src/datamash.c:344 #, c-format msgid "" "invalid input: field % requested, line % has only " @@ -510,12 +523,18 @@ "entrada inválida: campo % requerido, línea % tiene solo " "% campos" -#: src/datamash.c:385 +#: src/datamash.c:414 #, c-format msgid "%s in line % field %: '%s'" msgstr "%s en línea % campo %: '%s'" -#: src/datamash.c:713 +#: src/datamash.c:656 +msgid "" +"datamash: Using -f/--full with non-linewise operations is deprecated and " +"will be disabled in a future release.\n" +msgstr "" + +#: src/datamash.c:752 #, c-format msgid "" "transpose input error: line % has % fields (previous lines " @@ -526,7 +545,7 @@ "(anteriores líneas tuvieron %);\n" "vea --help para desactivar modo estricto" -#: src/datamash.c:770 +#: src/datamash.c:809 #, c-format msgid "" "reverse-field input error: line % has % fields (previous " @@ -537,7 +556,7 @@ "(líneas anteriores tenía %);\n" "vea --help para desactivar modo estricto" -#: src/datamash.c:879 src/datamash.c:896 src/datamash.c:902 +#: src/datamash.c:918 src/datamash.c:935 src/datamash.c:941 #, c-format msgid "" "line % (% fields):\n" @@ -546,7 +565,7 @@ "línea % (% campos):\n" " " -#: src/datamash.c:885 +#: src/datamash.c:924 #, c-format msgid "" "check failed: line % has % fields (expecting %)" @@ -554,7 +573,7 @@ "comprobación fallada: línea % tiene campos % (esperando " "%)" -#: src/datamash.c:908 +#: src/datamash.c:947 #, c-format msgid "" "check failed: line % has % fields (previous line had " @@ -563,74 +582,71 @@ "comprobación fallada: línea % tiene campos % (línea previa " "tuvo %)" -#: src/datamash.c:922 +#: src/datamash.c:961 #, c-format msgid "check failed: input had % lines (expecting %)" msgstr "" "comprobación fallada: entrad tuvo % líneas (esperando %)" -#: src/datamash.c:928 +#: src/datamash.c:967 #, c-format msgid "% line" msgid_plural "% lines" msgstr[0] "% de línea" msgstr[1] "% de líneas" -#: src/datamash.c:931 +#: src/datamash.c:970 #, c-format msgid "% field" msgid_plural "% fields" msgstr[0] "% de campo" msgstr[1] "% de campos" -#: src/datamash.c:1032 +#: src/datamash.c:1080 msgid "hash memory allocation error" msgstr "error asignación de memoria hash" -#: src/datamash.c:1099 -msgid "sort command too-long (please report this bug)" -msgstr "ordena órdenes demasiado largas (por favor boletine este defecto)" +#: src/datamash.c:1147 +msgid "-s and -z cannot be combined on this system" +msgstr "" -#: src/datamash.c:1105 +#: src/datamash.c:1181 msgid "failed to run 'sort': popen failed" msgstr "fallado al ejecutar «sort»: popen fallado" -#: src/datamash.c:1121 +#: src/datamash.c:1197 msgid "read error" msgstr "error de lectura" -#: src/datamash.c:1129 +#: src/datamash.c:1205 msgid "read error (on close)" msgstr "error de lectura (al cerrar)" -#: src/datamash.c:1222 src/datamash.c:1229 +#: src/datamash.c:1300 src/datamash.c:1307 src/datamash.c:1323 msgid "the delimiter must be a single character" msgstr "el delimitador debe ser un simple carácter" -#: src/datamash.c:1265 +#: src/datamash.c:1354 #, c-format msgid "missing operation specifiers" msgstr "faltan especificadores operativos" -#: src/datamash.c:1283 +#: src/datamash.c:1372 msgid "-H or --header-in must be used with named columns" msgstr "-H o --header-in debe ser empleada con columnas nombradas" #: src/decorate-functions.c:76 #, fuzzy, c-format -#| msgid "invalid numeric value" msgid "invalid empty roman numeral" msgstr "valor numérico inválido" #: src/decorate-functions.c:84 #, fuzzy, c-format -#| msgid "invalid numeric value '%s'" msgid "invalid roman numeral '%c' in %s" msgstr "valor numérico inválido «%s»" #: src/decorate-functions.c:120 #, fuzzy, c-format -#| msgid "invalid operand %s" msgid "invalid IPv4 address %s" msgstr "operando %s inválido" @@ -649,11 +665,24 @@ #: src/decorate-functions.c:165 #, fuzzy, c-format -#| msgid "invalid operand %s" msgid "invalid IPv6 address %s" msgstr "operando %s inválido" -#: src/decorate.c:140 +#: src/decorate-functions.c:192 +msgid "inet_pton failed for AF_INET and AF_INET6" +msgstr "" + +#: src/decorate-functions.c:196 +#, fuzzy, c-format +msgid "invalid IP address %s" +msgstr "operando %s inválido" + +#. This is a proper name. See the gettext manual, section Names. +#: src/decorate.c:42 +msgid "Assaf Gordon, Shawn Wagner and Erik Auerswald" +msgstr "" + +#: src/decorate.c:145 #, c-format msgid "" "Usage: %s [OPTION]... [INPUT]\n" @@ -662,29 +691,29 @@ "\n" msgstr "" -#: src/decorate.c:147 +#: src/decorate.c:152 msgid "Converts (and optionally sorts) fields of various formats\n" msgstr "" -#: src/decorate.c:153 +#: src/decorate.c:158 msgid "" "With --decorate: adds the converted fields to the start\n" "of each line and prints and prints it to STDOUT; does not sort.\n" msgstr "" -#: src/decorate.c:160 +#: src/decorate.c:165 msgid "" "With --undecorate: removes the first N fields from the input;\n" "Use as post-processing step after sort(1).\n" msgstr "" -#: src/decorate.c:167 +#: src/decorate.c:172 msgid "" "Without --decorate and --undecorate: automatically decorates the input,\n" "runs sort(1) and undecorates the result; This is the easiest method to use.\n" msgstr "" -#: src/decorate.c:179 +#: src/decorate.c:190 msgid "" " --decorate decorate/convert the specified fields and " "print\n" @@ -693,13 +722,13 @@ " sort(1) or undecorates the output\n" msgstr "" -#: src/decorate.c:184 +#: src/decorate.c:195 msgid "" " --header=N does not decorate or sort the first N lines\n" " -H same as --header=N\n" msgstr "" -#: src/decorate.c:188 +#: src/decorate.c:199 msgid "" " -k, --key=KEYDEF key/field to sort; same syntax as sort(1),\n" " optionally followed by ':method' to convert\n" @@ -708,17 +737,15 @@ " and available conversion below\n" msgstr "" -#: src/decorate.c:194 +#: src/decorate.c:205 #, fuzzy -#| msgid "" -#| " -t, --field-separator=X use X instead of TAB as field delimiter\n" msgid "" " -t, --field-separator=SEP use SEP instead of non-blank to blank " "transition\n" msgstr "" " -t, --field-separator=X utiliza X en vez de TAB como campo delimitador\n" -#: src/decorate.c:197 +#: src/decorate.c:208 msgid "" " --print-sort-args print adjusted parameters for sort(1); Useful\n" " when using --decorate and then manually " @@ -726,26 +753,25 @@ " sort(1)\n" msgstr "" -#: src/decorate.c:202 +#: src/decorate.c:213 #, fuzzy -#| msgid "" -#| " --no-strict allow lines with varying number of fields\n" msgid " --undecorate=N removes the first N fields\n" msgstr "" " --no-strict permite líneas con número variable de campos\n" -#: src/decorate.c:205 +#: src/decorate.c:216 #, fuzzy -#| msgid " -z, --zero-terminated end lines with 0 byte, not newline\n" msgid " -z, --zero-terminated line delimiter is NUL, not newline\n" msgstr "" " -z, --zero-terminated finaliza líneas con 0 byte, no líneas nuevas\n" -#: src/decorate.c:213 -msgid "The following options are passed to sort(1) as-is:\n" +#: src/decorate.c:227 +msgid "" +"The following options are passed to sort as-is (Most of them assume GNU " +"sort):\n" msgstr "" -#: src/decorate.c:219 +#: src/decorate.c:234 msgid "" " -c, --check\n" " --compress-program\n" @@ -758,226 +784,219 @@ " --parallel\n" msgstr "" -#: src/decorate.c:234 +#: src/decorate.c:249 msgid "Available conversions methods (use with -k):\n" msgstr "" -#: src/decorate.c:246 +#: src/decorate.c:261 #, fuzzy -#| msgid "Examples:" msgid "Examples:\n" msgstr "Ejemplos:" -#: src/decorate.c:252 +#: src/decorate.c:267 msgid "The following two invocations are equivalent:\n" msgstr "" -#: src/decorate.c:267 +#: src/decorate.c:282 msgid "Decorated output of roman numerals:\n" msgstr "" -#: src/decorate.c:431 +#: src/decorate.c:446 msgid "fwrite (header line) failed" msgstr "" -#: src/decorate.c:439 +#: src/decorate.c:454 msgid "fflush (header line) failed" msgstr "" -#: src/decorate.c:445 +#: src/decorate.c:460 #, c-format -msgid "conversion failed in line %zu" +msgid "conversion failed in line %" msgstr "" -#: src/decorate.c:451 +#: src/decorate.c:467 msgid "decorate: fwrite failed" msgstr "" -#: src/decorate.c:457 src/decorate.c:519 +#: src/decorate.c:473 src/decorate.c:535 #, c-format msgid "error reading %s" msgstr "" -#: src/decorate.c:538 +#: src/decorate.c:554 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number at field start" msgstr "valor numérico inválido «%s»" -#: src/decorate.c:543 src/decorate.c:571 +#: src/decorate.c:559 src/decorate.c:587 msgid "field number is zero" msgstr "" -#: src/decorate.c:548 src/decorate.c:576 +#: src/decorate.c:564 src/decorate.c:592 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number after '.'" msgstr "valor numérico inválido «%s»" -#: src/decorate.c:552 +#: src/decorate.c:568 msgid "character offset is zero" msgstr "" -#: src/decorate.c:567 +#: src/decorate.c:583 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number after ','" msgstr "valor numérico inválido «%s»" -#: src/decorate.c:603 +#: src/decorate.c:619 msgid "missing external conversion command" msgstr "" -#: src/decorate.c:618 +#: src/decorate.c:634 msgid "missing internal conversion function" msgstr "" -#: src/decorate.c:630 +#: src/decorate.c:646 #, fuzzy -#| msgid "invalid field pair for operation %s" msgid "invalid built-in conversion option" msgstr "campo no válido para operación %s" -#: src/decorate.c:641 +#: src/decorate.c:657 msgid "" "ordering flags (b/d/i/h/n/g/M/R/V) cannot be combined with a conversion " "function" msgstr "" -#: src/decorate.c:671 +#: src/decorate.c:687 #, fuzzy -#| msgid "invalid operation %s" msgid "invalid key specification" msgstr "operación %s no válida" -#: src/decorate.c:853 +#: src/decorate.c:890 #, fuzzy, c-format -#| msgid "invalid numeric value '%s'" msgid "invalid number of header lines %s" msgstr "valor numérico inválido «%s»" -#: src/decorate.c:907 +#: src/decorate.c:948 msgid "empty tab" msgstr "" -#: src/decorate.c:918 +#: src/decorate.c:959 #, c-format msgid "multi-character tab %s" msgstr "" -#: src/decorate.c:923 +#: src/decorate.c:964 msgid "incompatible tabs" msgstr "" -#: src/decorate.c:945 +#: src/decorate.c:986 #, fuzzy, c-format -#| msgid "invalid field '%s' for operation %s" msgid "invalid number of fields to undecorate %s" msgstr "campo no válido «%s» para operación %s" -#: src/decorate.c:968 +#: src/decorate.c:1009 msgid "--decorate and --undecorate options are mutually exclusive" msgstr "" -#: src/decorate.c:972 +#: src/decorate.c:1013 msgid "--undecorate cannot be used with --keys or --decorate" msgstr "" -#: src/decorate.c:976 +#: src/decorate.c:1017 msgid "missing -k/--key decoration or --undecorate options" msgstr "" -#: src/decorate.c:985 +#: src/decorate.c:1026 msgid "no decorated keys specified. use sort instead" msgstr "" -#: src/decorate.c:1024 +#: src/decorate.c:1060 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to create dec-sort pipe" msgstr "fallado al ejecutar «sort»: popen fallado" -#: src/decorate.c:1026 +#: src/decorate.c:1062 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to create sort-undec pipe" msgstr "fallado al ejecutar «sort»: popen fallado" -#: src/decorate.c:1033 +#: src/decorate.c:1069 msgid "failed to fork-1" msgstr "" -#: src/decorate.c:1040 +#: src/decorate.c:1076 msgid "failed to fork-2" msgstr "" -#: src/decorate.c:1052 src/decorate.c:1101 +#: src/decorate.c:1088 src/decorate.c:1137 msgid "failed to close sort-undec read-pipe" msgstr "" -#: src/decorate.c:1055 src/decorate.c:1140 +#: src/decorate.c:1091 src/decorate.c:1176 msgid "failed to close sort-undec write-pipe" msgstr "" -#: src/decorate.c:1057 src/decorate.c:1135 +#: src/decorate.c:1093 src/decorate.c:1171 msgid "failed to close dec-sort read-pipe" msgstr "" -#: src/decorate.c:1066 +#: src/decorate.c:1102 msgid "failed to dup STDOUT fd" msgstr "" -#: src/decorate.c:1069 +#: src/decorate.c:1105 msgid "fdopen (dup (stdout)) failed" msgstr "" -#: src/decorate.c:1074 +#: src/decorate.c:1110 msgid "failed to reassign dec-sort STDOUT" msgstr "" -#: src/decorate.c:1098 src/decorate.c:1137 +#: src/decorate.c:1134 src/decorate.c:1173 msgid "failed to close dec-sort write-pipe" msgstr "" -#: src/decorate.c:1106 +#: src/decorate.c:1142 msgid "failed to reassign dec-sort STDIN" msgstr "" -#: src/decorate.c:1112 +#: src/decorate.c:1148 msgid "failed to reassign sort-undec STDOUT" msgstr "" -#: src/decorate.c:1126 +#: src/decorate.c:1162 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to run the sort command" msgstr "fallado al ejecutar «sort»: popen fallado" -#: src/decorate.c:1144 +#: src/decorate.c:1180 msgid "failed to reassign sort-undec STDIN" msgstr "" -#: src/double-format.c:49 +#: src/double-format.c:45 +msgid "numeric format too large" +msgstr "" + +#: src/double-format.c:54 #, c-format msgid "format %s has no %% directive" msgstr "" -#: src/double-format.c:62 +#: src/double-format.c:67 #, c-format msgid "format %s missing valid type after '%%'" msgstr "" -#: src/double-format.c:66 +#: src/double-format.c:71 #, c-format msgid "format %s has unknown/invalid type %%%c directive" msgstr "" -#: src/double-format.c:79 +#: src/double-format.c:84 #, c-format msgid "format %s has too many %% directives" msgstr "" -#: src/field-ops.c:346 +#: src/field-ops.c:351 #, c-format msgid "" "input error for operation %s: fields %,% have different " @@ -986,17 +1005,16 @@ "error entrante para operación %s: campos %,% tienen " "número diferente de ítemes" -#: src/field-ops.c:1176 +#: src/field-ops.c:1199 msgid "invalid numeric value" msgstr "valor numérico inválido" -#: src/field-ops.c:1178 +#: src/field-ops.c:1201 msgid "invalid base64 value" msgstr "valor base64 no válido" #: src/key-compare.c:305 #, fuzzy, c-format -#| msgid "invalid field pair for operation %s" msgid "%s: invalid field specification %s" msgstr "campo no válido para operación %s" @@ -1027,7 +1045,6 @@ #: src/op-parser.c:243 #, fuzzy, c-format -#| msgid "invalid numeric value '%s'" msgid "invalid getnum type '%c'" msgstr "valor numérico inválido «%s»" @@ -1082,7 +1099,7 @@ msgid "conflicting operation %s" msgstr "conflicto operativo %s" -#: src/op-parser.c:499 src/op-parser.c:752 +#: src/op-parser.c:499 src/op-parser.c:758 #, c-format msgid "invalid operation %s" msgstr "operación %s no válida" @@ -1122,21 +1139,21 @@ msgid "crosstab requires exactly 2 fields, found %" msgstr "cruce requiere exactamente 2 campos, encontrados %" -#: src/op-parser.c:705 +#: src/op-parser.c:711 #, c-format msgid "crosstab supports one operation, found %" msgstr "cruce soportes una operación, encontrada %" -#: src/op-parser.c:714 +#: src/op-parser.c:720 msgid "missing operation" msgstr "operación ausente" -#: src/op-parser.c:728 +#: src/op-parser.c:734 #, c-format msgid "extra operand %s" msgstr "operando adicional %s" -#: src/op-parser.c:865 src/op-scanner.c:237 +#: src/op-parser.c:874 src/op-scanner.c:237 msgid "missing script (among arguments)" msgstr "falta script (entre argumentos)" @@ -1176,17 +1193,30 @@ msgid "Try '%s --help' for more information.\n" msgstr "Pruebe «%s --help» para más información.\n" -#: src/text-options.c:111 +#: src/text-options.c:109 msgid "missing rounding digits value" msgstr "" -#: src/text-options.c:116 +#: src/text-options.c:114 #, fuzzy, c-format -#| msgid "invalid numeric value '%s'" msgid "invalid rounding digits value %s" msgstr "valor numérico inválido «%s»" -#, fuzzy -#~| msgid "%s home page: \n" -#~ msgid "%s home page: \n" +#~ msgid "Assaf Gordon" +#~ msgstr "Assaf Gordon" + +#~ msgid "" +#~ " -f, --full print entire input line before op results\n" +#~ " (default: print only the grouped keys)\n" +#~ msgstr "" +#~ " -f, --full escribe línea de entrada completa antes de " +#~ "resultados op\n" +#~ " (por omisión: solo escribe claves " +#~ "agrupadas)\n" + +#, c-format +#~ msgid "%s home page: \n" #~ msgstr "Página inicial %s: \n" + +#~ msgid "sort command too-long (please report this bug)" +#~ msgstr "ordena órdenes demasiado largas (por favor boletine este defecto)" Binary files /tmp/tmpk9ju3y2l/uqkwDqQpWf/datamash-1.7/po/fr.gmo and /tmp/tmpk9ju3y2l/ut88G7BZjZ/datamash-1.8/po/fr.gmo differ diff -Nru datamash-1.7/po/fr.po datamash-1.8/po/fr.po --- datamash-1.7/po/fr.po 2020-04-23 17:34:24.000000000 +0000 +++ datamash-1.8/po/fr.po 2022-07-23 01:57:18.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: GNU datamash 1.4.12.1\n" "Report-Msgid-Bugs-To: bug-datamash@gnu.org\n" -"POT-Creation-Date: 2020-04-23 11:34-0600\n" +"POT-Creation-Date: 2022-07-23 11:57+1000\n" "PO-Revision-Date: 2019-09-02 20:39+0200\n" "Last-Translator: Frédéric Marchal \n" "Language-Team: French \n" @@ -82,11 +82,11 @@ #. If you don't know what to put here, please see #. #. and use glyphs suitable for your language. -#: lib/quotearg.c:362 +#: lib/quotearg.c:355 msgid "`" msgstr "« " -#: lib/quotearg.c:363 +#: lib/quotearg.c:356 msgid "'" msgstr " »" @@ -276,27 +276,27 @@ msgstr "argument de %s%s « %s » trop grand" #. This is a proper name. See the gettext manual, section Names. -#: src/datamash.c:65 src/decorate.c:41 -msgid "Assaf Gordon" -msgstr "Assaf Gordon" +#: src/datamash.c:66 +msgid "Assaf Gordon, Tim Rice, Shawn Wagner, Erik Auerswald" +msgstr "" -#: src/datamash.c:161 src/datamash.c:504 +#: src/datamash.c:169 src/datamash.c:539 #, 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:182 #, c-format 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:185 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." -#: src/datamash.c:180 +#: src/datamash.c:188 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" @@ -305,7 +305,7 @@ "elle doit être listée en premier. Elle peut être suivie d'autres " "opérations.\n" -#: src/datamash.c:183 +#: src/datamash.c:191 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" @@ -314,7 +314,7 @@ "(1=premier champ),\n" "ou un nom de champ lorsque les options -H ou --header-in sont utilisés.\n" -#: src/datamash.c:186 +#: src/datamash.c:194 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" @@ -327,35 +327,39 @@ "pour les opérations qui requièrent une paire de champs (par ex « pcov " "2:6 »).\n" -#: src/datamash.c:191 +#: src/datamash.c:199 msgid "Primary operations:\n" msgstr "Opérations primaires:\n" -#: src/datamash.c:194 +#: src/datamash.c:202 msgid "Line-Filtering operations:\n" msgstr "Opérations de filtrage des lignes:\n" -#: src/datamash.c:197 +#: src/datamash.c:205 msgid "Per-Line operations:\n" msgstr "Opérations sur les lignes:\n" -#: src/datamash.c:203 +#: src/datamash.c:211 msgid "Numeric Grouping operations:\n" msgstr "Opérations de groupement numériques:\n" -#: src/datamash.c:206 +#: src/datamash.c:214 msgid "Textual/Numeric Grouping operations:\n" msgstr "Opérations de groupement Textuels/Numériques:\n" -#: src/datamash.c:210 +#: src/datamash.c:218 msgid "Statistical Grouping operations:\n" msgstr "Opérations de groupement statistiques:\n" -#: src/datamash.c:219 +#: src/datamash.c:227 src/decorate.c:179 +msgid "Options:\n" +msgstr "Options:\n" + +#: src/datamash.c:229 msgid "Grouping Options:\n" msgstr "Options de groupement:\n" -#: src/datamash.c:220 +#: src/datamash.c:230 msgid "" " -C, --skip-comments skip comment lines (starting with '#' or ';'\n" " and optional whitespace)\n" @@ -364,17 +368,17 @@ "(démarrant avec « # » ou « ; »\n" " et le blanc optionnel)\n" -#: src/datamash.c:224 +#: src/datamash.c:234 msgid "" " -f, --full print entire input line before op results\n" " (default: print only the grouped keys)\n" +" This option is only sensible for linewise\n" +" operations. Other uses are deprecated and\n" +" will be removed in a future version of GNU\n" +" Datamash.\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" -#: src/datamash.c:228 +#: src/datamash.c:242 msgid "" " -g, --group=X[,Y,Z] group via fields X,[Y,Z];\n" " equivalent to primary operation 'groupby'\n" @@ -382,23 +386,23 @@ " -g, --group=X[,Y,Z] groupe selon les champs X,[Y,Z];\n" " équivalent à l'opération primaire « groupby »\n" -#: src/datamash.c:232 +#: src/datamash.c:246 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" -#: src/datamash.c:235 +#: src/datamash.c:249 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" -#: src/datamash.c:238 +#: src/datamash.c:252 msgid " -H, --headers same as '--header-in --header-out'\n" msgstr " -H, --headers identique à « --header-in --header-out »\n" -#: src/datamash.c:241 +#: src/datamash.c:255 msgid "" " -i, --ignore-case ignore upper/lower case when comparing text;\n" " this affects grouping, and string operations\n" @@ -408,7 +412,7 @@ " ceci affecte le groupement et les opérations " "textuelles\n" -#: src/datamash.c:245 +#: src/datamash.c:259 msgid "" " -s, --sort sort the input before grouping; this removes " "the\n" @@ -421,34 +425,45 @@ "entrées avec\n" " « sort »\n" -#: src/datamash.c:250 +#: src/datamash.c:263 +#, fuzzy +msgid "" +" -c, --collapse-delimiter=X use X to separate elements in collapse and\n" +" unique lists (default: comma)\n" +msgstr "" +" --output-delimiter=X utiliser X comme délimiteur des champs de " +"sortie\n" +" (par défaut : utiliser le même délimiteur que -" +"t/-W)\n" + +#: src/datamash.c:268 msgid "File Operation Options:\n" msgstr "Options des opérations sur les fichiers:\n" -#: src/datamash.c:251 +#: src/datamash.c:269 msgid " --no-strict allow lines with varying number of fields\n" msgstr "" " --no-strict accepter des lignes avec des nombres variables " "de champs\n" -#: src/datamash.c:254 +#: src/datamash.c:272 #, 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" -#: src/datamash.c:259 src/decorate.c:174 +#: src/datamash.c:277 src/decorate.c:185 msgid "General Options:\n" msgstr "Options générales:\n" -#: src/datamash.c:260 +#: src/datamash.c:278 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" -#: src/datamash.c:263 +#: src/datamash.c:281 msgid "" " --format=FORMAT print numeric values with printf style\n" " floating-point FORMAT.\n" @@ -456,7 +471,7 @@ " --format=FORMAT afficher les valeurs numériques avec le style\n" " en virgule flottante de printf FORMAT.\n" -#: src/datamash.c:267 +#: src/datamash.c:285 msgid "" " --output-delimiter=X use X instead as output field delimiter\n" " (default: use same delimiter as -t/-W)\n" @@ -466,17 +481,17 @@ " (par défaut : utiliser le même délimiteur que -" "t/-W)\n" -#: src/datamash.c:271 +#: src/datamash.c:289 msgid " --narm skip NA/NaN values\n" msgstr " --narm passe outre les valeurs NA/NaN\n" -#: src/datamash.c:274 +#: src/datamash.c:292 msgid " -R, --round=N round numeric output to N decimal places\n" msgstr "" " -R, --round=N arrondir la sortie numérique à N chiffres " "décimaux\n" -#: src/datamash.c:277 +#: src/datamash.c:295 msgid "" " -W, --whitespace use whitespace (one or more spaces and/or tabs)\n" " for field delimiters\n" @@ -485,35 +500,47 @@ "tabulations)\n" " comme délimiteurs de champs\n" -#: src/datamash.c:281 +#: src/datamash.c:299 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" -#: src/datamash.c:290 +#: src/datamash.c:302 src/decorate.c:219 +msgid " --sort-cmd=/path/to/sort Alternative sort(1) to use.\n" +msgstr "" + +#: src/datamash.c:311 +msgid "Environment:" +msgstr "" + +#: src/datamash.c:313 +msgid " LC_NUMERIC decimal-point character and thousands separator\n" +msgstr "" + +#: src/datamash.c:319 msgid "Examples:" msgstr "Exemples:" -#: src/datamash.c:292 +#: src/datamash.c:321 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:297 +#: src/datamash.c:326 msgid "Transpose input:" msgstr "Transposer l'entrée:" -#: src/datamash.c:304 src/decorate.c:287 +#: src/datamash.c:333 src/decorate.c:302 msgid "For detailed usage information and examples, see\n" msgstr "" "Pour des informations détaillées sur l'utilisation et des exemples, " "consultez\n" -#: src/datamash.c:306 src/decorate.c:289 +#: src/datamash.c:335 src/decorate.c:304 msgid "The manual and more examples are available at\n" msgstr "Le manuel et plus d'exemples sont disponibles sur\n" -#: src/datamash.c:315 +#: src/datamash.c:344 #, c-format msgid "" "invalid input: field % requested, line % has only " @@ -522,12 +549,18 @@ "entrée invalide: champ % requis, ligne % a seulement " "% champs" -#: src/datamash.c:385 +#: src/datamash.c:414 #, c-format msgid "%s in line % field %: '%s'" msgstr "%s à la ligne % champ %: « %s »" -#: src/datamash.c:713 +#: src/datamash.c:656 +msgid "" +"datamash: Using -f/--full with non-linewise operations is deprecated and " +"will be disabled in a future release.\n" +msgstr "" + +#: src/datamash.c:752 #, c-format msgid "" "transpose input error: line % has % fields (previous lines " @@ -538,7 +571,7 @@ "(les lignes précédentes en avaient %);\n" "voyez --help pour désactiver le mode strict" -#: src/datamash.c:770 +#: src/datamash.c:809 #, c-format msgid "" "reverse-field input error: line % has % fields (previous " @@ -549,7 +582,7 @@ "champs (les lignes précédentes en avaient %);\n" "voyez --help pour désactiver le mode strict" -#: src/datamash.c:879 src/datamash.c:896 src/datamash.c:902 +#: src/datamash.c:918 src/datamash.c:935 src/datamash.c:941 #, c-format msgid "" "line % (% fields):\n" @@ -558,7 +591,7 @@ "ligne % (% champs):\n" " " -#: src/datamash.c:885 +#: src/datamash.c:924 #, c-format msgid "" "check failed: line % has % fields (expecting %)" @@ -566,7 +599,7 @@ "échec de vérification: ligne % a % champs (% " "attendus)" -#: src/datamash.c:908 +#: src/datamash.c:947 #, c-format msgid "" "check failed: line % has % fields (previous line had " @@ -575,75 +608,72 @@ "échec de vérification: ligne % a % champs (ligne " "précédente avait %)" -#: src/datamash.c:922 +#: src/datamash.c:961 #, c-format msgid "check failed: input had % lines (expecting %)" msgstr "" "échec de vérification: l'entrée avait % lignes (% " "attendues)" -#: src/datamash.c:928 +#: src/datamash.c:967 #, c-format msgid "% line" msgid_plural "% lines" msgstr[0] "% ligne" msgstr[1] "% lignes" -#: src/datamash.c:931 +#: src/datamash.c:970 #, c-format msgid "% field" msgid_plural "% fields" msgstr[0] "% champ" msgstr[1] "% champs" -#: src/datamash.c:1032 +#: src/datamash.c:1080 msgid "hash memory allocation error" msgstr "erreur d'allocation de la mémoire de hachage" -#: src/datamash.c:1099 -msgid "sort command too-long (please report this bug)" -msgstr "commande tri trop longue (veuillez signaler ce bogue)" +#: src/datamash.c:1147 +msgid "-s and -z cannot be combined on this system" +msgstr "" -#: src/datamash.c:1105 +#: src/datamash.c:1181 msgid "failed to run 'sort': popen failed" msgstr "échec à l'exécution de « sort »: popen a échoué" -#: src/datamash.c:1121 +#: src/datamash.c:1197 msgid "read error" msgstr "erreur de lecture" -#: src/datamash.c:1129 +#: src/datamash.c:1205 msgid "read error (on close)" msgstr "erreur de lecture (à la fermeture)" -#: src/datamash.c:1222 src/datamash.c:1229 +#: src/datamash.c:1300 src/datamash.c:1307 src/datamash.c:1323 msgid "the delimiter must be a single character" msgstr "le délimiteur doit être un caractère unique" -#: src/datamash.c:1265 +#: src/datamash.c:1354 #, c-format msgid "missing operation specifiers" msgstr "spécificateurs d'opération manquant" -#: src/datamash.c:1283 +#: src/datamash.c:1372 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/decorate-functions.c:76 #, fuzzy, c-format -#| msgid "invalid empty grouping parameter" msgid "invalid empty roman numeral" msgstr "paramètre de groupement vide invalide" #: src/decorate-functions.c:84 #, fuzzy, c-format -#| msgid "invalid numeric value '%s'" msgid "invalid roman numeral '%c' in %s" msgstr "valeur numérique invalide « %s »" #: src/decorate-functions.c:120 #, fuzzy, c-format -#| msgid "invalid operand %s" msgid "invalid IPv4 address %s" msgstr "opérande « %s » invalide" @@ -662,11 +692,24 @@ #: src/decorate-functions.c:165 #, fuzzy, c-format -#| msgid "invalid operand %s" msgid "invalid IPv6 address %s" msgstr "opérande « %s » invalide" -#: src/decorate.c:140 +#: src/decorate-functions.c:192 +msgid "inet_pton failed for AF_INET and AF_INET6" +msgstr "" + +#: src/decorate-functions.c:196 +#, fuzzy, c-format +msgid "invalid IP address %s" +msgstr "opérande « %s » invalide" + +#. This is a proper name. See the gettext manual, section Names. +#: src/decorate.c:42 +msgid "Assaf Gordon, Shawn Wagner and Erik Auerswald" +msgstr "" + +#: src/decorate.c:145 #, c-format msgid "" "Usage: %s [OPTION]... [INPUT]\n" @@ -675,29 +718,29 @@ "\n" msgstr "" -#: src/decorate.c:147 +#: src/decorate.c:152 msgid "Converts (and optionally sorts) fields of various formats\n" msgstr "" -#: src/decorate.c:153 +#: src/decorate.c:158 msgid "" "With --decorate: adds the converted fields to the start\n" "of each line and prints and prints it to STDOUT; does not sort.\n" msgstr "" -#: src/decorate.c:160 +#: src/decorate.c:165 msgid "" "With --undecorate: removes the first N fields from the input;\n" "Use as post-processing step after sort(1).\n" msgstr "" -#: src/decorate.c:167 +#: src/decorate.c:172 msgid "" "Without --decorate and --undecorate: automatically decorates the input,\n" "runs sort(1) and undecorates the result; This is the easiest method to use.\n" msgstr "" -#: src/decorate.c:179 +#: src/decorate.c:190 msgid "" " --decorate decorate/convert the specified fields and " "print\n" @@ -706,13 +749,13 @@ " sort(1) or undecorates the output\n" msgstr "" -#: src/decorate.c:184 +#: src/decorate.c:195 msgid "" " --header=N does not decorate or sort the first N lines\n" " -H same as --header=N\n" msgstr "" -#: src/decorate.c:188 +#: src/decorate.c:199 msgid "" " -k, --key=KEYDEF key/field to sort; same syntax as sort(1),\n" " optionally followed by ':method' to convert\n" @@ -721,10 +764,8 @@ " and available conversion below\n" msgstr "" -#: src/decorate.c:194 +#: src/decorate.c:205 #, fuzzy -#| msgid "" -#| " -t, --field-separator=X use X instead of TAB as field delimiter\n" msgid "" " -t, --field-separator=SEP use SEP instead of non-blank to blank " "transition\n" @@ -732,7 +773,7 @@ " -t, --field-separator=X utiliser X au lieu de la tabulation comme " "délimiteur de champs\n" -#: src/decorate.c:197 +#: src/decorate.c:208 msgid "" " --print-sort-args print adjusted parameters for sort(1); Useful\n" " when using --decorate and then manually " @@ -740,28 +781,27 @@ " sort(1)\n" msgstr "" -#: src/decorate.c:202 +#: src/decorate.c:213 #, fuzzy -#| msgid "" -#| " --no-strict allow lines with varying number of fields\n" msgid " --undecorate=N removes the first N fields\n" msgstr "" " --no-strict accepter des lignes avec des nombres variables " "de champs\n" -#: src/decorate.c:205 +#: src/decorate.c:216 #, fuzzy -#| msgid " -z, --zero-terminated end lines with 0 byte, not newline\n" msgid " -z, --zero-terminated line delimiter is NUL, not newline\n" msgstr "" " -z, --zero-terminated terminer les lignes avec l'octet 0, pas un saut " "de ligne\n" -#: src/decorate.c:213 -msgid "The following options are passed to sort(1) as-is:\n" +#: src/decorate.c:227 +msgid "" +"The following options are passed to sort as-is (Most of them assume GNU " +"sort):\n" msgstr "" -#: src/decorate.c:219 +#: src/decorate.c:234 msgid "" " -c, --check\n" " --compress-program\n" @@ -774,226 +814,219 @@ " --parallel\n" msgstr "" -#: src/decorate.c:234 +#: src/decorate.c:249 msgid "Available conversions methods (use with -k):\n" msgstr "" -#: src/decorate.c:246 +#: src/decorate.c:261 #, fuzzy -#| msgid "Examples:" msgid "Examples:\n" msgstr "Exemples:" -#: src/decorate.c:252 +#: src/decorate.c:267 msgid "The following two invocations are equivalent:\n" msgstr "" -#: src/decorate.c:267 +#: src/decorate.c:282 msgid "Decorated output of roman numerals:\n" msgstr "" -#: src/decorate.c:431 +#: src/decorate.c:446 msgid "fwrite (header line) failed" msgstr "" -#: src/decorate.c:439 +#: src/decorate.c:454 msgid "fflush (header line) failed" msgstr "" -#: src/decorate.c:445 +#: src/decorate.c:460 #, c-format -msgid "conversion failed in line %zu" +msgid "conversion failed in line %" msgstr "" -#: src/decorate.c:451 +#: src/decorate.c:467 msgid "decorate: fwrite failed" msgstr "" -#: src/decorate.c:457 src/decorate.c:519 +#: src/decorate.c:473 src/decorate.c:535 #, c-format msgid "error reading %s" msgstr "" -#: src/decorate.c:538 +#: src/decorate.c:554 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number at field start" msgstr "valeur numérique invalide « %s »" -#: src/decorate.c:543 src/decorate.c:571 +#: src/decorate.c:559 src/decorate.c:587 msgid "field number is zero" msgstr "" -#: src/decorate.c:548 src/decorate.c:576 +#: src/decorate.c:564 src/decorate.c:592 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number after '.'" msgstr "valeur numérique invalide « %s »" -#: src/decorate.c:552 +#: src/decorate.c:568 msgid "character offset is zero" msgstr "" -#: src/decorate.c:567 +#: src/decorate.c:583 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number after ','" msgstr "valeur numérique invalide « %s »" -#: src/decorate.c:603 +#: src/decorate.c:619 msgid "missing external conversion command" msgstr "" -#: src/decorate.c:618 +#: src/decorate.c:634 msgid "missing internal conversion function" msgstr "" -#: src/decorate.c:630 +#: src/decorate.c:646 #, fuzzy -#| msgid "invalid field pair for operation %s" msgid "invalid built-in conversion option" msgstr "paire de champs invalide pour l'opération %s" -#: src/decorate.c:641 +#: src/decorate.c:657 msgid "" "ordering flags (b/d/i/h/n/g/M/R/V) cannot be combined with a conversion " "function" msgstr "" -#: src/decorate.c:671 +#: src/decorate.c:687 #, fuzzy -#| msgid "invalid operation %s" msgid "invalid key specification" msgstr "opération %s invalide" -#: src/decorate.c:853 +#: src/decorate.c:890 #, fuzzy, c-format -#| msgid "invalid numeric value '%s'" msgid "invalid number of header lines %s" msgstr "valeur numérique invalide « %s »" -#: src/decorate.c:907 +#: src/decorate.c:948 msgid "empty tab" msgstr "" -#: src/decorate.c:918 +#: src/decorate.c:959 #, c-format msgid "multi-character tab %s" msgstr "" -#: src/decorate.c:923 +#: src/decorate.c:964 msgid "incompatible tabs" msgstr "" -#: src/decorate.c:945 +#: src/decorate.c:986 #, fuzzy, c-format -#| msgid "invalid field '%s' for operation %s" msgid "invalid number of fields to undecorate %s" msgstr "champ « %s » invalide pour l'opération %s" -#: src/decorate.c:968 +#: src/decorate.c:1009 msgid "--decorate and --undecorate options are mutually exclusive" msgstr "" -#: src/decorate.c:972 +#: src/decorate.c:1013 msgid "--undecorate cannot be used with --keys or --decorate" msgstr "" -#: src/decorate.c:976 +#: src/decorate.c:1017 msgid "missing -k/--key decoration or --undecorate options" msgstr "" -#: src/decorate.c:985 +#: src/decorate.c:1026 msgid "no decorated keys specified. use sort instead" msgstr "" -#: src/decorate.c:1024 +#: src/decorate.c:1060 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to create dec-sort pipe" msgstr "échec à l'exécution de « sort »: popen a échoué" -#: src/decorate.c:1026 +#: src/decorate.c:1062 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to create sort-undec pipe" msgstr "échec à l'exécution de « sort »: popen a échoué" -#: src/decorate.c:1033 +#: src/decorate.c:1069 msgid "failed to fork-1" msgstr "" -#: src/decorate.c:1040 +#: src/decorate.c:1076 msgid "failed to fork-2" msgstr "" -#: src/decorate.c:1052 src/decorate.c:1101 +#: src/decorate.c:1088 src/decorate.c:1137 msgid "failed to close sort-undec read-pipe" msgstr "" -#: src/decorate.c:1055 src/decorate.c:1140 +#: src/decorate.c:1091 src/decorate.c:1176 msgid "failed to close sort-undec write-pipe" msgstr "" -#: src/decorate.c:1057 src/decorate.c:1135 +#: src/decorate.c:1093 src/decorate.c:1171 msgid "failed to close dec-sort read-pipe" msgstr "" -#: src/decorate.c:1066 +#: src/decorate.c:1102 msgid "failed to dup STDOUT fd" msgstr "" -#: src/decorate.c:1069 +#: src/decorate.c:1105 msgid "fdopen (dup (stdout)) failed" msgstr "" -#: src/decorate.c:1074 +#: src/decorate.c:1110 msgid "failed to reassign dec-sort STDOUT" msgstr "" -#: src/decorate.c:1098 src/decorate.c:1137 +#: src/decorate.c:1134 src/decorate.c:1173 msgid "failed to close dec-sort write-pipe" msgstr "" -#: src/decorate.c:1106 +#: src/decorate.c:1142 msgid "failed to reassign dec-sort STDIN" msgstr "" -#: src/decorate.c:1112 +#: src/decorate.c:1148 msgid "failed to reassign sort-undec STDOUT" msgstr "" -#: src/decorate.c:1126 +#: src/decorate.c:1162 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to run the sort command" msgstr "échec à l'exécution de « sort »: popen a échoué" -#: src/decorate.c:1144 +#: src/decorate.c:1180 msgid "failed to reassign sort-undec STDIN" msgstr "" -#: src/double-format.c:49 +#: src/double-format.c:45 +msgid "numeric format too large" +msgstr "" + +#: src/double-format.c:54 #, c-format msgid "format %s has no %% directive" msgstr "le format %s n'a pas de directive %%" -#: src/double-format.c:62 +#: src/double-format.c:67 #, c-format msgid "format %s missing valid type after '%%'" msgstr "le format %s n'a pas de type valide après « %% »" -#: src/double-format.c:66 +#: src/double-format.c:71 #, c-format msgid "format %s has unknown/invalid type %%%c directive" msgstr "le format %s a la directive de type %%%c inconnue/invalide" -#: src/double-format.c:79 +#: src/double-format.c:84 #, c-format msgid "format %s has too many %% directives" msgstr "le format %s a trop de directives %%" -#: src/field-ops.c:346 +#: src/field-ops.c:351 #, c-format msgid "" "input error for operation %s: fields %,% have different " @@ -1002,17 +1035,16 @@ "erreur d'entrée pour l'opération %s: les champs %,% ont " "des nombres différents d'éléments" -#: src/field-ops.c:1176 +#: src/field-ops.c:1199 msgid "invalid numeric value" msgstr "valeur numérique invalide" -#: src/field-ops.c:1178 +#: src/field-ops.c:1201 msgid "invalid base64 value" msgstr "valeur base64 invalide" #: src/key-compare.c:305 #, fuzzy, c-format -#| msgid "invalid field pair for operation %s" msgid "%s: invalid field specification %s" msgstr "paire de champs invalide pour l'opération %s" @@ -1097,7 +1129,7 @@ msgid "conflicting operation %s" msgstr "opération %s conflictuelle" -#: src/op-parser.c:499 src/op-parser.c:752 +#: src/op-parser.c:499 src/op-parser.c:758 #, c-format msgid "invalid operation %s" msgstr "opération %s invalide" @@ -1137,21 +1169,21 @@ msgid "crosstab requires exactly 2 fields, found %" msgstr "crosstab requiert exactement 2 champs, % trouvés" -#: src/op-parser.c:705 +#: src/op-parser.c:711 #, c-format msgid "crosstab supports one operation, found %" msgstr "crosstab supporte une opération, % trouvée" -#: src/op-parser.c:714 +#: src/op-parser.c:720 msgid "missing operation" msgstr "opération manquante" -#: src/op-parser.c:728 +#: src/op-parser.c:734 #, c-format msgid "extra operand %s" msgstr "opérande en trop après %s" -#: src/op-parser.c:865 src/op-scanner.c:237 +#: src/op-parser.c:874 src/op-scanner.c:237 msgid "missing script (among arguments)" msgstr "script manquant (parmi les arguments)" @@ -1191,15 +1223,30 @@ msgid "Try '%s --help' for more information.\n" msgstr "Essayez « %s --help » pour plus d'informations.\n" -#: src/text-options.c:111 +#: src/text-options.c:109 msgid "missing rounding digits value" msgstr "valeur d'arrondi des décimales manquante" -#: src/text-options.c:116 +#: src/text-options.c:114 #, c-format msgid "invalid rounding digits value %s" msgstr "valeur d'arrondi des décimales %s invalide" +#~ msgid "Assaf Gordon" +#~ msgstr "Assaf Gordon" + +#~ 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" + +#~ msgid "sort command too-long (please report this bug)" +#~ msgstr "commande tri trop longue (veuillez signaler ce bogue)" + #~ msgid "%s home page: \n" #~ msgstr "site internet de %s: \n" @@ -1224,9 +1271,6 @@ #~ 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" diff -Nru datamash-1.7/po/Makefile.in.in datamash-1.8/po/Makefile.in.in --- datamash-1.7/po/Makefile.in.in 2020-04-23 17:34:04.000000000 +0000 +++ datamash-1.8/po/Makefile.in.in 2022-05-28 01:46:45.000000000 +0000 @@ -1,14 +1,15 @@ # Makefile for PO directory in any package using GNU gettext. -# Copyright (C) 1995-2000 Ulrich Drepper -# Copyright (C) 2000-2020 Free Software Foundation, Inc. +# Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper # -# 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. +# This file can be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU General Public +# License but which still want to provide support for the GNU gettext +# functionality. +# Please note that the actual code of GNU gettext is covered by the GNU +# General Public License and is *not* in the public domain. # -# Origin: gettext-0.20 -GETTEXT_MACRO_VERSION = 0.20 +# Origin: gettext-0.19 +GETTEXT_MACRO_VERSION = 0.19 PACKAGE = @PACKAGE@ VERSION = @VERSION@ @@ -44,22 +45,20 @@ 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@ GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) +MSGFMT_ = @MSGFMT@ +MSGFMT_no = @MSGFMT@ +MSGFMT_yes = @MSGFMT_015@ +MSGFMT = $(MSGFMT_$(USE_MSGCTXT)) XGETTEXT_ = @XGETTEXT@ XGETTEXT_no = @XGETTEXT@ XGETTEXT_yes = @XGETTEXT_015@ XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) -MSGMERGE = @MSGMERGE@ +MSGMERGE = msgmerge MSGMERGE_UPDATE = @MSGMERGE@ --update -MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ MSGINIT = msginit MSGCONV = msgconv MSGFILTER = msgfilter @@ -91,32 +90,17 @@ # Makevars gets inserted here. (Don't remove this line!) .SUFFIXES: -.SUFFIXES: .po .gmo .sed .sin .nop .po-create .po-update +.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update + +.po.mo: + @echo "$(MSGFMT) -c -o $@ $<"; \ + $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ -# The .pot file, stamp-po, .po files, and .gmo files appear in release tarballs. -# The GNU Coding Standards say in -# : -# "GNU distributions usually contain some files which are not source files -# ... . Since these files normally appear in the source directory, they -# should always appear in the source directory, not in the build directory. -# So Makefile rules to update them should put the updated files in the -# source directory." -# Therefore we put these files in the source directory, not the build directory. - -# During .po -> .gmo conversion, take into account the most recent changes to -# the .pot file. This eliminates the need to update the .po files when the -# .pot file has changed, which would be troublesome if the .po files are put -# under version control. -.po.gmo: $(srcdir)/$(DOMAIN).pot +.po.gmo: @lang=`echo $* | sed -e 's,.*/,,'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ - echo "$${cdcmd}rm -f $${lang}.gmo && $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.1po && rm -f $${lang}.1po"; \ - cd $(srcdir) && \ - rm -f $${lang}.gmo && \ - $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && \ - $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.1po && \ - mv t-$${lang}.gmo $${lang}.gmo && \ - rm -f $${lang}.1po + echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \ + cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo .sin.sed: sed -e '/^#/d' $< > t-$@ @@ -125,7 +109,7 @@ all: all-@USE_NLS@ -all-yes: $(srcdir)/stamp-po +all-yes: stamp-po all-no: # Ensure that the gettext macros and this Makefile.in.in are in sync. @@ -139,24 +123,24 @@ # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because # we don't want to bother translators with empty POT files). We assume that # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. -# In this case, $(srcdir)/stamp-po is a nop (i.e. a phony target). +# In this case, stamp-po is a nop (i.e. a phony target). -# $(srcdir)/stamp-po is a timestamp denoting the last time at which the CATALOGS -# have been loosely updated. Its purpose is that when a developer or translator -# checks out the package from a version control system, and the $(DOMAIN).pot -# file is not under version control, "make" will update the $(DOMAIN).pot and -# the $(CATALOGS), but subsequent invocations of "make" will do nothing. This -# timestamp would not be necessary if updating the $(CATALOGS) would always -# touch them; however, the rule for $(POFILES) has been designed to not touch -# files that don't need to be changed. -$(srcdir)/stamp-po: $(srcdir)/$(DOMAIN).pot +# stamp-po is a timestamp denoting the last time at which the CATALOGS have +# been loosely updated. Its purpose is that when a developer or translator +# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, +# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent +# invocations of "make" will do nothing. This timestamp would not be necessary +# if updating the $(CATALOGS) would always touch them; however, the rule for +# $(POFILES) has been designed to not touch files that don't need to be +# changed. +stamp-po: $(srcdir)/$(DOMAIN).pot @$(CHECK_MACRO_VERSION) test ! -f $(srcdir)/$(DOMAIN).pot || \ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @test ! -f $(srcdir)/$(DOMAIN).pot || { \ - echo "touch $(srcdir)/stamp-po" && \ - echo timestamp > $(srcdir)/stamp-poT && \ - mv $(srcdir)/stamp-poT $(srcdir)/stamp-po; \ + echo "touch stamp-po" && \ + echo timestamp > stamp-poT && \ + mv stamp-poT stamp-po; \ } # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', @@ -172,9 +156,11 @@ package_gnu="$(PACKAGE_GNU)"; \ test -n "$$package_gnu" || { \ if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \ - LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f -size -10000000c -exec grep -i 'GNU @PACKAGE@' /dev/null '{}' ';' 2>/dev/null; \ + LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f \ + -size -10000000c -exec grep 'GNU @PACKAGE@' \ + /dev/null '{}' ';' 2>/dev/null; \ else \ - LC_ALL=C grep -i 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \ + LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \ fi; \ } | grep -v 'libtool:' >/dev/null; then \ package_gnu=yes; \ @@ -195,30 +181,22 @@ case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ - --add-comments=TRANSLATORS: \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --msgid-bugs-address="$$msgid_bugs_address" \ - $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ ;; \ *) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ - --add-comments=TRANSLATORS: \ + --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --package-name="$${package_prefix}@PACKAGE@" \ --package-version='@VERSION@' \ --msgid-bugs-address="$$msgid_bugs_address" \ - $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ ;; \ 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 \ - || exit 1; \ - 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 && \ @@ -242,19 +220,17 @@ # This target rebuilds a PO file if $(DOMAIN).pot has changed. # Note that a PO file is not touched if it doesn't need to be changed. $(POFILES): $(POFILESDEPS) - @test -f $(srcdir)/$(DOMAIN).pot || $(MAKE) $(srcdir)/$(DOMAIN).pot @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ if test -f "$(srcdir)/$${lang}.po"; then \ + test -f $(srcdir)/$(DOMAIN).pot || $(MAKE) $(srcdir)/$(DOMAIN).pot; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ - echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} --previous $${lang}.po $(DOMAIN).pot"; \ + 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 \ - '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].*) \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ - 0.1[6-7] | 0.1[6-7].*) \ - $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --previous $${lang}.po $(DOMAIN).pot;; \ *) \ - $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} --previous $${lang}.po $(DOMAIN).pot;; \ + $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \ esac; \ }; \ else \ @@ -389,30 +365,28 @@ info dvi ps pdf html tags TAGS ctags CTAGS ID: -install-dvi install-ps install-pdf install-html: - mostlyclean: rm -f remove-potcdate.sed - rm -f $(srcdir)/stamp-poT + rm -f stamp-poT rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po rm -fr *.o clean: mostlyclean distclean: clean - rm -f Makefile Makefile.in POTFILES + rm -f Makefile Makefile.in POTFILES *.mo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." - rm -f $(srcdir)/$(DOMAIN).pot $(srcdir)/stamp-po $(GMOFILES) + rm -f stamp-po $(GMOFILES) distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: test -z "$(DISTFILESDEPS)" || $(MAKE) $(DISTFILESDEPS) @$(MAKE) dist2 # This is a separate target because 'update-po' must be executed before. -dist2: $(srcdir)/stamp-po $(DISTFILES) +dist2: stamp-po $(DISTFILES) dists="$(DISTFILES)"; \ if test "$(PACKAGE)" = "gettext-tools"; then \ dists="$$dists Makevars.template"; \ @@ -453,19 +427,17 @@ .nop.po-update: @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ - if test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH=`pwd`/../src:$$PATH; fi; \ + if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ - echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang --previous $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ cd $(srcdir); \ if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ - '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].*) \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ - 0.1[6-7] | 0.1[6-7].*) \ - $(MSGMERGE) $(MSGMERGE_OPTIONS) --previous -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ *) \ - $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang --previous -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ esac; \ }; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ Binary files /tmp/tmpk9ju3y2l/uqkwDqQpWf/datamash-1.7/po/nb.gmo and /tmp/tmpk9ju3y2l/ut88G7BZjZ/datamash-1.8/po/nb.gmo differ diff -Nru datamash-1.7/po/nb.po datamash-1.8/po/nb.po --- datamash-1.7/po/nb.po 2020-04-23 17:34:24.000000000 +0000 +++ datamash-1.8/po/nb.po 2022-07-23 01:57:18.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: GNU datamash 1.4.12.1\n" "Report-Msgid-Bugs-To: bug-datamash@gnu.org\n" -"POT-Creation-Date: 2020-04-23 11:34-0600\n" +"POT-Creation-Date: 2022-07-23 11:57+1000\n" "PO-Revision-Date: 2019-09-01 23:01+0200\n" "Last-Translator: Johnny A. Solbu \n" "Language-Team: Norwegian Bokmaal \n" @@ -83,11 +83,11 @@ #. If you don't know what to put here, please see #. #. and use glyphs suitable for your language. -#: lib/quotearg.c:362 +#: lib/quotearg.c:355 msgid "`" msgstr "«" -#: lib/quotearg.c:363 +#: lib/quotearg.c:356 msgid "'" msgstr "»" @@ -274,25 +274,25 @@ msgstr "%s%s-argument »%s« er for stort" #. This is a proper name. See the gettext manual, section Names. -#: src/datamash.c:65 src/decorate.c:41 -msgid "Assaf Gordon" -msgstr "Assaf Gordon" +#: src/datamash.c:66 +msgid "Assaf Gordon, Tim Rice, Shawn Wagner, Erik Auerswald" +msgstr "" -#: src/datamash.c:161 src/datamash.c:504 +#: src/datamash.c:169 src/datamash.c:539 #, c-format msgid "column name %s not found in input file" msgstr "kolonnenavnet %s ble ikke funnet i inndatafilen" -#: src/datamash.c:174 +#: src/datamash.c:182 #, c-format msgid "Usage: %s [OPTION] op [fld] [op fld ...]\n" msgstr "Bruk: %s [VALG] op [fld] [op fld ...]\n" -#: src/datamash.c:177 +#: src/datamash.c:185 msgid "Performs numeric/string operations on input from stdin." msgstr "Utfører numerisk/strengoperasjoner på inndata fra standard inn." -#: src/datamash.c:180 +#: src/datamash.c:188 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" @@ -300,7 +300,7 @@ "«op» er operasjonen du skal utføre. Hvis en primær operasjon brukes\n" "må den være oppført først, eventuelt etterfulgt av andre operasjoner.\n" -#: src/datamash.c:183 +#: src/datamash.c:191 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" @@ -309,7 +309,7 @@ "felt),\n" "eller et kolonnenavn når du bruker -H eller --header-in.\n" -#: src/datamash.c:186 +#: src/datamash.c:194 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" @@ -319,35 +319,39 @@ "kan vises på en bindestrek (f.eks. 2-8). Bruk kolonner for \n" "operasjoner som krever et par felter (f.eks. 'pcov 2: 6').\n" -#: src/datamash.c:191 +#: src/datamash.c:199 msgid "Primary operations:\n" msgstr "Primær-operasjoner:\n" -#: src/datamash.c:194 +#: src/datamash.c:202 msgid "Line-Filtering operations:\n" msgstr "Linjefiltreringsoperasjoner:\n" -#: src/datamash.c:197 +#: src/datamash.c:205 msgid "Per-Line operations:\n" msgstr "Per-linje-operasjoner:\n" -#: src/datamash.c:203 +#: src/datamash.c:211 msgid "Numeric Grouping operations:\n" msgstr "Numerisk grupperingsoperasjoner:\n" -#: src/datamash.c:206 +#: src/datamash.c:214 msgid "Textual/Numeric Grouping operations:\n" msgstr "Tekstlig/numerisk grupperingsoperasjoner:\n" -#: src/datamash.c:210 +#: src/datamash.c:218 msgid "Statistical Grouping operations:\n" msgstr "Statistisk grupperingsoperasjoner:\n" -#: src/datamash.c:219 +#: src/datamash.c:227 src/decorate.c:179 +msgid "Options:\n" +msgstr "Valg:\n" + +#: src/datamash.c:229 msgid "Grouping Options:\n" msgstr "grupperingsvalg:\n" -#: src/datamash.c:220 +#: src/datamash.c:230 msgid "" " -C, --skip-comments skip comment lines (starting with '#' or ';'\n" " and optional whitespace)\n" @@ -356,16 +360,17 @@ "«;»\n" " og valgfritt mellomrom)\n" -#: src/datamash.c:224 +#: src/datamash.c:234 msgid "" " -f, --full print entire input line before op results\n" " (default: print only the grouped keys)\n" +" This option is only sensible for linewise\n" +" operations. Other uses are deprecated and\n" +" will be removed in a future version of GNU\n" +" Datamash.\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:228 +#: src/datamash.c:242 msgid "" " -g, --group=X[,Y,Z] group via fields X,[Y,Z];\n" " equivalent to primary operation 'groupby'\n" @@ -373,21 +378,21 @@ " -g, --group=X[,Y,Z] grupper via felter X,[Y,Z];\n" " tilsvarer primæroperasjon «groupby»'\n" -#: src/datamash.c:232 +#: src/datamash.c:246 msgid " --header-in first input line is column headers\n" msgstr "" " --header-in første inndatalinje er kolonnetopptekster\n" -#: src/datamash.c:235 +#: src/datamash.c:249 msgid " --header-out print column headers as first line\n" msgstr "" " --header-out skriv ut kolonnetopptekster som første linje\n" -#: src/datamash.c:238 +#: src/datamash.c:252 msgid " -H, --headers same as '--header-in --header-out'\n" msgstr " -H, --headers samme som «--header-in --header-out»\n" -#: src/datamash.c:241 +#: src/datamash.c:255 msgid "" " -i, --ignore-case ignore upper/lower case when comparing text;\n" " this affects grouping, and string operations\n" @@ -397,7 +402,7 @@ " dette påvirker gruppering og " "strengoperasjoner\n" -#: src/datamash.c:245 +#: src/datamash.c:259 msgid "" " -s, --sort sort the input before grouping; this removes " "the\n" @@ -408,29 +413,38 @@ " behovet for å manuellt omdirigere inndata " "gjennom «sort»\n" -#: src/datamash.c:250 +#: src/datamash.c:263 +#, fuzzy +msgid "" +" -c, --collapse-delimiter=X use X to separate elements in collapse and\n" +" unique lists (default: comma)\n" +msgstr "" +" --output-delimiter=X bruk X i stedet som utdata-skilletegn\n" +" (standard: bruk samme skilletegn som -t/-W)\n" + +#: src/datamash.c:268 msgid "File Operation Options:\n" msgstr "Filoperasjonsvalg:\n" -#: src/datamash.c:251 +#: src/datamash.c:269 msgid " --no-strict allow lines with varying number of fields\n" msgstr " --no-strict tillat linjer med varierende antall felt\n" -#: src/datamash.c:254 +#: src/datamash.c:272 #, 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:259 src/decorate.c:174 +#: src/datamash.c:277 src/decorate.c:185 msgid "General Options:\n" msgstr "Generelle valg:\n" -#: src/datamash.c:260 +#: src/datamash.c:278 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:263 +#: src/datamash.c:281 msgid "" " --format=FORMAT print numeric values with printf style\n" " floating-point FORMAT.\n" @@ -438,7 +452,7 @@ " --format=FORMAT skriv ut numeriske verdier med printf-stil\n" " flytfunksions-FORMAT.\n" -#: src/datamash.c:267 +#: src/datamash.c:285 msgid "" " --output-delimiter=X use X instead as output field delimiter\n" " (default: use same delimiter as -t/-W)\n" @@ -446,15 +460,15 @@ " --output-delimiter=X bruk X i stedet som utdata-skilletegn\n" " (standard: bruk samme skilletegn som -t/-W)\n" -#: src/datamash.c:271 +#: src/datamash.c:289 msgid " --narm skip NA/NaN values\n" msgstr " --narm hopp over NA/NaN-verdier\n" -#: src/datamash.c:274 +#: src/datamash.c:292 msgid " -R, --round=N round numeric output to N decimal places\n" msgstr " -R, --round=N rund numerisk utgang til N desimaler\n" -#: src/datamash.c:277 +#: src/datamash.c:295 msgid "" " -W, --whitespace use whitespace (one or more spaces and/or tabs)\n" " for field delimiters\n" @@ -463,32 +477,44 @@ "eller tabulatorer)\n" " for feltskilletegn\n" -#: src/datamash.c:281 +#: src/datamash.c:299 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:290 +#: src/datamash.c:302 src/decorate.c:219 +msgid " --sort-cmd=/path/to/sort Alternative sort(1) to use.\n" +msgstr "" + +#: src/datamash.c:311 +msgid "Environment:" +msgstr "" + +#: src/datamash.c:313 +msgid " LC_NUMERIC decimal-point character and thousands separator\n" +msgstr "" + +#: src/datamash.c:319 msgid "Examples:" msgstr "Eksempler:" -#: src/datamash.c:292 +#: src/datamash.c:321 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:297 +#: src/datamash.c:326 msgid "Transpose input:" msgstr "Transponere inndata:" -#: src/datamash.c:304 src/decorate.c:287 +#: src/datamash.c:333 src/decorate.c:302 msgid "For detailed usage information and examples, see\n" msgstr "For detaljert bruksinformasjon og eksempler, se\n" -#: src/datamash.c:306 src/decorate.c:289 +#: src/datamash.c:335 src/decorate.c:304 msgid "The manual and more examples are available at\n" msgstr "Manualen og flere eksempler finnes på\n" -#: src/datamash.c:315 +#: src/datamash.c:344 #, c-format msgid "" "invalid input: field % requested, line % has only " @@ -497,12 +523,18 @@ "ugyldig inngang: feltet % etterspurt, linje % har bare " "% felt" -#: src/datamash.c:385 +#: src/datamash.c:414 #, c-format msgid "%s in line % field %: '%s'" msgstr "%s i linje % felt %: «%s»" -#: src/datamash.c:713 +#: src/datamash.c:656 +msgid "" +"datamash: Using -f/--full with non-linewise operations is deprecated and " +"will be disabled in a future release.\n" +msgstr "" + +#: src/datamash.c:752 #, c-format msgid "" "transpose input error: line % has % fields (previous lines " @@ -513,7 +545,7 @@ "linjer hadde %);\n" "se --help for å deaktivere streng modus" -#: src/datamash.c:770 +#: src/datamash.c:809 #, c-format msgid "" "reverse-field input error: line % has % fields (previous " @@ -524,21 +556,21 @@ "(foregående linjer hadde %);\n" "se --help for å deaktivere streng modus" -#: src/datamash.c:879 src/datamash.c:896 src/datamash.c:902 +#: src/datamash.c:918 src/datamash.c:935 src/datamash.c:941 #, c-format msgid "" "line % (% fields):\n" " " msgstr "linje % (% felt):" -#: src/datamash.c:885 +#: src/datamash.c:924 #, c-format msgid "" "check failed: line % has % fields (expecting %)" msgstr "" "sjekk mislyktes: linje % har %-felt (forventer %)" -#: src/datamash.c:908 +#: src/datamash.c:947 #, c-format msgid "" "check failed: line % has % fields (previous line had " @@ -547,74 +579,71 @@ "sjekk mislyktes: linje % har % felt (forrige linje hadde " "%)" -#: src/datamash.c:922 +#: src/datamash.c:961 #, c-format msgid "check failed: input had % lines (expecting %)" msgstr "" "sjekk mislyktes: inndata hadde %-linjer (forventer %)" -#: src/datamash.c:928 +#: src/datamash.c:967 #, c-format msgid "% line" msgid_plural "% lines" msgstr[0] "%-linje" msgstr[1] "%-linjer" -#: src/datamash.c:931 +#: src/datamash.c:970 #, c-format msgid "% field" msgid_plural "% fields" msgstr[0] "%-felt" msgstr[1] "%-felter" -#: src/datamash.c:1032 +#: src/datamash.c:1080 msgid "hash memory allocation error" msgstr "hashminnetildelingsfeil" -#: src/datamash.c:1099 -msgid "sort command too-long (please report this bug)" -msgstr "sort-kommandoen for lang (vennligst rapporter denne feilen)" +#: src/datamash.c:1147 +msgid "-s and -z cannot be combined on this system" +msgstr "" -#: src/datamash.c:1105 +#: src/datamash.c:1181 msgid "failed to run 'sort': popen failed" msgstr "mislyktes i å kjøre «sort»: popen feilet" -#: src/datamash.c:1121 +#: src/datamash.c:1197 msgid "read error" msgstr "lesefeil" -#: src/datamash.c:1129 +#: src/datamash.c:1205 msgid "read error (on close)" msgstr "lesefeil (ved lukking)" -#: src/datamash.c:1222 src/datamash.c:1229 +#: src/datamash.c:1300 src/datamash.c:1307 src/datamash.c:1323 msgid "the delimiter must be a single character" msgstr "skilletegnet må være et enkelt tegn" -#: src/datamash.c:1265 +#: src/datamash.c:1354 #, c-format msgid "missing operation specifiers" msgstr "manglende operasjonsangivelser" -#: src/datamash.c:1283 +#: src/datamash.c:1372 msgid "-H or --header-in must be used with named columns" msgstr "-H or --header-in må brukes med navngitte kolonner" #: src/decorate-functions.c:76 #, fuzzy, c-format -#| msgid "invalid empty grouping parameter" msgid "invalid empty roman numeral" msgstr "ugyldig tom grupperingsparameter" #: src/decorate-functions.c:84 #, fuzzy, c-format -#| msgid "invalid numeric value '%s'" msgid "invalid roman numeral '%c' in %s" msgstr "ugyldig numerisk verdi «%s»" #: src/decorate-functions.c:120 #, fuzzy, c-format -#| msgid "invalid operand %s" msgid "invalid IPv4 address %s" msgstr "ugyldig operand %s" @@ -633,11 +662,24 @@ #: src/decorate-functions.c:165 #, fuzzy, c-format -#| msgid "invalid operand %s" msgid "invalid IPv6 address %s" msgstr "ugyldig operand %s" -#: src/decorate.c:140 +#: src/decorate-functions.c:192 +msgid "inet_pton failed for AF_INET and AF_INET6" +msgstr "" + +#: src/decorate-functions.c:196 +#, fuzzy, c-format +msgid "invalid IP address %s" +msgstr "ugyldig operand %s" + +#. This is a proper name. See the gettext manual, section Names. +#: src/decorate.c:42 +msgid "Assaf Gordon, Shawn Wagner and Erik Auerswald" +msgstr "" + +#: src/decorate.c:145 #, c-format msgid "" "Usage: %s [OPTION]... [INPUT]\n" @@ -646,29 +688,29 @@ "\n" msgstr "" -#: src/decorate.c:147 +#: src/decorate.c:152 msgid "Converts (and optionally sorts) fields of various formats\n" msgstr "" -#: src/decorate.c:153 +#: src/decorate.c:158 msgid "" "With --decorate: adds the converted fields to the start\n" "of each line and prints and prints it to STDOUT; does not sort.\n" msgstr "" -#: src/decorate.c:160 +#: src/decorate.c:165 msgid "" "With --undecorate: removes the first N fields from the input;\n" "Use as post-processing step after sort(1).\n" msgstr "" -#: src/decorate.c:167 +#: src/decorate.c:172 msgid "" "Without --decorate and --undecorate: automatically decorates the input,\n" "runs sort(1) and undecorates the result; This is the easiest method to use.\n" msgstr "" -#: src/decorate.c:179 +#: src/decorate.c:190 msgid "" " --decorate decorate/convert the specified fields and " "print\n" @@ -677,13 +719,13 @@ " sort(1) or undecorates the output\n" msgstr "" -#: src/decorate.c:184 +#: src/decorate.c:195 msgid "" " --header=N does not decorate or sort the first N lines\n" " -H same as --header=N\n" msgstr "" -#: src/decorate.c:188 +#: src/decorate.c:199 msgid "" " -k, --key=KEYDEF key/field to sort; same syntax as sort(1),\n" " optionally followed by ':method' to convert\n" @@ -692,16 +734,14 @@ " and available conversion below\n" msgstr "" -#: src/decorate.c:194 +#: src/decorate.c:205 #, fuzzy -#| msgid "" -#| " -t, --field-separator=X use X instead of TAB as field delimiter\n" msgid "" " -t, --field-separator=SEP use SEP instead of non-blank to blank " "transition\n" msgstr " -t, --field-separator=X bruk X istedenfor TAB som feltskilletegn\n" -#: src/decorate.c:197 +#: src/decorate.c:208 msgid "" " --print-sort-args print adjusted parameters for sort(1); Useful\n" " when using --decorate and then manually " @@ -709,25 +749,24 @@ " sort(1)\n" msgstr "" -#: src/decorate.c:202 +#: src/decorate.c:213 #, fuzzy -#| msgid "" -#| " --no-strict allow lines with varying number of fields\n" msgid " --undecorate=N removes the first N fields\n" msgstr " --no-strict tillat linjer med varierende antall felt\n" -#: src/decorate.c:205 +#: src/decorate.c:216 #, fuzzy -#| msgid " -z, --zero-terminated end lines with 0 byte, not newline\n" msgid " -z, --zero-terminated line delimiter is NUL, not newline\n" msgstr "" " -z, --zero-terminated avslutt linjer med 0 byte, ikke linjeskift\n" -#: src/decorate.c:213 -msgid "The following options are passed to sort(1) as-is:\n" +#: src/decorate.c:227 +msgid "" +"The following options are passed to sort as-is (Most of them assume GNU " +"sort):\n" msgstr "" -#: src/decorate.c:219 +#: src/decorate.c:234 msgid "" " -c, --check\n" " --compress-program\n" @@ -740,226 +779,219 @@ " --parallel\n" msgstr "" -#: src/decorate.c:234 +#: src/decorate.c:249 msgid "Available conversions methods (use with -k):\n" msgstr "" -#: src/decorate.c:246 +#: src/decorate.c:261 #, fuzzy -#| msgid "Examples:" msgid "Examples:\n" msgstr "Eksempler:" -#: src/decorate.c:252 +#: src/decorate.c:267 msgid "The following two invocations are equivalent:\n" msgstr "" -#: src/decorate.c:267 +#: src/decorate.c:282 msgid "Decorated output of roman numerals:\n" msgstr "" -#: src/decorate.c:431 +#: src/decorate.c:446 msgid "fwrite (header line) failed" msgstr "" -#: src/decorate.c:439 +#: src/decorate.c:454 msgid "fflush (header line) failed" msgstr "" -#: src/decorate.c:445 +#: src/decorate.c:460 #, c-format -msgid "conversion failed in line %zu" +msgid "conversion failed in line %" msgstr "" -#: src/decorate.c:451 +#: src/decorate.c:467 msgid "decorate: fwrite failed" msgstr "" -#: src/decorate.c:457 src/decorate.c:519 +#: src/decorate.c:473 src/decorate.c:535 #, c-format msgid "error reading %s" msgstr "" -#: src/decorate.c:538 +#: src/decorate.c:554 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number at field start" msgstr "ugyldig numerisk verdi «%s»" -#: src/decorate.c:543 src/decorate.c:571 +#: src/decorate.c:559 src/decorate.c:587 msgid "field number is zero" msgstr "" -#: src/decorate.c:548 src/decorate.c:576 +#: src/decorate.c:564 src/decorate.c:592 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number after '.'" msgstr "ugyldig numerisk verdi «%s»" -#: src/decorate.c:552 +#: src/decorate.c:568 msgid "character offset is zero" msgstr "" -#: src/decorate.c:567 +#: src/decorate.c:583 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number after ','" msgstr "ugyldig numerisk verdi «%s»" -#: src/decorate.c:603 +#: src/decorate.c:619 msgid "missing external conversion command" msgstr "" -#: src/decorate.c:618 +#: src/decorate.c:634 msgid "missing internal conversion function" msgstr "" -#: src/decorate.c:630 +#: src/decorate.c:646 #, fuzzy -#| msgid "invalid field pair for operation %s" msgid "invalid built-in conversion option" msgstr "ugyldig feltpar for operasjon %s" -#: src/decorate.c:641 +#: src/decorate.c:657 msgid "" "ordering flags (b/d/i/h/n/g/M/R/V) cannot be combined with a conversion " "function" msgstr "" -#: src/decorate.c:671 +#: src/decorate.c:687 #, fuzzy -#| msgid "invalid operation %s" msgid "invalid key specification" msgstr "ugyldig operasjon %s" -#: src/decorate.c:853 +#: src/decorate.c:890 #, fuzzy, c-format -#| msgid "invalid numeric value '%s'" msgid "invalid number of header lines %s" msgstr "ugyldig numerisk verdi «%s»" -#: src/decorate.c:907 +#: src/decorate.c:948 msgid "empty tab" msgstr "" -#: src/decorate.c:918 +#: src/decorate.c:959 #, c-format msgid "multi-character tab %s" msgstr "" -#: src/decorate.c:923 +#: src/decorate.c:964 msgid "incompatible tabs" msgstr "" -#: src/decorate.c:945 +#: src/decorate.c:986 #, fuzzy, c-format -#| msgid "invalid field '%s' for operation %s" msgid "invalid number of fields to undecorate %s" msgstr "ugyldig felt «%s» for operasjon %s" -#: src/decorate.c:968 +#: src/decorate.c:1009 msgid "--decorate and --undecorate options are mutually exclusive" msgstr "" -#: src/decorate.c:972 +#: src/decorate.c:1013 msgid "--undecorate cannot be used with --keys or --decorate" msgstr "" -#: src/decorate.c:976 +#: src/decorate.c:1017 msgid "missing -k/--key decoration or --undecorate options" msgstr "" -#: src/decorate.c:985 +#: src/decorate.c:1026 msgid "no decorated keys specified. use sort instead" msgstr "" -#: src/decorate.c:1024 +#: src/decorate.c:1060 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to create dec-sort pipe" msgstr "mislyktes i å kjøre «sort»: popen feilet" -#: src/decorate.c:1026 +#: src/decorate.c:1062 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to create sort-undec pipe" msgstr "mislyktes i å kjøre «sort»: popen feilet" -#: src/decorate.c:1033 +#: src/decorate.c:1069 msgid "failed to fork-1" msgstr "" -#: src/decorate.c:1040 +#: src/decorate.c:1076 msgid "failed to fork-2" msgstr "" -#: src/decorate.c:1052 src/decorate.c:1101 +#: src/decorate.c:1088 src/decorate.c:1137 msgid "failed to close sort-undec read-pipe" msgstr "" -#: src/decorate.c:1055 src/decorate.c:1140 +#: src/decorate.c:1091 src/decorate.c:1176 msgid "failed to close sort-undec write-pipe" msgstr "" -#: src/decorate.c:1057 src/decorate.c:1135 +#: src/decorate.c:1093 src/decorate.c:1171 msgid "failed to close dec-sort read-pipe" msgstr "" -#: src/decorate.c:1066 +#: src/decorate.c:1102 msgid "failed to dup STDOUT fd" msgstr "" -#: src/decorate.c:1069 +#: src/decorate.c:1105 msgid "fdopen (dup (stdout)) failed" msgstr "" -#: src/decorate.c:1074 +#: src/decorate.c:1110 msgid "failed to reassign dec-sort STDOUT" msgstr "" -#: src/decorate.c:1098 src/decorate.c:1137 +#: src/decorate.c:1134 src/decorate.c:1173 msgid "failed to close dec-sort write-pipe" msgstr "" -#: src/decorate.c:1106 +#: src/decorate.c:1142 msgid "failed to reassign dec-sort STDIN" msgstr "" -#: src/decorate.c:1112 +#: src/decorate.c:1148 msgid "failed to reassign sort-undec STDOUT" msgstr "" -#: src/decorate.c:1126 +#: src/decorate.c:1162 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to run the sort command" msgstr "mislyktes i å kjøre «sort»: popen feilet" -#: src/decorate.c:1144 +#: src/decorate.c:1180 msgid "failed to reassign sort-undec STDIN" msgstr "" -#: src/double-format.c:49 +#: src/double-format.c:45 +msgid "numeric format too large" +msgstr "" + +#: src/double-format.c:54 #, c-format msgid "format %s has no %% directive" msgstr "formatet %s har ingen %% directiver" -#: src/double-format.c:62 +#: src/double-format.c:67 #, c-format msgid "format %s missing valid type after '%%'" msgstr "formatet %s mangler gyldig type etter «%%»" -#: src/double-format.c:66 +#: src/double-format.c:71 #, c-format msgid "format %s has unknown/invalid type %%%c directive" msgstr "formatet %s har ukjent/ugyldig type %%%c-direktiv" -#: src/double-format.c:79 +#: src/double-format.c:84 #, c-format msgid "format %s has too many %% directives" msgstr "formatet %s har for mange %%-direktiver" -#: src/field-ops.c:346 +#: src/field-ops.c:351 #, c-format msgid "" "input error for operation %s: fields %,% have different " @@ -968,17 +1000,16 @@ "inndatafeil for operasjon %s: felt %, % har forskjellig " "antall elementer" -#: src/field-ops.c:1176 +#: src/field-ops.c:1199 msgid "invalid numeric value" msgstr "ugyldig numerisk verdi" -#: src/field-ops.c:1178 +#: src/field-ops.c:1201 msgid "invalid base64 value" msgstr "ugyldig base64-verdi" #: src/key-compare.c:305 #, fuzzy, c-format -#| msgid "invalid field pair for operation %s" msgid "%s: invalid field specification %s" msgstr "ugyldig feltpar for operasjon %s" @@ -1063,7 +1094,7 @@ msgid "conflicting operation %s" msgstr "motstridende operasjon %s" -#: src/op-parser.c:499 src/op-parser.c:752 +#: src/op-parser.c:499 src/op-parser.c:758 #, c-format msgid "invalid operation %s" msgstr "ugyldig operasjon %s" @@ -1103,21 +1134,21 @@ msgid "crosstab requires exactly 2 fields, found %" msgstr "krysstabulering krever nøyaktig 2 felt, fant%" -#: src/op-parser.c:705 +#: src/op-parser.c:711 #, c-format msgid "crosstab supports one operation, found %" msgstr "krysstabulering støtter én operasjon, fant %" -#: src/op-parser.c:714 +#: src/op-parser.c:720 msgid "missing operation" msgstr "manglende operasjon" -#: src/op-parser.c:728 +#: src/op-parser.c:734 #, c-format msgid "extra operand %s" msgstr "ekstra operand %s" -#: src/op-parser.c:865 src/op-scanner.c:237 +#: src/op-parser.c:874 src/op-scanner.c:237 msgid "missing script (among arguments)" msgstr "manglende script (blant argumenter)" @@ -1157,15 +1188,29 @@ msgid "Try '%s --help' for more information.\n" msgstr "Prøv «%s --help» for mer informasjon.\n" -#: src/text-options.c:111 +#: src/text-options.c:109 msgid "missing rounding digits value" msgstr "manglende avrundingssifferverdi" -#: src/text-options.c:116 +#: src/text-options.c:114 #, c-format msgid "invalid rounding digits value %s" msgstr "ugyldig avrundingssifferverdi %s" +#~ msgid "Assaf Gordon" +#~ msgstr "Assaf Gordon" + +#~ 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" + +#~ msgid "sort command too-long (please report this bug)" +#~ msgstr "sort-kommandoen for lang (vennligst rapporter denne feilen)" + #~ msgid "%s: option '--%s' doesn't allow an argument\n" #~ msgstr "%s: valg «--%s» tillater ikke argument\n" @@ -1190,8 +1235,5 @@ #~ 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" Binary files /tmp/tmpk9ju3y2l/uqkwDqQpWf/datamash-1.7/po/nl.gmo and /tmp/tmpk9ju3y2l/ut88G7BZjZ/datamash-1.8/po/nl.gmo differ diff -Nru datamash-1.7/po/nl.po datamash-1.8/po/nl.po --- datamash-1.7/po/nl.po 2020-04-23 17:34:24.000000000 +0000 +++ datamash-1.8/po/nl.po 2022-07-23 01:57:18.000000000 +0000 @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: datamash-1.4.12.1\n" "Report-Msgid-Bugs-To: bug-datamash@gnu.org\n" -"POT-Creation-Date: 2020-04-23 11:34-0600\n" +"POT-Creation-Date: 2022-07-23 11:57+1000\n" "PO-Revision-Date: 2019-09-16 16:28+0200\n" "Last-Translator: Benno Schulenberg \n" "Language-Team: Dutch \n" @@ -84,11 +84,11 @@ #. If you don't know what to put here, please see #. #. and use glyphs suitable for your language. -#: lib/quotearg.c:362 +#: lib/quotearg.c:355 msgid "`" msgstr "‘" -#: lib/quotearg.c:363 +#: lib/quotearg.c:356 msgid "'" msgstr "’" @@ -280,25 +280,25 @@ 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:65 src/decorate.c:41 -msgid "Assaf Gordon" -msgstr "Assaf Gordon" +#: src/datamash.c:66 +msgid "Assaf Gordon, Tim Rice, Shawn Wagner, Erik Auerswald" +msgstr "" -#: src/datamash.c:161 src/datamash.c:504 +#: src/datamash.c:169 src/datamash.c:539 #, 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:182 #, c-format 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:185 msgid "Performs numeric/string operations on input from stdin." msgstr "Voert numerieke of tekenreeksbewerkingen uit op standaardinvoer." -#: src/datamash.c:180 +#: src/datamash.c:188 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" @@ -306,7 +306,7 @@ "OPERATIE is de te verrichten bewerking. Een primaire bewerking moet\n" "als eerste gegeven worden, eventueel gevolgd door andere bewerkingen.\n" -#: src/datamash.c:183 +#: src/datamash.c:191 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" @@ -315,7 +315,7 @@ "veld),\n" "of een veldnaam wanneer optie '-H' of '--header-in' gebruikt wordt.\n" -#: src/datamash.c:186 +#: src/datamash.c:194 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" @@ -327,35 +327,39 @@ "voor\n" "bewerkingen die een veldenpaar vereisen (bijv. 'pcov 2:6').\n" -#: src/datamash.c:191 +#: src/datamash.c:199 msgid "Primary operations:\n" msgstr "Primaire bewerkingen:\n" -#: src/datamash.c:194 +#: src/datamash.c:202 msgid "Line-Filtering operations:\n" msgstr "Regelfilterbewerkingen:\n" -#: src/datamash.c:197 +#: src/datamash.c:205 msgid "Per-Line operations:\n" msgstr "Per-regel-bewerkingen:\n" -#: src/datamash.c:203 +#: src/datamash.c:211 msgid "Numeric Grouping operations:\n" msgstr "Numerieke groeperingsbewerkingen:\n" -#: src/datamash.c:206 +#: src/datamash.c:214 msgid "Textual/Numeric Grouping operations:\n" msgstr "Tekstuele en numerieke groeperingsbewerkingen:\n" -#: src/datamash.c:210 +#: src/datamash.c:218 msgid "Statistical Grouping operations:\n" msgstr "Statistische groeperingsbewerkingen:\n" -#: src/datamash.c:219 +#: src/datamash.c:227 src/decorate.c:179 +msgid "Options:\n" +msgstr "Opties:\n" + +#: src/datamash.c:229 msgid "Grouping Options:\n" msgstr "Groeperingsopties:\n" -#: src/datamash.c:220 +#: src/datamash.c:230 msgid "" " -C, --skip-comments skip comment lines (starting with '#' or ';'\n" " and optional whitespace)\n" @@ -363,16 +367,17 @@ " -C, --skip-comments commentaarregels (beginnend met '#' of ';') " "overslaan\n" -#: src/datamash.c:224 +#: src/datamash.c:234 msgid "" " -f, --full print entire input line before op results\n" " (default: print only the grouped keys)\n" +" This option is only sensible for linewise\n" +" operations. Other uses are deprecated and\n" +" will be removed in a future version of GNU\n" +" Datamash.\n" msgstr "" -" -f, --full gehele invoerregel tonen vóór " -"bewerkingsresultaten\n" -" (standaard alleen de gegroepeerde sleutels)\n" -#: src/datamash.c:228 +#: src/datamash.c:242 msgid "" " -g, --group=X[,Y,Z] group via fields X,[Y,Z];\n" " equivalent to primary operation 'groupby'\n" @@ -380,19 +385,19 @@ " -g, --group=X[,Y,Z] groeperen via de velden X,[Y,Z]; dit is\n" " hetzelfde als primaire bewerking 'groupby'\n" -#: src/datamash.c:232 +#: src/datamash.c:246 msgid " --header-in first input line is column headers\n" msgstr " --header-in eerste invoerregel zijn kolomkoppen\n" -#: src/datamash.c:235 +#: src/datamash.c:249 msgid " --header-out print column headers as first line\n" msgstr " --header-out kolomkoppen weergeven als eerste regel\n" -#: src/datamash.c:238 +#: src/datamash.c:252 msgid " -H, --headers same as '--header-in --header-out'\n" msgstr " -H, --headers hetzelfde als '--header-in --header-out'\n" -#: src/datamash.c:241 +#: src/datamash.c:255 msgid "" " -i, --ignore-case ignore upper/lower case when comparing text;\n" " this affects grouping, and string operations\n" @@ -403,7 +408,7 @@ "op\n" " groeperingen en tekenreeksbewerkingen\n" -#: src/datamash.c:245 +#: src/datamash.c:259 msgid "" " -s, --sort sort the input before grouping; this removes " "the\n" @@ -414,32 +419,41 @@ "maakt\n" " het handmatig door 'sort' sluizen overbodig\n" -#: src/datamash.c:250 +#: src/datamash.c:263 +#, fuzzy +msgid "" +" -c, --collapse-delimiter=X use X to separate elements in collapse and\n" +" unique lists (default: comma)\n" +msgstr "" +" --output-delimiter=X dit teken als veldscheider gebruiken\n" +" (standaard dezelfde als voor -t/-W)\n" + +#: src/datamash.c:268 msgid "File Operation Options:\n" msgstr "Bestandsbewerkingsopties:\n" -#: src/datamash.c:251 +#: src/datamash.c:269 msgid " --no-strict allow lines with varying number of fields\n" msgstr "" " --no-strict regels met een variërend aantal velden toestaan\n" -#: src/datamash.c:254 +#: src/datamash.c:272 #, c-format msgid " --filler=X fill missing values with X (default %s)\n" msgstr "" " --filler=WAARDE ontbrekende waarden opvullen met deze (standaard " "%s)\n" -#: src/datamash.c:259 src/decorate.c:174 +#: src/datamash.c:277 src/decorate.c:185 msgid "General Options:\n" msgstr "Algemene opties:\n" -#: src/datamash.c:260 +#: src/datamash.c:278 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" -#: src/datamash.c:263 +#: src/datamash.c:281 msgid "" " --format=FORMAT print numeric values with printf style\n" " floating-point FORMAT.\n" @@ -447,7 +461,7 @@ " --format=OPMAAK numerieke waarden weergeven met deze 'printf'\n" " drijvendekommastijl\n" -#: src/datamash.c:267 +#: src/datamash.c:285 msgid "" " --output-delimiter=X use X instead as output field delimiter\n" " (default: use same delimiter as -t/-W)\n" @@ -455,18 +469,18 @@ " --output-delimiter=X dit teken als veldscheider gebruiken\n" " (standaard dezelfde als voor -t/-W)\n" -#: src/datamash.c:271 +#: src/datamash.c:289 msgid " --narm skip NA/NaN values\n" msgstr "" " --narm de waarden 'NA', 'N/A' en 'NaN' overslaan\n" -#: src/datamash.c:274 +#: src/datamash.c:292 msgid " -R, --round=N round numeric output to N decimal places\n" msgstr "" " -R, --round=AANTAL numerieke uitvoer op dit aantal decimalen " "afronden\n" -#: src/datamash.c:277 +#: src/datamash.c:295 msgid "" " -W, --whitespace use whitespace (one or more spaces and/or tabs)\n" " for field delimiters\n" @@ -474,33 +488,45 @@ " -W, --whitespace witruimte gebruiken om velden te scheiden\n" " (één of meer spaties en/of tabs) \n" -#: src/datamash.c:281 +#: src/datamash.c:299 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" -#: src/datamash.c:290 +#: src/datamash.c:302 src/decorate.c:219 +msgid " --sort-cmd=/path/to/sort Alternative sort(1) to use.\n" +msgstr "" + +#: src/datamash.c:311 +msgid "Environment:" +msgstr "" + +#: src/datamash.c:313 +msgid " LC_NUMERIC decimal-point character and thousands separator\n" +msgstr "" + +#: src/datamash.c:319 msgid "Examples:" msgstr "Voorbeelden:" -#: src/datamash.c:292 +#: src/datamash.c:321 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:297 +#: src/datamash.c:326 msgid "Transpose input:" msgstr "De invoer transponeren:" -#: src/datamash.c:304 src/decorate.c:287 +#: src/datamash.c:333 src/decorate.c:302 msgid "For detailed usage information and examples, see\n" msgstr "Voor gedetailleerde gebruiksinformatie en voorbeelden, zie\n" -#: src/datamash.c:306 src/decorate.c:289 +#: src/datamash.c:335 src/decorate.c:304 msgid "The manual and more examples are available at\n" msgstr "De handleiding en meer voorbeelden zijn beschikbaar op\n" -#: src/datamash.c:315 +#: src/datamash.c:344 #, c-format msgid "" "invalid input: field % requested, line % has only " @@ -509,12 +535,18 @@ "ongeldige invoer: veld % werd gevraagd, maar regel % heeft " "slechts % velden" -#: src/datamash.c:385 +#: src/datamash.c:414 #, c-format msgid "%s in line % field %: '%s'" msgstr "%s in regel %, veld %: '%s'" -#: src/datamash.c:713 +#: src/datamash.c:656 +msgid "" +"datamash: Using -f/--full with non-linewise operations is deprecated and " +"will be disabled in a future release.\n" +msgstr "" + +#: src/datamash.c:752 #, c-format msgid "" "transpose input error: line % has % fields (previous lines " @@ -525,7 +557,7 @@ "(eerdere regels hadden er %);\n" "zie --help om strikte modus uit schakelen" -#: src/datamash.c:770 +#: src/datamash.c:809 #, c-format msgid "" "reverse-field input error: line % has % fields (previous " @@ -536,7 +568,7 @@ "(eerdere regels hadden er %);\n" "zie --help om strikte modus uit schakelen" -#: src/datamash.c:879 src/datamash.c:896 src/datamash.c:902 +#: src/datamash.c:918 src/datamash.c:935 src/datamash.c:941 #, c-format msgid "" "line % (% fields):\n" @@ -545,7 +577,7 @@ "regel % (% velden):\n" " " -#: src/datamash.c:885 +#: src/datamash.c:924 #, c-format msgid "" "check failed: line % has % fields (expecting %)" @@ -553,7 +585,7 @@ "controle is mislukt: regel % heeft % velden (er werden " "% verwacht)" -#: src/datamash.c:908 +#: src/datamash.c:947 #, c-format msgid "" "check failed: line % has % fields (previous line had " @@ -562,75 +594,72 @@ "controle is mislukt: regel % heeft % velden (eerdere regel " "had er %)" -#: src/datamash.c:922 +#: src/datamash.c:961 #, c-format msgid "check failed: input had % lines (expecting %)" msgstr "" "controle is mislukt: invoer heeft % velden (er werden % " "verwacht)" -#: src/datamash.c:928 +#: src/datamash.c:967 #, c-format msgid "% line" msgid_plural "% lines" msgstr[0] "% regel" msgstr[1] "% regels" -#: src/datamash.c:931 +#: src/datamash.c:970 #, c-format msgid "% field" msgid_plural "% fields" msgstr[0] "% veld" msgstr[1] "% velden" -#: src/datamash.c:1032 +#: src/datamash.c:1080 msgid "hash memory allocation error" msgstr "onvoldoende geheugen beschikbaar voor hash" -#: src/datamash.c:1099 -msgid "sort command too-long (please report this bug)" -msgstr "het sorteercommando is te lang (rapporteer deze **programmafout**)" +#: src/datamash.c:1147 +msgid "-s and -z cannot be combined on this system" +msgstr "" -#: src/datamash.c:1105 +#: src/datamash.c:1181 msgid "failed to run 'sort': popen failed" msgstr "het aanroepen van 'sort' is mislukt: 'popen()' faalde" -#: src/datamash.c:1121 +#: src/datamash.c:1197 msgid "read error" msgstr "fout bij lezen" -#: src/datamash.c:1129 +#: src/datamash.c:1205 msgid "read error (on close)" msgstr "leesfout (bij sluiten)" -#: src/datamash.c:1222 src/datamash.c:1229 +#: src/datamash.c:1300 src/datamash.c:1307 src/datamash.c:1323 msgid "the delimiter must be a single character" msgstr "het scheidingsteken moet een enkel teken zijn" -#: src/datamash.c:1265 +#: src/datamash.c:1354 #, c-format msgid "missing operation specifiers" msgstr "ontbrekende bewerkingsaanduidingen" -#: src/datamash.c:1283 +#: src/datamash.c:1372 msgid "-H or --header-in must be used with named columns" msgstr "optie '-H' of '--header-in' moet samen met kolomnamen gebruikt worden" #: src/decorate-functions.c:76 #, fuzzy, c-format -#| msgid "invalid empty grouping parameter" msgid "invalid empty roman numeral" msgstr "ongeldige lege groeperingsparameter" #: src/decorate-functions.c:84 #, fuzzy, c-format -#| msgid "invalid numeric value '%s'" msgid "invalid roman numeral '%c' in %s" msgstr "ongeldige numerieke waarde '%s'" #: src/decorate-functions.c:120 #, fuzzy, c-format -#| msgid "invalid operand %s" msgid "invalid IPv4 address %s" msgstr "ongeldige operand %s" @@ -649,11 +678,24 @@ #: src/decorate-functions.c:165 #, fuzzy, c-format -#| msgid "invalid operand %s" msgid "invalid IPv6 address %s" msgstr "ongeldige operand %s" -#: src/decorate.c:140 +#: src/decorate-functions.c:192 +msgid "inet_pton failed for AF_INET and AF_INET6" +msgstr "" + +#: src/decorate-functions.c:196 +#, fuzzy, c-format +msgid "invalid IP address %s" +msgstr "ongeldige operand %s" + +#. This is a proper name. See the gettext manual, section Names. +#: src/decorate.c:42 +msgid "Assaf Gordon, Shawn Wagner and Erik Auerswald" +msgstr "" + +#: src/decorate.c:145 #, c-format msgid "" "Usage: %s [OPTION]... [INPUT]\n" @@ -662,29 +704,29 @@ "\n" msgstr "" -#: src/decorate.c:147 +#: src/decorate.c:152 msgid "Converts (and optionally sorts) fields of various formats\n" msgstr "" -#: src/decorate.c:153 +#: src/decorate.c:158 msgid "" "With --decorate: adds the converted fields to the start\n" "of each line and prints and prints it to STDOUT; does not sort.\n" msgstr "" -#: src/decorate.c:160 +#: src/decorate.c:165 msgid "" "With --undecorate: removes the first N fields from the input;\n" "Use as post-processing step after sort(1).\n" msgstr "" -#: src/decorate.c:167 +#: src/decorate.c:172 msgid "" "Without --decorate and --undecorate: automatically decorates the input,\n" "runs sort(1) and undecorates the result; This is the easiest method to use.\n" msgstr "" -#: src/decorate.c:179 +#: src/decorate.c:190 msgid "" " --decorate decorate/convert the specified fields and " "print\n" @@ -693,13 +735,13 @@ " sort(1) or undecorates the output\n" msgstr "" -#: src/decorate.c:184 +#: src/decorate.c:195 msgid "" " --header=N does not decorate or sort the first N lines\n" " -H same as --header=N\n" msgstr "" -#: src/decorate.c:188 +#: src/decorate.c:199 msgid "" " -k, --key=KEYDEF key/field to sort; same syntax as sort(1),\n" " optionally followed by ':method' to convert\n" @@ -708,17 +750,15 @@ " and available conversion below\n" msgstr "" -#: src/decorate.c:194 +#: src/decorate.c:205 #, fuzzy -#| msgid "" -#| " -t, --field-separator=X use X instead of TAB as field delimiter\n" msgid "" " -t, --field-separator=SEP use SEP instead of non-blank to blank " "transition\n" msgstr "" " -t, --field-separator=X dit teken als veldscheider gebruiken i.p.v. tab\n" -#: src/decorate.c:197 +#: src/decorate.c:208 msgid "" " --print-sort-args print adjusted parameters for sort(1); Useful\n" " when using --decorate and then manually " @@ -726,27 +766,26 @@ " sort(1)\n" msgstr "" -#: src/decorate.c:202 +#: src/decorate.c:213 #, fuzzy -#| msgid "" -#| " --no-strict allow lines with varying number of fields\n" msgid " --undecorate=N removes the first N fields\n" msgstr "" " --no-strict regels met een variërend aantal velden toestaan\n" -#: src/decorate.c:205 +#: src/decorate.c:216 #, fuzzy -#| msgid " -z, --zero-terminated end lines with 0 byte, not newline\n" msgid " -z, --zero-terminated line delimiter is NUL, not newline\n" msgstr "" " -z, --zero-terminated regels afsluiten met 0-byte, niet met " "nieuweregel\n" -#: src/decorate.c:213 -msgid "The following options are passed to sort(1) as-is:\n" +#: src/decorate.c:227 +msgid "" +"The following options are passed to sort as-is (Most of them assume GNU " +"sort):\n" msgstr "" -#: src/decorate.c:219 +#: src/decorate.c:234 msgid "" " -c, --check\n" " --compress-program\n" @@ -759,226 +798,219 @@ " --parallel\n" msgstr "" -#: src/decorate.c:234 +#: src/decorate.c:249 msgid "Available conversions methods (use with -k):\n" msgstr "" -#: src/decorate.c:246 +#: src/decorate.c:261 #, fuzzy -#| msgid "Examples:" msgid "Examples:\n" msgstr "Voorbeelden:" -#: src/decorate.c:252 +#: src/decorate.c:267 msgid "The following two invocations are equivalent:\n" msgstr "" -#: src/decorate.c:267 +#: src/decorate.c:282 msgid "Decorated output of roman numerals:\n" msgstr "" -#: src/decorate.c:431 +#: src/decorate.c:446 msgid "fwrite (header line) failed" msgstr "" -#: src/decorate.c:439 +#: src/decorate.c:454 msgid "fflush (header line) failed" msgstr "" -#: src/decorate.c:445 +#: src/decorate.c:460 #, c-format -msgid "conversion failed in line %zu" +msgid "conversion failed in line %" msgstr "" -#: src/decorate.c:451 +#: src/decorate.c:467 msgid "decorate: fwrite failed" msgstr "" -#: src/decorate.c:457 src/decorate.c:519 +#: src/decorate.c:473 src/decorate.c:535 #, c-format msgid "error reading %s" msgstr "" -#: src/decorate.c:538 +#: src/decorate.c:554 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number at field start" msgstr "ongeldige numerieke waarde '%s'" -#: src/decorate.c:543 src/decorate.c:571 +#: src/decorate.c:559 src/decorate.c:587 msgid "field number is zero" msgstr "" -#: src/decorate.c:548 src/decorate.c:576 +#: src/decorate.c:564 src/decorate.c:592 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number after '.'" msgstr "ongeldige numerieke waarde '%s'" -#: src/decorate.c:552 +#: src/decorate.c:568 msgid "character offset is zero" msgstr "" -#: src/decorate.c:567 +#: src/decorate.c:583 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number after ','" msgstr "ongeldige numerieke waarde '%s'" -#: src/decorate.c:603 +#: src/decorate.c:619 msgid "missing external conversion command" msgstr "" -#: src/decorate.c:618 +#: src/decorate.c:634 msgid "missing internal conversion function" msgstr "" -#: src/decorate.c:630 +#: src/decorate.c:646 #, fuzzy -#| msgid "invalid field pair for operation %s" msgid "invalid built-in conversion option" msgstr "ongeldig veldenpaar voor bewerking %s" -#: src/decorate.c:641 +#: src/decorate.c:657 msgid "" "ordering flags (b/d/i/h/n/g/M/R/V) cannot be combined with a conversion " "function" msgstr "" -#: src/decorate.c:671 +#: src/decorate.c:687 #, fuzzy -#| msgid "invalid operation %s" msgid "invalid key specification" msgstr "ongeldige bewerking %s" -#: src/decorate.c:853 +#: src/decorate.c:890 #, fuzzy, c-format -#| msgid "invalid numeric value '%s'" msgid "invalid number of header lines %s" msgstr "ongeldige numerieke waarde '%s'" -#: src/decorate.c:907 +#: src/decorate.c:948 msgid "empty tab" msgstr "" -#: src/decorate.c:918 +#: src/decorate.c:959 #, c-format msgid "multi-character tab %s" msgstr "" -#: src/decorate.c:923 +#: src/decorate.c:964 msgid "incompatible tabs" msgstr "" -#: src/decorate.c:945 +#: src/decorate.c:986 #, fuzzy, c-format -#| msgid "invalid field '%s' for operation %s" msgid "invalid number of fields to undecorate %s" msgstr "ongeldig veld '%s' voor bewerking %s" -#: src/decorate.c:968 +#: src/decorate.c:1009 msgid "--decorate and --undecorate options are mutually exclusive" msgstr "" -#: src/decorate.c:972 +#: src/decorate.c:1013 msgid "--undecorate cannot be used with --keys or --decorate" msgstr "" -#: src/decorate.c:976 +#: src/decorate.c:1017 msgid "missing -k/--key decoration or --undecorate options" msgstr "" -#: src/decorate.c:985 +#: src/decorate.c:1026 msgid "no decorated keys specified. use sort instead" msgstr "" -#: src/decorate.c:1024 +#: src/decorate.c:1060 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to create dec-sort pipe" msgstr "het aanroepen van 'sort' is mislukt: 'popen()' faalde" -#: src/decorate.c:1026 +#: src/decorate.c:1062 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to create sort-undec pipe" msgstr "het aanroepen van 'sort' is mislukt: 'popen()' faalde" -#: src/decorate.c:1033 +#: src/decorate.c:1069 msgid "failed to fork-1" msgstr "" -#: src/decorate.c:1040 +#: src/decorate.c:1076 msgid "failed to fork-2" msgstr "" -#: src/decorate.c:1052 src/decorate.c:1101 +#: src/decorate.c:1088 src/decorate.c:1137 msgid "failed to close sort-undec read-pipe" msgstr "" -#: src/decorate.c:1055 src/decorate.c:1140 +#: src/decorate.c:1091 src/decorate.c:1176 msgid "failed to close sort-undec write-pipe" msgstr "" -#: src/decorate.c:1057 src/decorate.c:1135 +#: src/decorate.c:1093 src/decorate.c:1171 msgid "failed to close dec-sort read-pipe" msgstr "" -#: src/decorate.c:1066 +#: src/decorate.c:1102 msgid "failed to dup STDOUT fd" msgstr "" -#: src/decorate.c:1069 +#: src/decorate.c:1105 msgid "fdopen (dup (stdout)) failed" msgstr "" -#: src/decorate.c:1074 +#: src/decorate.c:1110 msgid "failed to reassign dec-sort STDOUT" msgstr "" -#: src/decorate.c:1098 src/decorate.c:1137 +#: src/decorate.c:1134 src/decorate.c:1173 msgid "failed to close dec-sort write-pipe" msgstr "" -#: src/decorate.c:1106 +#: src/decorate.c:1142 msgid "failed to reassign dec-sort STDIN" msgstr "" -#: src/decorate.c:1112 +#: src/decorate.c:1148 msgid "failed to reassign sort-undec STDOUT" msgstr "" -#: src/decorate.c:1126 +#: src/decorate.c:1162 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to run the sort command" msgstr "het aanroepen van 'sort' is mislukt: 'popen()' faalde" -#: src/decorate.c:1144 +#: src/decorate.c:1180 msgid "failed to reassign sort-undec STDIN" msgstr "" -#: src/double-format.c:49 +#: src/double-format.c:45 +msgid "numeric format too large" +msgstr "" + +#: src/double-format.c:54 #, c-format msgid "format %s has no %% directive" msgstr "opmaak %s bevat geen '%%' directief" -#: src/double-format.c:62 +#: src/double-format.c:67 #, c-format msgid "format %s missing valid type after '%%'" msgstr "opmaak %s heeft geen geldig type na '%%'" -#: src/double-format.c:66 +#: src/double-format.c:71 #, c-format msgid "format %s has unknown/invalid type %%%c directive" msgstr "opmaak %s heeft onbekend/ongeldig type %%%c-directief" -#: src/double-format.c:79 +#: src/double-format.c:84 #, c-format msgid "format %s has too many %% directives" msgstr "opmaak %s heeft te veel %% directieven" -#: src/field-ops.c:346 +#: src/field-ops.c:351 #, c-format msgid "" "input error for operation %s: fields %,% have different " @@ -987,17 +1019,16 @@ "invoerfout voor bewerking %s: velden %,% hebben een " "verschillend aantal items" -#: src/field-ops.c:1176 +#: src/field-ops.c:1199 msgid "invalid numeric value" msgstr "ongeldige numerieke waarde" -#: src/field-ops.c:1178 +#: src/field-ops.c:1201 msgid "invalid base64 value" msgstr "ongeldige base64-waarde" #: src/key-compare.c:305 #, fuzzy, c-format -#| msgid "invalid field pair for operation %s" msgid "%s: invalid field specification %s" msgstr "ongeldig veldenpaar voor bewerking %s" @@ -1085,7 +1116,7 @@ msgid "conflicting operation %s" msgstr "conflicterende bewerking %s" -#: src/op-parser.c:499 src/op-parser.c:752 +#: src/op-parser.c:499 src/op-parser.c:758 #, c-format msgid "invalid operation %s" msgstr "ongeldige bewerking %s" @@ -1125,21 +1156,21 @@ msgid "crosstab requires exactly 2 fields, found %" msgstr "'crosstab' vereist precies 2 velden; % gevonden" -#: src/op-parser.c:705 +#: src/op-parser.c:711 #, c-format msgid "crosstab supports one operation, found %" msgstr "'crosstab' ondersteunt één bewerking; % gevonden" -#: src/op-parser.c:714 +#: src/op-parser.c:720 msgid "missing operation" msgstr "ontbrekende bewerking" -#: src/op-parser.c:728 +#: src/op-parser.c:734 #, c-format msgid "extra operand %s" msgstr "overtollige operand %s" -#: src/op-parser.c:865 src/op-scanner.c:237 +#: src/op-parser.c:874 src/op-scanner.c:237 msgid "missing script (among arguments)" msgstr "ontbrekend script (tussen argumenten)" @@ -1179,15 +1210,30 @@ msgid "Try '%s --help' for more information.\n" msgstr "Typ '%s --help' voor meer informatie.\n" -#: src/text-options.c:111 +#: src/text-options.c:109 msgid "missing rounding digits value" msgstr "ontbrekend aantal afrondingscijfers" -#: src/text-options.c:116 +#: src/text-options.c:114 #, c-format msgid "invalid rounding digits value %s" msgstr "ongeldig aantal afrondingscijfers %s" +#~ msgid "Assaf Gordon" +#~ msgstr "Assaf Gordon" + +#~ 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" +#~ " (standaard alleen de gegroepeerde " +#~ "sleutels)\n" + +#~ msgid "sort command too-long (please report this bug)" +#~ msgstr "het sorteercommando is te lang (rapporteer deze **programmafout**)" + #~ msgid "%s: option '--%s' doesn't allow an argument\n" #~ msgstr "%s: optie '--%s' staat geen argument toe\n" @@ -1212,9 +1258,6 @@ #~ 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" Binary files /tmp/tmpk9ju3y2l/uqkwDqQpWf/datamash-1.7/po/pt_BR.gmo and /tmp/tmpk9ju3y2l/ut88G7BZjZ/datamash-1.8/po/pt_BR.gmo differ diff -Nru datamash-1.7/po/pt_BR.po datamash-1.8/po/pt_BR.po --- datamash-1.7/po/pt_BR.po 2020-04-23 17:34:24.000000000 +0000 +++ datamash-1.8/po/pt_BR.po 2022-07-23 01:57:18.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: datamash 1.4.12.1\n" "Report-Msgid-Bugs-To: bug-datamash@gnu.org\n" -"POT-Creation-Date: 2020-04-23 11:34-0600\n" +"POT-Creation-Date: 2022-07-23 11:57+1000\n" "PO-Revision-Date: 2019-09-02 07:55-0200\n" "Last-Translator: Rafael Fontenelle \n" "Language-Team: Brazilian Portuguese #. and use glyphs suitable for your language. -#: lib/quotearg.c:362 +#: lib/quotearg.c:355 msgid "`" msgstr "“" -#: lib/quotearg.c:363 +#: lib/quotearg.c:356 msgid "'" msgstr "”" @@ -276,25 +276,25 @@ msgstr "argumento grande demais para %s%s: \"%s\"" #. This is a proper name. See the gettext manual, section Names. -#: src/datamash.c:65 src/decorate.c:41 -msgid "Assaf Gordon" -msgstr "Assaf Gordon" +#: src/datamash.c:66 +msgid "Assaf Gordon, Tim Rice, Shawn Wagner, Erik Auerswald" +msgstr "" -#: src/datamash.c:161 src/datamash.c:504 +#: src/datamash.c:169 src/datamash.c:539 #, 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:182 #, c-format 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:185 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 +#: src/datamash.c:188 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" @@ -302,7 +302,7 @@ "'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:183 +#: src/datamash.c:191 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" @@ -310,7 +310,7 @@ "\"fld\" é o campo para usar; \"fld\" pode ser um número (1=primeiro campo),\n" "ou um nome de campo ao usar as opções -H ou --header-in.\n" -#: src/datamash.c:186 +#: src/datamash.c:194 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" @@ -320,35 +320,39 @@ "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:191 +#: src/datamash.c:199 msgid "Primary operations:\n" msgstr "Operações primárias:\n" -#: src/datamash.c:194 +#: src/datamash.c:202 msgid "Line-Filtering operations:\n" msgstr "Operações de filtragem de linha:\n" -#: src/datamash.c:197 +#: src/datamash.c:205 msgid "Per-Line operations:\n" msgstr "Operações per-linha:\n" -#: src/datamash.c:203 +#: src/datamash.c:211 msgid "Numeric Grouping operations:\n" msgstr "Operações de argumento numérico:\n" -#: src/datamash.c:206 +#: src/datamash.c:214 msgid "Textual/Numeric Grouping operations:\n" msgstr "Operações de agrupamento numérico/textual:\n" -#: src/datamash.c:210 +#: src/datamash.c:218 msgid "Statistical Grouping operations:\n" msgstr "Operações de agrupamento estatístico:\n" -#: src/datamash.c:219 +#: src/datamash.c:227 src/decorate.c:179 +msgid "Options:\n" +msgstr "Opções:\n" + +#: src/datamash.c:229 msgid "Grouping Options:\n" msgstr "Opções de agrupamento:\n" -#: src/datamash.c:220 +#: src/datamash.c:230 msgid "" " -C, --skip-comments skip comment lines (starting with '#' or ';'\n" " and optional whitespace)\n" @@ -356,16 +360,17 @@ " -C, --skip-comments ignora linhas de comentários (começando com\n" " \"#\" ou \";\" e espaço em branco opcional)\n" -#: src/datamash.c:224 +#: src/datamash.c:234 msgid "" " -f, --full print entire input line before op results\n" " (default: print only the grouped keys)\n" +" This option is only sensible for linewise\n" +" operations. Other uses are deprecated and\n" +" will be removed in a future version of GNU\n" +" Datamash.\n" msgstr "" -" -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:228 +#: src/datamash.c:242 msgid "" " -g, --group=X[,Y,Z] group via fields X,[Y,Z];\n" " equivalent to primary operation 'groupby'\n" @@ -373,21 +378,21 @@ " -g, --group=X[,Y,Z] agrupa por campos X,[Y,Z];\n" " equivalente a operação primária \"groupby\"\n" -#: src/datamash.c:232 +#: src/datamash.c:246 msgid " --header-in first input line is column headers\n" msgstr "" " --header-in primeira linha de entrada é coluna de cabeçalho\n" -#: src/datamash.c:235 +#: src/datamash.c:249 msgid " --header-out print column headers as first line\n" msgstr "" " --header-out exibe cabeçalhos de coluna como primeira linha\n" -#: src/datamash.c:238 +#: src/datamash.c:252 msgid " -H, --headers same as '--header-in --header-out'\n" msgstr " -H, --headers mesmo que \"--header-in --header-out\"\n" -#: src/datamash.c:241 +#: src/datamash.c:255 msgid "" " -i, --ignore-case ignore upper/lower case when comparing text;\n" " this affects grouping, and string operations\n" @@ -396,7 +401,7 @@ " comparar textos; isso afeta agrupamento e\n" " operações textuais\n" -#: src/datamash.c:245 +#: src/datamash.c:259 msgid "" " -s, --sort sort the input before grouping; this removes " "the\n" @@ -407,31 +412,40 @@ " isso remove a necessidade de redirecionar\n" " manualmente a entrada por meio de \"sort\"\n" -#: src/datamash.c:250 +#: src/datamash.c:263 +#, fuzzy +msgid "" +" -c, --collapse-delimiter=X use X to separate elements in collapse and\n" +" unique lists (default: comma)\n" +msgstr "" +" --output-delimiter=X usa X em vez do delimitador de campo de saída\n" +" (padrão: usa o mesmo delimitador que -t/-W)\n" + +#: src/datamash.c:268 msgid "File Operation Options:\n" msgstr "Opções de operações com arquivos:\n" -#: src/datamash.c:251 +#: src/datamash.c:269 msgid " --no-strict allow lines with varying number of fields\n" msgstr "" " --no-strict permite linhas com número variável de campos\n" -#: src/datamash.c:254 +#: src/datamash.c:272 #, 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" -#: src/datamash.c:259 src/decorate.c:174 +#: src/datamash.c:277 src/decorate.c:185 msgid "General Options:\n" msgstr "Opções gerais:\n" -#: src/datamash.c:260 +#: src/datamash.c:278 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" -#: src/datamash.c:263 +#: src/datamash.c:281 msgid "" " --format=FORMAT print numeric values with printf style\n" " floating-point FORMAT.\n" @@ -439,7 +453,7 @@ " --format=FORMATO imprime valores numéricos com FORMATO\n" " ponto flutuante no estilo printf.\n" -#: src/datamash.c:267 +#: src/datamash.c:285 msgid "" " --output-delimiter=X use X instead as output field delimiter\n" " (default: use same delimiter as -t/-W)\n" @@ -447,17 +461,17 @@ " --output-delimiter=X usa X em vez do delimitador de campo de saída\n" " (padrão: usa o mesmo delimitador que -t/-W)\n" -#: src/datamash.c:271 +#: src/datamash.c:289 msgid " --narm skip NA/NaN values\n" msgstr " --narm ignora valores NA/NaN\n" -#: src/datamash.c:274 +#: src/datamash.c:292 msgid " -R, --round=N round numeric output to N decimal places\n" msgstr "" " -R, --round=N arredonda a saída numérica para N casas " "decimais\n" -#: src/datamash.c:277 +#: src/datamash.c:295 msgid "" " -W, --whitespace use whitespace (one or more spaces and/or tabs)\n" " for field delimiters\n" @@ -465,32 +479,44 @@ " -W, --whitespace usa espaço em branco (um ou mais espaços e/ou\n" " tabs) para delimitadores de campo\n" -#: src/datamash.c:281 +#: src/datamash.c:299 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" -#: src/datamash.c:290 +#: src/datamash.c:302 src/decorate.c:219 +msgid " --sort-cmd=/path/to/sort Alternative sort(1) to use.\n" +msgstr "" + +#: src/datamash.c:311 +msgid "Environment:" +msgstr "" + +#: src/datamash.c:313 +msgid " LC_NUMERIC decimal-point character and thousands separator\n" +msgstr "" + +#: src/datamash.c:319 msgid "Examples:" msgstr "Exemplos:" -#: src/datamash.c:292 +#: src/datamash.c:321 msgid "Print the sum and the mean of values from column 1:" msgstr "Exibe a soma e a média de valores da coluna 1:" -#: src/datamash.c:297 +#: src/datamash.c:326 msgid "Transpose input:" msgstr "Entrada da transposição:" -#: src/datamash.c:304 src/decorate.c:287 +#: src/datamash.c:333 src/decorate.c:302 msgid "For detailed usage information and examples, see\n" msgstr "Para exemplos e informação detalhada de uso, veja\n" -#: src/datamash.c:306 src/decorate.c:289 +#: src/datamash.c:335 src/decorate.c:304 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:315 +#: src/datamash.c:344 #, c-format msgid "" "invalid input: field % requested, line % has only " @@ -499,12 +525,18 @@ "entrada inválida: campo % requisitado, linha % tem apenas " "% campos" -#: src/datamash.c:385 +#: src/datamash.c:414 #, c-format msgid "%s in line % field %: '%s'" msgstr "%s na linha % campo %: \"%s\"" -#: src/datamash.c:713 +#: src/datamash.c:656 +msgid "" +"datamash: Using -f/--full with non-linewise operations is deprecated and " +"will be disabled in a future release.\n" +msgstr "" + +#: src/datamash.c:752 #, c-format msgid "" "transpose input error: line % has % fields (previous lines " @@ -515,7 +547,7 @@ "(linhas anteriores tinham %);\n" "veja --help para desabilitar o modo estrito" -#: src/datamash.c:770 +#: src/datamash.c:809 #, c-format msgid "" "reverse-field input error: line % has % fields (previous " @@ -526,7 +558,7 @@ "(linhas anteriores tinham %);\n" "veja --help para desabilitar o modo estrito" -#: src/datamash.c:879 src/datamash.c:896 src/datamash.c:902 +#: src/datamash.c:918 src/datamash.c:935 src/datamash.c:941 #, c-format msgid "" "line % (% fields):\n" @@ -535,7 +567,7 @@ "linha % (% campos):\n" " " -#: src/datamash.c:885 +#: src/datamash.c:924 #, c-format msgid "" "check failed: line % has % fields (expecting %)" @@ -543,7 +575,7 @@ "verificação falhou: a linha % tem % campos (esperava " "%)" -#: src/datamash.c:908 +#: src/datamash.c:947 #, c-format msgid "" "check failed: line % has % fields (previous line had " @@ -552,75 +584,72 @@ "verificação falhou: a linha % tem % campos (linha anterior " "tinham %)" -#: src/datamash.c:922 +#: src/datamash.c:961 #, c-format msgid "check failed: input had % lines (expecting %)" msgstr "" "verificação falhou: a entrada tinha % linhas (esperava-se " "%)" -#: src/datamash.c:928 +#: src/datamash.c:967 #, c-format msgid "% line" msgid_plural "% lines" msgstr[0] "% linha" msgstr[1] "% linhas" -#: src/datamash.c:931 +#: src/datamash.c:970 #, c-format msgid "% field" msgid_plural "% fields" msgstr[0] "% campo" msgstr[1] "% campos" -#: src/datamash.c:1032 +#: src/datamash.c:1080 msgid "hash memory allocation error" msgstr "erro de alocação de memória hash" -#: src/datamash.c:1099 -msgid "sort command too-long (please report this bug)" -msgstr "comando sort grande demais (por favor, relate esse erro)" +#: src/datamash.c:1147 +msgid "-s and -z cannot be combined on this system" +msgstr "" -#: src/datamash.c:1105 +#: src/datamash.c:1181 msgid "failed to run 'sort': popen failed" msgstr "falha ao executar \"sort\": popen falhou" -#: src/datamash.c:1121 +#: src/datamash.c:1197 msgid "read error" msgstr "erro de leitura" -#: src/datamash.c:1129 +#: src/datamash.c:1205 msgid "read error (on close)" msgstr "erro de leitura (ao fechar)" -#: src/datamash.c:1222 src/datamash.c:1229 +#: src/datamash.c:1300 src/datamash.c:1307 src/datamash.c:1323 msgid "the delimiter must be a single character" msgstr "o delimitador deve ser um caractere singular" -#: src/datamash.c:1265 +#: src/datamash.c:1354 #, c-format msgid "missing operation specifiers" msgstr "faltando especificadores de operação" -#: src/datamash.c:1283 +#: src/datamash.c:1372 msgid "-H or --header-in must be used with named columns" msgstr "-H ou --header-in devem ser usados com colunas nomeadas" #: src/decorate-functions.c:76 #, fuzzy, c-format -#| msgid "invalid empty grouping parameter" msgid "invalid empty roman numeral" msgstr "parâmetro de agrupamento vazio inválido" #: src/decorate-functions.c:84 #, fuzzy, c-format -#| msgid "invalid numeric value '%s'" msgid "invalid roman numeral '%c' in %s" msgstr "valor numérico inválido \"%s\"" #: src/decorate-functions.c:120 #, fuzzy, c-format -#| msgid "invalid operand %s" msgid "invalid IPv4 address %s" msgstr "operação inválida %s" @@ -639,11 +668,24 @@ #: src/decorate-functions.c:165 #, fuzzy, c-format -#| msgid "invalid operand %s" msgid "invalid IPv6 address %s" msgstr "operação inválida %s" -#: src/decorate.c:140 +#: src/decorate-functions.c:192 +msgid "inet_pton failed for AF_INET and AF_INET6" +msgstr "" + +#: src/decorate-functions.c:196 +#, fuzzy, c-format +msgid "invalid IP address %s" +msgstr "operação inválida %s" + +#. This is a proper name. See the gettext manual, section Names. +#: src/decorate.c:42 +msgid "Assaf Gordon, Shawn Wagner and Erik Auerswald" +msgstr "" + +#: src/decorate.c:145 #, c-format msgid "" "Usage: %s [OPTION]... [INPUT]\n" @@ -652,29 +694,29 @@ "\n" msgstr "" -#: src/decorate.c:147 +#: src/decorate.c:152 msgid "Converts (and optionally sorts) fields of various formats\n" msgstr "" -#: src/decorate.c:153 +#: src/decorate.c:158 msgid "" "With --decorate: adds the converted fields to the start\n" "of each line and prints and prints it to STDOUT; does not sort.\n" msgstr "" -#: src/decorate.c:160 +#: src/decorate.c:165 msgid "" "With --undecorate: removes the first N fields from the input;\n" "Use as post-processing step after sort(1).\n" msgstr "" -#: src/decorate.c:167 +#: src/decorate.c:172 msgid "" "Without --decorate and --undecorate: automatically decorates the input,\n" "runs sort(1) and undecorates the result; This is the easiest method to use.\n" msgstr "" -#: src/decorate.c:179 +#: src/decorate.c:190 msgid "" " --decorate decorate/convert the specified fields and " "print\n" @@ -683,13 +725,13 @@ " sort(1) or undecorates the output\n" msgstr "" -#: src/decorate.c:184 +#: src/decorate.c:195 msgid "" " --header=N does not decorate or sort the first N lines\n" " -H same as --header=N\n" msgstr "" -#: src/decorate.c:188 +#: src/decorate.c:199 msgid "" " -k, --key=KEYDEF key/field to sort; same syntax as sort(1),\n" " optionally followed by ':method' to convert\n" @@ -698,17 +740,15 @@ " and available conversion below\n" msgstr "" -#: src/decorate.c:194 +#: src/decorate.c:205 #, fuzzy -#| msgid "" -#| " -t, --field-separator=X use X instead of TAB as field delimiter\n" msgid "" " -t, --field-separator=SEP use SEP instead of non-blank to blank " "transition\n" msgstr "" " -t, --field-separator=X usa X ao invés de TAB como delimitador de campo\n" -#: src/decorate.c:197 +#: src/decorate.c:208 msgid "" " --print-sort-args print adjusted parameters for sort(1); Useful\n" " when using --decorate and then manually " @@ -716,26 +756,25 @@ " sort(1)\n" msgstr "" -#: src/decorate.c:202 +#: src/decorate.c:213 #, fuzzy -#| msgid "" -#| " --no-strict allow lines with varying number of fields\n" msgid " --undecorate=N removes the first N fields\n" msgstr "" " --no-strict permite linhas com número variável de campos\n" -#: src/decorate.c:205 +#: src/decorate.c:216 #, fuzzy -#| msgid " -z, --zero-terminated end lines with 0 byte, not newline\n" msgid " -z, --zero-terminated line delimiter is NUL, not newline\n" msgstr "" " -z, --zero-terminated finaliza linhas com 0 bytes, não nova linha\n" -#: src/decorate.c:213 -msgid "The following options are passed to sort(1) as-is:\n" +#: src/decorate.c:227 +msgid "" +"The following options are passed to sort as-is (Most of them assume GNU " +"sort):\n" msgstr "" -#: src/decorate.c:219 +#: src/decorate.c:234 msgid "" " -c, --check\n" " --compress-program\n" @@ -748,226 +787,219 @@ " --parallel\n" msgstr "" -#: src/decorate.c:234 +#: src/decorate.c:249 msgid "Available conversions methods (use with -k):\n" msgstr "" -#: src/decorate.c:246 +#: src/decorate.c:261 #, fuzzy -#| msgid "Examples:" msgid "Examples:\n" msgstr "Exemplos:" -#: src/decorate.c:252 +#: src/decorate.c:267 msgid "The following two invocations are equivalent:\n" msgstr "" -#: src/decorate.c:267 +#: src/decorate.c:282 msgid "Decorated output of roman numerals:\n" msgstr "" -#: src/decorate.c:431 +#: src/decorate.c:446 msgid "fwrite (header line) failed" msgstr "" -#: src/decorate.c:439 +#: src/decorate.c:454 msgid "fflush (header line) failed" msgstr "" -#: src/decorate.c:445 +#: src/decorate.c:460 #, c-format -msgid "conversion failed in line %zu" +msgid "conversion failed in line %" msgstr "" -#: src/decorate.c:451 +#: src/decorate.c:467 msgid "decorate: fwrite failed" msgstr "" -#: src/decorate.c:457 src/decorate.c:519 +#: src/decorate.c:473 src/decorate.c:535 #, c-format msgid "error reading %s" msgstr "" -#: src/decorate.c:538 +#: src/decorate.c:554 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number at field start" msgstr "valor numérico inválido \"%s\"" -#: src/decorate.c:543 src/decorate.c:571 +#: src/decorate.c:559 src/decorate.c:587 msgid "field number is zero" msgstr "" -#: src/decorate.c:548 src/decorate.c:576 +#: src/decorate.c:564 src/decorate.c:592 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number after '.'" msgstr "valor numérico inválido \"%s\"" -#: src/decorate.c:552 +#: src/decorate.c:568 msgid "character offset is zero" msgstr "" -#: src/decorate.c:567 +#: src/decorate.c:583 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number after ','" msgstr "valor numérico inválido \"%s\"" -#: src/decorate.c:603 +#: src/decorate.c:619 msgid "missing external conversion command" msgstr "" -#: src/decorate.c:618 +#: src/decorate.c:634 msgid "missing internal conversion function" msgstr "" -#: src/decorate.c:630 +#: src/decorate.c:646 #, fuzzy -#| msgid "invalid field pair for operation %s" msgid "invalid built-in conversion option" msgstr "par de campos inválido para a operação %s" -#: src/decorate.c:641 +#: src/decorate.c:657 msgid "" "ordering flags (b/d/i/h/n/g/M/R/V) cannot be combined with a conversion " "function" msgstr "" -#: src/decorate.c:671 +#: src/decorate.c:687 #, fuzzy -#| msgid "invalid operation %s" msgid "invalid key specification" msgstr "operação inválida %s" -#: src/decorate.c:853 +#: src/decorate.c:890 #, fuzzy, c-format -#| msgid "invalid numeric value '%s'" msgid "invalid number of header lines %s" msgstr "valor numérico inválido \"%s\"" -#: src/decorate.c:907 +#: src/decorate.c:948 msgid "empty tab" msgstr "" -#: src/decorate.c:918 +#: src/decorate.c:959 #, c-format msgid "multi-character tab %s" msgstr "" -#: src/decorate.c:923 +#: src/decorate.c:964 msgid "incompatible tabs" msgstr "" -#: src/decorate.c:945 +#: src/decorate.c:986 #, fuzzy, c-format -#| msgid "invalid field '%s' for operation %s" msgid "invalid number of fields to undecorate %s" msgstr "\"%s\" de campo inválido para a operação %s" -#: src/decorate.c:968 +#: src/decorate.c:1009 msgid "--decorate and --undecorate options are mutually exclusive" msgstr "" -#: src/decorate.c:972 +#: src/decorate.c:1013 msgid "--undecorate cannot be used with --keys or --decorate" msgstr "" -#: src/decorate.c:976 +#: src/decorate.c:1017 msgid "missing -k/--key decoration or --undecorate options" msgstr "" -#: src/decorate.c:985 +#: src/decorate.c:1026 msgid "no decorated keys specified. use sort instead" msgstr "" -#: src/decorate.c:1024 +#: src/decorate.c:1060 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to create dec-sort pipe" msgstr "falha ao executar \"sort\": popen falhou" -#: src/decorate.c:1026 +#: src/decorate.c:1062 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to create sort-undec pipe" msgstr "falha ao executar \"sort\": popen falhou" -#: src/decorate.c:1033 +#: src/decorate.c:1069 msgid "failed to fork-1" msgstr "" -#: src/decorate.c:1040 +#: src/decorate.c:1076 msgid "failed to fork-2" msgstr "" -#: src/decorate.c:1052 src/decorate.c:1101 +#: src/decorate.c:1088 src/decorate.c:1137 msgid "failed to close sort-undec read-pipe" msgstr "" -#: src/decorate.c:1055 src/decorate.c:1140 +#: src/decorate.c:1091 src/decorate.c:1176 msgid "failed to close sort-undec write-pipe" msgstr "" -#: src/decorate.c:1057 src/decorate.c:1135 +#: src/decorate.c:1093 src/decorate.c:1171 msgid "failed to close dec-sort read-pipe" msgstr "" -#: src/decorate.c:1066 +#: src/decorate.c:1102 msgid "failed to dup STDOUT fd" msgstr "" -#: src/decorate.c:1069 +#: src/decorate.c:1105 msgid "fdopen (dup (stdout)) failed" msgstr "" -#: src/decorate.c:1074 +#: src/decorate.c:1110 msgid "failed to reassign dec-sort STDOUT" msgstr "" -#: src/decorate.c:1098 src/decorate.c:1137 +#: src/decorate.c:1134 src/decorate.c:1173 msgid "failed to close dec-sort write-pipe" msgstr "" -#: src/decorate.c:1106 +#: src/decorate.c:1142 msgid "failed to reassign dec-sort STDIN" msgstr "" -#: src/decorate.c:1112 +#: src/decorate.c:1148 msgid "failed to reassign sort-undec STDOUT" msgstr "" -#: src/decorate.c:1126 +#: src/decorate.c:1162 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to run the sort command" msgstr "falha ao executar \"sort\": popen falhou" -#: src/decorate.c:1144 +#: src/decorate.c:1180 msgid "failed to reassign sort-undec STDIN" msgstr "" -#: src/double-format.c:49 +#: src/double-format.c:45 +msgid "numeric format too large" +msgstr "" + +#: src/double-format.c:54 #, c-format msgid "format %s has no %% directive" msgstr "o formato %s não possui uma diretiva %%" -#: src/double-format.c:62 +#: src/double-format.c:67 #, c-format msgid "format %s missing valid type after '%%'" msgstr "o formato %s carece de um tipo válido após \"%%\"" -#: src/double-format.c:66 +#: src/double-format.c:71 #, c-format msgid "format %s has unknown/invalid type %%%c directive" msgstr "o formato %s possui um tipo desconhecido/inválido de diretiva %%%c" -#: src/double-format.c:79 +#: src/double-format.c:84 #, c-format msgid "format %s has too many %% directives" msgstr "o formato %s possui um número excessivo de diretivas %%" -#: src/field-ops.c:346 +#: src/field-ops.c:351 #, c-format msgid "" "input error for operation %s: fields %,% have different " @@ -976,17 +1008,16 @@ "erro de entrada para a operação %s: campos %,% tem número " "diferente de itens" -#: src/field-ops.c:1176 +#: src/field-ops.c:1199 msgid "invalid numeric value" msgstr "valor numérico inválido" -#: src/field-ops.c:1178 +#: src/field-ops.c:1201 msgid "invalid base64 value" msgstr "valor base64 inválido" #: src/key-compare.c:305 #, fuzzy, c-format -#| msgid "invalid field pair for operation %s" msgid "%s: invalid field specification %s" msgstr "par de campos inválido para a operação %s" @@ -1071,7 +1102,7 @@ msgid "conflicting operation %s" msgstr "operação conflitante %s" -#: src/op-parser.c:499 src/op-parser.c:752 +#: src/op-parser.c:499 src/op-parser.c:758 #, c-format msgid "invalid operation %s" msgstr "operação inválida %s" @@ -1112,21 +1143,21 @@ msgid "crosstab requires exactly 2 fields, found %" msgstr "crosstab requer exatamente 2 campos, encontrado(s) %" -#: src/op-parser.c:705 +#: src/op-parser.c:711 #, c-format msgid "crosstab supports one operation, found %" msgstr "crosstab oferece suporte a apenas uma operação, encontradas %" -#: src/op-parser.c:714 +#: src/op-parser.c:720 msgid "missing operation" msgstr "faltando a operação" -#: src/op-parser.c:728 +#: src/op-parser.c:734 #, c-format msgid "extra operand %s" msgstr "operando extra %s" -#: src/op-parser.c:865 src/op-scanner.c:237 +#: src/op-parser.c:874 src/op-scanner.c:237 msgid "missing script (among arguments)" msgstr "faltando script (dentre argumentos)" @@ -1168,15 +1199,29 @@ msgid "Try '%s --help' for more information.\n" msgstr "Tente \"%s --help\" para mais informações.\n" -#: src/text-options.c:111 +#: src/text-options.c:109 msgid "missing rounding digits value" msgstr "faltando valor de dígitos de arredondamento" -#: src/text-options.c:116 +#: src/text-options.c:114 #, c-format msgid "invalid rounding digits value %s" msgstr "valor de dígitos de arredondamento inválido %s" +#~ msgid "Assaf Gordon" +#~ msgstr "Assaf Gordon" + +#~ 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" +#~ " (padrão: exibe apenas as chaves agrupadas)\n" + +#~ msgid "sort command too-long (please report this bug)" +#~ msgstr "comando sort grande demais (por favor, relate esse erro)" + #~ msgid "%s home page: \n" #~ msgstr "Página do %s: \n" @@ -1201,9 +1246,6 @@ #~ 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" Binary files /tmp/tmpk9ju3y2l/uqkwDqQpWf/datamash-1.7/po/sr.gmo and /tmp/tmpk9ju3y2l/ut88G7BZjZ/datamash-1.8/po/sr.gmo differ diff -Nru datamash-1.7/po/sr.po datamash-1.8/po/sr.po --- datamash-1.7/po/sr.po 2020-04-23 17:34:24.000000000 +0000 +++ datamash-1.8/po/sr.po 2022-07-23 01:57:18.000000000 +0000 @@ -6,7 +6,7 @@ msgstr "" "Project-Id-Version: datamash-1.4.12.1\n" "Report-Msgid-Bugs-To: bug-datamash@gnu.org\n" -"POT-Creation-Date: 2020-04-23 11:34-0600\n" +"POT-Creation-Date: 2022-07-23 11:57+1000\n" "PO-Revision-Date: 2020-03-31 16:53+0200\n" "Last-Translator: Мирослав Николић \n" "Language-Team: Serbian <(nothing)>\n" @@ -83,11 +83,11 @@ #. If you don't know what to put here, please see #. #. and use glyphs suitable for your language. -#: lib/quotearg.c:362 +#: lib/quotearg.c:355 msgid "`" msgstr "„" -#: lib/quotearg.c:363 +#: lib/quotearg.c:356 msgid "'" msgstr "“" @@ -273,25 +273,25 @@ msgstr "%s%s аргумент „%s“ је превелик" #. This is a proper name. See the gettext manual, section Names. -#: src/datamash.c:65 src/decorate.c:41 -msgid "Assaf Gordon" -msgstr "Асаф Гордон" +#: src/datamash.c:66 +msgid "Assaf Gordon, Tim Rice, Shawn Wagner, Erik Auerswald" +msgstr "" -#: src/datamash.c:161 src/datamash.c:504 +#: src/datamash.c:169 src/datamash.c:539 #, c-format msgid "column name %s not found in input file" msgstr "нисам нашао назив ступца „%s“ у улазној датотеци" -#: src/datamash.c:174 +#: src/datamash.c:182 #, c-format msgid "Usage: %s [OPTION] op [fld] [op fld ...]\n" msgstr "Употреба: %s [ОПЦИЈА] op [fld] [op fld ...]\n" -#: src/datamash.c:177 +#: src/datamash.c:185 msgid "Performs numeric/string operations on input from stdin." msgstr "Обавите радње бројева/ниски на улазу из стандардног улаза." -#: src/datamash.c:180 +#: src/datamash.c:188 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" @@ -299,7 +299,7 @@ "„op“ је радња за обављање. Ако се користи примарна радња,\n" "мора бити наведена прва, за којом по избору следе друге радње.\n" -#: src/datamash.c:183 +#: src/datamash.c:191 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" @@ -307,7 +307,7 @@ "„fld“ је улазно поље за коришћење; „fld“ може бити број (1=прво поље),\n" "или назив поља када се користе опције „-H“ или „--header-in“.\n" -#: src/datamash.c:186 +#: src/datamash.c:194 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" @@ -317,35 +317,39 @@ "може бити наведен цртицом (нпр. 2-8). Користите двотачке за\n" "радње које захтевају пар поља (нпр. „pcov 2:6“).\n" -#: src/datamash.c:191 +#: src/datamash.c:199 msgid "Primary operations:\n" msgstr "Примарне радње:\n" -#: src/datamash.c:194 +#: src/datamash.c:202 msgid "Line-Filtering operations:\n" msgstr "Радње издвајања редова:\n" -#: src/datamash.c:197 +#: src/datamash.c:205 msgid "Per-Line operations:\n" msgstr "Радње над редовима:\n" -#: src/datamash.c:203 +#: src/datamash.c:211 msgid "Numeric Grouping operations:\n" msgstr "Радње бројевног груписања:\n" -#: src/datamash.c:206 +#: src/datamash.c:214 msgid "Textual/Numeric Grouping operations:\n" msgstr "Радње текстуалног/бројевног груписања:\n" -#: src/datamash.c:210 +#: src/datamash.c:218 msgid "Statistical Grouping operations:\n" msgstr "Радње статистичког груписања:\n" -#: src/datamash.c:219 +#: src/datamash.c:227 src/decorate.c:179 +msgid "Options:\n" +msgstr "Опције:\n" + +#: src/datamash.c:229 msgid "Grouping Options:\n" msgstr "Опције груписања:\n" -#: src/datamash.c:220 +#: src/datamash.c:230 msgid "" " -C, --skip-comments skip comment lines (starting with '#' or ';'\n" " and optional whitespace)\n" @@ -354,15 +358,17 @@ "или ;\n" " и по могућству празнином)\n" -#: src/datamash.c:224 +#: src/datamash.c:234 msgid "" " -f, --full print entire input line before op results\n" " (default: print only the grouped keys)\n" +" This option is only sensible for linewise\n" +" operations. Other uses are deprecated and\n" +" will be removed in a future version of GNU\n" +" Datamash.\n" msgstr "" -" -f, --full исписује читави улазни ред пре оп резултата\n" -" (основно: исписује само груписане кључеве)\n" -#: src/datamash.c:228 +#: src/datamash.c:242 msgid "" " -g, --group=X[,Y,Z] group via fields X,[Y,Z];\n" " equivalent to primary operation 'groupby'\n" @@ -370,19 +376,19 @@ " -g, --group=X[,Y,Z] групише путем поља X,[Y,Z];\n" " еквивалент примарној радњи „groupby“\n" -#: src/datamash.c:232 +#: src/datamash.c:246 msgid " --header-in first input line is column headers\n" msgstr " --header-in први улазни ред јесу заглавља ступца\n" -#: src/datamash.c:235 +#: src/datamash.c:249 msgid " --header-out print column headers as first line\n" msgstr " --header-out исписује заглавља ступца као први ред\n" -#: src/datamash.c:238 +#: src/datamash.c:252 msgid " -H, --headers same as '--header-in --header-out'\n" msgstr " -H, --headers исто као „--header-in --header-out“\n" -#: src/datamash.c:241 +#: src/datamash.c:255 msgid "" " -i, --ignore-case ignore upper/lower case when comparing text;\n" " this affects grouping, and string operations\n" @@ -390,7 +396,7 @@ " -i, --ignore-case занемарује велика/мала слова када пореди текст;\n" " ово утиче на груписање, и на радње ниске\n" -#: src/datamash.c:245 +#: src/datamash.c:259 msgid "" " -s, --sort sort the input before grouping; this removes " "the\n" @@ -400,32 +406,41 @@ " -s, --sort ређа улаз пре груписања; ово уклања потребу\n" " за ручним преспајањем улаза кроз „sort“\n" -#: src/datamash.c:250 +#: src/datamash.c:263 +#, fuzzy +msgid "" +" -c, --collapse-delimiter=X use X to separate elements in collapse and\n" +" unique lists (default: comma)\n" +msgstr "" +" --output-delimiter=X користи „X“ као граничник поља излаза\n" +" (основно: користи исти граничник као „-t/-W“)\n" + +#: src/datamash.c:268 msgid "File Operation Options:\n" msgstr "Опције радње датотеке:\n" -#: src/datamash.c:251 +#: src/datamash.c:269 msgid " --no-strict allow lines with varying number of fields\n" msgstr "" " --no-strict допушта редове са променљивим бројем поља\n" -#: src/datamash.c:254 +#: src/datamash.c:272 #, c-format msgid " --filler=X fill missing values with X (default %s)\n" msgstr "" " --filler=X попуњава недостајуће вредности са X (основно " "%s)\n" -#: src/datamash.c:259 src/decorate.c:174 +#: src/datamash.c:277 src/decorate.c:185 msgid "General Options:\n" msgstr "Опште опције:\n" -#: src/datamash.c:260 +#: src/datamash.c:278 msgid " -t, --field-separator=X use X instead of TAB as field delimiter\n" msgstr "" " -t, --field-separator=X користи X уместо табулатора као граничника поља\n" -#: src/datamash.c:263 +#: src/datamash.c:281 msgid "" " --format=FORMAT print numeric values with printf style\n" " floating-point FORMAT.\n" @@ -433,7 +448,7 @@ " --format=ЗАПИС исписује бројевне вредности са „printf“ стилом\n" " покретни зарез ЗАПИС.\n" -#: src/datamash.c:267 +#: src/datamash.c:285 msgid "" " --output-delimiter=X use X instead as output field delimiter\n" " (default: use same delimiter as -t/-W)\n" @@ -441,16 +456,16 @@ " --output-delimiter=X користи „X“ као граничник поља излаза\n" " (основно: користи исти граничник као „-t/-W“)\n" -#: src/datamash.c:271 +#: src/datamash.c:289 msgid " --narm skip NA/NaN values\n" msgstr " --narm прескаче вредности „NA/NaN“\n" -#: src/datamash.c:274 +#: src/datamash.c:292 msgid " -R, --round=N round numeric output to N decimal places\n" msgstr "" " -R, --round=N заокружује бројевни излаз на N децимална места\n" -#: src/datamash.c:277 +#: src/datamash.c:295 msgid "" " -W, --whitespace use whitespace (one or more spaces and/or tabs)\n" " for field delimiters\n" @@ -459,31 +474,43 @@ "табулаторе)\n" " за граничнике поља\n" -#: src/datamash.c:281 +#: src/datamash.c:299 msgid " -z, --zero-terminated end lines with 0 byte, not newline\n" msgstr " -z, --zero-terminated завршава редове 0 бајтом, не новим редом\n" -#: src/datamash.c:290 +#: src/datamash.c:302 src/decorate.c:219 +msgid " --sort-cmd=/path/to/sort Alternative sort(1) to use.\n" +msgstr "" + +#: src/datamash.c:311 +msgid "Environment:" +msgstr "" + +#: src/datamash.c:313 +msgid " LC_NUMERIC decimal-point character and thousands separator\n" +msgstr "" + +#: src/datamash.c:319 msgid "Examples:" msgstr "Примери:" -#: src/datamash.c:292 +#: src/datamash.c:321 msgid "Print the sum and the mean of values from column 1:" msgstr "Исписује збир и средње вредности из 1. ступца:" -#: src/datamash.c:297 +#: src/datamash.c:326 msgid "Transpose input:" msgstr "Улаз премештања:" -#: src/datamash.c:304 src/decorate.c:287 +#: src/datamash.c:333 src/decorate.c:302 msgid "For detailed usage information and examples, see\n" msgstr "За више података о коришћењу и примере, видите\n" -#: src/datamash.c:306 src/decorate.c:289 +#: src/datamash.c:335 src/decorate.c:304 msgid "The manual and more examples are available at\n" msgstr "Приручник и још примера је доступно на\n" -#: src/datamash.c:315 +#: src/datamash.c:344 #, c-format msgid "" "invalid input: field % requested, line % has only " @@ -492,12 +519,18 @@ "неисправан улаз: затражено је поље %, %. ред има само " "% поља" -#: src/datamash.c:385 +#: src/datamash.c:414 #, c-format msgid "%s in line % field %: '%s'" msgstr "%s у %. реду поље %: „%s“" -#: src/datamash.c:713 +#: src/datamash.c:656 +msgid "" +"datamash: Using -f/--full with non-linewise operations is deprecated and " +"will be disabled in a future release.\n" +msgstr "" + +#: src/datamash.c:752 #, c-format msgid "" "transpose input error: line % has % fields (previous lines " @@ -508,7 +541,7 @@ "има %);\n" "видите „--help“ да искључите искључиви режим" -#: src/datamash.c:770 +#: src/datamash.c:809 #, c-format msgid "" "reverse-field input error: line % has % fields (previous " @@ -519,7 +552,7 @@ "(претходни ред има %);\n" "видите „--help“ да искључите искључиви режим" -#: src/datamash.c:879 src/datamash.c:896 src/datamash.c:902 +#: src/datamash.c:918 src/datamash.c:935 src/datamash.c:941 #, c-format msgid "" "line % (% fields):\n" @@ -528,7 +561,7 @@ "%. ред (поље %):\n" " " -#: src/datamash.c:885 +#: src/datamash.c:924 #, c-format msgid "" "check failed: line % has % fields (expecting %)" @@ -536,7 +569,7 @@ "провера није успела: %. ред има % поља (очекујем " "%)" -#: src/datamash.c:908 +#: src/datamash.c:947 #, c-format msgid "" "check failed: line % has % fields (previous line had " @@ -545,12 +578,12 @@ "провера није успела: %. ред има % поља (претходни ред има " "%)" -#: src/datamash.c:922 +#: src/datamash.c:961 #, c-format msgid "check failed: input had % lines (expecting %)" msgstr "провера није успела: унос има % реда (очекујем %)" -#: src/datamash.c:928 +#: src/datamash.c:967 #, c-format msgid "% line" msgid_plural "% lines" @@ -558,7 +591,7 @@ msgstr[1] "% реда" msgstr[2] "% редова" -#: src/datamash.c:931 +#: src/datamash.c:970 #, c-format msgid "% field" msgid_plural "% fields" @@ -566,54 +599,51 @@ msgstr[1] "% поља" msgstr[2] "% поља" -#: src/datamash.c:1032 +#: src/datamash.c:1080 msgid "hash memory allocation error" msgstr "грешка доделе хеш меморије" -#: src/datamash.c:1099 -msgid "sort command too-long (please report this bug)" -msgstr "наредба ређања је предуга (пријавите ову грешку)" +#: src/datamash.c:1147 +msgid "-s and -z cannot be combined on this system" +msgstr "" -#: src/datamash.c:1105 +#: src/datamash.c:1181 msgid "failed to run 'sort': popen failed" msgstr "нисам успео да покренем „sort“: није успело „popen“" -#: src/datamash.c:1121 +#: src/datamash.c:1197 msgid "read error" msgstr "грешка читања" -#: src/datamash.c:1129 +#: src/datamash.c:1205 msgid "read error (on close)" msgstr "грешка читања (при затварању)" -#: src/datamash.c:1222 src/datamash.c:1229 +#: src/datamash.c:1300 src/datamash.c:1307 src/datamash.c:1323 msgid "the delimiter must be a single character" msgstr "граничник мора бити један знак" -#: src/datamash.c:1265 +#: src/datamash.c:1354 #, c-format msgid "missing operation specifiers" msgstr "недостају одредници радње" -#: src/datamash.c:1283 +#: src/datamash.c:1372 msgid "-H or --header-in must be used with named columns" msgstr "„-H“ или „--header-in“ мора да се користи са именованим ступцима" #: src/decorate-functions.c:76 #, fuzzy, c-format -#| msgid "invalid empty grouping parameter" msgid "invalid empty roman numeral" msgstr "неисправан параметар празног груписања" #: src/decorate-functions.c:84 #, fuzzy, c-format -#| msgid "invalid numeric value '%s'" msgid "invalid roman numeral '%c' in %s" msgstr "неисправна бројевна вредност „%s“" #: src/decorate-functions.c:120 #, fuzzy, c-format -#| msgid "invalid operand %s" msgid "invalid IPv4 address %s" msgstr "неисправан операнд „%s“" @@ -632,11 +662,24 @@ #: src/decorate-functions.c:165 #, fuzzy, c-format -#| msgid "invalid operand %s" msgid "invalid IPv6 address %s" msgstr "неисправан операнд „%s“" -#: src/decorate.c:140 +#: src/decorate-functions.c:192 +msgid "inet_pton failed for AF_INET and AF_INET6" +msgstr "" + +#: src/decorate-functions.c:196 +#, fuzzy, c-format +msgid "invalid IP address %s" +msgstr "неисправан операнд „%s“" + +#. This is a proper name. See the gettext manual, section Names. +#: src/decorate.c:42 +msgid "Assaf Gordon, Shawn Wagner and Erik Auerswald" +msgstr "" + +#: src/decorate.c:145 #, c-format msgid "" "Usage: %s [OPTION]... [INPUT]\n" @@ -645,29 +688,29 @@ "\n" msgstr "" -#: src/decorate.c:147 +#: src/decorate.c:152 msgid "Converts (and optionally sorts) fields of various formats\n" msgstr "" -#: src/decorate.c:153 +#: src/decorate.c:158 msgid "" "With --decorate: adds the converted fields to the start\n" "of each line and prints and prints it to STDOUT; does not sort.\n" msgstr "" -#: src/decorate.c:160 +#: src/decorate.c:165 msgid "" "With --undecorate: removes the first N fields from the input;\n" "Use as post-processing step after sort(1).\n" msgstr "" -#: src/decorate.c:167 +#: src/decorate.c:172 msgid "" "Without --decorate and --undecorate: automatically decorates the input,\n" "runs sort(1) and undecorates the result; This is the easiest method to use.\n" msgstr "" -#: src/decorate.c:179 +#: src/decorate.c:190 msgid "" " --decorate decorate/convert the specified fields and " "print\n" @@ -676,13 +719,13 @@ " sort(1) or undecorates the output\n" msgstr "" -#: src/decorate.c:184 +#: src/decorate.c:195 msgid "" " --header=N does not decorate or sort the first N lines\n" " -H same as --header=N\n" msgstr "" -#: src/decorate.c:188 +#: src/decorate.c:199 msgid "" " -k, --key=KEYDEF key/field to sort; same syntax as sort(1),\n" " optionally followed by ':method' to convert\n" @@ -691,17 +734,15 @@ " and available conversion below\n" msgstr "" -#: src/decorate.c:194 +#: src/decorate.c:205 #, fuzzy -#| msgid "" -#| " -t, --field-separator=X use X instead of TAB as field delimiter\n" msgid "" " -t, --field-separator=SEP use SEP instead of non-blank to blank " "transition\n" msgstr "" " -t, --field-separator=X користи X уместо табулатора као граничника поља\n" -#: src/decorate.c:197 +#: src/decorate.c:208 msgid "" " --print-sort-args print adjusted parameters for sort(1); Useful\n" " when using --decorate and then manually " @@ -709,25 +750,24 @@ " sort(1)\n" msgstr "" -#: src/decorate.c:202 +#: src/decorate.c:213 #, fuzzy -#| msgid "" -#| " --no-strict allow lines with varying number of fields\n" msgid " --undecorate=N removes the first N fields\n" msgstr "" " --no-strict допушта редове са променљивим бројем поља\n" -#: src/decorate.c:205 +#: src/decorate.c:216 #, fuzzy -#| msgid " -z, --zero-terminated end lines with 0 byte, not newline\n" msgid " -z, --zero-terminated line delimiter is NUL, not newline\n" msgstr " -z, --zero-terminated завршава редове 0 бајтом, не новим редом\n" -#: src/decorate.c:213 -msgid "The following options are passed to sort(1) as-is:\n" +#: src/decorate.c:227 +msgid "" +"The following options are passed to sort as-is (Most of them assume GNU " +"sort):\n" msgstr "" -#: src/decorate.c:219 +#: src/decorate.c:234 msgid "" " -c, --check\n" " --compress-program\n" @@ -740,226 +780,219 @@ " --parallel\n" msgstr "" -#: src/decorate.c:234 +#: src/decorate.c:249 msgid "Available conversions methods (use with -k):\n" msgstr "" -#: src/decorate.c:246 +#: src/decorate.c:261 #, fuzzy -#| msgid "Examples:" msgid "Examples:\n" msgstr "Примери:" -#: src/decorate.c:252 +#: src/decorate.c:267 msgid "The following two invocations are equivalent:\n" msgstr "" -#: src/decorate.c:267 +#: src/decorate.c:282 msgid "Decorated output of roman numerals:\n" msgstr "" -#: src/decorate.c:431 +#: src/decorate.c:446 msgid "fwrite (header line) failed" msgstr "" -#: src/decorate.c:439 +#: src/decorate.c:454 msgid "fflush (header line) failed" msgstr "" -#: src/decorate.c:445 +#: src/decorate.c:460 #, c-format -msgid "conversion failed in line %zu" +msgid "conversion failed in line %" msgstr "" -#: src/decorate.c:451 +#: src/decorate.c:467 msgid "decorate: fwrite failed" msgstr "" -#: src/decorate.c:457 src/decorate.c:519 +#: src/decorate.c:473 src/decorate.c:535 #, c-format msgid "error reading %s" msgstr "" -#: src/decorate.c:538 +#: src/decorate.c:554 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number at field start" msgstr "неисправна бројевна вредност „%s“" -#: src/decorate.c:543 src/decorate.c:571 +#: src/decorate.c:559 src/decorate.c:587 msgid "field number is zero" msgstr "" -#: src/decorate.c:548 src/decorate.c:576 +#: src/decorate.c:564 src/decorate.c:592 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number after '.'" msgstr "неисправна бројевна вредност „%s“" -#: src/decorate.c:552 +#: src/decorate.c:568 msgid "character offset is zero" msgstr "" -#: src/decorate.c:567 +#: src/decorate.c:583 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number after ','" msgstr "неисправна бројевна вредност „%s“" -#: src/decorate.c:603 +#: src/decorate.c:619 msgid "missing external conversion command" msgstr "" -#: src/decorate.c:618 +#: src/decorate.c:634 msgid "missing internal conversion function" msgstr "" -#: src/decorate.c:630 +#: src/decorate.c:646 #, fuzzy -#| msgid "invalid field pair for operation %s" msgid "invalid built-in conversion option" msgstr "неисправан пар поља за радњу „%s“" -#: src/decorate.c:641 +#: src/decorate.c:657 msgid "" "ordering flags (b/d/i/h/n/g/M/R/V) cannot be combined with a conversion " "function" msgstr "" -#: src/decorate.c:671 +#: src/decorate.c:687 #, fuzzy -#| msgid "invalid operation %s" msgid "invalid key specification" msgstr "неисправна радња „%s“" -#: src/decorate.c:853 +#: src/decorate.c:890 #, fuzzy, c-format -#| msgid "invalid numeric value '%s'" msgid "invalid number of header lines %s" msgstr "неисправна бројевна вредност „%s“" -#: src/decorate.c:907 +#: src/decorate.c:948 msgid "empty tab" msgstr "" -#: src/decorate.c:918 +#: src/decorate.c:959 #, c-format msgid "multi-character tab %s" msgstr "" -#: src/decorate.c:923 +#: src/decorate.c:964 msgid "incompatible tabs" msgstr "" -#: src/decorate.c:945 +#: src/decorate.c:986 #, fuzzy, c-format -#| msgid "invalid field '%s' for operation %s" msgid "invalid number of fields to undecorate %s" msgstr "неисправно поље „%s“ за радњу „%s“" -#: src/decorate.c:968 +#: src/decorate.c:1009 msgid "--decorate and --undecorate options are mutually exclusive" msgstr "" -#: src/decorate.c:972 +#: src/decorate.c:1013 msgid "--undecorate cannot be used with --keys or --decorate" msgstr "" -#: src/decorate.c:976 +#: src/decorate.c:1017 msgid "missing -k/--key decoration or --undecorate options" msgstr "" -#: src/decorate.c:985 +#: src/decorate.c:1026 msgid "no decorated keys specified. use sort instead" msgstr "" -#: src/decorate.c:1024 +#: src/decorate.c:1060 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to create dec-sort pipe" msgstr "нисам успео да покренем „sort“: није успело „popen“" -#: src/decorate.c:1026 +#: src/decorate.c:1062 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to create sort-undec pipe" msgstr "нисам успео да покренем „sort“: није успело „popen“" -#: src/decorate.c:1033 +#: src/decorate.c:1069 msgid "failed to fork-1" msgstr "" -#: src/decorate.c:1040 +#: src/decorate.c:1076 msgid "failed to fork-2" msgstr "" -#: src/decorate.c:1052 src/decorate.c:1101 +#: src/decorate.c:1088 src/decorate.c:1137 msgid "failed to close sort-undec read-pipe" msgstr "" -#: src/decorate.c:1055 src/decorate.c:1140 +#: src/decorate.c:1091 src/decorate.c:1176 msgid "failed to close sort-undec write-pipe" msgstr "" -#: src/decorate.c:1057 src/decorate.c:1135 +#: src/decorate.c:1093 src/decorate.c:1171 msgid "failed to close dec-sort read-pipe" msgstr "" -#: src/decorate.c:1066 +#: src/decorate.c:1102 msgid "failed to dup STDOUT fd" msgstr "" -#: src/decorate.c:1069 +#: src/decorate.c:1105 msgid "fdopen (dup (stdout)) failed" msgstr "" -#: src/decorate.c:1074 +#: src/decorate.c:1110 msgid "failed to reassign dec-sort STDOUT" msgstr "" -#: src/decorate.c:1098 src/decorate.c:1137 +#: src/decorate.c:1134 src/decorate.c:1173 msgid "failed to close dec-sort write-pipe" msgstr "" -#: src/decorate.c:1106 +#: src/decorate.c:1142 msgid "failed to reassign dec-sort STDIN" msgstr "" -#: src/decorate.c:1112 +#: src/decorate.c:1148 msgid "failed to reassign sort-undec STDOUT" msgstr "" -#: src/decorate.c:1126 +#: src/decorate.c:1162 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to run the sort command" msgstr "нисам успео да покренем „sort“: није успело „popen“" -#: src/decorate.c:1144 +#: src/decorate.c:1180 msgid "failed to reassign sort-undec STDIN" msgstr "" -#: src/double-format.c:49 +#: src/double-format.c:45 +msgid "numeric format too large" +msgstr "" + +#: src/double-format.c:54 #, c-format msgid "format %s has no %% directive" msgstr "запис „%s“ нема директиву „%%“" -#: src/double-format.c:62 +#: src/double-format.c:67 #, c-format msgid "format %s missing valid type after '%%'" msgstr "запису „%s“ недостаје исправна врста након „%%“" -#: src/double-format.c:66 +#: src/double-format.c:71 #, c-format msgid "format %s has unknown/invalid type %%%c directive" msgstr "запис „%s“ има непознату/неисправну директиву врсте „%%%c“" -#: src/double-format.c:79 +#: src/double-format.c:84 #, c-format msgid "format %s has too many %% directives" msgstr "запис „%s“ има превише директива „%%“" -#: src/field-ops.c:346 +#: src/field-ops.c:351 #, c-format msgid "" "input error for operation %s: fields %,% have different " @@ -968,17 +1001,16 @@ "улазна грешка за радњу „%s“: поља %,% имају различит број " "ставки" -#: src/field-ops.c:1176 +#: src/field-ops.c:1199 msgid "invalid numeric value" msgstr "неисправна бројевна вредност" -#: src/field-ops.c:1178 +#: src/field-ops.c:1201 msgid "invalid base64 value" msgstr "неисправна вредност основе64" #: src/key-compare.c:305 #, fuzzy, c-format -#| msgid "invalid field pair for operation %s" msgid "%s: invalid field specification %s" msgstr "неисправан пар поља за радњу „%s“" @@ -1063,7 +1095,7 @@ msgid "conflicting operation %s" msgstr "сукобљавајућа радња „%s“" -#: src/op-parser.c:499 src/op-parser.c:752 +#: src/op-parser.c:499 src/op-parser.c:758 #, c-format msgid "invalid operation %s" msgstr "неисправна радња „%s“" @@ -1101,21 +1133,21 @@ msgid "crosstab requires exactly 2 fields, found %" msgstr "„crosstab“ захтева тачно 2 поља, нађох %" -#: src/op-parser.c:705 +#: src/op-parser.c:711 #, c-format msgid "crosstab supports one operation, found %" msgstr "„crosstab“ подржава једну радњу, нађох %" -#: src/op-parser.c:714 +#: src/op-parser.c:720 msgid "missing operation" msgstr "недостаје радња" -#: src/op-parser.c:728 +#: src/op-parser.c:734 #, c-format msgid "extra operand %s" msgstr "додатни операнд „%s“" -#: src/op-parser.c:865 src/op-scanner.c:237 +#: src/op-parser.c:874 src/op-scanner.c:237 msgid "missing script (among arguments)" msgstr "недостаје скрипт (око аргумената)" @@ -1155,15 +1187,28 @@ msgid "Try '%s --help' for more information.\n" msgstr "Пробајте „%s --help“ за више података.\n" -#: src/text-options.c:111 +#: src/text-options.c:109 msgid "missing rounding digits value" msgstr "недостаје вредност заокруживања цифара" -#: src/text-options.c:116 +#: src/text-options.c:114 #, c-format msgid "invalid rounding digits value %s" msgstr "неисправна вредност заокруживања цифара „%s“" +#~ msgid "Assaf Gordon" +#~ msgstr "Асаф Гордон" + +#~ msgid "" +#~ " -f, --full print entire input line before op results\n" +#~ " (default: print only the grouped keys)\n" +#~ msgstr "" +#~ " -f, --full исписује читави улазни ред пре оп резултата\n" +#~ " (основно: исписује само груписане кључеве)\n" + +#~ msgid "sort command too-long (please report this bug)" +#~ msgstr "наредба ређања је предуга (пријавите ову грешку)" + #~ msgid "%s home page: \n" #~ msgstr "„%s“ матична страница: \n" @@ -1188,9 +1233,6 @@ #~ 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" Binary files /tmp/tmpk9ju3y2l/uqkwDqQpWf/datamash-1.7/po/sv.gmo and /tmp/tmpk9ju3y2l/ut88G7BZjZ/datamash-1.8/po/sv.gmo differ diff -Nru datamash-1.7/po/sv.po datamash-1.8/po/sv.po --- datamash-1.7/po/sv.po 2020-04-23 17:34:24.000000000 +0000 +++ datamash-1.8/po/sv.po 2022-07-23 01:57:18.000000000 +0000 @@ -9,22 +9,23 @@ # # Datamash translation: # Anders Jonsson , 2015, 2016, 2017. +# Luna Jernberg , 2022. # msgid "" msgstr "" -"Project-Id-Version: datamash 1.1.1.19\n" +"Project-Id-Version: datamash 1.4.12.1\n" "Report-Msgid-Bugs-To: bug-datamash@gnu.org\n" -"POT-Creation-Date: 2020-04-23 11:34-0600\n" -"PO-Revision-Date: 2017-08-08 21:33+0200\n" -"Last-Translator: Anders Jonsson \n" +"POT-Creation-Date: 2022-07-23 11:57+1000\n" +"PO-Revision-Date: 2022-02-15 10:37+0100\n" +"Last-Translator: Luna Jernberg \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 2.0.3\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.0.1\n" #: lib/closeout.c:122 msgid "write error" @@ -90,11 +91,11 @@ #. If you don't know what to put here, please see #. #. and use glyphs suitable for your language. -#: lib/quotearg.c:362 +#: lib/quotearg.c:355 msgid "`" msgstr "”" -#: lib/quotearg.c:363 +#: lib/quotearg.c:356 msgid "'" msgstr "”" @@ -117,18 +118,15 @@ #. TRANSLATORS: The %s placeholder is the web address of the GPL license. #: lib/version-etc.c:88 -#, fuzzy, c-format +#, c-format msgid "" "License GPLv3+: GNU GPL version 3 or later <%s>.\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" msgstr "" -"\n" -"Licens GPLv3+: GNU GPL version 3 eller senare .\n" +"Licens GPLv3+: GNU GPL version 3 eller senare <%s>.\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:105 @@ -243,13 +241,9 @@ #. "Report translation bugs to <...>\n" with the address for translation #. bugs (typically your translation team's web or email address). #: lib/version-etc.c:249 -#, fuzzy, c-format -#| msgid "" -#| "\n" -#| "Report bugs to: %s\n" +#, c-format msgid "Report bugs to: %s\n" msgstr "" -"\n" "Rapportera fel till %s\n" "Rapportera kommentarer om översättningen till \n" @@ -266,10 +260,9 @@ msgstr "%s hemsida: <%s>\n" #: lib/version-etc.c:260 -#, fuzzy, c-format +#, c-format msgid "General help using GNU software: <%s>\n" -msgstr "" -"Allmän hjälp med att använda GNU-program: \n" +msgstr "Allmän hjälp med att använda GNU-program: <%s>\n" #: lib/xalloc-die.c:34 msgid "memory exhausted" @@ -291,25 +284,25 @@ 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:65 src/decorate.c:41 -msgid "Assaf Gordon" -msgstr "Assaf Gordon" +#: src/datamash.c:66 +msgid "Assaf Gordon, Tim Rice, Shawn Wagner, Erik Auerswald" +msgstr "" -#: src/datamash.c:161 src/datamash.c:504 +#: src/datamash.c:169 src/datamash.c:539 #, c-format msgid "column name %s not found in input file" msgstr "kolumnnamnet %s hittades inte i indatafil" -#: src/datamash.c:174 +#: src/datamash.c:182 #, c-format msgid "Usage: %s [OPTION] op [fld] [op fld ...]\n" msgstr "Användning: %s [FLAGGA] åtg [flt] [åtg flt ...]\n" -#: src/datamash.c:177 +#: src/datamash.c:185 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:180 +#: src/datamash.c:188 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" @@ -317,7 +310,7 @@ "”å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:183 +#: src/datamash.c:191 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" @@ -327,7 +320,7 @@ "eller ett fältnamn då flaggorna -H eller --header-in används.\n" # Hyphen used in example rather than dash. -#: src/datamash.c:186 +#: src/datamash.c:194 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" @@ -337,50 +330,59 @@ "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:191 +#: src/datamash.c:199 msgid "Primary operations:\n" msgstr "Primära åtgärder:\n" -#: src/datamash.c:194 +#: src/datamash.c:202 msgid "Line-Filtering operations:\n" msgstr "Radfiltreringsåtgärder:\n" -#: src/datamash.c:197 +#: src/datamash.c:205 msgid "Per-Line operations:\n" msgstr "Per rads-åtgärder:\n" -#: src/datamash.c:203 +#: src/datamash.c:211 msgid "Numeric Grouping operations:\n" msgstr "Numeriska grupperingsåtgärder:\n" -#: src/datamash.c:206 +#: src/datamash.c:214 msgid "Textual/Numeric Grouping operations:\n" msgstr "Textuella/numeriska grupperingsåtgärder:\n" -#: src/datamash.c:210 +#: src/datamash.c:218 msgid "Statistical Grouping operations:\n" msgstr "Statistiska grupperingsåtgärder:\n" -#: src/datamash.c:219 +#: src/datamash.c:227 src/decorate.c:179 +msgid "Options:\n" +msgstr "Flaggor:\n" + +#: src/datamash.c:229 msgid "Grouping Options:\n" msgstr "Grupperingsflaggor:\n" -#: src/datamash.c:220 +#: src/datamash.c:230 msgid "" " -C, --skip-comments skip comment lines (starting with '#' or ';'\n" " and optional whitespace)\n" msgstr "" +" -C --skip-comments skippa kommentarsrader (börjar med '#' \" eller " +"';'\n" +"\"\n" +" och valfritt blanksteg)\n" -#: src/datamash.c:224 +#: src/datamash.c:234 msgid "" " -f, --full print entire input line before op results\n" " (default: print only the grouped keys)\n" +" This option is only sensible for linewise\n" +" operations. Other uses are deprecated and\n" +" will be removed in a future version of GNU\n" +" Datamash.\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:228 +#: src/datamash.c:242 msgid "" " -g, --group=X[,Y,Z] group via fields X,[Y,Z];\n" " equivalent to primary operation 'groupby'\n" @@ -388,19 +390,19 @@ " -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:232 +#: src/datamash.c:246 msgid " --header-in first input line is column headers\n" msgstr " --header-in första indatarad är kolumnrubriker\n" -#: src/datamash.c:235 +#: src/datamash.c:249 msgid " --header-out print column headers as first line\n" msgstr " --header-out skriv ut kolumnrubriker som första rad\n" -#: src/datamash.c:238 +#: src/datamash.c:252 msgid " -H, --headers same as '--header-in --header-out'\n" msgstr " -H, --headers samma som ”--header-in --header-out”\n" -#: src/datamash.c:241 +#: src/datamash.c:255 msgid "" " -i, --ignore-case ignore upper/lower case when comparing text;\n" " this affects grouping, and string operations\n" @@ -408,7 +410,7 @@ " -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:245 +#: src/datamash.c:259 msgid "" " -s, --sort sort the input before grouping; this removes " "the\n" @@ -419,50 +421,66 @@ " behovet av att manuellt skicka indata genom " "”sort”\n" -#: src/datamash.c:250 +#: src/datamash.c:263 +#, fuzzy +msgid "" +" -c, --collapse-delimiter=X use X to separate elements in collapse and\n" +" unique lists (default: comma)\n" +msgstr "" +" --output-delimiter=X använd X istället som utdatafältsavgränsare\n" +" (standard: använd samma avgränsare som -t/-W)\n" +"\n" + +#: src/datamash.c:268 msgid "File Operation Options:\n" msgstr "Filåtgärdsflaggor:\n" -#: src/datamash.c:251 +#: src/datamash.c:269 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:254 +#: src/datamash.c:272 #, 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:259 src/decorate.c:174 +#: src/datamash.c:277 src/decorate.c:185 msgid "General Options:\n" msgstr "Allmänna flaggor:\n" -#: src/datamash.c:260 +#: src/datamash.c:278 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:263 +#: src/datamash.c:281 msgid "" " --format=FORMAT print numeric values with printf style\n" " floating-point FORMAT.\n" msgstr "" +" --format=FORMAT skriv ut numeriska värden med printf stil\n" +" flyttals FORMAT.\n" +"\n" -#: src/datamash.c:267 +#: src/datamash.c:285 msgid "" " --output-delimiter=X use X instead as output field delimiter\n" " (default: use same delimiter as -t/-W)\n" msgstr "" +" --output-delimiter=X använd X istället som utdatafältsavgränsare\n" +" (standard: använd samma avgränsare som -t/-W)\n" +"\n" -#: src/datamash.c:271 +#: src/datamash.c:289 msgid " --narm skip NA/NaN values\n" msgstr " --narm hoppa över NA/NaN-värden\n" -#: src/datamash.c:274 +#: src/datamash.c:292 msgid " -R, --round=N round numeric output to N decimal places\n" -msgstr "" +msgstr " -R, --round=N avrunda numerisk utdata till N decimaler\n" -#: src/datamash.c:277 +#: src/datamash.c:295 msgid "" " -W, --whitespace use whitespace (one or more spaces and/or tabs)\n" " for field delimiters\n" @@ -471,31 +489,43 @@ "eller\n" " tabulatorer) som fältseparatorer\n" -#: src/datamash.c:281 +#: src/datamash.c:299 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:290 +#: src/datamash.c:302 src/decorate.c:219 +msgid " --sort-cmd=/path/to/sort Alternative sort(1) to use.\n" +msgstr "" + +#: src/datamash.c:311 +msgid "Environment:" +msgstr "" + +#: src/datamash.c:313 +msgid " LC_NUMERIC decimal-point character and thousands separator\n" +msgstr "" + +#: src/datamash.c:319 msgid "Examples:" msgstr "Exempel:" -#: src/datamash.c:292 +#: src/datamash.c:321 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:297 +#: src/datamash.c:326 msgid "Transpose input:" msgstr "Transponera indata:" -#: src/datamash.c:304 src/decorate.c:287 +#: src/datamash.c:333 src/decorate.c:302 msgid "For detailed usage information and examples, see\n" msgstr "För utförlig användningsinformation och exempel, se\n" -#: src/datamash.c:306 src/decorate.c:289 +#: src/datamash.c:335 src/decorate.c:304 msgid "The manual and more examples are available at\n" msgstr "Handboken och fler exempel är tillgängliga på\n" -#: src/datamash.c:315 +#: src/datamash.c:344 #, c-format msgid "" "invalid input: field % requested, line % has only " @@ -504,12 +534,18 @@ "ogiltigt indata: fält % begärdes, rad % har bara " "% fält" -#: src/datamash.c:385 +#: src/datamash.c:414 #, c-format msgid "%s in line % field %: '%s'" msgstr "%s i rad % fält %: ”%s”" -#: src/datamash.c:713 +#: src/datamash.c:656 +msgid "" +"datamash: Using -f/--full with non-linewise operations is deprecated and " +"will be disabled in a future release.\n" +msgstr "" + +#: src/datamash.c:752 #, c-format msgid "" "transpose input error: line % has % fields (previous lines " @@ -520,7 +556,7 @@ "rader hade %);\n" "se --help för att inaktivera strikt läge" -#: src/datamash.c:770 +#: src/datamash.c:809 #, c-format msgid "" "reverse-field input error: line % has % fields (previous " @@ -531,7 +567,7 @@ "rader hade %);\n" "se --help för att inaktivera strikt läge" -#: src/datamash.c:879 src/datamash.c:896 src/datamash.c:902 +#: src/datamash.c:918 src/datamash.c:935 src/datamash.c:941 #, c-format msgid "" "line % (% fields):\n" @@ -540,7 +576,7 @@ "rad % (% fält):\n" " " -#: src/datamash.c:885 +#: src/datamash.c:924 #, c-format msgid "" "check failed: line % has % fields (expecting %)" @@ -548,7 +584,7 @@ "kontroll misslyckades: rad % har % fält (förväntar " "%)" -#: src/datamash.c:908 +#: src/datamash.c:947 #, c-format msgid "" "check failed: line % has % fields (previous line had " @@ -557,74 +593,71 @@ "kontroll misslyckades: rad % har % fält (föregående rad " "hade %)" -#: src/datamash.c:922 +#: src/datamash.c:961 #, c-format msgid "check failed: input had % lines (expecting %)" msgstr "" "kontroll misslyckades: indata hade % rader (förväntar %)" -#: src/datamash.c:928 +#: src/datamash.c:967 #, c-format msgid "% line" msgid_plural "% lines" msgstr[0] "% rad" msgstr[1] "% rader" -#: src/datamash.c:931 +#: src/datamash.c:970 #, c-format msgid "% field" msgid_plural "% fields" msgstr[0] "% fält" msgstr[1] "% fält" -#: src/datamash.c:1032 +#: src/datamash.c:1080 msgid "hash memory allocation error" msgstr "minnesallokeringsfel för hash" -#: src/datamash.c:1099 -msgid "sort command too-long (please report this bug)" -msgstr "sorteringskommando för långt (rapportera gärna detta fel)" +#: src/datamash.c:1147 +msgid "-s and -z cannot be combined on this system" +msgstr "" -#: src/datamash.c:1105 +#: src/datamash.c:1181 msgid "failed to run 'sort': popen failed" msgstr "misslyckades att köra ”sort”: popen misslyckades" -#: src/datamash.c:1121 +#: src/datamash.c:1197 msgid "read error" msgstr "läsfel" -#: src/datamash.c:1129 +#: src/datamash.c:1205 msgid "read error (on close)" msgstr "läsfel (vid stängning)" -#: src/datamash.c:1222 src/datamash.c:1229 +#: src/datamash.c:1300 src/datamash.c:1307 src/datamash.c:1323 msgid "the delimiter must be a single character" msgstr "avskiljaren måste vara endast ett tecken" -#: src/datamash.c:1265 +#: src/datamash.c:1354 #, c-format msgid "missing operation specifiers" msgstr "saknar åtgärdsbeskrivning" -#: src/datamash.c:1283 +#: src/datamash.c:1372 msgid "-H or --header-in must be used with named columns" msgstr "-H eller --header-in måste användas med namngivna kolumner" #: src/decorate-functions.c:76 #, fuzzy, c-format -#| msgid "invalid empty grouping parameter" msgid "invalid empty roman numeral" msgstr "ogiltig tom grupperingsparameter" #: src/decorate-functions.c:84 #, fuzzy, c-format -#| msgid "invalid numeric value '%s'" msgid "invalid roman numeral '%c' in %s" msgstr "ogiltigt numeriskt värde ”%s”" #: src/decorate-functions.c:120 #, fuzzy, c-format -#| msgid "invalid operand %s" msgid "invalid IPv4 address %s" msgstr "ogiltig operand %s" @@ -643,11 +676,24 @@ #: src/decorate-functions.c:165 #, fuzzy, c-format -#| msgid "invalid operand %s" msgid "invalid IPv6 address %s" msgstr "ogiltig operand %s" -#: src/decorate.c:140 +#: src/decorate-functions.c:192 +msgid "inet_pton failed for AF_INET and AF_INET6" +msgstr "" + +#: src/decorate-functions.c:196 +#, fuzzy, c-format +msgid "invalid IP address %s" +msgstr "ogiltig operand %s" + +#. This is a proper name. See the gettext manual, section Names. +#: src/decorate.c:42 +msgid "Assaf Gordon, Shawn Wagner and Erik Auerswald" +msgstr "" + +#: src/decorate.c:145 #, c-format msgid "" "Usage: %s [OPTION]... [INPUT]\n" @@ -656,29 +702,29 @@ "\n" msgstr "" -#: src/decorate.c:147 +#: src/decorate.c:152 msgid "Converts (and optionally sorts) fields of various formats\n" msgstr "" -#: src/decorate.c:153 +#: src/decorate.c:158 msgid "" "With --decorate: adds the converted fields to the start\n" "of each line and prints and prints it to STDOUT; does not sort.\n" msgstr "" -#: src/decorate.c:160 +#: src/decorate.c:165 msgid "" "With --undecorate: removes the first N fields from the input;\n" "Use as post-processing step after sort(1).\n" msgstr "" -#: src/decorate.c:167 +#: src/decorate.c:172 msgid "" "Without --decorate and --undecorate: automatically decorates the input,\n" "runs sort(1) and undecorates the result; This is the easiest method to use.\n" msgstr "" -#: src/decorate.c:179 +#: src/decorate.c:190 msgid "" " --decorate decorate/convert the specified fields and " "print\n" @@ -687,13 +733,13 @@ " sort(1) or undecorates the output\n" msgstr "" -#: src/decorate.c:184 +#: src/decorate.c:195 msgid "" " --header=N does not decorate or sort the first N lines\n" " -H same as --header=N\n" msgstr "" -#: src/decorate.c:188 +#: src/decorate.c:199 msgid "" " -k, --key=KEYDEF key/field to sort; same syntax as sort(1),\n" " optionally followed by ':method' to convert\n" @@ -702,17 +748,15 @@ " and available conversion below\n" msgstr "" -#: src/decorate.c:194 +#: src/decorate.c:205 #, fuzzy -#| msgid "" -#| " -t, --field-separator=X use X instead of TAB as field delimiter\n" msgid "" " -t, --field-separator=SEP use SEP instead of non-blank to blank " "transition\n" msgstr "" " -t, --field-separator=X använd X istället för TAB som fältseparator\n" -#: src/decorate.c:197 +#: src/decorate.c:208 msgid "" " --print-sort-args print adjusted parameters for sort(1); Useful\n" " when using --decorate and then manually " @@ -720,24 +764,23 @@ " sort(1)\n" msgstr "" -#: src/decorate.c:202 +#: src/decorate.c:213 #, fuzzy -#| msgid "" -#| " --no-strict allow lines with varying number of fields\n" msgid " --undecorate=N removes the first N fields\n" msgstr " --no-strict tillåt rader med varierande antal fält\n" -#: src/decorate.c:205 +#: src/decorate.c:216 #, fuzzy -#| msgid " -z, --zero-terminated end lines with 0 byte, not newline\n" msgid " -z, --zero-terminated line delimiter is NUL, not newline\n" msgstr " -z, --zero-terminated avsluta rader med nollbyte, inte nyrad\n" -#: src/decorate.c:213 -msgid "The following options are passed to sort(1) as-is:\n" +#: src/decorate.c:227 +msgid "" +"The following options are passed to sort as-is (Most of them assume GNU " +"sort):\n" msgstr "" -#: src/decorate.c:219 +#: src/decorate.c:234 msgid "" " -c, --check\n" " --compress-program\n" @@ -750,226 +793,219 @@ " --parallel\n" msgstr "" -#: src/decorate.c:234 +#: src/decorate.c:249 msgid "Available conversions methods (use with -k):\n" msgstr "" -#: src/decorate.c:246 +#: src/decorate.c:261 #, fuzzy -#| msgid "Examples:" msgid "Examples:\n" msgstr "Exempel:" -#: src/decorate.c:252 +#: src/decorate.c:267 msgid "The following two invocations are equivalent:\n" msgstr "" -#: src/decorate.c:267 +#: src/decorate.c:282 msgid "Decorated output of roman numerals:\n" msgstr "" -#: src/decorate.c:431 +#: src/decorate.c:446 msgid "fwrite (header line) failed" msgstr "" -#: src/decorate.c:439 +#: src/decorate.c:454 msgid "fflush (header line) failed" msgstr "" -#: src/decorate.c:445 +#: src/decorate.c:460 #, c-format -msgid "conversion failed in line %zu" +msgid "conversion failed in line %" msgstr "" -#: src/decorate.c:451 +#: src/decorate.c:467 msgid "decorate: fwrite failed" msgstr "" -#: src/decorate.c:457 src/decorate.c:519 +#: src/decorate.c:473 src/decorate.c:535 #, c-format msgid "error reading %s" msgstr "" -#: src/decorate.c:538 +#: src/decorate.c:554 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number at field start" msgstr "ogiltigt numeriskt värde ”%s”" -#: src/decorate.c:543 src/decorate.c:571 +#: src/decorate.c:559 src/decorate.c:587 msgid "field number is zero" msgstr "" -#: src/decorate.c:548 src/decorate.c:576 +#: src/decorate.c:564 src/decorate.c:592 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number after '.'" msgstr "ogiltigt numeriskt värde ”%s”" -#: src/decorate.c:552 +#: src/decorate.c:568 msgid "character offset is zero" msgstr "" -#: src/decorate.c:567 +#: src/decorate.c:583 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number after ','" msgstr "ogiltigt numeriskt värde ”%s”" -#: src/decorate.c:603 +#: src/decorate.c:619 msgid "missing external conversion command" msgstr "" -#: src/decorate.c:618 +#: src/decorate.c:634 msgid "missing internal conversion function" msgstr "" -#: src/decorate.c:630 +#: src/decorate.c:646 #, fuzzy -#| msgid "invalid field pair for operation %s" msgid "invalid built-in conversion option" msgstr "ogiltigt par av fält för åtgärden %s" -#: src/decorate.c:641 +#: src/decorate.c:657 msgid "" "ordering flags (b/d/i/h/n/g/M/R/V) cannot be combined with a conversion " "function" msgstr "" -#: src/decorate.c:671 +#: src/decorate.c:687 #, fuzzy -#| msgid "invalid operation %s" msgid "invalid key specification" msgstr "ogiltig åtgärd %s" -#: src/decorate.c:853 +#: src/decorate.c:890 #, fuzzy, c-format -#| msgid "invalid numeric value '%s'" msgid "invalid number of header lines %s" msgstr "ogiltigt numeriskt värde ”%s”" -#: src/decorate.c:907 +#: src/decorate.c:948 msgid "empty tab" msgstr "" -#: src/decorate.c:918 +#: src/decorate.c:959 #, c-format msgid "multi-character tab %s" msgstr "" -#: src/decorate.c:923 +#: src/decorate.c:964 msgid "incompatible tabs" msgstr "" -#: src/decorate.c:945 +#: src/decorate.c:986 #, fuzzy, c-format -#| msgid "invalid field '%s' for operation %s" msgid "invalid number of fields to undecorate %s" msgstr "ogiltigt fält ”%s” för åtgärden %s" -#: src/decorate.c:968 +#: src/decorate.c:1009 msgid "--decorate and --undecorate options are mutually exclusive" msgstr "" -#: src/decorate.c:972 +#: src/decorate.c:1013 msgid "--undecorate cannot be used with --keys or --decorate" msgstr "" -#: src/decorate.c:976 +#: src/decorate.c:1017 msgid "missing -k/--key decoration or --undecorate options" msgstr "" -#: src/decorate.c:985 +#: src/decorate.c:1026 msgid "no decorated keys specified. use sort instead" msgstr "" -#: src/decorate.c:1024 +#: src/decorate.c:1060 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to create dec-sort pipe" msgstr "misslyckades att köra ”sort”: popen misslyckades" -#: src/decorate.c:1026 +#: src/decorate.c:1062 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to create sort-undec pipe" msgstr "misslyckades att köra ”sort”: popen misslyckades" -#: src/decorate.c:1033 +#: src/decorate.c:1069 msgid "failed to fork-1" msgstr "" -#: src/decorate.c:1040 +#: src/decorate.c:1076 msgid "failed to fork-2" msgstr "" -#: src/decorate.c:1052 src/decorate.c:1101 +#: src/decorate.c:1088 src/decorate.c:1137 msgid "failed to close sort-undec read-pipe" msgstr "" -#: src/decorate.c:1055 src/decorate.c:1140 +#: src/decorate.c:1091 src/decorate.c:1176 msgid "failed to close sort-undec write-pipe" msgstr "" -#: src/decorate.c:1057 src/decorate.c:1135 +#: src/decorate.c:1093 src/decorate.c:1171 msgid "failed to close dec-sort read-pipe" msgstr "" -#: src/decorate.c:1066 +#: src/decorate.c:1102 msgid "failed to dup STDOUT fd" msgstr "" -#: src/decorate.c:1069 +#: src/decorate.c:1105 msgid "fdopen (dup (stdout)) failed" msgstr "" -#: src/decorate.c:1074 +#: src/decorate.c:1110 msgid "failed to reassign dec-sort STDOUT" msgstr "" -#: src/decorate.c:1098 src/decorate.c:1137 +#: src/decorate.c:1134 src/decorate.c:1173 msgid "failed to close dec-sort write-pipe" msgstr "" -#: src/decorate.c:1106 +#: src/decorate.c:1142 msgid "failed to reassign dec-sort STDIN" msgstr "" -#: src/decorate.c:1112 +#: src/decorate.c:1148 msgid "failed to reassign sort-undec STDOUT" msgstr "" -#: src/decorate.c:1126 +#: src/decorate.c:1162 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to run the sort command" msgstr "misslyckades att köra ”sort”: popen misslyckades" -#: src/decorate.c:1144 +#: src/decorate.c:1180 msgid "failed to reassign sort-undec STDIN" msgstr "" -#: src/double-format.c:49 +#: src/double-format.c:45 +msgid "numeric format too large" +msgstr "" + +#: src/double-format.c:54 #, c-format msgid "format %s has no %% directive" -msgstr "" +msgstr "format %s har inget %%direktiv" -#: src/double-format.c:62 +#: src/double-format.c:67 #, c-format msgid "format %s missing valid type after '%%'" -msgstr "" +msgstr "format %s saknar giltig typ efter '%%'" -#: src/double-format.c:66 +#: src/double-format.c:71 #, c-format msgid "format %s has unknown/invalid type %%%c directive" -msgstr "" +msgstr "format %s har okänt/ogiltigt typ %%%cdirektiv" -#: src/double-format.c:79 +#: src/double-format.c:84 #, c-format msgid "format %s has too many %% directives" -msgstr "" +msgstr "format %s har för många %%direktiv" -#: src/field-ops.c:346 +#: src/field-ops.c:351 #, c-format msgid "" "input error for operation %s: fields %,% have different " @@ -978,17 +1014,16 @@ "indatafel för åtgärden %s: fälten %,% har olika antal " "poster" -#: src/field-ops.c:1176 +#: src/field-ops.c:1199 msgid "invalid numeric value" msgstr "ogiltigt numeriskt värde" -#: src/field-ops.c:1178 +#: src/field-ops.c:1201 msgid "invalid base64 value" msgstr "ogiltigt base64-värde" #: src/key-compare.c:305 #, fuzzy, c-format -#| msgid "invalid field pair for operation %s" msgid "%s: invalid field specification %s" msgstr "ogiltigt par av fält för åtgärden %s" @@ -1015,13 +1050,12 @@ #: src/op-parser.c:207 #, c-format msgid "invalid trim mean value %Lg (expected 0 <= X <= 0.5)" -msgstr "" +msgstr "ogiltigt trimmedelvärde %Lg (förväntat 0 <= X <= 0,5)" #: src/op-parser.c:243 -#, fuzzy, c-format -#| msgid "invalid numeric value '%s'" +#, c-format msgid "invalid getnum type '%c'" -msgstr "ogiltigt numeriskt värde ”%s”" +msgstr "ogiltig getnum-typ '%c'" #: src/op-parser.c:275 src/op-parser.c:286 src/op-parser.c:554 #, c-format @@ -1074,7 +1108,7 @@ msgid "conflicting operation %s" msgstr "motstridig åtgärd %s" -#: src/op-parser.c:499 src/op-parser.c:752 +#: src/op-parser.c:499 src/op-parser.c:758 #, c-format msgid "invalid operation %s" msgstr "ogiltig åtgärd %s" @@ -1113,21 +1147,21 @@ msgid "crosstab requires exactly 2 fields, found %" msgstr "crosstab kräver exakt 2 fält, hittade %" -#: src/op-parser.c:705 +#: src/op-parser.c:711 #, c-format msgid "crosstab supports one operation, found %" msgstr "crosstab stöder en åtgärd, hittade %" -#: src/op-parser.c:714 +#: src/op-parser.c:720 msgid "missing operation" msgstr "saknar åtgärd" -#: src/op-parser.c:728 +#: src/op-parser.c:734 #, c-format msgid "extra operand %s" msgstr "extra operand %s" -#: src/op-parser.c:865 src/op-scanner.c:237 +#: src/op-parser.c:874 src/op-scanner.c:237 msgid "missing script (among arguments)" msgstr "saknar skript (bland argument)" @@ -1138,11 +1172,11 @@ #: src/op-scanner.c:194 msgid "backslash at end of identifier" -msgstr "" +msgstr "omvänt snedstreck i slutet av identifieraren" #: src/op-scanner.c:202 msgid "identifier name too long" -msgstr "" +msgstr "identifierarnamnet är för långt" #: src/op-scanner.c:215 #, c-format @@ -1167,17 +1201,31 @@ msgid "Try '%s --help' for more information.\n" msgstr "Försök med ”%s --help” för mer information.\n" -#: src/text-options.c:111 +#: src/text-options.c:109 msgid "missing rounding digits value" -msgstr "" +msgstr "saknar avrundningssiffror värde" -#: src/text-options.c:116 -#, fuzzy, c-format +#: src/text-options.c:114 +#, c-format msgid "invalid rounding digits value %s" -msgstr "ogiltig grupperingsparameter %s" +msgstr "ogiltigt värde %s för avrundningssiffror" -#, fuzzy -#~ msgid "%s home page: \n" +#~ msgid "Assaf Gordon" +#~ msgstr "Assaf Gordon" + +#~ 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" + +#~ msgid "sort command too-long (please report this bug)" +#~ msgstr "sorteringskommando för långt (rapportera gärna detta fel)" + +#~ msgid "%s home page: \n" #~ msgstr "%s hemsida: \n" #~ msgid "%s: option '--%s' doesn't allow an argument\n" @@ -1201,8 +1249,5 @@ #~ 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" Binary files /tmp/tmpk9ju3y2l/uqkwDqQpWf/datamash-1.7/po/uk.gmo and /tmp/tmpk9ju3y2l/ut88G7BZjZ/datamash-1.8/po/uk.gmo differ diff -Nru datamash-1.7/po/uk.po datamash-1.8/po/uk.po --- datamash-1.7/po/uk.po 2020-04-23 17:34:24.000000000 +0000 +++ datamash-1.8/po/uk.po 2022-07-23 01:57:18.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: GNU datamash 1.4.12.1\n" "Report-Msgid-Bugs-To: bug-datamash@gnu.org\n" -"POT-Creation-Date: 2020-04-23 11:34-0600\n" +"POT-Creation-Date: 2022-07-23 11:57+1000\n" "PO-Revision-Date: 2019-09-01 15:15+0300\n" "Last-Translator: Yuri Chornoivan \n" "Language-Team: Ukrainian \n" @@ -84,11 +84,11 @@ #. If you don't know what to put here, please see #. #. and use glyphs suitable for your language. -#: lib/quotearg.c:362 +#: lib/quotearg.c:355 msgid "`" msgstr "«" -#: lib/quotearg.c:363 +#: lib/quotearg.c:356 msgid "'" msgstr "»" @@ -277,25 +277,25 @@ msgstr "%s%s, аргумент «%s» є занадто об'ємним" #. This is a proper name. See the gettext manual, section Names. -#: src/datamash.c:65 src/decorate.c:41 -msgid "Assaf Gordon" -msgstr "Assaf Gordon" +#: src/datamash.c:66 +msgid "Assaf Gordon, Tim Rice, Shawn Wagner, Erik Auerswald" +msgstr "" -#: src/datamash.c:161 src/datamash.c:504 +#: src/datamash.c:169 src/datamash.c:539 #, c-format msgid "column name %s not found in input file" msgstr "у файлі вхідних даних не знайдено стовпчика із назвою %s" -#: src/datamash.c:174 +#: src/datamash.c:182 #, c-format msgid "Usage: %s [OPTION] op [fld] [op fld ...]\n" msgstr "Користування: %s [ПАРАМЕТР] операція [поле] [операція поле ...]\n" -#: src/datamash.c:177 +#: src/datamash.c:185 msgid "Performs numeric/string operations on input from stdin." msgstr "Виконує числові дії або дії з рядками над вхідними даними зі stdin." -#: src/datamash.c:180 +#: src/datamash.c:188 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" @@ -304,7 +304,7 @@ "операцію,\n" "вона має бути у списку першою, за нею може бути вказано інші операції.\n" -#: src/datamash.c:183 +#: src/datamash.c:191 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" @@ -313,7 +313,7 @@ "бути число (1=перше поле) або назва поля, якщо використовуються параметри\n" "-H або --header-in.\n" -#: src/datamash.c:186 +#: src/datamash.c:194 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" @@ -323,35 +323,39 @@ "Діапазон полів можна вказати за допомогою дефіса (наприклад 2-8).\n" "Пари полів слід вказувати за допомогою двокрапки (наприклад «pcov 2:6»).\n" -#: src/datamash.c:191 +#: src/datamash.c:199 msgid "Primary operations:\n" msgstr "Основні операції:\n" -#: src/datamash.c:194 +#: src/datamash.c:202 msgid "Line-Filtering operations:\n" msgstr "Дії з фільтрування рядків:\n" -#: src/datamash.c:197 +#: src/datamash.c:205 msgid "Per-Line operations:\n" msgstr "Дії над окремими рядками:\n" -#: src/datamash.c:203 +#: src/datamash.c:211 msgid "Numeric Grouping operations:\n" msgstr "Дії з числового групування:\n" -#: src/datamash.c:206 +#: src/datamash.c:214 msgid "Textual/Numeric Grouping operations:\n" msgstr "Дії з текстового або числового групування:\n" -#: src/datamash.c:210 +#: src/datamash.c:218 msgid "Statistical Grouping operations:\n" msgstr "Дії зі статистичного групування:\n" -#: src/datamash.c:219 +#: src/datamash.c:227 src/decorate.c:179 +msgid "Options:\n" +msgstr "Параметри:\n" + +#: src/datamash.c:229 msgid "Grouping Options:\n" msgstr "Дії з групування:\n" -#: src/datamash.c:220 +#: src/datamash.c:230 msgid "" " -C, --skip-comments skip comment lines (starting with '#' or ';'\n" " and optional whitespace)\n" @@ -360,15 +364,17 @@ "починаються з «#» або «;»\n" " та необов'язкового пробілу)\n" -#: src/datamash.c:224 +#: src/datamash.c:234 msgid "" " -f, --full print entire input line before op results\n" " (default: print only the grouped keys)\n" +" This option is only sensible for linewise\n" +" operations. Other uses are deprecated and\n" +" will be removed in a future version of GNU\n" +" Datamash.\n" msgstr "" -" -f, --full вивести рядок вхідних даних до результатів дії\n" -" (типове: вивести лише згруповані дані)\n" -#: src/datamash.c:228 +#: src/datamash.c:242 msgid "" " -g, --group=X[,Y,Z] group via fields X,[Y,Z];\n" " equivalent to primary operation 'groupby'\n" @@ -376,22 +382,22 @@ " -g, --group=X[,Y,Z] групувати за полями X,[Y,Z];\n" " рівнозначне основній операції «groupby»\n" -#: src/datamash.c:232 +#: src/datamash.c:246 msgid " --header-in first input line is column headers\n" msgstr "" " --header-in перший рядок вхідних даних є рядком заголовків " "стовпчиків\n" -#: src/datamash.c:235 +#: src/datamash.c:249 msgid " --header-out print column headers as first line\n" msgstr "" " --header-out вивести заголовки стовпчиків у першому рядку\n" -#: src/datamash.c:238 +#: src/datamash.c:252 msgid " -H, --headers same as '--header-in --header-out'\n" msgstr " -H, --headers те саме, що і --header-in --header-out\n" -#: src/datamash.c:241 +#: src/datamash.c:255 msgid "" " -i, --ignore-case ignore upper/lower case when comparing text;\n" " this affects grouping, and string operations\n" @@ -401,7 +407,7 @@ " це стосується дій з групування та дій над " "рядками\n" -#: src/datamash.c:245 +#: src/datamash.c:259 msgid "" " -s, --sort sort the input before grouping; this removes " "the\n" @@ -413,32 +419,43 @@ " потребу у попередній обробці вхідних даних " "програмою sort\n" -#: src/datamash.c:250 +#: src/datamash.c:263 +#, fuzzy +msgid "" +" -c, --collapse-delimiter=X use X to separate elements in collapse and\n" +" unique lists (default: comma)\n" +msgstr "" +" --output-delimiter=X скористатися X замість роздільника виведених " +"полів\n" +" (типова поведінка: скористатися тим самим " +"роздільником, що і у -t/-W)\n" + +#: src/datamash.c:268 msgid "File Operation Options:\n" msgstr "Параметри дій над файлами:\n" -#: src/datamash.c:251 +#: src/datamash.c:269 msgid " --no-strict allow lines with varying number of fields\n" msgstr "" " --no-strict дозволяти рядки зі змінною кількістю полів\n" -#: src/datamash.c:254 +#: src/datamash.c:272 #, c-format msgid " --filler=X fill missing values with X (default %s)\n" msgstr "" " --filler=X заповнити пропущені значення рядком X (типово " "%s)\n" -#: src/datamash.c:259 src/decorate.c:174 +#: src/datamash.c:277 src/decorate.c:185 msgid "General Options:\n" msgstr "Загальні параметри:\n" -#: src/datamash.c:260 +#: src/datamash.c:278 msgid " -t, --field-separator=X use X instead of TAB as field delimiter\n" msgstr "" " -t, --field-separator=X використовувати роздільник полів X замість TAB\n" -#: src/datamash.c:263 +#: src/datamash.c:281 msgid "" " --format=FORMAT print numeric values with printf style\n" " floating-point FORMAT.\n" @@ -447,7 +464,7 @@ " на основі запису чисел із рухомою крапкою " "ФОРМАТ.\n" -#: src/datamash.c:267 +#: src/datamash.c:285 msgid "" " --output-delimiter=X use X instead as output field delimiter\n" " (default: use same delimiter as -t/-W)\n" @@ -457,17 +474,17 @@ " (типова поведінка: скористатися тим самим " "роздільником, що і у -t/-W)\n" -#: src/datamash.c:271 +#: src/datamash.c:289 msgid " --narm skip NA/NaN values\n" msgstr " --narm пропускати значення NA/NaN\n" -#: src/datamash.c:274 +#: src/datamash.c:292 msgid " -R, --round=N round numeric output to N decimal places\n" msgstr "" " -R, --round=N заокруглити числовий результат до N десяткових " "позицій\n" -#: src/datamash.c:277 +#: src/datamash.c:295 msgid "" " -W, --whitespace use whitespace (one or more spaces and/or tabs)\n" " for field delimiters\n" @@ -476,35 +493,47 @@ "пробілів чи\n" " символів табуляцій) як роздільник полів\n" -#: src/datamash.c:281 +#: src/datamash.c:299 msgid " -z, --zero-terminated end lines with 0 byte, not newline\n" msgstr "" " -z, --zero-terminated завершувати рядки нульовим байтом, а не символом " "нового рядка\n" -#: src/datamash.c:290 +#: src/datamash.c:302 src/decorate.c:219 +msgid " --sort-cmd=/path/to/sort Alternative sort(1) to use.\n" +msgstr "" + +#: src/datamash.c:311 +msgid "Environment:" +msgstr "" + +#: src/datamash.c:313 +msgid " LC_NUMERIC decimal-point character and thousands separator\n" +msgstr "" + +#: src/datamash.c:319 msgid "Examples:" msgstr "Приклади:" -#: src/datamash.c:292 +#: src/datamash.c:321 msgid "Print the sum and the mean of values from column 1:" msgstr "Вивести суму та середнє значення значень, починаючи зі стовпчика 1:" -#: src/datamash.c:297 +#: src/datamash.c:326 msgid "Transpose input:" msgstr "Транспонування вхідних даних:" -#: src/datamash.c:304 src/decorate.c:287 +#: src/datamash.c:333 src/decorate.c:302 msgid "For detailed usage information and examples, see\n" msgstr "" "Щоб дізнатися більше про користування програмою та ознайомитися з " "прикладами, див.\n" -#: src/datamash.c:306 src/decorate.c:289 +#: src/datamash.c:335 src/decorate.c:304 msgid "The manual and more examples are available at\n" msgstr "Підручник і додаткові приклади можна знайти на цій сторінці:\n" -#: src/datamash.c:315 +#: src/datamash.c:344 #, c-format msgid "" "invalid input: field % requested, line % has only " @@ -513,12 +542,18 @@ "некоректні вхідні дані: потрібне поле %, але у рядку % " "лише % полів" -#: src/datamash.c:385 +#: src/datamash.c:414 #, c-format msgid "%s in line % field %: '%s'" msgstr "%s у рядку %, поле %: «%s»" -#: src/datamash.c:713 +#: src/datamash.c:656 +msgid "" +"datamash: Using -f/--full with non-linewise operations is deprecated and " +"will be disabled in a future release.\n" +msgstr "" + +#: src/datamash.c:752 #, c-format msgid "" "transpose input error: line % has % fields (previous lines " @@ -529,7 +564,7 @@ "% полів (у попередніх рядках було %);\n" "див. --help, щоб дізнатися про те, як вимкнути строгий режим." -#: src/datamash.c:770 +#: src/datamash.c:809 #, c-format msgid "" "reverse-field input error: line % has % fields (previous " @@ -540,7 +575,7 @@ "є % полів (у попередніх рядках було %);\n" "див. --help, щоб дізнатися про те, як вимкнути строгий режим." -#: src/datamash.c:879 src/datamash.c:896 src/datamash.c:902 +#: src/datamash.c:918 src/datamash.c:935 src/datamash.c:941 #, c-format msgid "" "line % (% fields):\n" @@ -549,7 +584,7 @@ "рядок % (% полів):\n" " " -#: src/datamash.c:885 +#: src/datamash.c:924 #, c-format msgid "" "check failed: line % has % fields (expecting %)" @@ -557,7 +592,7 @@ "перевірку не пройдено: у рядку % маємо % полів (мало бути " "%)" -#: src/datamash.c:908 +#: src/datamash.c:947 #, c-format msgid "" "check failed: line % has % fields (previous line had " @@ -566,14 +601,14 @@ "перевірку не пройдено: у рядку % маємо % полів (у " "попередньому рядку було %)" -#: src/datamash.c:922 +#: src/datamash.c:961 #, c-format msgid "check failed: input had % lines (expecting %)" msgstr "" "перевірку не пройдено: у вхідних даних було % рядків (мало бути " "%)" -#: src/datamash.c:928 +#: src/datamash.c:967 #, c-format msgid "% line" msgid_plural "% lines" @@ -582,7 +617,7 @@ msgstr[2] "% рядків" msgstr[3] "% рядок" -#: src/datamash.c:931 +#: src/datamash.c:970 #, c-format msgid "% field" msgid_plural "% fields" @@ -591,56 +626,51 @@ msgstr[2] "% полів" msgstr[3] "% поле" -#: src/datamash.c:1032 +#: src/datamash.c:1080 msgid "hash memory allocation error" msgstr "помилка під час спроби отримання області пам’яті для хеш-сум" -#: src/datamash.c:1099 -msgid "sort command too-long (please report this bug)" +#: src/datamash.c:1147 +msgid "-s and -z cannot be combined on this system" msgstr "" -"упорядковування за допомогою команди sort виконується надто довго (повідомте " -"розробників про ваду)" -#: src/datamash.c:1105 +#: src/datamash.c:1181 msgid "failed to run 'sort': popen failed" msgstr "не вдалося виконати «sort»: помилка popen" -#: src/datamash.c:1121 +#: src/datamash.c:1197 msgid "read error" msgstr "помилка під час читання" -#: src/datamash.c:1129 +#: src/datamash.c:1205 msgid "read error (on close)" msgstr "помилка під час читання (під час закриття)" -#: src/datamash.c:1222 src/datamash.c:1229 +#: src/datamash.c:1300 src/datamash.c:1307 src/datamash.c:1323 msgid "the delimiter must be a single character" msgstr "розділювач повинен бути одним символом" -#: src/datamash.c:1265 +#: src/datamash.c:1354 #, c-format msgid "missing operation specifiers" msgstr "не вказано специфікаторів дій" -#: src/datamash.c:1283 +#: src/datamash.c:1372 msgid "-H or --header-in must be used with named columns" msgstr "якщо стовпчики мають назви, слід використовувати -H або --header-in" #: src/decorate-functions.c:76 #, fuzzy, c-format -#| msgid "invalid empty grouping parameter" msgid "invalid empty roman numeral" msgstr "некоректний порожній параметр групування" #: src/decorate-functions.c:84 #, fuzzy, c-format -#| msgid "invalid numeric value '%s'" msgid "invalid roman numeral '%c' in %s" msgstr "некоректне числове значення, «%s»" #: src/decorate-functions.c:120 #, fuzzy, c-format -#| msgid "invalid operand %s" msgid "invalid IPv4 address %s" msgstr "некоректний операнд %s" @@ -659,11 +689,24 @@ #: src/decorate-functions.c:165 #, fuzzy, c-format -#| msgid "invalid operand %s" msgid "invalid IPv6 address %s" msgstr "некоректний операнд %s" -#: src/decorate.c:140 +#: src/decorate-functions.c:192 +msgid "inet_pton failed for AF_INET and AF_INET6" +msgstr "" + +#: src/decorate-functions.c:196 +#, fuzzy, c-format +msgid "invalid IP address %s" +msgstr "некоректний операнд %s" + +#. This is a proper name. See the gettext manual, section Names. +#: src/decorate.c:42 +msgid "Assaf Gordon, Shawn Wagner and Erik Auerswald" +msgstr "" + +#: src/decorate.c:145 #, c-format msgid "" "Usage: %s [OPTION]... [INPUT]\n" @@ -672,29 +715,29 @@ "\n" msgstr "" -#: src/decorate.c:147 +#: src/decorate.c:152 msgid "Converts (and optionally sorts) fields of various formats\n" msgstr "" -#: src/decorate.c:153 +#: src/decorate.c:158 msgid "" "With --decorate: adds the converted fields to the start\n" "of each line and prints and prints it to STDOUT; does not sort.\n" msgstr "" -#: src/decorate.c:160 +#: src/decorate.c:165 msgid "" "With --undecorate: removes the first N fields from the input;\n" "Use as post-processing step after sort(1).\n" msgstr "" -#: src/decorate.c:167 +#: src/decorate.c:172 msgid "" "Without --decorate and --undecorate: automatically decorates the input,\n" "runs sort(1) and undecorates the result; This is the easiest method to use.\n" msgstr "" -#: src/decorate.c:179 +#: src/decorate.c:190 msgid "" " --decorate decorate/convert the specified fields and " "print\n" @@ -703,13 +746,13 @@ " sort(1) or undecorates the output\n" msgstr "" -#: src/decorate.c:184 +#: src/decorate.c:195 msgid "" " --header=N does not decorate or sort the first N lines\n" " -H same as --header=N\n" msgstr "" -#: src/decorate.c:188 +#: src/decorate.c:199 msgid "" " -k, --key=KEYDEF key/field to sort; same syntax as sort(1),\n" " optionally followed by ':method' to convert\n" @@ -718,17 +761,15 @@ " and available conversion below\n" msgstr "" -#: src/decorate.c:194 +#: src/decorate.c:205 #, fuzzy -#| msgid "" -#| " -t, --field-separator=X use X instead of TAB as field delimiter\n" msgid "" " -t, --field-separator=SEP use SEP instead of non-blank to blank " "transition\n" msgstr "" " -t, --field-separator=X використовувати роздільник полів X замість TAB\n" -#: src/decorate.c:197 +#: src/decorate.c:208 msgid "" " --print-sort-args print adjusted parameters for sort(1); Useful\n" " when using --decorate and then manually " @@ -736,27 +777,26 @@ " sort(1)\n" msgstr "" -#: src/decorate.c:202 +#: src/decorate.c:213 #, fuzzy -#| msgid "" -#| " --no-strict allow lines with varying number of fields\n" msgid " --undecorate=N removes the first N fields\n" msgstr "" " --no-strict дозволяти рядки зі змінною кількістю полів\n" -#: src/decorate.c:205 +#: src/decorate.c:216 #, fuzzy -#| msgid " -z, --zero-terminated end lines with 0 byte, not newline\n" msgid " -z, --zero-terminated line delimiter is NUL, not newline\n" msgstr "" " -z, --zero-terminated завершувати рядки нульовим байтом, а не символом " "нового рядка\n" -#: src/decorate.c:213 -msgid "The following options are passed to sort(1) as-is:\n" +#: src/decorate.c:227 +msgid "" +"The following options are passed to sort as-is (Most of them assume GNU " +"sort):\n" msgstr "" -#: src/decorate.c:219 +#: src/decorate.c:234 msgid "" " -c, --check\n" " --compress-program\n" @@ -769,228 +809,221 @@ " --parallel\n" msgstr "" -#: src/decorate.c:234 +#: src/decorate.c:249 msgid "Available conversions methods (use with -k):\n" msgstr "" -#: src/decorate.c:246 +#: src/decorate.c:261 #, fuzzy -#| msgid "Examples:" msgid "Examples:\n" msgstr "Приклади:" -#: src/decorate.c:252 +#: src/decorate.c:267 msgid "The following two invocations are equivalent:\n" msgstr "" -#: src/decorate.c:267 +#: src/decorate.c:282 msgid "Decorated output of roman numerals:\n" msgstr "" -#: src/decorate.c:431 +#: src/decorate.c:446 msgid "fwrite (header line) failed" msgstr "" -#: src/decorate.c:439 +#: src/decorate.c:454 msgid "fflush (header line) failed" msgstr "" -#: src/decorate.c:445 +#: src/decorate.c:460 #, c-format -msgid "conversion failed in line %zu" +msgid "conversion failed in line %" msgstr "" -#: src/decorate.c:451 +#: src/decorate.c:467 msgid "decorate: fwrite failed" msgstr "" -#: src/decorate.c:457 src/decorate.c:519 +#: src/decorate.c:473 src/decorate.c:535 #, c-format msgid "error reading %s" msgstr "" -#: src/decorate.c:538 +#: src/decorate.c:554 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number at field start" msgstr "некоректне числове значення, «%s»" -#: src/decorate.c:543 src/decorate.c:571 +#: src/decorate.c:559 src/decorate.c:587 msgid "field number is zero" msgstr "" -#: src/decorate.c:548 src/decorate.c:576 +#: src/decorate.c:564 src/decorate.c:592 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number after '.'" msgstr "некоректне числове значення, «%s»" -#: src/decorate.c:552 +#: src/decorate.c:568 msgid "character offset is zero" msgstr "" -#: src/decorate.c:567 +#: src/decorate.c:583 #, fuzzy -#| msgid "invalid numeric value '%s'" msgid "invalid number after ','" msgstr "некоректне числове значення, «%s»" -#: src/decorate.c:603 +#: src/decorate.c:619 msgid "missing external conversion command" msgstr "" -#: src/decorate.c:618 +#: src/decorate.c:634 msgid "missing internal conversion function" msgstr "" -#: src/decorate.c:630 +#: src/decorate.c:646 #, fuzzy -#| msgid "invalid field pair for operation %s" msgid "invalid built-in conversion option" msgstr "некоректна пара полів для операції %s" -#: src/decorate.c:641 +#: src/decorate.c:657 msgid "" "ordering flags (b/d/i/h/n/g/M/R/V) cannot be combined with a conversion " "function" msgstr "" -#: src/decorate.c:671 +#: src/decorate.c:687 #, fuzzy -#| msgid "invalid operation %s" msgid "invalid key specification" msgstr "некоректна операція, %s" -#: src/decorate.c:853 +#: src/decorate.c:890 #, fuzzy, c-format -#| msgid "invalid numeric value '%s'" msgid "invalid number of header lines %s" msgstr "некоректне числове значення, «%s»" -#: src/decorate.c:907 +#: src/decorate.c:948 msgid "empty tab" msgstr "" -#: src/decorate.c:918 +#: src/decorate.c:959 #, c-format msgid "multi-character tab %s" msgstr "" -#: src/decorate.c:923 +#: src/decorate.c:964 msgid "incompatible tabs" msgstr "" -#: src/decorate.c:945 +#: src/decorate.c:986 #, fuzzy, c-format -#| msgid "invalid field '%s' for operation %s" msgid "invalid number of fields to undecorate %s" msgstr "некоректне поле, «%s», для операції %s" -#: src/decorate.c:968 +#: src/decorate.c:1009 msgid "--decorate and --undecorate options are mutually exclusive" msgstr "" -#: src/decorate.c:972 +#: src/decorate.c:1013 msgid "--undecorate cannot be used with --keys or --decorate" msgstr "" -#: src/decorate.c:976 +#: src/decorate.c:1017 msgid "missing -k/--key decoration or --undecorate options" msgstr "" -#: src/decorate.c:985 +#: src/decorate.c:1026 msgid "no decorated keys specified. use sort instead" msgstr "" -#: src/decorate.c:1024 +#: src/decorate.c:1060 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to create dec-sort pipe" msgstr "не вдалося виконати «sort»: помилка popen" -#: src/decorate.c:1026 +#: src/decorate.c:1062 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to create sort-undec pipe" msgstr "не вдалося виконати «sort»: помилка popen" -#: src/decorate.c:1033 +#: src/decorate.c:1069 msgid "failed to fork-1" msgstr "" -#: src/decorate.c:1040 +#: src/decorate.c:1076 msgid "failed to fork-2" msgstr "" -#: src/decorate.c:1052 src/decorate.c:1101 +#: src/decorate.c:1088 src/decorate.c:1137 msgid "failed to close sort-undec read-pipe" msgstr "" -#: src/decorate.c:1055 src/decorate.c:1140 +#: src/decorate.c:1091 src/decorate.c:1176 msgid "failed to close sort-undec write-pipe" msgstr "" -#: src/decorate.c:1057 src/decorate.c:1135 +#: src/decorate.c:1093 src/decorate.c:1171 msgid "failed to close dec-sort read-pipe" msgstr "" -#: src/decorate.c:1066 +#: src/decorate.c:1102 msgid "failed to dup STDOUT fd" msgstr "" -#: src/decorate.c:1069 +#: src/decorate.c:1105 msgid "fdopen (dup (stdout)) failed" msgstr "" -#: src/decorate.c:1074 +#: src/decorate.c:1110 msgid "failed to reassign dec-sort STDOUT" msgstr "" -#: src/decorate.c:1098 src/decorate.c:1137 +#: src/decorate.c:1134 src/decorate.c:1173 msgid "failed to close dec-sort write-pipe" msgstr "" -#: src/decorate.c:1106 +#: src/decorate.c:1142 msgid "failed to reassign dec-sort STDIN" msgstr "" -#: src/decorate.c:1112 +#: src/decorate.c:1148 msgid "failed to reassign sort-undec STDOUT" msgstr "" -#: src/decorate.c:1126 +#: src/decorate.c:1162 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to run the sort command" msgstr "не вдалося виконати «sort»: помилка popen" -#: src/decorate.c:1144 +#: src/decorate.c:1180 msgid "failed to reassign sort-undec STDIN" msgstr "" -#: src/double-format.c:49 +#: src/double-format.c:45 +msgid "numeric format too large" +msgstr "" + +#: src/double-format.c:54 #, c-format msgid "format %s has no %% directive" msgstr "формат %s не містить інструкції %%" -#: src/double-format.c:62 +#: src/double-format.c:67 #, c-format msgid "format %s missing valid type after '%%'" msgstr "у записі формату, %s, не вистачає коректного типу після «%%»" -#: src/double-format.c:66 +#: src/double-format.c:71 #, c-format msgid "format %s has unknown/invalid type %%%c directive" msgstr "" "у записі форматування, %s, міститься невідома або некоректна інструкція щодо " "типу, %%%c" -#: src/double-format.c:79 +#: src/double-format.c:84 #, c-format msgid "format %s has too many %% directives" msgstr "формат %s містить надто багато інструкцій %%" -#: src/field-ops.c:346 +#: src/field-ops.c:351 #, c-format msgid "" "input error for operation %s: fields %,% have different " @@ -999,17 +1032,16 @@ "помилка у вхідних даних для операції %s: у полях %,% різна " "кількість записів" -#: src/field-ops.c:1176 +#: src/field-ops.c:1199 msgid "invalid numeric value" msgstr "некоректне числове значення" -#: src/field-ops.c:1178 +#: src/field-ops.c:1201 msgid "invalid base64 value" msgstr "некоректне значення base64" #: src/key-compare.c:305 #, fuzzy, c-format -#| msgid "invalid field pair for operation %s" msgid "%s: invalid field specification %s" msgstr "некоректна пара полів для операції %s" @@ -1096,7 +1128,7 @@ msgid "conflicting operation %s" msgstr "конфлікт операції %s" -#: src/op-parser.c:499 src/op-parser.c:752 +#: src/op-parser.c:499 src/op-parser.c:758 #, c-format msgid "invalid operation %s" msgstr "некоректна операція, %s" @@ -1136,22 +1168,22 @@ msgid "crosstab requires exactly 2 fields, found %" msgstr "для crosstab слід вказати точно 2 поля, вказано ж %" -#: src/op-parser.c:705 +#: src/op-parser.c:711 #, c-format msgid "crosstab supports one operation, found %" msgstr "" "у crosstab передбачено підтримку лише однієї операції, вказано ж %" -#: src/op-parser.c:714 +#: src/op-parser.c:720 msgid "missing operation" msgstr "пропущено операцію" -#: src/op-parser.c:728 +#: src/op-parser.c:734 #, c-format msgid "extra operand %s" msgstr "зайвий операнд %s" -#: src/op-parser.c:865 src/op-scanner.c:237 +#: src/op-parser.c:874 src/op-scanner.c:237 msgid "missing script (among arguments)" msgstr "не вказано скрипт (серед аргументів)" @@ -1191,15 +1223,31 @@ msgid "Try '%s --help' for more information.\n" msgstr "Віддайте команду «%s --help», щоб дізнатися більше.\n" -#: src/text-options.c:111 +#: src/text-options.c:109 msgid "missing rounding digits value" msgstr "не вказано кількість цифр для заокруглення" -#: src/text-options.c:116 +#: src/text-options.c:114 #, c-format msgid "invalid rounding digits value %s" msgstr "некоректне значення кількості цифр для заокруглення — %s" +#~ msgid "Assaf Gordon" +#~ msgstr "Assaf Gordon" + +#~ msgid "" +#~ " -f, --full print entire input line before op results\n" +#~ " (default: print only the grouped keys)\n" +#~ msgstr "" +#~ " -f, --full вивести рядок вхідних даних до результатів " +#~ "дії\n" +#~ " (типове: вивести лише згруповані дані)\n" + +#~ msgid "sort command too-long (please report this bug)" +#~ msgstr "" +#~ "упорядковування за допомогою команди sort виконується надто довго " +#~ "(повідомте розробників про ваду)" + #~ msgid "%s home page: \n" #~ msgstr "Домашня сторінка %s: \n" @@ -1224,9 +1272,6 @@ #~ 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" Binary files /tmp/tmpk9ju3y2l/uqkwDqQpWf/datamash-1.7/po/vi.gmo and /tmp/tmpk9ju3y2l/ut88G7BZjZ/datamash-1.8/po/vi.gmo differ diff -Nru datamash-1.7/po/vi.po datamash-1.8/po/vi.po --- datamash-1.7/po/vi.po 2020-04-23 17:34:24.000000000 +0000 +++ datamash-1.8/po/vi.po 2022-07-23 01:57:18.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: 2020-04-23 11:34-0600\n" +"POT-Creation-Date: 2022-07-23 11:57+1000\n" "PO-Revision-Date: 2015-06-06 15:26+0700\n" "Last-Translator: Trần Ngọc Quân \n" "Language-Team: Vietnamese \n" @@ -84,11 +84,11 @@ #. If you don't know what to put here, please see #. #. and use glyphs suitable for your language. -#: lib/quotearg.c:362 +#: lib/quotearg.c:355 msgid "`" msgstr "“" -#: lib/quotearg.c:363 +#: lib/quotearg.c:356 msgid "'" msgstr "”" @@ -238,9 +238,6 @@ #. bugs (typically your translation team's web or email address). #: lib/version-etc.c:249 #, fuzzy, c-format -#| msgid "" -#| "\n" -#| "Report bugs to: %s\n" msgid "Report bugs to: %s\n" msgstr "" "\n" @@ -283,32 +280,32 @@ msgstr "%s%s đối số “%s” quá lớn" #. This is a proper name. See the gettext manual, section Names. -#: src/datamash.c:65 src/decorate.c:41 -msgid "Assaf Gordon" -msgstr "Assaf Gordon" +#: src/datamash.c:66 +msgid "Assaf Gordon, Tim Rice, Shawn Wagner, Erik Auerswald" +msgstr "" -#: src/datamash.c:161 src/datamash.c:504 +#: src/datamash.c:169 src/datamash.c:539 #, 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 +#: src/datamash.c:182 #, 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:185 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." -#: src/datamash.c:180 +#: src/datamash.c:188 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:183 +#: src/datamash.c:191 #, fuzzy msgid "" "'fld' is the input field to use. 'fld' can be a number (1=first field),\n" @@ -318,77 +315,83 @@ "“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:186 +#: src/datamash.c:194 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:191 +#: src/datamash.c:199 #, fuzzy msgid "Primary operations:\n" msgstr "Thao tác trên-dòng:\n" -#: src/datamash.c:194 +#: src/datamash.c:202 msgid "Line-Filtering operations:\n" msgstr "Thao tác lọc-dòng:\n" -#: src/datamash.c:197 +#: src/datamash.c:205 msgid "Per-Line operations:\n" msgstr "Thao tác trên-dòng:\n" -#: src/datamash.c:203 +#: src/datamash.c:211 msgid "Numeric Grouping operations:\n" msgstr "Các thao tác nhóm số:\n" -#: src/datamash.c:206 +#: src/datamash.c:214 msgid "Textual/Numeric Grouping operations:\n" msgstr "Thao tác nhóm Số/Chữ:\n" -#: src/datamash.c:210 +#: src/datamash.c:218 msgid "Statistical Grouping operations:\n" msgstr "Thao tác nhóm thống kê:\n" -#: src/datamash.c:219 +#: src/datamash.c:227 src/decorate.c:179 +msgid "Options:\n" +msgstr "Tùy chọn:\n" + +#: src/datamash.c:229 msgid "Grouping Options:\n" msgstr "Tùy chọn nhóm:\n" -#: src/datamash.c:220 +#: src/datamash.c:230 msgid "" " -C, --skip-comments skip comment lines (starting with '#' or ';'\n" " and optional whitespace)\n" msgstr "" -#: src/datamash.c:224 +#: src/datamash.c:234 msgid "" " -f, --full print entire input line before op results\n" " (default: print only the grouped keys)\n" +" This option is only sensible for linewise\n" +" operations. Other uses are deprecated and\n" +" will be removed in a future version of GNU\n" +" Datamash.\n" msgstr "" -" -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:228 +#: src/datamash.c:242 msgid "" " -g, --group=X[,Y,Z] group via fields X,[Y,Z];\n" " equivalent to primary operation 'groupby'\n" msgstr "" -#: src/datamash.c:232 +#: src/datamash.c:246 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:235 +#: src/datamash.c:249 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:238 +#: src/datamash.c:252 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:241 +#: src/datamash.c:255 msgid "" " -i, --ignore-case ignore upper/lower case when comparing text;\n" " this affects grouping, and string operations\n" @@ -396,7 +399,7 @@ " -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:245 +#: src/datamash.c:259 msgid "" " -s, --sort sort the input before grouping; this removes " "the\n" @@ -408,51 +411,57 @@ " cần đến đường ống một cách thủ công thông qua " "lệnh “sort”\n" -#: src/datamash.c:250 +#: src/datamash.c:263 +msgid "" +" -c, --collapse-delimiter=X use X to separate elements in collapse and\n" +" unique lists (default: comma)\n" +msgstr "" + +#: src/datamash.c:268 msgid "File Operation Options:\n" msgstr "Tùy chọn thao tác tập tin:\n" -#: src/datamash.c:251 +#: src/datamash.c:269 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" -#: src/datamash.c:254 +#: src/datamash.c:272 #, 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" -#: src/datamash.c:259 src/decorate.c:174 +#: src/datamash.c:277 src/decorate.c:185 msgid "General Options:\n" msgstr "Tùy chọn chung:\n" -#: src/datamash.c:260 +#: src/datamash.c:278 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" -#: src/datamash.c:263 +#: src/datamash.c:281 msgid "" " --format=FORMAT print numeric values with printf style\n" " floating-point FORMAT.\n" msgstr "" -#: src/datamash.c:267 +#: src/datamash.c:285 msgid "" " --output-delimiter=X use X instead as output field delimiter\n" " (default: use same delimiter as -t/-W)\n" msgstr "" -#: src/datamash.c:271 +#: src/datamash.c:289 msgid " --narm skip NA/NaN values\n" msgstr " --narm bỏ qua các giá trị NA/NaN\n" -#: src/datamash.c:274 +#: src/datamash.c:292 msgid " -R, --round=N round numeric output to N decimal places\n" msgstr "" -#: src/datamash.c:277 +#: src/datamash.c:295 msgid "" " -W, --whitespace use whitespace (one or more spaces and/or tabs)\n" " for field delimiters\n" @@ -460,33 +469,45 @@ " -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:281 +#: src/datamash.c:299 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" -#: src/datamash.c:290 +#: src/datamash.c:302 src/decorate.c:219 +msgid " --sort-cmd=/path/to/sort Alternative sort(1) to use.\n" +msgstr "" + +#: src/datamash.c:311 +msgid "Environment:" +msgstr "" + +#: src/datamash.c:313 +msgid " LC_NUMERIC decimal-point character and thousands separator\n" +msgstr "" + +#: src/datamash.c:319 msgid "Examples:" msgstr "Ví dụ:" -#: src/datamash.c:292 +#: src/datamash.c:321 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:297 +#: src/datamash.c:326 msgid "Transpose input:" msgstr "Chuyển vị đầu vào:" -#: src/datamash.c:304 src/decorate.c:287 +#: src/datamash.c:333 src/decorate.c:302 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:306 src/decorate.c:289 +#: src/datamash.c:335 src/decorate.c:304 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:315 +#: src/datamash.c:344 #, c-format msgid "" "invalid input: field % requested, line % has only " @@ -495,12 +516,18 @@ "đầu vào không hợp lệ: đã yêu cầu trường %, dòng % chỉ có " "% trường" -#: src/datamash.c:385 +#: src/datamash.c:414 #, c-format msgid "%s in line % field %: '%s'" msgstr "%s ở dòng % trường %: “%s”" -#: src/datamash.c:713 +#: src/datamash.c:656 +msgid "" +"datamash: Using -f/--full with non-linewise operations is deprecated and " +"will be disabled in a future release.\n" +msgstr "" + +#: src/datamash.c:752 #, c-format msgid "" "transpose input error: line % has % fields (previous lines " @@ -511,7 +538,7 @@ "%);\n" "xem --help để tắt chế độ hạn chế" -#: src/datamash.c:770 +#: src/datamash.c:809 #, c-format msgid "" "reverse-field input error: line % has % fields (previous " @@ -522,14 +549,14 @@ "trước đó có %);\n" "xem --help để tắt chế độ hạn chế" -#: src/datamash.c:879 src/datamash.c:896 src/datamash.c:902 +#: src/datamash.c:918 src/datamash.c:935 src/datamash.c:941 #, fuzzy, c-format msgid "" "line % (% fields):\n" " " msgstr "%s ở dòng % trường %: “%s”" -#: src/datamash.c:885 +#: src/datamash.c:924 #, fuzzy, c-format msgid "" "check failed: line % has % fields (expecting %)" @@ -538,7 +565,7 @@ "%);\n" "xem --help để tắt chế độ hạn chế" -#: src/datamash.c:908 +#: src/datamash.c:947 #, fuzzy, c-format msgid "" "check failed: line % has % fields (previous line had " @@ -548,74 +575,70 @@ "%);\n" "xem --help để tắt chế độ hạn chế" -#: src/datamash.c:922 -#, fuzzy, c-format +#: src/datamash.c:961 +#, c-format msgid "check failed: input had % lines (expecting %)" 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:928 +#: src/datamash.c:967 #, c-format msgid "% line" msgid_plural "% lines" msgstr[0] "" -#: src/datamash.c:931 +#: src/datamash.c:970 #, c-format msgid "% field" msgid_plural "% fields" msgstr[0] "" -#: src/datamash.c:1032 +#: src/datamash.c:1080 msgid "hash memory allocation error" msgstr "lỗi phân bổ bộ nhớ mã băm" -#: src/datamash.c:1099 -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:1147 +msgid "-s and -z cannot be combined on this system" +msgstr "" -#: src/datamash.c:1105 +#: src/datamash.c:1181 msgid "failed to run 'sort': popen failed" msgstr "gặp lỗi khi chạy “sort”: popen bị lỗi" -#: src/datamash.c:1121 +#: src/datamash.c:1197 msgid "read error" msgstr "lỗi đọc" -#: src/datamash.c:1129 +#: src/datamash.c:1205 msgid "read error (on close)" msgstr "lỗi đọc (khi đóng)" -#: src/datamash.c:1222 src/datamash.c:1229 +#: src/datamash.c:1300 src/datamash.c:1307 src/datamash.c:1323 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:1265 +#: src/datamash.c:1354 #, c-format msgid "missing operation specifiers" msgstr "thiếu bộ chỉ thị thao tác" -#: src/datamash.c:1283 +#: src/datamash.c:1372 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/decorate-functions.c:76 #, fuzzy, c-format -#| msgid "invalid empty grouping parameter" msgid "invalid empty roman numeral" msgstr "tham số nhóm trống rỗng không hợp lệ" #: src/decorate-functions.c:84 #, fuzzy, c-format msgid "invalid roman numeral '%c' in %s" -msgstr "giá trị số không hợp lệ" +msgstr "thao tác không hợp lệ “%s”" #: src/decorate-functions.c:120 #, fuzzy, c-format msgid "invalid IPv4 address %s" -msgstr "thao tác không hợp lệ “%s”" +msgstr "đối số %s%s không hợp lệ “%s”" #: src/decorate-functions.c:139 msgid "inet_pton (AF_INET) failed" @@ -633,9 +656,23 @@ #: src/decorate-functions.c:165 #, fuzzy, c-format msgid "invalid IPv6 address %s" -msgstr "thao tác không hợp lệ “%s”" +msgstr "đối số %s%s không hợp lệ “%s”" + +#: src/decorate-functions.c:192 +msgid "inet_pton failed for AF_INET and AF_INET6" +msgstr "" + +#: src/decorate-functions.c:196 +#, fuzzy, c-format +msgid "invalid IP address %s" +msgstr "đối số %s%s không hợp lệ “%s”" + +#. This is a proper name. See the gettext manual, section Names. +#: src/decorate.c:42 +msgid "Assaf Gordon, Shawn Wagner and Erik Auerswald" +msgstr "" -#: src/decorate.c:140 +#: src/decorate.c:145 #, c-format msgid "" "Usage: %s [OPTION]... [INPUT]\n" @@ -644,29 +681,29 @@ "\n" msgstr "" -#: src/decorate.c:147 +#: src/decorate.c:152 msgid "Converts (and optionally sorts) fields of various formats\n" msgstr "" -#: src/decorate.c:153 +#: src/decorate.c:158 msgid "" "With --decorate: adds the converted fields to the start\n" "of each line and prints and prints it to STDOUT; does not sort.\n" msgstr "" -#: src/decorate.c:160 +#: src/decorate.c:165 msgid "" "With --undecorate: removes the first N fields from the input;\n" "Use as post-processing step after sort(1).\n" msgstr "" -#: src/decorate.c:167 +#: src/decorate.c:172 msgid "" "Without --decorate and --undecorate: automatically decorates the input,\n" "runs sort(1) and undecorates the result; This is the easiest method to use.\n" msgstr "" -#: src/decorate.c:179 +#: src/decorate.c:190 msgid "" " --decorate decorate/convert the specified fields and " "print\n" @@ -675,13 +712,13 @@ " sort(1) or undecorates the output\n" msgstr "" -#: src/decorate.c:184 +#: src/decorate.c:195 msgid "" " --header=N does not decorate or sort the first N lines\n" " -H same as --header=N\n" msgstr "" -#: src/decorate.c:188 +#: src/decorate.c:199 msgid "" " -k, --key=KEYDEF key/field to sort; same syntax as sort(1),\n" " optionally followed by ':method' to convert\n" @@ -690,17 +727,15 @@ " and available conversion below\n" msgstr "" -#: src/decorate.c:194 +#: src/decorate.c:205 #, fuzzy -#| msgid "" -#| " -t, --field-separator=X use X instead of TAB as field delimiter\n" msgid "" " -t, --field-separator=SEP use SEP instead of non-blank to blank " "transition\n" msgstr "" " -t, --field-separator=X dùng X thay vì TAB làm bộ phân tách trường\n" -#: src/decorate.c:197 +#: src/decorate.c:208 msgid "" " --print-sort-args print adjusted parameters for sort(1); Useful\n" " when using --decorate and then manually " @@ -708,27 +743,26 @@ " sort(1)\n" msgstr "" -#: src/decorate.c:202 +#: src/decorate.c:213 #, fuzzy -#| msgid "" -#| " --no-strict allow lines with varying number of fields\n" msgid " --undecorate=N removes the first N fields\n" msgstr "" " --no-strict cho phép các dòng với số lượng trường biến đổi\n" -#: src/decorate.c:205 +#: src/decorate.c:216 #, fuzzy -#| msgid " -z, --zero-terminated end lines with 0 byte, not newline\n" msgid " -z, --zero-terminated line delimiter is NUL, 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" -#: src/decorate.c:213 -msgid "The following options are passed to sort(1) as-is:\n" +#: src/decorate.c:227 +msgid "" +"The following options are passed to sort as-is (Most of them assume GNU " +"sort):\n" msgstr "" -#: src/decorate.c:219 +#: src/decorate.c:234 msgid "" " -c, --check\n" " --compress-program\n" @@ -741,237 +775,236 @@ " --parallel\n" msgstr "" -#: src/decorate.c:234 +#: src/decorate.c:249 msgid "Available conversions methods (use with -k):\n" msgstr "" -#: src/decorate.c:246 +#: src/decorate.c:261 #, fuzzy -#| msgid "Examples:" msgid "Examples:\n" msgstr "Ví dụ:" -#: src/decorate.c:252 +#: src/decorate.c:267 msgid "The following two invocations are equivalent:\n" msgstr "" -#: src/decorate.c:267 +#: src/decorate.c:282 msgid "Decorated output of roman numerals:\n" msgstr "" -#: src/decorate.c:431 +#: src/decorate.c:446 msgid "fwrite (header line) failed" msgstr "" -#: src/decorate.c:439 +#: src/decorate.c:454 msgid "fflush (header line) failed" msgstr "" -#: src/decorate.c:445 +#: src/decorate.c:460 #, c-format -msgid "conversion failed in line %zu" +msgid "conversion failed in line %" msgstr "" -#: src/decorate.c:451 +#: src/decorate.c:467 msgid "decorate: fwrite failed" msgstr "" -#: src/decorate.c:457 src/decorate.c:519 +#: src/decorate.c:473 src/decorate.c:535 #, c-format msgid "error reading %s" msgstr "" -#: src/decorate.c:538 +#: src/decorate.c:554 #, fuzzy msgid "invalid number at field start" msgstr "giá trị số không hợp lệ" -#: src/decorate.c:543 src/decorate.c:571 +#: src/decorate.c:559 src/decorate.c:587 msgid "field number is zero" msgstr "" -#: src/decorate.c:548 src/decorate.c:576 +#: src/decorate.c:564 src/decorate.c:592 #, fuzzy msgid "invalid number after '.'" msgstr "giá trị số không hợp lệ" -#: src/decorate.c:552 +#: src/decorate.c:568 msgid "character offset is zero" msgstr "" -#: src/decorate.c:567 +#: src/decorate.c:583 #, fuzzy msgid "invalid number after ','" msgstr "giá trị số không hợp lệ" -#: src/decorate.c:603 +#: src/decorate.c:619 msgid "missing external conversion command" msgstr "" -#: src/decorate.c:618 +#: src/decorate.c:634 msgid "missing internal conversion function" msgstr "" -#: src/decorate.c:630 -#, fuzzy +#: src/decorate.c:646 msgid "invalid built-in conversion option" -msgstr "cột “%s” không hợp lệ với thao tác %s" +msgstr "" -#: src/decorate.c:641 +#: src/decorate.c:657 msgid "" "ordering flags (b/d/i/h/n/g/M/R/V) cannot be combined with a conversion " "function" msgstr "" -#: src/decorate.c:671 +#: src/decorate.c:687 #, fuzzy msgid "invalid key specification" msgstr "thao tác không hợp lệ “%s”" -#: src/decorate.c:853 +#: src/decorate.c:890 #, fuzzy, c-format msgid "invalid number of header lines %s" msgstr "giá trị số không hợp lệ" -#: src/decorate.c:907 +#: src/decorate.c:948 msgid "empty tab" msgstr "" -#: src/decorate.c:918 +#: src/decorate.c:959 #, c-format msgid "multi-character tab %s" msgstr "" -#: src/decorate.c:923 +#: src/decorate.c:964 msgid "incompatible tabs" msgstr "" -#: src/decorate.c:945 -#, fuzzy, c-format +#: src/decorate.c:986 +#, c-format msgid "invalid number of fields to undecorate %s" -msgstr "cột “%s” không hợp lệ với thao tác %s" +msgstr "" -#: src/decorate.c:968 +#: src/decorate.c:1009 msgid "--decorate and --undecorate options are mutually exclusive" msgstr "" -#: src/decorate.c:972 +#: src/decorate.c:1013 msgid "--undecorate cannot be used with --keys or --decorate" msgstr "" -#: src/decorate.c:976 +#: src/decorate.c:1017 msgid "missing -k/--key decoration or --undecorate options" msgstr "" -#: src/decorate.c:985 +#: src/decorate.c:1026 msgid "no decorated keys specified. use sort instead" msgstr "" -#: src/decorate.c:1024 +#: src/decorate.c:1060 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to create dec-sort pipe" msgstr "gặp lỗi khi chạy “sort”: popen bị lỗi" -#: src/decorate.c:1026 +#: src/decorate.c:1062 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to create sort-undec pipe" msgstr "gặp lỗi khi chạy “sort”: popen bị lỗi" -#: src/decorate.c:1033 +#: src/decorate.c:1069 msgid "failed to fork-1" msgstr "" -#: src/decorate.c:1040 +#: src/decorate.c:1076 msgid "failed to fork-2" msgstr "" -#: src/decorate.c:1052 src/decorate.c:1101 +#: src/decorate.c:1088 src/decorate.c:1137 msgid "failed to close sort-undec read-pipe" msgstr "" -#: src/decorate.c:1055 src/decorate.c:1140 +#: src/decorate.c:1091 src/decorate.c:1176 msgid "failed to close sort-undec write-pipe" msgstr "" -#: src/decorate.c:1057 src/decorate.c:1135 +#: src/decorate.c:1093 src/decorate.c:1171 msgid "failed to close dec-sort read-pipe" msgstr "" -#: src/decorate.c:1066 +#: src/decorate.c:1102 msgid "failed to dup STDOUT fd" msgstr "" -#: src/decorate.c:1069 +#: src/decorate.c:1105 msgid "fdopen (dup (stdout)) failed" msgstr "" -#: src/decorate.c:1074 +#: src/decorate.c:1110 msgid "failed to reassign dec-sort STDOUT" msgstr "" -#: src/decorate.c:1098 src/decorate.c:1137 +#: src/decorate.c:1134 src/decorate.c:1173 msgid "failed to close dec-sort write-pipe" msgstr "" -#: src/decorate.c:1106 +#: src/decorate.c:1142 msgid "failed to reassign dec-sort STDIN" msgstr "" -#: src/decorate.c:1112 +#: src/decorate.c:1148 msgid "failed to reassign sort-undec STDOUT" msgstr "" -#: src/decorate.c:1126 +#: src/decorate.c:1162 #, fuzzy -#| msgid "failed to run 'sort': popen failed" msgid "failed to run the sort command" msgstr "gặp lỗi khi chạy “sort”: popen bị lỗi" -#: src/decorate.c:1144 +#: src/decorate.c:1180 msgid "failed to reassign sort-undec STDIN" msgstr "" -#: src/double-format.c:49 +#: src/double-format.c:45 +msgid "numeric format too large" +msgstr "" + +#: src/double-format.c:54 #, c-format msgid "format %s has no %% directive" msgstr "" -#: src/double-format.c:62 +#: src/double-format.c:67 #, c-format msgid "format %s missing valid type after '%%'" msgstr "" -#: src/double-format.c:66 +#: src/double-format.c:71 #, c-format msgid "format %s has unknown/invalid type %%%c directive" msgstr "" -#: src/double-format.c:79 +#: src/double-format.c:84 #, c-format msgid "format %s has too many %% directives" msgstr "" -#: src/field-ops.c:346 +#: src/field-ops.c:351 #, c-format msgid "" "input error for operation %s: fields %,% have different " "number of items" msgstr "" -#: src/field-ops.c:1176 +#: src/field-ops.c:1199 msgid "invalid numeric value" msgstr "giá trị số không hợp lệ" -#: src/field-ops.c:1178 +#: src/field-ops.c:1201 msgid "invalid base64 value" msgstr "giá trị base64 không hợp lệ" #: src/key-compare.c:305 #, fuzzy, c-format msgid "%s: invalid field specification %s" -msgstr "cột “%s” không hợp lệ với thao tác %s" +msgstr "thao tác không hợp lệ “%s”" #: src/key-compare.c:337 #, c-format @@ -1001,7 +1034,7 @@ #: src/op-parser.c:243 #, fuzzy, c-format msgid "invalid getnum type '%c'" -msgstr "giá trị số không hợp lệ" +msgstr "thao tác không hợp lệ “%s”" #: src/op-parser.c:275 src/op-parser.c:286 src/op-parser.c:554 #, fuzzy, c-format @@ -1054,7 +1087,7 @@ msgid "conflicting operation %s" msgstr "thao tác không hợp lệ “%s”" -#: src/op-parser.c:499 src/op-parser.c:752 +#: src/op-parser.c:499 src/op-parser.c:758 #, fuzzy, c-format msgid "invalid operation %s" msgstr "thao tác không hợp lệ “%s”" @@ -1094,22 +1127,22 @@ msgid "crosstab requires exactly 2 fields, found %" msgstr "" -#: src/op-parser.c:705 +#: src/op-parser.c:711 #, c-format msgid "crosstab supports one operation, found %" msgstr "" -#: src/op-parser.c:714 +#: src/op-parser.c:720 #, fuzzy msgid "missing operation" msgstr "thiếu bộ chỉ thị thao tác" -#: src/op-parser.c:728 +#: src/op-parser.c:734 #, fuzzy, c-format msgid "extra operand %s" msgstr "có thao tác thừa nằm sau “%s”" -#: src/op-parser.c:865 src/op-scanner.c:237 +#: src/op-parser.c:874 src/op-scanner.c:237 msgid "missing script (among arguments)" msgstr "" @@ -1149,46 +1182,63 @@ 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" -#: src/text-options.c:111 +#: src/text-options.c:109 msgid "missing rounding digits value" msgstr "" -#: src/text-options.c:116 +#: src/text-options.c:114 #, fuzzy, c-format msgid "invalid rounding digits value %s" msgstr "tham số nhóm không hợp lệ “%s”" -#, fuzzy -#~ msgid "%s home page: \n" -#~ msgstr "Trang chủ %s: \n" +#~ msgid "Assaf Gordon" +#~ msgstr "Assaf Gordon" +#~ msgid "" +#~ " -f, --full print entire input line before op results\n" +#~ " (default: print only the grouped keys)\n" +#~ msgstr "" +#~ " -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" + +#, c-format #~ msgid "%s: option '--%s' doesn't allow an argument\n" #~ msgstr "%s: tùy chọn “--%s” không nhận đối số\n" +#, c-format #~ msgid "%s: unrecognized option '--%s'\n" #~ msgstr "%s: không nhận ra tùy chọn “--%s”\n" +#, c-format #~ msgid "%s: option '-W %s' is ambiguous\n" #~ msgstr "%s: tùy chọn “-W %s” chưa rõ ràng\n" +#, c-format #~ msgid "%s: option '-W %s' doesn't allow an argument\n" #~ msgstr "%s: tùy chọn “-W %s” không cho phép đối số\n" +#, c-format #~ msgid "%s: option '-W %s' requires an argument\n" #~ msgstr "%s: tùy chọn “-W %s” cần một đối số\n" +#, c-format +#~ msgid "%s home page: \n" +#~ msgstr "Trang chủ %s: \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" +#, 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)" + #, 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.7/README datamash-1.8/README --- datamash-1.7/README 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/README 2022-05-28 02:52:43.000000000 +0000 @@ -128,7 +128,7 @@ Copyright and License ===================== -Copyright (C) 2013-2020 Assaf Gordon +Copyright (C) 2013-2021 Assaf Gordon License: GPL Version 3 (or later). diff -Nru datamash-1.7/src/column-headers.c datamash-1.8/src/column-headers.c --- datamash-1.7/src/column-headers.c 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/src/column-headers.c 2022-06-21 21:06:28.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2014-2020 Assaf Gordon. + Copyright (C) 2014-2021 Assaf Gordon. This file is part of GNU Datamash. diff -Nru datamash-1.7/src/column-headers.h datamash-1.8/src/column-headers.h --- datamash-1.7/src/column-headers.h 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/src/column-headers.h 2022-05-28 03:51:36.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2014-2020 Assaf Gordon + Copyright (C) 2014-2021 Assaf Gordon This file is part of GNU Datamash. diff -Nru datamash-1.7/src/crosstab.c datamash-1.8/src/crosstab.c --- datamash-1.7/src/crosstab.c 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/src/crosstab.c 2022-06-01 21:08:00.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2020 Assaf Gordon + Copyright (C) 2013-2021 Assaf Gordon This file is part of GNU Datamash. @@ -26,7 +26,6 @@ #include #include -#include "ignore-value.h" #include "hash.h" #include "hash-pjw.h" #include "xalloc.h" @@ -82,7 +81,7 @@ struct crosstab_datacell *dc = xmalloc (sizeof (struct crosstab_datacell)); dc->row_name = row; dc->col_name = col; - dc->data = data; + dc->data = xstrdup (data); return dc; } @@ -92,6 +91,10 @@ struct crosstab_datacell *dc = (struct crosstab_datacell*)a; dc->row_name = NULL; dc->col_name = NULL; + /* syntax-check doesn't like casting the argument to free; free + doesn't like const values passed to it. */ + void *data = (void*)dc->data; + free (data); dc->data = NULL; free (dc); } @@ -136,8 +139,11 @@ 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)); + struct crosstab_datacell *ctdc = new_datacell (r,c,data); + struct crosstab_datacell *existing_ctdc = hash_insert (ct->data, ctdc); + if (ctdc != existing_ctdc) { + crosstab_datacell_free (ctdc); + } } @@ -182,8 +188,8 @@ print_line_separator (); } - IF_LINT (free (rows_list)); - IF_LINT (free (cols_list)); + free (rows_list); + free (cols_list); } /* vim: set cinoptions=>4,n-2,{2,^-2,:2,=2,g0,h2,p5,t0,+2,(0,u0,w1,m1: */ /* vim: set shiftwidth=2: */ diff -Nru datamash-1.7/src/crosstab.h datamash-1.8/src/crosstab.h --- datamash-1.7/src/crosstab.h 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/src/crosstab.h 2022-05-28 03:51:36.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2020 Assaf Gordon + Copyright (C) 2013-2021 Assaf Gordon This file is part of GNU Datamash. diff -Nru datamash-1.7/src/datamash.c datamash-1.8/src/datamash.c --- datamash-1.7/src/datamash.c 2020-04-23 16:39:59.000000000 +0000 +++ datamash-1.8/src/datamash.c 2022-07-09 04:58:41.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2020 Assaf Gordon + Copyright (C) 2013-2021 Assaf Gordon This file is part of GNU Datamash. @@ -47,8 +47,8 @@ #include "linebuffer.h" #define Version VERSION #include "version-etc.h" -#include "xstrndup.h" #include "xalloc.h" +#include "sh-quote.h" #include "text-options.h" #include "text-lines.h" @@ -62,10 +62,12 @@ /* The official name of this program (e.g., no 'g' prefix). */ #define PROGRAM_NAME "datamash" -#define AUTHORS proper_name ("Assaf Gordon") +#define AUTHORS proper_name \ + ("Assaf Gordon, Tim Rice, Shawn Wagner, Erik Auerswald") /* Until someone better comes along */ -const char version_etc_copyright[] = "Copyright %s %d Assaf Gordon" ; +const char version_etc_copyright[] + = "Copyright %s %d Assaf Gordon and Tim Rice" ; /* Line number in the input file */ static size_t line_number = 0 ; @@ -100,6 +102,9 @@ /* Explicit output delimiter with --output-delimiter */ static int explicit_output_delimiter = -1; +/* Path to default sort program */ +static const char *sort_cmd = SORT_PATH; + enum { INPUT_HEADER_OPTION = CHAR_MAX + 1, @@ -108,13 +113,14 @@ REMOVE_NA_VALUES_OPTION, OUTPUT_DELIMITER_OPTION, CUSTOM_FORMAT_OPTION, + SORT_PROGRAM_OPTION, UNDOC_PRINT_INF_OPTION, UNDOC_PRINT_NAN_OPTION, UNDOC_PRINT_PROGNAME_OPTION, UNDOC_RMDUP_TEST }; -static char const short_options[] = "sfF:izg:t:HWR:C"; +static char const short_options[] = "sfF:izg:t:HWR:Cc:"; static struct option const long_options[] = { @@ -131,10 +137,12 @@ {"filler", required_argument, NULL, 'F'}, {"format", required_argument, NULL, CUSTOM_FORMAT_OPTION}, {"output-delimiter", required_argument, NULL, OUTPUT_DELIMITER_OPTION}, + {"collapse-delimiter", required_argument, NULL,'c'}, {"sort", no_argument, NULL, 's'}, {"no-strict", no_argument, NULL, NO_STRICT_OPTION}, {"narm", no_argument, NULL, REMOVE_NA_VALUES_OPTION}, {"round", required_argument, NULL, 'R'}, + {"sort-cmd", required_argument, NULL, SORT_PROGRAM_OPTION}, {GETOPT_HELP_OPTION_DECL}, {GETOPT_VERSION_OPTION_DECL}, /* Undocumented options */ @@ -210,12 +218,14 @@ fputs (_("Statistical Grouping operations:\n"),stdout); fputs ("\ mean, geomean, harmmean, trimmean, median, q1, q3, iqr, perc,\n\ - mode, antimode, pstdev, sstdev, pvar, svar, mad, madraw,\n\ + mode, antimode, pstdev, sstdev, pvar, svar, ms, rms, mad, madraw,\n\ pskew, sskew, pkurt, skurt, dpo, jarque,\n\ scov, pcov, spearson, ppearson\n\ \n", stdout); fputs ("\n", stdout); + fputs (_("Options:\n"),stdout); + fputs ("\n", stdout); fputs (_("Grouping Options:\n"),stdout); fputs (_("\ -C, --skip-comments skip comment lines (starting with '#' or ';'\n\ @@ -224,6 +234,10 @@ fputs (_("\ -f, --full print entire input line before op results\n\ (default: print only the grouped keys)\n\ + This option is only sensible for linewise\n\ + operations. Other uses are deprecated and\n\ + will be removed in a future version of GNU\n\ + Datamash.\n\ "), stdout); fputs (_("\ -g, --group=X[,Y,Z] group via fields X,[Y,Z];\n\ @@ -246,14 +260,18 @@ -s, --sort sort the input before grouping; this removes the\n\ need to manually pipe the input through 'sort'\n\ "), stdout); + fputs (_("\ + -c, --collapse-delimiter=X use X to separate elements in collapse and\n\ + unique lists (default: comma)\n\ +"), stdout); fputs (_("File Operation Options:\n"),stdout); fputs (_("\ --no-strict allow lines with varying number of fields\n\ "), stdout); - fputs (_("\ + printf (_("\ --filler=X fill missing values with X (default %s)\n\ -"), stdout); +"), missing_field_filler); fputs ("\n", stdout); fputs (_("General Options:\n"),stdout); @@ -281,12 +299,23 @@ fputs (_("\ -z, --zero-terminated end lines with 0 byte, not newline\n\ "), stdout); + fputs (_("\ + --sort-cmd=/path/to/sort Alternative sort(1) to use.\n\ +"), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); fputs ("\n\n", stdout); + fputs (_("Environment:"), stdout); + fputs ("\n", stdout); + fputs (_("\ + LC_NUMERIC decimal-point character and thousands separator\n\ +"), stdout); + + fputs ("\n\n", stdout); + fputs (_("Examples:"), stdout); fputs ("\n\n", stdout); fputs (_("Print the sum and the mean of values from column 1:"), stdout); @@ -302,7 +331,7 @@ \n", program_name); fputs (_("For detailed usage information and examples, see\n"),stdout); - printf (" man %s\n", PACKAGE_NAME); + printf (" man %s\n", PROGRAM_NAME); fputs (_("The manual and more examples are available at\n"), stdout); fputs (" " PACKAGE_URL "\n\n", stdout); } @@ -332,7 +361,7 @@ char * /* out */ buf, size_t len) { const char *p; - size_t l; + size_t l = 0; safe_line_record_get_field (lr, n, &p, &l); l = MIN (len-1,l); memcpy (buf, p, l); @@ -421,14 +450,14 @@ } } -#define SWAP_LINES(A, B) \ - do \ - { \ - struct line_record_t *_tmp; \ - _tmp = (A); \ - (A) = (B); \ - (B) = _tmp; \ - } \ +#define SWAP_LINES(A, B) \ + do \ + { \ + struct line_record_t *_tmp; \ + _tmp = (A); \ + (A) = (B); \ + (B) = _tmp; \ + } \ while (0) @@ -465,8 +494,6 @@ 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 ()); @@ -480,7 +507,15 @@ printf (":%Lg", op->params.trimmed_mean); } - printf ("(%s)", get_input_field_name (op->field)); + printf ("(%s", get_input_field_name (op->field)); + while (dm->ops[i].slave) + { + /* print subsequent arguments to the same operation, + e.g. 'pcov (x,y)' */ + ++i; + printf (",%s", get_input_field_name (dm->ops[i].field)); + } + printf (")"); if (i != dm->num_ops-1) print_field_separator (); @@ -597,7 +632,7 @@ /* Process each line in the input. - If the key fo the current line is different from the prevopis one, + If the key of the current line is different from the previous one, summarize the previous group and start a new one. */ static void @@ -617,6 +652,10 @@ if (input_header && line_number==0) process_input_header (input_stream); + if (print_full_line && !line_mode) + fputs (_("datamash: Using -f/--full with non-linewise operations \ +is deprecated and will be disabled in a future release.\n"), stderr); + /* 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) @@ -987,9 +1026,18 @@ if (output_header) { - ignore_value (fwrite (line_record_buffer (thisline), - line_record_length (thisline), - sizeof (char), stdout)); + const size_t num_fields = line_record_num_fields (thisline); + for (size_t i = 1 ; i <= num_fields ; ++i) { + if (i>1) + print_field_separator (); + + const char *str; + size_t len; + if (line_record_get_field (thisline, i, &str, &len)) + { + ignore_value (fwrite (str, len, sizeof (char), stdout)); + } + } print_line_separator (); } } @@ -1007,39 +1055,48 @@ break; line_number++; - if (!line_record_get_field (thisline, key_col, &str, &len)) - error_not_enough_fields (key_col, line_record_num_fields (thisline)); + if (!line_record_get_field (thisline, key_col, &str, &len)) + error_not_enough_fields (key_col, line_record_num_fields (thisline)); + + /* Add key to the key buffer */ + if (next_key_pos + len + 1 > keys_buffer_alloc) + { + keys_buffer = xmalloc ( keys_buffer_alloc ) ; + next_key_pos = 0; - /* Add key to the key buffer */ - if (next_key_pos + len + 1 > keys_buffer_alloc) - { - 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 = x2nrealloc (buffer_list, - &buffer_list_alloc, sizeof (char*)); - buffer_list[buffer_list_size++] = keys_buffer; - } - char *next_key = keys_buffer+next_key_pos; - memcpy (next_key, str, len); - next_key[len] = 0; - - /* Add key to buffer (if not found) */ - const int i = hash_insert_if_absent (ht, next_key, NULL); - if ( i == -1 ) - die (EXIT_FAILURE, errno, _("hash memory allocation error")); - - if ( i == 1 ) - { - /* This string was not found in the hash - new key */ - next_key_pos += len+1; - ignore_value (fwrite (line_record_buffer (thisline), - line_record_length (thisline), sizeof (char), - stdout)); - print_line_separator (); - } + /* Add new key-buffer to the list */ + 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; + memcpy (next_key, str, len); + next_key[len] = 0; + + /* Add key to buffer (if not found) */ + const int i = hash_insert_if_absent (ht, next_key, NULL); + if ( i == -1 ) + die (EXIT_FAILURE, errno, _("hash memory allocation error")); + + if ( i == 1 ) + { + /* This string was not found in the hash - new key */ + next_key_pos += len+1; + const size_t num_fields = line_record_num_fields (thisline); + for (size_t i = 1 ; i <= num_fields ; ++i) { + if (i>1) + print_field_separator (); + + const char *str; + size_t len; + if (line_record_get_field (thisline, i, &str, &len)) + { + ignore_value (fwrite (str, len, sizeof (char), stdout)); + } + } + print_line_separator (); + } } line_record_free (&lr); hash_free (ht); @@ -1054,9 +1111,9 @@ { if (pipe_through_sort && dm->num_grps>0) { - char tmp[INT_BUFSIZE_BOUND (size_t)*2+5]; - char cmd[1024]; - memset (cmd,0,sizeof (cmd)); + char delim[2] = { 0, 0 }; + char **args = xcalloc (dm->num_grps + 8, sizeof (char *)); + int argc = 0; if (input_header) { @@ -1066,41 +1123,60 @@ the 'sort' child-process */ process_input_header (stdin); } + #ifdef SORT_WITHOUT_LOCALE - /* For mingw/windows systems */ - strcat (cmd,"sort "); -#else - strcat (cmd,"LC_ALL=C sort "); + args[argc++] = "LC_ALL=C"; #endif - if (!case_sensitive) - strcat (cmd,"-f "); + args[argc++] = (char *)sort_cmd; #ifdef HAVE_STABLE_SORT /* stable sort (-s) is needed to support first/last operations (prevent sort from re-ordering lines which are not part of the group. '-s' is not standard POSIX, but very commonly supported, including on GNU coreutils, Busybox, FreeBSD, MacOSX */ - strcat (cmd,"-s "); + args[argc++] = "-s"; #endif + + if (eolchar == '\0') + { +#ifdef HAVE_ZERO_SORT + /* sort needs to understand -z to properly sort input using + NUL as the line delimiter */ + args[argc++] = "-z"; +#else + die (EXIT_FAILURE, 0, + _("-s and -z cannot be combined on this system")); +#endif + } + if (!case_sensitive) + { + args[argc++] = "-f"; + } + if (in_tab != TAB_WHITESPACE) { - /* If the delimiter is a single-quote character, use - double-quote to prevent shell quoting problems. */ - const char qc = (in_tab=='\'')?'"':'\''; - snprintf (tmp,sizeof (tmp),"-t %c%c%c ",qc,in_tab,qc); - strcat (cmd,tmp); + args[argc++] = "-t"; + delim[0] = in_tab; + args[argc++] = delim; } + + int sort_spec = argc; for (size_t i = 0; i < dm->num_grps; ++i) { + char tmp[INT_BUFSIZE_BOUND (size_t) * 2 + 5]; const size_t col_num = dm->grps[i].num; - snprintf (tmp,sizeof (tmp),"-k%"PRIuMAX",%"PRIuMAX" ", + snprintf (tmp,sizeof (tmp),"-k%"PRIuMAX",%"PRIuMAX, (uintmax_t)col_num,(uintmax_t)col_num); - if (strlen (tmp)+strlen (cmd)+1 >= sizeof (cmd)) - die (EXIT_FAILURE, 0, - _("sort command too-long (please report this bug)")); - strcat (cmd,tmp); + args[argc++] = xstrdup (tmp); } + char *cmd = shell_quote_argv ((const char * const *) args); + while (sort_spec < argc) + { + free (args[sort_spec++]); + } + free (args); input_stream = popen (cmd,"r"); + free (cmd); if (input_stream == NULL) die (EXIT_FAILURE, 0, _("failed to run 'sort': popen failed")); } @@ -1138,6 +1214,8 @@ DECL_LONG_DOUBLE_ROUNDING BEGIN_LONG_DOUBLE_ROUNDING (); + openbsd_pledge (); + set_program_name (argv[0]); #ifdef FORCE_C_LOCALE @@ -1159,9 +1237,9 @@ { switch (optc) { - case 'C': - skip_comments = true; - break; + case 'C': + skip_comments = true; + break; case 'F': missing_field_filler = optarg; @@ -1196,9 +1274,9 @@ input_header = output_header = true; break; - case 'R': - set_numeric_output_precision (optarg); - break; + case 'R': + set_numeric_output_precision (optarg); + break; case 's': pipe_through_sort = true; @@ -1223,18 +1301,29 @@ in_tab = out_tab = optarg[0]; break; - case OUTPUT_DELIMITER_OPTION: + case OUTPUT_DELIMITER_OPTION: if (optarg[0] == '\0' || optarg[1] != '\0') die (EXIT_FAILURE, 0, - _("the delimiter must be a single character")); - explicit_output_delimiter = (char)optarg[0]; - break; + _("the delimiter must be a single character")); + explicit_output_delimiter = (char)optarg[0]; + break; case 'W': in_tab = TAB_WHITESPACE; out_tab = '\t'; break; + case SORT_PROGRAM_OPTION: + sort_cmd = xstrdup (optarg); + break; + + case'c': + if (optarg[0] == '\0' || optarg[1] != '\0') + die (EXIT_FAILURE, 0, + _("the delimiter must be a single character")); + collapse_separator = optarg[0]; + break; + case UNDOC_PRINT_INF_OPTION: case UNDOC_PRINT_NAN_OPTION: field_op_print_empty_value ( (optc==UNDOC_PRINT_INF_OPTION) diff -Nru datamash-1.7/src/decorate.c datamash-1.8/src/decorate.c --- datamash-1.7/src/decorate.c 2020-04-23 16:52:04.000000000 +0000 +++ datamash-1.8/src/decorate.c 2022-07-04 21:28:32.000000000 +0000 @@ -1,5 +1,5 @@ /* decorate -- auxiliary program for sort preprocessing - Copyright (C) 2020 Assaf Gordon + Copyright (C) 2020-2021 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 @@ -31,6 +31,7 @@ #define Version VERSION #include "version-etc.h" #include "ignore-value.h" +#include "sh-quote.h" #include "decorate-functions.h" @@ -38,7 +39,9 @@ #define PROGRAM_NAME "decorate" #define AUTHORS \ - proper_name ("Assaf Gordon") + proper_name ("Assaf Gordon, Shawn Wagner and Erik Auerswald") + +static const char *sort_cmd = SORT_PATH; static bool debug_print_pid = false; @@ -89,7 +92,8 @@ NMERGE_OPTION, RANDOM_SOURCE_OPTION, HEADER_OPTION, - PARALLEL_OPTION + PARALLEL_OPTION, + SORT_PROGRAM_OPTION }; static struct option const longopts[] = @@ -101,6 +105,7 @@ {"zero-terminated", no_argument, NULL, 'z'}, {"print-sort-args", no_argument, NULL, PRINT_SORT_ARGS_OPTION}, {"header", required_argument, NULL, HEADER_OPTION}, + {"sort-cmd", required_argument, NULL, SORT_PROGRAM_OPTION}, /* sort options, passed as-is to the sort process */ {"check", optional_argument, NULL, CHECK_OPTION}, @@ -172,6 +177,12 @@ putchar ('\n'); fputs (_("\ +Options:\n\ +"), stdout); + + putchar ('\n'); + + fputs (_("\ General Options:\n\ "), stdout); @@ -205,13 +216,17 @@ fputs (_("\ -z, --zero-terminated line delimiter is NUL, not newline\n\ "), stdout); + fputs (_("\ + --sort-cmd=/path/to/sort Alternative sort(1) to use.\n\ +"), stdout); fputs (HELP_OPTION_DESCRIPTION, stdout); fputs (VERSION_OPTION_DESCRIPTION, stdout); putchar ('\n'); fputs (_("\ -The following options are passed to sort(1) as-is:\n\ +The following options are passed to sort as-is\ + (Most of them assume GNU sort):\n\ "), stdout); putchar ('\n'); @@ -285,7 +300,7 @@ fputs (_("For detailed usage information and examples, see\n"),stdout); - printf (" man %s\n", program_name); + printf (" man %s\n", PROGRAM_NAME); fputs (_("The manual and more examples are available at\n"), stdout); fputs (" " PACKAGE_URL "\n\n", stdout); } @@ -442,7 +457,8 @@ } if (!decorate_fields (&lb)) - die (SORT_FAILURE, errno, _("conversion failed in line %zu"), linenum); + die (SORT_FAILURE, errno, _("conversion failed in line %"PRIdMAX), + linenum); if (debug) dbg_printf ("writing line: '%.*s'", (int)lb.length, lb.buffer); @@ -740,7 +756,8 @@ char** build_sort_process_args () { - int argc = 2 ; /* one 'sort' program name (argv[0]), one for NULL */ + int argc = 3 ; /* one 'sort' program name (argv[0]), one extra arg on NetBSD, + one for NULL */ struct keyfield *key = keylist; /* step 1: count number of args */ @@ -755,7 +772,17 @@ char** argv = xcalloc (argc, sizeof (char*)); int i = 0; - argv[i++] = xstrdup ("sort"); /* argv[0] */ + argv[i++] = xstrdup (sort_cmd); /* argv[0] */ + +#ifdef __NetBSD__ + /* NetBSD's /usr/bin/sort is stable by default, unlike every other + * one I checked, causing test case failures. So make it unstable. + */ + if (STREQ (sort_cmd, "/usr/bin/sort")) + { + argv[i++] = xstrdup ("-S"); + } +#endif key = keylist; do { @@ -770,6 +797,14 @@ return argv; } +void +free_sort_args (char **args) +{ + for (char **arg = args; *arg; ++arg) { + free (*arg); + } + free (args); +} static void do_decorate (int optind, int argc, char** argv) @@ -806,6 +841,8 @@ bool decorate_only = false; bool print_sort_args = false; + openbsd_pledge (); + set_program_name (argv[0]); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); @@ -884,6 +921,10 @@ add_sort_extra_args (optarg); break; + case SORT_PROGRAM_OPTION: + sort_cmd = xstrdup (optarg); + break; + case RANDOM_SOURCE_OPTION: add_sort_extra_args ("--random-source"); add_sort_extra_args (optarg); @@ -991,16 +1032,11 @@ { /* print and exit */ char** sort_args = build_sort_process_args (); - char **p = sort_args; - while (*p) - { - /* TODO: shell quoting / escaping */ - fputs (*p, stdout); - ++p; - if (*p) - fputc (' ', stdout); - } - fputc ('\n', stdout); + char *cmdline = shell_quote_argv ((const char * const*)sort_args); + puts (cmdline); + /* Not freeing these causes false positives with leak detectors */ + free (cmdline); + free_sort_args (sort_args); exit (EXIT_SUCCESS); } @@ -1121,7 +1157,7 @@ ++p; } } - execvp ("sort", sort_args); + execvp (sort_cmd, sort_args); die (SORT_FAILURE, errno, _("failed to run the sort command")); } diff -Nru datamash-1.7/src/decorate-functions.c datamash-1.8/src/decorate-functions.c --- datamash-1.7/src/decorate-functions.c 2020-04-23 17:10:13.000000000 +0000 +++ datamash-1.8/src/decorate-functions.c 2022-06-01 21:08:00.000000000 +0000 @@ -1,6 +1,6 @@ /* Decorate functions - Copyright (C) 2020 Assaf Gordon + Copyright (C) 2020-2021 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 @@ -178,14 +178,61 @@ } +static bool +decorate_ipv6_ipv4 (const char* in, uint32_t mapping) +{ + struct in_addr adr4; + struct in6_addr adr6; + int s4, s6; + + s4 = inet_pton (AF_INET, in, &adr4); + s6 = inet_pton (AF_INET6, in, &adr6); + + if (s4 < 0 && s6 < 0) + die (SORT_FAILURE, errno, _("inet_pton failed for AF_INET and AF_INET6")); + + if (!(s4 > 0 || s6 > 0)) + { + error (0, 0, _("invalid IP address %s"), quote (in)); + return false; + } + + if (s6) + for (int i=0;i<16;++i) + printf ("%02X", adr6.s6_addr[i]); + else + printf ("%024X%08X", mapping, ntohl (adr4.s_addr)); + + return true; +} + + +bool +decorate_ipv6_ipv4_mapped (const char* in) +{ + return decorate_ipv6_ipv4 (in, 0xFFFF); +} + + +bool +decorate_ipv6_ipv4_compat (const char* in) +{ + return decorate_ipv6_ipv4 (in, 0); +} + + struct conversions_t builtin_conversions[] = { - { "as-is", "copy as-is", decorate_as_is }, /* for debugging */ - { "roman", "roman numerals", decorate_roman_numerals }, - { "strlen", "length (in bytes) of the specified field", decorate_strlen }, - { "ipv4", "dotted-decimal IPv4 addresses", decorate_ipv4_dot_decimal }, - { "ipv6", "IPv6 addresses", decorate_ipv6 }, - { "ipv4inet", "number-and-dots IPv4 addresses (incl. octal, hex values)", + { "as-is", "copy as-is", decorate_as_is }, /* for debugging */ + { "roman", "roman numerals", decorate_roman_numerals }, + { "strlen", "length (in bytes) of the specified field", decorate_strlen }, + { "ipv4", "dotted-decimal IPv4 addresses", decorate_ipv4_dot_decimal }, + { "ipv6", "IPv6 addresses", decorate_ipv6 }, + { "ipv4inet", "number-and-dots IPv4 addresses (incl. octal, hex values)", decorate_ipv4_inet_addr }, - { NULL, NULL, 0 } + { "ipv6v4map", "IPv6 and IPv4 (as IPv4-Mapped IPv6) addresses", + decorate_ipv6_ipv4_mapped}, + { "ipv6v4comp", "IPv6 and IPv4 (as IPv4-Compatible IPv6) addresses", + decorate_ipv6_ipv4_compat}, + { NULL, NULL, 0 } }; diff -Nru datamash-1.7/src/decorate-functions.h datamash-1.8/src/decorate-functions.h --- datamash-1.7/src/decorate-functions.h 2020-04-23 16:39:59.000000000 +0000 +++ datamash-1.8/src/decorate-functions.h 2022-05-28 03:51:36.000000000 +0000 @@ -1,6 +1,6 @@ /* Decorate functions - Copyright (C) 2020 Assaf Gordon + Copyright (C) 2020-2021 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.7/src/double-format.c datamash-1.8/src/double-format.c --- datamash-1.7/src/double-format.c 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/src/double-format.c 2022-06-01 21:08:00.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2018-2020 Assaf Gordon + Copyright (C) 2018-2021 Assaf Gordon Copyright (C) 1994-2018 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify @@ -30,6 +30,7 @@ #include "quote.h" #include "xalloc.h" +#include "text-options.h" char* validate_double_format (char const *fmt) @@ -40,13 +41,17 @@ len = strlen (fmt); + if (len > MAX_NUMERIC_FORMAT_LEN - 1) { + die (EXIT_FAILURE, 0, _("numeric format too large")); + } + /* extra space for NUL and 'L' printf-modifier */ out = xmalloc (len+2); for (i = 0; ! (fmt[i] == '%' && fmt[i + 1] != '%'); i += (fmt[i] == '%') + 1) if (!fmt[i]) die (EXIT_FAILURE, 0, - _("format %s has no %% directive"), quote (fmt)); + _("format %s has no %% directive"), quote (fmt)); i++; i += strspn (fmt + i, "-+#0 '"); @@ -64,7 +69,7 @@ if (! strchr ("efgaEFGA", fmt[i])) die (EXIT_FAILURE, 0, _("format %s has unknown/invalid type %%%c directive"), - quote (fmt), fmt[i]); + quote (fmt), fmt[i]); /* Copy characters until the type character, add 'L', then the type, then the rest of the format string. */ diff -Nru datamash-1.7/src/double-format.h datamash-1.8/src/double-format.h --- datamash-1.7/src/double-format.h 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/src/double-format.h 2022-05-28 03:51:36.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2018-2020 Assaf Gordon + Copyright (C) 2018-2021 Assaf Gordon This file is part of GNU Datamash. diff -Nru datamash-1.7/src/field-ops.c datamash-1.8/src/field-ops.c --- datamash-1.7/src/field-ops.c 2020-04-23 16:39:59.000000000 +0000 +++ datamash-1.8/src/field-ops.c 2022-06-24 19:41:43.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2020 Assaf Gordon + Copyright (C) 2013-2021 Assaf Gordon This file is part of GNU Datamash. @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include /* for dirname & POSIX version of basename */ @@ -80,6 +81,10 @@ {NUMERIC_SCALAR, IGNORE_FIRST, NUMERIC_RESULT}, /* OP_HARMMEAN */ {NUMERIC_SCALAR, IGNORE_FIRST, NUMERIC_RESULT}, + /* OP_MS */ + {NUMERIC_SCALAR, IGNORE_FIRST, NUMERIC_RESULT}, + /* OP_RMS */ + {NUMERIC_SCALAR, IGNORE_FIRST, NUMERIC_RESULT}, /* OP_MEDIAN */ {NUMERIC_VECTOR, IGNORE_FIRST, NUMERIC_RESULT}, /* OP_QUARTILE_1 */ @@ -281,7 +286,7 @@ char *p = op->str_buf; const char* pend = op->str_buf + op->str_buf_used; size_t idx=0; - while (p < pend) + while (p < pend && idx < op->count) { ptrs[idx++] = p; while ( pvalue += 1.0 / num_value; break; + case OP_MS: + case OP_RMS: + op->value += num_value * num_value; + break; + case OP_COUNT: op->value++; break; @@ -556,10 +566,16 @@ 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. */ + const long double frac = modfl (val, & op->value); + /* Buckets should follow this pattern: + ..., [-3x,-2x), [-2x,-x), [-x,0), [0,x), [x,2x), [2x,3x), ... */ if (signbit (op->value)) - --op->value; + { + if (is_zero (frac)) + op->value = pos_zero (op->value); + else + --op->value; + } op->value *= op->params.bin_bucket_size; } break; @@ -709,6 +725,8 @@ case OP_MEAN: case OP_GEOMEAN: case OP_HARMMEAN: + case OP_MS: + case OP_RMS: case OP_S_SKEWNESS: case OP_P_SKEWNESS: case OP_S_EXCESS_KURTOSIS: @@ -820,6 +838,7 @@ switch (op->op) /* LCOV_EXCL_BR_LINE */ { case OP_MEAN: + case OP_MS: numeric_result = op->value / op->count; break; @@ -892,7 +911,11 @@ case OP_TRIMMED_MEAN: field_op_sort_values (op); numeric_result = trimmed_mean_value ( op->values, op->num_values, - op->params.trimmed_mean); + op->params.trimmed_mean); + break; + + case OP_RMS: + numeric_result = sqrtl (op->value / op->count); break; case OP_PSTDEV: diff -Nru datamash-1.7/src/field-ops.h datamash-1.8/src/field-ops.h --- datamash-1.7/src/field-ops.h 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/src/field-ops.h 2022-06-04 00:38:54.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2020 Assaf Gordon + Copyright (C) 2013-2021 Assaf Gordon This file is part of GNU Datamash. @@ -80,8 +80,8 @@ /* Instance information */ size_t field; /* field number. 1 = first field in input file. */ bool field_by_name; /* if true, user gave field name (instead of number), - which needs to be resolved AFTER the header line - is loaded */ + which needs to be resolved AFTER the header line + is loaded */ char* field_name; union { diff -Nru datamash-1.7/src/key-compare.h datamash-1.8/src/key-compare.h --- datamash-1.7/src/key-compare.h 2020-04-23 16:39:59.000000000 +0000 +++ datamash-1.8/src/key-compare.h 2022-05-28 03:59:57.000000000 +0000 @@ -41,50 +41,50 @@ /* Lines are held in core as counted strings. */ struct line { - char *text; /* Text of the line. */ - size_t length; /* Length including final newline. */ - char *keybeg; /* Start of first key. */ - char *keylim; /* Limit of first key. */ + char *text; /* Text of the line. */ + size_t length; /* Length including final newline. */ + char *keybeg; /* Start of first key. */ + char *keylim; /* Limit of first key. */ }; /* Sort key. */ struct keyfield { - size_t sword; /* Zero-origin 'word' to start at. */ - size_t schar; /* Additional characters to skip. */ - size_t eword; /* Zero-origin last 'word' of key. */ - size_t echar; /* Additional characters in field. */ - bool const *ignore; /* Boolean array of characters to ignore. */ - char const *translate; /* Translation applied to characters. */ - bool skipsblanks; /* Skip leading blanks when finding start. */ - bool skipeblanks; /* Skip leading blanks when finding end. */ - bool numeric; /* Flag for numeric comparison. Handle + size_t sword; /* Zero-origin 'word' to start at. */ + size_t schar; /* Additional characters to skip. */ + size_t eword; /* Zero-origin last 'word' of key. */ + size_t echar; /* Additional characters in field. */ + bool const *ignore; /* Boolean array of characters to ignore. */ + char const *translate; /* Translation applied to characters. */ + bool skipsblanks; /* Skip leading blanks when finding start. */ + bool skipeblanks; /* Skip leading blanks when finding end. */ + bool numeric; /* Flag for numeric comparison. Handle strings of digits with optional decimal point, but no exponential notation. */ #ifdef KEY_COMPARE_RANDOM - bool random; /* Sort by random hash of key. */ + bool random; /* Sort by random hash of key. */ #endif - bool general_numeric; /* Flag for general, numeric comparison. + bool general_numeric; /* Flag for general, numeric comparison. Handle numbers in exponential notation. */ #ifdef KEY_COMPARE_HUMAN_NUMERIC - bool human_numeric; /* Flag for sorting by human readable + bool human_numeric; /* Flag for sorting by human readable units with either SI xor IEC prefixes. */ #endif #ifdef KEY_COMPARE_MONTH - bool month; /* Flag for comparison by month name. */ + bool month; /* Flag for comparison by month name. */ #endif #ifdef KEY_COMPARE_REVERSE - bool reverse; /* Reverse the sense of comparison. */ + bool reverse; /* Reverse the sense of comparison. */ #endif #ifdef KEY_COMPARE_VERSION - bool version; /* sort by version number */ + bool version; /* sort by version number */ #endif #ifdef KEY_COMPARE_DECORATION bool (*decorate_fn)(const char* in); const char* decorate_cmd; #endif - bool traditional_used; /* Traditional key option format is used. */ - struct keyfield *next; /* Next keyfield to try. */ + bool traditional_used; /* Traditional key option format is used. */ + struct keyfield *next; /* Next keyfield to try. */ }; /* If TAB has this value, blanks separate fields. */ diff -Nru datamash-1.7/src/op-defs.c datamash-1.8/src/op-defs.c --- datamash-1.7/src/op-defs.c 2020-04-23 04:02:11.000000000 +0000 +++ datamash-1.8/src/op-defs.c 2022-06-04 01:50:54.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2020 Assaf Gordon + Copyright (C) 2013-2021 Assaf Gordon This file is part of GNU Datamash. @@ -20,7 +20,7 @@ /* Written by Assaf Gordon */ #include - +#include #include "system.h" #include "op-defs.h" @@ -34,69 +34,73 @@ 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}, - {"range", OP_RANGE, MODE_GROUPBY}, - {"first", OP_FIRST, MODE_GROUPBY}, - {"last", OP_LAST, MODE_GROUPBY}, - {"rand", OP_RAND, MODE_GROUPBY}, - {"mean", OP_MEAN, MODE_GROUPBY}, - {"geomean", OP_GEOMEAN, MODE_GROUPBY}, - {"harmmean", OP_HARMMEAN, MODE_GROUPBY}, - {"median", OP_MEDIAN, MODE_GROUPBY}, - {"q1", OP_QUARTILE_1, MODE_GROUPBY}, - {"q3", OP_QUARTILE_3, MODE_GROUPBY}, - {"iqr", OP_IQR, MODE_GROUPBY}, - {"perc", OP_PERCENTILE, 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}, - {"sha224", OP_SHA224, MODE_PER_LINE}, - {"sha256", OP_SHA256, MODE_PER_LINE}, - {"sha384", OP_SHA384, MODE_PER_LINE}, - {"sha512", OP_SHA512, MODE_PER_LINE}, - {"dirname", OP_DIRNAME, MODE_PER_LINE}, - {"basename",OP_BASENAME,MODE_PER_LINE}, - {"extname", OP_EXTNAME, MODE_PER_LINE}, - {"barename",OP_BARENAME,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}, - {"trimmean",OP_TRIMMED_MEAN, MODE_GROUPBY}, - {"getnum", OP_GETNUM, MODE_PER_LINE}, - {"cut", OP_CUT, MODE_PER_LINE}, - {NULL, OP_INVALID, MODE_INVALID} + {"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}, + {"range", OP_RANGE, MODE_GROUPBY}, + {"first", OP_FIRST, MODE_GROUPBY}, + {"last", OP_LAST, MODE_GROUPBY}, + {"rand", OP_RAND, MODE_GROUPBY}, + {"mean", OP_MEAN, MODE_GROUPBY}, + {"geomean", OP_GEOMEAN, MODE_GROUPBY}, + {"harmmean", OP_HARMMEAN, MODE_GROUPBY}, + {"ms", OP_MS, MODE_GROUPBY}, + {"rms", OP_RMS, MODE_GROUPBY}, + {"median", OP_MEDIAN, MODE_GROUPBY}, + {"q1", OP_QUARTILE_1, MODE_GROUPBY}, + {"q3", OP_QUARTILE_3, MODE_GROUPBY}, + {"iqr", OP_IQR, MODE_GROUPBY}, + {"perc", OP_PERCENTILE, 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}, + {"uniq", 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}, + {"sha224", OP_SHA224, MODE_PER_LINE}, + {"sha256", OP_SHA256, MODE_PER_LINE}, + {"sha384", OP_SHA384, MODE_PER_LINE}, + {"sha512", OP_SHA512, MODE_PER_LINE}, + {"dirname", OP_DIRNAME, MODE_PER_LINE}, + {"basename", OP_BASENAME, MODE_PER_LINE}, + {"extname", OP_EXTNAME, MODE_PER_LINE}, + {"barename", OP_BARENAME, 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}, + {"trimmean", OP_TRIMMED_MEAN, MODE_GROUPBY}, + {"getnum", OP_GETNUM, MODE_PER_LINE}, + {"cut", OP_CUT, MODE_PER_LINE}, + {"echo", OP_CUT, MODE_PER_LINE}, + {NULL, OP_INVALID, MODE_INVALID} }; struct processing_mode_definition diff -Nru datamash-1.7/src/op-defs.h datamash-1.8/src/op-defs.h --- datamash-1.7/src/op-defs.h 2020-04-23 04:02:11.000000000 +0000 +++ datamash-1.8/src/op-defs.h 2022-06-04 00:38:25.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2020 Assaf Gordon + Copyright (C) 2013-2021 Assaf Gordon This file is part of GNU Datamash. @@ -38,6 +38,8 @@ OP_MEAN, OP_GEOMEAN, OP_HARMMEAN, + OP_MS, + OP_RMS, OP_MEDIAN, OP_QUARTILE_1, OP_QUARTILE_3, diff -Nru datamash-1.7/src/op-parser.c datamash-1.8/src/op-parser.c --- datamash-1.7/src/op-parser.c 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/src/op-parser.c 2022-07-09 03:30:44.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2020 Assaf Gordon + Copyright (C) 2013-2021 Assaf Gordon This file is part of GNU Datamash. @@ -205,7 +205,7 @@ op->params.trimmed_mean = _params[0].f; if (op->params.trimmed_mean<0 || op->params.trimmed_mean>0.5) die (EXIT_FAILURE, 0, _("invalid trim mean value %Lg " \ - "(expected 0 <= X <= 0.5)"), + "(expected 0 <= X <= 0.5)"), op->params.trimmed_mean); if (_params_used>1) die (EXIT_FAILURE, 0, _("too many parameters for operation %s"), @@ -524,7 +524,7 @@ tok = scanner_peek_token (); } - /* After adding all operations, see of there are master/slave ops + /* After adding all operations, see if there are master/slave ops * that need resolving - caching their pointer instead of index */ for (size_t i=0; inum_ops; ++i) { @@ -697,7 +697,13 @@ 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}; + struct parser_field_t dummy = { + grp_col, /* uintmax_t num; */ + dm->grps[0].by_name, /* bool by_name; */ + dm->grps[0].name, /* char* name; */ + false, /* bool range; */ + false /* bool pair; */ + }; add_op (OP_COUNT, &dummy); } else if (dm->num_ops>1) @@ -750,7 +756,7 @@ } die (EXIT_FAILURE,0, _("invalid operation %s"), - quote (scanner_identifier)); + quote (scanner_identifier)); } struct datamash_ops* @@ -798,6 +804,9 @@ free (p->ops); p->ops = NULL; + for (size_t i=0; i<_fields_used; ++i) { + free (_fields[i].name); + } free (_fields); _fields = NULL; _fields_alloc = 0; diff -Nru datamash-1.7/src/op-parser.h datamash-1.8/src/op-parser.h --- datamash-1.7/src/op-parser.h 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/src/op-parser.h 2022-05-28 03:51:36.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2020 Assaf Gordon + Copyright (C) 2013-2021 Assaf Gordon This file is part of GNU Datamash. diff -Nru datamash-1.7/src/op-scanner.c datamash-1.8/src/op-scanner.c --- datamash-1.7/src/op-scanner.c 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/src/op-scanner.c 2022-07-01 20:49:41.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2020 Assaf Gordon + Copyright (C) 2013-2021 Assaf Gordon This file is part of GNU Datamash. @@ -59,7 +59,7 @@ scanner_identifier[n]=0; } -/* Concatante argv into one (space separated) string */ +/* Concatenate argv into one (space separated) string */ void scanner_set_input_from_argv (int argc, const char* argv[]) { diff -Nru datamash-1.7/src/op-scanner.h datamash-1.8/src/op-scanner.h --- datamash-1.7/src/op-scanner.h 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/src/op-scanner.h 2022-05-28 03:51:36.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2020 Assaf Gordon + Copyright (C) 2013-2021 Assaf Gordon This file is part of GNU Datamash. diff -Nru datamash-1.7/src/system.h datamash-1.8/src/system.h --- datamash-1.7/src/system.h 2020-04-23 16:39:59.000000000 +0000 +++ datamash-1.8/src/system.h 2022-05-28 04:02:02.000000000 +0000 @@ -7,7 +7,7 @@ Copyright (C) 1989-2013 Free Software Foundation, Inc. Modifications for GNU Datamash are - Copyright (C) 2014-2020 Assaf Gordon + Copyright (C) 2014-2021 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 @@ -101,11 +101,11 @@ #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, \ - (char *) NULL); \ - exit (EXIT_SUCCESS); \ +#define case_GETOPT_VERSION_CHAR(Program_name, Authors) \ + case GETOPT_VERSION_CHAR: \ + version_etc (stdout, Program_name, PACKAGE_NAME, Version, Authors, \ + (char *) NULL); \ + exit (EXIT_SUCCESS); \ break; /* Factor out some of the common --help and --version processing code. */ @@ -124,9 +124,9 @@ #define GETOPT_VERSION_OPTION_DECL \ "version", no_argument, NULL, GETOPT_VERSION_CHAR -#define case_GETOPT_HELP_CHAR \ - case GETOPT_HELP_CHAR: \ - usage (EXIT_SUCCESS); \ +#define case_GETOPT_HELP_CHAR \ + case GETOPT_HELP_CHAR: \ + usage (EXIT_SUCCESS); \ break; #define HELP_OPTION_DESCRIPTION \ @@ -231,4 +231,13 @@ }; +static inline void +openbsd_pledge () +{ +#ifdef HAVE_PLEDGE + /* On OpenBSD, use pledge (2) to limit privileges */ + pledge ("stdio proc exec rpath", NULL); +#endif +} + #endif /* __DATAMASH__SYSTEM_H__ */ diff -Nru datamash-1.7/src/text-lines.c datamash-1.8/src/text-lines.c --- datamash-1.7/src/text-lines.c 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/src/text-lines.c 2022-05-28 03:51:36.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2020 Assaf Gordon + Copyright (C) 2013-2021 Assaf Gordon This file is part of GNU Datamash. diff -Nru datamash-1.7/src/text-lines.h datamash-1.8/src/text-lines.h --- datamash-1.7/src/text-lines.h 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/src/text-lines.h 2022-05-28 03:51:36.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2020 Assaf Gordon + Copyright (C) 2013-2021 Assaf Gordon This file is part of GNU Datamash. diff -Nru datamash-1.7/src/text-options.c datamash-1.8/src/text-options.c --- datamash-1.7/src/text-options.c 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/src/text-options.c 2022-06-01 21:08:00.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2020 Assaf Gordon + Copyright (C) 2013-2021 Assaf Gordon This file is part of GNU Datamash. @@ -43,13 +43,12 @@ bool case_sensitive = true; /* In the future: allow users to change this */ -char* numeric_output_format = "%.14Lg"; +char numeric_output_format[MAX_NUMERIC_FORMAT_LEN + 1] = "%.14Lg"; /* number of bytes to allocate for output buffer */ int numeric_output_bufsize = 200; /* 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? */ @@ -105,7 +104,6 @@ { long int l; char *p; - char tmp[100]; if (digits == NULL || digits[0] == '\0') die (EXIT_FAILURE, 0, _("missing rounding digits value")); @@ -114,10 +112,10 @@ l = strtol (digits, &p, 10); if (errno != 0 || *p != '\0' || l <=0 || l> 50) die (EXIT_FAILURE, 0, _("invalid rounding digits value %s"), - quote (digits)); + quote (digits)); - snprintf (tmp, sizeof (tmp), "%%.%dLf", (int)l); - numeric_output_format = xstrdup (tmp); + snprintf (numeric_output_format, sizeof (numeric_output_format), "%%.%dLf", + (int)l); finalize_numeric_output_buffer (); } @@ -125,6 +123,9 @@ void set_numeric_printf_format (const char* format) { - numeric_output_format = validate_double_format (format); + char *new_format = validate_double_format (format); + snprintf (numeric_output_format, sizeof (numeric_output_format), "%s", + new_format); + free (new_format); finalize_numeric_output_buffer (); } diff -Nru datamash-1.7/src/text-options.h datamash-1.8/src/text-options.h --- datamash-1.7/src/text-options.h 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/src/text-options.h 2022-06-01 21:08:00.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2020 Assaf Gordon + Copyright (C) 2013-2021 Assaf Gordon This file is part of GNU Datamash. @@ -42,8 +42,10 @@ /* Global case-sensitivity option. Defaults to 'true' . */ extern bool case_sensitive ; +/* Largest possible format string */ +#define MAX_NUMERIC_FORMAT_LEN 100 /* Numeric output format (default: "%.14Lg" */ -extern char* numeric_output_format; +extern char numeric_output_format[MAX_NUMERIC_FORMAT_LEN + 1]; /* number of bytes to allocate for output buffer */ extern int numeric_output_bufsize; diff -Nru datamash-1.7/src/utils.c datamash-1.8/src/utils.c --- datamash-1.7/src/utils.c 2020-02-13 03:16:49.000000000 +0000 +++ datamash-1.8/src/utils.c 2022-05-28 04:02:48.000000000 +0000 @@ -1,6 +1,6 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2020 Assaf Gordon + Copyright (C) 2013-2021 Assaf Gordon This file is part of GNU Datamash. @@ -26,6 +26,7 @@ #include #include #include +#include #include #include "system.h" @@ -407,7 +408,7 @@ long double _GL_ATTRIBUTE_PURE trimmed_mean_value ( const long double * const values, size_t n, - const long double trimmed_mean_percent) + const long double trimmed_mean_percent) { assert (trimmed_mean_percent >= 0); /* LCOV_EXCL_LINE */ assert (trimmed_mean_percent <= 0.5); /* LCOV_EXCL_LINE */ diff -Nru datamash-1.7/src/utils.h datamash-1.8/src/utils.h --- datamash-1.7/src/utils.h 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/src/utils.h 2022-07-09 03:30:37.000000000 +0000 @@ -1,6 +1,7 @@ /* GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2020 Assaf Gordon + Copyright (C) 2013-2021 Assaf Gordon + Copyright (C) 2022- Tim Rice This file is part of GNU Datamash. @@ -18,11 +19,21 @@ along with GNU Datamash. If not, see . */ -/* Written by Assaf Gordon */ +/* Written by Assaf Gordon and Tim Rice */ #ifndef __UTILS_H__ #define __UTILS_H__ /* + Print the current file, line number and function. + Useful for debugging. + */ +#define WHEREAMI() \ + { \ + printf ("In %s:%d, function '%s'\n", \ + __FILE__, __LINE__, __func__); \ + } + +/* Generate Utility Functions module. */ @@ -187,7 +198,7 @@ */ long double trimmed_mean_value ( const long double * const values, size_t n, - const long double trimmed_mean_percent); + const long double trimmed_mean_percent); /* diff -Nru datamash-1.7/.tarball-version datamash-1.8/.tarball-version --- datamash-1.7/.tarball-version 2020-04-23 17:34:26.000000000 +0000 +++ datamash-1.8/.tarball-version 2022-07-23 02:01:26.000000000 +0000 @@ -1 +1 @@ -1.7 +1.8 diff -Nru datamash-1.7/tests/datamash-check.pl datamash-1.8/tests/datamash-check.pl --- datamash-1.7/tests/datamash-check.pl 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/tests/datamash-check.pl 2022-06-18 00:33:01.000000000 +0000 @@ -3,7 +3,7 @@ Unit Tests for GNU Datamash - perform simple calculation on input data Tests for 'check' operation mode - Copyright (C) 2013-2020 Assaf Gordon + Copyright (C) 2013-2021 Assaf Gordon This file is part of GNU Datamash. @@ -70,77 +70,76 @@ my @Tests = ( - # Simple transpose and reverse - ['c1', 'check', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], - - # Variations on command-line parsing - ['c2', 'check 3 field', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], - ['c3', 'check 3 fields', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], - ['c4', 'check 3 col', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], - ['c5', 'check 3 columns', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], - ['c6', 'check 3 column', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], - - ['c7', 'check field 3', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], - ['c8', 'check fields 3', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], - ['c9', 'check col 3', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], - ['c10', 'check columns 3', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], - ['c11', 'check column 3', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], - - ['c12', 'check 5 lines', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], - ['c13', 'check 5 line', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], - ['c14', 'check 5 rows', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], - ['c15', 'check 5 row', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], - - ['c16', 'check lines 5', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], - ['c17', 'check line 5', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], - ['c18', 'check row 5', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], - ['c19', 'check rows 5', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], - - - # Duplicated options - ['e1', 'check rows 5 lines 6', {IN_PIPE=>$in1}, {EXIT=>1}, - {ERR=>"$prog: number of lines/rows already set in operation 'check'\n"}], - ['e2', 'check fields 6 fields 1', {IN_PIPE=>$in1}, {EXIT=>1}, - {ERR=>"$prog: number of fields/columns already set in operation 'check'\n"}], - - # Invalid values - ['e3', 'check 0 lines', {IN_PIPE=>$in1}, {EXIT=>1}, - {ERR=>"$prog: invalid value zero for lines/fields in operation 'check'\n"}], - ['e4', 'check 0 fields', {IN_PIPE=>$in1}, {EXIT=>1}, - {ERR=>"$prog: invalid value zero for lines/fields in operation 'check'\n"}], - - - - # Check lines - ['c40', 'check 4 lines', {IN_PIPE=>$in1}, {EXIT=>1}, - {ERR=>"$prog: check failed: input had 5 lines (expecting 4)\n"}], - ['c41', 'check 6 lines', {IN_PIPE=>$in1}, {EXIT=>1}, - {ERR=>"$prog: check failed: input had 5 lines (expecting 6)\n"}], - ['c42', 'check 6 lines', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: check failed: input had 0 lines (expecting 6)\n"}], - - # Check fields - ['c60', 'check 2 fields', {IN_PIPE=>$in1}, {EXIT=>1}, - {ERR=>"line 1 (3 fields):\n" . - " A\t1\t!\n" . - "$prog: check failed: line 1 has 3 fields (expecting 2)\n"}], - - - # Check matrix structure, no expected number of fields - ['c61', 'check', {IN_PIPE=>$in2}, {EXIT=>1}, - {ERR=>"line 1 (2 fields):\n" . - " A\t1\n" . - "line 2 (1 fields):\n" . - " B\n" . - "$prog: check failed: line 2 has 1 fields (previous line had 2)\n"}], - - # With expected number of fields - ['c62', 'check 2 fields', {IN_PIPE=>$in2}, {EXIT=>1}, - {ERR=>"line 2 (1 fields):\n" . - " B\n" . - "$prog: check failed: line 2 has 1 fields (expecting 2)\n"}], - + # Simple transpose and reverse + ['c1', 'check', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], + # Variations on command-line parsing + ['c2', 'check 3 field', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], + ['c3', 'check 3 fields', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], + ['c4', 'check 3 col', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], + ['c5', 'check 3 columns', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], + ['c6', 'check 3 column', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], + + ['c7', 'check field 3', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], + ['c8', 'check fields 3', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], + ['c9', 'check col 3', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], + ['c10', 'check columns 3', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], + ['c11', 'check column 3', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], + + ['c12', 'check 5 lines', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], + ['c13', 'check 5 line', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], + ['c14', 'check 5 rows', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], + ['c15', 'check 5 row', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], + + ['c16', 'check lines 5', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], + ['c17', 'check line 5', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], + ['c18', 'check row 5', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], + ['c19', 'check rows 5', {IN_PIPE=>$in1}, {OUT=>"5 lines, 3 fields\n"}], + + + # Duplicated options + ['e1', 'check rows 5 lines 6', {IN_PIPE=>$in1}, {EXIT=>1}, + {ERR=>"$prog: number of lines/rows already set in operation 'check'\n"}], + ['e2', 'check fields 6 fields 1', {IN_PIPE=>$in1}, {EXIT=>1}, + {ERR=>"$prog: number of fields/columns already set " . + "in operation 'check'\n"}], + + # Invalid values + ['e3', 'check 0 lines', {IN_PIPE=>$in1}, {EXIT=>1}, + {ERR=>"$prog: invalid value zero for lines/fields in operation 'check'\n"}], + ['e4', 'check 0 fields', {IN_PIPE=>$in1}, {EXIT=>1}, + {ERR=>"$prog: invalid value zero for lines/fields in operation 'check'\n"}], + + + + # Check lines + ['c40', 'check 4 lines', {IN_PIPE=>$in1}, {EXIT=>1}, + {ERR=>"$prog: check failed: input had 5 lines (expecting 4)\n"}], + ['c41', 'check 6 lines', {IN_PIPE=>$in1}, {EXIT=>1}, + {ERR=>"$prog: check failed: input had 5 lines (expecting 6)\n"}], + ['c42', 'check 6 lines', {IN_PIPE=>""}, {EXIT=>1}, + {ERR=>"$prog: check failed: input had 0 lines (expecting 6)\n"}], + + # Check fields + ['c60', 'check 2 fields', {IN_PIPE=>$in1}, {EXIT=>1}, + {ERR=>"line 1 (3 fields):\n" . + " A\t1\t!\n" . + "$prog: check failed: line 1 has 3 fields (expecting 2)\n"}], + + + # Check matrix structure, no expected number of fields + ['c61', 'check', {IN_PIPE=>$in2}, {EXIT=>1}, + {ERR=>"line 1 (2 fields):\n" . + " A\t1\n" . + "line 2 (1 fields):\n" . + " B\n" . + "$prog: check failed: line 2 has 1 fields (previous line had 2)\n"}], + + # With expected number of fields + ['c62', 'check 2 fields', {IN_PIPE=>$in2}, {EXIT=>1}, + {ERR=>"line 2 (1 fields):\n" . + " B\n" . + "$prog: check failed: line 2 has 1 fields (expecting 2)\n"}], ); my $save_temps = $ENV{SAVE_TEMPS}; diff -Nru datamash-1.7/tests/datamash-check-tabular.pl datamash-1.8/tests/datamash-check-tabular.pl --- datamash-1.7/tests/datamash-check-tabular.pl 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/tests/datamash-check-tabular.pl 2022-06-17 23:39:01.000000000 +0000 @@ -4,7 +4,7 @@ Tests for 'transpose' and 'reverse' operation modes. - Copyright (C) 2013-2020 Assaf Gordon + Copyright (C) 2013-2021 Assaf Gordon This file is part of GNU Datamash. @@ -120,13 +120,13 @@ # 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"}], + {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"}], + {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| ).*$//'}, @@ -136,7 +136,6 @@ {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}; diff -Nru datamash-1.7/tests/datamash-crosstab.pl datamash-1.8/tests/datamash-crosstab.pl --- datamash-1.7/tests/datamash-crosstab.pl 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/tests/datamash-crosstab.pl 2022-07-10 21:01:13.000000000 +0000 @@ -4,7 +4,7 @@ Tests for 'transpose' and 'reverse' operation modes. - Copyright (C) 2013-2020 Assaf Gordon + Copyright (C) 2013-2021 Assaf Gordon This file is part of GNU Datamash. @@ -141,6 +141,31 @@ b 3 XX EOF +my $in4=<<'EOF'; +x y +1 0.5 +2 1 +3 1.5 +4 2 +EOF + +my $out4_hdr=<<'EOF'; +GroupBy(x) GroupBy(y) count(x) + 0.5 1 1.5 2 +1 1 N/A N/A N/A +2 N/A 1 N/A N/A +3 N/A N/A 1 N/A +4 N/A N/A N/A 1 +EOF + +my $out4_no_hdr=<<'EOF'; + 0.5 1 1.5 2 +1 1 N/A N/A N/A +2 N/A 1 N/A N/A +3 N/A N/A 1 N/A +4 N/A N/A N/A 1 +EOF + my @Tests = ( ['c1','crosstab 1,2 first 3', {IN_PIPE=>$in1}, {OUT=>$out1_first}], @@ -163,28 +188,34 @@ ['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 headers + ['c17','-W --header-in --header-out ct x,y', + {IN_PIPE=>$in4}, {OUT=>$out4_hdr}], + ['c18','-W --header-in ct x,y', + {IN_PIPE=>$in4}, {OUT=>$out4_no_hdr}], + # 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"}], + {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"}], + {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"}], + {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"}], + {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"}], + {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"}], + {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"}], + {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"}], + {ERR=>"$prog: invalid field range for operation 'crosstab'\n"}], ); my $save_temps = $ENV{SAVE_TEMPS}; diff -Nru datamash-1.7/tests/datamash-error-msgs.pl datamash-1.8/tests/datamash-error-msgs.pl --- datamash-1.7/tests/datamash-error-msgs.pl 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/tests/datamash-error-msgs.pl 2022-07-20 20:27:55.000000000 +0000 @@ -2,7 +2,7 @@ =pod Unit Tests for GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2020 Assaf Gordon + Copyright (C) 2013-2021 Assaf Gordon This file is part of GNU Datamash. @@ -54,208 +54,219 @@ ( # 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"}], + {ERR=>"$prog: invalid numeric value '1x'\n"}], # Processing mode without operation ['e2','groupby 1', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: missing operation\n"}], + {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"}], + {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"}], + {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"}], + {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"}], + {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"}], + {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"}], + {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"}], + {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"}], + {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"}], + {ERR=>"$prog: operation 'pcov' requires field pairs\n"}], ['e42','pcov 1:', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: invalid field pair for operation 'pcov'\n"}], + {ERR=>"$prog: invalid field pair for operation 'pcov'\n"}], ['e43','pcov :', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: invalid field pair for operation 'pcov'\n"}], + {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"}], + {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"}], + {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"}], + {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"}], + {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"}], + {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"}], + {ERR=>"$prog: invalid numeric value '4a'\n"}], ['e63','sum 4_', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: invalid numeric value '4_'\n"}], + {ERR=>"$prog: invalid numeric value '4_'\n"}], # Overflow strtol ['e64','sum 1234567890123456789012345678901234567', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: invalid numeric value " . - "'1234567890123456789012345678901234567'\n"}], + {ERR=>"$prog: invalid numeric value " . + "'1234567890123456789012345678901234567'\n"}], # Invalid charcters ['e65','sum "foo^bar"', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: invalid operand '^bar'\n"}], + {ERR=>"$prog: invalid operand '^bar'\n"}], # Empty columns ['e66','sum 1,,', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: missing field for operation 'sum'\n"}], + {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"}], + {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"}], + {ERR=>"$prog: invalid numeric value '1x'\n"}], # Processing mode without operation ['e71','groupby 1', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: missing operation\n"}], + {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"}], + {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"}], + {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"}], + {ERR=>"$prog: too many parameters for operation 'bin'\n"}], ['e81','bin: 1', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: missing parameter for operation 'bin'\n"}], + {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"}], + {ERR=>"$prog: missing parameter for operation 'sum'\n"}], ['e83','bin:10: 1', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: missing parameter for operation 'bin'\n"}], + {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"}], + {ERR=>"$prog: missing field for operation 'bin'\n"}], ['e85','bin:10, 1', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: missing field for operation 'bin'\n"}], + {ERR=>"$prog: missing field for operation 'bin'\n"}], ['e86','bin:, 1', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: invalid parameter , for operation 'bin'\n"}], + {ERR=>"$prog: invalid parameter , for operation 'bin'\n"}], ['e87','bin, 1', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: missing field for operation 'bin'\n"}], + {ERR=>"$prog: missing field for operation 'bin'\n"}], ['e88','bin:- 1', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: invalid parameter - for operation 'bin'\n"}], + {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"}], + {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"}], + {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"}], + {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"}], + {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"}], + {ERR=>"$prog: strbin bucket size must not be zero\n"}], # values for percentile operation ['e94','perc:0 1', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: invalid percentile value 0\n"}], + {ERR=>"$prog: invalid percentile value 0\n"}], ['e95','perc:101 1', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: invalid percentile value 101\n"}], + {ERR=>"$prog: invalid percentile value 101\n"}], ['e96','perc:foo 1', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: invalid parameter foo for operation 'perc'\n"}], + {ERR=>"$prog: invalid parameter foo for operation 'perc'\n"}], ['e97','perc:-32 1', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: invalid parameter - for operation 'perc'\n"}], + {ERR=>"$prog: invalid parameter - for operation 'perc'\n"}], ['e98','perc:1:2 1', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: too many parameters for operation 'perc'\n"}], + {ERR=>"$prog: too many parameters for operation 'perc'\n"}], # Invalid output delimiters ['e100', '--output-delimiter', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: option '--output-delimiter' requires an argument\n". - "Try '$prog --help' for more information.\n"}], + {ERR_SUBST=>'s/requires an argument -- output-delimiter/' . + '\'--output-delimiter\' requires an argument/'}, + {ERR=>"$prog: option '--output-delimiter' requires an argument\n". + "Try '$prog --help' for more information.\n"}], ['e101', '--output-delimiter ""', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: the delimiter must be a single character\n"}], + {ERR=>"$prog: the delimiter must be a single character\n"}], ['e102', '--output-delimiter "XX"', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: the delimiter must be a single character\n"}], + {ERR=>"$prog: the delimiter must be a single character\n"}], # values for trimmean operation ['e103','trimmean:12 1', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: invalid trim mean value 12 (expected 0 <= X <= 0.5)\n"}], + {ERR=>"$prog: invalid trim mean value 12 (expected 0 <= X <= 0.5)\n"}], ['e104','trimmean:0.51 1', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: invalid trim mean value 0.51 (expected 0 <= X <= 0.5)\n"}], + {ERR=>"$prog: invalid trim mean value 0.51 (expected 0 <= X <= 0.5)\n"}], ['e105','trimmean:-32 1', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: invalid parameter - for operation 'trimmean'\n"}], + {ERR=>"$prog: invalid parameter - for operation 'trimmean'\n"}], ['e106','trimmean:1:2 1', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: too many parameters for operation 'trimmean'\n"}], + {ERR=>"$prog: too many parameters for operation 'trimmean'\n"}], # Rounding ['e110','--round ""', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: missing rounding digits value\n"}], + {ERR=>"$prog: missing rounding digits value\n"}], ['e111','--round "3a"', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: invalid rounding digits value '3a'\n"}], + {ERR=>"$prog: invalid rounding digits value '3a'\n"}], # Rounding Currently hard-coded to 1 to 50 decimal-point digits. ['e112','--round "0"', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: invalid rounding digits value '0'\n"}], + {ERR=>"$prog: invalid rounding digits value '0'\n"}], ['e113','--round "51"', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: invalid rounding digits value '51'\n"}], + {ERR=>"$prog: invalid rounding digits value '51'\n"}], # Custom Output Formats ['e120','--format ""', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: format '' has no % directive\n"}], + {ERR=>"$prog: format '' has no % directive\n"}], ['e121','--format "foobar"', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: format 'foobar' has no % directive\n"}], + {ERR=>"$prog: format 'foobar' has no % directive\n"}], ['e122','--format "aa%%ff"', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: format 'aa%%ff' has no % directive\n"}], + {ERR=>"$prog: format 'aa%%ff' has no % directive\n"}], ['e123','--format "%Lg"', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: format '%Lg' has unknown/invalid type %L directive\n"}], + {ERR=>"$prog: format '%Lg' has unknown/invalid type %L directive\n"}], ['e124','--format "%*g"', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: format '%*g' has unknown/invalid type %* directive\n"}], + {ERR=>"$prog: format '%*g' has unknown/invalid type %* directive\n"}], ['e125','--format "%g %f"', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: format '%g %f' has too many % directives\n"}], + {ERR=>"$prog: format '%g %f' has too many % directives\n"}], ['e126','--format "%"', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: format '%' missing valid type after '%'\n"}], + {ERR=>"$prog: format '%' missing valid type after '%'\n"}], ['e127','--format "%3"', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: format '%3' missing valid type after '%'\n"}], + {ERR=>"$prog: format '%3' missing valid type after '%'\n"}], ['e128','--format "%#.4"', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: format '%#.4' missing valid type after '%'\n"}], + {ERR=>"$prog: format '%#.4' missing valid type after '%'\n"}], ['e129','--format "%f%"', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: format '%f%' has too many % directives\n"}], + {ERR=>"$prog: format '%f%' has too many % directives\n"}], ['e130','--format "%f%3"', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: format '%f%3' has too many % directives\n"}], + {ERR=>"$prog: format '%f%3' has too many % directives\n"}], # identifier scanning errors ['e140',"-H sum 'foo\\'", {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: backslash at end of identifier\n"}], + {ERR=>"$prog: backslash at end of identifier\n"}], ['e141',"-H sum $ident_too_long", {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: identifier name too long\n"}], + {ERR=>"$prog: identifier name too long\n"}], + + # invalid numeric input data + ['e150', 'sum 1', {IN_PIPE=>"1.2.3\n"}, {EXIT=>1}, + {ERR=>"$prog: invalid numeric value in line 1 field 1: '1.2.3'\n"}], + ['e151', 'sum 1', {IN_PIPE=>"1.2.3\t4.5\n"}, {EXIT=>1}, + {ERR=>"$prog: invalid numeric value in line 1 field 1: '1.2.3'\n"}], + ['e152', 'sum 2', {IN_PIPE=>"1.2\t3.4.5\n"}, {EXIT=>1}, + {ERR=>"$prog: invalid numeric value in line 1 field 2: '3.4.5'\n"}], + ); my $save_temps = $ENV{SAVE_TEMPS}; diff -Nru datamash-1.7/tests/datamash-i18n-de.pl datamash-1.8/tests/datamash-i18n-de.pl --- datamash-1.7/tests/datamash-i18n-de.pl 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/tests/datamash-i18n-de.pl 2022-07-20 20:27:55.000000000 +0000 @@ -0,0 +1,101 @@ +#!/usr/bin/env perl +=pod + Unit Tests for GNU Datamash - check German locale (de_DE.UTF-8). + + Copyright (C) 2013-2021 Assaf Gordon + Copyright (C) 2022- Timothy Rice + + 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 and Timothy Rice. +=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 ; + +## Skip this test if Deutsche (German) locale not found. +use POSIX qw(locale_h); +use locale; +my $lc_de = setlocale(LC_ALL, "de_DE.utf8"); +CuSkip::skip "requires de_DE.utf8 locale\n" + unless defined($lc_de); + +(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; + +## Portability hack +## Check if the system's sort supports stable sorting ('-s'). +## If it doesn't - skip some tests +my $rc = system("sort -s < /dev/null > /dev/null 2>/dev/null"); +die "testing framework failure: failed to execute sort -s" + if ( ($rc == -1) || ($rc & 127) ); +my $sort_exit_code = ($rc >> 8); +my $have_stable_sort = ($sort_exit_code==0); + + +# Deutsche Prüfungen +@ENV{qw(LANGUAGE LANG LC_ALL)} = ('de_DE.utf8') x 3; + +my @Prufungen = +( + # Prüfen Sie, ob das Komma als Dezimaltrennzeichen funktioniert + ['de1', 'sum 1', {IN_PIPE=>"1,1\n"}, {OUT=>"1,1\n"}], + ['de2', 'sum 1,2', {IN_PIPE=>"1,1\t2,2\n"}, {OUT=>"1,1\t2,2\n"}], + ['de3', 'count 1,2,3', {IN_PIPE=>"1,1\t2,2\t3,3\n"}, {OUT=>"1\t1\t1\n"}], + + # There is a bug where the bin operation does not respect + # the locale's choice of decimal separator. + # TODO: Be able to uncomment the following line. + #['de4', 'bin:0,1 1' {IN_PIPE=>"1,15\n"}, {OUT=>"1,1\n"}], + + # Comma as field separator is problematic for numeric operations + ['de5', '-t, cut 2,1', {IN_PIPE=>"1,2\n"}, {OUT=>"2,1\n"}], + ['de6', '-t, unique 1,2', {IN_PIPE=>"1,2\n"}, {OUT=>"1,2\n"}], + ['de7', '-t, count 1,2', {IN_PIPE=>"1,2\n"}, {OUT=>"1,1\n"}], + ['de8', '-t, countunique 1,2', {IN_PIPE=>"1,2\n"}, {OUT=>"1,1\n"}], + ['de9', '-t, rmdup 1', {IN_PIPE=>"1,2\n"}, {OUT=>"1,2\n"}], + ['de10', '-t, rmdup 2', {IN_PIPE=>"1,2\n"}, {OUT=>"1,2\n"}], + # TODO: fix bug for numeric operations + #['de11', '-t, sum 1,2', {IN_PIPE=>"1,2\n"}, {OUT=>"1,2\n"}], + #['de12', '-t, sum 1,2,3', {IN_PIPE=>"1,2,3\n"}, {OUT=>"1,2,3\n"}], + + # TODO: make the getnum operation locale-aware + #['de13', 'getnum 1', {IN_PIPE=>"bar-1,2\n"}, {OUT=>"1,2\n"}], + #['de14', 'getnum:p 1', {IN_PIPE=>"bar-1,2\n"}, {OUT=>"1,2\n"}], + #['de15', 'getnum:d 1', {IN_PIPE=>"bar-1,2\n"}, {OUT=>"-1,2\n"}], + +); + +my $save_temps = $ENV{SAVE_TEMPS}; +my $verbose = $ENV{VERBOSE}; + +my $fail = run_tests ($program_name, $prog, \@Prufungen, $save_temps, $verbose); + +exit $fail; diff -Nru datamash-1.7/tests/datamash-io-errors-cheap.sh datamash-1.8/tests/datamash-io-errors-cheap.sh --- datamash-1.7/tests/datamash-io-errors-cheap.sh 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/tests/datamash-io-errors-cheap.sh 2022-06-12 21:55:40.000000000 +0000 @@ -0,0 +1,42 @@ +#!/bin/sh + +# Unit Tests for GNU Datamash - simple I/O error simulation + +# Copyright (C) 2022 Erik Auerswald +# +# 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 Erik Auerswald, +# based on datamash-io-errors.sh written by Assaf Gordon + +## +## This script tests GNU Datamash's handling of basic I/O errors. +## + +. "${test_dir=.}/init.sh"; path_prepend_ ./src + +fail=0 + +## +## This test requires the special file /dev/full +## +test -w /dev/full || skip_ 'requires writable /dev/full' + +## Test 1: output error +echo 0 | datamash -g 1 count 1 > /dev/full && + { warn_ "datamash failed to detect no-space error" ; fail=1 ; } + +Exit $fail diff -Nru datamash-1.7/tests/datamash-io-errors.sh datamash-1.8/tests/datamash-io-errors.sh --- datamash-1.7/tests/datamash-io-errors.sh 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/tests/datamash-io-errors.sh 2022-05-28 02:52:43.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # Unit Tests for GNU Datamash - I/O error simulation -# Copyright (C) 2014-2020 Assaf Gordon +# Copyright (C) 2014-2021 Assaf Gordon # # This file is part of GNU Datamash. # diff -Nru datamash-1.7/tests/datamash-md5.pl datamash-1.8/tests/datamash-md5.pl --- datamash-1.7/tests/datamash-md5.pl 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/tests/datamash-md5.pl 2022-06-17 23:41:22.000000000 +0000 @@ -2,7 +2,7 @@ =pod Unit Tests for GNU Datamash - tests md5 operations - Copyright (C) 2013-2020 Assaf Gordon + Copyright (C) 2013-2021 Assaf Gordon This file is part of GNU Datamash. @@ -100,7 +100,7 @@ my @Tests = ( - ['md5-1', '-W md5 2', {IN_PIPE=>$in_g1}, {OUT=>$out_g1_md5}], + ['md5-1', '-W md5 2', {IN_PIPE=>$in_g1}, {OUT=>$out_g1_md5}], ); my $save_temps = $ENV{SAVE_TEMPS}; diff -Nru datamash-1.7/tests/datamash-output-format.pl datamash-1.8/tests/datamash-output-format.pl --- datamash-1.7/tests/datamash-output-format.pl 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/tests/datamash-output-format.pl 2022-06-17 23:41:37.000000000 +0000 @@ -2,7 +2,7 @@ =pod Unit Tests for GNU Datamash - perform simple calculation on input data - Copyright (C) 2018-2020 Assaf Gordon $in1}, - {OUT => "0" x 3999 . "1\n"}], + {OUT => "0" x 3999 . "1\n"}], # due to binary floating representation, some decimal point digits won't be # zero (e.g. 1.0000090000000000000000000000000523453254320000000... or @@ -105,9 +105,8 @@ # The OUT_SUBST replaces exactly 3995 digits (as expected from the format) # with an "X". ['m2', '--format "%.4000f" sum 1', {IN_PIPE=>$in1}, - {OUT => "1.00000X\n"}, - {OUT_SUBST => 's/^(1\.00000)([0-9]{3995})$/\1X/'}], - + {OUT => "1.00000X\n"}, + {OUT_SUBST => 's/^(1\.00000)([0-9]{3995})$/\1X/'}], ); diff -Nru datamash-1.7/tests/datamash-pair-tests.pl datamash-1.8/tests/datamash-pair-tests.pl --- datamash-1.7/tests/datamash-pair-tests.pl 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/tests/datamash-pair-tests.pl 2022-07-10 20:58:25.000000000 +0000 @@ -2,7 +2,7 @@ =pod Unit Tests for GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2020 Assaf Gordon + Copyright (C) 2013-2021 Assaf Gordon This file is part of GNU Datamash. @@ -111,7 +111,7 @@ EOF my $out1_pcov_hdr=<<'EOF'; -pcov(field-2) +pcov(field-1,field-2) 1.622 EOF @@ -160,6 +160,34 @@ 3 6 EOF +my $in6=<<'EOF'; +x y +1 0.5 +2 1 +3 1.5 +4 2 +EOF + +my $out6_pcov_hdr=<<'EOF'; +pcov(x,y) +0.625 +EOF + +my $out6_scov_hdr=<<'EOF'; +scov(x,y) +0.833 +EOF + +my $out6_ppears_hdr=<<'EOF'; +ppearson(x,y) +1 +EOF + +my $out6_spears_hdr=<<'EOF'; +spearson(x,y) +1 +EOF + my @Tests = ( ['c1', 'scov 1:2', {IN_PIPE=>$in1}, {OUT=>$out1_scov}], @@ -167,9 +195,17 @@ # 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}], + ['c3_hin_p', '-W --header-in --header-out pcov x:y', + {IN_PIPE=>$in6}, {OUT=>$out6_pcov_hdr}], + ['c3_hin_s', '-W --header-in --header-out scov x:y', + {IN_PIPE=>$in6}, {OUT=>$out6_scov_hdr}], ['p1', 'ppearson 1:2', {IN_PIPE=>$in2}, {OUT=>$out2_p}], + ['p1_hin', '-W --header-in --header-out ppearson x:y', + {IN_PIPE=>$in6}, {OUT=>$out6_ppears_hdr}], ['p2', 'spearson 1:2', {IN_PIPE=>$in2}, {OUT=>$out2_s}], + ['p2_hin', '-W --header-in --header-out spearson x:y', + {IN_PIPE=>$in6}, {OUT=>$out6_spears_hdr}], # Test operations on edge-cases of input (one items, no items, # different number of items) diff -Nru datamash-1.7/tests/datamash-parser.pl datamash-1.8/tests/datamash-parser.pl --- datamash-1.7/tests/datamash-parser.pl 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/tests/datamash-parser.pl 2022-07-04 21:28:32.000000000 +0000 @@ -2,7 +2,7 @@ =pod Unit Tests for GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2020 Assaf Gordon + Copyright (C) 2013-2021 Assaf Gordon This file is part of GNU Datamash. @@ -82,10 +82,10 @@ # group by multiple columns ['p5', 'gb 1,3 sum 2', {IN_PIPE=>$in1}, - {OUT=>"A\tx\t110\nB\tx\t10\nB\ty\t35\n"}], + {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"}], + {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' . @@ -104,7 +104,7 @@ # invalid operation after valid mode ['p11','groupby 1 foobar 2', {IN_PIPE=>""}, {EXIT=>1}, - {ERR_SUBST=>'s/.*//s'}], + {ERR_SUBST=>'s/.*//s'}], # missing field number after processing mode ['p12','groupby', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], @@ -119,9 +119,9 @@ ['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}], + {IN_PIPE=>$in2}, {OUT=>$out2}], ['p27','sum 1,2 sum 3-5', - {IN_PIPE=>$in2}, {OUT=>$out2}], + {IN_PIPE=>$in2}, {OUT=>$out2}], # 'check' options ['p30','check', {IN_PIPE=>""}, {OUT=>"0 lines, 0 fields\n"}], @@ -129,11 +129,10 @@ ['p32','check 10', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], ['p33','check lines lines', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], ['p34','check 1 line fields', {IN_PIPE=>""}, {EXIT=>1}, - {ERR_SUBST=>'s/.*//s'}], + {ERR_SUBST=>'s/.*//s'}], ['p35','check 10 foo', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], - # 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'}], @@ -167,7 +166,7 @@ # Overflow strtol ['e64','sum 1234567890123456789012345678901234567', {IN_PIPE=>""}, {EXIT=>1}, - {ERR_SUBST=>'s/.*//s'}], + {ERR_SUBST=>'s/.*//s'}], # Invalid charcters ['e65','sum "foo^bar"', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], @@ -184,8 +183,11 @@ ['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=>""}], + ['b31','bin 1', {IN_PIPE=>""}, {OUT=>""}], + ['b32','bin:10 1', {IN_PIPE=>""}, {OUT=>""}], + ['b33','bin:1.5 1', {IN_PIPE=>""}, {OUT=>""}], + ['b34','bin 1,2', {IN_PIPE=>""}, {OUT=>""}], + ['b35','bin:1 1,2', {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'}], @@ -196,11 +198,33 @@ ['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'}], + ['e30','bin :10 1', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + ['e31','bin : 10 1', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + ['e32','bin : 1', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + ['e33','bin:1,2 1', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + ['e34','bin:-2 1', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + ['e35','bin 1:2', {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'}], + + # Test corner cases to avoid introducing unintended changes in behavior + # The parser allows some optional whitespace + ['cc0', '" sum 1 , 2"', {IN_PIPE=>""}, {OUT=>""}], + ['cc1', '" sum 1, 2"', {IN_PIPE=>""}, {OUT=>""}], + ['cc2', '" sum 1 ,2"', {IN_PIPE=>""}, {OUT=>""}], + ['cc3', '" sum 1 - 3"', {IN_PIPE=>""}, {OUT=>""}], + ['cc4', '" sum 1- 3"', {IN_PIPE=>""}, {OUT=>""}], + ['cc5', '" sum 1 -3"', {IN_PIPE=>""}, {OUT=>""}], + ['cc6', '" pcov 1 : 2"', {IN_PIPE=>""}, {OUT=>""}], + ['cc7', '" gb 1 , 2 sum 3"', {IN_PIPE=>""}, {OUT=>""}], + # Trailing whitespace leads to failures (could be seen as parser bug) + ['cce0', '"sum 1 "', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + ['cce1', "'sum 1\t'", {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + ['cce2', '"pcov 1:2 "', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], + ['cce3', '"gb 1,2 sum 3 "', {IN_PIPE=>""}, {EXIT=>1}, {ERR_SUBST=>'s/.*//s'}], ); my $save_temps = $ENV{SAVE_TEMPS}; diff -Nru datamash-1.7/tests/datamash-rand.sh datamash-1.8/tests/datamash-rand.sh --- datamash-1.7/tests/datamash-rand.sh 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/tests/datamash-rand.sh 2022-05-28 02:52:43.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # Unit Tests for GNU Datamash - perform simple calculation on input data -# Copyright (C) 2014-2020 Assaf Gordon +# Copyright (C) 2014-2021 Assaf Gordon # # This file is part of GNU Datamash. # @@ -31,7 +31,7 @@ require_paste_ ## Ensure seq is useable -## (not installed on OpenBSD by default) +openbsd_seq_replacement_ seq 10 >/dev/null 2>/dev/null || skip_ "requires a working seq" diff -Nru datamash-1.7/tests/datamash-sha.pl datamash-1.8/tests/datamash-sha.pl --- datamash-1.7/tests/datamash-sha.pl 2020-04-23 16:39:59.000000000 +0000 +++ datamash-1.8/tests/datamash-sha.pl 2022-06-17 23:43:10.000000000 +0000 @@ -2,7 +2,7 @@ =pod Unit Tests for GNU Datamash - tests sha1/256/5125 operations - Copyright (C) 2013-2020 Assaf Gordon + Copyright (C) 2013-2021 Assaf Gordon This file is part of GNU Datamash. @@ -105,11 +105,11 @@ my @Tests = ( - ['sha1-1', '-W sha1 2', {IN_PIPE=>$in_g1}, {OUT=>$out_g1_sha1}], - ['sha224-1','-W sha224 2', {IN_PIPE=>$in_g1}, {OUT=>$out_g1_sha224}], - ['sha256-1','-W sha256 2', {IN_PIPE=>$in_g1}, {OUT=>$out_g1_sha256}], - ['sha384-1','-W sha384 2', {IN_PIPE=>$in_g1}, {OUT=>$out_g1_sha384}], - ['sha512-1','-W sha512 2', {IN_PIPE=>$in_g1}, {OUT=>$out_g1_sha512}], + ['sha1-1', '-W sha1 2', {IN_PIPE=>$in_g1}, {OUT=>$out_g1_sha1}], + ['sha224-1','-W sha224 2', {IN_PIPE=>$in_g1}, {OUT=>$out_g1_sha224}], + ['sha256-1','-W sha256 2', {IN_PIPE=>$in_g1}, {OUT=>$out_g1_sha256}], + ['sha384-1','-W sha384 2', {IN_PIPE=>$in_g1}, {OUT=>$out_g1_sha384}], + ['sha512-1','-W sha512 2', {IN_PIPE=>$in_g1}, {OUT=>$out_g1_sha512}], ); my $save_temps = $ENV{SAVE_TEMPS}; diff -Nru datamash-1.7/tests/datamash-show-env.sh datamash-1.8/tests/datamash-show-env.sh --- datamash-1.7/tests/datamash-show-env.sh 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/tests/datamash-show-env.sh 2022-05-28 02:52:43.000000000 +0000 @@ -2,7 +2,7 @@ # Unit Tests for GNU Datamash - perform simple calculation on input data -# Copyright (C) 2014-2020 Assaf Gordon +# Copyright (C) 2014-2021 Assaf Gordon # # This file is part of GNU Datamash. # diff -Nru datamash-1.7/tests/datamash-sort-errors.sh datamash-1.8/tests/datamash-sort-errors.sh --- datamash-1.7/tests/datamash-sort-errors.sh 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/tests/datamash-sort-errors.sh 2022-05-28 02:52:43.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # Unit Tests for GNU Datamash - perform simple calculation on input data -# Copyright (C) 2014-2020 Assaf Gordon +# Copyright (C) 2014-2021 Assaf Gordon # # This file is part of GNU Datamash. # @@ -31,7 +31,7 @@ require_paste_ ## Ensure seq is useable -## (not installed on OpenBSD by default) +openbsd_seq_replacement_ seq 10 >/dev/null 2>/dev/null || skip_ "requires a working seq" @@ -51,12 +51,6 @@ GROUPPARAM=$(seq 1000 2000 | paste -d "," -s -) || framework_failure_ "failed to construct too-long group parameter" -## The expected error message when the group parameter is too long -## to pass to the 'sort' pipe -echo "$PROG_ARGV0: sort command too-long" \ - "(please report this bug)" > exp_err1 || - framework_failure_ "failed to create exp_err1" - ## The expected error message when 'sort' is not found printf 'sh: sort: not found\ndatamash: read error (on close)' > exp_err2 || framework_failure_ "failed to create exp_err2" @@ -97,24 +91,11 @@ ## ## -## piping to 'sort' uses a fixed-sized buffer for the command line (1024 bytes). -## If the "--group" parameter is too long, we can't safely create it. -## -## NOTE: This run SHOULD return an error, hence the "&&" instead of "||" -## -echo "" | datamash --sort --group "$GROUPPARAM" sum 1 2>err1 && - { warn_ "datamash --sort (group too-long) failed to detect error" ; - fail=1 ; } -compare_ err1 exp_err1 || - { warn_ "group-too-long error message is incorrect" ; fail=1 ; } - -## -## Test with non-existing 'sort' executable, -## by removing all directories fromt he PATH +## Test with non-existing 'sort' executable, by giving an invalid path ## ## NOTE: This run SHOULD return an error, hence the "&&" instead of "||" ## -seq 10 | PATH=$DATAMASHDIR datamash --sort -g 1 sum 1 && +seq 10 | datamash --sort --sort-cmd=/not/a/sort -g 1 sum 1 && { warn_ "datamash --sort with non existing 'sort' did not fail " \ "(it should have failed)" ; fail=1 ; } @@ -122,7 +103,7 @@ ## Test with a 'sort' that crashes ## NOTE: This run SHOULD return an error, hence the "&&" instead of "||" ## -seq 10 | PATH=$BADDIR:$DATAMASHDIR datamash --sort -g 1 sum 1 && +seq 10 | datamash --sort --sort-cmd="${BADDIR}/sort" -g 1 sum 1 && { warn_ "datamash --sort with crashing 'sort' did not fail " \ "(it should have failed)" ; fail=1 ; } diff -Nru datamash-1.7/tests/datamash-sort-header-deprecated.pl datamash-1.8/tests/datamash-sort-header-deprecated.pl --- datamash-1.7/tests/datamash-sort-header-deprecated.pl 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/tests/datamash-sort-header-deprecated.pl 2022-06-18 02:56:56.000000000 +0000 @@ -0,0 +1,106 @@ +#!/usr/bin/env perl +=pod + Unit Tests for GNU Datamash - perform simple calculation on input data + + Copyright (C) 2022 Timothy Rice + Copyright (C) 2013-2021 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 and Tim Rice. +=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'; + +## 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 --foobar 2>&1 | head -n 1 | cut -f1 -d:`; +chomp $prog if $prog; +$prog = $prog_bin unless $prog; + +# Turn off localization of executable's output. +@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; + +# An unsorted input with a header line +my $INFILE=<<'EOF'; +x y z +A % 1 +B ( 2 +A & 3 +B = 4 +EOF + +my @INFILE_lines = split /\n/, $INFILE, -1; +my $INFILE_NO_HEADER = join("\n", @INFILE_lines[1..$#INFILE_lines]); + +my $exp_sort_in_header_full=<<'EOF'; +A % 1 1,3 +B ( 2 2,4 +EOF + +my $exp_sort_out_header_full=<<'EOF'; +field-1 field-2 field-3 unique(field-3) +A % 1 1,3 +B ( 2 2,4 +EOF + +my $exp_sort_headers_full=<<'EOF'; +x y z unique(z) +A % 1 1,3 +B ( 2 2,4 +EOF + +my $deprecation_notice="$prog: Using -f/--full with non-linewise " . + "operations is deprecated and will be disabled " . + "in a future release.\n"; + +my @Tests = +( + ['shdep01', '-t " " --sort --full --header-out -g 1 unique 3', + {IN_PIPE=>$INFILE_NO_HEADER}, {OUT=>$exp_sort_out_header_full}, + {ERR=>$deprecation_notice}], + ['shdep02', '-t " " -g 1 --sort --full --header-in unique 3', + {IN_PIPE=>$INFILE}, {OUT=>$exp_sort_in_header_full}, + {ERR=>$deprecation_notice}], + ['shdep03', '-t " " -g 1 --sort --full --headers unique 3', + {IN_PIPE=>$INFILE}, {OUT=>$exp_sort_headers_full}, + {ERR=>$deprecation_notice}], + + # Check sort-piping with empty input - should always produce empty output + ['shdep04', '-t " " --sort --full unique 3', + {IN_PIPE=>""}, {OUT=>""}, + {ERR=>$deprecation_notice}], +); + +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.7/tests/datamash-sort-header.pl datamash-1.8/tests/datamash-sort-header.pl --- datamash-1.7/tests/datamash-sort-header.pl 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/tests/datamash-sort-header.pl 2022-06-18 01:59:09.000000000 +0000 @@ -0,0 +1,138 @@ +#!/usr/bin/env perl +=pod + Unit Tests for GNU Datamash - perform simple calculation on input data + + Copyright (C) 2022 Timothy Rice + Copyright (C) 2013-2021 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 and Tim Rice. +=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'; + +## 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 --foobar 2>&1 | head -n 1 | cut -f1 -d:`; +chomp $prog if $prog; +$prog = $prog_bin unless $prog; + +# Turn off localization of executable's output. +@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; + +# An unsorted input with a header line +my $INFILE=<<'EOF'; +x y z +A % 1 +B ( 2 +A & 3 +B = 4 +EOF + +my @INFILE_lines = split /\n/, $INFILE, -1; +my $INFILE_NO_HEADER = join("\n", @INFILE_lines[1..$#INFILE_lines]); + +# The expected output with different option combinations +my $exp_no_sort_no_header=<<'EOF'; +x z +A 1 +B 2 +A 3 +B 4 +EOF + +my $exp_no_sort_in_header=<<'EOF'; +A 1 +B 2 +A 3 +B 4 +EOF + +my $exp_sort_in_header=<<'EOF'; +A 1,3 +B 2,4 +EOF + +my $exp_no_sort_headers=<<'EOF'; +GroupBy(x) unique(z) +A 1 +B 2 +A 3 +B 4 +EOF + +my $exp_sort_headers=<<'EOF'; +GroupBy(x) unique(z) +A 1,3 +B 2,4 +EOF + +my $exp_sort_out_header=<<'EOF'; +GroupBy(field-1) unique(field-3) +A 1,3 +B 2,4 +EOF + +my @Tests = +( + # Simple transpose and reverse + ['sh01', '-t " " -g 1 unique 3', + {IN_PIPE=>$INFILE}, {OUT=>$exp_no_sort_no_header}], + ['sh02', '-t " " -g 1 --header-in unique 3', + {IN_PIPE=>$INFILE}, {OUT=>$exp_no_sort_in_header}], + ['sh03', '-t " " -g 1 --sort --header-in unique 3', + {IN_PIPE=>$INFILE}, {OUT=>$exp_sort_in_header}], + ['sh04', '-t " " -g 1 --headers unique 3', + {IN_PIPE=>$INFILE}, {OUT=>$exp_no_sort_headers}], + ['sh05', '-t " " -g 1 --sort --headers unique 3', + {IN_PIPE=>$INFILE}, {OUT=>$exp_sort_headers}], + ['sh06', '-t " " -sH -g 1 unique 3', + {IN_PIPE=>$INFILE}, {OUT=>$exp_sort_headers}], + ['sh07', '-t " " --sort --header-out -g 1 unique 3', + {IN_PIPE=>$INFILE_NO_HEADER}, {OUT=>$exp_sort_out_header}], + + # Check sort-piping with empty input - should always produce empty output + ['sh08', '-t " " --sort unique 3', + {IN_PIPE=>""}, {OUT=>""}], + ['sh09', '-t " " --sort --header-in unique 3', + {IN_PIPE=>""}, {OUT=>""}], + ['sh10', '-t " " --sort --header-out unique 3', + {IN_PIPE=>""}, {OUT=>""}], + ['sh11', '-t " " --sort --headers unique 3', + {IN_PIPE=>""}, {OUT=>""}], + +); + +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.7/tests/datamash-sort-header.sh datamash-1.8/tests/datamash-sort-header.sh --- datamash-1.7/tests/datamash-sort-header.sh 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/tests/datamash-sort-header.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,165 +0,0 @@ -#!/bin/sh -# Unit Tests for GNU Datamash - perform simple calculation on input data - -# Copyright (C) 2014-2020 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 - -. "${test_dir=.}/init.sh"; path_prepend_ ./src - -fail=0 - -# An unsorted input with a header line -INFILE="x y z -A % 1 -B ( 2 -A & 3 -B = 4" - -# The expected output with different option combinations -echo "x z -A 1 -B 2 -A 3 -B 4" > exp_no_sort_no_header || - framework_failure_ "failed to write exp_no_sort_no_header file" - -echo "A 1 -B 2 -A 3 -B 4" > exp_no_sort_in_header || - framework_failure_ "failed to write exp_no_sort_in_header file" - -echo "A 1,3 -B 2,4" > exp_sort_in_header || - framework_failure_ "failed to write exp_sort_in_header file" - -echo "GroupBy(x) unique(z) -A 1 -B 2 -A 3 -B 4" > exp_no_sort_headers || - framework_failure_ "failed to write exp_no_sort_headers file" - - -echo "A % 1 1,3 -B ( 2 2,4" > exp_sort_in_header_full || - framework_failure_ "failed to write exp_sort_in_header_full file" - -echo "GroupBy(x) unique(z) -A 1,3 -B 2,4" > exp_sort_headers || - framework_failure_ "failed to write exp_sort_headers file" - -echo "GroupBy(field-1) unique(field-3) -A 1,3 -B 2,4" > exp_sort_out_header || - framework_failure_ "failed to write exp_sort_out_header" - -echo "field-1 field-2 field-3 unique(field-3) -A % 1 1,3 -B ( 2 2,4" > exp_sort_out_header_full || - framework_failure_ "failed to write exp_sort_out_header_full" - -echo "x y z unique(z) -A % 1 1,3 -B ( 2 2,4" > exp_sort_headers_full || - framework_failure_ "failed to write exp_sort_headers_full" - - -echo "$INFILE" | datamash -t ' ' -g 1 unique 3 > out1 || - framework_failure_ "datamash failed" -compare_ out1 exp_no_sort_no_header || - { warn_ "no-sort-no-header failed" ; fail=1 ; } - -echo "$INFILE" | datamash -t ' ' -g 1 --header-in unique 3 > out2 || - framework_failure_ "datamash failed" -compare_ out2 exp_no_sort_in_header || - { warn_ "no-sort-in-header failed" ; fail=1 ; } - -echo "$INFILE" | datamash -t ' ' -g 1 --sort --header-in unique 3 > out3 || - framework_failure_ "datamash failed" -compare_ out3 exp_sort_in_header || - { warn_ "sort-in-header failed" ; fail=1 ; } - -echo "$INFILE" | datamash -t ' ' -g 1 --headers unique 3 > out4 || - framework_failure_ "datamash failed" -compare_ out4 exp_no_sort_headers || - { warn_ "no-sort-headers failed" ; fail=1 ; } - -echo "$INFILE" | datamash -t ' ' -g 1 --sort --headers unique 3 > out5 || - framework_failure_ "datamash failed" -compare_ out5 exp_sort_headers || - { warn_ "sort-headers failed" ; fail=1 ; } - -echo "$INFILE" | datamash -t ' ' -sH -g 1 unique 3 > out6 || - framework_failure_ "datamash failed" -compare_ out5 out6 || - { warn_ "sort-headers (short options) failed" ; fail=1 ; } - -echo "$INFILE" | sed 1d | - datamash -t ' ' --sort --header-out -g 1 unique 3 > out7 || - framework_failure_ "datamash failed" -compare_ out7 exp_sort_out_header || - { warn_ "sort-header-out failed" ; fail=1 ; } - -echo "$INFILE" | sed 1d | - datamash -t ' ' --sort --full --header-out -g 1 unique 3 > out8 || - framework_failure_ "datamash failed" -compare_ out8 exp_sort_out_header_full || - { warn_ "sort-header-out-full failed" ; fail=1 ; } - -echo "$INFILE" | - datamash -t ' ' -g 1 --sort --full --header-in unique 3 > out9 || - framework_failure_ "datamash failed" -compare_ out9 exp_sort_in_header_full || - { warn_ "sort-in-header-full failed" ; fail=1 ; } - -echo "$INFILE" | - datamash -t ' ' -g 1 --sort --full --headers unique 3 > out10 || - framework_failure_ "datamash failed" -compare_ out10 exp_sort_headers_full || - { warn_ "sort-headers-full failed" ; fail=1 ; } - - -## Check sort-piping with empty input - should always produce empty output -printf "" | datamash -t ' ' --sort unique 3 > emp1 || - framework_failure_ "datamash failed" -compare_ /dev/null "emp1" || { warn_ "sort on empty file failed" ; fail=1; } - -printf "" | datamash -t ' ' --sort --header-in unique 3 > emp2 || - framework_failure_ "datamash failed" -compare_ /dev/null "emp2" || - { warn_ "sort+header-in on empty file failed" ; fail=1; } - -printf "" | datamash -t ' ' --sort --header-out unique 3 > emp3 || - framework_failure_ "datamash failed" -compare_ /dev/null "emp3" || - { warn_ "sort+header-out on empty file failed" ; fail=1; } - -printf "" | datamash -t ' ' --sort --headers unique 3 > emp4 || - framework_failure_ "datamash failed" -compare_ /dev/null "emp4" || - { warn_ "sort+headers on empty file failed" ; fail=1; } - -printf "" | datamash -t ' ' --sort --full unique 3 > emp5 || - framework_failure_ "datamash failed" -compare_ /dev/null "emp5" || - { warn_ "sort+full on empty file failed" ; fail=1; } - -Exit $fail diff -Nru datamash-1.7/tests/datamash-stats.pl datamash-1.8/tests/datamash-stats.pl --- datamash-1.7/tests/datamash-stats.pl 2020-04-23 16:39:59.000000000 +0000 +++ datamash-1.8/tests/datamash-stats.pl 2022-06-17 23:44:13.000000000 +0000 @@ -2,7 +2,7 @@ =pod Unit Tests for GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2020 Assaf Gordon $seq11}, {OUT => "14.545\n"},], ['mean8', 'mean 1' , {IN_PIPE=>$seq12_unsorted}, {OUT => "16.416\n"},], ['mean9', '--sort mean 1' , - {IN_PIPE=>$seq12_unsorted}, {OUT => "16.416\n"},], + {IN_PIPE=>$seq12_unsorted}, {OUT => "16.416\n"},], ['mean10','mean 1' , {IN_PIPE=>$seq20}, {OUT => "100.06\n"},], ['mean11','mean 1' , {IN_PIPE=>$seq21}, {OUT => "45.32\n"},], ['mean12','mean 1' , {IN_PIPE=>$seq22}, {OUT => "67.45\n"},], @@ -308,7 +320,7 @@ ['geomean7', 'geomean 1' , {IN_PIPE=>$seq11}, {OUT => "10.653\n"},], ['geomean8', 'geomean 1' , {IN_PIPE=>$seq12_unsorted}, {OUT => "11.817\n"},], ['geomean9', '--sort geomean 1' , - {IN_PIPE=>$seq12_unsorted}, {OUT => "11.817\n"},], + {IN_PIPE=>$seq12_unsorted}, {OUT => "11.817\n"},], ['geomean10','geomean 1' , {IN_PIPE=>$seq20}, {OUT => "99.596\n"},], ['geomean11','geomean 1' , {IN_PIPE=>$seq21}, {OUT => "34.644\n"},], ['geomean12','geomean 1' , {IN_PIPE=>$seq22}, {OUT => "67.386\n"},], @@ -323,13 +335,39 @@ ['harmmean6', 'harmmean 1' , {IN_PIPE=>$seq12}, {OUT => "7.534\n"},], ['harmmean7', 'harmmean 1' , {IN_PIPE=>$seq11}, {OUT => "7.025\n"},], ['harmmean8', 'harmmean 1' , {IN_PIPE=>$seq12_unsorted}, - {OUT => "7.534\n"},], + {OUT => "7.534\n"},], ['harmmean9', '--sort harmmean 1' , - {IN_PIPE=>$seq12_unsorted}, {OUT => "7.534\n"},], + {IN_PIPE=>$seq12_unsorted}, {OUT => "7.534\n"},], ['harmmean10','harmmean 1' , {IN_PIPE=>$seq20}, {OUT => "99.122\n"},], ['harmmean11','harmmean 1' , {IN_PIPE=>$seq21}, {OUT => "19.563\n"},], ['harmmean12','harmmean 1' , {IN_PIPE=>$seq22}, {OUT => "67.322\n"},], + # Test mean square + ['ms1', 'ms 1', {IN_PIPE=>$seq1}, {OUT => "7.5\n"},], + ['ms2', 'ms 1', {IN_PIPE=>$seq2}, {OUT => "4.666\n"},], + ['ms3', 'ms 1', {IN_PIPE=>$seq3}, {OUT => "4\n"},], + ['ms4', 'ms 1', {IN_PIPE=>$seq9}, {OUT => "172.888\n"},], + ['ms5', 'ms 1', {IN_PIPE=>$seq10}, {OUT => "239.7\n"},], + ['ms6', 'ms 1', {IN_PIPE=>$seq11}, {OUT => "305.272\n"},], + ['ms7', 'ms 1', {IN_PIPE=>$seq12}, {OUT => "393.916\n"},], + ['ms8', 'ms 1', {IN_PIPE=>$seq20}, {OUT => "10102.8\n"},], + ['ms9', 'ms 1', {IN_PIPE=>$seq21}, {OUT => "2971.76\n"},], + ['ms10', 'ms 1', {IN_PIPE=>$seq22}, {OUT => "4558.03\n"},], + ['ms11', 'ms 1', {IN_PIPE=>$seq23}, {OUT => "42.689\n"},], + + # Test root mean square + ['rms1', 'rms 1', {IN_PIPE=>$seq1}, {OUT => "2.738\n"},], + ['rms2', 'rms 1', {IN_PIPE=>$seq2}, {OUT => "2.160\n"},], + ['rms3', 'rms 1', {IN_PIPE=>$seq3}, {OUT => "2\n"},], + ['rms4', 'rms 1', {IN_PIPE=>$seq9}, {OUT => "13.148\n"},], + ['rms5', 'rms 1', {IN_PIPE=>$seq10}, {OUT => "15.482\n"},], + ['rms6', 'rms 1', {IN_PIPE=>$seq11}, {OUT => "17.472\n"},], + ['rms7', 'rms 1', {IN_PIPE=>$seq12}, {OUT => "19.847\n"},], + ['rms8', 'rms 1', {IN_PIPE=>$seq20}, {OUT => "100.512\n"},], + ['rms9', 'rms 1', {IN_PIPE=>$seq21}, {OUT => "54.513\n"},], + ['rms10', 'rms 1', {IN_PIPE=>$seq22}, {OUT => "67.513\n"},], + ['rms11', 'rms 1', {IN_PIPE=>$seq23}, {OUT => "6.533\n"},], + # Test median ['med1', 'median 1' , {IN_PIPE=>$seq1}, {OUT => "2.5\n"}], ['med2', 'median 1' , {IN_PIPE=>$seq2}, {OUT => "2\n"}], @@ -609,9 +647,9 @@ ['mad_6', 'mad 1' , {IN_PIPE=>$seq11}, {OUT => "11.860\n"}], ['mad_7', 'mad 1' , {IN_PIPE=>$seq12}, {OUT => "13.343\n"}], ['mad_7.1', 'mad 1' , {IN_PIPE=>$seq12_unsorted}, - {OUT => "13.343\n"}], + {OUT => "13.343\n"}], ['mad_7.2', '--sort mad 1' , {IN_PIPE=>$seq12_unsorted}, - {OUT => "13.343\n"}], + {OUT => "13.343\n"}], ['mad_8', 'mad 1' , {IN_PIPE=>$seq20}, {OUT => "10.378\n"},], ['mad_9', 'mad 1' , {IN_PIPE=>$seq21}, {OUT => "27.428\n"},], ['mad_10','mad 1' , {IN_PIPE=>$seq22}, {OUT => "4.447\n"},], @@ -626,9 +664,9 @@ ['madraw_6', 'madraw 1' , {IN_PIPE=>$seq11}, {OUT => "8\n"}], ['madraw_7', 'madraw 1' , {IN_PIPE=>$seq12}, {OUT => "9\n"}], ['madraw_7.1', 'madraw 1' , {IN_PIPE=>$seq12_unsorted}, - {OUT => "9\n"}], + {OUT => "9\n"}], ['madraw_7.2', '--sort madraw 1' , {IN_PIPE=>$seq12_unsorted}, - {OUT => "9\n"}], + {OUT => "9\n"}], ['madraw_8', 'madraw 1' , {IN_PIPE=>$seq20}, {OUT => "7\n"},], ['madraw_9', 'madraw 1' , {IN_PIPE=>$seq21}, {OUT => "18.5\n"},], ['madraw_10','madraw 1' , {IN_PIPE=>$seq22}, {OUT => "3\n"},], @@ -712,7 +750,6 @@ ['dpo_9', 'dpo 1' , {IN_PIPE=>$seq21}, {OUT => "7.689e-10\n"},], ['dpo_10','dpo 1' , {IN_PIPE=>$seq22}, {OUT => "0.819\n"},], ['dpo_11','dpo 1' , {IN_PIPE=>$seq23}, {OUT => "0.002\n"},], - ); ## diff -Nru datamash-1.7/tests/datamash-strbin.sh datamash-1.8/tests/datamash-strbin.sh --- datamash-1.7/tests/datamash-strbin.sh 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/tests/datamash-strbin.sh 2022-05-28 02:52:43.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # Unit Tests for GNU Datamash - perform simple calculation on input data -# Copyright (C) 2015-2020 Assaf Gordon +# Copyright (C) 2015-2021 Assaf Gordon # # This file is part of GNU Datamash. # @@ -28,7 +28,8 @@ fail=0 -## Ensure seq,awk are useable +## Ensure seq is useable +openbsd_seq_replacement_ seq 10 >/dev/null 2>/dev/null \ || skip_ "requires a working seq" diff -Nru datamash-1.7/tests/datamash-tests-2-deprecated.pl datamash-1.8/tests/datamash-tests-2-deprecated.pl --- datamash-1.7/tests/datamash-tests-2-deprecated.pl 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/tests/datamash-tests-2-deprecated.pl 2022-06-17 23:44:29.000000000 +0000 @@ -0,0 +1,154 @@ +#!/usr/bin/env perl +=pod + Unit Tests for GNU Datamash - perform simple calculation on input data + + Copyright (C) 2013-2021 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; + +## +## This is a continuation of 'datamash-tests.pl' +## split into two files, as it was getting too large. +## + +# 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; + +## 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_bin ---print-nan`; +die "test infrastructure failed: can't determine 'nan' string" unless $nan; +my $inf = `$prog_bin ---print-inf`; +die "test infrastructure failed: can't determine 'inf' string" unless $inf; + +## Portability hack +## Check if the system's sort supports stable sorting ('-s'). +## If it doesn't - skip some tests +my $rc = system("sort -s < /dev/null > /dev/null 2>/dev/null"); +die "testing framework failure: failed to execute sort -s" + if ( ($rc == -1) || ($rc & 127) ); +my $sort_exit_code = ($rc >> 8); +my $have_stable_sort = ($sort_exit_code==0); + + +# TODO: add localization tests with "grouping" +# Turn off localization of executable's output. +@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; + + +# Test the selection operation (first/last/min/max) together with "FULL": +# group by column 1 ("A" or "B"), and operate on column 2 (numeric). +# Ensure the matching "iX" is displayed, despite not being part of the +# operation (example: if 'min(2)' is the operation, then "B 8" should be +# selected, and "i7" must be displayed with "-full" (because "i7" is on the +# same line as the min(2) value zero). +my $in_full1=<<'EOF'; +A 4 i1 +A 3 i2 +A 5 i3 +B 1 i4 +B 8 i5 +B 0 i6 +B 3 i7 +EOF + +my $full_deprecation = "$prog: Using -f/--full with non-linewise operations " . +"is deprecated and will be disabled in a future release.\n"; + +my @Tests = +( + # Test 'min' + --full + # Test with "--full", "i2" and "i6" should be displayed + ['slct2dep', '-t" " -f -g1 min 2', {IN_PIPE=>$in_full1}, + {OUT=>"A 3 i2 3\nB 0 i6 0\n"}, + {ERR=>"$full_deprecation"}], + # --full with --sort => should not change results + ['slct3dep', '-s -t" " -f -g1 min 2', {IN_PIPE=>$in_full1}, + {OUT=>"A 3 i2 3\nB 0 i6 0\n"}, + {ERR=>"$full_deprecation"}], + + # Test 'max' + --full + # Test with "--full", "i3" and "i7" should be displayed + ['slct5dep', '-t" " -f -g1 max 2', {IN_PIPE=>$in_full1}, + {OUT=>"A 5 i3 5\nB 8 i5 8\n"}, + {ERR=>"$full_deprecation"}], + # --full with --sort => should not change results + ['slct6dep', '-s -t" " -f -g1 max 2', {IN_PIPE=>$in_full1}, + {OUT=>"A 5 i3 5\nB 8 i5 8\n"}, + {ERR=>"$full_deprecation"}], + + # Test 'first' + --full + # Test with "--full", "i1" and "i4" should be displayed + ['slct8dep', '-t" " -f -g1 first 2', {IN_PIPE=>$in_full1}, + {OUT=>"A 4 i1 4\nB 1 i4 1\n"}, + {ERR=>"$full_deprecation"}], + # more --full with --sort => see test 'sortslct1' below + + # Test 'last' + --full + # Test with "--full", "i1" and "i4" should be displayed + ['slct10dep', '-t" " -f -g1 last 2', {IN_PIPE=>$in_full1}, + {OUT=>"A 5 i3 5\nB 3 i7 3\n"}, + {ERR=>"$full_deprecation"}], +); + +if ($have_stable_sort) { + push @Tests, ( + # Test 'first' + --full + --sort + # NOTE: This is subtle: + # Sorting should be stable: only ordering the column which is used + # for grouping (column 1 in this test). This means that the second + # column (containing numbers) should NOT affect sorting, and the order + # of the lines should not change. The results of this test + # should be the same as 'slct8'. If the system doesn't have stable + # 'sort', then the order will change. + ['sortslct1dep', '-s -t" " -f -g1 first 2', {IN_PIPE=>$in_full1}, + {OUT=>"A 4 i1 4\nB 1 i4 1\n"}, + {ERR=>"$full_deprecation"}], + # Test 'last' + --full + --sort + # See note above regarding 'first' - applies to 'last' as well. + ['sortslct2dep', '-s -t" " -f -g1 last 2', {IN_PIPE=>$in_full1}, + {OUT=>"A 5 i3 5\nB 3 i7 3\n"}, + {ERR=>"$full_deprecation"}], + ) +} + +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.7/tests/datamash-tests-2.pl datamash-1.8/tests/datamash-tests-2.pl --- datamash-1.7/tests/datamash-tests-2.pl 2020-02-13 03:15:38.000000000 +0000 +++ datamash-1.8/tests/datamash-tests-2.pl 2022-07-20 20:27:55.000000000 +0000 @@ -2,7 +2,7 @@ =pod Unit Tests for GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2020 Assaf Gordon + Copyright (C) 2013-2021 Assaf Gordon This file is part of GNU Datamash. @@ -56,16 +56,6 @@ my $inf = `$prog_bin ---print-inf`; die "test infrastructure failed: can't determine 'inf' string" unless $inf; -## Portability hack -## Check if the system's sort supports stable sorting ('-s'). -## If it doesn't - skip some tests -my $rc = system("sort -s < /dev/null > /dev/null 2>/dev/null"); -die "testing framework failure: failed to execute sort -s" - if ( ($rc == -1) || ($rc & 127) ); -my $sort_exit_code = ($rc >> 8); -my $have_stable_sort = ($sort_exit_code==0); - - # TODO: add localization tests with "grouping" # Turn off localization of executable's output. @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; @@ -215,24 +205,36 @@ EOF my $bin_in2=<<'EOF'; +-101.9 +-3.1 -3 -0.3 +-0 +0 0.3 3 103 EOF my $bin_out2_100=<<'EOF'; +-200 +-100 -100 -100 0 0 +0 +0 100 EOF my $bin_out2_3=<<'EOF'; +-102 -6 -3 +-3 +0 +0 0 3 102 @@ -371,44 +373,24 @@ 1,X,6 EOF - - my @Tests = ( # Test 'min' + --full # first, verify test without "--full" ['slct1', '-t" " -g1 min 2', {IN_PIPE=>$in_full1}, {OUT=>"A 3\nB 0\n"}], - # Test with "--full", "i2" and "i6" should be displayed - ['slct2', '-t" " -f -g1 min 2', {IN_PIPE=>$in_full1}, - {OUT=>"A 3 i2 3\nB 0 i6 0\n"}], - # --full with --sort => should not change results - ['slct3', '-s -t" " -f -g1 min 2', {IN_PIPE=>$in_full1}, - {OUT=>"A 3 i2 3\nB 0 i6 0\n"}], # Test 'max' + --full # first, verify test without "--full" ['slct4', '-t" " -g1 max 2', {IN_PIPE=>$in_full1}, {OUT=>"A 5\nB 8\n"}], - # Test with "--full", "i3" and "i7" should be displayed - ['slct5', '-t" " -f -g1 max 2', {IN_PIPE=>$in_full1}, - {OUT=>"A 5 i3 5\nB 8 i5 8\n"}], - # --full with --sort => should not change results - ['slct6', '-s -t" " -f -g1 max 2', {IN_PIPE=>$in_full1}, - {OUT=>"A 5 i3 5\nB 8 i5 8\n"}], # Test 'first' + --full # first, verify test without "--full" ['slct7', '-t" " -g1 first 2', {IN_PIPE=>$in_full1}, {OUT=>"A 4\nB 1\n"}], - # Test with "--full", "i1" and "i4" should be displayed - ['slct8', '-t" " -f -g1 first 2', {IN_PIPE=>$in_full1}, - {OUT=>"A 4 i1 4\nB 1 i4 1\n"}], # more --full with --sort => see test 'sortslct1' below # Test 'last' + --full # first, verify test without "--full" ['slct9', '-t" " -g1 last 2', {IN_PIPE=>$in_full1}, {OUT=>"A 5\nB 3\n"}], - # Test with "--full", "i1" and "i4" should be displayed - ['slct10', '-t" " -f -g1 last 2', {IN_PIPE=>$in_full1}, - {OUT=>"A 5 i3 5\nB 3 i7 3\n"}], # more --full with --sort => see test 'sortslct2' below @@ -419,42 +401,42 @@ ['narm2', '--narm mean 1', {IN_PIPE=>$na1}, {OUT=>"2\n"}], # without --narm, these should fail with invalid input ['narm3', 'sum 1', {IN_PIPE=>$na1}, {EXIT=>1}, - {ERR=>"$prog: invalid numeric value in line 3 field 1: 'NA'\n"}], + {ERR=>"$prog: invalid numeric value in line 3 field 1: 'NA'\n"}], ## Test with 'nA' ['narm4', '--narm sum 1', {IN_PIPE=>$na2}, {OUT=>"6\n"}], ['narm5', '--narm mean 1', {IN_PIPE=>$na2}, {OUT=>"2\n"}], # without --narm, these should fail with invalid input ['narm6', 'sum 1', {IN_PIPE=>$na2}, {EXIT=>1}, - {ERR=>"$prog: invalid numeric value in line 3 field 1: 'nA'\n"}], + {ERR=>"$prog: invalid numeric value in line 3 field 1: 'nA'\n"}], ## Test with 'N/A' ['narm7', '--narm sum 1', {IN_PIPE=>$na3}, {OUT=>"6\n"}], ['narm8', '--narm mean 1', {IN_PIPE=>$na3}, {OUT=>"2\n"}], # without --narm, these should fail with invalid input ['narm9', 'sum 1', {IN_PIPE=>$na3}, {EXIT=>1}, - {ERR=>"$prog: invalid numeric value in line 3 field 1: 'N/A'\n"}], + {ERR=>"$prog: invalid numeric value in line 3 field 1: 'N/A'\n"}], ## Test with 'NaN' ['narm10', '--narm sum 1', {IN_PIPE=>$na4}, {OUT=>"6\n"}], ['narm11', '--narm mean 1', {IN_PIPE=>$na4}, {OUT=>"2\n"}], # without --narm, 'nan' should be processed, not skipped ['narm12', 'sum 1', {IN_PIPE=>$na4}, {OUT=>"$nan\n"}, - {OUT_SUBST=>'s/^-//'}], + {OUT_SUBST=>'s/^-//'}], ## Test with 'nan' ['narm13', '--narm sum 1', {IN_PIPE=>$na5}, {OUT=>"6\n"}], ['narm14', '--narm mean 1', {IN_PIPE=>$na5}, {OUT=>"2\n"}], # without --narm, 'nan' should be processed, not skipped ['narm15', 'sum 1', {IN_PIPE=>$na5}, {OUT=>"$nan\n"}, - {OUT_SUBST=>'s/^-//'}], + {OUT_SUBST=>'s/^-//'}], # These input have strings starting with 'NA' or 'NAN' but should not # be mistaken for them. ['narm16', '--narm sum 1', {IN_PIPE=>$not_na1}, {EXIT=>1}, - {ERR=>"$prog: invalid numeric value in line 3 field 1: 'NAK'\n"}], + {ERR=>"$prog: invalid numeric value in line 3 field 1: 'NAK'\n"}], ['narm17', '--narm sum 1', {IN_PIPE=>$not_na2}, {EXIT=>1}, - {ERR=>"$prog: invalid numeric value in line 3 field 1: 'NANA'\n"}], + {ERR=>"$prog: invalid numeric value in line 3 field 1: 'NANA'\n"}], ## NA value as first/last line ['narm18', '--narm mean 1', {IN_PIPE=>$na_first}, {OUT=>"5\n"}], @@ -464,13 +446,13 @@ ['narm20', '-t: --narm sum 1 sum 2 sum 3', {IN_PIPE=>$na_mid1}, {OUT=>"12:10:18\n"}], ['narm21', '-t: sum 1 sum 2 sum 3', {IN_PIPE=>$na_mid1}, {EXIT=>1}, - {ERR=>"$prog: invalid numeric value in line 2 field 2: 'NA'\n"}], + {ERR=>"$prog: invalid numeric value in line 2 field 2: 'NA'\n"}], ## NA as the last field ['narm22', '-t: --narm sum 1 sum 2 sum 3', {IN_PIPE=>$na_mid1}, {OUT=>"12:10:18\n"}], ['narm23', '-t: sum 1 sum 2 sum 3', {IN_PIPE=>$na_mid1}, {EXIT=>1}, - {ERR=>"$prog: invalid numeric value in line 2 field 2: 'NA'\n"}], + {ERR=>"$prog: invalid numeric value in line 2 field 2: 'NA'\n"}], # N/A affect counts ['narm24', '-t: count 1 count 2 count 3', {IN_PIPE=>$na_last1}, @@ -541,11 +523,16 @@ # 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}], + ['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}], + ['bin6', 'bin:3. 1', {IN_PIPE=>$bin_in2}, {OUT=>$bin_out2_3}], + ['bin7', 'bin:3.0 1', {IN_PIPE=>$bin_in2}, {OUT=>$bin_out2_3}], + ['bin8', 'bin:3.e0 1', {IN_PIPE=>$bin_in2}, {OUT=>$bin_out2_3}], + ['bin9', 'bin:0.3e1 1', {IN_PIPE=>$bin_in2}, {OUT=>$bin_out2_3}], + ['bin10','bin:30.e-1 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', @@ -563,35 +550,42 @@ # Test output-delimiter ['odlm1', '-t: last 1 last 2', {IN_PIPE=>$na_mid1}, {OUT=>"7:8\n"}], ['odlm2', '-t: --output-delimiter "%" last 1 last 2', - {IN_PIPE=>$na_mid1}, {OUT=>"7%8\n"}], + {IN_PIPE=>$na_mid1}, {OUT=>"7%8\n"}], ['odlm3', '--output-delimiter "%" -t: last 1 last 2', - {IN_PIPE=>$na_mid1}, {OUT=>"7%8\n"}], + {IN_PIPE=>$na_mid1}, {OUT=>"7%8\n"}], # output-delimiter with whitespace ['odlm4', '-t " " last 1 last 2', {IN_PIPE=>$in_full1}, {OUT=>"B 3\n"}], ['odlm5', '-W last 1 last 2', {IN_PIPE=>$in_full1}, {OUT=>"B\t3\n"}], ['odlm6', '-W --output-delimiter ":" last 1 last 2', - {IN_PIPE=>$in_full1}, {OUT=>"B:3\n"}], + {IN_PIPE=>$in_full1}, {OUT=>"B:3\n"}], ['odlm7', '--output-delimiter ":" -W last 1 last 2', - {IN_PIPE=>$in_full1}, {OUT=>"B:3\n"}], + {IN_PIPE=>$in_full1}, {OUT=>"B:3\n"}], # Multiple output delimiters ['odlm8', '--output-delimiter "x" -W --output-delimiter "y" last 1 last 2', - {IN_PIPE=>$in_full1}, {OUT=>"By3\n"}], + {IN_PIPE=>$in_full1}, {OUT=>"By3\n"}], # Test -C/--skip-comments option ['sc1', 'sum 2', {IN_PIPE=>$in_comments}, {OUT=>"15\n"}], ['sc2', '-C sum 2', {IN_PIPE=>$in_comments}, {OUT=>"5\n"}], ['sc3', 'reverse', {IN_PIPE=>$in_comments}, - {OUT=>"3 #foo\n" . - "5 bar\n" . - "7 ;baz\n"}], + {OUT=>"3 #foo\n" . + "5 bar\n" . + "7 ;baz\n"}], ['sc4', '-C reverse', {IN_PIPE=>$in_comments}, {OUT=>"5 bar\n"}], + # Regression tests + # TODO: Move regression tests into a separate file when sufficiently many + # have accumulated to warrant the overhead of another test file. # Bug in mode/antimode in 1.4 and earlier ['bug_mode1', 'mode 1', {IN_PIPE=>"-1"}, {OUT=>"-1\n"}], + # "Segmentation fault" when input contains embedded NUL characters + # (see https://lists.gnu.org/archive/html/bug-datamash/2020-11/msg00001.html) + ['regr001', 'countunique 1', {IN_PIPE=>"\x00" x 100}, {OUT=>"1\n"}], + ['regr002', 'unique 1', {IN_PIPE=>"\x00" x 100}, {OUT=>"\n"}], ## ## Backslash escaping in identifiers @@ -599,23 +593,22 @@ ## minus in field name ['esc1', '-W -H sum "A_Chlor_T1h_r1\\-metaG"', {IN_PIPE=>$in_esc_ident}, - {OUT=>"sum(A_Chlor_T1h_r1-metaG)\n11\n"}], + {OUT=>"sum(A_Chlor_T1h_r1-metaG)\n11\n"}], # field name starting with an identifier ['esc2', '-W -H sum "\\9C"', {IN_PIPE=>$in_esc_ident}, - {OUT=>"sum(9C)\n33\n"}], + {OUT=>"sum(9C)\n33\n"}], # field name starting with minus ['esc3', '-W -H sum "\\-bar"', {IN_PIPE=>$in_esc_ident}, - {OUT=>"sum(-bar)\n44\n"}], + {OUT=>"sum(-bar)\n44\n"}], # dirname and basename ['dnbn1', 'dirname 1 basename 1', {IN_PIPE=>$in_dirname_basename}, - {OUT=>$exp_dirname_basename}], + {OUT=>$exp_dirname_basename}], # barename and extname ['bnen1', 'barename 1 extname 1', {IN_PIPE=>$in_barename_extname}, - {OUT=>$exp_barename_extname}], - + {OUT=>$exp_barename_extname}], ## GetNum variants @@ -640,40 +633,50 @@ ['gn12', 'getnum:i 1', {IN_PIPE=>"moo---4"}, {OUT=>"0\n"}], ['gn13', 'getnum:d 1', {IN_PIPE=>"moo...4"}, {OUT=>"0\n"}], ['gn14', 'getnum:i 1', - {IN_PIPE=>"moo999999999999999999999999999991234312341432123451541341312431"}, - {OUT=>"0\n"}], + {IN_PIPE=>"moo99999999999999999999999999999" . + "1234312341432123451541341312431"}, + {OUT=>"0\n"}], ['gn15', 'getnum:d 1', - {IN_PIPE=>"moo" . "9" x 10000}, - {OUT=>"0\n"}], + {IN_PIPE=>"moo" . "9" x 10000}, + {OUT=>"0\n"}], ['gn16', 'getnum:n 1', {IN_PIPE=>"moo" x 4000 . "42" . "bar" x 1000}, - {OUT=>"42\n"}], + {OUT=>"42\n"}], # cut operation ['cut1','-t, cut 3,1,2', {IN_PIPE=>$in1_cut}, {OUT=>"c,a,b\n6,1,X\n"}], ['cut2','-t, -H cut c,a', {IN_PIPE=>$in1_cut}, {OUT=>"cut(c),cut(a)\n6,1\n"}], -); + # Aliases (more-or-less: copy-paste above tests and s/orig/alias/ the + # command names.) + ['alias1','-t, echo 3,1,2', {IN_PIPE=>$in1_cut}, {OUT=>"c,a,b\n6,1,X\n"}], + ['alias2','-t, -H echo c,a', {IN_PIPE=>$in1_cut}, + {OUT=>"cut(c),cut(a)\n6,1\n"}], + ['alias3', '-t: --narm uniq 2', {IN_PIPE=>$na_mid1}, + {OUT=>"2,8\n"}], + ['alias4', '-t: uniq 2', {IN_PIPE=>$na_mid1}, + {OUT=>"2,8,NA\n"}], + ['alias5', '--narm uniq 1', {IN_PIPE=>$na_all}, {OUT=>"\n"}], + # Decimal separator used as input field delimiter + ['ifdl01', '-t. cut 2,1', {IN_PIPE=>"1.2\n"}, {OUT=>"2.1\n"}], + ['ifdl02', '-t. cut 3,2,1', {IN_PIPE=>"1.2.3\n"}, {OUT=>"3.2.1\n"}], + ['ifdl03', '-t. unique 1,2', {IN_PIPE=>"1.2\n"}, {OUT=>"1.2\n"}], + ['ifdl04', '-t. unique 1,2,3', {IN_PIPE=>"1.2.3\n"}, {OUT=>"1.2.3\n"}], + ['ifdl05', '-t. count 1,2', {IN_PIPE=>"1.2\n"}, {OUT=>"1.1\n"}], + ['ifdl06', '-t. count 1,2,3', {IN_PIPE=>"1.2.3\n"}, {OUT=>"1.1.1\n"}], + ['ifdl07', '-t. countunique 1,2', {IN_PIPE=>"1.2\n"}, {OUT=>"1.1\n"}], + ['ifdl08', '-t. countunique 1,2,3', {IN_PIPE=>"1.2.3\n"}, {OUT=>"1.1.1\n"}], + ['ifdl09', '-t. rmdup 1', {IN_PIPE=>"1.2\n"}, {OUT=>"1.2\n"}], + ['ifdl10', '-t. rmdup 2', {IN_PIPE=>"1.2\n"}, {OUT=>"1.2\n"}], + ['ifdl11', '-t. rmdup 3', {IN_PIPE=>"1.2.3\n"}, {OUT=>"1.2.3\n"}], + # TODO: fix bug for numeric operations + #['ifdl12', '-t. sum 1,2', {IN_PIPE=>"1.2\n"}, {OUT=>"1.2\n"}], + #['ifdl13', '-t. sum 1,2,3', {IN_PIPE=>"1.2.3\n"}, {OUT=>"1.2.3\n"}], + # TODO: fix bug for "getnum" operation + #['ifdl14', '-t. getnum 1,2', {IN_PIPE=>"x1.2y\n"}, {OUT=>"1.2\n"}], -if ($have_stable_sort) { - push @Tests, ( - # Test 'first' + --full + --sort - # NOTE: This is subtle: - # Sorting should be stable: only ordering the column which is used - # for grouping (column 1 in this test). This means that the second - # column (containing numbers) should NOT affect sorting, and the order - # of the lines should not change. The results of this test - # should be the same as 'slct8'. If the system doesn't have stable - # 'sort', then the order will change. - ['sortslct1', '-s -t" " -f -g1 first 2', {IN_PIPE=>$in_full1}, - {OUT=>"A 4 i1 4\nB 1 i4 1\n"}], - # Test 'last' + --full + --sort - # See note above regarding 'first' - applies to 'last' as well. - ['sortslct2', '-s -t" " -f -g1 last 2', {IN_PIPE=>$in_full1}, - {OUT=>"A 5 i3 5\nB 3 i7 3\n"}], - ) -} +); my $save_temps = $ENV{SAVE_TEMPS}; my $verbose = $ENV{VERBOSE}; diff -Nru datamash-1.7/tests/datamash-tests-deprecated.pl datamash-1.8/tests/datamash-tests-deprecated.pl --- datamash-1.7/tests/datamash-tests-deprecated.pl 1970-01-01 00:00:00.000000000 +0000 +++ datamash-1.8/tests/datamash-tests-deprecated.pl 2022-06-17 23:45:55.000000000 +0000 @@ -0,0 +1,155 @@ +#!/usr/bin/env perl +=pod + Unit Tests for GNU Datamash - perform simple calculation on input data + + Copyright (C) 2013-2021 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; + +## Portability hack +## Check if the system's sort supports stable sorting ('-s'). +## If it doesn't - skip some tests +my $rc = system("sort -s < /dev/null > /dev/null 2>/dev/null"); +die "testing framework failure: failed to execute sort -s" + if ( ($rc == -1) || ($rc & 127) ); +my $sort_exit_code = ($rc >> 8); +my $have_stable_sort = ($sort_exit_code==0); + + +# TODO: add localization tests with "grouping" +# Turn off localization of executable's output. +@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3; + +my $in_g3=<<'EOF'; +A 3 W +A 5 W +A 7 W +A 11 X +A 13 X +B 17 Y +B 19 Z +C 23 Z +EOF + +my $in_g4=<<'EOF'; +A 5 +K 6 +P 2 +EOF + +my $in_hdr1=<<'EOF'; +x y z +A 1 10 +A 2 10 +A 3 10 +A 4 10 +A 4 10 +B 5 10 +B 6 20 +B 7 30 +C 8 11 +C 9 22 +C 1 33 +C 2 44 +EOF + +my $in_hdr_only=<<'EOF'; +X:Y:Z +EOF + +my $full_deprecation = "$prog: Using -f/--full with non-linewise operations " . +"is deprecated and will be disabled in a future release.\n"; + +my @Tests = +( + # empty input = empty output, regardless of options + ['emp2dep', '--full count 2', {IN_PIPE=>""},{OUT=>""}, + {ERR=>"$full_deprecation"}], + ['emp5dep', '--full --header-in count 2', {IN_PIPE=>""},{OUT=>""}, + {ERR=>"$full_deprecation"}], + ['emp6dep', '--full --header-out count 2', {IN_PIPE=>""},{OUT=>""}, + {ERR=>"$full_deprecation"}], + ['emp7dep', '--full --header-in --header-out count 2', + {IN_PIPE=>""},{OUT=>""}, + {ERR=>"$full_deprecation"}], + ['emp8dep', '-g3,4 --full --header-in --header-out count 2', + {IN_PIPE=>""},{OUT=>""}, + {ERR=>"$full_deprecation"}], + + # --full option - without grouping, returns the first line + ['fl1dep', '-t" " --full sum 2', {IN_PIPE=>$in_g3}, + {OUT=>"A 3 W 98\n"}, + {ERR=>"$full_deprecation"}], + # --full with grouping - print entire line of each group + ['fl2dep', '-t" " --full -g3 sum 2', {IN_PIPE=>$in_g3}, + {OUT=>"A 3 W 15\nA 11 X 24\nB 17 Y 17\nB 19 Z 42\n"}, + {ERR=>"$full_deprecation"}], + + # Input and output header, with full line + ['hdr3dep', '-t" " -g 1 --full --header-in --header-out count 2', + {IN_PIPE=>$in_hdr1}, + {OUT=>"x y z count(y)\nA 1 10 5\nB 5 10 3\nC 8 11 4\n"}, + {ERR=>"$full_deprecation"}], + + # Output Header with --full + ['hdr5dep', '-t" " -g 1 --full --header-out count 2', {IN_PIPE=>$in_g3}, + {OUT=>"field-1 field-2 field-3 count(field-2)\n" . + "A 3 W 5\nB 17 Y 2\nC 23 Z 1\n"}, + {ERR=>"$full_deprecation"}], + + # Input has only one header line (no data lines), and the user requested + # header-in and header-out => header line should be printed + ['hdr15dep', '-t: --full -H sum 1', {IN_PIPE=>$in_hdr_only}, + {OUT=>"X:Y:Z:sum(X)\n"}, + {ERR=>"$full_deprecation"}], + ['hdr17dep', '-t: --full -s -g1 -H sum 2', {IN_PIPE=>$in_hdr_only}, + {OUT=>"X:Y:Z:sum(Y)\n"}, + {ERR=>"$full_deprecation"}], + + # Test single line per group + ['sl2dep', '-t" " --full -g 1 mean 2', {IN_PIPE=>$in_g4}, + {OUT=>"A 5 5\nK 6 6\nP 2 2\n"}, + {ERR=>"$full_deprecation"}], +); + +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.7/tests/datamash-tests.pl datamash-1.8/tests/datamash-tests.pl --- datamash-1.7/tests/datamash-tests.pl 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/tests/datamash-tests.pl 2022-07-09 03:53:38.000000000 +0000 @@ -2,7 +2,7 @@ =pod Unit Tests for GNU Datamash - perform simple calculation on input data - Copyright (C) 2013-2020 Assaf Gordon + Copyright (C) 2013-2021 Assaf Gordon This file is part of GNU Datamash. @@ -68,6 +68,23 @@ my $in3 = "1 \t 2\t\t\t3\t\t\n" . "4\t\t\t5 6\n"; +# Only whitespace +my $ws1 = "\t\t\t\n"; +my $ws2 = " \t \n"; + +# Leading whitespace +my $lws1 = "\t\t1\n"; +my $lws2 = "\t 1\n"; + +# trailing whitespace +my $tws1 = "1\t\t\n"; +my $tws2 = "1 \t\n"; + +# both leading and trailing whitespace +my $ltws1 = "\t\t1\t\t\n"; +my $ltws2 = " \t1\t \n"; +my $ltws3 = "\t 1:2 \t\n"; + my $in_g1=<<'EOF'; A 100 A 10 @@ -343,95 +360,107 @@ ['b4', 'max 1', {IN_PIPE=>$in1}, {OUT => "10\n"}], ['b5', 'absmin 1', {IN_PIPE=>$in1}, {OUT => "1\n"}], ['b6', 'absmax 1', {IN_PIPE=>$in1}, {OUT => "10\n"}], - ['b8', 'median 1', {IN_PIPE=>$in1}, {OUT => "5\n"}], - ['b9', 'mode 1', {IN_PIPE=>$in1}, {OUT => "5\n"}], - ['b10', 'antimode 1', {IN_PIPE=>$in1}, {OUT => "1\n"}], - ['b11', 'unique 1', {IN_PIPE=>$in1}, {OUT => "1,10,2,3,4,5,6,7,8,9\n"}], - ['b13', 'collapse 1', {IN_PIPE=>$in1}, {OUT => "1,2,3,4,5,6,7,5,8,9,10\n"}], + ['b7', 'median 1', {IN_PIPE=>$in1}, {OUT => "5\n"}], + ['b8', 'mode 1', {IN_PIPE=>$in1}, {OUT => "5\n"}], + ['b9', 'antimode 1', {IN_PIPE=>$in1}, {OUT => "1\n"}], + ['b10', 'unique 1', {IN_PIPE=>$in1}, {OUT => "1,10,2,3,4,5,6,7,8,9\n"}], + ['b11', '--collapse-delimiter=^ unique 1', + {IN_PIPE=>$in1}, {OUT => "1^10^2^3^4^5^6^7^8^9\n"}], + ['b11.1', '-c^ unique 1', + {IN_PIPE=>$in1}, {OUT => "1^10^2^3^4^5^6^7^8^9\n"}], + ['b12', 'collapse 1', {IN_PIPE=>$in1}, {OUT => "1,2,3,4,5,6,7,5,8,9,10\n"}], + ['b13', '--collapse-delimiter=^ collapse 1', + {IN_PIPE=>$in1}, {OUT => "1^2^3^4^5^6^7^5^8^9^10\n"}], + ['b13.1', '-c ^ collapse 1', + {IN_PIPE=>$in1}, {OUT => "1^2^3^4^5^6^7^5^8^9^10\n"}], # on a different architecture, would printf(%Lg) print something else? # Use OUT_SUBST to trim output to 1.3 digits ['b14', 'mean 1', {IN_PIPE=>$in1}, {OUT => "5.454\n"}, - {OUT_SUBST=>'s/^(\d\.\d{3}).*/\1/'}], + {OUT_SUBST=>'s/^(\d\.\d{3}).*/\1/'}], ['b15', 'pstdev 1', {IN_PIPE=>$in1}, {OUT => "2.742\n"}, - {OUT_SUBST=>'s/^(\d\.\d{3}).*/\1/'}], + {OUT_SUBST=>'s/^(\d\.\d{3}).*/\1/'}], ['b16', 'sstdev 1', {IN_PIPE=>$in1}, {OUT => "2.876\n"}, - {OUT_SUBST=>'s/^(\d\.\d{3}).*/\1/'}], + {OUT_SUBST=>'s/^(\d\.\d{3}).*/\1/'}], ['b17', 'pvar 1', {IN_PIPE=>$in1}, {OUT => "7.520\n"}, - {OUT_SUBST=>'s/^(\d\.\d{3}).*/\1/'}], + {OUT_SUBST=>'s/^(\d\.\d{3}).*/\1/'}], ['b18', 'svar 1', {IN_PIPE=>$in1}, {OUT => "8.272\n"}, - {OUT_SUBST=>'s/^(\d\.\d{3}).*/\1/'}], + {OUT_SUBST=>'s/^(\d\.\d{3}).*/\1/'}], ['b19', 'countunique 1', {IN_PIPE=>$in1}, {OUT => "10\n"}], ['b20', 'first 1', {IN_PIPE=>$in1}, {OUT => "1\n"}], ['b21', 'last 1', {IN_PIPE=>$in1}, {OUT => "10\n"}], # This test just ensures the 'rand' operation is functioning. # It does not verify randomness (see datamash-rand.sh test for that). ['b22', 'rand 1', {IN_PIPE=>$in1}, {OUT => "\n"}, - {OUT_SUBST=>'s/[0-9]+//'}], + {OUT_SUBST=>'s/[0-9]+//'}], ## Some error checkings ['e1', 'sum', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: missing field for operation 'sum'\n"}], + {ERR=>"$prog: missing field for operation 'sum'\n"}], ['e2', 'foobar', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: invalid operation 'foobar'\n"}], + {ERR=>"$prog: invalid operation 'foobar'\n"}], ['e3', '', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: missing operation specifiers\n" . - "Try '$prog --help' for more information.\n"}], + {ERR=>"$prog: missing operation specifiers\n" . + "Try '$prog --help' for more information.\n"}], ['e4', 'sum 1' , {IN_PIPE=>"a\n"}, {EXIT=>1}, - {ERR=>"$prog: invalid numeric value in line 1 field 1: 'a'\n"}], + {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: missing field for operation 'groupby'\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"}], + {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: missing field for operation 'groupby'\n"}], + {ERR=>"$prog: missing field for operation 'groupby'\n"}], ['e8', '-g 1,0 sum 1' , {IN_PIPE=>"a\n"}, {EXIT=>1}, - {ERR=>"$prog: invalid field '0' for operation 'groupby'\n"}], + {ERR=>"$prog: invalid field '0' for operation 'groupby'\n"}], ['e9', '-g 1X0 sum 1' , {IN_PIPE=>"a\n"}, {EXIT=>1}, - {ERR=>"$prog: invalid numeric value '1X0'\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"}], + {ERR=>"$prog: the delimiter must be a single character\n"}], ['e10.1', '-g 1 -t "" sum 1' , {IN_PIPE=>"a\n"}, {EXIT=>1}, - {ERR=>"$prog: the delimiter must be a single character\n"}], + {ERR=>"$prog: the delimiter must be a single character\n"}], ['e11', '--foobar' , {IN_PIPE=>"a\n"}, {EXIT=>1}, - {ERR=>"$prog: unrecognized option foobar\n" . - "Try '$prog --help' for more information.\n"}, - # This ERR_SUBST is needed because on some systems (e.g. OpenBSD), - # The error message from 'getopt_long' is slightly - # different than GNU libc's. - {ERR_SUBST=>'s/(unknown|unrecognized) option.*(foobar).*' . - '/unrecognized option $2/'}], + {ERR=>"$prog: unrecognized option foobar\n" . + "Try '$prog --help' for more information.\n"}, + # This ERR_SUBST is needed because on some systems (e.g. OpenBSD), + # The error message from 'getopt_long' is slightly + # different than GNU libc's. + {ERR_SUBST=>'s/(unknown|unrecognized) option.*(foobar).*' . + '/unrecognized option $2/'}], ['e12', '-t" " -H unique 4' , {IN_PIPE=>$in_hdr1}, {EXIT=>1}, - {ERR=>"$prog: invalid input: field 4 requested, " . - "line 1 has only 3 fields\n"}], + {ERR=>"$prog: invalid input: field 4 requested, " . + "line 1 has only 3 fields\n"}], ['e13', '-t" " sum 6' , {IN_PIPE=>$in_g3}, {EXIT=>1}, - {ERR=>"$prog: invalid input: field 6 requested, " . - "line 1 has only 3 fields\n"}], + {ERR=>"$prog: invalid input: field 6 requested, " . + "line 1 has only 3 fields\n"}], ['e14', '--header-in -t: sum 6' , {IN_PIPE=>$in_hdr2}, {EXIT=>1}, - {ERR=>"$prog: invalid input: field 6 requested, " . - "line 2 has only 3 fields\n"}], + {ERR=>"$prog: invalid input: field 6 requested, " . + "line 2 has only 3 fields\n"}], ['e15', 'sum foo' , {IN_PIPE=>"a"}, {EXIT=>1}, - {ERR=>"$prog: -H or --header-in must be used with named columns\n"}], + {ERR=>"$prog: -H or --header-in must be used with named columns\n"}], ['e16', '-t" " sum 2' , {IN_PIPE=>$in_invalid_num1}, {EXIT=>1}, - {ERR=>"$prog: invalid numeric value in line 3 field 2: '3a'\n"}], + {ERR=>"$prog: invalid numeric value in line 3 field 2: '3a'\n"}], ['e17', 'sum 1' , {IN_PIPE=>"1e-20000\n"}, {EXIT=>1}, - {ERR=>"$prog: invalid numeric value in line 1 field 1: '1e-20000'\n"}], + {ERR=>"$prog: invalid numeric value in line 1 field 1: '1e-20000'\n"}], ['e18', 'sum 0' , {IN_PIPE=>"a"}, {EXIT=>1}, - {ERR=>"$prog: invalid field '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 field range for operation 'sum'\n"}], + {ERR=>"$prog: invalid field range for operation 'sum'\n"}], ['e21', 'sum ""' , {IN_PIPE=>"a"}, {EXIT=>1}, - {ERR=>"$prog: missing field 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"}], + {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 field '-' for operation 'groupby'\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"}], + {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: missing field for operation 'groupby'\n"}], + {ERR=>"$prog: missing field for operation 'groupby'\n"}], + ['e26', '--collapse-delimiter=foo', {IN_PIPE=>"a\n"}, {EXIT=>1}, + {ERR=>"$prog: the delimiter must be a single character\n"}], + ['e27', '-c foo', {IN_PIPE=>"a\n"}, {EXIT=>1}, + {ERR=>"$prog: the delimiter must be a single character\n"}], # No newline at the end of the lines ['nl1', 'sum 1', {IN_PIPE=>"99"}, {OUT=>"99\n"}], @@ -439,15 +468,8 @@ # empty input = empty output, regardless of options [ 'emp1', 'count 1', {IN_PIPE=>""}, {OUT=>""}], - [ 'emp2', '--full count 2', {IN_PIPE=>""},{OUT=>""}], [ 'emp3', '--header-in count 2', {IN_PIPE=>""},{OUT=>""}], [ 'emp4', '--header-out count 2', {IN_PIPE=>""},{OUT=>""}], - [ 'emp5', '--full --header-in count 2', {IN_PIPE=>""},{OUT=>""}], - [ 'emp6', '--full --header-out count 2', {IN_PIPE=>""},{OUT=>""}], - [ 'emp7', '--full --header-in --header-out count 2', - {IN_PIPE=>""},{OUT=>""}], - [ 'emp8', '-g3,4 --full --header-in --header-out count 2', - {IN_PIPE=>""},{OUT=>""}], [ 'emp9', '-g3 count 2', {IN_PIPE=>""},{OUT=>""}], ## Field extraction @@ -483,6 +505,40 @@ ['f23', '-t: -g1 sum 2', {IN_PIPE=>$in_empty1}, {EXIT=>1}, {ERR=>"$prog: invalid numeric value in line 1 field 2: ''\n"}], + # whitespace only, different field delimiters + ['ws1.1', 'check', {IN_PIPE=>$ws1}, {OUT=>"1 line, 4 fields\n"}], + ['ws1.2', '-W check', {IN_PIPE=>$ws1}, {OUT=>"1 line, 1 field\n"}], + ['ws1.3', '-t: check', {IN_PIPE=>$ws1}, {OUT=>"1 line, 1 field\n"}], + ['ws2.1', 'check', {IN_PIPE=>$ws2}, {OUT=>"1 line, 2 fields\n"}], + ['ws2.2', '-W check', {IN_PIPE=>$ws2}, {OUT=>"1 line, 1 field\n"}], + ['ws2.3', '-t: check', {IN_PIPE=>$ws2}, {OUT=>"1 line, 1 field\n"}], + + # leading whitespace, different field delimiters + ['lws1.1', 'check', {IN_PIPE=>$lws1}, {OUT=>"1 line, 3 fields\n"}], + ['lws1.2', '-W check', {IN_PIPE=>$lws1}, {OUT=>"1 line, 1 field\n"}], + ['lws1.3', '-t: check', {IN_PIPE=>$lws1}, {OUT=>"1 line, 1 field\n"}], + ['lws2.1', 'check', {IN_PIPE=>$lws2}, {OUT=>"1 line, 2 fields\n"}], + ['lws2.2', '-W check', {IN_PIPE=>$lws2}, {OUT=>"1 line, 1 field\n"}], + ['lws2.3', '-t: check', {IN_PIPE=>$lws2}, {OUT=>"1 line, 1 field\n"}], + + # trailing whitespace, different field delimiters + ['tws1.1', 'check', {IN_PIPE=>$tws1}, {OUT=>"1 line, 3 fields\n"}], + ['tws1.2', '-W check', {IN_PIPE=>$tws1}, {OUT=>"1 line, 2 fields\n"}], + ['tws1.3', '-t: check', {IN_PIPE=>$tws1}, {OUT=>"1 line, 1 field\n"}], + ['tws2.1', 'check', {IN_PIPE=>$tws2}, {OUT=>"1 line, 2 fields\n"}], + ['tws2.2', '-W check', {IN_PIPE=>$tws2}, {OUT=>"1 line, 2 fields\n"}], + ['tws2.3', '-t: check', {IN_PIPE=>$tws2}, {OUT=>"1 line, 1 field\n"}], + + # both leading and trailing whitespace, different field delimiters + ['ltws1.1', 'check', {IN_PIPE=>$ltws1}, {OUT=>"1 line, 5 fields\n"}], + ['ltws1.2', '-W check', {IN_PIPE=>$ltws1}, {OUT=>"1 line, 2 fields\n"}], + ['ltws1.3', '-t: check', {IN_PIPE=>$ltws1}, {OUT=>"1 line, 1 field\n"}], + ['ltws2.1', 'check', {IN_PIPE=>$ltws2}, {OUT=>"1 line, 3 fields\n"}], + ['ltws2.2', '-W check', {IN_PIPE=>$ltws2}, {OUT=>"1 line, 2 fields\n"}], + ['ltws2.3', '-t: check', {IN_PIPE=>$ltws2}, {OUT=>"1 line, 1 field\n"}], + ['ltws3.1', 'check', {IN_PIPE=>$ltws3}, {OUT=>"1 line, 3 fields\n"}], + ['ltws3.2', '-W check', {IN_PIPE=>$ltws3}, {OUT=>"1 line, 2 fields\n"}], + ['ltws3.3', '-t: check', {IN_PIPE=>$ltws3}, {OUT=>"1 line, 2 fields\n"}], # Test Absolute min/max ['mm1', 'min 1', {IN_PIPE=>$in_minmax}, {OUT=>"-700\n"}], @@ -498,107 +554,86 @@ ['g1.1', '-t" " -g1 sum 2', {IN_PIPE=>$in_g1}, {OUT=>"A 195\n"}], ['g2.1', '-t" " -g1 median 2', {IN_PIPE=>$in_g1}, {OUT=>"A 42.5\n"}], ['g3.1', '-t" " -g1 collapse 2', {IN_PIPE=>$in_g1}, - {OUT=>"A 100,10,50,35\n"}], + {OUT=>"A 100,10,50,35\n"}], ['g4.1', '-t" " -g1 count 2', {IN_PIPE=>$in_g5}, - {OUT=>"A 1\nAA 1\nAAA 1\n"}], + {OUT=>"A 1\nAA 1\nAAA 1\n"}], # Group on the last column ['grp5', '-t" " -g3 count 1', {IN_PIPE=>$in_hdr1}, - {OUT=>"z 1\n10 6\n20 1\n30 1\n11 1\n22 1\n33 1\n44 1\n"}], + {OUT=>"z 1\n10 6\n20 1\n30 1\n11 1\n22 1\n33 1\n44 1\n"}], # 3 groups, single line per group, custom delimiter ['g7.1', '-g2 -t= mode 1', {IN_PIPE=>"1=A\n2=B\n3=C\n"}, - {OUT=>"A=1\nB=2\nC=3\n"}], + {OUT=>"A=1\nB=2\nC=3\n"}], # Multiple keys (from different columns) ['g8.1', '-t" " -g1,3 sum 2', {IN_PIPE=>$in_g3}, - {OUT=>"A W 15\nA X 24\nB Y 17\nB Z 19\nC Z 23\n"}], - + {OUT=>"A W 15\nA X 24\nB Y 17\nB Z 19\nC Z 23\n"}], - # --full option - without grouping, returns the first line - ['fl1', '-t" " --full sum 2', {IN_PIPE=>$in_g3}, - {OUT=>"A 3 W 98\n"}], - # --full with grouping - print entire line of each group - ['fl2', '-t" " --full -g3 sum 2', {IN_PIPE=>$in_g3}, - {OUT=>"A 3 W 15\nA 11 X 24\nB 17 Y 17\nB 19 Z 42\n"}], # count on non-numeric fields ['cnt1', '-t" " -g 1 count 1', {IN_PIPE=>$in_g2}, - {OUT=>"A 4\nB 3\n"}], + {OUT=>"A 4\nB 3\n"}], # Input Header ['hdr1', '-t" " -g 1 --header-in count 2',{IN_PIPE=>$in_hdr1}, - {OUT=>"A 5\nB 3\nC 4\n"}], + {OUT=>"A 5\nB 3\nC 4\n"}], # Input and output header ['hdr2', '-t" " -g 1 --header-in --header-out count 2',{IN_PIPE=>$in_hdr1}, - {OUT=>"GroupBy(x) count(y)\nA 5\nB 3\nC 4\n"}], - - # Input and output header, with full line - ['hdr3', '-t" " -g 1 --full --header-in --header-out count 2', - {IN_PIPE=>$in_hdr1}, - {OUT=>"x y z count(y)\nA 1 10 5\nB 5 10 3\nC 8 11 4\n"}], + {OUT=>"GroupBy(x) count(y)\nA 5\nB 3\nC 4\n"}], # Output Header ['hdr4', '-t" " -g 1 --header-out count 2', {IN_PIPE=>$in_g3}, - {OUT=>"GroupBy(field-1) count(field-2)\nA 5\nB 2\nC 1\n"}], - - # Output Header with --full - ['hdr5', '-t" " -g 1 --full --header-out count 2', {IN_PIPE=>$in_g3}, - {OUT=>"field-1 field-2 field-3 count(field-2)\n" . - "A 3 W 5\nB 17 Y 2\nC 23 Z 1\n"}], + {OUT=>"GroupBy(field-1) count(field-2)\nA 5\nB 2\nC 1\n"}], # Header without grouping ['hdr6', '-t" " --header-out count 2', {IN_PIPE=>$in_g3}, - {OUT=>"count(field-2)\n8\n"}], + {OUT=>"count(field-2)\n8\n"}], # Output Header, multiple ops ['hdr7', '-t" " -g 1 --header-out count 2 unique 3', {IN_PIPE=>$in_g3}, - {OUT=>"GroupBy(field-1) count(field-2) unique(field-3)\n" . - "A 5 W,X\nB 2 Y,Z\nC 1 Z\n"}], + {OUT=>"GroupBy(field-1) count(field-2) unique(field-3)\n" . + "A 5 W,X\nB 2 Y,Z\nC 1 Z\n"}], # Headers, non white-space separator ['hdr8', '-g 1 -H -t: count 2 unique 3', {IN_PIPE=>$in_hdr2}, - {OUT=>"GroupBy(x):count(y):unique(z)\nA:5:W,X\nB:2:Y,Z\nC:1:Z\n"}], + {OUT=>"GroupBy(x):count(y):unique(z)\nA:5:W,X\nB:2:Y,Z\nC:1:Z\n"}], # Headers, non white-space separator, 3 operations ['hdr9', '-g 1 -H -t: count 2 unique 3 sum 2', {IN_PIPE=>$in_hdr2}, - {OUT=>"GroupBy(x):count(y):unique(z):sum(y)\n" . - "A:5:W,X:39\nB:2:Y,Z:36\nC:1:Z:23\n"}], + {OUT=>"GroupBy(x):count(y):unique(z):sum(y)\n" . + "A:5:W,X:39\nB:2:Y,Z:36\nC:1:Z:23\n"}], # Headers, white-space separator, 3 operations ['hdr10', '-W -g 1 --header-in --header-out count 2',{IN_PIPE=>$in_hdr3}, - {OUT=>"GroupBy(x)\tcount(y)\nA\t5\nB\t3\nC\t4\n"}], + {OUT=>"GroupBy(x)\tcount(y)\nA\t5\nB\t3\nC\t4\n"}], # Group + output headers on the last column ['hdr11', '-t" " --header-out -g3 count 1', {IN_PIPE=>$in_hdr1}, - {OUT=>"GroupBy(field-3) count(field-1)\n" . - "z 1\n10 6\n20 1\n30 1\n11 1\n22 1\n33 1\n44 1\n"}], + {OUT=>"GroupBy(field-3) count(field-1)\n" . + "z 1\n10 6\n20 1\n30 1\n11 1\n22 1\n33 1\n44 1\n"}], # Group + input headers on last column ['hdr12', '-t" " --header-in -g3 count 1', {IN_PIPE=>$in_hdr1}, - {OUT=>"10 6\n20 1\n30 1\n11 1\n22 1\n33 1\n44 1\n"}], + {OUT=>"10 6\n20 1\n30 1\n11 1\n22 1\n33 1\n44 1\n"}], # Group + input/output headers on last column ['hdr13', '-t" " -H -g3 count 1', {IN_PIPE=>$in_hdr1}, - {OUT=>"GroupBy(z) count(x)\n10 6\n20 1\n30 1\n11 1\n22 1\n33 1\n44 1\n"}], + {OUT=>"GroupBy(z) count(x)\n10 6\n20 1\n30 1\n11 1\n22 1\n33 1\n44 1\n"}], # Input has only one header line (no data lines), and the user requested # header-in and header-out => header line should be printed ['hdr14', '-t: -H sum 1', {IN_PIPE=>$in_hdr_only}, - {OUT=>"sum(X)\n"}], - ['hdr15', '-t: --full -H sum 1', {IN_PIPE=>$in_hdr_only}, - {OUT=>"X:Y:Z:sum(X)\n"}], + {OUT=>"sum(X)\n"}], ['hdr16', '-t: -s -g1 -H sum 2', {IN_PIPE=>$in_hdr_only}, - {OUT=>"GroupBy(X):sum(Y)\n"}], - ['hdr17', '-t: --full -s -g1 -H sum 2', {IN_PIPE=>$in_hdr_only}, - {OUT=>"X:Y:Z:sum(Y)\n"}], + {OUT=>"GroupBy(X):sum(Y)\n"}], ['hdr18', '-t: --header-in sum 1', {IN_PIPE=>$in_hdr_only}, - {OUT=>""}], + {OUT=>""}], ['hdr19', '-t: -H reverse', {IN_PIPE=>$in_hdr_only}, - {OUT=>"Z:Y:X\n"}], + {OUT=>"Z:Y:X\n"}], ['hdr20', '-t: --header-in reverse', {IN_PIPE=>$in_hdr_only}, - {OUT=>""}], + {OUT=>""}], ['hdr21', '-t: -H rmdup 1', {IN_PIPE=>$in_hdr_only}, - {OUT=>$in_hdr_only}], + {OUT=>$in_hdr_only}], ['hdr22', '-t: --header-in rmdup 1', {IN_PIPE=>$in_hdr_only}, - {OUT=>""}], + {OUT=>""}], ['hdr23', '-t: --header-in rmdup 1', {IN_PIPE=>""}, {OUT=>""}], ['hdr24', '-t: -H rmdup 1', {IN_PIPE=>""}, {OUT=>""}], @@ -611,22 +646,20 @@ # Test single line per group ['sl1', '-t" " -g 1 mean 2', {IN_PIPE=>$in_g4}, - {OUT=>"A 5\nK 6\nP 2\n"}], - ['sl2', '-t" " --full -g 1 mean 2', {IN_PIPE=>$in_g4}, - {OUT=>"A 5 5\nK 6 6\nP 2 2\n"}], + {OUT=>"A 5\nK 6\nP 2\n"}], # Test countunique operation ['cuq1', '-t" " -g 1 countunique 3', {IN_PIPE=>$in_g3}, - {OUT=>"A 2\nB 2\nC 1\n"}], + {OUT=>"A 2\nB 2\nC 1\n"}], ['cuq2', '-t" " -g 1 countunique 2', {IN_PIPE=>$in_g4}, - {OUT=>"A 1\nK 1\nP 1\n"}], + {OUT=>"A 1\nK 1\nP 1\n"}], ['cuq3', '-t" " --header-in -g 1 countunique 2', {IN_PIPE=>$in_cnt_uniq1}, - {OUT=>"A 2\nB 2\n"}], + {OUT=>"A 2\nB 2\n"}], # countunique, case-insensitive ['cuq4', '-t" " -g 1 countunique 2', {IN_PIPE=>$in_cnt_uniq2}, - {OUT=>"a 1\nA 3\n"}], + {OUT=>"a 1\nA 3\n"}], ['cuq5', '-i -t" " -g 1 countunique 2', {IN_PIPE=>$in_cnt_uniq2}, - {OUT=>"a 2\n"}], + {OUT=>"a 2\n"}], # Test Tab vs White-space field separator ['tab1', "sum 2", {IN_PIPE=>$in_tab1}, {OUT=>"60\n"}], @@ -635,58 +668,50 @@ # Test Auto-Sorting # With default separator (White-space), the second column is A,B,C,D ['sort1', '-W -s -g 2 unique 3', {IN_PIPE=>$in_sort1}, - {OUT=>"A\tx\nB\tk,x\nC\tg,j\nD\tj\n"}], + {OUT=>"A\tx\nB\tk,x\nC\tg,j\nD\tj\n"}], # With TAB separator, the second column is g,j,k,x ['sort2', '-s -g 2 unique 3', {IN_PIPE=>$in_sort1}, - {OUT=>"g\t6\nj\t3,4\nk\t2\nx\t1,5\n"}], + {OUT=>"g\t6\nj\t3,4\nk\t2\nx\t1,5\n"}], # Control check: if we do not sort, the some groups will appear twice # because the input is not sorted. ['sort3', '-g 2 unique 3', {IN_PIPE=>$in_sort1}, - {OUT=>"x\t1\nk\t2\nj\t3\nx\t5\nj\t4\ng\t6\n"}], + {OUT=>"x\t1\nk\t2\nj\t3\nx\t5\nj\t4\ng\t6\n"}], ['sort4', '-s -g 1 sum 2 -t "\'" ', {IN_PIPE=>$in_sort_quote1}, - {OUT=>"A'4\nB'6\n"}], + {OUT=>"A'4\nB'6\n"}], ['sort5', '-s -g 1 sum 2 -t "\"" ', {IN_PIPE=>$in_sort_quote2}, - {OUT=>"A\"4\nB\"6\n"}], - -#my $in_sort_quote1=<<"EOF"; -#A'1 -#B'2 -#A'3 -#B'4 -#EOF - + {OUT=>"A\"4\nB\"6\n"}], # Test Case-sensitivity, on sorted input (no 'sort' piping) # on both grouping and string operations ['case1', '-t" " -g 1 sum 3', {IN_PIPE=>$in_case_sorted}, - {OUT=>"a 4\nA 7\nb 4\nB 6\n"}], + {OUT=>"a 4\nA 7\nb 4\nB 6\n"}], ['case2', '-t" " -i -g 1 sum 3', {IN_PIPE=>$in_case_sorted}, - {OUT=>"a 11\nb 10\n"}], + {OUT=>"a 11\nb 10\n"}], ['case3', '-t" " -g 1 unique 2', {IN_PIPE=>$in_case_sorted}, - {OUT=>"a X,x\nA X,x\nb Y\nB Y\n"}], + {OUT=>"a X,x\nA X,x\nb Y\nB Y\n"}], ['case4', '-t" " -i -g 1 unique 2', {IN_PIPE=>$in_case_sorted}, - {OUT=>"a X\nb Y\n"}], + {OUT=>"a X\nb Y\n"}], ['case4.1', '-i -t" " -g 1 unique 2', {IN_PIPE=>$in_cnt_uniq2}, - {OUT=>"a B,C\n"}], + {OUT=>"a B,C\n"}], # Test Case-sensitivity, on non-sorted input (with 'sort' piping) # on both grouping and string operations. ['case5', '-t" " -s -g 1 sum 3', {IN_PIPE=>$in_case_unsorted}, - {OUT=>"A 7\nB 6\na 4\nb 4\n"}], + {OUT=>"A 7\nB 6\na 4\nb 4\n"}], ['case6', '-t" " -s -g 1 unique 2', {IN_PIPE=>$in_case_unsorted}, - {OUT=>"A X,x\nB Y\na X,x\nb Y\n"}], + {OUT=>"A X,x\nB Y\na X,x\nb Y\n"}], ## Test nul-terminated lines ['nul1', '-t" " -z -g 1 sum 2', {IN_PIPE=>$in_nul1}, - {OUT=>"A 3\x00B 7\x00"}], + {OUT=>"A 3\x00B 7\x00"}], ['nul2', '-t" " --zero-terminated -g 1 sum 2', {IN_PIPE=>$in_nul1}, - {OUT=>"A 3\x00B 7\x00"}], + {OUT=>"A 3\x00B 7\x00"}], # Test --help (but don't verify the output) ['help1', '--help', {IN_PIPE=>""}, {OUT => ""}, - {OUT_SUBST=>'s/^.*//gms'}], + {OUT_SUBST=>'s/^.*//gms'}], ['ver1', '--version', {IN_PIPE=>""}, {OUT => ""}, - {OUT_SUBST=>'s/^.*//gms'}], + {OUT_SUBST=>'s/^.*//gms'}], # Test output precision (number of digits) for numerical operations. # The current precision is 14 digits (hard-coded). @@ -708,31 +733,31 @@ ['fst3', '-t" " -g 1 first 2', {IN_PIPE=>$in_g2}, {OUT=>"A 100\nB 66\n"}], ['fst4', '-t" " -g 1 first 2', {IN_PIPE=>$in_g4}, {OUT=>"A 5\nK 6\nP 2\n"}], ['fst5', '-t" " -g 1 first 2', {IN_PIPE=>$in_large_buffer1}, - {OUT=>"A 1\nB 3\n"}], + {OUT=>"A 1\nB 3\n"}], ['fst6', '-t" " -g 1 first 2', {IN_PIPE=>$in_large_buffer2}, - {OUT=>$out_large_buffer_first}], + {OUT=>$out_large_buffer_first}], ['lst1', '-t" " last 2', {IN_PIPE=>$in_g1}, {OUT=>"35\n"}], ['lst2', '-t" " -g 1 last 2', {IN_PIPE=>$in_g1}, {OUT=>"A 35\n"}], ['lst3', '-t" " -g 1 last 2', {IN_PIPE=>$in_g2}, {OUT=>"A 35\nB 55\n"}], ['lst4', '-t" " -g 1 last 2', {IN_PIPE=>$in_g4}, {OUT=>"A 5\nK 6\nP 2\n"}], ['lst5', '-t" " -g 1 last 2', {IN_PIPE=>$in_large_buffer1}, - {OUT=>"A 2\nB 4\n"}], + {OUT=>"A 2\nB 4\n"}], ['lst6', '-t" " -g 1 last 2', {IN_PIPE=>$in_large_buffer2}, - {OUT=>$out_large_buffer_last}], + {OUT=>$out_large_buffer_last}], ## Test md5/sha1/sha256/sha512 operations. ## NOTE: this just ensures the operations don't fail, and produces the ## expected length of output strings. ## validation of the calculation is tested in datamash-{md5,sha}.pl. ['md5-1', '-W md5 2', {IN_PIPE=>$in_g1}, - {OUT_SUBST=>'s/^[a-f0-9]{32}$//'}, {OUT=>"\n\n\n\n"}], + {OUT_SUBST=>'s/^[a-f0-9]{32}$//'}, {OUT=>"\n\n\n\n"}], ['sha1-1', '-W sha1 2', {IN_PIPE=>$in_g1}, - {OUT_SUBST=>'s/^[a-f0-9]{40}$//'}, {OUT=>"\n\n\n\n"}], + {OUT_SUBST=>'s/^[a-f0-9]{40}$//'}, {OUT=>"\n\n\n\n"}], ['sha256-1', '-W sha256 2', {IN_PIPE=>$in_g1}, - {OUT_SUBST=>'s/^[a-f0-9]{64}$//'}, {OUT=>"\n\n\n\n"}], + {OUT_SUBST=>'s/^[a-f0-9]{64}$//'}, {OUT=>"\n\n\n\n"}], ['sha512-1', '-W sha512 2', {IN_PIPE=>$in_g1}, - {OUT_SUBST=>'s/^[a-f0-9]{128}$//'}, {OUT=>"\n\n\n\n"}], + {OUT_SUBST=>'s/^[a-f0-9]{128}$//'}, {OUT=>"\n\n\n\n"}], ## Test Base64 ['base64-1','-W base64 2', {IN_PIPE=>$in_g1}, {OUT=>$out_g1_base64}], @@ -767,13 +792,16 @@ ['rmdp5', '-t: --header-in rmdup 1', {IN_PIPE=>$in_dup1}, {OUT=>"1:a\n2:b\n3:a\n"}], ['rmdp6', '-t: rmdup 4', {IN_PIPE=>$in_dup1}, {EXIT=>1}, - {ERR=>"$prog: invalid input: field 4 requested, " . - "line 1 has only 2 fields\n"}], + {ERR=>"$prog: invalid input: field 4 requested, " . + "line 1 has only 2 fields\n"}], ## rmdup with named columns ['rmdp7', '-t: -H rmdup X', {IN_PIPE=>$in_dup1}, {OUT=>"X:Y\n1:a\n2:b\n3:a\n"}], ['rmdp8', '-t: rmdup X', {IN_PIPE=>$in_dup1}, {EXIT=>1}, - {ERR=>"$prog: -H or --header-in must be used with named columns\n"}], + {ERR=>"$prog: -H or --header-in must be used with named columns\n"}], + # rmdup with different output delimiter + ['rmdp9', '-t: --output-delimiter % rmdup 1', {IN_PIPE=>$in_dup1}, + {OUT=>"X%Y\n1%a\n2%b\n3%a\n"}], # Test noop operation ['noop1', 'noop', {IN_PIPE=>""}, {OUT=>""}], @@ -787,20 +815,20 @@ ['nc3', '--header-in sum foo', {IN_PIPE=>""}, {OUT=>""}], ## with named columns, -H or --header-in are required. ['nc1', 'sum foo', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: -H or --header-in must be used with named columns\n"}], + {ERR=>"$prog: -H or --header-in must be used with named columns\n"}], ['nc4', 'sum foo', {IN_PIPE=>$in_hdr1}, {EXIT=>1}, - {ERR=>"$prog: -H or --header-in must be used with named columns\n"}], + {ERR=>"$prog: -H or --header-in must be used with named columns\n"}], ## Invalid column name ['nc5', '--header-in sum foo', {IN_PIPE=>$in_hdr1}, {EXIT=>1}, - {ERR=>"$prog: column name 'foo' not found in input file\n"}], + {ERR=>"$prog: column name 'foo' not found in input file\n"}], ['nc6', '-H sum foo', {IN_PIPE=>$in_hdr1}, {EXIT=>1}, - {ERR=>"$prog: column name 'foo' not found in input file\n"}], + {ERR=>"$prog: column name 'foo' not found in input file\n"}], ## Valid column names, and identical column number ['nc7', '-t" " -H sum y sum 2', {IN_PIPE=>$in_hdr1}, - {OUT=>"sum(y) sum(y)\n52 52\n"}], + {OUT=>"sum(y) sum(y)\n52 52\n"}], ## Valid column names + sorting ['nc8', '-s -g 1 -t" " -H sum y', {IN_PIPE=>$in_hdr1}, - {OUT=>"GroupBy(x) sum(y)\nA 14\nB 18\nC 20\n"}], + {OUT=>"GroupBy(x) sum(y)\nA 14\nB 18\nC 20\n"}], # Test named columns - for grouping ## with empty input, invalid column name is not an error @@ -808,53 +836,53 @@ ['ng2', '--header-in -g foo sum foo', {IN_PIPE=>""}, {OUT=>""}], ## with named columns, -H or --header-in are required ['ng3', '-g foo count 1', {IN_PIPE=>""}, {EXIT=>1}, - {ERR=>"$prog: -H or --header-in must be used with named columns\n"}], + {ERR=>"$prog: -H or --header-in must be used with named columns\n"}], ['ng4', '-g foo count 1', {IN_PIPE=>$in_hdr1}, {EXIT=>1}, - {ERR=>"$prog: -H or --header-in must be used with named columns\n"}], + {ERR=>"$prog: -H or --header-in must be used with named columns\n"}], ## Invalid column name ['ng5', '--header-in -g foo sum 1', {IN_PIPE=>$in_hdr1}, {EXIT=>1}, - {ERR=>"$prog: column name 'foo' not found in input file\n"}], + {ERR=>"$prog: column name 'foo' not found in input file\n"}], ['ng6', '-H -g foo sum 1', {IN_PIPE=>$in_hdr1}, {EXIT=>1}, - {ERR=>"$prog: column name 'foo' not found in input file\n"}], + {ERR=>"$prog: column name 'foo' not found in input file\n"}], ## Valid column names in grouping ['ng7', '-t" " -H -g x sum 2', {IN_PIPE=>$in_hdr1}, - {OUT=>"GroupBy(x) sum(y)\nA 14\nB 18\nC 20\n"}], + {OUT=>"GroupBy(x) sum(y)\nA 14\nB 18\nC 20\n"}], ## group by name+number ['ng8', '-t":" -H -g x,3 sum 2', {IN_PIPE=>$in_hdr2}, - {OUT=>"GroupBy(x):GroupBy(z):sum(y)\n" . - "A:W:15\nA:X:24\nB:Y:17\nB:Z:19\nC:Z:23\n"}], + {OUT=>"GroupBy(x):GroupBy(z):sum(y)\n" . + "A:W:15\nA:X:24\nB:Y:17\nB:Z:19\nC:Z:23\n"}], ## group by name+name ['ng9', '-t":" -H -g x,z sum 2', {IN_PIPE=>$in_hdr2}, - {OUT=>"GroupBy(x):GroupBy(z):sum(y)\n" . - "A:W:15\nA:X:24\nB:Y:17\nB:Z:19\nC:Z:23\n"}], + {OUT=>"GroupBy(x):GroupBy(z):sum(y)\n" . + "A:W:15\nA:X:24\nB:Y:17\nB:Z:19\nC:Z:23\n"}], ## group by number+name ['ng10', '-t":" -H -g 1,z sum 2', {IN_PIPE=>$in_hdr2}, - {OUT=>"GroupBy(x):GroupBy(z):sum(y)\n" . - "A:W:15\nA:X:24\nB:Y:17\nB:Z:19\nC:Z:23\n"}], + {OUT=>"GroupBy(x):GroupBy(z):sum(y)\n" . + "A:W:15\nA:X:24\nB:Y:17\nB:Z:19\nC:Z:23\n"}], ## group by name + sorting ['ng11', '-s -t" " -H -g x sum 2', {IN_PIPE=>$in_hdr1}, - {OUT=>"GroupBy(x) sum(y)\nA 14\nB 18\nC 20\n"}], + {OUT=>"GroupBy(x) sum(y)\nA 14\nB 18\nC 20\n"}], ); if ($have_stable_sort) { push @Tests, ( # last with sort, test the 'stable' sort ['lst7', '-t" " --sort -g 1 last 3', {IN_PIPE=>$in_case_unsorted}, - {OUT=>"A 5\nB 6\na 3\nb 4\n"}], + {OUT=>"A 5\nB 6\na 3\nb 4\n"}], ['lst8', '-t" " --sort -i -g 1 last 3', {IN_PIPE=>$in_case_unsorted}, - {OUT=>"A 5\nB 6\n"}], + {OUT=>"A 5\nB 6\n"}], # First with sort, test the 'stable' sort ['fst7', '-t" " --sort -g 1 first 3', {IN_PIPE=>$in_case_unsorted}, - {OUT=>"A 2\nB 6\na 1\nb 4\n"}], + {OUT=>"A 2\nB 6\na 1\nb 4\n"}], ['fst8', '-t" " --sort -i -g 1 first 3', {IN_PIPE=>$in_case_unsorted}, - {OUT=>"a 1\nb 4\n"}], + {OUT=>"a 1\nb 4\n"}], # NOTE: 'sort' is used with '-s' (stable sort), # so with case-insensitive sort, the first appearing letter is # reported (the lowercase a/b in case7 & case8). ['case7', '-t" " -s -i -g 1 sum 3', {IN_PIPE=>$in_case_unsorted}, - {OUT=>"a 11\nb 10\n"}], + {OUT=>"a 11\nb 10\n"}], ['case8', '-t" " -s -i -g 1 unique 2', {IN_PIPE=>$in_case_unsorted}, - {OUT=>"a X\nb Y\n"}], + {OUT=>"a X\nb Y\n"}], ); } diff -Nru datamash-1.7/tests/datamash-transpose.pl datamash-1.8/tests/datamash-transpose.pl --- datamash-1.7/tests/datamash-transpose.pl 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/tests/datamash-transpose.pl 2022-06-17 23:58:29.000000000 +0000 @@ -4,7 +4,7 @@ Tests for 'transpose' and 'reverse' operation modes. - Copyright (C) 2013-2020 Assaf Gordon + Copyright (C) 2013-2021 Assaf Gordon This file is part of GNU Datamash. @@ -149,75 +149,77 @@ my @Tests = ( - # Simple transpose and reverse - ['tr1', 'transpose', {IN_PIPE=>$in1}, {OUT=>$out1_tr}], - ['rev1', 'reverse', {IN_PIPE=>$in1}, {OUT=>$out1_rev}], - - # non-tab delimiter - ['tr2', '-t: transpose', {IN_PIPE=>$in2}, {OUT=>$out2_tr}], - ['rev2', '-t: reverse', {IN_PIPE=>$in2}, {OUT=>$out2_rev}], - - # missing fields, strict mode - ['tr3', 'transpose', {IN_PIPE=>$in3}, {EXIT=>1}, - {OUT_SUBST=>'s/.*//'}, - {ERR=>"$prog: transpose input error: line 2 has 1 fields ". - "(previous lines had 2);\nsee --help to disable strict mode\n"}], - ['rev3', 'reverse', {IN_PIPE=>$in3}, {EXIT=>1}, - {OUT_SUBST=>'s/.*//s'}, - {ERR=>"$prog: reverse-field input error: line 2 has 1 fields ". - "(previous lines had 2);\nsee --help to disable strict mode\n"}], - - # missing fields, non-strict mode - ['tr4', '--no-strict transpose', {IN_PIPE=>$in3}, {OUT=>$out3_tr}], - ['rev4', '--no-strict reverse', {IN_PIPE=>$in3}, {OUT=>$out3_rev}], - ['tr4.1', '--no-strict --filler xxx transpose', - {IN_PIPE=>$in3}, {OUT=>$out3_filler_tr}], - - - # Single column - ['tr5', 'transpose', {IN_PIPE=>$in4}, {OUT=>$out4_tr}], - ['rev5', 'reverse', {IN_PIPE=>$in4}, {OUT=>$out4_rev}], - - # Single row - ['tr6', 'transpose', {IN_PIPE=>$in5}, {OUT=>$out5_tr}], - ['rev6', 'reverse', {IN_PIPE=>$in5}, {OUT=>$out5_rev}], - - # Single field - ['tr7', 'transpose', {IN_PIPE=>$in6}, {OUT=>$in6}], - ['rev7', 'reverse', {IN_PIPE=>$in6}, {OUT=>$in6}], - - # Empty input - ['tr8', 'transpose', {IN_PIPE=>$in7}, {OUT=>""}], - ['rev8', 'reverse', {IN_PIPE=>$in7}, {OUT=>""}], - - # Extra operands - ['tr9', 'transpose aaa', {IN_PIPE=>''}, {EXIT=>1}, - {ERR=>"$prog: extra operand 'aaa'\n"}], - ['rev9', 'reverse aaa', {IN_PIPE=>''}, {EXIT=>1}, - {ERR=>"$prog: extra operand 'aaa'\n"}], - - # empty input - ['tr10', 'transpose', {IN_PIPE=>""}, {OUT=>""}], - ['rev10', 'reverse', {IN_PIPE=>""}, {OUT=>""}], - - # Reverse with header combinations - ['rev-hdr1','-H reverse', {IN_PIPE=>""}, {OUT=>""}], - ['rev-hdr2','--header-in reverse', {IN_PIPE=>""}, {OUT=>""}], - ['rev-hdr3','-t: reverse', {IN_PIPE=>$in_hdr1}, - {OUT=>"Y:X\na:1\nb:2\n"}], - ['rev-hdr4','-t: -H reverse', {IN_PIPE=>$in_hdr1}, - {OUT=>"Y:X\na:1\nb:2\n"}], - # first line is header line, discard it (there's no --header-out). - ['rev-hdr5','-t: --header-in reverse', {IN_PIPE=>$in_hdr1}, - {OUT=>"a:1\nb:2\n"}], - # 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}], + # Simple transpose and reverse + ['tr1', 'transpose', {IN_PIPE=>$in1}, {OUT=>$out1_tr}], + ['rev1', 'reverse', {IN_PIPE=>$in1}, {OUT=>$out1_rev}], + + # non-tab delimiter + ['tr2', '-t: transpose', {IN_PIPE=>$in2}, {OUT=>$out2_tr}], + ['rev2', '-t: reverse', {IN_PIPE=>$in2}, {OUT=>$out2_rev}], + + # missing fields, strict mode + ['tr3', 'transpose', {IN_PIPE=>$in3}, {EXIT=>1}, + {OUT_SUBST=>'s/.*//'}, + {ERR=>"$prog: transpose input error: line 2 has 1 fields ". + "(previous lines had 2);\n" . + "see --help to disable strict mode\n"}], + ['rev3', 'reverse', {IN_PIPE=>$in3}, {EXIT=>1}, + {OUT_SUBST=>'s/.*//s'}, + {ERR=>"$prog: reverse-field input error: line 2 has 1 fields ". + "(previous lines had 2);\n" . + "see --help to disable strict mode\n"}], + + # missing fields, non-strict mode + ['tr4', '--no-strict transpose', {IN_PIPE=>$in3}, {OUT=>$out3_tr}], + ['rev4', '--no-strict reverse', {IN_PIPE=>$in3}, {OUT=>$out3_rev}], + ['tr4.1', '--no-strict --filler xxx transpose', + {IN_PIPE=>$in3}, {OUT=>$out3_filler_tr}], + + + # Single column + ['tr5', 'transpose', {IN_PIPE=>$in4}, {OUT=>$out4_tr}], + ['rev5', 'reverse', {IN_PIPE=>$in4}, {OUT=>$out4_rev}], + + # Single row + ['tr6', 'transpose', {IN_PIPE=>$in5}, {OUT=>$out5_tr}], + ['rev6', 'reverse', {IN_PIPE=>$in5}, {OUT=>$out5_rev}], + + # Single field + ['tr7', 'transpose', {IN_PIPE=>$in6}, {OUT=>$in6}], + ['rev7', 'reverse', {IN_PIPE=>$in6}, {OUT=>$in6}], + + # Empty input + ['tr8', 'transpose', {IN_PIPE=>$in7}, {OUT=>""}], + ['rev8', 'reverse', {IN_PIPE=>$in7}, {OUT=>""}], + + # Extra operands + ['tr9', 'transpose aaa', {IN_PIPE=>''}, {EXIT=>1}, + {ERR=>"$prog: extra operand 'aaa'\n"}], + ['rev9', 'reverse aaa', {IN_PIPE=>''}, {EXIT=>1}, + {ERR=>"$prog: extra operand 'aaa'\n"}], + + # empty input + ['tr10', 'transpose', {IN_PIPE=>""}, {OUT=>""}], + ['rev10', 'reverse', {IN_PIPE=>""}, {OUT=>""}], + + # Reverse with header combinations + ['rev-hdr1','-H reverse', {IN_PIPE=>""}, {OUT=>""}], + ['rev-hdr2','--header-in reverse', {IN_PIPE=>""}, {OUT=>""}], + ['rev-hdr3','-t: reverse', {IN_PIPE=>$in_hdr1}, + {OUT=>"Y:X\na:1\nb:2\n"}], + ['rev-hdr4','-t: -H reverse', {IN_PIPE=>$in_hdr1}, + {OUT=>"Y:X\na:1\nb:2\n"}], + # first line is header line, discard it (there's no --header-out). + ['rev-hdr5','-t: --header-in reverse', {IN_PIPE=>$in_hdr1}, + {OUT=>"a:1\nb:2\n"}], + # 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.7/tests/datamash-valgrind.sh datamash-1.8/tests/datamash-valgrind.sh --- datamash-1.7/tests/datamash-valgrind.sh 2020-04-23 04:29:26.000000000 +0000 +++ datamash-1.8/tests/datamash-valgrind.sh 2022-06-02 20:55:13.000000000 +0000 @@ -2,7 +2,7 @@ # Unit Tests for GNU Datamash - perform simple calculation on input data -# Copyright (C) 2014-2020 Assaf Gordon +# Copyright (C) 2014-2021 Assaf Gordon # # This file is part of GNU Datamash. # @@ -188,9 +188,11 @@ fail=1 ; } ## Test large output formats +## datamash exits with an error on x86, because some numbers in the file "wide" +## are too big for "long double" 80-bit floating point cat wide | valgrind --track-origins=yes --leak-check=full \ - --show-reachable=yes --error-exitcode=1 \ + --show-reachable=yes --error-exitcode=2 \ datamash --format "%05000.5000f" sum 1 > /dev/null || - { warn_ "custom-format failed" ; fail=1 ; } + { test $? -eq 2 && { warn_ "custom-format failed" ; fail=1 ; } ; } Exit $fail diff -Nru datamash-1.7/tests/decorate-errors.pl datamash-1.8/tests/decorate-errors.pl --- datamash-1.7/tests/decorate-errors.pl 2020-04-23 16:39:59.000000000 +0000 +++ datamash-1.8/tests/decorate-errors.pl 2022-06-18 00:02:37.000000000 +0000 @@ -2,7 +2,7 @@ =pod Unit Tests for decorate - Copyright (C) 2020 Assaf Gordon + Copyright (C) 2020-2021 Assaf Gordon This file is part of GNU Datamash. @@ -46,112 +46,139 @@ my @Tests = ( - ['e1','--foo-bar',{ERR=>"$prog: unrecognized option '--foo-bar'\n" . - "Try '$prog --help' for more information.\n"}, - {EXIT=>2}], - ['e2','-k1,1:strlen no-such-file.txt', {EXIT=>2}, - {ERR=>"$prog: no-such-file.txt: No such file or directory\n"}], - ['e3','--decorate -k1,1:strlen no-such-file.txt', {EXIT=>2}, - {ERR=>"$prog: no-such-file.txt: No such file or directory\n"}], - ['e4','--undecorate 2 no-such-file.txt', {EXIT=>2}, - {ERR=>"$prog: no-such-file.txt: No such file or directory\n"}], - - ['e5','-k1,1%', {EXIT=>2}, - {ERR=>"$prog: invalid key specification: " . - "invalid field specification '1,1%'\n"}], - ['e6','-k1,1:', {EXIT=>2}, - {ERR=>"$prog: missing internal conversion function: " . - "invalid field specification '1,1:'\n"}], - ['e7','-k1,1@', {EXIT=>2}, - {ERR=>"$prog: missing external conversion command: " . - "invalid field specification '1,1\@'\n"}], - ['e8','-k1,1@foobar', {EXIT=>2}, - {ERR=>"$prog: external commands are not implemented (yet)\n"}], - ['e9','-k1,1:foobar', {EXIT=>2}, - {ERR=>"$prog: invalid built-in conversion option: " . - "invalid field specification '1,1:foobar'\n"}], - - ## Bad --key=KEYDEF syntax (should be identical to sort's behavior) - ['e10','-k0', {EXIT=>2}, - {ERR=>"$prog: field number is zero: invalid field specification '0'\n"}], - ['e11','-k1.0', {EXIT=>2}, - {ERR=>"$prog: character offset is zero: " . - "invalid field specification '1.0'\n"}], - ['e12','-k1.A', {EXIT=>2}, - {ERR=>"$prog: invalid number after '.': invalid count at start of 'A'\n"}], - ['e13','-k1,0', {EXIT=>2}, - {ERR=>"$prog: field number is zero: invalid field specification '1,0'\n"}], - ['e14','-k1,2.B', {EXIT=>2}, - {ERR=>"$prog: invalid number after '.': invalid count at start of 'B'\n"}], - - - ## sort key ordering aren't allowed with conversion functions - ## (except 'r' for reverse order) - ['e20','-k1b,1:foobar', {EXIT=>2}, - {ERR=>"$prog: $ordering_flags_error_prefix '1b,1:foobar'\n"}], - ['e21','-k1,1b:foobar', {EXIT=>2}, - {ERR=>"$prog: $ordering_flags_error_prefix '1,1b:foobar'\n"}], - ['e22','-k1f,1:foobar', {EXIT=>2}, - {ERR=>"$prog: $ordering_flags_error_prefix '1f,1:foobar'\n"}], - ['e23','-k1d,1:foobar', {EXIT=>2}, - {ERR=>"$prog: $ordering_flags_error_prefix '1d,1:foobar'\n"}], - ['e24','-k1n,1:foobar', {EXIT=>2}, - {ERR=>"$prog: $ordering_flags_error_prefix '1n,1:foobar'\n"}], - ['e25','-k1g,1:foobar', {EXIT=>2}, - {ERR=>"$prog: $ordering_flags_error_prefix '1g,1:foobar'\n"}], - ['e26','-k1M,1:foobar', {EXIT=>2}, - {ERR=>"$prog: $ordering_flags_error_prefix '1M,1:foobar'\n"}], - ['e27','-k1h,1:foobar', {EXIT=>2}, - {ERR=>"$prog: $ordering_flags_error_prefix '1h,1:foobar'\n"}], - ['e28','-k1V,1:foobar', {EXIT=>2}, - {ERR=>"$prog: $ordering_flags_error_prefix '1V,1:foobar'\n"}], - ['e29','-k1,1R:foobar', {EXIT=>2}, - {ERR=>"$prog: $ordering_flags_error_prefix '1,1R:foobar'\n"}], - - - ['e40','-t "" -k1,1:foobar', {EXIT=>2}, - {ERR=>"$prog: empty tab\n"}], - ['e41','-tab -k1,1:foobar', {EXIT=>2}, - {ERR=>"$prog: multi-character tab 'ab'\n"}], - ['e42','-t: -t, -k1,1:foobar', {EXIT=>2}, - {ERR=>"$prog: incompatible tabs\n"}], - - - ['e50','--undecorate 0', {EXIT=>2}, - {ERR=>"$prog: invalid number of fields to undecorate '0'\n"}], - ['e51','--undecorate A', {EXIT=>2}, - {ERR=>"$prog: invalid number of fields to undecorate 'A'\n"}], - ['e52','--undecorate -4', {EXIT=>2}, - {ERR=>"$prog: invalid number of fields to undecorate '-4'\n"}], - - ['e60','--decorate -k1,1:roman --undecorate 4', {EXIT=>2}, - {ERR=>"$prog: --decorate and --undecorate options are mutually exclusive\n"}], - ['e61','-k1,1:roman --undecorate 4', {EXIT=>2}, - {ERR=>"$prog: --undecorate cannot be used with --keys or --decorate\n"}], - ['e62','', {EXIT=>2}, - {ERR=>"$prog: missing -k/--key decoration or --undecorate options\n"}], - - ['e70', '--header X --decorate -k2,2:ipv4' , {EXIT=>2}, - {ERR=>"$prog: invalid number of header lines 'X'\n"}], - - - # Conversion Errors - ['c1', '--decorate -k1,1:roman' , {IN_PIPE=>"\n"}, {OUT => " "}, {EXIT=>2}, - {ERR=>"$prog: invalid empty roman numeral\n" . - "$prog: conversion failed in line 1\n" }], - ['c2', '--decorate -k2,2:roman' , {IN_PIPE=>"M"}, {OUT => " "}, {EXIT=>2}, - {ERR=>"$prog: invalid empty roman numeral\n" . - "$prog: conversion failed in line 1\n" }], - ['c3', '--decorate -k1,1:ipv4' , {IN_PIPE=>"FOO\n"}, {OUT => " "}, {EXIT=>2}, - {ERR=>"$prog: invalid dot-decimal IPv4 address 'FOO'\n" . - "$prog: conversion failed in line 1\n" }], - ['c4', '--decorate -k1,1:ipv4inet' , {IN_PIPE=>"FOO\n"}, {OUT => " "}, - {EXIT=>2}, - {ERR=>"$prog: invalid IPv4 address 'FOO'\n" . - "$prog: conversion failed in line 1\n" }], - ['c5', '--decorate -k1,1:ipv6' , {IN_PIPE=>"FOO\n"}, {OUT => " "}, {EXIT=>2}, - {ERR=>"$prog: invalid IPv6 address 'FOO'\n" . - "$prog: conversion failed in line 1\n" }], + ['e1','--foo-bar', + {ERR_SUBST=>'s/unknown/unrecognized/; s/-- foo-bar/\'--foo-bar\'/'}, + {ERR=>"$prog: unrecognized option '--foo-bar'\n" . + "Try '$prog --help' for more information.\n"}, + {EXIT=>2}], + ['e2','-k1,1:strlen no-such-file.txt', {EXIT=>2}, + {ERR=>"$prog: no-such-file.txt: No such file or directory\n"}], + ['e3','--decorate -k1,1:strlen no-such-file.txt', {EXIT=>2}, + {ERR=>"$prog: no-such-file.txt: No such file or directory\n"}], + ['e4','--undecorate 2 no-such-file.txt', {EXIT=>2}, + {ERR=>"$prog: no-such-file.txt: No such file or directory\n"}], + + ['e5','-k1,1%', {EXIT=>2}, + {ERR=>"$prog: invalid key specification: " . + "invalid field specification '1,1%'\n"}], + ['e6','-k1,1:', {EXIT=>2}, + {ERR=>"$prog: missing internal conversion function: " . + "invalid field specification '1,1:'\n"}], + ['e7','-k1,1@', {EXIT=>2}, + {ERR=>"$prog: missing external conversion command: " . + "invalid field specification '1,1\@'\n"}], + ['e8','-k1,1@foobar', {EXIT=>2}, + {ERR=>"$prog: external commands are not implemented (yet)\n"}], + ['e9','-k1,1:foobar', {EXIT=>2}, + {ERR=>"$prog: invalid built-in conversion option: " . + "invalid field specification '1,1:foobar'\n"}], + + ## Bad --key=KEYDEF syntax (should be identical to sort's behavior) + ['e10','-k0', {EXIT=>2}, + {ERR=>"$prog: field number is zero: invalid field specification '0'\n"}], + ['e11','-k1.0', {EXIT=>2}, + {ERR=>"$prog: character offset is zero: " . + "invalid field specification '1.0'\n"}], + ['e12','-k1.A', {EXIT=>2}, + {ERR=>"$prog: invalid number after '.': invalid count at start of 'A'\n"}], + ['e13','-k1,0', {EXIT=>2}, + {ERR=>"$prog: field number is zero: invalid field specification '1,0'\n"}], + ['e14','-k1,2.B', {EXIT=>2}, + {ERR=>"$prog: invalid number after '.': invalid count at start of 'B'\n"}], + + + ## sort key ordering aren't allowed with conversion functions + ## (except 'r' for reverse order) + ['e20','-k1b,1:foobar', {EXIT=>2}, + {ERR=>"$prog: $ordering_flags_error_prefix '1b,1:foobar'\n"}], + ['e21','-k1,1b:foobar', {EXIT=>2}, + {ERR=>"$prog: $ordering_flags_error_prefix '1,1b:foobar'\n"}], + ['e22','-k1f,1:foobar', {EXIT=>2}, + {ERR=>"$prog: $ordering_flags_error_prefix '1f,1:foobar'\n"}], + ['e23','-k1d,1:foobar', {EXIT=>2}, + {ERR=>"$prog: $ordering_flags_error_prefix '1d,1:foobar'\n"}], + ['e24','-k1n,1:foobar', {EXIT=>2}, + {ERR=>"$prog: $ordering_flags_error_prefix '1n,1:foobar'\n"}], + ['e25','-k1g,1:foobar', {EXIT=>2}, + {ERR=>"$prog: $ordering_flags_error_prefix '1g,1:foobar'\n"}], + ['e26','-k1M,1:foobar', {EXIT=>2}, + {ERR=>"$prog: $ordering_flags_error_prefix '1M,1:foobar'\n"}], + ['e27','-k1h,1:foobar', {EXIT=>2}, + {ERR=>"$prog: $ordering_flags_error_prefix '1h,1:foobar'\n"}], + ['e28','-k1V,1:foobar', {EXIT=>2}, + {ERR=>"$prog: $ordering_flags_error_prefix '1V,1:foobar'\n"}], + ['e29','-k1,1R:foobar', {EXIT=>2}, + {ERR=>"$prog: $ordering_flags_error_prefix '1,1R:foobar'\n"}], + + + ['e40','-t "" -k1,1:foobar', {EXIT=>2}, + {ERR=>"$prog: empty tab\n"}], + ['e41','-tab -k1,1:foobar', {EXIT=>2}, + {ERR=>"$prog: multi-character tab 'ab'\n"}], + ['e42','-t: -t, -k1,1:foobar', {EXIT=>2}, + {ERR=>"$prog: incompatible tabs\n"}], + + + ['e50','--undecorate 0', {EXIT=>2}, + {ERR=>"$prog: invalid number of fields to undecorate '0'\n"}], + ['e51','--undecorate A', {EXIT=>2}, + {ERR=>"$prog: invalid number of fields to undecorate 'A'\n"}], + ['e52','--undecorate -4', {EXIT=>2}, + {ERR=>"$prog: invalid number of fields to undecorate '-4'\n"}], + + ['e60','--decorate -k1,1:roman --undecorate 4', {EXIT=>2}, + {ERR=>"$prog: --decorate and --undecorate options " . + "are mutually exclusive\n"}], + ['e61','-k1,1:roman --undecorate 4', {EXIT=>2}, + {ERR=>"$prog: --undecorate cannot be used with --keys or --decorate\n"}], + ['e62','', {EXIT=>2}, + {ERR=>"$prog: missing -k/--key decoration or --undecorate options\n"}], + + ['e70', '--header X --decorate -k2,2:ipv4' , {EXIT=>2}, + {ERR=>"$prog: invalid number of header lines 'X'\n"}], + + + # Conversion Errors + ['c1', '--decorate -k1,1:roman' , {IN_PIPE=>"\n"}, {OUT => " "}, {EXIT=>2}, + {ERR=>"$prog: invalid empty roman numeral\n" . + "$prog: conversion failed in line 1\n" }], + ['c2', '--decorate -k2,2:roman' , {IN_PIPE=>"M"}, {OUT => " "}, {EXIT=>2}, + {ERR=>"$prog: invalid empty roman numeral\n" . + "$prog: conversion failed in line 1\n" }], + ['c3', '--decorate -k1,1:ipv4' , {IN_PIPE=>"FOO\n"}, {OUT => " "}, {EXIT=>2}, + {ERR=>"$prog: invalid dot-decimal IPv4 address 'FOO'\n" . + "$prog: conversion failed in line 1\n" }], + ['c4', '--decorate -k1,1:ipv4inet' , {IN_PIPE=>"FOO\n"}, {OUT => " "}, + {EXIT=>2}, + {ERR=>"$prog: invalid IPv4 address 'FOO'\n" . + "$prog: conversion failed in line 1\n" }], + ['c5', '--decorate -k1,1:ipv6' , {IN_PIPE=>"FOO\n"}, {OUT => " "}, {EXIT=>2}, + {ERR=>"$prog: invalid IPv6 address 'FOO'\n" . + "$prog: conversion failed in line 1\n" }], + ['c6', '--decorate -k1,1:ipv6v4map', {IN_PIPE=>"FOO\n"}, {OUT => " "}, + {EXIT=>2}, + {ERR=>"$prog: invalid IP address 'FOO'\n" . + "$prog: conversion failed in line 1\n" }], + ['c7', '--decorate -k1,1:ipv6v4comp', {IN_PIPE=>"FOO\n"}, {OUT => " "}, + {EXIT=>2}, + {ERR=>"$prog: invalid IP address 'FOO'\n" . + "$prog: conversion failed in line 1\n" }], + ['c8', '--decorate -k1,1:ipv6v4map', {IN_PIPE=>"0\n"}, {OUT => " "}, + {EXIT=>2}, + {ERR=>"$prog: invalid IP address '0'\n" . + "$prog: conversion failed in line 1\n" }], + ['c9', '--decorate -k1,1:ipv6v4comp', {IN_PIPE=>"0\n"}, {OUT => " "}, + {EXIT=>2}, + {ERR=>"$prog: invalid IP address '0'\n" . + "$prog: conversion failed in line 1\n" }], + ['c10', '--decorate -k1,1:ipv6v4map', {IN_PIPE=>"\n"}, {OUT => " "}, + {EXIT=>2}, + {ERR=>"$prog: invalid IP address ''\n" . + "$prog: conversion failed in line 1\n" }], + ['c11', '--decorate -k1,1:ipv6v4comp', {IN_PIPE=>"\n"}, {OUT => " "}, + {EXIT=>2}, + {ERR=>"$prog: invalid IP address ''\n" . + "$prog: conversion failed in line 1\n" }], # on a different architecture, would printf(%Lg) print something else? diff -Nru datamash-1.7/tests/decorate-sort-tests.pl datamash-1.8/tests/decorate-sort-tests.pl --- datamash-1.7/tests/decorate-sort-tests.pl 2020-04-23 16:39:59.000000000 +0000 +++ datamash-1.8/tests/decorate-sort-tests.pl 2022-06-18 00:00:19.000000000 +0000 @@ -2,7 +2,7 @@ =pod Unit Tests for decorate - Copyright (C) 2020 Assaf Gordon + Copyright (C) 2020-2021 Assaf Gordon This file is part of GNU Datamash. @@ -33,7 +33,7 @@ (my $program_name = $0) =~ s|.*/||; my $prog = 'decorate'; - +$prog .= " --sort-cmd=/usr/bin/sort" if $^O eq "netbsd"; # TODO: add localization tests with "grouping" # Turn off localization of executable's output. @@ -177,32 +177,75 @@ M 192.168.43.1 EOF +my $in2=<<'EOF'; +203.0.113.47 +192.0.2.33 +203.0.113.0 +192.0.2.3 +0.0.0.0 +::ffff:192.0.2.42 +2001:db8:6:5:4:3:2:1 +2001:Db8:: +::192.0.2.41 +::1 +EOF + +my $out2_ipv6v4map=<<'EOF'; +::1 +::192.0.2.41 +0.0.0.0 +192.0.2.3 +192.0.2.33 +::ffff:192.0.2.42 +203.0.113.0 +203.0.113.47 +2001:Db8:: +2001:db8:6:5:4:3:2:1 +EOF + +my $out2_ipv6v4comp=<<'EOF'; +0.0.0.0 +::1 +192.0.2.3 +192.0.2.33 +::192.0.2.41 +203.0.113.0 +203.0.113.47 +::ffff:192.0.2.42 +2001:Db8:: +2001:db8:6:5:4:3:2:1 +EOF + my @Tests = ( - ['s1', '-k1,1:roman', {IN_PIPE=>$in1}, {OUT => $out1_dec_roman}], - ['s2', '-k2,2:ipv4', {IN_PIPE=>$in1}, {OUT => $out1_dec_ipv4}], - ['s3', '-k2,2:ipv4 --stable', {IN_PIPE=>$in1}, {OUT => $out1_dec_ipv4_stable}], - ['s4', '-k2,2r:ipv4', {IN_PIPE=>$in1}, {OUT => $out1_dec_ipv4_rev}], - - ['s5', '-k1,1:roman -k2,2r:ipv4' , {IN_PIPE=>$in1}, - {OUT => $out1_dec_roman_ipv4rev}], - ['s6', '-k2,2:ipv4 -k1r,1:roman' , {IN_PIPE=>$in1}, - {OUT => $out1_dec_ipv4_romanrev}], - - ['s10', '-k1,1:roman -k2,2' , {IN_PIPE=>$in1}, - {OUT => $out1_dec_roman_k2}], - ['s11', '-k2n,2 -k1,1:roman' , {IN_PIPE=>$in1}, - {OUT => $out1_dec_k2n_roman}], - - - # Sort with header lines - ['sh1', '-H -k2,2r:ipv4', {IN_PIPE=>$in1}, {OUT=>$out1_dec_ipv4_rev_header1}], - ['sh2', '--header=2 -k2,2r:ipv4', {IN_PIPE=>$in1}, - {OUT => $out1_dec_ipv4_rev_header2}], - # More header lines than in the input - ['sh3', '--header=9 -k2,2r:ipv4', {IN_PIPE=>$in1}, {OUT => $in1}], - ['sh4', '--header=10 -k2,2r:ipv4', {IN_PIPE=>$in1}, {OUT => $in1}], + ['s1', '-k1,1:roman', {IN_PIPE=>$in1}, {OUT => $out1_dec_roman}], + ['s2', '-k2,2:ipv4', {IN_PIPE=>$in1}, {OUT => $out1_dec_ipv4}], + ['s3', '-k2,2:ipv4 --stable', {IN_PIPE=>$in1}, + {OUT => $out1_dec_ipv4_stable}], + ['s4', '-k2,2r:ipv4', {IN_PIPE=>$in1}, {OUT => $out1_dec_ipv4_rev}], + + ['s5', '-k1,1:roman -k2,2r:ipv4' , {IN_PIPE=>$in1}, + {OUT => $out1_dec_roman_ipv4rev}], + ['s6', '-k2,2:ipv4 -k1r,1:roman' , {IN_PIPE=>$in1}, + {OUT => $out1_dec_ipv4_romanrev}], + + ['s10', '-k1,1:roman -k2,2' , {IN_PIPE=>$in1}, + {OUT => $out1_dec_roman_k2}], + ['s11', '-k2n,2 -k1,1:roman' , {IN_PIPE=>$in1}, + {OUT => $out1_dec_k2n_roman}], + + ['s12', '-k1,1:ipv6v4map', {IN_PIPE=>$in2}, {OUT => $out2_ipv6v4map}], + ['s13', '-k1,1:ipv6v4comp', {IN_PIPE=>$in2}, {OUT => $out2_ipv6v4comp}], + + + # Sort with header lines + ['sh1', '-H -k2,2r:ipv4', {IN_PIPE=>$in1}, {OUT=>$out1_dec_ipv4_rev_header1}], + ['sh2', '--header=2 -k2,2r:ipv4', {IN_PIPE=>$in1}, + {OUT => $out1_dec_ipv4_rev_header2}], + # More header lines than in the input + ['sh3', '--header=9 -k2,2r:ipv4', {IN_PIPE=>$in1}, {OUT => $in1}], + ['sh4', '--header=10 -k2,2r:ipv4', {IN_PIPE=>$in1}, {OUT => $in1}], ); diff -Nru datamash-1.7/tests/decorate-tests.pl datamash-1.8/tests/decorate-tests.pl --- datamash-1.7/tests/decorate-tests.pl 2020-04-23 16:39:59.000000000 +0000 +++ datamash-1.8/tests/decorate-tests.pl 2022-06-18 00:01:35.000000000 +0000 @@ -2,7 +2,7 @@ =pod Unit Tests for decorate - Copyright (C) 2020 Assaf Gordon + Copyright (C) 2020-2021 Assaf Gordon This file is part of GNU Datamash. @@ -33,7 +33,7 @@ (my $program_name = $0) =~ s|.*/||; my $prog = 'decorate'; - +$prog .= " --sort-cmd=/usr/bin/sort" if $^O eq "netbsd"; # TODO: add localization tests with "grouping" # Turn off localization of executable's output. @@ -222,95 +222,160 @@ C0A8110A L 192.168.17.10 EOF +my $in4=<<'EOF'; +203.0.113.47 +192.0.2.33 +203.0.113.0 +192.0.2.3 +0.0.0.0 +::ffff:192.0.2.42 +2001:db8:6:5:4:3:2:1 +2001:Db8:: +::192.0.2.41 +::1 +:: +EOF + +my $out4_ipv6v4map=<<'EOF'; +00000000000000000000FFFFCB00712F 203.0.113.47 +00000000000000000000FFFFC0000221 192.0.2.33 +00000000000000000000FFFFCB007100 203.0.113.0 +00000000000000000000FFFFC0000203 192.0.2.3 +00000000000000000000FFFF00000000 0.0.0.0 +00000000000000000000FFFFC000022A ::ffff:192.0.2.42 +20010DB8000600050004000300020001 2001:db8:6:5:4:3:2:1 +20010DB8000000000000000000000000 2001:Db8:: +000000000000000000000000C0000229 ::192.0.2.41 +00000000000000000000000000000001 ::1 +00000000000000000000000000000000 :: +EOF + +my $out4_ipv6v4comp=<<'EOF'; +000000000000000000000000CB00712F 203.0.113.47 +000000000000000000000000C0000221 192.0.2.33 +000000000000000000000000CB007100 203.0.113.0 +000000000000000000000000C0000203 192.0.2.3 +00000000000000000000000000000000 0.0.0.0 +00000000000000000000FFFFC000022A ::ffff:192.0.2.42 +20010DB8000600050004000300020001 2001:db8:6:5:4:3:2:1 +20010DB8000000000000000000000000 2001:Db8:: +000000000000000000000000C0000229 ::192.0.2.41 +00000000000000000000000000000001 ::1 +00000000000000000000000000000000 :: +EOF my @Tests = ( - ## basic decoration functions - ['d1', '--decorate -k1,1:roman' , {IN_PIPE=>$in1}, {OUT => $out1_dec_roman}], - ['d2', '--decorate -k2,2:ipv4' , {IN_PIPE=>$in1}, {OUT => $out1_dec_ipv4}], - ['d3', '--decorate -k1,1:roman -k2,2:ipv4' , {IN_PIPE=>$in1}, - {OUT => $out1_dec_roman_ipv4}], - ['d4', '--decorate -k2,2:ipv4 -k1,1:roman' , {IN_PIPE=>$in1}, - {OUT => $out1_dec_ipv4_roman}], - ['d5', '--decorate -k1,1:as-is' , {IN_PIPE=>$in1}, {OUT => $out1_asis}], - ['d6', '--decorate -k1,1:strlen -k2,2:strlen' , {IN_PIPE=>$in1}, - {OUT => $out1_strlen1}], - ['d7', '--decorate -k1,1:ipv4inet', {IN_PIPE=>$in2}, {OUT => $out2_ipv4inet}], - ['d8', '--decorate -k1,1:ipv6', {IN_PIPE=>$in3}, {OUT => $out3_ipv6}], - ['d9', '--decorate -k1:strlen' , {IN_PIPE=>$in1}, {OUT=>$out1_strlen2}], - ['d10', '--decorate -k1,1:strlen -k1:strlen' , {IN_PIPE=>$in1}, - {OUT=>$out1_strlen3}], - ['d11', '--decorate -k1,1:strlen -k2.2,2:strlen' , {IN_PIPE=>$in1}, - {OUT=>$out1_strlen4}], - - ## basic undecoration - ['u1', '--undecorate 1' , {IN_PIPE=>$out1_dec_roman}, {OUT => $in1}], - ['u2', '--undecorate 1' , {IN_PIPE=>$out1_dec_ipv4}, {OUT => $in1}], - ['u3', '--undecorate 2' , {IN_PIPE=>$out1_dec_roman_ipv4}, {OUT => $in1}], - ['u4', '--undecorate 2' , {IN_PIPE=>$out1_dec_ipv4_roman}, {OUT => $in1}], - - ## sort arguments adjustment - ['sa1', '--print-sort-args -k1,1:roman', {OUT=>"sort -k1,1\n"}], - ['sa2', '--print-sort-args -k2,2:roman', {OUT=>"sort -k1,1\n"}], - ['sa3', '--print-sort-args -k2,2:roman -k4,4n -k1,1:strlen', - {OUT=>"sort -k1,1 -k6,6n -k2,2\n"}], - ['sa4', '--print-sort-args -k2,2:ipv4 -k4,4Vr',{OUT=>"sort -k1,1 -k5,5rV\n"}], - ['sa5', '--print-sort-args -k2,2:ipv4 -k4r,4V',{OUT=>"sort -k1,1 -k5,5rV\n"}], - ['sa6', '--print-sort-args -k2,2:ipv4 -k4V,4r',{OUT=>"sort -k1,1 -k5,5rV\n"}], - ['sa7', '--print-sort-args -k2,2r:ipv4 ',{OUT=>"sort -k1,1r\n"}], - ['sa8', '--print-sort-args -k2,2r:ipv4 ',{OUT=>"sort -k1,1r\n"}], - ['sa9', '--print-sort-args -k2,2r:ipv4 -s ',{OUT=>"sort -k1,1r -s\n"}], - ['sa10', '--print-sort-args -k2,2r:ipv4 -szu ', - {OUT=>"sort -k1,1r -s -z -u\n"}], - ['sa11', '--print-sort-args -k2,2r:ipv4 -S 2G -szu ', - {OUT=>"sort -k1,1r -S 2G -s -z -u\n"}], - ['sa12', '--print-sort-args -k2,2r:ipv4 -S 2G -T /foo/bar -szu ', - {OUT=>"sort -k1,1r -S 2G -T /foo/bar -s -z -u\n"}], - ['sa13', '--print-sort-args -k2,2r:ipv4 -t: -S 2G -T /foo/bar -szu ', - {OUT=>"sort -k1,1r -t : -S 2G -T /foo/bar -s -z -u\n"}], - ['sa14', '--print-sort-args -k2,2r:ipv4 -t: -t:', - {OUT=>"sort -k1,1r -t : -t :\n"}], - ['sa15', '--print-sort-args -k2,2r:ipv4 -t "\\\\0"', - {OUT=>"sort -k1,1r -t \\0\n"}], - ['sa16', '--print-sort-args -k2,2r:ipv4 --compress-program=ZOOP', - {OUT=>"sort -k1,1r --compress-program ZOOP\n"}], - ['sa17', '--print-sort-args -k2,2r:ipv4 --compress-program ZOOP', - {OUT=>"sort -k1,1r --compress-program ZOOP\n"}], - ['sa18', '--print-sort-args -k2,2r:ipv4 --random-source /foo/bar', - {OUT=>"sort -k1,1r --random-source /foo/bar\n"}], - ['sa19', '--print-sort-args -k2,2r:ipv4 --batch-size 9 --parallel=42', - {OUT=>"sort -k1,1r --batch-size 9 --parallel 42\n"}], - ['sa21', '--print-sort-args -k2,2r:ipv4 -c', - {OUT=>"sort -k1,1r -c\n"}], - ['sa22', '--print-sort-args -k2,2r:ipv4 --check', - {OUT=>"sort -k1,1r --check\n"}], - ['sa23', '--print-sort-args -k2,2r:ipv4 -C', - {OUT=>"sort -k1,1r -C\n"}], - ['sa24', '--print-sort-args -k2,2r:ipv4 --check=diagnose-first', - {OUT=>"sort -k1,1r --check=diagnose-first\n"}], - ['sa25', '--print-sort-args -k2,2r:ipv4 --check=foobar12343124321123421432145', - {OUT=>"sort -k1,1r --check=foobar12343124321123421432145\n"}], - ['sa26', '--print-sort-args -k2,2r:ipv4 --check=quiet', - {OUT=>"sort -k1,1r --check=quiet\n"}], - ['sa27', '--print-sort-args -k7 -k2,2r:ipv4 -k5.3,6.2', - {OUT=>"sort -k8 -k1,1r -k6.3,7.2\n"}], - - - # Edge Cases - ['g1', '--decorate -k1,1:roman' , {IN_PIPE=>""}, {OUT => ""}], - - # Header Lines - ['h1', '-H --decorate -k2,2:ipv4', {IN_PIPE=>$in1}, - {OUT=>$out1_dec_ipv4_header1}], - ['h2', '--header 1 --decorate -k2,2:ipv4', {IN_PIPE=>$in1}, - {OUT=>$out1_dec_ipv4_header1}], - ['h3', '--header=1 --decorate -k2,2:ipv4', {IN_PIPE=>$in1}, - {OUT=>$out1_dec_ipv4_header1}], - ['h4', '--header 2 --decorate -k2,2:ipv4', {IN_PIPE=>$in1}, - {OUT=>$out1_dec_ipv4_header2}], - # More header lines than in the input - ['h5', '--header 8 --decorate -k2,2:ipv4' , {IN_PIPE=>$in1}, {OUT => $in1}], - ['h6', '--header 9 --decorate -k2,2:ipv4' , {IN_PIPE=>$in1}, {OUT => $in1}], + ## basic decoration functions + ['d1', '--decorate -k1,1:roman' , {IN_PIPE=>$in1}, {OUT => $out1_dec_roman}], + ['d2', '--decorate -k2,2:ipv4' , {IN_PIPE=>$in1}, {OUT => $out1_dec_ipv4}], + ['d3', '--decorate -k1,1:roman -k2,2:ipv4' , {IN_PIPE=>$in1}, + {OUT => $out1_dec_roman_ipv4}], + ['d4', '--decorate -k2,2:ipv4 -k1,1:roman' , {IN_PIPE=>$in1}, + {OUT => $out1_dec_ipv4_roman}], + ['d5', '--decorate -k1,1:as-is' , {IN_PIPE=>$in1}, {OUT => $out1_asis}], + ['d6', '--decorate -k1,1:strlen -k2,2:strlen' , {IN_PIPE=>$in1}, + {OUT => $out1_strlen1}], + ['d7', '--decorate -k1,1:ipv4inet', {IN_PIPE=>$in2}, {OUT => $out2_ipv4inet}], + ['d8', '--decorate -k1,1:ipv6', {IN_PIPE=>$in3}, {OUT => $out3_ipv6}], + ['d9', '--decorate -k1:strlen' , {IN_PIPE=>$in1}, {OUT=>$out1_strlen2}], + ['d10', '--decorate -k1,1:strlen -k1:strlen' , {IN_PIPE=>$in1}, + {OUT=>$out1_strlen3}], + ['d11', '--decorate -k1,1:strlen -k2.2,2:strlen' , {IN_PIPE=>$in1}, + {OUT=>$out1_strlen4}], + ['d12', '--decorate -k1:ipv6v4map', {IN_PIPE=>$in4}, {OUT=>$out4_ipv6v4map}], + ['d13', '--decorate -k1:ipv6v4comp', {IN_PIPE=>$in4}, + {OUT=>$out4_ipv6v4comp}], + + ## basic undecoration + ['u1', '--undecorate 1' , {IN_PIPE=>$out1_dec_roman}, {OUT => $in1}], + ['u2', '--undecorate 1' , {IN_PIPE=>$out1_dec_ipv4}, {OUT => $in1}], + ['u3', '--undecorate 2' , {IN_PIPE=>$out1_dec_roman_ipv4}, {OUT => $in1}], + ['u4', '--undecorate 2' , {IN_PIPE=>$out1_dec_ipv4_roman}, {OUT => $in1}], + + ## sort arguments adjustment + ['sa1', '--print-sort-args -k1,1:roman', + {OUT_SUBST=>'s/^.*?sort(?: -S)?/sort/'}, {OUT=>"sort -k1,1\n"}], + ['sa2', '--print-sort-args -k2,2:roman', + {OUT_SUBST=>'s/^.*?sort(?: -S)?/sort/'}, {OUT=>"sort -k1,1\n"}], + ['sa3', '--print-sort-args -k2,2:roman -k4,4n -k1,1:strlen', + {OUT_SUBST=>'s/^.*?sort(?: -S)?/sort/'}, + {OUT=>"sort -k1,1 -k6,6n -k2,2\n"}], + ['sa4', '--print-sort-args -k2,2:ipv4 -k4,4Vr', + {OUT_SUBST=>'s/^.*?sort(?: -S)?/sort/'}, {OUT=>"sort -k1,1 -k5,5rV\n"}], + ['sa5', '--print-sort-args -k2,2:ipv4 -k4r,4V', + {OUT_SUBST=>'s/^.*?sort(?: -S)?/sort/'}, {OUT=>"sort -k1,1 -k5,5rV\n"}], + ['sa6', '--print-sort-args -k2,2:ipv4 -k4V,4r', + {OUT_SUBST=>'s/^.*?sort(?: -S)?/sort/'}, {OUT=>"sort -k1,1 -k5,5rV\n"}], + ['sa7', '--print-sort-args -k2,2r:ipv4 ', + {OUT_SUBST=>'s/^.*?sort(?: -S)?/sort/'}, {OUT=>"sort -k1,1r\n"}], + ['sa8', '--print-sort-args -k2,2r:ipv4 ', + {OUT_SUBST=>'s/^.*?sort(?: -S)?/sort/'},{OUT=>"sort -k1,1r\n"}], + ['sa9', '--print-sort-args -k2,2r:ipv4 -s ', + {OUT_SUBST=>'s/^.*?sort(?: -S)?/sort/'}, {OUT=>"sort -k1,1r -s\n"}], + ['sa10', '--print-sort-args -k2,2r:ipv4 -szu ', + {OUT_SUBST=>'s/^.*?sort(?: -S)?/sort/'}, {OUT=>"sort -k1,1r -s -z -u\n"}], + ['sa11', '--print-sort-args -k2,2r:ipv4 -S 2G -szu ', + {OUT_SUBST=>'s/^.*?sort(?: -S)?/sort/'}, + {OUT=>"sort -k1,1r -S 2G -s -z -u\n"}], + ['sa12', '--print-sort-args -k2,2r:ipv4 -S 2G -T /foo/bar -szu ', + {OUT_SUBST=>'s/^.*?sort(?: -S)?/sort/'}, + {OUT=>"sort -k1,1r -S 2G -T /foo/bar -s -z -u\n"}], + ['sa13', '--print-sort-args -k2,2r:ipv4 -t: -S 2G -T /foo/bar -szu ', + {OUT_SUBST=>'s/^.*?sort(?: -S)?/sort/'}, + {OUT=>"sort -k1,1r -t : -S 2G -T /foo/bar -s -z -u\n"}], + ['sa14', '--print-sort-args -k2,2r:ipv4 -t: -t:', + {OUT_SUBST=>'s/^.*?sort(?: -S)?/sort/'}, {OUT=>"sort -k1,1r -t : -t :\n"}], + ['sa15', '--print-sort-args -k2,2r:ipv4 -t "\\\\0"', + {OUT_SUBST=>'s/^.*?sort(?: -S)?/sort/'}, {OUT=>"sort -k1,1r -t '\\0'\n"}], + ['sa16', '--print-sort-args -k2,2r:ipv4 --compress-program=ZOOP', + {OUT_SUBST=>'s/^.*?sort(?: -S)?/sort/'}, + {OUT=>"sort -k1,1r --compress-program ZOOP\n"}], + ['sa17', '--print-sort-args -k2,2r:ipv4 --compress-program ZOOP', + {OUT_SUBST=>'s/^.*?sort(?: -S)?/sort/'}, + {OUT=>"sort -k1,1r --compress-program ZOOP\n"}], + ['sa18', '--print-sort-args -k2,2r:ipv4 --random-source /foo/bar', + {OUT_SUBST=>'s/^.*?sort(?: -S)?/sort/'}, + {OUT=>"sort -k1,1r --random-source /foo/bar\n"}], + ['sa19', '--print-sort-args -k2,2r:ipv4 --batch-size 9 --parallel=42', + {OUT_SUBST=>'s/^.*?sort(?: -S)?/sort/'}, + {OUT=>"sort -k1,1r --batch-size 9 --parallel 42\n"}], + ['sa21', '--print-sort-args -k2,2r:ipv4 -c', + {OUT_SUBST=>'s/^.*?sort(?: -S)?/sort/'}, {OUT=>"sort -k1,1r -c\n"}], + ['sa22', '--print-sort-args -k2,2r:ipv4 --check', + {OUT_SUBST=>'s/^.*?sort(?: -S)?/sort/'}, {OUT=>"sort -k1,1r --check\n"}], + ['sa23', '--print-sort-args -k2,2r:ipv4 -C', + {OUT_SUBST=>'s/^.*?sort(?: -S)?/sort/'}, {OUT=>"sort -k1,1r -C\n"}], + ['sa24', "--print-sort-args -k2,2r:ipv4 '--check=diagnose-first'", + {OUT_SUBST=>'s/^.*?sort(?: -S)?/sort/'}, + {OUT=>"sort -k1,1r '--check=diagnose-first'\n"}], + ['sa25', "--print-sort-args -k2,2r:ipv4 " . + "--check=foobar12343124321123421432145", + {OUT_SUBST=>'s/^.*?sort(?: -S)?/sort/'}, + {OUT=>"sort -k1,1r '--check=foobar12343124321123421432145'\n"}], + ['sa26', '--print-sort-args -k2,2r:ipv4 --check=quiet', + {OUT_SUBST=>'s/^.*?sort(?: -S)?/sort/'}, + {OUT=>"sort -k1,1r '--check=quiet'\n"}], + ['sa27', '--print-sort-args -k7 -k2,2r:ipv4 -k5.3,6.2', + {OUT_SUBST=>'s/^.*?sort(?: -S)?/sort/'}, + {OUT=>"sort -k8 -k1,1r -k6.3,7.2\n"}], + + + # Edge Cases + ['g1', '--decorate -k1,1:roman' , {IN_PIPE=>""}, {OUT => ""}], + + # Header Lines + ['h1', '-H --decorate -k2,2:ipv4', {IN_PIPE=>$in1}, + {OUT=>$out1_dec_ipv4_header1}], + ['h2', '--header 1 --decorate -k2,2:ipv4', {IN_PIPE=>$in1}, + {OUT=>$out1_dec_ipv4_header1}], + ['h3', '--header=1 --decorate -k2,2:ipv4', {IN_PIPE=>$in1}, + {OUT=>$out1_dec_ipv4_header1}], + ['h4', '--header 2 --decorate -k2,2:ipv4', {IN_PIPE=>$in1}, + {OUT=>$out1_dec_ipv4_header2}], + # More header lines than in the input + ['h5', '--header 8 --decorate -k2,2:ipv4' , {IN_PIPE=>$in1}, {OUT => $in1}], + ['h6', '--header 9 --decorate -k2,2:ipv4' , {IN_PIPE=>$in1}, {OUT => $in1}], # on a different architecture, would printf(%Lg) print something else? # Use OUT_SUBST to trim output to 1.3 digits diff -Nru datamash-1.7/tests/init.sh datamash-1.8/tests/init.sh --- datamash-1.7/tests/init.sh 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/tests/init.sh 2022-05-28 02:52:43.000000000 +0000 @@ -1,6 +1,6 @@ # source this file; set up for tests -# Copyright (C) 2009-2019 Free Software Foundation, Inc. +# Copyright (C) 2009-2021 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 @@ -60,6 +60,9 @@ # 4. Finally # $ exit +# ============================================================================= +# Elementary diagnostics + ME_=`expr "./$0" : '.*/\(.*\)$'` # Prepare PATH_SEPARATOR. @@ -109,26 +112,8 @@ 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 -} +# ============================================================================= +# Ensure the shell supports modern syntax. # Sanitize this shell to POSIX mode, if possible. DUALCASE=1; export DUALCASE @@ -144,6 +129,8 @@ fi # We require $(...) support unconditionally. +# We require that the printf built-in work correctly regarding octal escapes; +# this eliminates /bin/sh on AIX 7.2. # We require non-surprising "local" semantics (this eliminates dash). # This takes the admittedly draconian step of eliminating dash, because the # assignment tab=$(printf '\t') works fine, yet preceding it with "local " @@ -173,6 +160,12 @@ # ? - not ok gl_shell_test_script_=' test $(echo y) = y || exit 1 +LC_ALL=en_US.UTF-8 printf "\\351" 2>/dev/null \ + | LC_ALL=C tr "\\351" x | LC_ALL=C grep "^x$" > /dev/null \ + || exit 1 +printf "\\351" 2>/dev/null \ + | LC_ALL=C tr "\\351" x | LC_ALL=C grep "^x$" > /dev/null \ + || exit 1 f_local_() { local v=1; }; f_local_ || exit 1 f_dash_local_fail_() { local t=$(printf " 1"); }; f_dash_local_fail_ score_=10 @@ -255,6 +248,9 @@ fi fi +# ============================================================================= +# Ensure the shell behaves reasonably. + # If this is bash, turn off all aliases. test -n "$BASH_VERSION" && unalias -a @@ -265,99 +261,177 @@ # widespread than that for hyphen-containing function names. test -n "$EXEEXT" && test -n "$BASH_VERSION" && shopt -s expand_aliases -# Enable glibc's malloc-perturbing option. -# This is useful for exposing code that depends on the fact that -# malloc-related functions often return memory that is mostly zeroed. -# If you have the time and cycles, use valgrind to do an even better job. -: ${MALLOC_PERTURB_=87} -export MALLOC_PERTURB_ +# ============================================================================= +# Creating a temporary directory (needed by the core test framework) -# This is a stub function that is run upon trap (upon regular exit and -# interrupt). Override it with a per-test function, e.g., to unmount -# a partition, or to undo any other global state changes. -cleanup_ () { :; } +# Create a temporary directory, much like mktemp -d does. +# Written by Jim Meyering. +# +# Usage: mktempd_ /tmp phoey.XXXXXXXXXX +# +# First, try to use the mktemp program. +# Failing that, we'll roll our own mktemp-like function: +# - try to get random bytes from /dev/urandom +# - failing that, generate output from a combination of quickly-varying +# sources and gzip. Ignore non-varying gzip header, and extract +# "random" bits from there. +# - given those bits, map to file-name bytes using tr, and try to create +# the desired directory. +# - make only $MAX_TRIES_ attempts -# Emit a header similar to that from diff -u; Print the simulated "diff" -# command so that the order of arguments is clear. Don't bother with @@ lines. -emit_diff_u_header_ () +# Helper function. Print $N pseudo-random bytes from a-zA-Z0-9. +rand_bytes_ () { - printf '%s\n' "diff -u $*" \ - "--- $1 1970-01-01" \ - "+++ $2 1970-01-01" + n_=$1 + + # Maybe try openssl rand -base64 $n_prime_|tr '+/=\012' abcd first? + # But if they have openssl, they probably have mktemp, too. + + chars_=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 + dev_rand_=/dev/urandom + if test -r "$dev_rand_"; then + # Note: 256-length($chars_) == 194; 3 copies of $chars_ is 186 + 8 = 194. + dd ibs=$n_ count=1 if=$dev_rand_ 2>/dev/null \ + | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_ + return + fi + + n_plus_50_=`expr $n_ + 50` + cmds_='date; date +%N; free; who -a; w; ps auxww; ps -ef' + data_=` (eval "$cmds_") 2>&1 | gzip ` + + # Ensure that $data_ has length at least 50+$n_ + while :; do + len_=`echo "$data_"|wc -c` + test $n_plus_50_ -le $len_ && break; + data_=` (echo "$data_"; eval "$cmds_") 2>&1 | gzip ` + done + + echo "$data_" \ + | dd bs=1 skip=50 count=$n_ 2>/dev/null \ + | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_ } -# Arrange not to let diff or cmp operate on /dev/null, -# since on some systems (at least OSF/1 5.1), that doesn't work. -# When there are not two arguments, or no argument is /dev/null, return 2. -# When one argument is /dev/null and the other is not empty, -# cat the nonempty file to stderr and return 1. -# Otherwise, return 0. -compare_dev_null_ () +mktempd_ () { - test $# = 2 || return 2 + case $# in + 2);; + *) fail_ "Usage: mktempd_ DIR TEMPLATE";; + esac - if test "x$1" = x/dev/null; then - test -s "$2" || return 0 - emit_diff_u_header_ "$@"; sed 's/^/+/' "$2" - return 1 - fi + destdir_=$1 + template_=$2 - if test "x$2" = x/dev/null; then - test -s "$1" || return 0 - emit_diff_u_header_ "$@"; sed 's/^/-/' "$1" - return 1 - fi + MAX_TRIES_=4 - return 2 + # Disallow any trailing slash on specified destdir: + # it would subvert the post-mktemp "case"-based destdir test. + case $destdir_ in + / | //) destdir_slash_=$destdir;; + */) fail_ "invalid destination dir: remove trailing slash(es)";; + *) destdir_slash_=$destdir_/;; + esac + + case $template_ in + *XXXX) ;; + *) fail_ \ + "invalid template: $template_ (must have a suffix of at least 4 X's)";; + esac + + # First, try to use mktemp. + d=`unset TMPDIR; { mktemp -d -t -p "$destdir_" "$template_"; } 2>/dev/null` && + + # The resulting name must be in the specified directory. + case $d in "$destdir_slash_"*) :;; *) false;; esac && + + # It must have created the directory. + test -d "$d" && + + # It must have 0700 permissions. Handle sticky "S" bits. + perms=`ls -dgo "$d" 2>/dev/null` && + case $perms in drwx--[-S]---*) :;; *) false;; esac && { + echo "$d" + return + } + + # If we reach this point, we'll have to create a directory manually. + + # Get a copy of the template without its suffix of X's. + base_template_=`echo "$template_"|sed 's/XX*$//'` + + # Calculate how many X's we've just removed. + template_length_=`echo "$template_" | wc -c` + nx_=`echo "$base_template_" | wc -c` + nx_=`expr $template_length_ - $nx_` + + err_= + i_=1 + while :; do + X_=`rand_bytes_ $nx_` + candidate_dir_="$destdir_slash_$base_template_$X_" + err_=`mkdir -m 0700 "$candidate_dir_" 2>&1` \ + && { echo "$candidate_dir_"; return; } + test $MAX_TRIES_ -le $i_ && break; + i_=`expr $i_ + 1` + done + fail_ "$err_" } -for diff_opt_ in -u -U3 -c '' no; do - test "$diff_opt_" != no && - diff_out_=`exec 2>/dev/null; diff $diff_opt_ "$0" "$0" < /dev/null` && - break -done -if test "$diff_opt_" != no; then - if test -z "$diff_out_"; then - compare_ () { diff $diff_opt_ "$@"; } - else - compare_ () - { - # If no differences were found, AIX and HP-UX 'diff' produce output - # like "No differences encountered". Hide this output. - diff $diff_opt_ "$@" > diff.out - diff_status_=$? - test $diff_status_ -eq 0 || cat diff.out || diff_status_=2 - rm -f diff.out || diff_status_=2 - return $diff_status_ - } - fi -elif cmp -s /dev/null /dev/null 2>/dev/null; then - compare_ () { cmp -s "$@"; } -else - compare_ () { cmp "$@"; } -fi +# ============================================================================= +# Core test framework -# Usage: compare EXPECTED ACTUAL -# -# Given compare_dev_null_'s preprocessing, defer to compare_ if 2 or more. -# Otherwise, propagate $? to caller: any diffs have already been printed. -compare () +# An arbitrary prefix to help distinguish test directories. +testdir_prefix_ () { printf gt; } + +# Set up the environment for the test to run in. +setup_ () { - # This looks like it can be factored to use a simple "case $?" - # after unchecked compare_dev_null_ invocation, but that would - # fail in a "set -e" environment. - if compare_dev_null_ "$@"; then - return 0 - else - case $? in - 1) return 1;; - *) compare_ "$@";; - esac + if test "$VERBOSE" = yes; then + # Test whether set -x may cause the selected shell to corrupt an + # application's stderr. Many do, including zsh-4.3.10 and the /bin/sh + # from SunOS 5.11, OpenBSD 4.7 and Irix 6.5. + # If enabling verbose output this way would cause trouble, simply + # issue a warning and refrain. + if $gl_set_x_corrupts_stderr_; then + warn_ "using SHELL=$SHELL with 'set -x' corrupts stderr" + else + set -x + fi fi + + initial_cwd_=$PWD + + # Create and enter the temporary directory. + pfx_=`testdir_prefix_` + test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \ + || fail_ "failed to create temporary directory in $initial_cwd_" + cd "$test_dir_" || fail_ "failed to cd to temporary directory" + # Set variables srcdir, builddir, for the convenience of the test. + case $srcdir in + /* | ?:*) ;; + *) srcdir="../$srcdir" ;; + esac + builddir=".." + export srcdir builddir + + # As autoconf-generated configure scripts do, ensure that IFS + # is defined initially, so that saving and restoring $IFS works. + gl_init_sh_nl_=' +' + IFS=" "" $gl_init_sh_nl_" + + # This trap statement, along with a trap on 0 below, ensure that the + # temporary directory, $test_dir_, is removed upon exit as well as + # upon receipt of any of the listed signals. + for sig_ in 1 2 3 13 15; do + eval "trap 'Exit $(expr $sig_ + 128)' $sig_" + done } -# An arbitrary prefix to help distinguish test directories. -testdir_prefix_ () { printf gt; } +# This is a stub function that is run upon trap (upon regular exit and +# interrupt). Override it with a per-test function, e.g., to unmount +# a partition, or to undo any other global state changes. +cleanup_ () { :; } # Run the user-overridable cleanup_ function, remove the temporary # directory and exit with the incoming value of $?. @@ -377,6 +451,9 @@ exit $__st } +# ============================================================================= +# Prepending directories to PATH + # Given a directory name, DIR, if every entry in it that matches *.exe # contains only the specified bytes (see the case stmt below), then print # a space-separated list of those names and return 0. Otherwise, don't @@ -458,160 +535,148 @@ export PATH } -setup_ () -{ - if test "$VERBOSE" = yes; then - # Test whether set -x may cause the selected shell to corrupt an - # application's stderr. Many do, including zsh-4.3.10 and the /bin/sh - # from SunOS 5.11, OpenBSD 4.7 and Irix 5.x and 6.5. - # If enabling verbose output this way would cause trouble, simply - # issue a warning and refrain. - if $gl_set_x_corrupts_stderr_; then - warn_ "using SHELL=$SHELL with 'set -x' corrupts stderr" - else - set -x - fi - fi +# ============================================================================= +# Convenience environment variables for the tests - initial_cwd_=$PWD +# ----------------------------------------------------------------------------- - pfx_=`testdir_prefix_` - test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \ - || fail_ "failed to create temporary directory in $initial_cwd_" - cd "$test_dir_" || fail_ "failed to cd to temporary directory" +# Enable glibc's malloc-perturbing option. +# This is useful for exposing code that depends on the fact that +# malloc-related functions often return memory that is mostly zeroed. +# If you have the time and cycles, use valgrind to do an even better job. +: ${MALLOC_PERTURB_=87} +export MALLOC_PERTURB_ - # As autoconf-generated configure scripts do, ensure that IFS - # is defined initially, so that saving and restoring $IFS works. - gl_init_sh_nl_=' -' - IFS=" "" $gl_init_sh_nl_" +# ----------------------------------------------------------------------------- - # This trap statement, along with a trap on 0 below, ensure that the - # temporary directory, $test_dir_, is removed upon exit as well as - # upon receipt of any of the listed signals. - for sig_ in 1 2 3 13 15; do - eval "trap 'Exit $(expr $sig_ + 128)' $sig_" - done -} +# The interpreter for Bourne-shell scripts. +# No special standards compatibility requirements. +# Some environments, such as Android, don't have /bin/sh. +if test -f /bin/sh$EXEEXT; then + BOURNE_SHELL=/bin/sh +else + BOURNE_SHELL=sh +fi -# Create a temporary directory, much like mktemp -d does. -# Written by Jim Meyering. -# -# Usage: mktempd_ /tmp phoey.XXXXXXXXXX -# -# First, try to use the mktemp program. -# Failing that, we'll roll our own mktemp-like function: -# - try to get random bytes from /dev/urandom -# - failing that, generate output from a combination of quickly-varying -# sources and gzip. Ignore non-varying gzip header, and extract -# "random" bits from there. -# - given those bits, map to file-name bytes using tr, and try to create -# the desired directory. -# - make only $MAX_TRIES_ attempts +# ============================================================================= +# Convenience functions for the tests -# Helper function. Print $N pseudo-random bytes from a-zA-Z0-9. -rand_bytes_ () -{ - n_=$1 +# ----------------------------------------------------------------------------- +# Return value checking - # Maybe try openssl rand -base64 $n_prime_|tr '+/=\012' abcd first? - # But if they have openssl, they probably have mktemp, too. +# 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 - chars_=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 - dev_rand_=/dev/urandom - if test -r "$dev_rand_"; then - # Note: 256-length($chars_) == 194; 3 copies of $chars_ is 186 + 8 = 194. - dd ibs=$n_ count=1 if=$dev_rand_ 2>/dev/null \ - | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_ - return - fi + local exp_exit="$1" + shift + "$@" + test $? -eq $exp_exit && ret_=0 || ret_=1 - n_plus_50_=`expr $n_ + 50` - cmds_='date; date +%N; free; who -a; w; ps auxww; ps -ef' - data_=` (eval "$cmds_") 2>&1 | gzip ` + if test "$VERBOSE" = yes && test "$gl_set_x_corrupts_stderr_" = false; then + set -x + fi + { return $ret_; } 2>/dev/null +} - # Ensure that $data_ has length at least 50+$n_ - while :; do - len_=`echo "$data_"|wc -c` - test $n_plus_50_ -le $len_ && break; - data_=` (echo "$data_"; eval "$cmds_") 2>&1 | gzip ` - done +# ----------------------------------------------------------------------------- +# Text file comparison - echo "$data_" \ - | dd bs=1 skip=50 count=$n_ 2>/dev/null \ - | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_ +# Emit a header similar to that from diff -u; Print the simulated "diff" +# command so that the order of arguments is clear. Don't bother with @@ lines. +emit_diff_u_header_ () +{ + printf '%s\n' "diff -u $*" \ + "--- $1 1970-01-01" \ + "+++ $2 1970-01-01" } -mktempd_ () +# Arrange not to let diff or cmp operate on /dev/null, +# since on some systems (at least OSF/1 5.1), that doesn't work. +# When there are not two arguments, or no argument is /dev/null, return 2. +# When one argument is /dev/null and the other is not empty, +# cat the nonempty file to stderr and return 1. +# Otherwise, return 0. +compare_dev_null_ () { - case $# in - 2);; - *) fail_ "Usage: mktempd_ DIR TEMPLATE";; - esac - - destdir_=$1 - template_=$2 - - MAX_TRIES_=4 - - # Disallow any trailing slash on specified destdir: - # it would subvert the post-mktemp "case"-based destdir test. - case $destdir_ in - / | //) destdir_slash_=$destdir;; - */) fail_ "invalid destination dir: remove trailing slash(es)";; - *) destdir_slash_=$destdir_/;; - esac - - case $template_ in - *XXXX) ;; - *) fail_ \ - "invalid template: $template_ (must have a suffix of at least 4 X's)";; - esac - - # First, try to use mktemp. - d=`unset TMPDIR; { mktemp -d -t -p "$destdir_" "$template_"; } 2>/dev/null` && - - # The resulting name must be in the specified directory. - case $d in "$destdir_slash_"*) :;; *) false;; esac && - - # It must have created the directory. - test -d "$d" && + test $# = 2 || return 2 - # It must have 0700 permissions. Handle sticky "S" bits. - perms=`ls -dgo "$d" 2>/dev/null` && - case $perms in drwx--[-S]---*) :;; *) false;; esac && { - echo "$d" - return - } + if test "x$1" = x/dev/null; then + test -s "$2" || return 0 + emit_diff_u_header_ "$@"; sed 's/^/+/' "$2" + return 1 + fi - # If we reach this point, we'll have to create a directory manually. + if test "x$2" = x/dev/null; then + test -s "$1" || return 0 + emit_diff_u_header_ "$@"; sed 's/^/-/' "$1" + return 1 + fi - # Get a copy of the template without its suffix of X's. - base_template_=`echo "$template_"|sed 's/XX*$//'` + return 2 +} - # Calculate how many X's we've just removed. - template_length_=`echo "$template_" | wc -c` - nx_=`echo "$base_template_" | wc -c` - nx_=`expr $template_length_ - $nx_` +for diff_opt_ in -u -U3 -c '' no; do + test "$diff_opt_" != no && + diff_out_=`exec 2>/dev/null; diff $diff_opt_ "$0" "$0" < /dev/null` && + break +done +if test "$diff_opt_" != no; then + if test -z "$diff_out_"; then + compare_ () { diff $diff_opt_ "$@"; } + else + compare_ () + { + # If no differences were found, AIX and HP-UX 'diff' produce output + # like "No differences encountered". Hide this output. + diff $diff_opt_ "$@" > diff.out + diff_status_=$? + test $diff_status_ -eq 0 || cat diff.out || diff_status_=2 + rm -f diff.out || diff_status_=2 + return $diff_status_ + } + fi +elif cmp -s /dev/null /dev/null 2>/dev/null; then + compare_ () { cmp -s "$@"; } +else + compare_ () { cmp "$@"; } +fi - err_= - i_=1 - while :; do - X_=`rand_bytes_ $nx_` - candidate_dir_="$destdir_slash_$base_template_$X_" - err_=`mkdir -m 0700 "$candidate_dir_" 2>&1` \ - && { echo "$candidate_dir_"; return; } - test $MAX_TRIES_ -le $i_ && break; - i_=`expr $i_ + 1` - done - fail_ "$err_" +# Usage: compare EXPECTED ACTUAL +# +# Given compare_dev_null_'s preprocessing, defer to compare_ if 2 or more. +# Otherwise, propagate $? to caller: any diffs have already been printed. +compare () +{ + # This looks like it can be factored to use a simple "case $?" + # after unchecked compare_dev_null_ invocation, but that would + # fail in a "set -e" environment. + if compare_dev_null_ "$@"; then + return 0 + else + case $? in + 1) return 1;; + *) compare_ "$@";; + esac + fi } +# ----------------------------------------------------------------------------- + # If you want to override the testdir_prefix_ function, # or to add more utility functions, use this file. test -f "$srcdir/init.cfg" \ && . "$srcdir/init.cfg" +# ============================================================================= +# Set up the environment for the test to run in. + setup_ "$@" # This trap is here, rather than in the setup_ function, because some # shells run the exit trap at shell function exit, rather than script exit. diff -Nru datamash-1.7/tests/no-perl datamash-1.8/tests/no-perl --- datamash-1.7/tests/no-perl 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/tests/no-perl 2022-05-28 02:52:43.000000000 +0000 @@ -2,7 +2,7 @@ # Unit Tests for GNU Datamash - stub for systems without Perl -# Copyright (C) 2014-2020 Assaf Gordon +# Copyright (C) 2014-2021 Assaf Gordon # # This file is part of GNU Datamash. # diff -Nru datamash-1.7/THANKS datamash-1.8/THANKS --- datamash-1.7/THANKS 2020-01-02 00:28:13.000000000 +0000 +++ datamash-1.8/THANKS 2022-06-01 21:08:00.000000000 +0000 @@ -1,14 +1,23 @@ -Additional contributors to datamash. - - Copyright (C) 2013-2020 Assaf Gordon - - 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. - Thanks to: Aaron Quinlan ( http://quinlanlab.org/ ) whose 'groupBy' program - (https://github.com/arq5x/bedtools) was the inspiration for datamash. + (https://github.com/arq5x/bedtools) was the inspiration for GNU Datamash. + +The following people provided bug reports, feature requests and other +suggestions which resulted in notable improvements to GNU Datamash: + + Alejandro Garrido Mota + Benno Schulenberg + Bruno Haible + Dagobert Michelseni + Dave Myron + Khavish Bhundoo + Kingsley G. Morse Jr. + Mark van Rossum + Renan Valieris + Renato Alves + Sanjeev Kumar Sharma + Steve Ward + Torsten Seemann See also the AUTHORS and ChangeLog files. diff -Nru datamash-1.7/TODO datamash-1.8/TODO --- datamash-1.7/TODO 2014-08-15 20:07:26.000000000 +0000 +++ datamash-1.8/TODO 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -Protect autosort with: - Autosort with ' delimiter - with NULL delimiter -test null delimiter