summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2015-02-01 09:50:44 -0500
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2015-02-01 09:50:44 -0500
commita3eb4b0a735b4fbd60ed66154befd31c56b601db (patch)
treec599a9b69f74610a807019356333a1bc32d1cfd7
parent6322f5a157959473624345252df752d09e711e88 (diff)
parent86cd3e2cb5117c5800997d3bb363b6d5470be3ce (diff)
downloadgawk-a3eb4b0a735b4fbd60ed66154befd31c56b601db.tar.gz
Merge branch 'master' into select
-rw-r--r--ChangeLog24
-rw-r--r--INSTALL6
-rw-r--r--Makefile.in48
-rw-r--r--NEWS17
-rw-r--r--aclocal.m465
-rw-r--r--awk.h1
-rw-r--r--awkgram.c746
-rw-r--r--awkgram.y24
-rw-r--r--awklib/Makefile.in24
-rw-r--r--awklib/eg/lib/bits2str.awk2
-rw-r--r--command.c4
-rwxr-xr-xcompile2
-rwxr-xr-xconfig.guess169
-rwxr-xr-xconfig.sub32
-rwxr-xr-xconfigure68
-rw-r--r--configure.ac4
-rwxr-xr-xdepcomp37
-rw-r--r--doc/ChangeLog29
-rw-r--r--doc/Makefile.in24
-rw-r--r--doc/gawk.info2427
-rw-r--r--doc/gawk.texi1355
-rw-r--r--doc/gawktexi.in1328
-rw-r--r--extension/ChangeLog8
-rw-r--r--extension/INSTALL6
-rw-r--r--extension/Makefile.in115
-rw-r--r--extension/aclocal.m476
-rwxr-xr-xextension/build-aux/ar-lib2
-rwxr-xr-xextension/build-aux/compile2
-rwxr-xr-xextension/build-aux/config.guess169
-rwxr-xr-xextension/build-aux/config.sub32
-rwxr-xr-xextension/build-aux/depcomp37
-rwxr-xr-xextension/build-aux/install-sh31
-rw-r--r--extension/build-aux/ltmain.sh130
-rwxr-xr-xextension/build-aux/missing6
-rw-r--r--extension/configh.in22
-rwxr-xr-xextension/configure2887
-rw-r--r--extension/configure.ac5
-rw-r--r--extension/m4/ChangeLog4
-rw-r--r--extension/m4/gettext.m4383
-rw-r--r--extension/m4/iconv.m4214
-rw-r--r--extension/m4/intlmacosx.m451
-rw-r--r--extension/m4/libtool.m4527
-rw-r--r--extension/m4/ltoptions.m457
-rw-r--r--extension/m4/ltsugar.m42
-rw-r--r--extension/m4/ltversion.m412
-rw-r--r--extension/m4/lt~obsolete.m42
-rw-r--r--extension/m4/po.m4449
-rw-r--r--extras/Makefile.in24
-rwxr-xr-xinstall-sh31
-rw-r--r--m4/ChangeLog5
-rw-r--r--m4/iconv.m461
-rw-r--r--m4/po.m42
-rwxr-xr-xmissing6
-rw-r--r--po/ChangeLog4
-rw-r--r--po/POTFILES.in6
-rw-r--r--symbol.c55
-rw-r--r--test/ChangeLog8
-rw-r--r--test/Makefile.am9
-rw-r--r--test/Makefile.in50
-rw-r--r--test/Maketests15
-rw-r--r--test/callparam.awk6
-rw-r--r--test/callparam.ok2
-rwxr-xr-xtest/exit.sh2
-rw-r--r--test/indirectcall.awk8
-rw-r--r--test/paramasfunc1.awk9
-rw-r--r--test/paramasfunc1.ok3
-rw-r--r--test/paramasfunc2.awk10
-rw-r--r--test/paramasfunc2.ok3
-rwxr-xr-xylwrap59
69 files changed, 4823 insertions, 7220 deletions
diff --git a/ChangeLog b/ChangeLog
index 5a9f4b4a..e5897b52 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,27 @@
+2015-01-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ Don't allow function parameter names to be the same as function
+ names - required by POSIX. Bug first reported in comp.lang.awk.
+
+ In addition, don't allow use of a parameter as a function name
+ in a call (but it's ok in indirect calls).
+
+ * NEWS: Updated.
+ * awk.h (check_param_names): Add declaration.
+ * awkgram.y (at_seen): New variable. Communicates between
+ yylex() and the parser.
+ (FUNC_CALL production): Check at_seen and check that the identifier
+ is a function name.
+ (parse_program): Call check_param_names() and set errcount.
+ (yylex): Set at_seen after seeing an at-sign.
+ * symbol.c (check_param_names): New function.
+
+2015-01-24 Arnold D. Robbins <arnold@skeeve.com>
+
+ Infrastructure updates.
+
+ Bison 3.0.4. Automake 1.15. Gettext 0.19.4.
+
2015-01-20 Arnold D. Robbins <arnold@skeeve.com>
* gawkapi.c (api_set_array_element): Remove useless call to
diff --git a/INSTALL b/INSTALL
index 6e90e07d..20998407 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,7 +1,7 @@
Installation Instructions
*************************
-Copyright (C) 1994-1996, 1999-2002, 2004-2012 Free Software Foundation,
+Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation,
Inc.
Copying and distribution of this file, with or without modification,
@@ -12,8 +12,8 @@ without warranty of any kind.
Basic Installation
==================
- Briefly, the shell commands `./configure; make; make install' should
-configure, build, and install this package. The following
+ Briefly, the shell command `./configure && make && make install'
+should configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package. Some packages provide this
`INSTALL' file but do not implement all of the features documented
diff --git a/Makefile.in b/Makefile.in
index e45c520f..7e39cbf7 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -39,7 +39,17 @@
VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -103,13 +113,6 @@ build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = gawk$(EXEEXT)
subdir = .
-DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
- $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/configure $(am__configure_deps) \
- $(srcdir)/configh.in mkinstalldirs ABOUT-NLS awkgram.c \
- command.c depcomp ylwrap $(include_HEADERS) COPYING TODO \
- compile config.guess config.rpath config.sub install-sh \
- missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
$(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gettext.m4 \
@@ -124,6 +127,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
$(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
+ $(am__configure_deps) $(include_HEADERS) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -257,6 +262,10 @@ ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/configh.in ABOUT-NLS \
+ AUTHORS COPYING ChangeLog INSTALL NEWS README TODO awkgram.c \
+ command.c compile config.guess config.rpath config.sub depcomp \
+ install-sh missing mkinstalldirs ylwrap
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
@@ -570,7 +579,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu Makefile
-.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@@ -913,15 +921,15 @@ dist-xz: distdir
$(am__post_remove_distdir)
dist-tarZ: distdir
- @echo WARNING: "Support for shar distribution archives is" \
- "deprecated." >&2
+ @echo WARNING: "Support for distribution archives compressed with" \
+ "legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
- @echo WARNING: "Support for distribution archives compressed with" \
- "legacy program 'compress' is deprecated." >&2
+ @echo WARNING: "Support for shar distribution archives is" \
+ "deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
@@ -957,17 +965,17 @@ distcheck: dist
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
- mkdir $(distdir)/_build $(distdir)/_inst
+ mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
- && $(am__cd) $(distdir)/_build \
- && ../configure \
+ && $(am__cd) $(distdir)/_build/sub \
+ && ../../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
- --srcdir=.. --prefix="$$dc_install_base" \
+ --srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
@@ -1157,6 +1165,8 @@ uninstall-am: uninstall-binPROGRAMS uninstall-includeHEADERS
tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \
uninstall-includeHEADERS
+.PRECIOUS: Makefile
+
# First, add a link from gawk to gawk-X.Y.Z.
#
diff --git a/NEWS b/NEWS
index 421d2c76..bf1ea842 100644
--- a/NEWS
+++ b/NEWS
@@ -53,6 +53,7 @@ Changes from 4.1.1 to 4.1.2
- Chapter 15 on MPFR reworked.
- Summary sections added to all chapters.
- Exercises added in several chapters.
+ - Heavily proof-read and copyedited.
2. The debugger's "restart" command now works again.
@@ -65,9 +66,10 @@ Changes from 4.1.1 to 4.1.2
6. Built-in functions are now included in FUNCTAB.
-7. In non-English locales, it was accidentally possible to use "letters"
- beside those of the English alphabet in identifiers. This has
- been fixed. (isalpha and isalnum are NOT our friends.)
+7. POSIX and historical practice require the exclusive use of the English
+ alphabet in identifiers. In non-English locales, it was accidentally
+ possible to use "letters" beside those of the English alphabet. This
+ has been fixed. (isalpha and isalnum are NOT our friends.)
If you feel that you must have this misfeature, use `configure --help'
to see what option to use when configuring gawk to reenable it.
@@ -81,8 +83,13 @@ Changes from 4.1.1 to 4.1.2
AWKPATH setting, be sure to put "." in it somewhere. The documentation
has been updated and clarified.
-10. Infrastructure upgrades: Automake 1.14.1, Gettext 0.19.3, Libtool 2.4.3,
- Bison 3.0.3.
+10. Infrastructure upgrades: Automake 1.15, Gettext 0.19.4, Libtool 2.4.5,
+ Bison 3.0.4.
+
+11. POSIX requires that the names of function parameters not be the
+ same as any of the special built-in variables and also not conflict
+ with the names of any functions. Gawk has checked for the former
+ since 3.1.7. It now also checks for the latter.
XX. A number of bugs have been fixed. See the ChangeLog.
diff --git a/aclocal.m4 b/aclocal.m4
index 8907206b..c150e9a8 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.15 -*- Autoconf -*-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to.
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'.])])
-# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+# Copyright (C) 2002-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.14'
+[am__api_version='1.15'
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.14.1], [],
+m4_if([$1], [1.15], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# 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.14.1])dnl
+[AM_AUTOMAKE_VERSION([1.15])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-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -103,15 +103,14 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
])
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -142,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -333,7 +332,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -409,7 +408,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -499,8 +498,8 @@ AC_REQUIRE([AC_PROG_MKDIR_P])dnl
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
+# We need awk for the "check" target (and possibly the TAP driver). The
+# system "awk" is bad on some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
@@ -573,7 +572,11 @@ to "yes", and re-run configure.
END
AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
fi
-fi])
+fi
+dnl The trailing newline in this macro's definition is deliberate, for
+dnl backward compatibility and to allow trailing 'dnl'-style comments
+dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
+])
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
@@ -602,7 +605,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -613,7 +616,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-if test x"${install_sh}" != xset; then
+if test x"${install_sh+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -623,7 +626,7 @@ if test x"${install_sh}" != xset; then
fi
AC_SUBST([install_sh])])
-# Copyright (C) 2003-2013 Free Software Foundation, Inc.
+# Copyright (C) 2003-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -644,7 +647,7 @@ AC_SUBST([am__leading_dot])])
# Check to see how 'make' treats includes. -*- Autoconf -*-
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -694,7 +697,7 @@ rm -f confinc confmf
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -733,7 +736,7 @@ fi
# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -762,7 +765,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -809,7 +812,7 @@ AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -828,7 +831,7 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -909,7 +912,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
-# Copyright (C) 2009-2013 Free Software Foundation, Inc.
+# Copyright (C) 2009-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -969,7 +972,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -997,7 +1000,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006-2013 Free Software Foundation, Inc.
+# Copyright (C) 2006-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1016,7 +1019,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
-# Copyright (C) 2004-2013 Free Software Foundation, Inc.
+# Copyright (C) 2004-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
diff --git a/awk.h b/awk.h
index 52a43c99..0bf1d98c 100644
--- a/awk.h
+++ b/awk.h
@@ -1618,6 +1618,7 @@ extern void free_context(AWK_CONTEXT *ctxt, bool keep_globals);
extern NODE **variable_list();
extern NODE **function_list(bool sort);
extern void print_vars(NODE **table, Func_print print_func, FILE *fp);
+extern bool check_param_names(void);
/* floatcomp.c */
#ifdef HAVE_UINTMAX_T
diff --git a/awkgram.c b/awkgram.c
index 770c96d2..7a184ed5 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -1,4 +1,4 @@
-/* A Bison parser, made by GNU Bison 3.0.3. */
+/* A Bison parser, made by GNU Bison 3.0.4. */
/* Bison implementation for Yacc-like parsers in C
@@ -44,7 +44,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "3.0.3"
+#define YYBISON_VERSION "3.0.4"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -127,6 +127,7 @@ static int one_line_close(int fd);
static void split_comment(void);
static void check_comment(void);
+static bool at_seen = false;
static bool want_source = false;
static bool want_regexp = false; /* lexical scanning kludge */
static char *in_function; /* parsing kludge */
@@ -202,7 +203,7 @@ extern double fmod(double x, double y);
#define YYSTYPE INSTRUCTION *
-#line 206 "awkgram.c" /* yacc.c:339 */
+#line 207 "awkgram.c" /* yacc.c:339 */
# ifndef YY_NULLPTR
# if defined __cplusplus && 201103L <= __cplusplus
@@ -356,7 +357,7 @@ int yyparse (void);
/* Copy the second part of user declarations. */
-#line 360 "awkgram.c" /* yacc.c:358 */
+#line 361 "awkgram.c" /* yacc.c:358 */
#ifdef short
# undef short
@@ -658,25 +659,25 @@ static const yytype_uint8 yytranslate[] =
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 205, 205, 207, 212, 213, 217, 229, 234, 245,
- 251, 256, 264, 272, 274, 279, 287, 289, 295, 303,
- 313, 343, 357, 371, 379, 390, 402, 404, 406, 412,
- 417, 418, 422, 457, 456, 490, 492, 497, 503, 531,
- 536, 537, 541, 543, 545, 552, 642, 684, 726, 839,
- 846, 853, 863, 872, 881, 890, 901, 917, 916, 940,
- 952, 952, 1050, 1050, 1083, 1113, 1119, 1120, 1126, 1127,
- 1134, 1139, 1151, 1165, 1167, 1175, 1180, 1182, 1190, 1192,
- 1201, 1202, 1210, 1215, 1215, 1226, 1230, 1238, 1239, 1242,
- 1244, 1249, 1250, 1259, 1260, 1265, 1270, 1276, 1278, 1280,
- 1287, 1288, 1294, 1295, 1300, 1302, 1307, 1309, 1317, 1322,
- 1331, 1338, 1340, 1342, 1358, 1368, 1375, 1377, 1382, 1384,
- 1386, 1394, 1396, 1401, 1403, 1408, 1410, 1412, 1462, 1464,
- 1466, 1468, 1470, 1472, 1474, 1476, 1490, 1495, 1500, 1525,
- 1531, 1533, 1535, 1537, 1539, 1541, 1546, 1550, 1582, 1584,
- 1590, 1596, 1609, 1610, 1611, 1616, 1621, 1625, 1629, 1644,
- 1657, 1662, 1698, 1716, 1717, 1723, 1724, 1729, 1731, 1738,
- 1755, 1772, 1774, 1781, 1786, 1794, 1804, 1816, 1825, 1829,
- 1833, 1837, 1841, 1845, 1848, 1850, 1854, 1858, 1862
+ 0, 206, 206, 208, 213, 214, 218, 230, 235, 246,
+ 252, 258, 267, 275, 277, 282, 290, 292, 298, 306,
+ 316, 346, 360, 374, 382, 393, 405, 407, 409, 415,
+ 423, 424, 428, 463, 462, 496, 498, 503, 509, 537,
+ 542, 543, 547, 549, 551, 558, 648, 690, 732, 845,
+ 852, 859, 869, 878, 887, 896, 907, 923, 922, 946,
+ 958, 958, 1056, 1056, 1089, 1119, 1125, 1126, 1132, 1133,
+ 1140, 1145, 1157, 1171, 1173, 1181, 1186, 1188, 1196, 1198,
+ 1207, 1208, 1216, 1221, 1221, 1232, 1236, 1244, 1245, 1248,
+ 1250, 1255, 1256, 1265, 1266, 1271, 1276, 1282, 1284, 1286,
+ 1293, 1294, 1300, 1301, 1306, 1308, 1313, 1315, 1323, 1328,
+ 1337, 1344, 1346, 1348, 1364, 1374, 1381, 1383, 1388, 1390,
+ 1392, 1400, 1402, 1407, 1409, 1414, 1416, 1418, 1468, 1470,
+ 1472, 1474, 1476, 1478, 1480, 1482, 1496, 1501, 1506, 1531,
+ 1537, 1539, 1541, 1543, 1545, 1547, 1552, 1556, 1588, 1590,
+ 1596, 1602, 1615, 1616, 1617, 1622, 1627, 1631, 1635, 1650,
+ 1663, 1668, 1705, 1734, 1735, 1741, 1742, 1747, 1749, 1756,
+ 1773, 1790, 1792, 1799, 1804, 1812, 1822, 1834, 1843, 1847,
+ 1851, 1855, 1859, 1863, 1866, 1868, 1872, 1876, 1880
};
#endif
@@ -1849,24 +1850,24 @@ yyreduce:
switch (yyn)
{
case 3:
-#line 208 "awkgram.y" /* yacc.c:1646 */
+#line 209 "awkgram.y" /* yacc.c:1646 */
{
rule = 0;
yyerrok;
}
-#line 1858 "awkgram.c" /* yacc.c:1646 */
+#line 1859 "awkgram.c" /* yacc.c:1646 */
break;
case 5:
-#line 214 "awkgram.y" /* yacc.c:1646 */
+#line 215 "awkgram.y" /* yacc.c:1646 */
{
next_sourcefile();
}
-#line 1866 "awkgram.c" /* yacc.c:1646 */
+#line 1867 "awkgram.c" /* yacc.c:1646 */
break;
case 6:
-#line 218 "awkgram.y" /* yacc.c:1646 */
+#line 219 "awkgram.y" /* yacc.c:1646 */
{
rule = 0;
/*
@@ -1875,20 +1876,20 @@ yyreduce:
*/
/* yyerrok; */
}
-#line 1879 "awkgram.c" /* yacc.c:1646 */
+#line 1880 "awkgram.c" /* yacc.c:1646 */
break;
case 7:
-#line 230 "awkgram.y" /* yacc.c:1646 */
+#line 231 "awkgram.y" /* yacc.c:1646 */
{
(void) append_rule((yyvsp[-1]), (yyvsp[0]));
first_rule = false;
}
-#line 1888 "awkgram.c" /* yacc.c:1646 */
+#line 1889 "awkgram.c" /* yacc.c:1646 */
break;
case 8:
-#line 235 "awkgram.y" /* yacc.c:1646 */
+#line 236 "awkgram.y" /* yacc.c:1646 */
{
if (rule != Rule) {
msg(_("%s blocks must have an action part"), ruletab[rule]);
@@ -1899,39 +1900,41 @@ yyreduce:
} else /* pattern rule with non-empty pattern */
(void) append_rule((yyvsp[-1]), NULL);
}
-#line 1903 "awkgram.c" /* yacc.c:1646 */
+#line 1904 "awkgram.c" /* yacc.c:1646 */
break;
case 9:
-#line 246 "awkgram.y" /* yacc.c:1646 */
+#line 247 "awkgram.y" /* yacc.c:1646 */
{
in_function = NULL;
(void) mk_function((yyvsp[-1]), (yyvsp[0]));
yyerrok;
}
-#line 1913 "awkgram.c" /* yacc.c:1646 */
+#line 1914 "awkgram.c" /* yacc.c:1646 */
break;
case 10:
-#line 252 "awkgram.y" /* yacc.c:1646 */
+#line 253 "awkgram.y" /* yacc.c:1646 */
{
want_source = false;
+ at_seen = false;
yyerrok;
}
-#line 1922 "awkgram.c" /* yacc.c:1646 */
+#line 1924 "awkgram.c" /* yacc.c:1646 */
break;
case 11:
-#line 257 "awkgram.y" /* yacc.c:1646 */
+#line 259 "awkgram.y" /* yacc.c:1646 */
{
want_source = false;
+ at_seen = false;
yyerrok;
}
-#line 1931 "awkgram.c" /* yacc.c:1646 */
+#line 1934 "awkgram.c" /* yacc.c:1646 */
break;
case 12:
-#line 265 "awkgram.y" /* yacc.c:1646 */
+#line 268 "awkgram.y" /* yacc.c:1646 */
{
if (include_source((yyvsp[0])) < 0)
YYABORT;
@@ -1939,23 +1942,23 @@ yyreduce:
bcfree((yyvsp[0]));
(yyval) = NULL;
}
-#line 1943 "awkgram.c" /* yacc.c:1646 */
+#line 1946 "awkgram.c" /* yacc.c:1646 */
break;
case 13:
-#line 273 "awkgram.y" /* yacc.c:1646 */
+#line 276 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 1949 "awkgram.c" /* yacc.c:1646 */
+#line 1952 "awkgram.c" /* yacc.c:1646 */
break;
case 14:
-#line 275 "awkgram.y" /* yacc.c:1646 */
+#line 278 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 1955 "awkgram.c" /* yacc.c:1646 */
+#line 1958 "awkgram.c" /* yacc.c:1646 */
break;
case 15:
-#line 280 "awkgram.y" /* yacc.c:1646 */
+#line 283 "awkgram.y" /* yacc.c:1646 */
{
if (load_library((yyvsp[0])) < 0)
YYABORT;
@@ -1963,23 +1966,23 @@ yyreduce:
bcfree((yyvsp[0]));
(yyval) = NULL;
}
-#line 1967 "awkgram.c" /* yacc.c:1646 */
+#line 1970 "awkgram.c" /* yacc.c:1646 */
break;
case 16:
-#line 288 "awkgram.y" /* yacc.c:1646 */
+#line 291 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 1973 "awkgram.c" /* yacc.c:1646 */
+#line 1976 "awkgram.c" /* yacc.c:1646 */
break;
case 17:
-#line 290 "awkgram.y" /* yacc.c:1646 */
+#line 293 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 1979 "awkgram.c" /* yacc.c:1646 */
+#line 1982 "awkgram.c" /* yacc.c:1646 */
break;
case 18:
-#line 295 "awkgram.y" /* yacc.c:1646 */
+#line 298 "awkgram.y" /* yacc.c:1646 */
{
rule = Rule;
if (comment != NULL) {
@@ -1988,11 +1991,11 @@ yyreduce:
} else
(yyval) = NULL;
}
-#line 1992 "awkgram.c" /* yacc.c:1646 */
+#line 1995 "awkgram.c" /* yacc.c:1646 */
break;
case 19:
-#line 304 "awkgram.y" /* yacc.c:1646 */
+#line 307 "awkgram.y" /* yacc.c:1646 */
{
rule = Rule;
if (comment != NULL) {
@@ -2001,11 +2004,11 @@ yyreduce:
} else
(yyval) = (yyvsp[0]);
}
-#line 2005 "awkgram.c" /* yacc.c:1646 */
+#line 2008 "awkgram.c" /* yacc.c:1646 */
break;
case 20:
-#line 314 "awkgram.y" /* yacc.c:1646 */
+#line 317 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *tp;
@@ -2035,11 +2038,11 @@ yyreduce:
(yyval) = list_append(list_merge((yyvsp[-3]), (yyvsp[0])), tp);
rule = Rule;
}
-#line 2039 "awkgram.c" /* yacc.c:1646 */
+#line 2042 "awkgram.c" /* yacc.c:1646 */
break;
case 21:
-#line 344 "awkgram.y" /* yacc.c:1646 */
+#line 347 "awkgram.y" /* yacc.c:1646 */
{
static int begin_seen = 0;
@@ -2053,11 +2056,11 @@ yyreduce:
check_comment();
(yyval) = (yyvsp[0]);
}
-#line 2057 "awkgram.c" /* yacc.c:1646 */
+#line 2060 "awkgram.c" /* yacc.c:1646 */
break;
case 22:
-#line 358 "awkgram.y" /* yacc.c:1646 */
+#line 361 "awkgram.y" /* yacc.c:1646 */
{
static int end_seen = 0;
@@ -2071,11 +2074,11 @@ yyreduce:
check_comment();
(yyval) = (yyvsp[0]);
}
-#line 2075 "awkgram.c" /* yacc.c:1646 */
+#line 2078 "awkgram.c" /* yacc.c:1646 */
break;
case 23:
-#line 372 "awkgram.y" /* yacc.c:1646 */
+#line 375 "awkgram.y" /* yacc.c:1646 */
{
func_first = false;
(yyvsp[0])->in_rule = rule = BEGINFILE;
@@ -2083,11 +2086,11 @@ yyreduce:
check_comment();
(yyval) = (yyvsp[0]);
}
-#line 2087 "awkgram.c" /* yacc.c:1646 */
+#line 2090 "awkgram.c" /* yacc.c:1646 */
break;
case 24:
-#line 380 "awkgram.y" /* yacc.c:1646 */
+#line 383 "awkgram.y" /* yacc.c:1646 */
{
func_first = false;
(yyvsp[0])->in_rule = rule = ENDFILE;
@@ -2095,11 +2098,11 @@ yyreduce:
check_comment();
(yyval) = (yyvsp[0]);
}
-#line 2099 "awkgram.c" /* yacc.c:1646 */
+#line 2102 "awkgram.c" /* yacc.c:1646 */
break;
case 25:
-#line 391 "awkgram.y" /* yacc.c:1646 */
+#line 394 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *ip;
if ((yyvsp[-3]) == NULL)
@@ -2108,39 +2111,42 @@ yyreduce:
ip = (yyvsp[-3]);
(yyval) = ip;
}
-#line 2112 "awkgram.c" /* yacc.c:1646 */
+#line 2115 "awkgram.c" /* yacc.c:1646 */
break;
case 26:
-#line 403 "awkgram.y" /* yacc.c:1646 */
+#line 406 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 2118 "awkgram.c" /* yacc.c:1646 */
+#line 2121 "awkgram.c" /* yacc.c:1646 */
break;
case 27:
-#line 405 "awkgram.y" /* yacc.c:1646 */
+#line 408 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 2124 "awkgram.c" /* yacc.c:1646 */
+#line 2127 "awkgram.c" /* yacc.c:1646 */
break;
case 28:
-#line 407 "awkgram.y" /* yacc.c:1646 */
+#line 410 "awkgram.y" /* yacc.c:1646 */
{
yyerror(_("`%s' is a built-in function, it cannot be redefined"),
tokstart);
YYABORT;
}
-#line 2134 "awkgram.c" /* yacc.c:1646 */
+#line 2137 "awkgram.c" /* yacc.c:1646 */
break;
case 29:
-#line 413 "awkgram.y" /* yacc.c:1646 */
- { (yyval) = (yyvsp[0]); }
-#line 2140 "awkgram.c" /* yacc.c:1646 */
+#line 416 "awkgram.y" /* yacc.c:1646 */
+ {
+ (yyval) = (yyvsp[0]);
+ at_seen = false;
+ }
+#line 2146 "awkgram.c" /* yacc.c:1646 */
break;
case 32:
-#line 423 "awkgram.y" /* yacc.c:1646 */
+#line 429 "awkgram.y" /* yacc.c:1646 */
{
/*
* treat any comments between BOF and the first function
@@ -2167,17 +2173,17 @@ yyreduce:
/* $4 already free'd in install_function */
(yyval) = (yyvsp[-5]);
}
-#line 2171 "awkgram.c" /* yacc.c:1646 */
+#line 2177 "awkgram.c" /* yacc.c:1646 */
break;
case 33:
-#line 457 "awkgram.y" /* yacc.c:1646 */
+#line 463 "awkgram.y" /* yacc.c:1646 */
{ want_regexp = true; }
-#line 2177 "awkgram.c" /* yacc.c:1646 */
+#line 2183 "awkgram.c" /* yacc.c:1646 */
break;
case 34:
-#line 459 "awkgram.y" /* yacc.c:1646 */
+#line 465 "awkgram.y" /* yacc.c:1646 */
{
NODE *n, *exp;
char *re;
@@ -2206,28 +2212,28 @@ yyreduce:
(yyval)->opcode = Op_match_rec;
(yyval)->memory = n;
}
-#line 2210 "awkgram.c" /* yacc.c:1646 */
+#line 2216 "awkgram.c" /* yacc.c:1646 */
break;
case 35:
-#line 491 "awkgram.y" /* yacc.c:1646 */
+#line 497 "awkgram.y" /* yacc.c:1646 */
{ bcfree((yyvsp[0])); }
-#line 2216 "awkgram.c" /* yacc.c:1646 */
+#line 2222 "awkgram.c" /* yacc.c:1646 */
break;
case 37:
-#line 497 "awkgram.y" /* yacc.c:1646 */
+#line 503 "awkgram.y" /* yacc.c:1646 */
{
if (comment != NULL) {
(yyval) = list_create(comment);
comment = NULL;
} else (yyval) = NULL;
}
-#line 2227 "awkgram.c" /* yacc.c:1646 */
+#line 2233 "awkgram.c" /* yacc.c:1646 */
break;
case 38:
-#line 504 "awkgram.y" /* yacc.c:1646 */
+#line 510 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0]) == NULL) {
if (comment == NULL)
@@ -2255,40 +2261,40 @@ yyreduce:
}
yyerrok;
}
-#line 2259 "awkgram.c" /* yacc.c:1646 */
+#line 2265 "awkgram.c" /* yacc.c:1646 */
break;
case 39:
-#line 532 "awkgram.y" /* yacc.c:1646 */
+#line 538 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2265 "awkgram.c" /* yacc.c:1646 */
+#line 2271 "awkgram.c" /* yacc.c:1646 */
break;
case 42:
-#line 542 "awkgram.y" /* yacc.c:1646 */
+#line 548 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2271 "awkgram.c" /* yacc.c:1646 */
+#line 2277 "awkgram.c" /* yacc.c:1646 */
break;
case 43:
-#line 544 "awkgram.y" /* yacc.c:1646 */
+#line 550 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 2277 "awkgram.c" /* yacc.c:1646 */
+#line 2283 "awkgram.c" /* yacc.c:1646 */
break;
case 44:
-#line 546 "awkgram.y" /* yacc.c:1646 */
+#line 552 "awkgram.y" /* yacc.c:1646 */
{
if (do_pretty_print)
(yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count));
else
(yyval) = (yyvsp[0]);
}
-#line 2288 "awkgram.c" /* yacc.c:1646 */
+#line 2294 "awkgram.c" /* yacc.c:1646 */
break;
case 45:
-#line 553 "awkgram.y" /* yacc.c:1646 */
+#line 559 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *dflt, *curr = NULL, *cexp, *cstmt;
INSTRUCTION *ip, *nextc, *tbreak;
@@ -2378,11 +2384,11 @@ yyreduce:
break_allowed--;
fix_break_continue(ip, tbreak, NULL);
}
-#line 2382 "awkgram.c" /* yacc.c:1646 */
+#line 2388 "awkgram.c" /* yacc.c:1646 */
break;
case 46:
-#line 643 "awkgram.y" /* yacc.c:1646 */
+#line 649 "awkgram.y" /* yacc.c:1646 */
{
/*
* -----------------
@@ -2424,11 +2430,11 @@ yyreduce:
continue_allowed--;
fix_break_continue(ip, tbreak, tcont);
}
-#line 2428 "awkgram.c" /* yacc.c:1646 */
+#line 2434 "awkgram.c" /* yacc.c:1646 */
break;
case 47:
-#line 685 "awkgram.y" /* yacc.c:1646 */
+#line 691 "awkgram.y" /* yacc.c:1646 */
{
/*
* -----------------
@@ -2470,11 +2476,11 @@ yyreduce:
} /* else
$1 and $4 are NULLs */
}
-#line 2474 "awkgram.c" /* yacc.c:1646 */
+#line 2480 "awkgram.c" /* yacc.c:1646 */
break;
case 48:
-#line 727 "awkgram.y" /* yacc.c:1646 */
+#line 733 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *ip;
char *var_name = (yyvsp[-5])->lextok;
@@ -2587,44 +2593,44 @@ regular_loop:
break_allowed--;
continue_allowed--;
}
-#line 2591 "awkgram.c" /* yacc.c:1646 */
+#line 2597 "awkgram.c" /* yacc.c:1646 */
break;
case 49:
-#line 840 "awkgram.y" /* yacc.c:1646 */
+#line 846 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_for_loop((yyvsp[-11]), (yyvsp[-9]), (yyvsp[-6]), (yyvsp[-3]), (yyvsp[0]));
break_allowed--;
continue_allowed--;
}
-#line 2602 "awkgram.c" /* yacc.c:1646 */
+#line 2608 "awkgram.c" /* yacc.c:1646 */
break;
case 50:
-#line 847 "awkgram.y" /* yacc.c:1646 */
+#line 853 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_for_loop((yyvsp[-10]), (yyvsp[-8]), (INSTRUCTION *) NULL, (yyvsp[-3]), (yyvsp[0]));
break_allowed--;
continue_allowed--;
}
-#line 2613 "awkgram.c" /* yacc.c:1646 */
+#line 2619 "awkgram.c" /* yacc.c:1646 */
break;
case 51:
-#line 854 "awkgram.y" /* yacc.c:1646 */
+#line 860 "awkgram.y" /* yacc.c:1646 */
{
if (do_pretty_print)
(yyval) = list_prepend((yyvsp[0]), instruction(Op_exec_count));
else
(yyval) = (yyvsp[0]);
}
-#line 2624 "awkgram.c" /* yacc.c:1646 */
+#line 2630 "awkgram.c" /* yacc.c:1646 */
break;
case 52:
-#line 864 "awkgram.y" /* yacc.c:1646 */
+#line 870 "awkgram.y" /* yacc.c:1646 */
{
if (! break_allowed)
error_ln((yyvsp[-1])->source_line,
@@ -2633,11 +2639,11 @@ regular_loop:
(yyval) = list_create((yyvsp[-1]));
}
-#line 2637 "awkgram.c" /* yacc.c:1646 */
+#line 2643 "awkgram.c" /* yacc.c:1646 */
break;
case 53:
-#line 873 "awkgram.y" /* yacc.c:1646 */
+#line 879 "awkgram.y" /* yacc.c:1646 */
{
if (! continue_allowed)
error_ln((yyvsp[-1])->source_line,
@@ -2646,11 +2652,11 @@ regular_loop:
(yyval) = list_create((yyvsp[-1]));
}
-#line 2650 "awkgram.c" /* yacc.c:1646 */
+#line 2656 "awkgram.c" /* yacc.c:1646 */
break;
case 54:
-#line 882 "awkgram.y" /* yacc.c:1646 */
+#line 888 "awkgram.y" /* yacc.c:1646 */
{
/* if inside function (rule = 0), resolve context at run-time */
if (rule && rule != Rule)
@@ -2659,11 +2665,11 @@ regular_loop:
(yyvsp[-1])->target_jmp = ip_rec;
(yyval) = list_create((yyvsp[-1]));
}
-#line 2663 "awkgram.c" /* yacc.c:1646 */
+#line 2669 "awkgram.c" /* yacc.c:1646 */
break;
case 55:
-#line 891 "awkgram.y" /* yacc.c:1646 */
+#line 897 "awkgram.y" /* yacc.c:1646 */
{
/* if inside function (rule = 0), resolve context at run-time */
if (rule == BEGIN || rule == END || rule == ENDFILE)
@@ -2674,11 +2680,11 @@ regular_loop:
(yyvsp[-1])->target_endfile = ip_endfile;
(yyval) = list_create((yyvsp[-1]));
}
-#line 2678 "awkgram.c" /* yacc.c:1646 */
+#line 2684 "awkgram.c" /* yacc.c:1646 */
break;
case 56:
-#line 902 "awkgram.y" /* yacc.c:1646 */
+#line 908 "awkgram.y" /* yacc.c:1646 */
{
/* Initialize the two possible jump targets, the actual target
* is resolved at run-time.
@@ -2693,20 +2699,20 @@ regular_loop:
} else
(yyval) = list_append((yyvsp[-1]), (yyvsp[-2]));
}
-#line 2697 "awkgram.c" /* yacc.c:1646 */
+#line 2703 "awkgram.c" /* yacc.c:1646 */
break;
case 57:
-#line 917 "awkgram.y" /* yacc.c:1646 */
+#line 923 "awkgram.y" /* yacc.c:1646 */
{
if (! in_function)
yyerror(_("`return' used outside function context"));
}
-#line 2706 "awkgram.c" /* yacc.c:1646 */
+#line 2712 "awkgram.c" /* yacc.c:1646 */
break;
case 58:
-#line 920 "awkgram.y" /* yacc.c:1646 */
+#line 926 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-1]) == NULL) {
(yyval) = list_create((yyvsp[-3]));
@@ -2727,17 +2733,17 @@ regular_loop:
(yyval) = list_append((yyvsp[-1]), (yyvsp[-3]));
}
}
-#line 2731 "awkgram.c" /* yacc.c:1646 */
+#line 2737 "awkgram.c" /* yacc.c:1646 */
break;
case 60:
-#line 952 "awkgram.y" /* yacc.c:1646 */
+#line 958 "awkgram.y" /* yacc.c:1646 */
{ in_print = true; in_parens = 0; }
-#line 2737 "awkgram.c" /* yacc.c:1646 */
+#line 2743 "awkgram.c" /* yacc.c:1646 */
break;
case 61:
-#line 953 "awkgram.y" /* yacc.c:1646 */
+#line 959 "awkgram.y" /* yacc.c:1646 */
{
/*
* Optimization: plain `print' has no expression list, so $3 is null.
@@ -2834,17 +2840,17 @@ regular_print:
}
}
}
-#line 2838 "awkgram.c" /* yacc.c:1646 */
+#line 2844 "awkgram.c" /* yacc.c:1646 */
break;
case 62:
-#line 1050 "awkgram.y" /* yacc.c:1646 */
+#line 1056 "awkgram.y" /* yacc.c:1646 */
{ sub_counter = 0; }
-#line 2844 "awkgram.c" /* yacc.c:1646 */
+#line 2850 "awkgram.c" /* yacc.c:1646 */
break;
case 63:
-#line 1051 "awkgram.y" /* yacc.c:1646 */
+#line 1057 "awkgram.y" /* yacc.c:1646 */
{
char *arr = (yyvsp[-2])->lextok;
@@ -2877,11 +2883,11 @@ regular_print:
(yyval) = list_append(list_append((yyvsp[0]), (yyvsp[-2])), (yyvsp[-3]));
}
}
-#line 2881 "awkgram.c" /* yacc.c:1646 */
+#line 2887 "awkgram.c" /* yacc.c:1646 */
break;
case 64:
-#line 1088 "awkgram.y" /* yacc.c:1646 */
+#line 1094 "awkgram.y" /* yacc.c:1646 */
{
static bool warned = false;
char *arr = (yyvsp[-1])->lextok;
@@ -2907,52 +2913,52 @@ regular_print:
fatal(_("`delete' is not allowed with FUNCTAB"));
}
}
-#line 2911 "awkgram.c" /* yacc.c:1646 */
+#line 2917 "awkgram.c" /* yacc.c:1646 */
break;
case 65:
-#line 1114 "awkgram.y" /* yacc.c:1646 */
+#line 1120 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = optimize_assignment((yyvsp[0])); }
-#line 2917 "awkgram.c" /* yacc.c:1646 */
+#line 2923 "awkgram.c" /* yacc.c:1646 */
break;
case 66:
-#line 1119 "awkgram.y" /* yacc.c:1646 */
+#line 1125 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2923 "awkgram.c" /* yacc.c:1646 */
+#line 2929 "awkgram.c" /* yacc.c:1646 */
break;
case 67:
-#line 1121 "awkgram.y" /* yacc.c:1646 */
+#line 1127 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 2929 "awkgram.c" /* yacc.c:1646 */
+#line 2935 "awkgram.c" /* yacc.c:1646 */
break;
case 68:
-#line 1126 "awkgram.y" /* yacc.c:1646 */
+#line 1132 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2935 "awkgram.c" /* yacc.c:1646 */
+#line 2941 "awkgram.c" /* yacc.c:1646 */
break;
case 69:
-#line 1128 "awkgram.y" /* yacc.c:1646 */
+#line 1134 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-1]) == NULL)
(yyval) = list_create((yyvsp[0]));
else
(yyval) = list_prepend((yyvsp[-1]), (yyvsp[0]));
}
-#line 2946 "awkgram.c" /* yacc.c:1646 */
+#line 2952 "awkgram.c" /* yacc.c:1646 */
break;
case 70:
-#line 1135 "awkgram.y" /* yacc.c:1646 */
+#line 1141 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 2952 "awkgram.c" /* yacc.c:1646 */
+#line 2958 "awkgram.c" /* yacc.c:1646 */
break;
case 71:
-#line 1140 "awkgram.y" /* yacc.c:1646 */
+#line 1146 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *casestmt = (yyvsp[0]);
if ((yyvsp[0]) == NULL)
@@ -2964,11 +2970,11 @@ regular_print:
bcfree((yyvsp[-2]));
(yyval) = (yyvsp[-4]);
}
-#line 2968 "awkgram.c" /* yacc.c:1646 */
+#line 2974 "awkgram.c" /* yacc.c:1646 */
break;
case 72:
-#line 1152 "awkgram.y" /* yacc.c:1646 */
+#line 1158 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *casestmt = (yyvsp[0]);
if ((yyvsp[0]) == NULL)
@@ -2979,17 +2985,17 @@ regular_print:
(yyvsp[-3])->case_stmt = casestmt;
(yyval) = (yyvsp[-3]);
}
-#line 2983 "awkgram.c" /* yacc.c:1646 */
+#line 2989 "awkgram.c" /* yacc.c:1646 */
break;
case 73:
-#line 1166 "awkgram.y" /* yacc.c:1646 */
+#line 1172 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 2989 "awkgram.c" /* yacc.c:1646 */
+#line 2995 "awkgram.c" /* yacc.c:1646 */
break;
case 74:
-#line 1168 "awkgram.y" /* yacc.c:1646 */
+#line 1174 "awkgram.y" /* yacc.c:1646 */
{
NODE *n = (yyvsp[0])->memory;
(void) force_number(n);
@@ -2997,71 +3003,71 @@ regular_print:
bcfree((yyvsp[-1]));
(yyval) = (yyvsp[0]);
}
-#line 3001 "awkgram.c" /* yacc.c:1646 */
+#line 3007 "awkgram.c" /* yacc.c:1646 */
break;
case 75:
-#line 1176 "awkgram.y" /* yacc.c:1646 */
+#line 1182 "awkgram.y" /* yacc.c:1646 */
{
bcfree((yyvsp[-1]));
(yyval) = (yyvsp[0]);
}
-#line 3010 "awkgram.c" /* yacc.c:1646 */
+#line 3016 "awkgram.c" /* yacc.c:1646 */
break;
case 76:
-#line 1181 "awkgram.y" /* yacc.c:1646 */
+#line 1187 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3016 "awkgram.c" /* yacc.c:1646 */
+#line 3022 "awkgram.c" /* yacc.c:1646 */
break;
case 77:
-#line 1183 "awkgram.y" /* yacc.c:1646 */
+#line 1189 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_push_re;
(yyval) = (yyvsp[0]);
}
-#line 3025 "awkgram.c" /* yacc.c:1646 */
+#line 3031 "awkgram.c" /* yacc.c:1646 */
break;
case 78:
-#line 1191 "awkgram.y" /* yacc.c:1646 */
+#line 1197 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3031 "awkgram.c" /* yacc.c:1646 */
+#line 3037 "awkgram.c" /* yacc.c:1646 */
break;
case 79:
-#line 1193 "awkgram.y" /* yacc.c:1646 */
+#line 1199 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3037 "awkgram.c" /* yacc.c:1646 */
+#line 3043 "awkgram.c" /* yacc.c:1646 */
break;
case 81:
-#line 1203 "awkgram.y" /* yacc.c:1646 */
+#line 1209 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = (yyvsp[-1]);
}
-#line 3045 "awkgram.c" /* yacc.c:1646 */
+#line 3051 "awkgram.c" /* yacc.c:1646 */
break;
case 82:
-#line 1210 "awkgram.y" /* yacc.c:1646 */
+#line 1216 "awkgram.y" /* yacc.c:1646 */
{
in_print = false;
in_parens = 0;
(yyval) = NULL;
}
-#line 3055 "awkgram.c" /* yacc.c:1646 */
+#line 3061 "awkgram.c" /* yacc.c:1646 */
break;
case 83:
-#line 1215 "awkgram.y" /* yacc.c:1646 */
+#line 1221 "awkgram.y" /* yacc.c:1646 */
{ in_print = false; in_parens = 0; }
-#line 3061 "awkgram.c" /* yacc.c:1646 */
+#line 3067 "awkgram.c" /* yacc.c:1646 */
break;
case 84:
-#line 1216 "awkgram.y" /* yacc.c:1646 */
+#line 1222 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-2])->redir_type == redirect_twoway
&& (yyvsp[0])->lasti->opcode == Op_K_getline_redir
@@ -3069,136 +3075,136 @@ regular_print:
yyerror(_("multistage two-way pipelines don't work"));
(yyval) = list_prepend((yyvsp[0]), (yyvsp[-2]));
}
-#line 3073 "awkgram.c" /* yacc.c:1646 */
+#line 3079 "awkgram.c" /* yacc.c:1646 */
break;
case 85:
-#line 1227 "awkgram.y" /* yacc.c:1646 */
+#line 1233 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_condition((yyvsp[-3]), (yyvsp[-5]), (yyvsp[0]), NULL, NULL);
}
-#line 3081 "awkgram.c" /* yacc.c:1646 */
+#line 3087 "awkgram.c" /* yacc.c:1646 */
break;
case 86:
-#line 1232 "awkgram.y" /* yacc.c:1646 */
+#line 1238 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_condition((yyvsp[-6]), (yyvsp[-8]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[0]));
}
-#line 3089 "awkgram.c" /* yacc.c:1646 */
+#line 3095 "awkgram.c" /* yacc.c:1646 */
break;
case 91:
-#line 1249 "awkgram.y" /* yacc.c:1646 */
+#line 1255 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3095 "awkgram.c" /* yacc.c:1646 */
+#line 3101 "awkgram.c" /* yacc.c:1646 */
break;
case 92:
-#line 1251 "awkgram.y" /* yacc.c:1646 */
+#line 1257 "awkgram.y" /* yacc.c:1646 */
{
bcfree((yyvsp[-1]));
(yyval) = (yyvsp[0]);
}
-#line 3104 "awkgram.c" /* yacc.c:1646 */
+#line 3110 "awkgram.c" /* yacc.c:1646 */
break;
case 93:
-#line 1259 "awkgram.y" /* yacc.c:1646 */
+#line 1265 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3110 "awkgram.c" /* yacc.c:1646 */
+#line 3116 "awkgram.c" /* yacc.c:1646 */
break;
case 94:
-#line 1261 "awkgram.y" /* yacc.c:1646 */
+#line 1267 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3116 "awkgram.c" /* yacc.c:1646 */
+#line 3122 "awkgram.c" /* yacc.c:1646 */
break;
case 95:
-#line 1266 "awkgram.y" /* yacc.c:1646 */
+#line 1272 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->param_count = 0;
(yyval) = list_create((yyvsp[0]));
}
-#line 3125 "awkgram.c" /* yacc.c:1646 */
+#line 3131 "awkgram.c" /* yacc.c:1646 */
break;
case 96:
-#line 1271 "awkgram.y" /* yacc.c:1646 */
+#line 1277 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->param_count = (yyvsp[-2])->lasti->param_count + 1;
(yyval) = list_append((yyvsp[-2]), (yyvsp[0]));
yyerrok;
}
-#line 3135 "awkgram.c" /* yacc.c:1646 */
+#line 3141 "awkgram.c" /* yacc.c:1646 */
break;
case 97:
-#line 1277 "awkgram.y" /* yacc.c:1646 */
+#line 1283 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3141 "awkgram.c" /* yacc.c:1646 */
+#line 3147 "awkgram.c" /* yacc.c:1646 */
break;
case 98:
-#line 1279 "awkgram.y" /* yacc.c:1646 */
+#line 1285 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 3147 "awkgram.c" /* yacc.c:1646 */
+#line 3153 "awkgram.c" /* yacc.c:1646 */
break;
case 99:
-#line 1281 "awkgram.y" /* yacc.c:1646 */
+#line 1287 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-2]); }
-#line 3153 "awkgram.c" /* yacc.c:1646 */
+#line 3159 "awkgram.c" /* yacc.c:1646 */
break;
case 100:
-#line 1287 "awkgram.y" /* yacc.c:1646 */
+#line 1293 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3159 "awkgram.c" /* yacc.c:1646 */
+#line 3165 "awkgram.c" /* yacc.c:1646 */
break;
case 101:
-#line 1289 "awkgram.y" /* yacc.c:1646 */
+#line 1295 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3165 "awkgram.c" /* yacc.c:1646 */
+#line 3171 "awkgram.c" /* yacc.c:1646 */
break;
case 102:
-#line 1294 "awkgram.y" /* yacc.c:1646 */
+#line 1300 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3171 "awkgram.c" /* yacc.c:1646 */
+#line 3177 "awkgram.c" /* yacc.c:1646 */
break;
case 103:
-#line 1296 "awkgram.y" /* yacc.c:1646 */
+#line 1302 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3177 "awkgram.c" /* yacc.c:1646 */
+#line 3183 "awkgram.c" /* yacc.c:1646 */
break;
case 104:
-#line 1301 "awkgram.y" /* yacc.c:1646 */
+#line 1307 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_expression_list(NULL, (yyvsp[0])); }
-#line 3183 "awkgram.c" /* yacc.c:1646 */
+#line 3189 "awkgram.c" /* yacc.c:1646 */
break;
case 105:
-#line 1303 "awkgram.y" /* yacc.c:1646 */
+#line 1309 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
yyerrok;
}
-#line 3192 "awkgram.c" /* yacc.c:1646 */
+#line 3198 "awkgram.c" /* yacc.c:1646 */
break;
case 106:
-#line 1308 "awkgram.y" /* yacc.c:1646 */
+#line 1314 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3198 "awkgram.c" /* yacc.c:1646 */
+#line 3204 "awkgram.c" /* yacc.c:1646 */
break;
case 107:
-#line 1310 "awkgram.y" /* yacc.c:1646 */
+#line 1316 "awkgram.y" /* yacc.c:1646 */
{
/*
* Returning the expression list instead of NULL lets
@@ -3206,52 +3212,52 @@ regular_print:
*/
(yyval) = (yyvsp[-1]);
}
-#line 3210 "awkgram.c" /* yacc.c:1646 */
+#line 3216 "awkgram.c" /* yacc.c:1646 */
break;
case 108:
-#line 1318 "awkgram.y" /* yacc.c:1646 */
+#line 1324 "awkgram.y" /* yacc.c:1646 */
{
/* Ditto */
(yyval) = mk_expression_list((yyvsp[-2]), (yyvsp[0]));
}
-#line 3219 "awkgram.c" /* yacc.c:1646 */
+#line 3225 "awkgram.c" /* yacc.c:1646 */
break;
case 109:
-#line 1323 "awkgram.y" /* yacc.c:1646 */
+#line 1329 "awkgram.y" /* yacc.c:1646 */
{
/* Ditto */
(yyval) = (yyvsp[-2]);
}
-#line 3228 "awkgram.c" /* yacc.c:1646 */
+#line 3234 "awkgram.c" /* yacc.c:1646 */
break;
case 110:
-#line 1332 "awkgram.y" /* yacc.c:1646 */
+#line 1338 "awkgram.y" /* yacc.c:1646 */
{
if (do_lint && (yyvsp[0])->lasti->opcode == Op_match_rec)
lintwarn_ln((yyvsp[-1])->source_line,
_("regular expression on right of assignment"));
(yyval) = mk_assignment((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1]));
}
-#line 3239 "awkgram.c" /* yacc.c:1646 */
+#line 3245 "awkgram.c" /* yacc.c:1646 */
break;
case 111:
-#line 1339 "awkgram.y" /* yacc.c:1646 */
+#line 1345 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3245 "awkgram.c" /* yacc.c:1646 */
+#line 3251 "awkgram.c" /* yacc.c:1646 */
break;
case 112:
-#line 1341 "awkgram.y" /* yacc.c:1646 */
+#line 1347 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_boolean((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3251 "awkgram.c" /* yacc.c:1646 */
+#line 3257 "awkgram.c" /* yacc.c:1646 */
break;
case 113:
-#line 1343 "awkgram.y" /* yacc.c:1646 */
+#line 1349 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[-2])->lasti->opcode == Op_match_rec)
warning_ln((yyvsp[-1])->source_line,
@@ -3267,11 +3273,11 @@ regular_print:
(yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1]));
}
}
-#line 3271 "awkgram.c" /* yacc.c:1646 */
+#line 3277 "awkgram.c" /* yacc.c:1646 */
break;
case 114:
-#line 1359 "awkgram.y" /* yacc.c:1646 */
+#line 1365 "awkgram.y" /* yacc.c:1646 */
{
if (do_lint_old)
warning_ln((yyvsp[-1])->source_line,
@@ -3281,91 +3287,91 @@ regular_print:
(yyvsp[-1])->expr_count = 1;
(yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1]));
}
-#line 3285 "awkgram.c" /* yacc.c:1646 */
+#line 3291 "awkgram.c" /* yacc.c:1646 */
break;
case 115:
-#line 1369 "awkgram.y" /* yacc.c:1646 */
+#line 1375 "awkgram.y" /* yacc.c:1646 */
{
if (do_lint && (yyvsp[0])->lasti->opcode == Op_match_rec)
lintwarn_ln((yyvsp[-1])->source_line,
_("regular expression on right of comparison"));
(yyval) = list_append(list_merge((yyvsp[-2]), (yyvsp[0])), (yyvsp[-1]));
}
-#line 3296 "awkgram.c" /* yacc.c:1646 */
+#line 3302 "awkgram.c" /* yacc.c:1646 */
break;
case 116:
-#line 1376 "awkgram.y" /* yacc.c:1646 */
+#line 1382 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_condition((yyvsp[-4]), (yyvsp[-3]), (yyvsp[-2]), (yyvsp[-1]), (yyvsp[0])); }
-#line 3302 "awkgram.c" /* yacc.c:1646 */
+#line 3308 "awkgram.c" /* yacc.c:1646 */
break;
case 117:
-#line 1378 "awkgram.y" /* yacc.c:1646 */
+#line 1384 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3308 "awkgram.c" /* yacc.c:1646 */
+#line 3314 "awkgram.c" /* yacc.c:1646 */
break;
case 118:
-#line 1383 "awkgram.y" /* yacc.c:1646 */
+#line 1389 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3314 "awkgram.c" /* yacc.c:1646 */
+#line 3320 "awkgram.c" /* yacc.c:1646 */
break;
case 119:
-#line 1385 "awkgram.y" /* yacc.c:1646 */
+#line 1391 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3320 "awkgram.c" /* yacc.c:1646 */
+#line 3326 "awkgram.c" /* yacc.c:1646 */
break;
case 120:
-#line 1387 "awkgram.y" /* yacc.c:1646 */
+#line 1393 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_assign_quotient;
(yyval) = (yyvsp[0]);
}
-#line 3329 "awkgram.c" /* yacc.c:1646 */
+#line 3335 "awkgram.c" /* yacc.c:1646 */
break;
case 121:
-#line 1395 "awkgram.y" /* yacc.c:1646 */
+#line 1401 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3335 "awkgram.c" /* yacc.c:1646 */
+#line 3341 "awkgram.c" /* yacc.c:1646 */
break;
case 122:
-#line 1397 "awkgram.y" /* yacc.c:1646 */
+#line 1403 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3341 "awkgram.c" /* yacc.c:1646 */
+#line 3347 "awkgram.c" /* yacc.c:1646 */
break;
case 123:
-#line 1402 "awkgram.y" /* yacc.c:1646 */
+#line 1408 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3347 "awkgram.c" /* yacc.c:1646 */
+#line 3353 "awkgram.c" /* yacc.c:1646 */
break;
case 124:
-#line 1404 "awkgram.y" /* yacc.c:1646 */
+#line 1410 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3353 "awkgram.c" /* yacc.c:1646 */
+#line 3359 "awkgram.c" /* yacc.c:1646 */
break;
case 125:
-#line 1409 "awkgram.y" /* yacc.c:1646 */
+#line 1415 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3359 "awkgram.c" /* yacc.c:1646 */
+#line 3365 "awkgram.c" /* yacc.c:1646 */
break;
case 126:
-#line 1411 "awkgram.y" /* yacc.c:1646 */
+#line 1417 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3365 "awkgram.c" /* yacc.c:1646 */
+#line 3371 "awkgram.c" /* yacc.c:1646 */
break;
case 127:
-#line 1413 "awkgram.y" /* yacc.c:1646 */
+#line 1419 "awkgram.y" /* yacc.c:1646 */
{
int count = 2;
bool is_simple_var = false;
@@ -3412,47 +3418,47 @@ regular_print:
max_args = count;
}
}
-#line 3416 "awkgram.c" /* yacc.c:1646 */
+#line 3422 "awkgram.c" /* yacc.c:1646 */
break;
case 129:
-#line 1465 "awkgram.y" /* yacc.c:1646 */
+#line 1471 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3422 "awkgram.c" /* yacc.c:1646 */
+#line 3428 "awkgram.c" /* yacc.c:1646 */
break;
case 130:
-#line 1467 "awkgram.y" /* yacc.c:1646 */
+#line 1473 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3428 "awkgram.c" /* yacc.c:1646 */
+#line 3434 "awkgram.c" /* yacc.c:1646 */
break;
case 131:
-#line 1469 "awkgram.y" /* yacc.c:1646 */
+#line 1475 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3434 "awkgram.c" /* yacc.c:1646 */
+#line 3440 "awkgram.c" /* yacc.c:1646 */
break;
case 132:
-#line 1471 "awkgram.y" /* yacc.c:1646 */
+#line 1477 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3440 "awkgram.c" /* yacc.c:1646 */
+#line 3446 "awkgram.c" /* yacc.c:1646 */
break;
case 133:
-#line 1473 "awkgram.y" /* yacc.c:1646 */
+#line 1479 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3446 "awkgram.c" /* yacc.c:1646 */
+#line 3452 "awkgram.c" /* yacc.c:1646 */
break;
case 134:
-#line 1475 "awkgram.y" /* yacc.c:1646 */
+#line 1481 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3452 "awkgram.c" /* yacc.c:1646 */
+#line 3458 "awkgram.c" /* yacc.c:1646 */
break;
case 135:
-#line 1477 "awkgram.y" /* yacc.c:1646 */
+#line 1483 "awkgram.y" /* yacc.c:1646 */
{
/*
* In BEGINFILE/ENDFILE, allow `getline [var] < file'
@@ -3466,29 +3472,29 @@ regular_print:
_("non-redirected `getline' undefined inside END action"));
(yyval) = mk_getline((yyvsp[-2]), (yyvsp[-1]), (yyvsp[0]), redirect_input);
}
-#line 3470 "awkgram.c" /* yacc.c:1646 */
+#line 3476 "awkgram.c" /* yacc.c:1646 */
break;
case 136:
-#line 1491 "awkgram.y" /* yacc.c:1646 */
+#line 1497 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_postincrement;
(yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0]));
}
-#line 3479 "awkgram.c" /* yacc.c:1646 */
+#line 3485 "awkgram.c" /* yacc.c:1646 */
break;
case 137:
-#line 1496 "awkgram.y" /* yacc.c:1646 */
+#line 1502 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_postdecrement;
(yyval) = mk_assignment((yyvsp[-1]), NULL, (yyvsp[0]));
}
-#line 3488 "awkgram.c" /* yacc.c:1646 */
+#line 3494 "awkgram.c" /* yacc.c:1646 */
break;
case 138:
-#line 1501 "awkgram.y" /* yacc.c:1646 */
+#line 1507 "awkgram.y" /* yacc.c:1646 */
{
if (do_lint_old) {
warning_ln((yyvsp[-1])->source_line,
@@ -3508,64 +3514,64 @@ regular_print:
(yyval) = list_append(list_merge(t, (yyvsp[0])), (yyvsp[-1]));
}
}
-#line 3512 "awkgram.c" /* yacc.c:1646 */
+#line 3518 "awkgram.c" /* yacc.c:1646 */
break;
case 139:
-#line 1526 "awkgram.y" /* yacc.c:1646 */
+#line 1532 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = mk_getline((yyvsp[-1]), (yyvsp[0]), (yyvsp[-3]), (yyvsp[-2])->redir_type);
bcfree((yyvsp[-2]));
}
-#line 3521 "awkgram.c" /* yacc.c:1646 */
+#line 3527 "awkgram.c" /* yacc.c:1646 */
break;
case 140:
-#line 1532 "awkgram.y" /* yacc.c:1646 */
+#line 1538 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3527 "awkgram.c" /* yacc.c:1646 */
+#line 3533 "awkgram.c" /* yacc.c:1646 */
break;
case 141:
-#line 1534 "awkgram.y" /* yacc.c:1646 */
+#line 1540 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3533 "awkgram.c" /* yacc.c:1646 */
+#line 3539 "awkgram.c" /* yacc.c:1646 */
break;
case 142:
-#line 1536 "awkgram.y" /* yacc.c:1646 */
+#line 1542 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3539 "awkgram.c" /* yacc.c:1646 */
+#line 3545 "awkgram.c" /* yacc.c:1646 */
break;
case 143:
-#line 1538 "awkgram.y" /* yacc.c:1646 */
+#line 1544 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3545 "awkgram.c" /* yacc.c:1646 */
+#line 3551 "awkgram.c" /* yacc.c:1646 */
break;
case 144:
-#line 1540 "awkgram.y" /* yacc.c:1646 */
+#line 1546 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3551 "awkgram.c" /* yacc.c:1646 */
+#line 3557 "awkgram.c" /* yacc.c:1646 */
break;
case 145:
-#line 1542 "awkgram.y" /* yacc.c:1646 */
+#line 1548 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = mk_binary((yyvsp[-2]), (yyvsp[0]), (yyvsp[-1])); }
-#line 3557 "awkgram.c" /* yacc.c:1646 */
+#line 3563 "awkgram.c" /* yacc.c:1646 */
break;
case 146:
-#line 1547 "awkgram.y" /* yacc.c:1646 */
+#line 1553 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_create((yyvsp[0]));
}
-#line 3565 "awkgram.c" /* yacc.c:1646 */
+#line 3571 "awkgram.c" /* yacc.c:1646 */
break;
case 147:
-#line 1551 "awkgram.y" /* yacc.c:1646 */
+#line 1557 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0])->opcode == Op_match_rec) {
(yyvsp[0])->opcode = Op_nomatch;
@@ -3597,37 +3603,37 @@ regular_print:
}
}
}
-#line 3601 "awkgram.c" /* yacc.c:1646 */
+#line 3607 "awkgram.c" /* yacc.c:1646 */
break;
case 148:
-#line 1583 "awkgram.y" /* yacc.c:1646 */
+#line 1589 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 3607 "awkgram.c" /* yacc.c:1646 */
+#line 3613 "awkgram.c" /* yacc.c:1646 */
break;
case 149:
-#line 1585 "awkgram.y" /* yacc.c:1646 */
+#line 1591 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = snode((yyvsp[-1]), (yyvsp[-3]));
if ((yyval) == NULL)
YYABORT;
}
-#line 3617 "awkgram.c" /* yacc.c:1646 */
+#line 3623 "awkgram.c" /* yacc.c:1646 */
break;
case 150:
-#line 1591 "awkgram.y" /* yacc.c:1646 */
+#line 1597 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = snode((yyvsp[-1]), (yyvsp[-3]));
if ((yyval) == NULL)
YYABORT;
}
-#line 3627 "awkgram.c" /* yacc.c:1646 */
+#line 3633 "awkgram.c" /* yacc.c:1646 */
break;
case 151:
-#line 1597 "awkgram.y" /* yacc.c:1646 */
+#line 1603 "awkgram.y" /* yacc.c:1646 */
{
static bool warned = false;
@@ -3640,45 +3646,45 @@ regular_print:
if ((yyval) == NULL)
YYABORT;
}
-#line 3644 "awkgram.c" /* yacc.c:1646 */
+#line 3650 "awkgram.c" /* yacc.c:1646 */
break;
case 154:
-#line 1612 "awkgram.y" /* yacc.c:1646 */
+#line 1618 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[-1])->opcode = Op_preincrement;
(yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1]));
}
-#line 3653 "awkgram.c" /* yacc.c:1646 */
+#line 3659 "awkgram.c" /* yacc.c:1646 */
break;
case 155:
-#line 1617 "awkgram.y" /* yacc.c:1646 */
+#line 1623 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[-1])->opcode = Op_predecrement;
(yyval) = mk_assignment((yyvsp[0]), NULL, (yyvsp[-1]));
}
-#line 3662 "awkgram.c" /* yacc.c:1646 */
+#line 3668 "awkgram.c" /* yacc.c:1646 */
break;
case 156:
-#line 1622 "awkgram.y" /* yacc.c:1646 */
+#line 1628 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_create((yyvsp[0]));
}
-#line 3670 "awkgram.c" /* yacc.c:1646 */
+#line 3676 "awkgram.c" /* yacc.c:1646 */
break;
case 157:
-#line 1626 "awkgram.y" /* yacc.c:1646 */
+#line 1632 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_create((yyvsp[0]));
}
-#line 3678 "awkgram.c" /* yacc.c:1646 */
+#line 3684 "awkgram.c" /* yacc.c:1646 */
break;
case 158:
-#line 1630 "awkgram.y" /* yacc.c:1646 */
+#line 1636 "awkgram.y" /* yacc.c:1646 */
{
if ((yyvsp[0])->lasti->opcode == Op_push_i
&& ((yyvsp[0])->lasti->memory->flags & (STRCUR|STRING)) == 0
@@ -3693,11 +3699,11 @@ regular_print:
(yyval) = list_append((yyvsp[0]), (yyvsp[-1]));
}
}
-#line 3697 "awkgram.c" /* yacc.c:1646 */
+#line 3703 "awkgram.c" /* yacc.c:1646 */
break;
case 159:
-#line 1645 "awkgram.y" /* yacc.c:1646 */
+#line 1651 "awkgram.y" /* yacc.c:1646 */
{
/*
* was: $$ = $2
@@ -3707,20 +3713,20 @@ regular_print:
(yyvsp[-1])->memory = make_number(0.0);
(yyval) = list_append((yyvsp[0]), (yyvsp[-1]));
}
-#line 3711 "awkgram.c" /* yacc.c:1646 */
+#line 3717 "awkgram.c" /* yacc.c:1646 */
break;
case 160:
-#line 1658 "awkgram.y" /* yacc.c:1646 */
+#line 1664 "awkgram.y" /* yacc.c:1646 */
{
func_use((yyvsp[0])->lasti->func_name, FUNC_USE);
(yyval) = (yyvsp[0]);
}
-#line 3720 "awkgram.c" /* yacc.c:1646 */
+#line 3726 "awkgram.c" /* yacc.c:1646 */
break;
case 161:
-#line 1663 "awkgram.y" /* yacc.c:1646 */
+#line 1669 "awkgram.y" /* yacc.c:1646 */
{
/* indirect function call */
INSTRUCTION *f, *t;
@@ -3752,13 +3758,25 @@ regular_print:
*/
(yyval) = list_prepend((yyvsp[0]), t);
+ at_seen = false;
}
-#line 3757 "awkgram.c" /* yacc.c:1646 */
+#line 3764 "awkgram.c" /* yacc.c:1646 */
break;
case 162:
-#line 1699 "awkgram.y" /* yacc.c:1646 */
+#line 1706 "awkgram.y" /* yacc.c:1646 */
{
+ NODE *n;
+
+ if (! at_seen) {
+ n = lookup((yyvsp[-3])->func_name);
+ if (n != NULL && n->type != Node_func
+ && n->type != Node_ext_func && n->type != Node_old_ext_func) {
+ error_ln((yyvsp[-3])->source_line,
+ _("attempt to use non-function `%s' in function call"),
+ (yyvsp[-3])->func_name);
+ }
+ }
param_sanity((yyvsp[-1]));
(yyvsp[-3])->opcode = Op_func_call;
(yyvsp[-3])->func_body = NULL;
@@ -3771,49 +3789,49 @@ regular_print:
(yyval) = list_append(t, (yyvsp[-3]));
}
}
-#line 3775 "awkgram.c" /* yacc.c:1646 */
+#line 3793 "awkgram.c" /* yacc.c:1646 */
break;
case 163:
-#line 1716 "awkgram.y" /* yacc.c:1646 */
+#line 1734 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3781 "awkgram.c" /* yacc.c:1646 */
+#line 3799 "awkgram.c" /* yacc.c:1646 */
break;
case 164:
-#line 1718 "awkgram.y" /* yacc.c:1646 */
+#line 1736 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3787 "awkgram.c" /* yacc.c:1646 */
+#line 3805 "awkgram.c" /* yacc.c:1646 */
break;
case 165:
-#line 1723 "awkgram.y" /* yacc.c:1646 */
+#line 1741 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3793 "awkgram.c" /* yacc.c:1646 */
+#line 3811 "awkgram.c" /* yacc.c:1646 */
break;
case 166:
-#line 1725 "awkgram.y" /* yacc.c:1646 */
+#line 1743 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 3799 "awkgram.c" /* yacc.c:1646 */
+#line 3817 "awkgram.c" /* yacc.c:1646 */
break;
case 167:
-#line 1730 "awkgram.y" /* yacc.c:1646 */
+#line 1748 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3805 "awkgram.c" /* yacc.c:1646 */
+#line 3823 "awkgram.c" /* yacc.c:1646 */
break;
case 168:
-#line 1732 "awkgram.y" /* yacc.c:1646 */
+#line 1750 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_merge((yyvsp[-1]), (yyvsp[0]));
}
-#line 3813 "awkgram.c" /* yacc.c:1646 */
+#line 3831 "awkgram.c" /* yacc.c:1646 */
break;
case 169:
-#line 1739 "awkgram.y" /* yacc.c:1646 */
+#line 1757 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *ip = (yyvsp[0])->lasti;
int count = ip->sub_count; /* # of SUBSEP-seperated expressions */
@@ -3827,11 +3845,11 @@ regular_print:
sub_counter++; /* count # of dimensions */
(yyval) = (yyvsp[0]);
}
-#line 3831 "awkgram.c" /* yacc.c:1646 */
+#line 3849 "awkgram.c" /* yacc.c:1646 */
break;
case 170:
-#line 1756 "awkgram.y" /* yacc.c:1646 */
+#line 1774 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *t = (yyvsp[-1]);
if ((yyvsp[-1]) == NULL) {
@@ -3845,31 +3863,31 @@ regular_print:
(yyvsp[0])->sub_count = count_expressions(&t, false);
(yyval) = list_append(t, (yyvsp[0]));
}
-#line 3849 "awkgram.c" /* yacc.c:1646 */
+#line 3867 "awkgram.c" /* yacc.c:1646 */
break;
case 171:
-#line 1773 "awkgram.y" /* yacc.c:1646 */
+#line 1791 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); }
-#line 3855 "awkgram.c" /* yacc.c:1646 */
+#line 3873 "awkgram.c" /* yacc.c:1646 */
break;
case 172:
-#line 1775 "awkgram.y" /* yacc.c:1646 */
+#line 1793 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_merge((yyvsp[-1]), (yyvsp[0]));
}
-#line 3863 "awkgram.c" /* yacc.c:1646 */
+#line 3881 "awkgram.c" /* yacc.c:1646 */
break;
case 173:
-#line 1782 "awkgram.y" /* yacc.c:1646 */
+#line 1800 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[-1]); }
-#line 3869 "awkgram.c" /* yacc.c:1646 */
+#line 3887 "awkgram.c" /* yacc.c:1646 */
break;
case 174:
-#line 1787 "awkgram.y" /* yacc.c:1646 */
+#line 1805 "awkgram.y" /* yacc.c:1646 */
{
char *var_name = (yyvsp[0])->lextok;
@@ -3877,22 +3895,22 @@ regular_print:
(yyvsp[0])->memory = variable((yyvsp[0])->source_line, var_name, Node_var_new);
(yyval) = list_create((yyvsp[0]));
}
-#line 3881 "awkgram.c" /* yacc.c:1646 */
+#line 3899 "awkgram.c" /* yacc.c:1646 */
break;
case 175:
-#line 1795 "awkgram.y" /* yacc.c:1646 */
+#line 1813 "awkgram.y" /* yacc.c:1646 */
{
char *arr = (yyvsp[-1])->lextok;
(yyvsp[-1])->memory = variable((yyvsp[-1])->source_line, arr, Node_var_new);
(yyvsp[-1])->opcode = Op_push_array;
(yyval) = list_prepend((yyvsp[0]), (yyvsp[-1]));
}
-#line 3892 "awkgram.c" /* yacc.c:1646 */
+#line 3910 "awkgram.c" /* yacc.c:1646 */
break;
case 176:
-#line 1805 "awkgram.y" /* yacc.c:1646 */
+#line 1823 "awkgram.y" /* yacc.c:1646 */
{
INSTRUCTION *ip = (yyvsp[0])->nexti;
if (ip->opcode == Op_push
@@ -3904,73 +3922,73 @@ regular_print:
} else
(yyval) = (yyvsp[0]);
}
-#line 3908 "awkgram.c" /* yacc.c:1646 */
+#line 3926 "awkgram.c" /* yacc.c:1646 */
break;
case 177:
-#line 1817 "awkgram.y" /* yacc.c:1646 */
+#line 1835 "awkgram.y" /* yacc.c:1646 */
{
(yyval) = list_append((yyvsp[-1]), (yyvsp[-2]));
if ((yyvsp[0]) != NULL)
mk_assignment((yyvsp[-1]), NULL, (yyvsp[0]));
}
-#line 3918 "awkgram.c" /* yacc.c:1646 */
+#line 3936 "awkgram.c" /* yacc.c:1646 */
break;
case 178:
-#line 1826 "awkgram.y" /* yacc.c:1646 */
+#line 1844 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_postincrement;
}
-#line 3926 "awkgram.c" /* yacc.c:1646 */
+#line 3944 "awkgram.c" /* yacc.c:1646 */
break;
case 179:
-#line 1830 "awkgram.y" /* yacc.c:1646 */
+#line 1848 "awkgram.y" /* yacc.c:1646 */
{
(yyvsp[0])->opcode = Op_postdecrement;
}
-#line 3934 "awkgram.c" /* yacc.c:1646 */
+#line 3952 "awkgram.c" /* yacc.c:1646 */
break;
case 180:
-#line 1833 "awkgram.y" /* yacc.c:1646 */
+#line 1851 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = NULL; }
-#line 3940 "awkgram.c" /* yacc.c:1646 */
+#line 3958 "awkgram.c" /* yacc.c:1646 */
break;
case 182:
-#line 1841 "awkgram.y" /* yacc.c:1646 */
+#line 1859 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 3946 "awkgram.c" /* yacc.c:1646 */
+#line 3964 "awkgram.c" /* yacc.c:1646 */
break;
case 183:
-#line 1845 "awkgram.y" /* yacc.c:1646 */
+#line 1863 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 3952 "awkgram.c" /* yacc.c:1646 */
+#line 3970 "awkgram.c" /* yacc.c:1646 */
break;
case 186:
-#line 1854 "awkgram.y" /* yacc.c:1646 */
+#line 1872 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 3958 "awkgram.c" /* yacc.c:1646 */
+#line 3976 "awkgram.c" /* yacc.c:1646 */
break;
case 187:
-#line 1858 "awkgram.y" /* yacc.c:1646 */
+#line 1876 "awkgram.y" /* yacc.c:1646 */
{ (yyval) = (yyvsp[0]); yyerrok; }
-#line 3964 "awkgram.c" /* yacc.c:1646 */
+#line 3982 "awkgram.c" /* yacc.c:1646 */
break;
case 188:
-#line 1862 "awkgram.y" /* yacc.c:1646 */
+#line 1880 "awkgram.y" /* yacc.c:1646 */
{ yyerrok; }
-#line 3970 "awkgram.c" /* yacc.c:1646 */
+#line 3988 "awkgram.c" /* yacc.c:1646 */
break;
-#line 3974 "awkgram.c" /* yacc.c:1646 */
+#line 3992 "awkgram.c" /* yacc.c:1646 */
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -4198,7 +4216,7 @@ yyreturn:
#endif
return yyresult;
}
-#line 1864 "awkgram.y" /* yacc.c:1906 */
+#line 1882 "awkgram.y" /* yacc.c:1906 */
struct token {
@@ -4737,6 +4755,9 @@ parse_program(INSTRUCTION **pcode)
if (ret == 0) /* avoid spurious warning if parser aborted with YYABORT */
check_funcs();
+ if (! check_param_names())
+ errcount++;
+
if (args_array == NULL)
emalloc(args_array, NODE **, (max_args + 2) * sizeof(NODE *), "parse_program");
else
@@ -5666,6 +5687,7 @@ retry:
return lasttok = NEWLINE;
case '@':
+ at_seen = true;
return lasttok = '@';
case '\\':
diff --git a/awkgram.y b/awkgram.y
index 44be7824..03d91b74 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -87,6 +87,7 @@ static int one_line_close(int fd);
static void split_comment(void);
static void check_comment(void);
+static bool at_seen = false;
static bool want_source = false;
static bool want_regexp = false; /* lexical scanning kludge */
static char *in_function; /* parsing kludge */
@@ -251,11 +252,13 @@ rule
| '@' LEX_INCLUDE source statement_term
{
want_source = false;
+ at_seen = false;
yyerrok;
}
| '@' LEX_LOAD library statement_term
{
want_source = false;
+ at_seen = false;
yyerrok;
}
;
@@ -410,7 +413,10 @@ func_name
YYABORT;
}
| '@' LEX_EVAL
- { $$ = $2; }
+ {
+ $$ = $2;
+ at_seen = false;
+ }
;
lex_builtin
@@ -1691,12 +1697,24 @@ func_call
*/
$$ = list_prepend($2, t);
+ at_seen = false;
}
;
direct_func_call
: FUNC_CALL '(' opt_expression_list r_paren
{
+ NODE *n;
+
+ if (! at_seen) {
+ n = lookup($1->func_name);
+ if (n != NULL && n->type != Node_func
+ && n->type != Node_ext_func && n->type != Node_old_ext_func) {
+ error_ln($1->source_line,
+ _("attempt to use non-function `%s' in function call"),
+ $1->func_name);
+ }
+ }
param_sanity($3);
$1->opcode = Op_func_call;
$1->func_body = NULL;
@@ -2399,6 +2417,9 @@ parse_program(INSTRUCTION **pcode)
if (ret == 0) /* avoid spurious warning if parser aborted with YYABORT */
check_funcs();
+ if (! check_param_names())
+ errcount++;
+
if (args_array == NULL)
emalloc(args_array, NODE **, (max_args + 2) * sizeof(NODE *), "parse_program");
else
@@ -3328,6 +3349,7 @@ retry:
return lasttok = NEWLINE;
case '@':
+ at_seen = true;
return lasttok = '@';
case '\\':
diff --git a/awklib/Makefile.in b/awklib/Makefile.in
index b4b887a1..6dc8ea81 100644
--- a/awklib/Makefile.in
+++ b/awklib/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -38,7 +38,17 @@
#
VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -101,8 +111,6 @@ build_triplet = @build@
host_triplet = @host@
pkglibexec_PROGRAMS = pwcat$(EXEEXT) grcat$(EXEEXT)
subdir = awklib
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp ChangeLog
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
$(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gettext.m4 \
@@ -117,6 +125,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
$(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@@ -183,6 +192,8 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
+ $(top_srcdir)/mkinstalldirs ChangeLog
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
pkgdatadir = $(datadir)/awk
pkglibexecdir = $(libexecdir)/awk
@@ -340,7 +351,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu awklib/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu awklib/Makefile
-.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@@ -631,6 +641,8 @@ uninstall-am: uninstall-local uninstall-pkglibexecPROGRAMS
tags tags-am uninstall uninstall-am uninstall-local \
uninstall-pkglibexecPROGRAMS
+.PRECIOUS: Makefile
+
all: $(srcdir)/stamp-eg $(AUXPROGS) $(AUXAWK)
diff --git a/awklib/eg/lib/bits2str.awk b/awklib/eg/lib/bits2str.awk
index 9725ee8f..a10ffad1 100644
--- a/awklib/eg/lib/bits2str.awk
+++ b/awklib/eg/lib/bits2str.awk
@@ -1,4 +1,4 @@
-# bits2str --- turn a byte into readable 1's and 0's
+# bits2str --- turn a byte into readable ones and zeros
function bits2str(bits, data, mask)
{
diff --git a/command.c b/command.c
index 389814a5..04d5e5f3 100644
--- a/command.c
+++ b/command.c
@@ -1,4 +1,4 @@
-/* A Bison parser, made by GNU Bison 3.0.3. */
+/* A Bison parser, made by GNU Bison 3.0.4. */
/* Bison implementation for Yacc-like parsers in C
@@ -44,7 +44,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "3.0.3"
+#define YYBISON_VERSION "3.0.4"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
diff --git a/compile b/compile
index 531136b0..a85b723c 100755
--- a/compile
+++ b/compile
@@ -3,7 +3,7 @@
scriptversion=2012-10-14.11; # UTC
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
diff --git a/config.guess b/config.guess
index 4438cd70..6c32c864 100755
--- a/config.guess
+++ b/config.guess
@@ -2,7 +2,7 @@
# Attempt to guess a canonical system name.
# Copyright 1992-2014 Free Software Foundation, Inc.
-timestamp='2014-01-01'
+timestamp='2014-11-04'
# 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
@@ -24,12 +24,12 @@ timestamp='2014-01-01'
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
#
-# Originally written by Per Bothner.
+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
#
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
#
-# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+# Please send patches to <config-patches@gnu.org>.
me=`echo "$0" | sed -e 's,.*/,,'`
@@ -149,7 +149,7 @@ Linux|GNU|GNU/*)
LIBC=gnu
#endif
EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
;;
esac
@@ -579,8 +579,9 @@ EOF
else
IBM_ARCH=powerpc
fi
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
+ if [ -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
@@ -826,7 +827,7 @@ EOF
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
- i*:MSYS*:*)
+ *:MSYS*:*)
echo ${UNAME_MACHINE}-pc-msys
exit ;;
i*:windows32*:*)
@@ -969,10 +970,10 @@ EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
;;
- or1k:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ openrisc*:Linux:*:*)
+ echo or1k-unknown-linux-${LIBC}
exit ;;
- or32:Linux:*:*)
+ or32:Linux:*:* | or1k*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
padre:Linux:*:*)
@@ -1371,154 +1372,6 @@ EOF
exit ;;
esac
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
- I don't know.... */
- printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
- printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
- "4"
-#else
- ""
-#endif
- ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
- int version;
- 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
- printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
- exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
- printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
- printf ("ns32k-encore-mach\n"); exit (0);
-#else
- printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
- printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
- printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
- printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
- struct utsname un;
-
- uname(&un);
-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
- printf ("i386-sequent-ptx1\n"); exit (0);
- }
- printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-# include <sys/param.h>
-# if defined (BSD)
-# if BSD == 43
- printf ("vax-dec-bsd4.3\n"); exit (0);
-# else
-# if BSD == 199006
- printf ("vax-dec-bsd4.3reno\n"); exit (0);
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# endif
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# else
- printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
- printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
- exit (1);
-}
-EOF
-
-$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.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
- case `getsysinfo -f cpu_type` in
- c1*)
- echo c1-convex-bsd
- exit ;;
- c2*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- c34*)
- echo c34-convex-bsd
- exit ;;
- c38*)
- echo c38-convex-bsd
- exit ;;
- c4*)
- echo c4-convex-bsd
- exit ;;
- esac
-fi
-
cat >&2 <<EOF
$0: unable to guess system type
diff --git a/config.sub b/config.sub
index 092cff00..7ffe3737 100755
--- a/config.sub
+++ b/config.sub
@@ -2,7 +2,7 @@
# Configuration validation subroutine script.
# Copyright 1992-2014 Free Software Foundation, Inc.
-timestamp='2014-01-01'
+timestamp='2014-12-03'
# 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
@@ -25,7 +25,7 @@ timestamp='2014-01-01'
# of the GNU General Public License, version 3 ("GPLv3").
-# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+# Please send patches to <config-patches@gnu.org>.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
@@ -283,8 +283,10 @@ case $basic_machine in
| mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
+ | mipsisa32r6 | mipsisa32r6el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64r6 | mipsisa64r6el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipsr5900 | mipsr5900el \
@@ -296,11 +298,11 @@ case $basic_machine in
| nds32 | nds32le | nds32be \
| nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \
- | open8 \
- | or1k | or32 \
+ | open8 | or1k | or1knd | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
+ | riscv32 | riscv64 \
| rl78 | rx \
| score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
@@ -311,6 +313,7 @@ case $basic_machine in
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
| ubicom32 \
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+ | visium \
| we32k \
| x86 | xc16x | xstormy16 | xtensa \
| z8k | z80)
@@ -325,6 +328,9 @@ case $basic_machine in
c6x)
basic_machine=tic6x-unknown
;;
+ leon|leon[3-9])
+ basic_machine=sparc-$basic_machine
+ ;;
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
basic_machine=$basic_machine-unknown
os=-none
@@ -402,8 +408,10 @@ case $basic_machine in
| mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa32r6-* | mipsisa32r6el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64r6-* | mipsisa64r6el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipsr5900-* | mipsr5900el-* \
@@ -415,6 +423,7 @@ case $basic_machine in
| nios-* | nios2-* | nios2eb-* | nios2el-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \
+ | or1k*-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
@@ -432,6 +441,7 @@ case $basic_machine in
| ubicom32-* \
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
| vax-* \
+ | visium-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \
@@ -769,6 +779,9 @@ case $basic_machine in
basic_machine=m68k-isi
os=-sysv
;;
+ leon-*|leon[3-9]-*)
+ basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
+ ;;
m68knommu)
basic_machine=m68k-unknown
os=-linux
@@ -824,6 +837,10 @@ case $basic_machine in
basic_machine=powerpc-unknown
os=-morphos
;;
+ moxiebox)
+ basic_machine=moxie-unknown
+ os=-moxiebox
+ ;;
msdos)
basic_machine=i386-pc
os=-msdos
@@ -1369,14 +1386,14 @@ case $os in
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
- | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1594,9 +1611,6 @@ case $basic_machine in
mips*-*)
os=-elf
;;
- or1k-*)
- os=-elf
- ;;
or32-*)
os=-coff
;;
diff --git a/configure b/configure
index cb7cf42b..2d17ea1e 100755
--- a/configure
+++ b/configure
@@ -2592,7 +2592,7 @@ then
fi
-am__api_version='1.14'
+am__api_version='1.15'
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
@@ -2793,8 +2793,8 @@ test "$program_suffix" != NONE &&
ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
if test x"${MISSING+set}" != xset; then
case $am_aux_dir in
@@ -2813,7 +2813,7 @@ else
$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
fi
-if test x"${install_sh}" != xset; then
+if test x"${install_sh+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -3141,8 +3141,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
mkdir_p='$(MKDIR_P)'
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
+# We need awk for the "check" target (and possibly the TAP driver). The
+# system "awk" is bad on some platforms.
# Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ...
AMTAR='$${TAR-tar}'
@@ -3203,6 +3203,7 @@ fi
+
# Check whether --with-whiny-user-strftime was given.
if test "${with_whiny_user_strftime+set}" = set; then :
withval=$with_whiny_user_strftime; if test "$withval" = yes
@@ -7515,36 +7516,42 @@ else
if test $am_cv_lib_iconv = yes; then
LIBS="$LIBS $LIBICONV"
fi
- if test "$cross_compiling" = yes; then :
-
- case "$host_os" in
- aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
- *) am_cv_func_iconv_works="guessing yes" ;;
- esac
-
+ am_cv_func_iconv_works=no
+ for ac_iconv_const in '' 'const'; do
+ if test "$cross_compiling" = yes; then :
+ case "$host_os" in
+ aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
+ *) am_cv_func_iconv_works="guessing yes" ;;
+ esac
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <iconv.h>
#include <string.h>
-int main ()
+
+#ifndef ICONV_CONST
+# define ICONV_CONST $ac_iconv_const
+#endif
+
+int
+main ()
{
- int result = 0;
+int result = 0;
/* Test against AIX 5.1 bug: Failures are not distinguishable from successful
returns. */
{
iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
if (cd_utf8_to_88591 != (iconv_t)(-1))
{
- static const char input[] = "\342\202\254"; /* EURO SIGN */
+ static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
char buf[10];
- const char *inptr = input;
+ ICONV_CONST char *inptr = input;
size_t inbytesleft = strlen (input);
char *outptr = buf;
size_t outbytesleft = sizeof (buf);
size_t res = iconv (cd_utf8_to_88591,
- (char **) &inptr, &inbytesleft,
+ &inptr, &inbytesleft,
&outptr, &outbytesleft);
if (res == 0)
result |= 1;
@@ -7557,14 +7564,14 @@ int main ()
iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
if (cd_ascii_to_88591 != (iconv_t)(-1))
{
- static const char input[] = "\263";
+ static ICONV_CONST char input[] = "\263";
char buf[10];
- const char *inptr = input;
+ ICONV_CONST char *inptr = input;
size_t inbytesleft = strlen (input);
char *outptr = buf;
size_t outbytesleft = sizeof (buf);
size_t res = iconv (cd_ascii_to_88591,
- (char **) &inptr, &inbytesleft,
+ &inptr, &inbytesleft,
&outptr, &outbytesleft);
if (res == 0)
result |= 2;
@@ -7576,14 +7583,14 @@ int main ()
iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
if (cd_88591_to_utf8 != (iconv_t)(-1))
{
- static const char input[] = "\304";
+ static ICONV_CONST char input[] = "\304";
static char buf[2] = { (char)0xDE, (char)0xAD };
- const char *inptr = input;
+ ICONV_CONST char *inptr = input;
size_t inbytesleft = 1;
char *outptr = buf;
size_t outbytesleft = 1;
size_t res = iconv (cd_88591_to_utf8,
- (char **) &inptr, &inbytesleft,
+ &inptr, &inbytesleft,
&outptr, &outbytesleft);
if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
result |= 4;
@@ -7596,14 +7603,14 @@ int main ()
iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
if (cd_88591_to_utf8 != (iconv_t)(-1))
{
- static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+ static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
char buf[50];
- const char *inptr = input;
+ ICONV_CONST char *inptr = input;
size_t inbytesleft = strlen (input);
char *outptr = buf;
size_t outbytesleft = sizeof (buf);
size_t res = iconv (cd_88591_to_utf8,
- (char **) &inptr, &inbytesleft,
+ &inptr, &inbytesleft,
&outptr, &outbytesleft);
if ((int)res > 0)
result |= 8;
@@ -7623,17 +7630,20 @@ int main ()
&& iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
result |= 16;
return result;
+
+ ;
+ return 0;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
am_cv_func_iconv_works=yes
-else
- am_cv_func_iconv_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
+ test "$am_cv_func_iconv_works" = no || break
+ done
LIBS="$am_save_LIBS"
fi
diff --git a/configure.ac b/configure.ac
index c6b4dd76..8662ca2b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -40,7 +40,7 @@ then
fi
AC_PREREQ(2.69)
-AM_INIT_AUTOMAKE([1.14 dist-xz dist-lzip])
+AM_INIT_AUTOMAKE([1.15 dist-xz dist-lzip])
AC_CONFIG_MACRO_DIR([m4])
@@ -131,7 +131,7 @@ AC_LANG([C])
dnl initialize GNU gettext
AM_GNU_GETTEXT([external])
-AM_GNU_GETTEXT_VERSION([0.19.3])
+AM_GNU_GETTEXT_VERSION([0.19.4])
AM_LANGINFO_CODESET
gt_LC_MESSAGES
diff --git a/depcomp b/depcomp
index 31788017..fc98710e 100755
--- a/depcomp
+++ b/depcomp
@@ -3,7 +3,7 @@
scriptversion=2013-05-30.07; # UTC
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -251,6 +251,41 @@ hp)
exit 1
;;
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
+ echo "$object : \\" > "$depfile"
+ # Clip off the initial element (the dependent). Don't try to be
+ # clever and replace this with sed code, as IRIX sed won't handle
+ # lines with more than a fixed number of characters (4096 in
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
+ # the IRIX cc adds comments like '#:fec' to the end of the
+ # dependency line.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
+ | tr "$nl" ' ' >> "$depfile"
+ echo >> "$depfile"
+ # The second pass generates a dummy entry for each header file.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> "$depfile"
+ else
+ make_dummy_depfile
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
xlc)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 5dd32735..19948706 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,32 @@
+2015-01-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in: Document POSIX requirement that function parameters
+ cannot have the same name as a function. Fix indirectcall example.
+
+2015-01-27 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in: O'Reilly fixes.
+ And still more. Also, fix @code --> @command in a number of places.
+
+2015-01-26 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in: O'Reilly fixes.
+
+2015-01-25 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in: Fix a bad URL. And another one.
+ More O'Reilly fixes.
+
+2015-01-23 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in: O'Reilly fixes.
+ (Glossary): Many new entries from Antonio Giovanni Columbo.
+
+2015-01-21 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in: O'Reilly fixes.
+ Remove obsolete start/end of range indexing comments.
+
2015-01-20 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: O'Reilly fixes.
diff --git a/doc/Makefile.in b/doc/Makefile.in
index a17000bc..68aacf48 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -38,7 +38,17 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -102,8 +112,6 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = doc
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/mkinstalldirs texinfo.tex ChangeLog
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
$(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gettext.m4 \
@@ -118,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
$(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@@ -213,6 +222,8 @@ man1dir = $(mandir)/man1
NROFF = nroff
MANS = $(man_MANS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs \
+ ChangeLog texinfo.tex
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@@ -394,7 +405,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu doc/Makefile
-.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@@ -856,6 +866,8 @@ uninstall-man: uninstall-man1
uninstall-info-am uninstall-man uninstall-man1 \
uninstall-pdf-am uninstall-ps-am
+.PRECIOUS: Makefile
+
# Uncomment the following definition of AWKCARD if your troff can produce
# Postscript but still has troubles with macros from 'colors'. As this
diff --git a/doc/gawk.info b/doc/gawk.info
index 10085b35..e399353b 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -2280,9 +2280,10 @@ built-in functions for working with timestamps, performing bit
manipulation, for runtime string translation (internationalization),
determining the type of a variable, and array sorting.
- As we develop our presentation of the `awk' language, we introduce
-most of the variables and many of the functions. They are described
-systematically in *note Built-in Variables::, and in *note Built-in::.
+ As we develop our presentation of the `awk' language, we will
+introduce most of the variables and many of the functions. They are
+described systematically in *note Built-in Variables::, and in *note
+Built-in::.

File: gawk.info, Node: When, Next: Intro Summary, Prev: Other Features, Up: Getting Started
@@ -2347,7 +2348,7 @@ File: gawk.info, Node: Intro Summary, Prev: When, Up: Getting Started
* You may use backslash continuation to continue a source line.
Lines are automatically continued after a comma, open brace,
- question mark, colon, `||', `&&', `do' and `else'.
+ question mark, colon, `||', `&&', `do', and `else'.

File: gawk.info, Node: Invoking Gawk, Next: Regexp, Prev: Getting Started, Up: Top
@@ -2414,8 +2415,8 @@ File: gawk.info, Node: Options, Next: Other Arguments, Prev: Command Line, U
Options begin with a dash and consist of a single character. GNU-style
long options consist of two dashes and a keyword. The keyword can be
abbreviated, as long as the abbreviation allows the option to be
-uniquely identified. If the option takes an argument, then the keyword
-is either immediately followed by an equals sign (`=') and the
+uniquely identified. If the option takes an argument, either the
+keyword is immediately followed by an equals sign (`=') and the
argument's value, or the keyword and the argument's value are separated
by whitespace. If a particular option with a value is given more than
once, it is the last value that counts.
@@ -2430,10 +2431,10 @@ The following list describes options mandated by the POSIX standard:
`-f SOURCE-FILE'
`--file SOURCE-FILE'
- Read `awk' program source from SOURCE-FILE instead of in the first
- nonoption argument. This option may be given multiple times; the
- `awk' program consists of the concatenation of the contents of
- each specified SOURCE-FILE.
+ Read the `awk' program source from SOURCE-FILE instead of in the
+ first nonoption argument. This option may be given multiple
+ times; the `awk' program consists of the concatenation of the
+ contents of each specified SOURCE-FILE.
`-v VAR=VAL'
`--assign VAR=VAL'
@@ -2474,7 +2475,7 @@ The following list describes options mandated by the POSIX standard:
`-b'
`--characters-as-bytes'
Cause `gawk' to treat all input data as single-byte characters.
- In addition, all output written with `print' or `printf' are
+ In addition, all output written with `print' or `printf' is
treated as single-byte characters.
Normally, `gawk' follows the POSIX standard and attempts to process
@@ -2482,7 +2483,7 @@ The following list describes options mandated by the POSIX standard:
This can often involve converting multibyte characters into wide
characters (internally), and can lead to problems or confusion if
the input data does not contain valid multibyte characters. This
- option is an easy way to tell `gawk': "hands off my data!".
+ option is an easy way to tell `gawk', "Hands off my data!"
`-c'
`--traditional'
@@ -2517,7 +2518,7 @@ The following list describes options mandated by the POSIX standard:
default, the debugger reads commands interactively from the
keyboard (standard input). The optional FILE argument allows you
to specify a file with a list of commands for the debugger to
- execute non-interactively. No space is allowed between the `-D'
+ execute noninteractively. No space is allowed between the `-D'
and FILE, if FILE is supplied.
`-e' PROGRAM-TEXT
@@ -2552,23 +2553,23 @@ The following list describes options mandated by the POSIX standard:
`-g'
`--gen-pot'
- Analyze the source program and generate a GNU `gettext' Portable
- Object Template file on standard output for all string constants
+ Analyze the source program and generate a GNU `gettext' portable
+ object template file on standard output for all string constants
that have been marked for translation. *Note
Internationalization::, for information about this option.
`-h'
`--help'
- Print a "usage" message summarizing the short and long style
+ Print a "usage" message summarizing the short- and long-style
options that `gawk' accepts and then exit.
`-i' SOURCE-FILE
`--include' SOURCE-FILE
Read an `awk' source library from SOURCE-FILE. This option is
completely equivalent to using the `@include' directive inside
- your program. This option is very similar to the `-f' option, but
- there are two important differences. First, when `-i' is used,
- the program source is not loaded if it has been previously loaded,
+ your program. It is very similar to the `-f' option, but there
+ are two important differences. First, when `-i' is used, the
+ program source is not loaded if it has been previously loaded,
whereas with `-f', `gawk' always loads the file. Second, because
this option is intended to be used with code libraries, `gawk'
does not recognize such files as constituting main program input.
@@ -2630,7 +2631,7 @@ The following list describes options mandated by the POSIX standard:
`-o'[FILE]
`--pretty-print'[`='FILE]
- Enable pretty-printing of `awk' programs. By default, output
+ Enable pretty-printing of `awk' programs. By default, the output
program is created in a file named `awkprof.out' (*note
Profiling::). The optional FILE argument allows you to specify a
different file name for the output. No space is allowed between
@@ -2736,7 +2737,7 @@ input as a source of data.)
Because it is clumsy using the standard `awk' mechanisms to mix
source file and command-line `awk' programs, `gawk' provides the `-e'
-option. This does not require you to pre-empt the standard input for
+option. This does not require you to preempt the standard input for
your source code; it allows you to easily mix command-line and library
source code (*note AWKPATH Variable::). As with `-f', the `-e' and `-i'
options may also be used multiple times on the command line.
@@ -2895,7 +2896,7 @@ implementations, you must supply a precise pathname for each program
file, unless the file is in the current directory. But with `gawk', if
the file name supplied to the `-f' or `-i' options does not contain a
directory separator `/', then `gawk' searches a list of directories
-(called the "search path"), one by one, looking for a file with the
+(called the "search path") one by one, looking for a file with the
specified name.
The search path is a string consisting of directory names separated by
@@ -2928,9 +2929,9 @@ or by placing two colons next to each other [`::'].)
Different past versions of `gawk' would also look explicitly in
the current directory, either before or after the path search. As
- of version 4.1.2, this no longer happens, and if you wish to look
- in the current directory, you must include `.' either as a separate
- entry, or as a null entry in the search path.
+ of version 4.1.2, this no longer happens; if you wish to look in
+ the current directory, you must include `.' either as a separate
+ entry or as a null entry in the search path.
The default value for `AWKPATH' is `.:/usr/local/share/awk'.(2)
Since `.' is included at the beginning, `gawk' searches first in the
@@ -3042,7 +3043,7 @@ change. The variables are:
If this variable exists, `gawk' includes the file name and line
number within the `gawk' source code from which warning and/or
fatal messages are generated. Its purpose is to help isolate the
- source of a message, as there are multiple places which produce the
+ source of a message, as there are multiple places that produce the
same warning or error message.
`GAWK_NO_DFA'
@@ -3058,16 +3059,16 @@ change. The variables are:
evaluation stack, when needed.
`INT_CHAIN_MAX'
- The intended maximum number of items `gawk' will maintain on a
- hash chain for managing arrays indexed by integers.
+ This specifies intended maximum number of items `gawk' will
+ maintain on a hash chain for managing arrays indexed by integers.
`STR_CHAIN_MAX'
- The intended maximum number of items `gawk' will maintain on a
- hash chain for managing arrays indexed by strings.
+ This specifies intended maximum number of items `gawk' will
+ maintain on a hash chain for managing arrays indexed by strings.
`TIDYMEM'
If this variable exists, `gawk' uses the `mtrace()' library calls
- from GNU LIBC to help track down possible memory leaks.
+ from the GNU C library to help track down possible memory leaks.

File: gawk.info, Node: Exit Status, Next: Include Files, Prev: Environment Variables, Up: Invoking Gawk
@@ -3099,11 +3100,11 @@ This minor node describes a feature that is specific to `gawk'.
files. This gives you the ability to split large `awk' source files
into smaller, more manageable pieces, and also lets you reuse common
`awk' code from various `awk' scripts. In other words, you can group
-together `awk' functions, used to carry out specific tasks, into
-external files. These files can be used just like function libraries,
-using the `@include' keyword in conjunction with the `AWKPATH'
-environment variable. Note that source files may also be included
-using the `-i' option.
+together `awk' functions used to carry out specific tasks into external
+files. These files can be used just like function libraries, using the
+`@include' keyword in conjunction with the `AWKPATH' environment
+variable. Note that source files may also be included using the `-i'
+option.
Let's see an example. We'll start with two (trivial) `awk' scripts,
namely `test1' and `test2'. Here is the `test1' script:
@@ -3165,11 +3166,11 @@ Variable::) apply to `@include' also.
This is very helpful in constructing `gawk' function libraries. If
you have a large script with useful, general-purpose `awk' functions,
you can break it down into library files and put those files in a
-special directory. You can then include those "libraries," using
-either the full pathnames of the files, or by setting the `AWKPATH'
+special directory. You can then include those "libraries," either by
+using the full pathnames of the files, or by setting the `AWKPATH'
environment variable accordingly and then using `@include' with just
-the file part of the full pathname. Of course, you can have more than
-one directory to keep library files; the more complex the working
+the file part of the full pathname. Of course, you can keep library
+files in more than one directory; the more complex the working
environment is, the more directories you may need to organize the files
to be included.
@@ -3181,8 +3182,8 @@ particular, `@include' is very useful for writing CGI scripts to be run
from web pages.
As mentioned in *note AWKPATH Variable::, the current directory is
-always searched first for source files, before searching in `AWKPATH',
-and this also applies to files named with `@include'.
+always searched first for source files, before searching in `AWKPATH';
+this also applies to files named with `@include'.

File: gawk.info, Node: Loading Shared Libraries, Next: Obsolete, Prev: Include Files, Up: Invoking Gawk
@@ -3227,8 +3228,8 @@ File: gawk.info, Node: Obsolete, Next: Undocumented, Prev: Loading Shared Lib
====================================
This minor node describes features and/or command-line options from
-previous releases of `gawk' that are either not available in the
-current version or that are still supported but deprecated (meaning that
+previous releases of `gawk' that either are not available in the
+current version or are still supported but deprecated (meaning that
they will _not_ be in the next release).
The process-related special files `/dev/pid', `/dev/ppid',
@@ -3256,7 +3257,7 @@ File: gawk.info, Node: Invoking Summary, Prev: Undocumented, Up: Invoking Gaw
run `awk'.
* The three standard options for all versions of `awk' are `-f',
- `-F' and `-v'. `gawk' supplies these and many others, as well as
+ `-F', and `-v'. `gawk' supplies these and many others, as well as
corresponding GNU-style long options.
* Nonoption command-line arguments are usually treated as file names,
@@ -3286,7 +3287,7 @@ File: gawk.info, Node: Invoking Summary, Prev: Undocumented, Up: Invoking Gaw
* `gawk' allows you to load additional functions written in C or C++
using the `@load' statement and/or the `-l' option. (This
- advanced feature is described later on in *note Dynamic
+ advanced feature is described later, in *note Dynamic
Extensions::.)

@@ -3435,7 +3436,7 @@ sequences apply to both string constants and regexp constants:
Horizontal TAB, `Ctrl-i', ASCII code 9 (HT).
`\v'
- Vertical tab, `Ctrl-k', ASCII code 11 (VT).
+ Vertical TAB, `Ctrl-k', ASCII code 11 (VT).
`\NNN'
The octal value NNN, where NNN stands for 1 to 3 digits between
@@ -3485,7 +3486,7 @@ normally be a regexp operator. For example, `/a\+b/' matches the three
characters `a+b'.
For complete portability, do not use a backslash before any
-character not shown in the previous list and that is not an operator.
+character not shown in the previous list or that is not an operator.
Backslash Before Regular Characters
@@ -3547,7 +3548,7 @@ and converted into corresponding real characters as the very first step
in processing regexps.
Here is a list of metacharacters. All characters that are not escape
-sequences and that are not listed in the following stand for themselves:
+sequences and that are not listed here stand for themselves:
`\'
This suppresses the special meaning of a character when matching.
@@ -3630,7 +3631,7 @@ sequences and that are not listed in the following stand for themselves:
There are two subtle points to understand about how `*' works.
First, the `*' applies only to the single preceding regular
expression component (e.g., in `ph*', it applies just to the `h').
- To cause `*' to apply to a larger sub-expression, use parentheses:
+ To cause `*' to apply to a larger subexpression, use parentheses:
`(ph)*' matches `ph', `phph', `phphph', and so on.
Second, `*' finds as many repetitions as possible. If the text to
@@ -3661,10 +3662,10 @@ sequences and that are not listed in the following stand for themselves:
Matches `whhhy', but not `why' or `whhhhy'.
`wh{3,5}y'
- Matches `whhhy', `whhhhy', or `whhhhhy', only.
+ Matches `whhhy', `whhhhy', or `whhhhhy' only.
`wh{2,}y'
- Matches `whhy' or `whhhy', and so on.
+ Matches `whhy', `whhhy', and so on.
Interval expressions were not traditionally available in `awk'.
They were added as part of the POSIX standard to make `awk' and
@@ -3766,7 +3767,7 @@ Class Meaning
`[:print:]' Printable characters (characters that are not control
characters)
`[:punct:]' Punctuation characters (characters that are not letters,
- digits control characters, or space characters)
+ digits, control characters, or space characters)
`[:space:]' Space characters (such as space, TAB, and formfeed, to name
a few)
`[:upper:]' Uppercase alphabetic characters
@@ -3804,8 +3805,9 @@ Collating symbols
Equivalence classes
Locale-specific names for a list of characters that are equal. The
name is enclosed between `[=' and `=]'. For example, the name `e'
- might be used to represent all of "e," "e`," and "e'." In this
- case, `[[=e=]]' is a regexp that matches any of `e', `e'', or `e`'.
+ might be used to represent all of "e," "e^," "e`," and "e'." In
+ this case, `[[=e=]]' is a regexp that matches any of `e', `e^',
+ `e'', or `e`'.
These features are very valuable in non-English-speaking locales.
@@ -3827,7 +3829,7 @@ Consider the following:
This example uses the `sub()' function to make a change to the input
record. (`sub()' replaces the first instance of any text matched by
the first argument with the string provided as the second argument;
-*note String Functions::). Here, the regexp `/a+/' indicates "one or
+*note String Functions::.) Here, the regexp `/a+/' indicates "one or
more `a' characters," and the replacement text is `<A>'.
The input contains four `a' characters. `awk' (and POSIX) regular
@@ -3864,15 +3866,16 @@ regexp":
This sets `digits_regexp' to a regexp that describes one or more digits,
and tests whether the input record matches this regexp.
- NOTE: When using the `~' and `!~' operators, there is a difference
- between a regexp constant enclosed in slashes and a string
- constant enclosed in double quotes. If you are going to use a
- string constant, you have to understand that the string is, in
- essence, scanned _twice_: the first time when `awk' reads your
+ NOTE: When using the `~' and `!~' operators, be aware that there
+ is a difference between a regexp constant enclosed in slashes and
+ a string constant enclosed in double quotes. If you are going to
+ use a string constant, you have to understand that the string is,
+ in essence, scanned _twice_: the first time when `awk' reads your
program, and the second time when it goes to match the string on
the lefthand side of the operator with the pattern on the right.
This is true of any string-valued expression (such as
- `digits_regexp', shown previously), not just string constants.
+ `digits_regexp', shown in the previous example), not just string
+ constants.
What difference does it make if the string is scanned twice? The
answer has to do with escape sequences, and particularly with
@@ -3969,7 +3972,7 @@ letters, digits, or underscores (`_'):
`\B'
Matches the empty string that occurs between two word-constituent
- characters. For example, `/\Brat\B/' matches `crate' but it does
+ characters. For example, `/\Brat\B/' matches `crate', but it does
not match `dirty rat'. `\B' is essentially the opposite of `\y'.
There are two other operators that work on buffers. In Emacs, a
@@ -3978,10 +3981,10 @@ letters, digits, or underscores (`_'):
operators are:
`\`'
- Matches the empty string at the beginning of a buffer (string).
+ Matches the empty string at the beginning of a buffer (string)
`\''
- Matches the empty string at the end of a buffer (string).
+ Matches the empty string at the end of a buffer (string)
Because `^' and `$' always work in terms of the beginning and end of
strings, these operators don't add any new capabilities for `awk'.
@@ -4152,7 +4155,7 @@ one line. Each record is automatically split into chunks called
parts of a record.
On rare occasions, you may need to use the `getline' command. The
-`getline' command is valuable, both because it can do explicit input
+`getline' command is valuable both because it can do explicit input
from any number of files, and because the files used with it do not
have to be named on the `awk' command line (*note Getline::).
@@ -4202,8 +4205,8 @@ File: gawk.info, Node: awk split records, Next: gawk split records, Up: Recor
Records are separated by a character called the "record separator". By
default, the record separator is the newline character. This is why
-records are, by default, single lines. A different character can be
-used for the record separator by assigning the character to the
+records are, by default, single lines. To use a different character
+for the record separator, simply assign that character to the
predefined variable `RS'.
Like any other variable, the value of `RS' can be changed in the
@@ -4218,14 +4221,14 @@ BEGIN/END::). For example:
awk 'BEGIN { RS = "u" }
{ print $0 }' mail-list
-changes the value of `RS' to `u', before reading any input. This is a
-string whose first character is the letter "u"; as a result, records
-are separated by the letter "u." Then the input file is read, and the
-second rule in the `awk' program (the action with no pattern) prints
-each record. Because each `print' statement adds a newline at the end
-of its output, this `awk' program copies the input with each `u'
-changed to a newline. Here are the results of running the program on
-`mail-list':
+changes the value of `RS' to `u', before reading any input. The new
+value is a string whose first character is the letter "u"; as a result,
+records are separated by the letter "u". Then the input file is read,
+and the second rule in the `awk' program (the action with no pattern)
+prints each record. Because each `print' statement adds a newline at
+the end of its output, this `awk' program copies the input with each
+`u' changed to a newline. Here are the results of running the program
+on `mail-list':
$ awk 'BEGIN { RS = "u" }
> { print $0 }' mail-list
@@ -4273,11 +4276,11 @@ data file (*note Sample Data Files::), the line looks like this:
Bill 555-1675 bill.drowning@hotmail.com A
-It contains no `u' so there is no reason to split the record, unlike
-the others which have one or more occurrences of the `u'. In fact,
-this record is treated as part of the previous record; the newline
-separating them in the output is the original newline in the data file,
-not the one added by `awk' when it printed the record!
+It contains no `u', so there is no reason to split the record, unlike
+the others, which each have one or more occurrences of the `u'. In
+fact, this record is treated as part of the previous record; the
+newline separating them in the output is the original newline in the
+data file, not the one added by `awk' when it printed the record!
Another way to change the record separator is on the command line,
using the variable-assignment feature (*note Other Arguments::):
@@ -4343,8 +4346,8 @@ part of either record.
character. However, when `RS' is a regular expression, `RT' contains
the actual input text that matched the regular expression.
- If the input file ended without any text that matches `RS', `gawk'
-sets `RT' to the null string.
+ If the input file ends without any text matching `RS', `gawk' sets
+`RT' to the null string.
The following example illustrates both of these features. It sets
`RS' equal to a regular expression that matches either a newline or a
@@ -4442,12 +4445,12 @@ to these pieces of the record. You don't have to use them--you can
operate on the whole record if you want--but fields are what make
simple `awk' programs so powerful.
- You use a dollar-sign (`$') to refer to a field in an `awk' program,
+ You use a dollar sign (`$') to refer to a field in an `awk' program,
followed by the number of the field you want. Thus, `$1' refers to the
-first field, `$2' to the second, and so on. (Unlike the Unix shells,
-the field numbers are not limited to single digits. `$127' is the
-127th field in the record.) For example, suppose the following is a
-line of input:
+first field, `$2' to the second, and so on. (Unlike in the Unix
+shells, the field numbers are not limited to single digits. `$127' is
+the 127th field in the record.) For example, suppose the following is
+a line of input:
This seems like a pretty nice example.
@@ -4464,10 +4467,9 @@ as `$7', which is `example.'. If you try to reference a field beyond
the last one (such as `$8' when the record has only seven fields), you
get the empty string. (If used in a numeric operation, you get zero.)
- The use of `$0', which looks like a reference to the "zero-th"
-field, is a special case: it represents the whole input record. Use it
-when you are not interested in specific fields. Here are some more
-examples:
+ The use of `$0', which looks like a reference to the "zeroth" field,
+is a special case: it represents the whole input record. Use it when
+you are not interested in specific fields. Here are some more examples:
$ awk '$1 ~ /li/ { print $0 }' mail-list
-| Amelia 555-5553 amelia.zodiacusque@gmail.com F
@@ -4515,8 +4517,8 @@ is another example of using expressions as field numbers:
awk '{ print $(2*2) }' mail-list
`awk' evaluates the expression `(2*2)' and uses its value as the
-number of the field to print. The `*' sign represents multiplication,
-so the expression `2*2' evaluates to four. The parentheses are used so
+number of the field to print. The `*' represents multiplication, so
+the expression `2*2' evaluates to four. The parentheses are used so
that the multiplication is done before the `$' operation; they are
necessary whenever there is a binary operator(1) in the field-number
expression. This example, then, prints the type of relationship (the
@@ -4540,7 +4542,7 @@ field number.
---------- Footnotes ----------
(1) A "binary operator", such as `*' for multiplication, is one that
-takes two operands. The distinction is required, because `awk' also has
+takes two operands. The distinction is required because `awk' also has
unary (one-operand) and ternary (three-operand) operators.

@@ -4662,7 +4664,7 @@ value of `NF' and recomputes `$0'. (d.c.) Here is an example:
decremented.
Finally, there are times when it is convenient to force `awk' to
-rebuild the entire record, using the current value of the fields and
+rebuild the entire record, using the current values of the fields and
`OFS'. To do this, use the seemingly innocuous assignment:
$1 = $1 # force record to be reconstituted
@@ -4682,7 +4684,7 @@ built-in function that updates `$0', such as `sub()' and `gsub()'
It is important to remember that `$0' is the _full_ record, exactly
as it was read from the input. This includes any leading or trailing
whitespace, and the exact whitespace (or other characters) that
-separate the fields.
+separates the fields.
It is a common error to try to change the field separators in a
record simply by setting `FS' and `OFS', and then expecting a plain
@@ -4750,7 +4752,7 @@ attached, such as:
John Q. Smith, LXIX, 29 Oak St., Walamazoo, MI 42139
-The same program would extract `*LXIX', instead of `*29*Oak*St.'. If
+The same program would extract `*LXIX' instead of `*29*Oak*St.'. If
you were expecting the program to print the address, you would be
surprised. The moral is to choose your data layout and separator
characters carefully to prevent such problems. (If the data is not in
@@ -4949,11 +4951,11 @@ your field and record separators.
Perhaps the most common use of a single character as the field
separator occurs when processing the Unix system password file. On
many Unix systems, each user has a separate entry in the system
-password file, one line per user. The information in these lines is
-separated by colons. The first field is the user's login name and the
-second is the user's encrypted or shadow password. (A shadow password
-is indicated by the presence of a single `x' in the second field.) A
-password file entry might look like this:
+password file, with one line per user. The information in these lines
+is separated by colons. The first field is the user's login name and
+the second is the user's encrypted or shadow password. (A shadow
+password is indicated by the presence of a single `x' in the second
+field.) A password file entry might look like this:
arnold:x:2076:10:Arnold Robbins:/home/arnold:/bin/bash
@@ -4981,15 +4983,14 @@ When you do this, `$1' is the same as `$0'.
According to the POSIX standard, `awk' is supposed to behave as if
each record is split into fields at the time it is read. In
particular, this means that if you change the value of `FS' after a
-record is read, the value of the fields (i.e., how they were split)
+record is read, the values of the fields (i.e., how they were split)
should reflect the old value of `FS', not the new one.
However, many older implementations of `awk' do not work this way.
Instead, they defer splitting the fields until a field is actually
referenced. The fields are split using the _current_ value of `FS'!
(d.c.) This behavior can be difficult to diagnose. The following
-example illustrates the difference between the two methods. (The
-`sed'(2) command prints just the first line of `/etc/passwd'.)
+example illustrates the difference between the two methods:
sed 1q /etc/passwd | awk '{ FS = ":" ; print $1 }'
@@ -5002,6 +5003,8 @@ first line of the file, something like:
root:x:0:0:Root:/:
+ (The `sed'(2) command prints just the first line of `/etc/passwd'.)
+
---------- Footnotes ----------
(1) Thanks to Andrew Schorr for this tip.
@@ -5155,7 +5158,7 @@ run on a system with card readers is another story!)
splitting again. Use `FS = FS' to make this happen, without having to
know the current value of `FS'. In order to tell which kind of field
splitting is in effect, use `PROCINFO["FS"]' (*note Auto-set::). The
-value is `"FS"' if regular field splitting is being used, or it is
+value is `"FS"' if regular field splitting is being used, or
`"FIELDWIDTHS"' if fixed-width field splitting is being used:
if (PROCINFO["FS"] == "FS")
@@ -5188,10 +5191,10 @@ what they are, and not by what they are not.
The most notorious such case is so-called "comma-separated values"
(CSV) data. Many spreadsheet programs, for example, can export their
data into text files, where each record is terminated with a newline,
-and fields are separated by commas. If only commas separated the data,
+and fields are separated by commas. If commas only separated the data,
there wouldn't be an issue. The problem comes when one of the fields
contains an _embedded_ comma. In such cases, most programs embed the
-field in double quotes.(1) So we might have data like this:
+field in double quotes.(1) So, we might have data like this:
Robbins,Arnold,"1234 A Pretty Street, NE",MyTown,MyState,12345-6789,USA
@@ -5258,9 +5261,9 @@ being used.
provides an elegant solution for the majority of cases, and the
`gawk' developers are satisfied with that.
- As written, the regexp used for `FPAT' requires that each field have
-a least one character. A straightforward modification (changing
-changed the first `+' to `*') allows fields to be empty:
+ As written, the regexp used for `FPAT' requires that each field
+contain at least one character. A straightforward modification
+(changing the first `+' to `*') allows fields to be empty:
FPAT = "([^,]*)|(\"[^\"]+\")"
@@ -5268,9 +5271,8 @@ changed the first `+' to `*') allows fields to be empty:
available for splitting regular strings (*note String Functions::).
To recap, `gawk' provides three independent methods to split input
-records into fields. `gawk' uses whichever mechanism was last chosen
-based on which of the three variables--`FS', `FIELDWIDTHS', and
-`FPAT'--was last assigned to.
+records into fields. The mechanism used is based on which of the three
+variables--`FS', `FIELDWIDTHS', or `FPAT'--was last assigned to.
---------- Footnotes ----------
@@ -5308,7 +5310,7 @@ empty; lines that contain only whitespace do not count.)
`"\n\n+"' to `RS'. This regexp matches the newline at the end of the
record and one or more blank lines after the record. In addition, a
regular expression always matches the longest possible sequence when
-there is a choice (*note Leftmost Longest::). So the next record
+there is a choice (*note Leftmost Longest::). So, the next record
doesn't start until the first nonblank line that follows--no matter how
many blank lines appear in a row, they are considered one record
separator.
@@ -5320,12 +5322,12 @@ last record, the final newline is removed from the record. In the
second case, this special processing is not done. (d.c.)
Now that the input is separated into records, the second step is to
-separate the fields in the record. One way to do this is to divide each
-of the lines into fields in the normal manner. This happens by default
-as the result of a special feature. When `RS' is set to the empty
-string, _and_ `FS' is set to a single character, the newline character
-_always_ acts as a field separator. This is in addition to whatever
-field separations result from `FS'.(1)
+separate the fields in the records. One way to do this is to divide
+each of the lines into fields in the normal manner. This happens by
+default as the result of a special feature. When `RS' is set to the
+empty string _and_ `FS' is set to a single character, the newline
+character _always_ acts as a field separator. This is in addition to
+whatever field separations result from `FS'.(1)
The original motivation for this special exception was probably to
provide useful behavior in the default case (i.e., `FS' is equal to
@@ -5333,17 +5335,17 @@ provide useful behavior in the default case (i.e., `FS' is equal to
newline character to separate fields, because there is no way to
prevent it. However, you can work around this by using the `split()'
function to break up the record manually (*note String Functions::).
-If you have a single character field separator, you can work around the
+If you have a single-character field separator, you can work around the
special feature in a different way, by making `FS' into a regexp for
that single character. For example, if the field separator is a
percent character, instead of `FS = "%"', use `FS = "[%]"'.
Another way to separate fields is to put each field on a separate
line: to do this, just set the variable `FS' to the string `"\n"'.
-(This single character separator matches a single newline.) A
+(This single-character separator matches a single newline.) A
practical example of a data file organized this way might be a mailing
-list, where each entry is separated by blank lines. Consider a mailing
-list in a file named `addresses', which looks like this:
+list, where blank lines separate the entries. Consider a mailing list
+in a file named `addresses', which looks like this:
Jane Doe
123 Main Street
@@ -5426,7 +5428,7 @@ File: gawk.info, Node: Getline, Next: Read Timeout, Prev: Multiple Line, Up:
So far we have been getting our input data from `awk''s main input
stream--either the standard input (usually your keyboard, sometimes the
-output from another program) or from the files specified on the command
+output from another program) or the files specified on the command
line. The `awk' language has a special built-in command called
`getline' that can be used to read input under your explicit control.
@@ -5568,7 +5570,7 @@ and produces these results:
free
The `getline' command used in this way sets only the variables `NR',
-`FNR', and `RT' (and of course, VAR). The record is not split into
+`FNR', and `RT' (and, of course, VAR). The record is not split into
fields, so the values of the fields (including `$0') and the value of
`NF' do not change.
@@ -5578,8 +5580,8 @@ File: gawk.info, Node: Getline/File, Next: Getline/Variable/File, Prev: Getli
4.9.3 Using `getline' from a File
---------------------------------
-Use `getline < FILE' to read the next record from FILE. Here FILE is a
-string-valued expression that specifies the file name. `< FILE' is
+Use `getline < FILE' to read the next record from FILE. Here, FILE is
+a string-valued expression that specifies the file name. `< FILE' is
called a "redirection" because it directs input to come from a
different place. For example, the following program reads its input
record from the file `secondary.input' when it encounters a first field
@@ -5715,8 +5717,8 @@ all `awk' implementations.
treatment of a construct like `"echo " "date" | getline'. Most
versions, including the current version, treat it at as `("echo "
"date") | getline'. (This is also how BWK `awk' behaves.) Some
- versions changed and treated it as `"echo " ("date" | getline)'.
- (This is how `mawk' behaves.) In short, _always_ use explicit
+ versions instead treat it as `"echo " ("date" | getline)'. (This
+ is how `mawk' behaves.) In short, _always_ use explicit
parentheses, and then you won't have to worry.

@@ -5752,15 +5754,16 @@ File: gawk.info, Node: Getline/Coprocess, Next: Getline/Variable/Coprocess, P
4.9.7 Using `getline' from a Coprocess
--------------------------------------
-Input into `getline' from a pipe is a one-way operation. The command
-that is started with `COMMAND | getline' only sends data _to_ your
-`awk' program.
+Reading input into `getline' from a pipe is a one-way operation. The
+command that is started with `COMMAND | getline' only sends data _to_
+your `awk' program.
On occasion, you might want to send data to another program for
processing and then read the results back. `gawk' allows you to start
a "coprocess", with which two-way communications are possible. This is
done with the `|&' operator. Typically, you write data to the
-coprocess first and then read results back, as shown in the following:
+coprocess first and then read the results back, as shown in the
+following:
print "SOME QUERY" |& "db_server"
"db_server" |& getline
@@ -5822,7 +5825,7 @@ in mind:
files. (d.c.) (See *note BEGIN/END::; also *note Auto-set::.)
* Using `FILENAME' with `getline' (`getline < FILENAME') is likely
- to be a source for confusion. `awk' opens a separate input stream
+ to be a source of confusion. `awk' opens a separate input stream
from the current input file. However, by not using a variable,
`$0' and `NF' are still updated. If you're doing this, it's
probably by accident, and you should reconsider what it is you're
@@ -5830,15 +5833,15 @@ in mind:
* *note Getline Summary::, presents a table summarizing the
`getline' variants and which variables they can affect. It is
- worth noting that those variants which do not use redirection can
+ worth noting that those variants that do not use redirection can
cause `FILENAME' to be updated if they cause `awk' to start
reading a new input file.
* If the variable being assigned is an expression with side effects,
different versions of `awk' behave differently upon encountering
end-of-file. Some versions don't evaluate the expression; many
- versions (including `gawk') do. Here is an example, due to Duncan
- Moore:
+ versions (including `gawk') do. Here is an example, courtesy of
+ Duncan Moore:
BEGIN {
system("echo 1 > f")
@@ -5846,8 +5849,8 @@ in mind:
print c
}
- Here, the side effect is the `++c'. Is `c' incremented if end of
- file is encountered, before the element in `a' is assigned?
+ Here, the side effect is the `++c'. Is `c' incremented if
+ end-of-file is encountered before the element in `a' is assigned?
`gawk' treats `getline' like a function call, and evaluates the
expression `a[++c]' before attempting to read from `f'. However,
@@ -5891,8 +5894,8 @@ This minor node describes a feature that is specific to `gawk'.
You may specify a timeout in milliseconds for reading input from the
keyboard, a pipe, or two-way communication, including TCP/IP sockets.
-This can be done on a per input, command, or connection basis, by
-setting a special element in the `PROCINFO' array (*note Auto-set::):
+This can be done on a per-input, per-command, or per-connection basis,
+by setting a special element in the `PROCINFO' array (*note Auto-set::):
PROCINFO["input_name", "READ_TIMEOUT"] = TIMEOUT IN MILLISECONDS
@@ -5916,7 +5919,7 @@ for more than five seconds:
print $0
`gawk' terminates the read operation if input does not arrive after
-waiting for the timeout period, returns failure and sets `ERRNO' to an
+waiting for the timeout period, returns failure, and sets `ERRNO' to an
appropriate string value. A negative or zero value for the timeout is
the same as specifying no timeout at all.
@@ -5956,7 +5959,7 @@ input to arrive:
environment variable exists, `gawk' uses its value to initialize the
timeout value. The exclusive use of the environment variable to
specify timeout has the disadvantage of not being able to control it on
-a per command or connection basis.
+a per-command or per-connection basis.
`gawk' considers a timeout event to be an error even though the
attempt to read from the underlying device may succeed in a later
@@ -6052,7 +6055,7 @@ File: gawk.info, Node: Input Summary, Next: Input Exercises, Prev: Command-li
* `gawk' sets `RT' to the text matched by `RS'.
* After splitting the input into records, `awk' further splits the
- record into individual fields, named `$1', `$2', and so on. `$0'
+ records into individual fields, named `$1', `$2', and so on. `$0'
is the whole record, and `NF' indicates how many fields there are.
The default way to split fields is between whitespace characters.
@@ -6066,19 +6069,21 @@ File: gawk.info, Node: Input Summary, Next: Input Exercises, Prev: Command-li
* Field splitting is more complicated than record splitting:
- Field separator value Fields are split ... `awk' /
- `gawk'
+ Field separator value Fields are split ... `awk' /
+ `gawk'
----------------------------------------------------------------------
- `FS == " "' On runs of whitespace `awk'
- `FS == ANY SINGLE On that character `awk'
- CHARACTER'
- `FS == REGEXP' On text matching the regexp `awk'
- `FS == ""' Each individual character is `gawk'
- a separate field
- `FIELDWIDTHS == LIST OF Based on character position `gawk'
- COLUMNS'
- `FPAT == REGEXP' On the text surrounding text `gawk'
- matching the regexp
+ `FS == " "' On runs of whitespace `awk'
+ `FS == ANY SINGLE On that character `awk'
+ CHARACTER'
+ `FS == REGEXP' On text matching the `awk'
+ regexp
+ `FS == ""' Such that each individual `gawk'
+ character is a separate
+ field
+ `FIELDWIDTHS == LIST OF Based on character `gawk'
+ COLUMNS' position
+ `FPAT == REGEXP' On the text surrounding `gawk'
+ text matching the regexp
* Using `FS = "\n"' causes the entire record to be a single field
(assuming that newlines separate records).
@@ -6088,12 +6093,11 @@ File: gawk.info, Node: Input Summary, Next: Input Exercises, Prev: Command-li
* Use `PROCINFO["FS"]' to see how fields are being split.
- * Use `getline' in its various forms to read additional records,
- from the default input stream, from a file, or from a pipe or
- coprocess.
+ * Use `getline' in its various forms to read additional records from
+ the default input stream, from a file, or from a pipe or coprocess.
- * Use `PROCINFO[FILE, "READ_TIMEOUT"]' to cause reads to timeout for
- FILE.
+ * Use `PROCINFO[FILE, "READ_TIMEOUT"]' to cause reads to time out
+ for FILE.
* Directories on the command line are fatal for standard `awk';
`gawk' ignores them if not in POSIX mode.
@@ -6187,7 +6191,7 @@ you will probably get an error. Keep in mind that a space is printed
between any two items.
Note that the `print' statement is a statement and not an
-expression--you can't use it in the pattern part of a PATTERN-ACTION
+expression--you can't use it in the pattern part of a pattern-action
statement, for example.

@@ -6335,7 +6339,7 @@ File: gawk.info, Node: OFMT, Next: Printf, Prev: Output Separators, Up: Prin
===========================================
When printing numeric values with the `print' statement, `awk'
-internally converts the number to a string of characters and prints
+internally converts each number to a string of characters and prints
that string. `awk' uses the `sprintf()' function to do this conversion
(*note String Functions::). For now, it suffices to say that the
`sprintf()' function accepts a "format specification" that tells it how
@@ -6390,7 +6394,7 @@ A simple `printf' statement looks like this:
As for `print', the entire list of arguments may optionally be enclosed
in parentheses. Here too, the parentheses are necessary if any of the
-item expressions use the `>' relational operator; otherwise, it can be
+item expressions uses the `>' relational operator; otherwise, it can be
confused with an output redirection (*note Redirection::).
The difference between `printf' and `print' is the FORMAT argument.
@@ -6417,7 +6421,7 @@ statements. For example:
> }'
-| Don't Panic!
-Here, neither the `+' nor the `OUCH!' appear in the output message.
+Here, neither the `+' nor the `OUCH!' appears in the output message.

File: gawk.info, Node: Control Letters, Next: Format Modifiers, Prev: Basic Printf, Up: Printf
@@ -6456,7 +6460,7 @@ width. Here is a list of the format-control letters:
(The `%i' specification is for compatibility with ISO C.)
`%e', `%E'
- Print a number in scientific (exponential) notation; for example:
+ Print a number in scientific (exponential) notation. For example:
printf "%4.3e\n", 1950
@@ -6481,7 +6485,7 @@ width. Here is a list of the format-control letters:
Math Definitions::).
`%F'
- Like `%f' but the infinity and "not a number" values are spelled
+ Like `%f', but the infinity and "not a number" values are spelled
using uppercase letters.
The `%F' format is a POSIX extension to ISO C; not all systems
@@ -6675,7 +6679,7 @@ string, like so:
s = "abcdefg"
printf "%" w "." p "s\n", s
-This is not particularly easy to read but it does work.
+This is not particularly easy to read, but it does work.
C programmers may be used to supplying additional modifiers (`h',
`j', `l', `L', `t', and `z') in `printf' format strings. These are not
@@ -6714,7 +6718,7 @@ an aligned two-column table of names and phone numbers, as shown here:
-| Jean-Paul 555-2127
In this case, the phone numbers had to be printed as strings because
-the numbers are separated by a dash. Printing the phone numbers as
+the numbers are separated by dashes. Printing the phone numbers as
numbers would have produced just the first three digits: `555'. This
would have been pretty confusing.
@@ -6762,7 +6766,7 @@ output, usually the screen. Both `print' and `printf' can also send
their output to other places. This is called "redirection".
NOTE: When `--sandbox' is specified (*note Options::), redirecting
- output to files, pipes and coprocesses is disabled.
+ output to files, pipes, and coprocesses is disabled.
A redirection appears after the `print' or `printf' statement.
Redirections in `awk' are written just like redirections in shell
@@ -6802,7 +6806,7 @@ work identically for `printf':
Each output file contains one name or number per line.
`print ITEMS >> OUTPUT-FILE'
- This redirection prints the items into the pre-existing output file
+ This redirection prints the items into the preexisting output file
named OUTPUT-FILE. The difference between this and the single-`>'
redirection is that the old contents (if any) of OUTPUT-FILE are
not erased. Instead, the `awk' output is appended to the file.
@@ -6850,8 +6854,8 @@ work identically for `printf':
`print ITEMS |& COMMAND'
This redirection prints the items to the input of COMMAND. The
difference between this and the single-`|' redirection is that the
- output from COMMAND can be read with `getline'. Thus COMMAND is a
- "coprocess", which works together with, but subsidiary to, the
+ output from COMMAND can be read with `getline'. Thus, COMMAND is
+ a "coprocess", which works together with but is subsidiary to the
`awk' program.
This feature is a `gawk' extension, and is not available in POSIX
@@ -6875,7 +6879,7 @@ a file, and then to use `>>' for subsequent output:
This is indeed how redirections must be used from the shell. But in
`awk', it isn't necessary. In this kind of case, a program should use
`>' for all the `print' statements, because the output file is only
-opened once. (It happens that if you mix `>' and `>>' that output is
+opened once. (It happens that if you mix `>' and `>>' output is
produced in the expected order. However, mixing the operators for the
same file is definitely poor style, and is confusing to readers of your
program.)
@@ -6908,14 +6912,14 @@ command lines to be fed to the shell.

File: gawk.info, Node: Special FD, Next: Special Files, Prev: Redirection, Up: Printing
-5.7 Special Files for Standard Pre-Opened Data Streams
-======================================================
+5.7 Special Files for Standard Preopened Data Streams
+=====================================================
Running programs conventionally have three input and output streams
already available to them for reading and writing. These are known as
the "standard input", "standard output", and "standard error output".
-These open streams (and any other open file or pipe) are often referred
-to by the technical term "file descriptors".
+These open streams (and any other open files or pipes) are often
+referred to by the technical term "file descriptors".
These streams are, by default, connected to your keyboard and
screen, but they are often redirected with the shell, via the `<', `<<',
@@ -6940,7 +6944,7 @@ error messages to the screen, like this:
(`/dev/tty' is a special file supplied by the operating system that is
connected to your keyboard and screen. It represents the "terminal,"(1)
which on modern systems is a keyboard and screen, not a serial console.)
-This generally has the same effect but not always: although the
+This generally has the same effect, but not always: although the
standard error stream is usually the screen, it can be redirected; when
that happens, writing to the screen is not correct. In fact, if `awk'
is run from a background job, it may not have a terminal at all. Then
@@ -6967,7 +6971,7 @@ becomes:
print "Serious error detected!" > "/dev/stderr"
- Note the use of quotes around the file name. Like any other
+ Note the use of quotes around the file name. Like with any other
redirection, the value must be a string. It is a common error to omit
the quotes, which leads to confusing results.
@@ -7000,7 +7004,7 @@ there are special file names reserved for TCP/IP networking.

File: gawk.info, Node: Other Inherited Files, Next: Special Network, Up: Special Files
-5.8.1 Accessing Other Open Files With `gawk'
+5.8.1 Accessing Other Open Files with `gawk'
--------------------------------------------
Besides the `/dev/stdin', `/dev/stdout', and `/dev/stderr' special file
@@ -7050,7 +7054,7 @@ File: gawk.info, Node: Special Caveats, Prev: Special Network, Up: Special Fi
Here are some things to bear in mind when using the special file names
that `gawk' provides:
- * Recognition of the file names for the three standard pre-opened
+ * Recognition of the file names for the three standard preopened
files is disabled only in POSIX mode.
* Recognition of the other special file names is disabled if `gawk'
@@ -7059,7 +7063,7 @@ that `gawk' provides:
* `gawk' _always_ interprets these special file names. For example,
using `/dev/fd/4' for output actually writes on file descriptor 4,
- and not on a new file descriptor that is `dup()''ed from file
+ and not on a new file descriptor that is `dup()'ed from file
descriptor 4. Most of the time this does not matter; however, it
is important to _not_ close any of the files related to file
descriptors 0, 1, and 2. Doing so results in unpredictable
@@ -7219,8 +7223,8 @@ closing input or output files, respectively. This value is zero if the
close succeeds, or -1 if it fails.
The POSIX standard is very vague; it says that `close()' returns
-zero on success and nonzero otherwise. In general, different
-implementations vary in what they report when closing pipes; thus the
+zero on success and a nonzero value otherwise. In general, different
+implementations vary in what they report when closing pipes; thus, the
return value cannot be used portably. (d.c.) In POSIX mode (*note
Options::), `gawk' just returns zero when closing a pipe.
@@ -7246,8 +7250,8 @@ File: gawk.info, Node: Output Summary, Next: Output Exercises, Prev: Close Fi
numeric values for the `print' statement.
* The `printf' statement provides finer-grained control over output,
- with format control letters for different data types and various
- flags that modify the behavior of the format control letters.
+ with format-control letters for different data types and various
+ flags that modify the behavior of the format-control letters.
* Output from both `print' and `printf' may be redirected to files,
pipes, and coprocesses.
@@ -7298,9 +7302,9 @@ value to a variable or a field by using an assignment operator.
An expression can serve as a pattern or action statement on its own.
Most other kinds of statements contain one or more expressions that
specify the data on which to operate. As in other languages,
-expressions in `awk' include variables, array references, constants,
-and function calls, as well as combinations of these with various
-operators.
+expressions in `awk' can include variables, array references,
+constants, and function calls, as well as combinations of these with
+various operators.
* Menu:
@@ -7319,8 +7323,8 @@ File: gawk.info, Node: Values, Next: All Operators, Up: Expressions
=========================================
Expressions are built up from values and the operations performed upon
-them. This minor node describes the elementary objects which provide
-the values used in expressions.
+them. This minor node describes the elementary objects that provide the
+values used in expressions.
* Menu:
@@ -7365,14 +7369,14 @@ the same value:
1.05e+2
1050e-1
- A string constant consists of a sequence of characters enclosed in
+ A "string constant" consists of a sequence of characters enclosed in
double quotation marks. For example:
"parrot"
represents the string whose contents are `parrot'. Strings in `gawk'
can be of any length, and they can contain any of the possible
-eight-bit ASCII characters including ASCII NUL (character code zero).
+eight-bit ASCII characters, including ASCII NUL (character code zero).
Other `awk' implementations may have difficulty with some character
codes.
@@ -7392,14 +7396,14 @@ File: gawk.info, Node: Nondecimal-numbers, Next: Regexp Constants, Prev: Scal
In `awk', all numbers are in decimal (i.e., base 10). Many other
programming languages allow you to specify numbers in other bases, often
octal (base 8) and hexadecimal (base 16). In octal, the numbers go 0,
-1, 2, 3, 4, 5, 6, 7, 10, 11, 12, and so on. Just as `11', in decimal,
-is 1 times 10 plus 1, so `11', in octal, is 1 times 8, plus 1. This
-equals 9 in decimal. In hexadecimal, there are 16 digits. Because the
-everyday decimal number system only has ten digits (`0'-`9'), the
-letters `a' through `f' are used to represent the rest. (Case in the
-letters is usually irrelevant; hexadecimal `a' and `A' have the same
-value.) Thus, `11', in hexadecimal, is 1 times 16 plus 1, which equals
-17 in decimal.
+1, 2, 3, 4, 5, 6, 7, 10, 11, 12, and so on. Just as `11' in decimal is
+1 times 10 plus 1, so `11' in octal is 1 times 8 plus 1. This equals 9
+in decimal. In hexadecimal, there are 16 digits. Because the everyday
+decimal number system only has ten digits (`0'-`9'), the letters `a'
+through `f' are used to represent the rest. (Case in the letters is
+usually irrelevant; hexadecimal `a' and `A' have the same value.)
+Thus, `11' in hexadecimal is 1 times 16 plus 1, which equals 17 in
+decimal.
Just by looking at plain `11', you can't tell what base it's in.
So, in C, C++, and other languages derived from C, there is a special
@@ -7407,13 +7411,13 @@ notation to signify the base. Octal numbers start with a leading `0',
and hexadecimal numbers start with a leading `0x' or `0X':
`11'
- Decimal value 11.
+ Decimal value 11
`011'
- Octal 11, decimal value 9.
+ Octal 11, decimal value 9
`0x11'
- Hexadecimal 11, decimal value 17.
+ Hexadecimal 11, decimal value 17
This example shows the difference:
@@ -7432,11 +7436,11 @@ really need to do this, use the `--non-decimal-data' command-line
option; *note Nondecimal Data::.) If you have octal or hexadecimal
data, you can use the `strtonum()' function (*note String Functions::)
to convert the data into a number. Most of the time, you will want to
-use octal or hexadecimal constants when working with the built-in bit
-manipulation functions; see *note Bitwise Functions::, for more
+use octal or hexadecimal constants when working with the built-in
+bit-manipulation functions; see *note Bitwise Functions::, for more
information.
- Unlike some early C implementations, `8' and `9' are not valid in
+ Unlike in some early C implementations, `8' and `9' are not valid in
octal constants. For example, `gawk' treats `018' as decimal 18:
$ gawk 'BEGIN { print "021 is", 021 ; print 018 }'
@@ -7463,12 +7467,12 @@ File: gawk.info, Node: Regexp Constants, Prev: Nondecimal-numbers, Up: Consta
6.1.1.3 Regular Expression Constants
....................................
-A regexp constant is a regular expression description enclosed in
+A "regexp constant" is a regular expression description enclosed in
slashes, such as `/^beginning and end$/'. Most regexps used in `awk'
programs are constant, but the `~' and `!~' matching operators can also
match computed or dynamic regexps (which are typically just ordinary
-strings or variables that contain a regexp, but could be a more complex
-expression).
+strings or variables that contain a regexp, but could be more complex
+expressions).

File: gawk.info, Node: Using Constant Regexps, Next: Variables, Prev: Constants, Up: Values
@@ -7520,7 +7524,7 @@ and `patsplit()' functions (*note String Functions::). Modern
implementations of `awk', including `gawk', allow the third argument of
`split()' to be a regexp constant, but some older implementations do
not. (d.c.) Because some built-in functions accept regexp constants
-as arguments, it can be confusing when attempting to use regexp
+as arguments, confusion can arise when attempting to use regexp
constants as arguments to user-defined functions (*note
User-defined::). For example:
@@ -7543,10 +7547,11 @@ User-defined::). For example:
In this example, the programmer wants to pass a regexp constant to
the user-defined function `mysub()', which in turn passes it on to
either `sub()' or `gsub()'. However, what really happens is that the
-`pat' parameter is either one or zero, depending upon whether or not
-`$0' matches `/hi/'. `gawk' issues a warning when it sees a regexp
-constant used as a parameter to a user-defined function, because
-passing a truth value in this way is probably not what was intended.
+`pat' parameter is assigned a value of either one or zero, depending
+upon whether or not `$0' matches `/hi/'. `gawk' issues a warning when
+it sees a regexp constant used as a parameter to a user-defined
+function, because passing a truth value in this way is probably not
+what was intended.

File: gawk.info, Node: Variables, Next: Conversion, Prev: Using Constant Regexps, Up: Values
@@ -7554,7 +7559,7 @@ File: gawk.info, Node: Variables, Next: Conversion, Prev: Using Constant Rege
6.1.3 Variables
---------------
-Variables are ways of storing values at one point in your program for
+"Variables" are ways of storing values at one point in your program for
use later in another part of your program. They can be manipulated
entirely within the program text, and they can also be assigned values
on the `awk' command line.
@@ -7583,14 +7588,14 @@ variables.
A variable name is a valid expression by itself; it represents the
variable's current value. Variables are given new values with
-"assignment operators", "increment operators", and "decrement
-operators". *Note Assignment Ops::. In addition, the `sub()' and
-`gsub()' functions can change a variable's value, and the `match()',
-`split()', and `patsplit()' functions can change the contents of their
-array parameters. *Note String Functions::.
+"assignment operators", "increment operators", and "decrement operators"
+(*note Assignment Ops::). In addition, the `sub()' and `gsub()'
+functions can change a variable's value, and the `match()', `split()',
+and `patsplit()' functions can change the contents of their array
+parameters (*note String Functions::).
A few variables have special built-in meanings, such as `FS' (the
-field separator), and `NF' (the number of fields in the current input
+field separator) and `NF' (the number of fields in the current input
record). *Note Built-in Variables::, for a list of the predefined
variables. These predefined variables can be used and assigned just
like all other variables, but their values are also used or changed
@@ -7787,7 +7792,7 @@ point, so the default behavior was restored to use a period as the
decimal point character. You can use the `--use-lc-numeric' option
(*note Options::) to force `gawk' to use the locale's decimal point
character. (`gawk' also uses the locale's decimal point character when
-in POSIX mode, either via `--posix', or the `POSIXLY_CORRECT'
+in POSIX mode, either via `--posix' or the `POSIXLY_CORRECT'
environment variable, as shown previously.)
*note table-locale-affects:: describes the cases in which the
@@ -7803,10 +7808,10 @@ Input Use period Use locale
Table 6.1: Locale decimal point versus a period
- Finally, modern day formal standards and IEEE standard floating-point
-representation can have an unusual but important effect on the way
-`gawk' converts some special string values to numbers. The details are
-presented in *note POSIX Floating Point Problems::.
+ Finally, modern-day formal standards and the IEEE standard
+floating-point representation can have an unusual but important effect
+on the way `gawk' converts some special string values to numbers. The
+details are presented in *note POSIX Floating Point Problems::.

File: gawk.info, Node: All Operators, Next: Truth Values and Conditions, Prev: Values, Up: Expressions
@@ -7814,7 +7819,7 @@ File: gawk.info, Node: All Operators, Next: Truth Values and Conditions, Prev
6.2 Operators: Doing Something with Values
==========================================
-This minor node introduces the "operators" which make use of the values
+This minor node introduces the "operators" that make use of the values
provided by constants and variables.
* Menu:
@@ -7995,7 +8000,7 @@ you'll get.
---------- Footnotes ----------
- (1) It happens that BWK `awk', `gawk' and `mawk' all "get it right,"
+ (1) It happens that BWK `awk', `gawk', and `mawk' all "get it right,"
but you should not rely on this.

@@ -8112,7 +8117,7 @@ righthand expression. For example:
The indices of `bar' are practically guaranteed to be different, because
`rand()' returns different values each time it is called. (Arrays and
the `rand()' function haven't been covered yet. *Note Arrays::, and
-*note Numeric Functions::, for more information). This example
+*note Numeric Functions::, for more information.) This example
illustrates an important fact about assignment operators: the lefthand
expression is only evaluated _once_.
@@ -8130,14 +8135,14 @@ converted to a number.
Operator Effect
--------------------------------------------------------------------------
-LVALUE `+=' INCREMENT Add INCREMENT to the value of LVALUE
-LVALUE `-=' DECREMENT Subtract DECREMENT from the value of LVALUE
-LVALUE `*=' Multiply the value of LVALUE by COEFFICIENT
+LVALUE `+=' INCREMENT Add INCREMENT to the value of LVALUE.
+LVALUE `-=' DECREMENT Subtract DECREMENT from the value of LVALUE.
+LVALUE `*=' Multiply the value of LVALUE by COEFFICIENT.
COEFFICIENT
-LVALUE `/=' DIVISOR Divide the value of LVALUE by DIVISOR
-LVALUE `%=' MODULUS Set LVALUE to its remainder by MODULUS
-LVALUE `^=' POWER
-LVALUE `**=' POWER Raise LVALUE to the power POWER (c.e.)
+LVALUE `/=' DIVISOR Divide the value of LVALUE by DIVISOR.
+LVALUE `%=' MODULUS Set LVALUE to its remainder by MODULUS.
+LVALUE `^=' POWER Raise LVALUE to the power POWER.
+LVALUE `**=' POWER Raise LVALUE to the power POWER. (c.e.)
Table 6.2: Arithmetic assignment operators
@@ -8222,8 +8227,8 @@ is a summary of increment and decrement expressions:
Operator Evaluation Order
- Doctor, doctor! It hurts when I do this!
- So don't do that! -- Groucho Marx
+ Doctor, it hurts when I do this!
+ Then don't do that! -- Groucho Marx
What happens for something like the following?
@@ -8238,7 +8243,7 @@ Or something even stranger?
In other words, when do the various side effects prescribed by the
postfix operators (`b++') take effect? When side effects happen is
-"implementation defined". In other words, it is up to the particular
+"implementation-defined". In other words, it is up to the particular
version of `awk'. The result for the first example may be 12 or 13,
and for the second, it may be 22 or 23.
@@ -8253,7 +8258,7 @@ File: gawk.info, Node: Truth Values and Conditions, Next: Function Calls, Pre
===============================
In certain contexts, expression values also serve as "truth values";
-(i.e., they determine what should happen next as the program runs). This
+i.e., they determine what should happen next as the program runs. This
minor node describes how `awk' defines "true" and "false" and how
values are compared.
@@ -8307,10 +8312,10 @@ File: gawk.info, Node: Typing and Comparison, Next: Boolean Ops, Prev: Truth
The Guide is definitive. Reality is frequently inaccurate. --
Douglas Adams, `The Hitchhiker's Guide to the Galaxy'
- Unlike other programming languages, `awk' variables do not have a
-fixed type. Instead, they can be either a number or a string, depending
-upon the value that is assigned to them. We look now at how variables
-are typed, and how `awk' compares variables.
+ Unlike in other programming languages, in `awk' variables do not
+have a fixed type. Instead, they can be either a number or a string,
+depending upon the value that is assigned to them. We look now at how
+variables are typed, and how `awk' compares variables.
* Menu:
@@ -8331,16 +8336,16 @@ of the variable is important because the types of two variables
determine how they are compared. Variable typing follows these rules:
* A numeric constant or the result of a numeric operation has the
- NUMERIC attribute.
+ "numeric" attribute.
* A string constant or the result of a string operation has the
- STRING attribute.
+ "string" attribute.
* Fields, `getline' input, `FILENAME', `ARGV' elements, `ENVIRON'
elements, and the elements of an array created by `match()',
`split()', and `patsplit()' that are numeric strings have the
- STRNUM attribute. Otherwise, they have the STRING attribute.
- Uninitialized variables also have the STRNUM attribute.
+ "strnum" attribute. Otherwise, they have the "string" attribute.
+ Uninitialized variables also have the "strnum" attribute.
* Attributes propagate across assignments but are not changed by any
use.
@@ -8382,12 +8387,13 @@ constant, then a string comparison is performed. Otherwise, a numeric
comparison is performed.
This point bears additional emphasis: All user input is made of
-characters, and so is first and foremost of STRING type; input strings
-that look numeric are additionally given the STRNUM attribute. Thus,
-the six-character input string ` +3.14' receives the STRNUM attribute.
+characters, and so is first and foremost of string type; input strings
+that look numeric are additionally given the strnum attribute. Thus,
+the six-character input string ` +3.14' receives the strnum attribute.
In contrast, the eight characters `" +3.14"' appearing in program text
comprise a string constant. The following examples print `1' when the
-comparison between the two different constants is true, `0' otherwise:
+comparison between the two different constants is true, and `0'
+otherwise:
$ echo ' +3.14' | awk '{ print($0 == " +3.14") }' True
-| 1
@@ -8486,7 +8492,7 @@ comparison is:
-| false
the result is `false' because both `$1' and `$2' are user input. They
-are numeric strings--therefore both have the STRNUM attribute,
+are numeric strings--therefore both have the strnum attribute,
dictating a numeric comparison. The purpose of the comparison rules
and the use of numeric strings is to attempt to produce the behavior
that is "least surprising," while still "doing the right thing."
@@ -8545,7 +8551,7 @@ is an example to illustrate the difference, in an `en_US.UTF-8' locale:
---------- Footnotes ----------
(1) Technically, string comparison is supposed to behave the same
-way as if the strings are compared with the C `strcoll()' function.
+way as if the strings were compared with the C `strcoll()' function.

File: gawk.info, Node: Boolean Ops, Next: Conditional Exp, Prev: Typing and Comparison, Up: Truth Values and Conditions
@@ -8608,7 +8614,7 @@ Boolean operators are:
The `&&' and `||' operators are called "short-circuit" operators
because of the way they work. Evaluation of the full expression is
-"short-circuited" if the result can be determined part way through its
+"short-circuited" if the result can be determined partway through its
evaluation.
Statements that end with `&&' or `||' can be continued simply by
@@ -8661,15 +8667,15 @@ File: gawk.info, Node: Conditional Exp, Prev: Boolean Ops, Up: Truth Values a
A "conditional expression" is a special kind of expression that has
three operands. It allows you to use one expression's value to select
-one of two other expressions. The conditional expression is the same
-as in the C language, as shown here:
+one of two other expressions. The conditional expression in `awk' is
+the same as in the C language, as shown here:
SELECTOR ? IF-TRUE-EXP : IF-FALSE-EXP
There are three subexpressions. The first, SELECTOR, is always
computed first. If it is "true" (not zero or not null), then
-IF-TRUE-EXP is computed next and its value becomes the value of the
-whole expression. Otherwise, IF-FALSE-EXP is computed next and its
+IF-TRUE-EXP is computed next, and its value becomes the value of the
+whole expression. Otherwise, IF-FALSE-EXP is computed next, and its
value becomes the value of the whole expression. For example, the
following expression produces the absolute value of `x':
@@ -8703,7 +8709,7 @@ A "function" is a name for a particular calculation. This enables you
to ask for it by name at any point in the program. For example, the
function `sqrt()' computes the square root of a number.
- A fixed set of functions are "built-in", which means they are
+ A fixed set of functions are "built in", which means they are
available in every `awk' program. The `sqrt()' function is one of
these. *Note Built-in::, for a list of built-in functions and their
descriptions. In addition, you can define functions for use in your
@@ -8838,7 +8844,7 @@ precedence:
Increment, decrement.
`^ **'
- Exponentiation. These operators group right-to-left.
+ Exponentiation. These operators group right to left.
`+ - !'
Unary plus, minus, logical "not."
@@ -8865,7 +8871,7 @@ String concatenation
operand of another operator. As a result, it does not make sense
to use a redirection operator near another operator of lower
precedence without parentheses. Such combinations (e.g., `print
- foo > a ? b : c'), result in syntax errors. The correct way to
+ foo > a ? b : c') result in syntax errors. The correct way to
write this statement is `print foo > (a ? b : c)'.
`~ !~'
@@ -8875,16 +8881,16 @@ String concatenation
Array membership.
`&&'
- Logical "and".
+ Logical "and."
`||'
- Logical "or".
+ Logical "or."
`?:'
- Conditional. This operator groups right-to-left.
+ Conditional. This operator groups right to left.
`= += -= *= /= %= ^= **='
- Assignment. These operators group right-to-left.
+ Assignment. These operators group right to left.
NOTE: The `|&', `**', and `**=' operators are not specified by
POSIX. For maximum portability, do not use them.
@@ -8952,24 +8958,24 @@ File: gawk.info, Node: Expressions Summary, Prev: Locales, Up: Expressions
* `awk' provides the usual arithmetic operators (addition,
subtraction, multiplication, division, modulus), and unary plus
- and minus. It also provides comparison operators, boolean
- operators, array membership testing, and regexp matching
- operators. String concatenation is accomplished by placing two
- expressions next to each other; there is no explicit operator.
- The three-operand `?:' operator provides an "if-else" test within
- expressions.
+ and minus. It also provides comparison operators, Boolean
+ operators, an array membership testing operator, and regexp
+ matching operators. String concatenation is accomplished by
+ placing two expressions next to each other; there is no explicit
+ operator. The three-operand `?:' operator provides an "if-else"
+ test within expressions.
* Assignment operators provide convenient shorthands for common
arithmetic operations.
- * In `awk', a value is considered to be true if it is non-zero _or_
+ * In `awk', a value is considered to be true if it is nonzero _or_
non-null. Otherwise, the value is false.
* A variable's type is set upon each assignment and may change over
its lifetime. The type determines how it behaves in comparisons
(string or numeric).
- * Function calls return a value which may be used as part of a larger
+ * Function calls return a value that may be used as part of a larger
expression. Expressions used to pass parameter values are fully
evaluated before the function is called. `awk' provides built-in
and user-defined functions; this is described in *note Functions::.
@@ -9143,7 +9149,7 @@ inside Boolean patterns. Likewise, the special patterns `BEGIN', `END',
`BEGINFILE', and `ENDFILE', which never match any input record, are not
expressions and cannot appear inside Boolean patterns.
- The precedence of the different operators which can appear in
+ The precedence of the different operators that can appear in
patterns is described in *note Precedence::.

@@ -9163,8 +9169,8 @@ following:
prints every record in `myfile' between `on'/`off' pairs, inclusive.
A range pattern starts out by matching BEGPAT against every input
-record. When a record matches BEGPAT, the range pattern is "turned on"
-and the range pattern matches this record as well. As long as the
+record. When a record matches BEGPAT, the range pattern is "turned
+on", and the range pattern matches this record as well. As long as the
range pattern stays turned on, it automatically matches every input
record read. The range pattern also matches ENDPAT against every input
record; when this succeeds, the range pattern is "turned off" again for
@@ -9282,7 +9288,7 @@ for more information on using library functions. *Note Library
Functions::, for a number of useful library functions.
If an `awk' program has only `BEGIN' rules and no other rules, then
-the program exits after the `BEGIN' rule is run.(1) However, if an
+the program exits after the `BEGIN' rules are run.(1) However, if an
`END' rule exists, then the input is read, even if there are no other
rules in the program. This is necessary in case the `END' rule checks
the `FNR' and `NR' variables.
@@ -9308,7 +9314,7 @@ give `$0' a real value is to execute a `getline' command without a
variable (*note Getline::). Another way is simply to assign a value to
`$0'.
- The second point is similar to the first but from the other
+ The second point is similar to the first, but from the other
direction. Traditionally, due largely to implementation issues, `$0'
and `NF' were _undefined_ inside an `END' rule. The POSIX standard
specifies that `NF' is available in an `END' rule. It contains the
@@ -9369,7 +9375,7 @@ tasks that would otherwise be difficult or impossible to perform:
entirely. Otherwise, `gawk' exits with the usual fatal error.
* If you have written extensions that modify the record handling (by
- inserting an "input parser," *note Input Parsers::), you can invoke
+ inserting an "input parser"; *note Input Parsers::), you can invoke
them at this point, before `gawk' has started processing the file.
(This is a _very_ advanced feature, currently used only by the
`gawkextlib' project (http://gawkextlib.sourceforge.net).)
@@ -9379,16 +9385,15 @@ last record in an input file. For the last input file, it will be
called before any `END' rules. The `ENDFILE' rule is executed even for
empty input files.
- Normally, when an error occurs when reading input in the normal input
-processing loop, the error is fatal. However, if an `ENDFILE' rule is
-present, the error becomes non-fatal, and instead `ERRNO' is set. This
-makes it possible to catch and process I/O errors at the level of the
-`awk' program.
+ Normally, when an error occurs when reading input in the normal
+input-processing loop, the error is fatal. However, if an `ENDFILE'
+rule is present, the error becomes non-fatal, and instead `ERRNO' is
+set. This makes it possible to catch and process I/O errors at the
+level of the `awk' program.
The `next' statement (*note Next Statement::) is not allowed inside
either a `BEGINFILE' or an `ENDFILE' rule. The `nextfile' statement is
-allowed only inside a `BEGINFILE' rule, but not inside an `ENDFILE'
-rule.
+allowed only inside a `BEGINFILE' rule, not inside an `ENDFILE' rule.
The `getline' statement (*note Getline::) is restricted inside both
`BEGINFILE' and `ENDFILE': only redirected forms of `getline' are
@@ -9433,11 +9438,11 @@ following program:
END { print nmatches, "found" }' /path/to/data
The `awk' program consists of two pieces of quoted text that are
-concatenated together to form the program. The first part is double
-quoted, which allows substitution of the `pattern' shell variable
-inside the quotes. The second part is single quoted.
+concatenated together to form the program. The first part is
+double-quoted, which allows substitution of the `pattern' shell
+variable inside the quotes. The second part is single-quoted.
- Variable substitution via quoting works, but can be potentially
+ Variable substitution via quoting works, but can potentially be
messy. It requires a good understanding of the shell's quoting rules
(*note Quoting::), and it's often difficult to correctly match up the
quotes when reading the program.
@@ -9634,15 +9639,15 @@ The body of this loop is a compound statement enclosed in braces,
containing two statements. The loop works in the following manner:
first, the value of `i' is set to one. Then, the `while' statement
tests whether `i' is less than or equal to three. This is true when
-`i' equals one, so the `i'-th field is printed. Then the `i++'
+`i' equals one, so the `i'th field is printed. Then the `i++'
increments the value of `i' and the loop repeats. The loop terminates
when `i' reaches four.
A newline is not required between the condition and the body;
however, using one makes the program clearer unless the body is a
-compound statement or else is very simple. The newline after the
-open-brace that begins the compound statement is not required either,
-but the program is harder to read without it.
+compound statement or else is very simple. The newline after the open
+brace that begins the compound statement is not required either, but the
+program is harder to read without it.

File: gawk.info, Node: Do Statement, Next: For Statement, Prev: While Statement, Up: Statements
@@ -9665,7 +9670,7 @@ Contrast this with the corresponding `while' statement:
while (CONDITION)
BODY
-This statement does not execute BODY even once if the CONDITION is
+This statement does not execute the BODY even once if the CONDITION is
false to begin with. The following is an example of a `do' statement:
{
@@ -9721,7 +9726,7 @@ loop.)
The same is true of the INCREMENT part. Incrementing additional
variables requires separate statements at the end of the loop. The C
compound expression, using C's comma operator, is useful in this
-context but it is not supported in `awk'.
+context, but it is not supported in `awk'.
Most often, INCREMENT is an increment expression, as in the previous
example. But this is not required; it can be any expression
@@ -9797,7 +9802,7 @@ statement looks like this:
Control flow in the `switch' statement works as it does in C. Once a
match to a given case is made, the case statement bodies execute until
-a `break', `continue', `next', `nextfile' or `exit' is encountered, or
+a `break', `continue', `next', `nextfile', or `exit' is encountered, or
the end of the `switch' statement itself. For example:
while ((c = getopt(ARGC, ARGV, "aksx")) != -1) {
@@ -10040,12 +10045,11 @@ listed in `ARGV'.
standard. See the Austin Group website
(http://austingroupbugs.net/view.php?id=607).
- The current version of BWK `awk', and `mawk' also support
-`nextfile'. However, they don't allow the `nextfile' statement inside
-function bodies (*note User-defined::). `gawk' does; a `nextfile'
-inside a function body reads the next record and starts processing it
-with the first rule in the program, just as any other `nextfile'
-statement.
+ The current version of BWK `awk' and `mawk' also support `nextfile'.
+However, they don't allow the `nextfile' statement inside function
+bodies (*note User-defined::). `gawk' does; a `nextfile' inside a
+function body reads the next record and starts processing it with the
+first rule in the program, just as any other `nextfile' statement.

File: gawk.info, Node: Exit Statement, Prev: Nextfile Statement, Up: Statements
@@ -10073,9 +10077,9 @@ record, skips reading any remaining input records, and executes the
they do not execute.
In such a case, if you don't want the `END' rule to do its job, set
-a variable to nonzero before the `exit' statement and check that
-variable in the `END' rule. *Note Assert Function::, for an example
-that does this.
+a variable to a nonzero value before the `exit' statement and check
+that variable in the `END' rule. *Note Assert Function::, for an
+example that does this.
If an argument is supplied to `exit', its value is used as the exit
status code for the `awk' process. If no argument is supplied, `exit'
@@ -10133,7 +10137,7 @@ of activity.

File: gawk.info, Node: User-modified, Next: Auto-set, Up: Built-in Variables
-7.5.1 Built-In Variables That Control `awk'
+7.5.1 Built-in Variables That Control `awk'
-------------------------------------------
The following is an alphabetical list of variables that you can change
@@ -10157,11 +10161,11 @@ description of each variable.)
use binary I/O. Any other string value is treated the same as
`"rw"', but causes `gawk' to generate a warning message.
`BINMODE' is described in more detail in *note PC Using::. `mawk'
- (*note Other Versions::), also supports this variable, but only
+ (*note Other Versions::) also supports this variable, but only
using numeric values.
``CONVFMT''
- This string controls conversion of numbers to strings (*note
+ A string that controls the conversion of numbers to strings (*note
Conversion::). It works by being passed, in effect, as the first
argument to the `sprintf()' function (*note String Functions::).
Its default value is `"%.6g"'. `CONVFMT' was introduced by the
@@ -10208,7 +10212,7 @@ description of each variable.)
`IGNORECASE #'
If `IGNORECASE' is nonzero or non-null, then all string comparisons
- and all regular expression matching are case independent. Thus,
+ and all regular expression matching are case-independent. Thus,
regexp matching with `~' and `!~', as well as the `gensub()',
`gsub()', `index()', `match()', `patsplit()', `split()', and
`sub()' functions, record termination with `RS', and field
@@ -10228,7 +10232,7 @@ description of each variable.)
Assigning a false value to `LINT' turns off the lint warnings.
This variable is a `gawk' extension. It is not special in other
- `awk' implementations. Unlike the other special variables,
+ `awk' implementations. Unlike with the other special variables,
changing `LINT' does affect the production of lint warnings, even
if `gawk' is in compatibility mode. Much as the `--lint' and
`--traditional' options independently control different aspects of
@@ -10236,17 +10240,18 @@ description of each variable.)
execution is independent of the flavor of `awk' being executed.
`OFMT'
- Controls conversion of numbers to strings (*note Conversion::) for
- printing with the `print' statement. It works by being passed as
- the first argument to the `sprintf()' function (*note String
- Functions::). Its default value is `"%.6g"'. Earlier versions of
- `awk' used `OFMT' to specify the format for converting numbers to
- strings in general expressions; this is now done by `CONVFMT'.
+ A string that controls conversion of numbers to strings (*note
+ Conversion::) for printing with the `print' statement. It works
+ by being passed as the first argument to the `sprintf()' function
+ (*note String Functions::). Its default value is `"%.6g"'.
+ Earlier versions of `awk' used `OFMT' to specify the format for
+ converting numbers to strings in general expressions; this is now
+ done by `CONVFMT'.
`OFS'
- This is the output field separator (*note Output Separators::).
- It is output between the fields printed by a `print' statement.
- Its default value is `" "', a string consisting of a single space.
+ The output field separator (*note Output Separators::). It is
+ output between the fields printed by a `print' statement. Its
+ default value is `" "', a string consisting of a single space.
`ORS'
The output record separator. It is output at the end of every
@@ -10296,7 +10301,7 @@ description of each variable.)

File: gawk.info, Node: Auto-set, Next: ARGC and ARGV, Prev: User-modified, Up: Built-in Variables
-7.5.2 Built-In Variables That Convey Information
+7.5.2 Built-in Variables That Convey Information
------------------------------------------------
The following is an alphabetical list of variables that `awk' sets
@@ -10419,14 +10424,14 @@ Options::), they are not special:
`NF'
The number of fields in the current input record. `NF' is set
- each time a new record is read, when a new field is created or
+ each time a new record is read, when a new field is created, or
when `$0' changes (*note Fields::).
Unlike most of the variables described in this node, assigning a
value to `NF' has the potential to affect `awk''s internal
workings. In particular, assignments to `NF' can be used to
- create or remove fields from the current record. *Note Changing
- Fields::.
+ create fields in or remove fields from the current record. *Note
+ Changing Fields::.
`FUNCTAB #'
An array whose indices and corresponding values are the names of
@@ -10465,7 +10470,7 @@ Options::), they are not special:
`PROCINFO["identifiers"]'
A subarray, indexed by the names of all identifiers used in
- the text of the AWK program. An "identifier" is simply the
+ the text of the `awk' program. An "identifier" is simply the
name of a variable (be it scalar or array), built-in
function, user-defined function, or extension function. For
each identifier, the value of the element is one of the
@@ -10486,7 +10491,7 @@ Options::), they are not special:
`"untyped"'
The identifier is untyped (could be used as a scalar or
- array, `gawk' doesn't know yet).
+ an array; `gawk' doesn't know yet).
`"user"'
The identifier is a user-defined function.
@@ -10579,7 +10584,7 @@ Options::), they are not special:
string, or -1 if no match is found.
`RSTART'
- The start-index in characters of the substring that is matched by
+ The start index in characters of the substring that is matched by
the `match()' function (*note String Functions::). `RSTART' is
set by invoking the `match()' function. Its value is the position
of the string where the matched substring starts, or zero if no
@@ -10629,7 +10634,7 @@ Options::), they are not special:
}
NOTE: In order to avoid severe time-travel paradoxes,(2)
- neither `FUNCTAB' nor `SYMTAB' are available as elements
+ neither `FUNCTAB' nor `SYMTAB' is available as an element
within the `SYMTAB' array.
Changing `NR' and `FNR'
@@ -10768,7 +10773,7 @@ are passed on to the `awk' program. (*Note Getopt Function::, for an
When designing your program, you should choose options that don't
conflict with `gawk''s, because it will process any options that it
accepts before passing the rest of the command line on to your program.
-Using `#!' with the `-E' option may help (*Note Executable Scripts::,
+Using `#!' with the `-E' option may help (*note Executable Scripts::,
and *note Options::,).

@@ -10779,14 +10784,14 @@ File: gawk.info, Node: Pattern Action Summary, Prev: Built-in Variables, Up:
* Pattern-action pairs make up the basic elements of an `awk'
program. Patterns are either normal expressions, range
- expressions, regexp constants, one of the special keywords
- `BEGIN', `END', `BEGINFILE', `ENDFILE', or empty. The action
+ expressions, or regexp constants; one of the special keywords
+ `BEGIN', `END', `BEGINFILE', or `ENDFILE'; or empty. The action
executes if the current record matches the pattern. Empty
(missing) patterns match all records.
- * I/O from `BEGIN' and `END' rules have certain constraints. This
- is also true, only more so, for `BEGINFILE' and `ENDFILE' rules.
- The latter two give you "hooks" into `gawk''s file processing,
+ * I/O from `BEGIN' and `END' rules has certain constraints. This is
+ also true, only more so, for `BEGINFILE' and `ENDFILE' rules. The
+ latter two give you "hooks" into `gawk''s file processing,
allowing you to recover from a file that otherwise would cause a
fatal error (such as a file that cannot be opened).
@@ -10807,11 +10812,11 @@ File: gawk.info, Node: Pattern Action Summary, Prev: Built-in Variables, Up:
iteration of a loop (or get out of a `switch').
* `next' and `nextfile' let you read the next record and start over
- at the top of your program, or skip to the next input file and
+ at the top of your program or skip to the next input file and
start over, respectively.
* The `exit' statement terminates your program. When executed from
- an action (or function body) it transfers control to the `END'
+ an action (or function body), it transfers control to the `END'
statements. From an `END' statement body, it exits immediately.
You may pass an optional numeric value to be used as `awk''s exit
status.
@@ -10913,9 +10918,9 @@ languages allow arbitrary starting and ending indices--e.g., `15 ..
27'--but the size of the array is still fixed when the array is
declared.)
- A contiguous array of four elements might look like the following
-example, conceptually, if the element values are 8, `"foo"', `""', and
-30 as shown in *note figure-array-elements:::
+ A contiguous array of four elements might look like *note
+figure-array-elements::, conceptually, if the element values are eight,
+`"foo"', `""', and 30.
+---------+---------+--------+---------+
| 8 | "foo" | "" | 30 | @r{Value}
@@ -10924,17 +10929,19 @@ example, conceptually, if the element values are 8, `"foo"', `""', and
Figure 8.1: A contiguous array
Only the values are stored; the indices are implicit from the order of
-the values. Here, 8 is the value at index zero, because 8 appears in the
-position with zero elements before it.
+the values. Here, eight is the value at index zero, because eight
+appears in the position with zero elements before it.
Arrays in `awk' are different--they are "associative". This means
that each array is a collection of pairs--an index and its corresponding
array element value:
- Index 3 Value 30
- Index 1 Value "foo"
- Index 0 Value 8
- Index 2 Value ""
+ Index Value
+------------------------
+ `3' `30'
+ `1' `"foo"'
+ `0' `8'
+ `2' `""'
The pairs are shown in jumbled order because their order is
irrelevant.(1)
@@ -10943,11 +10950,13 @@ irrelevant.(1)
at any time. For example, suppose a tenth element is added to the array
whose value is `"number ten"'. The result is:
- Index 10 Value "number ten"
- Index 3 Value 30
- Index 1 Value "foo"
- Index 0 Value 8
- Index 2 Value ""
+ Index Value
+-------------------------------
+ `10' `"number ten"'
+ `3' `30'
+ `1' `"foo"'
+ `0' `8'
+ `2' `""'
Now the array is "sparse", which just means some indices are missing.
It has elements 0-3 and 10, but doesn't have elements 4, 5, 6, 7, 8, or
@@ -10958,17 +10967,19 @@ have to be positive integers. Any number, or even a string, can be an
index. For example, the following is an array that translates words
from English to French:
- Index "dog" Value "chien"
- Index "cat" Value "chat"
- Index "one" Value "un"
- Index 1 Value "un"
+ Index Value
+------------------------
+ `"dog"' `"chien"'
+ `"cat"' `"chat"'
+ `"one"' `"un"'
+ `1' `"un"'
Here we decided to translate the number one in both spelled-out and
numeric form--thus illustrating that a single array can have both
numbers and strings as indices. (In fact, array subscripts are always
strings. There are some subtleties to how numbers work when used as
array subscripts; this is discussed in more detail in *note Numeric
-Array Subscripts::.) Here, the number `1' isn't double quoted, because
+Array Subscripts::.) Here, the number `1' isn't double-quoted, because
`awk' automatically converts it to a string.
The value of `IGNORECASE' has no effect upon array subscripting.
@@ -10992,7 +11003,7 @@ File: gawk.info, Node: Reference to Elements, Next: Assigning Elements, Prev:
-----------------------------------
The principal way to use an array is to refer to one of its elements.
-An array reference is an expression as follows:
+An "array reference" is an expression as follows:
ARRAY[INDEX-EXPRESSION]
@@ -11000,8 +11011,8 @@ Here, ARRAY is the name of an array. The expression INDEX-EXPRESSION is
the index of the desired element of the array.
The value of the array reference is the current value of that array
-element. For example, `foo[4.3]' is an expression for the element of
-array `foo' at index `4.3'.
+element. For example, `foo[4.3]' is an expression referencing the
+element of array `foo' at index `4.3'.
A reference to an array element that has no recorded value yields a
value of `""', the null string. This includes elements that have not
@@ -11068,7 +11079,7 @@ File: gawk.info, Node: Array Example, Next: Scanning an Array, Prev: Assignin
The following program takes a list of lines, each beginning with a line
number, and prints them out in order of line number. The line numbers
-are not in order when they are first read--instead they are scrambled.
+are not in order when they are first read--instead, they are scrambled.
This program sorts the lines by making an array using the line numbers
as subscripts. The program then prints out the lines in sorted order
of their numbers. It is a very simple program and gets confused upon
@@ -11139,7 +11150,7 @@ has previously used, with the variable VAR set to that index.
The following program uses this form of the `for' statement. The
first rule scans the input records and notes which words appear (at
least once) in the input, by storing a one into the array `used' with
-the word as index. The second rule scans the elements of `used' to
+the word as the index. The second rule scans the elements of `used' to
find all the distinct words that appear in the input. It prints each
word that is more than 10 characters long and also prints the number of
such words. *Note String Functions::, for more information on the
@@ -11222,7 +11233,7 @@ internal implementation of arrays and will vary from one version of
Often, though, you may wish to do something simple, such as
"traverse the array by comparing the indices in ascending order," or
"traverse the array by comparing the values in descending order."
-`gawk' provides two mechanisms which give you this control.
+`gawk' provides two mechanisms that give you this control:
* Set `PROCINFO["sorted_in"]' to one of a set of predefined values.
We describe this now.
@@ -11270,22 +11281,26 @@ available:
which `gawk' uses internally to perform the sorting.
`"@ind_str_desc"'
- String indices ordered from high to low.
+ Like `"@ind_str_asc"', but the string indices are ordered from
+ high to low.
`"@ind_num_desc"'
- Numeric indices ordered from high to low.
+ Like `"@ind_num_asc"', but the numeric indices are ordered from
+ high to low.
`"@val_type_desc"'
- Element values, based on type, ordered from high to low.
- Subarrays, if present, come out first.
+ Like `"@val_type_asc"', but the element values, based on type, are
+ ordered from high to low. Subarrays, if present, come out first.
`"@val_str_desc"'
- Element values, treated as strings, ordered from high to low.
- Subarrays, if present, come out first.
+ Like `"@val_str_asc"', but the element values, treated as strings,
+ are ordered from high to low. Subarrays, if present, come out
+ first.
`"@val_num_desc"'
- Element values, treated as numbers, ordered from high to low.
- Subarrays, if present, come out first.
+ Like `"@val_num_asc"', but the element values, treated as numbers,
+ are ordered from high to low. Subarrays, if present, come out
+ first.
The array traversal order is determined before the `for' loop starts
to run. Changing `PROCINFO["sorted_in"]' in the loop body does not
@@ -11471,8 +11486,8 @@ deleting elements in an array:
This example removes all the elements from the array `frequencies'.
Once an element is deleted, a subsequent `for' statement to scan the
-array does not report that element and the `in' operator to check for
-the presence of that element returns zero (i.e., false):
+array does not report that element and using the `in' operator to check
+for the presence of that element returns zero (i.e., false):
delete foo[4]
if (4 in foo)
@@ -11675,7 +11690,7 @@ two-element subarray at index `1' of the main array `a':
This simulates a true two-dimensional array. Each subarray element
can contain another subarray as a value, which in turn can hold other
arrays as well. In this way, you can create arrays of three or more
-dimensions. The indices can be any `awk' expression, including scalars
+dimensions. The indices can be any `awk' expressions, including scalars
separated by commas (i.e., a regular `awk' simulated multidimensional
subscript). So the following is valid in `gawk':
@@ -11684,7 +11699,7 @@ subscript). So the following is valid in `gawk':
Each subarray and the main array can be of different length. In
fact, the elements of an array or its subarray do not all have to have
the same type. This means that the main array and any of its subarrays
-can be non-rectangular, or jagged in structure. You can assign a scalar
+can be nonrectangular, or jagged in structure. You can assign a scalar
value to the index `4' of the main array `a', even though `a[1]' is
itself an array and not a scalar:
@@ -11702,8 +11717,8 @@ the element at that index:
a[4][5][6][7] = "An element in a four-dimensional array"
This removes the scalar value from index `4' and then inserts a
-subarray of subarray of subarray containing a scalar. You can also
-delete an entire subarray or subarray of subarrays:
+three-level nested subarray containing a scalar. You can also delete an
+entire subarray or subarray of subarrays:
delete a[4][5]
a[4][5] = "An element in subarray a[4]"
@@ -11711,7 +11726,7 @@ delete an entire subarray or subarray of subarrays:
But recall that you can not delete the main array `a' and then use it
as a scalar.
- The built-in functions which take array arguments can also be used
+ The built-in functions that take array arguments can also be used
with subarrays. For example, the following code fragment uses `length()'
(*note String Functions::) to determine the number of elements in the
main array `a' and its subarrays:
@@ -11732,7 +11747,7 @@ be nested to scan all the elements of an array of arrays if it is
rectangular in structure. In order to print the contents (scalar
values) of a two-dimensional array of arrays (i.e., in which each
first-level element is itself an array, not necessarily of the same
-length) you could use the following code:
+length), you could use the following code:
for (i in array)
for (j in array[i])
@@ -11814,9 +11829,9 @@ File: gawk.info, Node: Arrays Summary, Prev: Arrays of Arrays, Up: Arrays
of `awk'.
* Standard `awk' simulates multidimensional arrays by separating
- subscript values with a comma. The values are concatenated into a
+ subscript values with commas. The values are concatenated into a
single string, separated by the value of `SUBSEP'. The fact that
- such a subscript was created in this way is not retained; thus
+ such a subscript was created in this way is not retained; thus,
changing `SUBSEP' may have unexpected consequences. You can use
`(SUB1, SUB2, ...) in ARRAY' to see if such a multidimensional
subscript exists in ARRAY.
@@ -11824,7 +11839,7 @@ File: gawk.info, Node: Arrays Summary, Prev: Arrays of Arrays, Up: Arrays
* `gawk' provides true arrays of arrays. You use a separate set of
square brackets for each dimension in such an array:
`data[row][col]', for example. Array elements may thus be either
- scalar values (number or string) or another array.
+ scalar values (number or string) or other arrays.
* Use the `isarray()' built-in function to determine if an array
element is itself a subarray.
@@ -11844,7 +11859,9 @@ internationalize and localize programs.
Besides the built-in functions, `awk' has provisions for writing new
functions that the rest of a program can use. The second half of this
-major node describes these "user-defined" functions.
+major node describes these "user-defined" functions. Finally, we
+explore indirect function calls, a `gawk'-specific extension that lets
+you determine at runtime what function is to be called.
* Menu:
@@ -11856,7 +11873,7 @@ major node describes these "user-defined" functions.

File: gawk.info, Node: Built-in, Next: User-defined, Up: Functions
-9.1 Built-In Functions
+9.1 Built-in Functions
======================
"Built-in" functions are always available for your `awk' program to
@@ -11881,7 +11898,7 @@ for your convenience.

File: gawk.info, Node: Calling Built-in, Next: Numeric Functions, Up: Built-in
-9.1.1 Calling Built-In Functions
+9.1.1 Calling Built-in Functions
--------------------------------
To call one of `awk''s built-in functions, write the name of the
@@ -11918,9 +11935,10 @@ are evaluated from left to right or from right to left. For example:
j = atan2(++i, i *= 2)
If the order of evaluation is left to right, then `i' first becomes
-6, and then 12, and `atan2()' is called with the two arguments 6 and
-12. But if the order of evaluation is right to left, `i' first becomes
-10, then 11, and `atan2()' is called with the two arguments 11 and 10.
+six, and then 12, and `atan2()' is called with the two arguments six
+and 12. But if the order of evaluation is right to left, `i' first
+becomes 10, then 11, and `atan2()' is called with the two arguments 11
+and 10.

File: gawk.info, Node: Numeric Functions, Next: String Functions, Prev: Calling Built-in, Up: Built-in
@@ -11976,7 +11994,7 @@ brackets ([ ]):
Often random integers are needed instead. Following is a
user-defined function that can be used to obtain a random
- non-negative integer less than N:
+ nonnegative integer less than N:
function randint(n)
{
@@ -12066,7 +12084,7 @@ File: gawk.info, Node: String Functions, Next: I/O Functions, Prev: Numeric F
The functions in this minor node look at or change the text of one or
more strings.
- `gawk' understands locales (*note Locales::), and does all string
+ `gawk' understands locales (*note Locales::) and does all string
processing in terms of _characters_, not _bytes_. This distinction is
particularly important to understand for locales where one character
may be represented by multiple bytes. Thus, for example, `length()'
@@ -12137,7 +12155,7 @@ Options::):
a[2] = "de"
a[3] = "sac"
- The `asorti()' function works similarly to `asort()', however, the
+ The `asorti()' function works similarly to `asort()'; however, the
_indices_ are sorted, instead of the values. Thus, in the previous
example, starting with the same initial set of indices and values
in `a', calling `asorti(a)' would yield:
@@ -12225,7 +12243,7 @@ Options::):
With BWK `awk' and `gawk', it is a fatal error to use a regexp
constant for FIND. Other implementations allow it, simply
treating the regexp constant as an expression meaning `$0 ~
- /regexp/'. (d.c.).
+ /regexp/'. (d.c.)
`length('[STRING]`)'
Return the number of characters in STRING. If STRING is a number,
@@ -12269,9 +12287,9 @@ Options::):
`match(STRING, REGEXP' [`, ARRAY']`)'
Search STRING for the longest, leftmost substring matched by the
- regular expression, REGEXP and return the character position
- (index) at which that substring begins (one, if it starts at the
- beginning of STRING). If no match is found, return zero.
+ regular expression REGEXP and return the character position (index)
+ at which that substring begins (one, if it starts at the beginning
+ of STRING). If no match is found, return zero.
The REGEXP argument may be either a regexp constant (`/'...`/') or
a string constant (`"'...`"'). In the latter case, the string is
@@ -12279,7 +12297,7 @@ Options::):
discussion of the difference between the two forms, and the
implications for writing your program correctly.
- The order of the first two arguments is backwards from most other
+ The order of the first two arguments is the opposite of most other
string functions that work with regular expressions, such as
`sub()' and `gsub()'. It might help to remember that for
`match()', the order is the same as for the `~' operator: `STRING
@@ -12346,8 +12364,8 @@ Options::):
There may not be subscripts for the start and index for every
parenthesized subexpression, because they may not all have matched
- text; thus they should be tested for with the `in' operator (*note
- Reference to Elements::).
+ text; thus, they should be tested for with the `in' operator
+ (*note Reference to Elements::).
The ARRAY argument to `match()' is a `gawk' extension. In
compatibility mode (*note Options::), using a third argument is a
@@ -12380,19 +12398,19 @@ Options::):
FIELDSEP, is a regexp describing where to split STRING (much as
`FS' can be a regexp describing where to split input records). If
FIELDSEP is omitted, the value of `FS' is used. `split()' returns
- the number of elements created. SEPS is a `gawk' extension with
+ the number of elements created. SEPS is a `gawk' extension, with
`SEPS[I]' being the separator string between `ARRAY[I]' and
- `ARRAY[I+1]'. If FIELDSEP is a single space then any leading
+ `ARRAY[I+1]'. If FIELDSEP is a single space, then any leading
whitespace goes into `SEPS[0]' and any trailing whitespace goes
- into `SEPS[N]' where N is the return value of `split()' (i.e., the
- number of elements in ARRAY).
+ into `SEPS[N]', where N is the return value of `split()' (i.e.,
+ the number of elements in ARRAY).
The `split()' function splits strings into pieces in a manner
similar to the way input lines are split into fields. For example:
split("cul-de-sac", a, "-", seps)
- splits the string `cul-de-sac' into three fields using `-' as the
+ splits the string `"cul-de-sac"' into three fields using `-' as the
separator. It sets the contents of the array `a' as follows:
a[1] = "cul"
@@ -12409,17 +12427,18 @@ Options::):
As with input field-splitting, when the value of FIELDSEP is
`" "', leading and trailing whitespace is ignored in values
assigned to the elements of ARRAY but not in SEPS, and the elements
- are separated by runs of whitespace. Also, as with input
- field-splitting, if FIELDSEP is the null string, each individual
+ are separated by runs of whitespace. Also, as with input field
+ splitting, if FIELDSEP is the null string, each individual
character in the string is split into its own array element.
(c.e.)
Note, however, that `RS' has no effect on the way `split()' works.
- Even though `RS = ""' causes newline to also be an input field
- separator, this does not affect how `split()' splits strings.
+ Even though `RS = ""' causes the newline character to also be an
+ input field separator, this does not affect how `split()' splits
+ strings.
Modern implementations of `awk', including `gawk', allow the third
- argument to be a regexp constant (`/abc/') as well as a string.
+ argument to be a regexp constant (`/'...`/') as well as a string.
(d.c.) The POSIX standard allows this as well. *Note Computed
Regexps::, for a discussion of the difference between using a
string constant or a regexp constant, and the implications for
@@ -12520,7 +12539,7 @@ Options::):
{ sub(/\|/, "\\&"); print }
As mentioned, the third argument to `sub()' must be a variable,
- field or array element. Some versions of `awk' allow the third
+ field, or array element. Some versions of `awk' allow the third
argument to be an expression that is not an lvalue. In such a
case, `sub()' still searches for the pattern and returns zero or
one, but the result of the substitution (if any) is thrown away
@@ -12645,11 +12664,11 @@ example, `"a\qb"' is treated as `"aqb"'.
At the runtime level, the various functions handle sequences of `\'
and `&' differently. The situation is (sadly) somewhat complex.
-Historically, the `sub()' and `gsub()' functions treated the two
-character sequence `\&' specially; this sequence was replaced in the
-generated text with a single `&'. Any other `\' within the REPLACEMENT
-string that did not precede an `&' was passed through unchanged. This
-is illustrated in *note table-sub-escapes::.
+Historically, the `sub()' and `gsub()' functions treated the
+two-character sequence `\&' specially; this sequence was replaced in
+the generated text with a single `&'. Any other `\' within the
+REPLACEMENT string that did not precede an `&' was passed through
+unchanged. This is illustrated in *note table-sub-escapes::.
You type `sub()' sees `sub()' generates
------- --------- --------------
@@ -12664,10 +12683,10 @@ is illustrated in *note table-sub-escapes::.
Table 9.1: Historical escape sequence processing for `sub()' and
`gsub()'
-This table shows both the lexical-level processing, where an odd number
-of backslashes becomes an even number at the runtime level, as well as
-the runtime processing done by `sub()'. (For the sake of simplicity,
-the rest of the following tables only show the case of even numbers of
+This table shows the lexical-level processing, where an odd number of
+backslashes becomes an even number at the runtime level, as well as the
+runtime processing done by `sub()'. (For the sake of simplicity, the
+rest of the following tables only show the case of even numbers of
backslashes entered at the lexical level.)
The problem with the historical approach is that there is no way to
@@ -12691,10 +12710,10 @@ This is shown in *note table-sub-proposed::.
`\\q' `\q' A literal `\q'
`\\\\' `\\' `\\'
-Table 9.2: GNU `awk' rules for `sub()' and backslash
+Table 9.2: `gawk' rules for `sub()' and backslash
In a nutshell, at the runtime level, there are now three special
-sequences of characters (`\\\&', `\\&' and `\&') whereas historically
+sequences of characters (`\\\&', `\\&', and `\&') whereas historically
there was only one. However, as in the historical case, any `\' that
is not part of one of these three sequences is not special and appears
in the output literally.
@@ -12724,7 +12743,7 @@ Table 9.3: POSIX rules for `sub()' and `gsub()'
`\\\\' is seen as `\\' and produces `\' instead of `\\'.
Starting with version 3.1.4, `gawk' followed the POSIX rules when
-`--posix' is specified (*note Options::). Otherwise, it continued to
+`--posix' was specified (*note Options::). Otherwise, it continued to
follow the proposed rules, as that had been its behavior for many years.
When version 4.0.0 was released, the `gawk' maintainer made the
@@ -12751,9 +12770,9 @@ the `\' does not, as shown in *note table-gensub-escapes::.
Table 9.4: Escape sequence processing for `gensub()'
- Because of the complexity of the lexical and runtime level processing
-and the special cases for `sub()' and `gsub()', we recommend the use of
-`gawk' and `gensub()' when you have to do substitutions.
+ Because of the complexity of the lexical- and runtime-level
+processing and the special cases for `sub()' and `gsub()', we recommend
+the use of `gawk' and `gensub()' when you have to do substitutions.
---------- Footnotes ----------
@@ -12780,10 +12799,10 @@ parameters are enclosed in square brackets ([ ]):
When closing a coprocess, it is occasionally useful to first close
one end of the two-way pipe and then to close the other. This is
done by providing a second argument to `close()'. This second
- argument should be one of the two string values `"to"' or `"from"',
- indicating which end of the pipe to close. Case in the string does
- not matter. *Note Two-way I/O::, which discusses this feature in
- more detail and gives an example.
+ argument (HOW) should be one of the two string values `"to"' or
+ `"from"', indicating which end of the pipe to close. Case in the
+ string does not matter. *Note Two-way I/O::, which discusses this
+ feature in more detail and gives an example.
Note that the second argument to `close()' is a `gawk' extension;
it is not available in compatibility mode (*note Options::).
@@ -12801,7 +12820,7 @@ parameters are enclosed in square brackets ([ ]):
sometimes it is necessary to force a program to "flush" its
buffers (i.e., write the information to its destination, even if a
buffer is not full). This is the purpose of the `fflush()'
- function--`gawk' also buffers its output and the `fflush()'
+ function--`gawk' also buffers its output, and the `fflush()'
function forces `gawk' to flush its buffers.
Brian Kernighan added `fflush()' to his `awk' in April 1992. For
@@ -12818,16 +12837,17 @@ parameters are enclosed in square brackets ([ ]):
output files and pipes if the argument was the null string.
This was changed in order to be compatible with Brian
Kernighan's `awk', in the hope that standardizing this
- feature in POSIX would then be easier (which indeed helped).
+ feature in POSIX would then be easier (which indeed proved to
+ be the case).
With `gawk', you can use `fflush("/dev/stdout")' if you wish
to flush only the standard output.
`fflush()' returns zero if the buffer is successfully flushed;
- otherwise, it returns non-zero. (`gawk' returns -1.) In the case
- where all buffers are flushed, the return value is zero only if
- all buffers were flushed successfully. Otherwise, it is -1, and
- `gawk' warns about the problem FILENAME.
+ otherwise, it returns a nonzero value. (`gawk' returns -1.) In
+ the case where all buffers are flushed, the return value is zero
+ only if all buffers were flushed successfully. Otherwise, it is
+ -1, and `gawk' warns about the problem FILENAME.
`gawk' also issues a warning message if you attempt to flush a
file or pipe that was opened for reading (such as with `getline'),
@@ -12836,9 +12856,9 @@ parameters are enclosed in square brackets ([ ]):
Interactive Versus Noninteractive Buffering
- As a side point, buffering issues can be even more confusing,
- depending upon whether your program is "interactive" (i.e.,
- communicating with a user sitting at a keyboard).(1)
+ As a side point, buffering issues can be even more confusing if
+ your program is "interactive" (i.e., communicating with a user
+ sitting at a keyboard).(1)
Interactive programs generally "line buffer" their output (i.e.,
they write out every line). Noninteractive programs wait until
@@ -12867,7 +12887,7 @@ parameters are enclosed in square brackets ([ ]):
shot.
`system(COMMAND)'
- Execute the operating-system command COMMAND and then return to
+ Execute the operating system command COMMAND and then return to
the `awk' program. Return COMMAND's exit status.
For example, if the following fragment of code is put in your `awk'
@@ -12956,14 +12976,14 @@ File: gawk.info, Node: Time Functions, Next: Bitwise Functions, Prev: I/O Fun
`awk' programs are commonly used to process log files containing
timestamp information, indicating when a particular log record was
-written. Many programs log their timestamp in the form returned by the
-`time()' system call, which is the number of seconds since a particular
-epoch. On POSIX-compliant systems, it is the number of seconds since
-1970-01-01 00:00:00 UTC, not counting leap seconds.(1) All known
-POSIX-compliant systems support timestamps from 0 through 2^31 - 1,
-which is sufficient to represent times through 2038-01-19 03:14:07 UTC.
-Many systems support a wider range of timestamps, including negative
-timestamps that represent times before the epoch.
+written. Many programs log their timestamps in the form returned by
+the `time()' system call, which is the number of seconds since a
+particular epoch. On POSIX-compliant systems, it is the number of
+seconds since 1970-01-01 00:00:00 UTC, not counting leap seconds.(1)
+All known POSIX-compliant systems support timestamps from 0 through
+2^31 - 1, which is sufficient to represent times through 2038-01-19
+03:14:07 UTC. Many systems support a wider range of timestamps,
+including negative timestamps that represent times before the epoch.
In order to make it easier to process such log files and to produce
useful reports, `gawk' provides the following functions for working
@@ -12986,9 +13006,9 @@ enclosed in square brackets ([ ]):
specified; for example, an hour of -1 means 1 hour before midnight.
The origin-zero Gregorian calendar is assumed, with year 0
preceding year 1 and year -1 preceding year 0. The time is
- assumed to be in the local timezone. If the daylight-savings flag
- is positive, the time is assumed to be daylight savings time; if
- zero, the time is assumed to be standard time; and if negative
+ assumed to be in the local time zone. If the daylight-savings
+ flag is positive, the time is assumed to be daylight savings time;
+ if zero, the time is assumed to be standard time; and if negative
(the default), `mktime()' attempts to determine whether daylight
savings time is in effect for the specified time.
@@ -13129,23 +13149,23 @@ the following date format specifications:
The weekday as a decimal number (1-7). Monday is day one.
`%U'
- The week number of the year (the first Sunday as the first day of
- week one) as a decimal number (00-53).
+ The week number of the year (with the first Sunday as the first
+ day of week one) as a decimal number (00-53).
`%V'
- The week number of the year (the first Monday as the first day of
- week one) as a decimal number (01-53). The method for determining
- the week number is as specified by ISO 8601. (To wit: if the week
- containing January 1 has four or more days in the new year, then
- it is week one; otherwise it is week 53 of the previous year and
- the next week is week one.)
+ The week number of the year (with the first Monday as the first
+ day of week one) as a decimal number (01-53). The method for
+ determining the week number is as specified by ISO 8601. (To wit:
+ if the week containing January 1 has four or more days in the new
+ year, then it is week one; otherwise it is week 53 of the previous
+ year and the next week is week one.)
`%w'
The weekday as a decimal number (0-6). Sunday is day zero.
`%W'
- The week number of the year (the first Monday as the first day of
- week one) as a decimal number (00-53).
+ The week number of the year (with the first Monday as the first
+ day of week one) as a decimal number (00-53).
`%x'
The locale's "appropriate" date representation. (This is `%A %B
@@ -13162,8 +13182,8 @@ the following date format specifications:
The full year as a decimal number (e.g., 2015).
`%z'
- The timezone offset in a +HHMM format (e.g., the format necessary
- to produce RFC 822/RFC 1036 date headers).
+ The time zone offset in a `+HHMM' format (e.g., the format
+ necessary to produce RFC 822/RFC 1036 date headers).
`%Z'
The time zone name or abbreviation; no characters if no time zone
@@ -13280,7 +13300,7 @@ each successive pair of bits in the operands. Three common operations
are bitwise AND, OR, and XOR. The operations are described in *note
table-bitwise-ops::.
- Bit Operator
+ Bit operator
| AND | OR | XOR
|--+--+--+--+--+--
Operands | 0 | 1 | 0 | 1 | 0 | 1
@@ -13336,7 +13356,7 @@ paragraph, don't worry about it.)
Here is a user-defined function (*note User-defined::) that
illustrates the use of these functions:
- # bits2str --- turn a byte into readable 1's and 0's
+ # bits2str --- turn a byte into readable ones and zeros
function bits2str(bits, data, mask)
{
@@ -13394,9 +13414,9 @@ Nondecimal-numbers::), and then demonstrates the results of the
---------- Footnotes ----------
- (1) This example shows that 0's come in on the left side. For
+ (1) This example shows that zeros come in on the left side. For
`gawk', this is always true, but in some languages, it's possible to
-have the left side fill with 1's.
+have the left side fill with ones.

File: gawk.info, Node: Type Functions, Next: I18N Functions, Prev: Bitwise Functions, Up: Built-in
@@ -13517,11 +13537,13 @@ the argument names are used to hold the argument values given in the
call.
A function cannot have two parameters with the same name, nor may it
-have a parameter with the same name as the function itself. In
-addition, according to the POSIX standard, function parameters cannot
-have the same name as one of the special predefined variables (*note
-Built-in Variables::). Not all versions of `awk' enforce this
-restriction.
+have a parameter with the same name as the function itself.
+
+ CAUTION: According to the POSIX standard, function parameters
+ cannot have the same name as one of the special predefined
+ variables (*note Built-in Variables::), nor may a function
+ parameter have the same name as another function. Not all
+ versions of `awk' enforce these restrictions.
Local variables act like the empty string if referenced where a
string value is required, and like zero if referenced where a numeric
@@ -14123,13 +14145,13 @@ using indirect function calls:
# average --- return the average of the values in fields $first - $last
- function average(first, last, sum, i)
+ function average(first, last, the_sum, i)
{
- sum = 0;
+ the_sum = 0;
for (i = first; i <= last; i++)
- sum += $i
+ the_sum += $i
- return sum / (last - first + 1)
+ return the_sum / (last - first + 1)
}
# sum --- return the sum of the values in fields $first - $last
@@ -20657,8 +20679,8 @@ File: gawk.info, Node: Gawk I18N, Next: I18N Summary, Prev: I18N Example, Up
`gawk' itself has been internationalized using the GNU `gettext'
package. (GNU `gettext' is described in complete detail in *note (GNU
`gettext' utilities)Top:: gettext, GNU gettext tools.) As of this
-writing, the latest version of GNU `gettext' is version 0.19.3
-(ftp://ftp.gnu.org/gnu/gettext/gettext-0.19.3.tar.gz).
+writing, the latest version of GNU `gettext' is version 0.19.4
+(ftp://ftp.gnu.org/gnu/gettext/gettext-0.19.4.tar.gz).
If a translation of `gawk''s messages exists, then `gawk' produces
usage messages, warnings, and fatal errors in the local language.
@@ -22015,7 +22037,7 @@ so:
$ gawk --version
-| GNU Awk 4.1.2, API: 1.1 (GNU MPFR 3.1.0-p3, GNU MP 5.0.2)
- -| Copyright (C) 1989, 1991-2014 Free Software Foundation.
+ -| Copyright (C) 1989, 1991-2015 Free Software Foundation.
...
(You may see different version numbers than what's shown here. That's
@@ -22554,7 +22576,7 @@ set:
It's not that well known but it's not that obscure either. It's
Euler's modification to Newton's method for calculating pi. Take
a look at lines (23) - (25) here:
- `http://mathworld.wolfram.com/PiFormulas.htm'.
+ `http://mathworld.wolfram.com/PiFormulas.html'.
The algorithm I wrote simply expands the multiply by 2 and works
from the innermost expression outwards. I used this to program HP
@@ -28531,7 +28553,7 @@ Unix `awk'
git clone git://github.com/onetrueawk/awk bwkawk
- This command creates a copy of the Git (http://www.git-scm.com)
+ This command creates a copy of the Git (http://git-scm.com)
repository in a directory named `bwkawk'. If you leave that
argument off the `git' command line, the repository copy is
created in a directory named `awk'.
@@ -28578,7 +28600,7 @@ Unix `awk'
To get `awka', go to `http://sourceforge.net/projects/awka'.
The project seems to be frozen; no new code changes have been made
- since approximately 2003.
+ since approximately 2001.
`pawk'
Nelson H.F. Beebe at the University of Utah has modified BWK `awk'
@@ -28763,7 +28785,7 @@ released versions of `gawk'.
changes, you will probably wish to work with the development version.
To do so, you will need to access the `gawk' source code repository.
The code is maintained using the Git distributed version control system
-(http://git-scm.com/). You will need to install it if your system
+(http://git-scm.com). You will need to install it if your system
doesn't have it. Once you have done so, use the command:
git clone git://git.savannah.gnu.org/gawk.git
@@ -28818,7 +28840,7 @@ possible to include them:
document describes how GNU software should be written. If you
haven't read it, please do so, preferably _before_ starting to
modify `gawk'. (The `GNU Coding Standards' are available from the
- GNU Project's website (http://www.gnu.org/prep/standards_toc.html).
+ GNU Project's website (http://www.gnu.org/prep/standards/).
Texinfo, Info, and DVI versions are also available.)
5. Use the `gawk' coding style. The C code for `gawk' follows the
@@ -29700,6 +29722,21 @@ ANSI
C++ programming languages. These standards often become
international standards as well. See also "ISO."
+Argument
+ An argument can be two different things. It can be an option or a
+ file name passed to a command while invoking it from the command
+ line, or it can be something passed to a "function" inside a
+ program, e.g. inside `awk'.
+
+ In the latter case, an argument can be passed to a function in two
+ ways. Either it is given to the called function by value, i.e., a
+ copy of the value of the variable is made available to the called
+ function, but the original variable cannot be modified by the
+ function itself; or it is given by reference, i.e., a pointer to
+ the interested variable is passed to the function, which can then
+ directly modify it. In `awk' scalars are passed by value, and
+ arrays are passed by reference. See "Pass By Value/Reference."
+
Array
A grouping of multiple values under the same name. Most languages
just provide sequential arrays. `awk' provides associative arrays.
@@ -29735,6 +29772,26 @@ Bash
The GNU version of the standard shell (the Bourne-Again SHell).
See also "Bourne Shell."
+Binary
+ Base-two notation, where the digits are `0'-`1'. Since electronic
+ circuitry works "naturally" in base 2 (just think of Off/On),
+ everything inside a computer is calculated using base 2. Each digit
+ represents the presence (or absence) of a power of 2 and is called
+ a "bit". So, for example, the base-two number `10101' is the same
+ as decimal 21, ((1 x 16) + (1 x 4) + (1 x 1)).
+
+ Since base-two numbers quickly become very long to read and write,
+ they are usually grouped by 3 (i.e., they are read as octal
+ numbers), or by 4 (i.e., they are read as hexadecimal numbers).
+ There is no direct way to insert base 2 numbers in a C program.
+ If need arises, such numbers are usually inserted as octal or
+ hexadecimal numbers. The number of base-two digits that fit into
+ registers used for representing integer numbers in computers is a
+ rough indication of the computing power of the computer itself.
+ Most computers nowadays use 64 bits for representing integer
+ numbers in their registers, but 32-bit, 16-bit and 8-bit registers
+ have been widely used in the past. *Note Nondecimal-numbers::.
+
Bit
Short for "Binary Digit." All values in computer memory
ultimately reduce to binary digits: values that are either zero or
@@ -29763,6 +29820,19 @@ Braces
The characters `{' and `}'. Braces are used in `awk' for
delimiting actions, compound statements, and function bodies.
+Bracket Expression
+ Inside a "regular expression", an expression included in square
+ brackets, meant to designate a single character as belonging to a
+ specified character class. A bracket expression can contain a list
+ of one or more characters, like `[abc]', a range of characters,
+ like `[A-Z]', or a name, delimited by `:', that designates a known
+ set of characters, like `[:digit:]'. The form of bracket expression
+ enclosed between `:' is independent of the underlying
+ representation of the character themselves, which could utilize
+ the ASCII, ECBDIC, or Unicode codesets, depending on the
+ architecture of the computer system, and on localization. See
+ also "Regular Expression."
+
Built-in Function
The `awk' language provides built-in functions that perform various
numerical, I/O-related, and string computations. Examples are
@@ -29790,9 +29860,25 @@ C
In general, `gawk' attempts to be as similar to the 1990 version
of ISO C as makes sense.
+C Shell
+ The C Shell (`csh' or its improved version, `tcsh') is a Unix
+ shell that was created by Bill Joy in the late 1970s. The C shell
+ was differentiated from other shells by its interactive features
+ and overall style, which looks more like C. The C Shell is not
+ backward compatible with the Bourne Shell, so special attention is
+ required when converting scripts written for other Unix shells to
+ the C shell, especially with regard to the management of shell
+ variables. See also "Bourne Shell."
+
C++
A popular object-oriented programming language derived from C.
+Character Class
+ See "Bracket Expression."
+
+Character List
+ See "Bracket Expression."
+
Character Set
The set of numeric codes used by a computer system to represent the
characters (letters, numbers, punctuation, etc.) of a particular
@@ -29807,7 +29893,7 @@ CHEM
A preprocessor for `pic' that reads descriptions of molecules and
produces `pic' input for drawing them. It was written in `awk' by
Brian Kernighan and Jon Bentley, and is available from
- `http://netlib.sandia.gov/netlib/typesetting/chem.gz'.
+ `http://netlib.org/typesetting/chem'.
Comparison Expression
A relation that is either true or false, such as `a < b'.
@@ -29820,10 +29906,21 @@ Compiler
machine-executable object code. The object code is then executed
directly by the computer. See also "Interpreter."
+Complemented Bracket Expression
+ The negation of a "bracket expression". All that is _not_
+ described by a given bracket expression. The symbol `^' precedes
+ the negated bracket expression. E.g.: `[[^:digit:]' designates
+ whatever character is not a digit. `[^bad]' designates whatever
+ character is not one of the letters `b', `a', or `d'. See
+ "Bracket Expression."
+
Compound Statement
A series of `awk' statements, enclosed in curly braces. Compound
statements may be nested. (*Note Statements::.)
+Computed Regexps
+ See "Dynamic Regular Expressions."
+
Concatenation
Concatenating two strings means sticking them together, one after
another, producing a new string. For example, the string `foo'
@@ -29837,6 +29934,12 @@ Conditional Expression
otherwise the value is EXPR3. In either case, only one of EXPR2
and EXPR3 is evaluated. (*Note Conditional Exp::.)
+Control Statement
+ A control statement is an instruction to perform a given operation
+ or a set of operations inside an `awk' program, if a given
+ condition is true. Control statements are: `if', `for', `while',
+ and `do' (*note Statements::).
+
Cookie
A peculiar goodie, token, saying or remembrance produced by or
presented to a program. (With thanks to Professor Doug McIlroy.)
@@ -29943,6 +30046,12 @@ Format
are controlled by the format strings contained in the predefined
variables `CONVFMT' and `OFMT'. (*Note Control Letters::.)
+Fortran
+ Shorthand for FORmula TRANslator, one of the first programming
+ languages available for scientific calculations. It was created by
+ John Backus, and has been available since 1957. It is still in use
+ today.
+
Free Documentation License
This document describes the terms under which this Info file is
published and may be copied. (*Note GNU Free Documentation
@@ -29958,9 +30067,16 @@ FSF
See "Free Software Foundation."
Function
- A specialized group of statements used to encapsulate general or
- program-specific tasks. `awk' has a number of built-in functions,
- and also allows you to define your own. (*Note Functions::.)
+ A part of an `awk' program that can be invoked from every point of
+ the program, to perform a task. `awk' has several built-in
+ functions. Users can define their own functions in every part of
+ the program. Function can be recursive, i.e., they may invoke
+ themselves. *Note Functions::. In `gawk' it is also possible to
+ have functions shared among different programs, and included where
+ required using the `@include' directive (*note Include Files::).
+ In `gawk' the name of the function that should be invoked can be
+ generated at run time, i.e., dynamically. The `gawk' extension
+ API provides constructor functions (*note Constructor Functions::).
`gawk'
The GNU implementation of `awk'.
@@ -30056,6 +30172,12 @@ Keyword
`else', `exit', `for...in', `for', `function', `func', `if',
`next', `nextfile', `switch', and `while'.
+Korn Shell
+ The Korn Shell (`ksh') is a Unix shell which was developed by
+ David Korn at Bell Laboratories in the early 1980s. The Korn Shell
+ is backward-compatible with the Bourne shell and includes many
+ features of the C shell. See also "Bourne Shell."
+
Lesser General Public License
This document describes the terms under which binary library
archives or shared objects, and their source code may be
@@ -30093,6 +30215,13 @@ Metacharacters
Instead, they denote regular expression operations, such as
repetition, grouping, or alternation.
+Nesting
+ Nesting is where information is organized in layers, or where
+ objects contain other similar objects. In `gawk' the `@include'
+ directive can be nested. The "natural" nesting of arithmetic and
+ logical operations can be changed using parentheses (*note
+ Precedence::).
+
No-op
An operation that does nothing.
@@ -30112,6 +30241,11 @@ Octal
are written in C using a leading `0', to indicate their base.
Thus, `013' is 11 ((1 x 8) + 3). *Note Nondecimal-numbers::.
+Output Record
+ A single chunk of data that is written out by `awk'. Usually, an
+ `awk' output record consists of one or more lines of text. *Note
+ Records::.
+
Pattern
Patterns tell `awk' which input records are interesting to which
rules.
@@ -30127,6 +30261,9 @@ PEBKAC
computer usage problems. (Problem Exists Between Keyboard And
Chair.)
+Plug-in
+ See "Extensions."
+
POSIX
The name for a series of standards that specify a Portable
Operating System interface. The "IX" denotes the Unix heritage of
@@ -30150,6 +30287,9 @@ Range (of input lines)
can specify ranges of input lines for `awk' to process or it can
specify single lines. (*Note Pattern Overview::.)
+Record
+ See "Input record" and "Output record."
+
Recursion
When a function calls itself, either directly or indirectly. If
this is clear, stop, and proceed to the next entry. Otherwise,
@@ -30166,6 +30306,16 @@ Redirection
using the `>', `>>', `|', and `|&' operators. (*Note Getline::,
and *note Redirection::.)
+Reference Counts
+ An internal mechanism in `gawk' to minimize the amount of memory
+ needed to store the value of string variables. If the value
+ assumed by a variable is used in more than one place, only one
+ copy of the value itself is kept, and the associated reference
+ count is increased when the same value is used by an additional
+ variable, and decresed when the related variable is no longer in
+ use. When the reference count goes to zero, the memory space used
+ to store the value of the variable is freed.
+
Regexp
See "Regular Expression."
@@ -30184,6 +30334,15 @@ Regular Expression Constant
when you write the `awk' program and cannot be changed during its
execution. (*Note Regexp Usage::.)
+Regular Expression Operators
+ See "Metacharacters."
+
+Rounding
+ Rounding the result of an arithmetic operation can be tricky.
+ More than one way of rounding exists, and in `gawk' it is possible
+ to choose which method should be used in a program. *Note Setting
+ the rounding mode::.
+
Rule
A segment of an `awk' program that specifies how to process single
input records. A rule consists of a "pattern" and an "action".
@@ -30245,6 +30404,11 @@ Special File
handed directly to the underlying operating system--for example,
`/dev/stderr'. (*Note Special Files::.)
+Statement
+ An expression inside an `awk' program in the action part of a
+ pattern-action rule, or inside an `awk' function. A statement can
+ be a variable assignment, an array operation, a loop, etc.
+
Stream Editor
A program that reads records from an input stream and processes
them one or more at a time. This is in contrast with batch
@@ -30287,10 +30451,15 @@ UTC
reference time for day and date calculations. See also "Epoch"
and "GMT."
+Variable
+ A name for a value. In `awk', variables may be either scalars or
+ arrays.
+
Whitespace
A sequence of space, TAB, or newline characters occurring inside
an input record or a string.
+

File: gawk.info, Node: Copying, Next: GNU Free Documentation License, Prev: Glossary, Up: Top
@@ -31523,7 +31692,7 @@ Index
* ! (exclamation point), !~ operator <5>: Case-sensitivity. (line 26)
* ! (exclamation point), !~ operator <6>: Computed Regexps. (line 6)
* ! (exclamation point), !~ operator: Regexp Usage. (line 19)
-* " (double quote), in regexp constants: Computed Regexps. (line 29)
+* " (double quote), in regexp constants: Computed Regexps. (line 30)
* " (double quote), in shell commands: Quoting. (line 54)
* # (number sign), #! (executable scripts): Executable Scripts.
(line 6)
@@ -31552,7 +31721,7 @@ Index
* * (asterisk), * operator, as regexp operator: Regexp Operators.
(line 89)
* * (asterisk), * operator, null strings, matching: String Functions.
- (line 536)
+ (line 537)
* * (asterisk), ** operator <1>: Precedence. (line 49)
* * (asterisk), ** operator: Arithmetic Ops. (line 81)
* * (asterisk), **= operator <1>: Precedence. (line 95)
@@ -31611,7 +31780,7 @@ Index
* --re-interval option: Options. (line 279)
* --sandbox option: Options. (line 286)
* --sandbox option, disabling system() function: I/O Functions.
- (line 128)
+ (line 129)
* --sandbox option, input redirection with getline: Getline. (line 19)
* --sandbox option, output redirection with print, printf: Redirection.
(line 6)
@@ -31758,7 +31927,7 @@ Index
* \ (backslash), in escape sequences: Escape Sequences. (line 6)
* \ (backslash), in escape sequences, POSIX and: Escape Sequences.
(line 108)
-* \ (backslash), in regexp constants: Computed Regexps. (line 29)
+* \ (backslash), in regexp constants: Computed Regexps. (line 30)
* \ (backslash), in shell commands: Quoting. (line 48)
* \ (backslash), regexp operator: Regexp Operators. (line 18)
* ^ (caret), ^ operator: Precedence. (line 49)
@@ -31852,7 +32021,7 @@ Index
* arrays: Arrays. (line 6)
* arrays of arrays: Arrays of Arrays. (line 6)
* arrays, an example of using: Array Example. (line 6)
-* arrays, and IGNORECASE variable: Array Intro. (line 94)
+* arrays, and IGNORECASE variable: Array Intro. (line 100)
* arrays, as parameters to functions: Pass By Value/Reference.
(line 44)
* arrays, associative: Array Intro. (line 50)
@@ -31879,14 +32048,14 @@ Index
(line 6)
* arrays, sorting, and IGNORECASE variable: Array Sorting Functions.
(line 83)
-* arrays, sparse: Array Intro. (line 72)
+* arrays, sparse: Array Intro. (line 76)
* arrays, subscripts, uninitialized variables as: Uninitialized Subscripts.
(line 6)
* arrays, unassigned elements: Reference to Elements.
(line 18)
* artificial intelligence, gawk and: Distribution contents.
(line 52)
-* ASCII <1>: Glossary. (line 133)
+* ASCII <1>: Glossary. (line 197)
* ASCII: Ordinal Functions. (line 45)
* asort <1>: Array Sorting Functions.
(line 6)
@@ -31913,7 +32082,7 @@ Index
* asterisk (*), * operator, as regexp operator: Regexp Operators.
(line 89)
* asterisk (*), * operator, null strings, matching: String Functions.
- (line 536)
+ (line 537)
* asterisk (*), ** operator <1>: Precedence. (line 49)
* asterisk (*), ** operator: Arithmetic Ops. (line 81)
* asterisk (*), **= operator <1>: Precedence. (line 95)
@@ -32027,7 +32196,7 @@ Index
* backslash (\), in escape sequences: Escape Sequences. (line 6)
* backslash (\), in escape sequences, POSIX and: Escape Sequences.
(line 108)
-* backslash (\), in regexp constants: Computed Regexps. (line 29)
+* backslash (\), in regexp constants: Computed Regexps. (line 30)
* backslash (\), in shell commands: Quoting. (line 48)
* backslash (\), regexp operator: Regexp Operators. (line 18)
* backtrace debugger command: Execution Stack. (line 13)
@@ -32058,7 +32227,7 @@ Index
* BEGINFILE pattern, Boolean patterns and: Expression Patterns.
(line 69)
* beginfile() user-defined function: Filetrans Function. (line 61)
-* Bentley, Jon: Glossary. (line 143)
+* Bentley, Jon: Glossary. (line 207)
* Benzinger, Michael: Contributors. (line 97)
* Berry, Karl <1>: Ranges and Locales. (line 74)
* Berry, Karl: Acknowledgments. (line 33)
@@ -32120,7 +32289,7 @@ Index
* Brennan, Michael: Foreword3. (line 84)
* Brian Kernighan's awk <1>: I/O Functions. (line 43)
* Brian Kernighan's awk <2>: Gory Details. (line 19)
-* Brian Kernighan's awk <3>: String Functions. (line 492)
+* Brian Kernighan's awk <3>: String Functions. (line 493)
* Brian Kernighan's awk <4>: Delete. (line 51)
* Brian Kernighan's awk <5>: Nextfile Statement. (line 47)
* Brian Kernighan's awk <6>: Continue Statement. (line 44)
@@ -32140,14 +32309,14 @@ Index
* Brink, Jeroen: DOS Quoting. (line 10)
* Broder, Alan J.: Contributors. (line 88)
* Brown, Martin: Contributors. (line 82)
-* BSD-based operating systems: Glossary. (line 611)
+* BSD-based operating systems: Glossary. (line 753)
* bt debugger command (alias for backtrace): Execution Stack. (line 13)
* Buening, Andreas <1>: Bugs. (line 70)
* Buening, Andreas <2>: Contributors. (line 92)
* Buening, Andreas: Acknowledgments. (line 60)
* buffering, input/output <1>: Two-way I/O. (line 52)
-* buffering, input/output: I/O Functions. (line 140)
-* buffering, interactive vs. noninteractive: I/O Functions. (line 75)
+* buffering, input/output: I/O Functions. (line 141)
+* buffering, interactive vs. noninteractive: I/O Functions. (line 76)
* buffers, flushing: I/O Functions. (line 32)
* buffers, operators for: GNU Regexp Operators.
(line 48)
@@ -32172,8 +32341,8 @@ Index
* case keyword: Switch Statement. (line 6)
* case sensitivity, and regexps: User-modified. (line 76)
* case sensitivity, and string comparisons: User-modified. (line 76)
-* case sensitivity, array indices and: Array Intro. (line 94)
-* case sensitivity, converting case: String Functions. (line 522)
+* case sensitivity, array indices and: Array Intro. (line 100)
+* case sensitivity, converting case: String Functions. (line 523)
* case sensitivity, example programs: Library Functions. (line 53)
* case sensitivity, gawk: Case-sensitivity. (line 26)
* case sensitivity, regexps and: Case-sensitivity. (line 6)
@@ -32182,7 +32351,7 @@ Index
(line 56)
* character lists in regular expression: Bracket Expressions. (line 6)
* character lists, See bracket expressions: Regexp Operators. (line 56)
-* character sets (machine character encodings) <1>: Glossary. (line 133)
+* character sets (machine character encodings) <1>: Glossary. (line 197)
* character sets (machine character encodings): Ordinal Functions.
(line 45)
* character sets, See Also bracket expressions: Regexp Operators.
@@ -32193,7 +32362,7 @@ Index
* Chassell, Robert J.: Acknowledgments. (line 33)
* chdir() extension function: Extension Sample File Functions.
(line 12)
-* chem utility: Glossary. (line 143)
+* chem utility: Glossary. (line 207)
* chr() extension function: Extension Sample Ord.
(line 15)
* chr() user-defined function: Ordinal Functions. (line 16)
@@ -32251,7 +32420,7 @@ Index
* common extensions, \x escape sequence: Escape Sequences. (line 61)
* common extensions, BINMODE variable: PC Using. (line 33)
* common extensions, delete to delete entire arrays: Delete. (line 39)
-* common extensions, func keyword: Definition Syntax. (line 93)
+* common extensions, func keyword: Definition Syntax. (line 95)
* common extensions, length() applied to an array: String Functions.
(line 201)
* common extensions, RS as a regexp: gawk split records. (line 6)
@@ -32270,7 +32439,7 @@ Index
* compatibility mode (gawk), octal numbers: Nondecimal-numbers.
(line 60)
* compatibility mode (gawk), specifying: Options. (line 81)
-* compiled programs <1>: Glossary. (line 155)
+* compiled programs <1>: Glossary. (line 219)
* compiled programs: Basic High Level. (line 15)
* compiling gawk for Cygwin: Cygwin. (line 6)
* compiling gawk for MS-DOS and MS-Windows: PC Compiling. (line 13)
@@ -32302,9 +32471,9 @@ Index
* control statements: Statements. (line 6)
* controlling array scanning order: Controlling Scanning.
(line 14)
-* convert string to lower case: String Functions. (line 523)
-* convert string to number: String Functions. (line 390)
-* convert string to upper case: String Functions. (line 529)
+* convert string to lower case: String Functions. (line 524)
+* convert string to number: String Functions. (line 391)
+* convert string to upper case: String Functions. (line 530)
* converting integer array subscripts: Numeric Array Subscripts.
(line 31)
* converting, dates to timestamps: Time Functions. (line 76)
@@ -32316,7 +32485,7 @@ Index
* CONVFMT variable: Strings And Numbers. (line 29)
* CONVFMT variable, and array subscripts: Numeric Array Subscripts.
(line 6)
-* cookie: Glossary. (line 177)
+* cookie: Glossary. (line 258)
* coprocesses <1>: Two-way I/O. (line 25)
* coprocesses: Redirection. (line 96)
* coprocesses, closing: Close Files And Pipes.
@@ -32340,7 +32509,7 @@ Index
* cut.awk program: Cut Program. (line 45)
* d debugger command (alias for delete): Breakpoint Control. (line 64)
* d.c., See dark corner: Conventions. (line 42)
-* dark corner <1>: Glossary. (line 188)
+* dark corner <1>: Glossary. (line 269)
* dark corner: Conventions. (line 42)
* dark corner, "0" is actually true: Truth Values. (line 24)
* dark corner, /= operator vs. /=.../ regexp constant: Assignment Ops.
@@ -32382,7 +32551,7 @@ Index
(line 148)
* dark corner, regexp constants, as arguments to user-defined functions: Using Constant Regexps.
(line 43)
-* dark corner, split() function: String Functions. (line 361)
+* dark corner, split() function: String Functions. (line 362)
* dark corner, strings, storing: gawk split records. (line 83)
* dark corner, value of ARGV[0]: Auto-set. (line 39)
* data, fixed-width: Constant Size. (line 6)
@@ -32601,7 +32770,7 @@ Index
(line 77)
* differences in awk and gawk, SYMTAB variable: Auto-set. (line 296)
* differences in awk and gawk, TEXTDOMAIN variable: User-modified.
- (line 151)
+ (line 152)
* differences in awk and gawk, trunc-mod operation: Arithmetic Ops.
(line 66)
* directories, command-line: Command-line directories.
@@ -32627,7 +32796,7 @@ Index
* dollar sign ($), incrementing fields and arrays: Increment Ops.
(line 30)
* dollar sign ($), regexp operator: Regexp Operators. (line 35)
-* double quote ("), in regexp constants: Computed Regexps. (line 29)
+* double quote ("), in regexp constants: Computed Regexps. (line 30)
* double quote ("), in shell commands: Quoting. (line 54)
* down debugger command: Execution Stack. (line 23)
* Drepper, Ulrich: Acknowledgments. (line 52)
@@ -32689,7 +32858,7 @@ Index
* environment variables used by gawk: Environment Variables.
(line 6)
* environment variables, in ENVIRON array: Auto-set. (line 60)
-* epoch, definition of: Glossary. (line 234)
+* epoch, definition of: Glossary. (line 315)
* equals sign (=), = operator: Assignment Ops. (line 6)
* equals sign (=), == operator <1>: Precedence. (line 65)
* equals sign (=), == operator: Comparison Operators.
@@ -32775,7 +32944,7 @@ Index
* extensions, common, BINMODE variable: PC Using. (line 33)
* extensions, common, delete to delete entire arrays: Delete. (line 39)
* extensions, common, fflush() function: I/O Functions. (line 43)
-* extensions, common, func keyword: Definition Syntax. (line 93)
+* extensions, common, func keyword: Definition Syntax. (line 95)
* extensions, common, length() applied to an array: String Functions.
(line 201)
* extensions, common, RS as a regexp: gawk split records. (line 6)
@@ -32921,7 +33090,7 @@ Index
* format time string: Time Functions. (line 48)
* formats, numeric output: OFMT. (line 6)
* formatting output: Printf. (line 6)
-* formatting strings: String Functions. (line 383)
+* formatting strings: String Functions. (line 384)
* forward slash (/) to enclose regular expressions: Regexp. (line 10)
* forward slash (/), / operator: Precedence. (line 55)
* forward slash (/), /= operator <1>: Precedence. (line 95)
@@ -32935,10 +33104,10 @@ Index
* frame debugger command: Execution Stack. (line 27)
* Free Documentation License (FDL): GNU Free Documentation License.
(line 7)
-* Free Software Foundation (FSF) <1>: Glossary. (line 288)
+* Free Software Foundation (FSF) <1>: Glossary. (line 375)
* Free Software Foundation (FSF) <2>: Getting. (line 10)
* Free Software Foundation (FSF): Manual History. (line 6)
-* FreeBSD: Glossary. (line 611)
+* FreeBSD: Glossary. (line 753)
* FS variable <1>: User-modified. (line 50)
* FS variable: Field Separators. (line 15)
* FS variable, --field-separator option and: Options. (line 21)
@@ -32952,7 +33121,7 @@ Index
* FS, containing ^: Regexp Field Splitting.
(line 59)
* FS, in multiline records: Multiple Line. (line 41)
-* FSF (Free Software Foundation) <1>: Glossary. (line 288)
+* FSF (Free Software Foundation) <1>: Glossary. (line 375)
* FSF (Free Software Foundation) <2>: Getting. (line 10)
* FSF (Free Software Foundation): Manual History. (line 6)
* fts() extension function: Extension Sample File Functions.
@@ -32992,7 +33161,7 @@ Index
* functions, library, user database, reading: Passwd Functions.
(line 6)
* functions, names of: Definition Syntax. (line 23)
-* functions, recursive: Definition Syntax. (line 83)
+* functions, recursive: Definition Syntax. (line 85)
* functions, string-translation: I18N Functions. (line 6)
* functions, undefined: Pass By Value/Reference.
(line 68)
@@ -33013,7 +33182,7 @@ Index
* gawk, awk and: Preface. (line 21)
* gawk, bitwise operations in: Bitwise Functions. (line 40)
* gawk, break statement in: Break Statement. (line 51)
-* gawk, character classes and: Bracket Expressions. (line 100)
+* gawk, character classes and: Bracket Expressions. (line 101)
* gawk, coding style in: Adding Code. (line 38)
* gawk, command-line options, and regular expressions: GNU Regexp Operators.
(line 70)
@@ -33048,7 +33217,7 @@ Index
* gawk, IGNORECASE variable in <1>: Array Sorting Functions.
(line 83)
* gawk, IGNORECASE variable in <2>: String Functions. (line 58)
-* gawk, IGNORECASE variable in <3>: Array Intro. (line 94)
+* gawk, IGNORECASE variable in <3>: Array Intro. (line 100)
* gawk, IGNORECASE variable in <4>: User-modified. (line 76)
* gawk, IGNORECASE variable in: Case-sensitivity. (line 26)
* gawk, implementation issues: Notes. (line 6)
@@ -33090,7 +33259,7 @@ Index
* gawk, splitting fields and: Constant Size. (line 87)
* gawk, string-translation functions: I18N Functions. (line 6)
* gawk, SYMTAB array in: Auto-set. (line 296)
-* gawk, TEXTDOMAIN variable in: User-modified. (line 151)
+* gawk, TEXTDOMAIN variable in: User-modified. (line 152)
* gawk, timestamps: Time Functions. (line 6)
* gawk, uses for: Preface. (line 34)
* gawk, versions of, information about, printing: Options. (line 300)
@@ -33105,7 +33274,7 @@ Index
* gawkpath_append shell function: Shell Startup Files. (line 19)
* gawkpath_default shell function: Shell Startup Files. (line 12)
* gawkpath_prepend shell function: Shell Startup Files. (line 15)
-* General Public License (GPL): Glossary. (line 305)
+* General Public License (GPL): Glossary. (line 399)
* General Public License, See GPL: Manual History. (line 11)
* generate time values: Time Functions. (line 25)
* gensub <1>: String Functions. (line 90)
@@ -33137,7 +33306,7 @@ Index
* getline from a file: Getline/File. (line 6)
* getline into a variable: Getline/Variable. (line 6)
* getline statement, BEGINFILE/ENDFILE patterns and: BEGINFILE/ENDFILE.
- (line 54)
+ (line 53)
* getlocaltime() user-defined function: Getlocaltime Function.
(line 16)
* getopt() function (C library): Getopt Function. (line 15)
@@ -33163,18 +33332,18 @@ Index
* GNU awk, See gawk: Preface. (line 51)
* GNU Free Documentation License: GNU Free Documentation License.
(line 7)
-* GNU General Public License: Glossary. (line 305)
-* GNU Lesser General Public License: Glossary. (line 396)
+* GNU General Public License: Glossary. (line 399)
+* GNU Lesser General Public License: Glossary. (line 496)
* GNU long options <1>: Options. (line 6)
* GNU long options: Command Line. (line 13)
* GNU long options, printing list of: Options. (line 154)
-* GNU Project <1>: Glossary. (line 314)
+* GNU Project <1>: Glossary. (line 408)
* GNU Project: Manual History. (line 11)
-* GNU/Linux <1>: Glossary. (line 611)
+* GNU/Linux <1>: Glossary. (line 753)
* GNU/Linux <2>: I18N Example. (line 55)
* GNU/Linux: Manual History. (line 28)
* Gordon, Assaf: Contributors. (line 105)
-* GPL (General Public License) <1>: Glossary. (line 305)
+* GPL (General Public License) <1>: Glossary. (line 399)
* GPL (General Public License): Manual History. (line 11)
* GPL (General Public License), printing: Options. (line 88)
* grcat program: Group Functions. (line 16)
@@ -33186,7 +33355,7 @@ Index
* gsub <1>: String Functions. (line 140)
* gsub: Using Constant Regexps.
(line 43)
-* gsub() function, arguments of: String Functions. (line 462)
+* gsub() function, arguments of: String Functions. (line 463)
* gsub() function, escape processing: Gory Details. (line 6)
* h debugger command (alias for help): Miscellaneous Debugger Commands.
(line 66)
@@ -33221,7 +33390,7 @@ Index
* ignore breakpoint: Breakpoint Control. (line 87)
* ignore debugger command: Breakpoint Control. (line 87)
* IGNORECASE variable: User-modified. (line 76)
-* IGNORECASE variable, and array indices: Array Intro. (line 94)
+* IGNORECASE variable, and array indices: Array Intro. (line 100)
* IGNORECASE variable, and array sorting functions: Array Sorting Functions.
(line 83)
* IGNORECASE variable, in example programs: Library Functions.
@@ -33289,14 +33458,14 @@ Index
* integers, arbitrary precision: Arbitrary Precision Integers.
(line 6)
* integers, unsigned: Computer Arithmetic. (line 41)
-* interacting with other programs: I/O Functions. (line 106)
+* interacting with other programs: I/O Functions. (line 107)
* internationalization <1>: I18N and L10N. (line 6)
* internationalization: I18N Functions. (line 6)
* internationalization, localization <1>: Internationalization.
(line 13)
-* internationalization, localization: User-modified. (line 151)
+* internationalization, localization: User-modified. (line 152)
* internationalization, localization, character classes: Bracket Expressions.
- (line 100)
+ (line 101)
* internationalization, localization, gawk and: Internationalization.
(line 13)
* internationalization, localization, locale categories: Explaining gettext.
@@ -33306,20 +33475,20 @@ Index
* internationalization, localization, portability and: I18N Portability.
(line 6)
* internationalizing a program: Explaining gettext. (line 6)
-* interpreted programs <1>: Glossary. (line 356)
+* interpreted programs <1>: Glossary. (line 450)
* interpreted programs: Basic High Level. (line 15)
* interval expressions, regexp operator: Regexp Operators. (line 116)
* inventory-shipped file: Sample Data Files. (line 32)
-* invoke shell command: I/O Functions. (line 106)
+* invoke shell command: I/O Functions. (line 107)
* isarray: Type Functions. (line 11)
-* ISO: Glossary. (line 367)
-* ISO 8859-1: Glossary. (line 133)
-* ISO Latin-1: Glossary. (line 133)
+* ISO: Glossary. (line 461)
+* ISO 8859-1: Glossary. (line 197)
+* ISO Latin-1: Glossary. (line 197)
* Jacobs, Andrew: Passwd Functions. (line 90)
* Jaegermann, Michal <1>: Contributors. (line 45)
* Jaegermann, Michal: Acknowledgments. (line 60)
* Java implementation of awk: Other Versions. (line 117)
-* Java programming language: Glossary. (line 379)
+* Java programming language: Glossary. (line 473)
* jawk: Other Versions. (line 117)
* Jedi knights: Undocumented. (line 6)
* Johansen, Chris: Signature Program. (line 25)
@@ -33328,7 +33497,7 @@ Index
* Kahrs, Ju"rgen: Acknowledgments. (line 60)
* Kasal, Stepan: Acknowledgments. (line 60)
* Kenobi, Obi-Wan: Undocumented. (line 6)
-* Kernighan, Brian <1>: Glossary. (line 143)
+* Kernighan, Brian <1>: Glossary. (line 207)
* Kernighan, Brian <2>: Basic Data Typing. (line 54)
* Kernighan, Brian <3>: Other Versions. (line 13)
* Kernighan, Brian <4>: Contributors. (line 11)
@@ -33369,8 +33538,8 @@ Index
* length: String Functions. (line 171)
* length of input record: String Functions. (line 178)
* length of string: String Functions. (line 171)
-* Lesser General Public License (LGPL): Glossary. (line 396)
-* LGPL (Lesser General Public License): Glossary. (line 396)
+* Lesser General Public License (LGPL): Glossary. (line 496)
+* LGPL (Lesser General Public License): Glossary. (line 496)
* libmawk: Other Versions. (line 125)
* libraries of awk functions: Library Functions. (line 6)
* libraries of awk functions, assertions: Assert Function. (line 6)
@@ -33415,7 +33584,7 @@ Index
* lint checking, undefined functions: Pass By Value/Reference.
(line 85)
* LINT variable: User-modified. (line 88)
-* Linux <1>: Glossary. (line 611)
+* Linux <1>: Glossary. (line 753)
* Linux <2>: I18N Example. (line 55)
* Linux: Manual History. (line 28)
* list all global variables, in debugger: Debugger Info. (line 48)
@@ -33470,14 +33639,14 @@ Index
* matching, expressions, See comparison expressions: Typing and Comparison.
(line 9)
* matching, leftmost longest: Multiple Line. (line 26)
-* matching, null strings: String Functions. (line 536)
+* matching, null strings: String Functions. (line 537)
* mawk utility <1>: Other Versions. (line 48)
* mawk utility <2>: Nextfile Statement. (line 47)
* mawk utility <3>: Concatenation. (line 36)
* mawk utility <4>: Getline/Pipe. (line 62)
* mawk utility: Escape Sequences. (line 120)
* maximum precision supported by MPFR library: Auto-set. (line 244)
-* McIlroy, Doug: Glossary. (line 177)
+* McIlroy, Doug: Glossary. (line 258)
* McPhee, Patrick: Contributors. (line 100)
* message object files: Explaining gettext. (line 42)
* message object files, converting from portable object files: I18N Example.
@@ -33505,7 +33674,7 @@ Index
* names, functions: Definition Syntax. (line 23)
* namespace issues: Library Names. (line 6)
* namespace issues, functions: Definition Syntax. (line 23)
-* NetBSD: Glossary. (line 611)
+* NetBSD: Glossary. (line 753)
* networks, programming: TCP/IP Networking. (line 6)
* networks, support for: Special Network. (line 6)
* newlines <1>: Boolean Ops. (line 69)
@@ -33514,8 +33683,8 @@ Index
* newlines, as field separators: Default Field Splitting.
(line 6)
* newlines, as record separators: awk split records. (line 12)
-* newlines, in dynamic regexps: Computed Regexps. (line 59)
-* newlines, in regexp constants: Computed Regexps. (line 69)
+* newlines, in dynamic regexps: Computed Regexps. (line 60)
+* newlines, in regexp constants: Computed Regexps. (line 70)
* newlines, printing: Print Examples. (line 12)
* newlines, separating statements in actions <1>: Statements. (line 10)
* newlines, separating statements in actions: Action Overview.
@@ -33561,7 +33730,7 @@ Index
(line 43)
* null strings, converting numbers to strings: Strings And Numbers.
(line 21)
-* null strings, matching: String Functions. (line 536)
+* null strings, matching: String Functions. (line 537)
* number as string of bits: Bitwise Functions. (line 110)
* number of array elements: String Functions. (line 201)
* number sign (#), #! (executable scripts): Executable Scripts.
@@ -33590,10 +33759,10 @@ Index
* OFMT variable <2>: Strings And Numbers. (line 57)
* OFMT variable: OFMT. (line 15)
* OFMT variable, POSIX awk and: OFMT. (line 27)
-* OFS variable <1>: User-modified. (line 113)
+* OFS variable <1>: User-modified. (line 114)
* OFS variable <2>: Output Separators. (line 6)
* OFS variable: Changing Fields. (line 64)
-* OpenBSD: Glossary. (line 611)
+* OpenBSD: Glossary. (line 753)
* OpenSolaris: Other Versions. (line 100)
* operating systems, BSD-based: Manual History. (line 28)
* operating systems, PC, gawk on: PC Using. (line 6)
@@ -33643,7 +33812,7 @@ Index
(line 12)
* ord() user-defined function: Ordinal Functions. (line 16)
* order of evaluation, concatenation: Concatenation. (line 41)
-* ORS variable <1>: User-modified. (line 118)
+* ORS variable <1>: User-modified. (line 119)
* ORS variable: Output Separators. (line 21)
* output field separator, See OFS variable: Changing Fields. (line 64)
* output record separator, See ORS variable: Output Separators.
@@ -33719,7 +33888,7 @@ Index
(line 65)
* portability, deleting array elements: Delete. (line 56)
* portability, example programs: Library Functions. (line 42)
-* portability, functions, defining: Definition Syntax. (line 109)
+* portability, functions, defining: Definition Syntax. (line 111)
* portability, gawk: New Ports. (line 6)
* portability, gettext library and: Explaining gettext. (line 11)
* portability, internationalization and: I18N Portability. (line 6)
@@ -33731,7 +33900,7 @@ Index
* portability, operators: Increment Ops. (line 60)
* portability, operators, not in POSIX awk: Precedence. (line 98)
* portability, POSIXLY_CORRECT environment variable: Options. (line 359)
-* portability, substr() function: String Functions. (line 512)
+* portability, substr() function: String Functions. (line 513)
* portable object files <1>: Translator i18n. (line 6)
* portable object files: Explaining gettext. (line 37)
* portable object files, converting to message object files: I18N Example.
@@ -33764,7 +33933,7 @@ Index
* POSIX awk, field separators and <1>: Full Line Fields. (line 16)
* POSIX awk, field separators and: Fields. (line 6)
* POSIX awk, FS variable and: User-modified. (line 60)
-* POSIX awk, function keyword in: Definition Syntax. (line 93)
+* POSIX awk, function keyword in: Definition Syntax. (line 95)
* POSIX awk, functions and, gsub()/sub(): Gory Details. (line 90)
* POSIX awk, functions and, length(): String Functions. (line 180)
* POSIX awk, GNU long options and: Options. (line 15)
@@ -33783,7 +33952,7 @@ Index
* POSIX, gawk extensions not included in: POSIX/GNU. (line 6)
* POSIX, programs, implementing in awk: Clones. (line 6)
* POSIXLY_CORRECT environment variable: Options. (line 339)
-* PREC variable: User-modified. (line 123)
+* PREC variable: User-modified. (line 124)
* precedence <1>: Precedence. (line 6)
* precedence: Increment Ops. (line 60)
* precedence, regexp operators: Regexp Operators. (line 156)
@@ -33798,7 +33967,7 @@ Index
* print statement, commas, omitting: Print Examples. (line 31)
* print statement, I/O operators in: Precedence. (line 71)
* print statement, line continuations and: Print Examples. (line 76)
-* print statement, OFMT variable and: User-modified. (line 113)
+* print statement, OFMT variable and: User-modified. (line 114)
* print statement, See Also redirection, of output: Redirection.
(line 17)
* print statement, sprintf() function and: Round Function. (line 6)
@@ -33857,7 +34026,7 @@ Index
* programming conventions, functions, calling: Calling Built-in.
(line 10)
* programming conventions, functions, writing: Definition Syntax.
- (line 65)
+ (line 67)
* programming conventions, gawk extensions: Internal File Ops.
(line 45)
* programming conventions, private variable names: Library Names.
@@ -33866,7 +34035,7 @@ Index
* programming languages, Ada: Glossary. (line 11)
* programming languages, data-driven vs. procedural: Getting Started.
(line 12)
-* programming languages, Java: Glossary. (line 379)
+* programming languages, Java: Glossary. (line 473)
* programming, basic steps: Basic High Level. (line 20)
* programming, concepts: Basic Concepts. (line 6)
* pwcat program: Passwd Functions. (line 23)
@@ -33913,7 +34082,7 @@ Index
* readfile() user-defined function: Readfile Function. (line 30)
* reading input files: Reading Files. (line 6)
* recipe for a programming language: History. (line 6)
-* record separators <1>: User-modified. (line 132)
+* record separators <1>: User-modified. (line 133)
* record separators: awk split records. (line 6)
* record separators, changing: awk split records. (line 85)
* record separators, regular expressions as: awk split records.
@@ -33926,7 +34095,7 @@ Index
* records, splitting input into: Records. (line 6)
* records, terminating: awk split records. (line 125)
* records, treating files as: gawk split records. (line 93)
-* recursive functions: Definition Syntax. (line 83)
+* recursive functions: Definition Syntax. (line 85)
* redirect gawk output, in debugger: Debugger Info. (line 72)
* redirection of input: Getline/File. (line 6)
* redirection of output: Redirection. (line 6)
@@ -33941,8 +34110,8 @@ Index
* regexp constants, as patterns: Expression Patterns. (line 34)
* regexp constants, in gawk: Using Constant Regexps.
(line 28)
-* regexp constants, slashes vs. quotes: Computed Regexps. (line 29)
-* regexp constants, vs. string constants: Computed Regexps. (line 39)
+* regexp constants, slashes vs. quotes: Computed Regexps. (line 30)
+* regexp constants, vs. string constants: Computed Regexps. (line 40)
* register extension: Registration Functions.
(line 6)
* regular expressions: Regexp. (line 6)
@@ -33961,7 +34130,7 @@ Index
(line 57)
* regular expressions, dynamic: Computed Regexps. (line 6)
* regular expressions, dynamic, with embedded newlines: Computed Regexps.
- (line 59)
+ (line 60)
* regular expressions, gawk, command-line options: GNU Regexp Operators.
(line 70)
* regular expressions, interval expressions and: Options. (line 279)
@@ -33980,7 +34149,7 @@ Index
* regular expressions, searching for: Egrep Program. (line 6)
* relational operators, See comparison operators: Typing and Comparison.
(line 9)
-* replace in string: String Functions. (line 408)
+* replace in string: String Functions. (line 409)
* retrying input: Retrying Input. (line 6)
* return debugger command: Debugger Execution Control.
(line 54)
@@ -34026,8 +34195,8 @@ Index
* round to nearest integer: Numeric Functions. (line 38)
* round() user-defined function: Round Function. (line 16)
* rounding numbers: Round Function. (line 6)
-* ROUNDMODE variable: User-modified. (line 127)
-* RS variable <1>: User-modified. (line 132)
+* ROUNDMODE variable: User-modified. (line 128)
+* RS variable <1>: User-modified. (line 133)
* RS variable: awk split records. (line 12)
* RS variable, multiline records and: Multiple Line. (line 17)
* rshift: Bitwise Functions. (line 53)
@@ -34084,19 +34253,19 @@ Index
* separators, field, FIELDWIDTHS variable and: User-modified. (line 37)
* separators, field, FPAT variable and: User-modified. (line 43)
* separators, field, POSIX and: Fields. (line 6)
-* separators, for records <1>: User-modified. (line 132)
+* separators, for records <1>: User-modified. (line 133)
* separators, for records: awk split records. (line 6)
* separators, for records, regular expressions as: awk split records.
(line 125)
* separators, for statements in actions: Action Overview. (line 19)
-* separators, subscript: User-modified. (line 145)
+* separators, subscript: User-modified. (line 146)
* set breakpoint: Breakpoint Control. (line 11)
* set debugger command: Viewing And Changing Data.
(line 59)
* set directory of message catalogs: I18N Functions. (line 12)
* set watchpoint: Viewing And Changing Data.
(line 67)
-* shadowing of variable values: Definition Syntax. (line 71)
+* shadowing of variable values: Definition Syntax. (line 73)
* shell quoting, rules for: Quoting. (line 6)
* shells, piping commands into: Redirection. (line 136)
* shells, quoting: Using Shell Variables.
@@ -34138,14 +34307,14 @@ Index
(line 14)
* sidebar, Changing NR and FNR: Auto-set. (line 339)
* sidebar, Controlling Output Buffering with system(): I/O Functions.
- (line 138)
+ (line 139)
* sidebar, Escape Sequences for Metacharacters: Escape Sequences.
(line 137)
* sidebar, FS and IGNORECASE: Field Splitting Summary.
(line 38)
* sidebar, Interactive Versus Noninteractive Buffering: I/O Functions.
- (line 73)
-* sidebar, Matching the Null String: String Functions. (line 534)
+ (line 74)
+* sidebar, Matching the Null String: String Functions. (line 535)
* sidebar, Operator Evaluation Order: Increment Ops. (line 58)
* sidebar, Piping into sh: Redirection. (line 134)
* sidebar, Pre-POSIX awk Used OFMT for String Conversion: Strings And Numbers.
@@ -34159,7 +34328,7 @@ Index
* sidebar, Understanding #!: Executable Scripts. (line 31)
* sidebar, Understanding $0: Changing Fields. (line 134)
* sidebar, Using \n in Bracket Expressions of Dynamic Regexps: Computed Regexps.
- (line 57)
+ (line 58)
* sidebar, Using close()'s Return Value: Close Files And Pipes.
(line 131)
* SIGHUP signal, for dynamic profiling: Profiling. (line 210)
@@ -34212,16 +34381,16 @@ Index
* source code, QuikTrim Awk: Other Versions. (line 139)
* source code, Solaris awk: Other Versions. (line 100)
* source files, search path for: Programs Exercises. (line 70)
-* sparse arrays: Array Intro. (line 72)
+* sparse arrays: Array Intro. (line 76)
* Spencer, Henry: Glossary. (line 16)
* split: String Functions. (line 316)
* split string into array: String Functions. (line 297)
* split utility: Split Program. (line 6)
* split() function, array elements, deleting: Delete. (line 61)
* split.awk program: Split Program. (line 30)
-* sprintf <1>: String Functions. (line 383)
+* sprintf <1>: String Functions. (line 384)
* sprintf: OFMT. (line 15)
-* sprintf() function, OFMT variable and: User-modified. (line 113)
+* sprintf() function, OFMT variable and: User-modified. (line 114)
* sprintf() function, print/printf statements and: Round Function.
(line 6)
* sqrt: Numeric Functions. (line 92)
@@ -34229,7 +34398,7 @@ Index
* square root: Numeric Functions. (line 92)
* srand: Numeric Functions. (line 96)
* stack frame: Debugging Terms. (line 10)
-* Stallman, Richard <1>: Glossary. (line 288)
+* Stallman, Richard <1>: Glossary. (line 375)
* Stallman, Richard <2>: Contributors. (line 23)
* Stallman, Richard <3>: Acknowledgments. (line 18)
* Stallman, Richard: Manual History. (line 6)
@@ -34253,7 +34422,7 @@ Index
* stream editors: Full Line Fields. (line 22)
* strftime: Time Functions. (line 48)
* string constants: Scalar Constants. (line 15)
-* string constants, vs. regexp constants: Computed Regexps. (line 39)
+* string constants, vs. regexp constants: Computed Regexps. (line 40)
* string extraction (internationalization): String Extraction.
(line 6)
* string length: String Functions. (line 171)
@@ -34265,7 +34434,7 @@ Index
* strings splitting, example: String Functions. (line 335)
* strings, converting <1>: Bitwise Functions. (line 110)
* strings, converting: Strings And Numbers. (line 6)
-* strings, converting letter case: String Functions. (line 522)
+* strings, converting letter case: String Functions. (line 523)
* strings, converting, numbers to: User-modified. (line 30)
* strings, empty, See null strings: awk split records. (line 115)
* strings, extracting: String Extraction. (line 6)
@@ -34275,15 +34444,15 @@ Index
* strings, null: Regexp Field Splitting.
(line 43)
* strings, numeric: Variable Typing. (line 6)
-* strtonum: String Functions. (line 390)
+* strtonum: String Functions. (line 391)
* strtonum() function (gawk), --non-decimal-data option and: Nondecimal Data.
(line 35)
-* sub <1>: String Functions. (line 408)
+* sub <1>: String Functions. (line 409)
* sub: Using Constant Regexps.
(line 43)
-* sub() function, arguments of: String Functions. (line 462)
+* sub() function, arguments of: String Functions. (line 463)
* sub() function, escape processing: Gory Details. (line 6)
-* subscript separators: User-modified. (line 145)
+* subscript separators: User-modified. (line 146)
* subscripts in arrays, multidimensional: Multidimensional. (line 10)
* subscripts in arrays, multidimensional, scanning: Multiscanning.
(line 11)
@@ -34291,19 +34460,19 @@ Index
(line 6)
* subscripts in arrays, uninitialized variables as: Uninitialized Subscripts.
(line 6)
-* SUBSEP variable: User-modified. (line 145)
+* SUBSEP variable: User-modified. (line 146)
* SUBSEP variable, and multidimensional arrays: Multidimensional.
(line 16)
* substitute in string: String Functions. (line 90)
-* substr: String Functions. (line 481)
-* substring: String Functions. (line 481)
+* substr: String Functions. (line 482)
+* substring: String Functions. (line 482)
* Sumner, Andrew: Other Versions. (line 68)
* supplementary groups of gawk process: Auto-set. (line 260)
* switch statement: Switch Statement. (line 6)
* SYMTAB array: Auto-set. (line 296)
* syntactic ambiguity: /= operator vs. /=.../ regexp constant: Assignment Ops.
(line 148)
-* system: I/O Functions. (line 106)
+* system: I/O Functions. (line 107)
* systime: Time Functions. (line 66)
* t debugger command (alias for tbreak): Breakpoint Control. (line 90)
* tbreak debugger command: Breakpoint Control. (line 90)
@@ -34330,7 +34499,7 @@ Index
* text, printing: Print. (line 22)
* text, printing, unduplicated lines of: Uniq Program. (line 6)
* TEXTDOMAIN variable <1>: Programmer i18n. (line 9)
-* TEXTDOMAIN variable: User-modified. (line 151)
+* TEXTDOMAIN variable: User-modified. (line 152)
* TEXTDOMAIN variable, BEGIN pattern and: Programmer i18n. (line 60)
* TEXTDOMAIN variable, portability and: I18N Portability. (line 20)
* textdomain() function (C library): Explaining gettext. (line 28)
@@ -34353,8 +34522,8 @@ Index
* timestamps, converting dates to: Time Functions. (line 76)
* timestamps, formatted: Getlocaltime Function.
(line 6)
-* tolower: String Functions. (line 523)
-* toupper: String Functions. (line 529)
+* tolower: String Functions. (line 524)
+* toupper: String Functions. (line 530)
* tr utility: Translate Program. (line 6)
* trace debugger command: Miscellaneous Debugger Commands.
(line 108)
@@ -34373,14 +34542,14 @@ Index
(line 22)
* troubleshooting, fatal errors, printf format strings: Format Modifiers.
(line 158)
-* troubleshooting, fflush() function: I/O Functions. (line 62)
+* troubleshooting, fflush() function: I/O Functions. (line 63)
* troubleshooting, function call syntax: Function Calls. (line 30)
* troubleshooting, gawk: Compatibility Mode. (line 6)
* troubleshooting, gawk, bug reports: Bugs. (line 9)
* troubleshooting, gawk, fatal errors, function arguments: Calling Built-in.
(line 16)
* troubleshooting, getline function: File Checking. (line 25)
-* troubleshooting, gsub()/sub() functions: String Functions. (line 472)
+* troubleshooting, gsub()/sub() functions: String Functions. (line 473)
* troubleshooting, match() function: String Functions. (line 292)
* troubleshooting, print statement, omitting commas: Print Examples.
(line 31)
@@ -34388,10 +34557,10 @@ Index
* troubleshooting, quotes with file names: Special FD. (line 62)
* troubleshooting, readable data files: File Checking. (line 6)
* troubleshooting, regexp constants vs. string constants: Computed Regexps.
- (line 39)
+ (line 40)
* troubleshooting, string concatenation: Concatenation. (line 26)
-* troubleshooting, substr() function: String Functions. (line 499)
-* troubleshooting, system() function: I/O Functions. (line 128)
+* troubleshooting, substr() function: String Functions. (line 500)
+* troubleshooting, system() function: I/O Functions. (line 129)
* troubleshooting, typographical errors, global variables: Options.
(line 98)
* true, logical: Truth Values. (line 6)
@@ -34414,14 +34583,14 @@ Index
* undisplay debugger command: Viewing And Changing Data.
(line 80)
* undocumented features: Undocumented. (line 6)
-* Unicode <1>: Glossary. (line 133)
+* Unicode <1>: Glossary. (line 197)
* Unicode <2>: Ranges and Locales. (line 61)
* Unicode: Ordinal Functions. (line 45)
* uninitialized variables, as array subscripts: Uninitialized Subscripts.
(line 6)
* uniq utility: Uniq Program. (line 6)
* uniq.awk program: Uniq Program. (line 65)
-* Unix: Glossary. (line 611)
+* Unix: Glossary. (line 753)
* Unix awk, backslashes in escape sequences: Escape Sequences.
(line 120)
* Unix awk, close() function and: Close Files And Pipes.
@@ -34470,7 +34639,7 @@ Index
* variables, predefined conveying information: Auto-set. (line 6)
* variables, private: Library Names. (line 11)
* variables, setting: Options. (line 32)
-* variables, shadowing: Definition Syntax. (line 71)
+* variables, shadowing: Definition Syntax. (line 73)
* variables, types of: Assignment Ops. (line 40)
* variables, types of, comparison expressions and: Typing and Comparison.
(line 9)
@@ -34604,528 +34773,528 @@ Node: More Complex102678
Node: Statements/Lines105540
Ref: Statements/Lines-Footnote-1109995
Node: Other Features110260
-Node: When111191
-Ref: When-Footnote-1112945
-Node: Intro Summary113010
-Node: Invoking Gawk113893
-Node: Command Line115407
-Node: Options116205
-Ref: Options-Footnote-1132009
-Ref: Options-Footnote-2132238
-Node: Other Arguments132263
-Node: Naming Standard Input135211
-Node: Environment Variables136304
-Node: AWKPATH Variable136862
-Ref: AWKPATH Variable-Footnote-1140275
-Ref: AWKPATH Variable-Footnote-2140320
-Node: AWKLIBPATH Variable140580
-Node: Other Environment Variables141836
-Node: Exit Status145324
-Node: Include Files146000
-Node: Loading Shared Libraries149597
-Node: Obsolete151024
-Node: Undocumented151721
-Node: Invoking Summary151988
-Node: Regexp153652
-Node: Regexp Usage155106
-Node: Escape Sequences157143
-Node: Regexp Operators163384
-Ref: Regexp Operators-Footnote-1170810
-Ref: Regexp Operators-Footnote-2170957
-Node: Bracket Expressions171055
-Ref: table-char-classes173070
-Node: Leftmost Longest175994
-Node: Computed Regexps177296
-Node: GNU Regexp Operators180693
-Node: Case-sensitivity184366
-Ref: Case-sensitivity-Footnote-1187251
-Ref: Case-sensitivity-Footnote-2187486
-Node: Regexp Summary187594
-Node: Reading Files189061
-Node: Records191224
-Node: awk split records191957
-Node: gawk split records196872
-Ref: gawk split records-Footnote-1201416
-Node: Fields201453
-Ref: Fields-Footnote-1204229
-Node: Nonconstant Fields204315
-Ref: Nonconstant Fields-Footnote-1206558
-Node: Changing Fields206762
-Node: Field Separators212691
-Node: Default Field Splitting215396
-Node: Regexp Field Splitting216513
-Node: Single Character Fields219863
-Node: Command Line Field Separator220922
-Node: Full Line Fields224134
-Ref: Full Line Fields-Footnote-1225651
-Ref: Full Line Fields-Footnote-2225697
-Node: Field Splitting Summary225798
-Node: Constant Size227872
-Node: Splitting By Content232461
-Ref: Splitting By Content-Footnote-1236455
-Node: Multiple Line236618
-Ref: Multiple Line-Footnote-1242504
-Node: Getline242683
-Node: Plain Getline245167
-Node: Getline/Variable247807
-Node: Getline/File248955
-Node: Getline/Variable/File250339
-Ref: Getline/Variable/File-Footnote-1251942
-Node: Getline/Pipe252029
-Node: Getline/Variable/Pipe254712
-Node: Getline/Coprocess255843
-Node: Getline/Variable/Coprocess257095
-Node: Getline Notes257834
-Node: Getline Summary260626
-Ref: table-getline-variants261038
-Node: Read Timeout261867
-Ref: Read Timeout-Footnote-1265757
-Node: Retrying Input265815
-Node: Command-line directories267010
-Node: Input Summary267917
-Node: Input Exercises271218
-Node: Printing271946
-Node: Print273723
-Node: Print Examples275180
-Node: Output Separators277959
-Node: OFMT279977
-Node: Printf281331
-Node: Basic Printf282116
-Node: Control Letters283686
-Node: Format Modifiers287669
-Node: Printf Examples293678
-Node: Redirection296164
-Node: Special FD303005
-Ref: Special FD-Footnote-1306165
-Node: Special Files306239
-Node: Other Inherited Files306856
-Node: Special Network307856
-Node: Special Caveats308718
-Node: Close Files And Pipes309669
-Ref: Close Files And Pipes-Footnote-1316851
-Ref: Close Files And Pipes-Footnote-2316999
-Node: Output Summary317149
-Node: Output Exercises318147
-Node: Expressions318827
-Node: Values320012
-Node: Constants320690
-Node: Scalar Constants321381
-Ref: Scalar Constants-Footnote-1322240
-Node: Nondecimal-numbers322490
-Node: Regexp Constants325508
-Node: Using Constant Regexps326033
-Node: Variables329176
-Node: Using Variables329831
-Node: Assignment Options331742
-Node: Conversion333617
-Node: Strings And Numbers334141
-Ref: Strings And Numbers-Footnote-1337206
-Node: Locale influences conversions337315
-Ref: table-locale-affects340062
-Node: All Operators340650
-Node: Arithmetic Ops341280
-Node: Concatenation343785
-Ref: Concatenation-Footnote-1346604
-Node: Assignment Ops346710
-Ref: table-assign-ops351689
-Node: Increment Ops352961
-Node: Truth Values and Conditions356399
-Node: Truth Values357484
-Node: Typing and Comparison358533
-Node: Variable Typing359343
-Node: Comparison Operators362996
-Ref: table-relational-ops363406
-Node: POSIX String Comparison366901
-Ref: POSIX String Comparison-Footnote-1367973
-Node: Boolean Ops368111
-Ref: Boolean Ops-Footnote-1372590
-Node: Conditional Exp372681
-Node: Function Calls374408
-Node: Precedence378288
-Node: Locales381949
-Node: Expressions Summary383581
-Node: Patterns and Actions386141
-Node: Pattern Overview387261
-Node: Regexp Patterns388940
-Node: Expression Patterns389483
-Node: Ranges393193
-Node: BEGIN/END396299
-Node: Using BEGIN/END397060
-Ref: Using BEGIN/END-Footnote-1399794
-Node: I/O And BEGIN/END399900
-Node: BEGINFILE/ENDFILE402214
-Node: Empty405115
-Node: Using Shell Variables405432
-Node: Action Overview407705
-Node: Statements410031
-Node: If Statement411879
-Node: While Statement413374
-Node: Do Statement415403
-Node: For Statement416547
-Node: Switch Statement419704
-Node: Break Statement422086
-Node: Continue Statement424127
-Node: Next Statement425954
-Node: Nextfile Statement428335
-Node: Exit Statement430965
-Node: Built-in Variables433368
-Node: User-modified434501
-Ref: User-modified-Footnote-1442182
-Node: Auto-set442244
-Ref: Auto-set-Footnote-1456460
-Ref: Auto-set-Footnote-2456665
-Node: ARGC and ARGV456721
-Node: Pattern Action Summary460939
-Node: Arrays463366
-Node: Array Basics464695
-Node: Array Intro465539
-Ref: figure-array-elements467503
-Ref: Array Intro-Footnote-1470029
-Node: Reference to Elements470157
-Node: Assigning Elements472609
-Node: Array Example473100
-Node: Scanning an Array474858
-Node: Controlling Scanning477874
-Ref: Controlling Scanning-Footnote-1483070
-Node: Numeric Array Subscripts483386
-Node: Uninitialized Subscripts485571
-Node: Delete487188
-Ref: Delete-Footnote-1489931
-Node: Multidimensional489988
-Node: Multiscanning493085
-Node: Arrays of Arrays494674
-Node: Arrays Summary499433
-Node: Functions501525
-Node: Built-in502424
-Node: Calling Built-in503502
-Node: Numeric Functions505493
-Ref: Numeric Functions-Footnote-1510312
-Ref: Numeric Functions-Footnote-2510669
-Ref: Numeric Functions-Footnote-3510717
-Node: String Functions510989
-Ref: String Functions-Footnote-1534464
-Ref: String Functions-Footnote-2534593
-Ref: String Functions-Footnote-3534841
-Node: Gory Details534928
-Ref: table-sub-escapes536709
-Ref: table-sub-proposed538229
-Ref: table-posix-sub539593
-Ref: table-gensub-escapes541129
-Ref: Gory Details-Footnote-1541961
-Node: I/O Functions542112
-Ref: I/O Functions-Footnote-1549330
-Node: Time Functions549477
-Ref: Time Functions-Footnote-1559965
-Ref: Time Functions-Footnote-2560033
-Ref: Time Functions-Footnote-3560191
-Ref: Time Functions-Footnote-4560302
-Ref: Time Functions-Footnote-5560414
-Ref: Time Functions-Footnote-6560641
-Node: Bitwise Functions560907
-Ref: table-bitwise-ops561469
-Ref: Bitwise Functions-Footnote-1565778
-Node: Type Functions565947
-Node: I18N Functions567098
-Node: User-defined568743
-Node: Definition Syntax569548
-Ref: Definition Syntax-Footnote-1574955
-Node: Function Example575026
-Ref: Function Example-Footnote-1577945
-Node: Function Caveats577967
-Node: Calling A Function578485
-Node: Variable Scope579443
-Node: Pass By Value/Reference582431
-Node: Return Statement585926
-Node: Dynamic Typing588907
-Node: Indirect Calls589836
-Ref: Indirect Calls-Footnote-1601138
-Node: Functions Summary601266
-Node: Library Functions603968
-Ref: Library Functions-Footnote-1607577
-Ref: Library Functions-Footnote-2607720
-Node: Library Names607891
-Ref: Library Names-Footnote-1611345
-Ref: Library Names-Footnote-2611568
-Node: General Functions611654
-Node: Strtonum Function612757
-Node: Assert Function615779
-Node: Round Function619103
-Node: Cliff Random Function620644
-Node: Ordinal Functions621660
-Ref: Ordinal Functions-Footnote-1624723
-Ref: Ordinal Functions-Footnote-2624975
-Node: Join Function625186
-Ref: Join Function-Footnote-1626955
-Node: Getlocaltime Function627155
-Node: Readfile Function630899
-Node: Shell Quoting632869
-Node: Data File Management634270
-Node: Filetrans Function634902
-Node: Rewind Function638958
-Node: File Checking640345
-Ref: File Checking-Footnote-1641677
-Node: Empty Files641878
-Node: Ignoring Assigns643857
-Node: Getopt Function645408
-Ref: Getopt Function-Footnote-1656870
-Node: Passwd Functions657070
-Ref: Passwd Functions-Footnote-1665907
-Node: Group Functions665995
-Ref: Group Functions-Footnote-1673889
-Node: Walking Arrays674102
-Node: Library Functions Summary675705
-Node: Library Exercises677106
-Node: Sample Programs678386
-Node: Running Examples679156
-Node: Clones679884
-Node: Cut Program681108
-Node: Egrep Program690827
-Ref: Egrep Program-Footnote-1698325
-Node: Id Program698435
-Node: Split Program702080
-Ref: Split Program-Footnote-1705528
-Node: Tee Program705656
-Node: Uniq Program708445
-Node: Wc Program715864
-Ref: Wc Program-Footnote-1720114
-Node: Miscellaneous Programs720208
-Node: Dupword Program721421
-Node: Alarm Program723452
-Node: Translate Program728256
-Ref: Translate Program-Footnote-1732821
-Node: Labels Program733091
-Ref: Labels Program-Footnote-1736442
-Node: Word Sorting736526
-Node: History Sorting740597
-Node: Extract Program742433
-Node: Simple Sed749958
-Node: Igawk Program753026
-Ref: Igawk Program-Footnote-1767350
-Ref: Igawk Program-Footnote-2767551
-Ref: Igawk Program-Footnote-3767673
-Node: Anagram Program767788
-Node: Signature Program770845
-Node: Programs Summary772092
-Node: Programs Exercises773285
-Ref: Programs Exercises-Footnote-1777416
-Node: Advanced Features777507
-Node: Nondecimal Data779455
-Node: Array Sorting781045
-Node: Controlling Array Traversal781742
-Ref: Controlling Array Traversal-Footnote-1790075
-Node: Array Sorting Functions790193
-Ref: Array Sorting Functions-Footnote-1794082
-Node: Two-way I/O794278
-Ref: Two-way I/O-Footnote-1799223
-Ref: Two-way I/O-Footnote-2799409
-Node: TCP/IP Networking799491
-Node: Profiling802364
-Node: Advanced Features Summary810641
-Node: Internationalization812574
-Node: I18N and L10N814054
-Node: Explaining gettext814740
-Ref: Explaining gettext-Footnote-1819765
-Ref: Explaining gettext-Footnote-2819949
-Node: Programmer i18n820114
-Ref: Programmer i18n-Footnote-1824980
-Node: Translator i18n825029
-Node: String Extraction825823
-Ref: String Extraction-Footnote-1826954
-Node: Printf Ordering827040
-Ref: Printf Ordering-Footnote-1829826
-Node: I18N Portability829890
-Ref: I18N Portability-Footnote-1832345
-Node: I18N Example832408
-Ref: I18N Example-Footnote-1835211
-Node: Gawk I18N835283
-Node: I18N Summary835921
-Node: Debugger837260
-Node: Debugging838282
-Node: Debugging Concepts838723
-Node: Debugging Terms840576
-Node: Awk Debugging843148
-Node: Sample Debugging Session844042
-Node: Debugger Invocation844562
-Node: Finding The Bug845946
-Node: List of Debugger Commands852421
-Node: Breakpoint Control853754
-Node: Debugger Execution Control857450
-Node: Viewing And Changing Data860814
-Node: Execution Stack864192
-Node: Debugger Info865829
-Node: Miscellaneous Debugger Commands869846
-Node: Readline Support874875
-Node: Limitations875767
-Node: Debugging Summary877881
-Node: Arbitrary Precision Arithmetic879049
-Node: Computer Arithmetic880465
-Ref: table-numeric-ranges884063
-Ref: Computer Arithmetic-Footnote-1884922
-Node: Math Definitions884979
-Ref: table-ieee-formats888267
-Ref: Math Definitions-Footnote-1888871
-Node: MPFR features888976
-Node: FP Math Caution890647
-Ref: FP Math Caution-Footnote-1891697
-Node: Inexactness of computations892066
-Node: Inexact representation893025
-Node: Comparing FP Values894382
-Node: Errors accumulate895464
-Node: Getting Accuracy896897
-Node: Try To Round899559
-Node: Setting precision900458
-Ref: table-predefined-precision-strings901142
-Node: Setting the rounding mode902931
-Ref: table-gawk-rounding-modes903295
-Ref: Setting the rounding mode-Footnote-1906750
-Node: Arbitrary Precision Integers906929
-Ref: Arbitrary Precision Integers-Footnote-1911828
-Node: POSIX Floating Point Problems911977
-Ref: POSIX Floating Point Problems-Footnote-1915850
-Node: Floating point summary915888
-Node: Dynamic Extensions918082
-Node: Extension Intro919634
-Node: Plugin License920900
-Node: Extension Mechanism Outline921697
-Ref: figure-load-extension922125
-Ref: figure-register-new-function923605
-Ref: figure-call-new-function924609
-Node: Extension API Description926595
-Node: Extension API Functions Introduction928129
-Node: General Data Types933001
-Ref: General Data Types-Footnote-1938740
-Node: Memory Allocation Functions939039
-Ref: Memory Allocation Functions-Footnote-1941878
-Node: Constructor Functions941974
-Node: Registration Functions943708
-Node: Extension Functions944393
-Node: Exit Callback Functions946690
-Node: Extension Version String947938
-Node: Input Parsers948603
-Node: Output Wrappers958482
-Node: Two-way processors962997
-Node: Printing Messages965201
-Ref: Printing Messages-Footnote-1966277
-Node: Updating `ERRNO'966429
-Node: Requesting Values967169
-Ref: table-value-types-returned967897
-Node: Accessing Parameters968854
-Node: Symbol Table Access970085
-Node: Symbol table by name970599
-Node: Symbol table by cookie972580
-Ref: Symbol table by cookie-Footnote-1976724
-Node: Cached values976787
-Ref: Cached values-Footnote-1980286
-Node: Array Manipulation980377
-Ref: Array Manipulation-Footnote-1981467
-Node: Array Data Types981504
-Ref: Array Data Types-Footnote-1984159
-Node: Array Functions984251
-Node: Flattening Arrays988105
-Node: Creating Arrays994997
-Node: Redirection API999768
-Node: Extension API Variables1002539
-Node: Extension Versioning1003172
-Node: Extension API Informational Variables1005073
-Node: Extension API Boilerplate1006138
-Node: Finding Extensions1009947
-Node: Extension Example1010507
-Node: Internal File Description1011279
-Node: Internal File Ops1015346
-Ref: Internal File Ops-Footnote-11027016
-Node: Using Internal File Ops1027156
-Ref: Using Internal File Ops-Footnote-11029539
-Node: Extension Samples1029812
-Node: Extension Sample File Functions1031338
-Node: Extension Sample Fnmatch1038976
-Node: Extension Sample Fork1040467
-Node: Extension Sample Inplace1041682
-Node: Extension Sample Ord1043357
-Node: Extension Sample Readdir1044193
-Ref: table-readdir-file-types1045069
-Node: Extension Sample Revout1045880
-Node: Extension Sample Rev2way1046470
-Node: Extension Sample Read write array1047210
-Node: Extension Sample Readfile1049150
-Node: Extension Sample Time1050245
-Node: Extension Sample API Tests1051594
-Node: gawkextlib1052085
-Node: Extension summary1054743
-Node: Extension Exercises1058432
-Node: Language History1059154
-Node: V7/SVR3.11060810
-Node: SVR41062991
-Node: POSIX1064436
-Node: BTL1065825
-Node: POSIX/GNU1066559
-Node: Feature History1072183
-Node: Common Extensions1085281
-Node: Ranges and Locales1086605
-Ref: Ranges and Locales-Footnote-11091223
-Ref: Ranges and Locales-Footnote-21091250
-Ref: Ranges and Locales-Footnote-31091484
-Node: Contributors1091705
-Node: History summary1097246
-Node: Installation1098616
-Node: Gawk Distribution1099562
-Node: Getting1100046
-Node: Extracting1100869
-Node: Distribution contents1102504
-Node: Unix Installation1108569
-Node: Quick Installation1109252
-Node: Shell Startup Files1111663
-Node: Additional Configuration Options1112742
-Node: Configuration Philosophy1114481
-Node: Non-Unix Installation1116850
-Node: PC Installation1117308
-Node: PC Binary Installation1118627
-Node: PC Compiling1120475
-Ref: PC Compiling-Footnote-11123496
-Node: PC Testing1123605
-Node: PC Using1124781
-Node: Cygwin1128896
-Node: MSYS1129719
-Node: VMS Installation1130219
-Node: VMS Compilation1131011
-Ref: VMS Compilation-Footnote-11132233
-Node: VMS Dynamic Extensions1132291
-Node: VMS Installation Details1133975
-Node: VMS Running1136227
-Node: VMS GNV1139063
-Node: VMS Old Gawk1139797
-Node: Bugs1140267
-Node: Other Versions1144150
-Node: Installation summary1150578
-Node: Notes1151634
-Node: Compatibility Mode1152499
-Node: Additions1153281
-Node: Accessing The Source1154206
-Node: Adding Code1155642
-Node: New Ports1161807
-Node: Derived Files1166289
-Ref: Derived Files-Footnote-11171764
-Ref: Derived Files-Footnote-21171798
-Ref: Derived Files-Footnote-31172394
-Node: Future Extensions1172508
-Node: Implementation Limitations1173114
-Node: Extension Design1174362
-Node: Old Extension Problems1175516
-Ref: Old Extension Problems-Footnote-11177033
-Node: Extension New Mechanism Goals1177090
-Ref: Extension New Mechanism Goals-Footnote-11180450
-Node: Extension Other Design Decisions1180639
-Node: Extension Future Growth1182747
-Node: Old Extension Mechanism1183583
-Node: Notes summary1185345
-Node: Basic Concepts1186531
-Node: Basic High Level1187212
-Ref: figure-general-flow1187484
-Ref: figure-process-flow1188083
-Ref: Basic High Level-Footnote-11191312
-Node: Basic Data Typing1191497
-Node: Glossary1194825
-Node: Copying1219983
-Node: GNU Free Documentation License1257539
-Node: Index1282675
+Node: When111196
+Ref: When-Footnote-1112950
+Node: Intro Summary113015
+Node: Invoking Gawk113899
+Node: Command Line115413
+Node: Options116211
+Ref: Options-Footnote-1132006
+Ref: Options-Footnote-2132235
+Node: Other Arguments132260
+Node: Naming Standard Input135208
+Node: Environment Variables136301
+Node: AWKPATH Variable136859
+Ref: AWKPATH Variable-Footnote-1140266
+Ref: AWKPATH Variable-Footnote-2140311
+Node: AWKLIBPATH Variable140571
+Node: Other Environment Variables141827
+Node: Exit Status145345
+Node: Include Files146021
+Node: Loading Shared Libraries149610
+Node: Obsolete151037
+Node: Undocumented151729
+Node: Invoking Summary151996
+Node: Regexp153659
+Node: Regexp Usage155113
+Node: Escape Sequences157150
+Node: Regexp Operators163390
+Ref: Regexp Operators-Footnote-1170800
+Ref: Regexp Operators-Footnote-2170947
+Node: Bracket Expressions171045
+Ref: table-char-classes173060
+Node: Leftmost Longest176002
+Node: Computed Regexps177304
+Node: GNU Regexp Operators180733
+Node: Case-sensitivity184405
+Ref: Case-sensitivity-Footnote-1187290
+Ref: Case-sensitivity-Footnote-2187525
+Node: Regexp Summary187633
+Node: Reading Files189100
+Node: Records191262
+Node: awk split records191995
+Node: gawk split records196924
+Ref: gawk split records-Footnote-1201463
+Node: Fields201500
+Ref: Fields-Footnote-1204278
+Node: Nonconstant Fields204364
+Ref: Nonconstant Fields-Footnote-1206602
+Node: Changing Fields206805
+Node: Field Separators212736
+Node: Default Field Splitting215440
+Node: Regexp Field Splitting216557
+Node: Single Character Fields219907
+Node: Command Line Field Separator220966
+Node: Full Line Fields224183
+Ref: Full Line Fields-Footnote-1225704
+Ref: Full Line Fields-Footnote-2225750
+Node: Field Splitting Summary225851
+Node: Constant Size227925
+Node: Splitting By Content232508
+Ref: Splitting By Content-Footnote-1236473
+Node: Multiple Line236636
+Ref: Multiple Line-Footnote-1242517
+Node: Getline242696
+Node: Plain Getline245175
+Node: Getline/Variable247815
+Node: Getline/File248964
+Node: Getline/Variable/File250349
+Ref: Getline/Variable/File-Footnote-1251952
+Node: Getline/Pipe252039
+Node: Getline/Variable/Pipe254717
+Node: Getline/Coprocess255848
+Node: Getline/Variable/Coprocess257112
+Node: Getline Notes257851
+Node: Getline Summary260645
+Ref: table-getline-variants261057
+Node: Read Timeout261886
+Ref: Read Timeout-Footnote-1265789
+Node: Retrying Input265847
+Node: Command-line directories267042
+Node: Input Summary267949
+Node: Input Exercises271334
+Node: Printing272062
+Node: Print273839
+Node: Print Examples275296
+Node: Output Separators278075
+Node: OFMT280093
+Node: Printf281448
+Node: Basic Printf282233
+Node: Control Letters283805
+Node: Format Modifiers287790
+Node: Printf Examples293800
+Node: Redirection296286
+Node: Special FD303124
+Ref: Special FD-Footnote-1306290
+Node: Special Files306364
+Node: Other Inherited Files306981
+Node: Special Network307981
+Node: Special Caveats308843
+Node: Close Files And Pipes309792
+Ref: Close Files And Pipes-Footnote-1316983
+Ref: Close Files And Pipes-Footnote-2317131
+Node: Output Summary317281
+Node: Output Exercises318279
+Node: Expressions318959
+Node: Values320148
+Node: Constants320825
+Node: Scalar Constants321516
+Ref: Scalar Constants-Footnote-1322378
+Node: Nondecimal-numbers322628
+Node: Regexp Constants325638
+Node: Using Constant Regexps326164
+Node: Variables329327
+Node: Using Variables329984
+Node: Assignment Options331895
+Node: Conversion333770
+Node: Strings And Numbers334294
+Ref: Strings And Numbers-Footnote-1337359
+Node: Locale influences conversions337468
+Ref: table-locale-affects340214
+Node: All Operators340806
+Node: Arithmetic Ops341435
+Node: Concatenation343940
+Ref: Concatenation-Footnote-1346759
+Node: Assignment Ops346866
+Ref: table-assign-ops351845
+Node: Increment Ops353155
+Node: Truth Values and Conditions356586
+Node: Truth Values357669
+Node: Typing and Comparison358718
+Node: Variable Typing359534
+Node: Comparison Operators363201
+Ref: table-relational-ops363611
+Node: POSIX String Comparison367106
+Ref: POSIX String Comparison-Footnote-1368178
+Node: Boolean Ops368317
+Ref: Boolean Ops-Footnote-1372795
+Node: Conditional Exp372886
+Node: Function Calls374624
+Node: Precedence378504
+Node: Locales382164
+Node: Expressions Summary383796
+Node: Patterns and Actions386367
+Node: Pattern Overview387487
+Node: Regexp Patterns389166
+Node: Expression Patterns389709
+Node: Ranges393418
+Node: BEGIN/END396525
+Node: Using BEGIN/END397286
+Ref: Using BEGIN/END-Footnote-1400022
+Node: I/O And BEGIN/END400128
+Node: BEGINFILE/ENDFILE402443
+Node: Empty405340
+Node: Using Shell Variables405657
+Node: Action Overview407930
+Node: Statements410256
+Node: If Statement412104
+Node: While Statement413599
+Node: Do Statement415627
+Node: For Statement416775
+Node: Switch Statement419933
+Node: Break Statement422315
+Node: Continue Statement424356
+Node: Next Statement426183
+Node: Nextfile Statement428564
+Node: Exit Statement431192
+Node: Built-in Variables433603
+Node: User-modified434736
+Ref: User-modified-Footnote-1442439
+Node: Auto-set442501
+Ref: Auto-set-Footnote-1456734
+Ref: Auto-set-Footnote-2456939
+Node: ARGC and ARGV456995
+Node: Pattern Action Summary461213
+Node: Arrays463646
+Node: Array Basics464975
+Node: Array Intro465819
+Ref: figure-array-elements467753
+Ref: Array Intro-Footnote-1470373
+Node: Reference to Elements470501
+Node: Assigning Elements472963
+Node: Array Example473454
+Node: Scanning an Array475213
+Node: Controlling Scanning478233
+Ref: Controlling Scanning-Footnote-1483627
+Node: Numeric Array Subscripts483943
+Node: Uninitialized Subscripts486128
+Node: Delete487745
+Ref: Delete-Footnote-1490494
+Node: Multidimensional490551
+Node: Multiscanning493648
+Node: Arrays of Arrays495237
+Node: Arrays Summary499991
+Node: Functions502082
+Node: Built-in503121
+Node: Calling Built-in504199
+Node: Numeric Functions506194
+Ref: Numeric Functions-Footnote-1511012
+Ref: Numeric Functions-Footnote-2511369
+Ref: Numeric Functions-Footnote-3511417
+Node: String Functions511689
+Ref: String Functions-Footnote-1535190
+Ref: String Functions-Footnote-2535319
+Ref: String Functions-Footnote-3535567
+Node: Gory Details535654
+Ref: table-sub-escapes537435
+Ref: table-sub-proposed538950
+Ref: table-posix-sub540312
+Ref: table-gensub-escapes541849
+Ref: Gory Details-Footnote-1542682
+Node: I/O Functions542833
+Ref: I/O Functions-Footnote-1550069
+Node: Time Functions550216
+Ref: Time Functions-Footnote-1560725
+Ref: Time Functions-Footnote-2560793
+Ref: Time Functions-Footnote-3560951
+Ref: Time Functions-Footnote-4561062
+Ref: Time Functions-Footnote-5561174
+Ref: Time Functions-Footnote-6561401
+Node: Bitwise Functions561667
+Ref: table-bitwise-ops562229
+Ref: Bitwise Functions-Footnote-1566541
+Node: Type Functions566713
+Node: I18N Functions567864
+Node: User-defined569509
+Node: Definition Syntax570314
+Ref: Definition Syntax-Footnote-1575813
+Node: Function Example575884
+Ref: Function Example-Footnote-1578803
+Node: Function Caveats578825
+Node: Calling A Function579343
+Node: Variable Scope580301
+Node: Pass By Value/Reference583289
+Node: Return Statement586784
+Node: Dynamic Typing589765
+Node: Indirect Calls590694
+Ref: Indirect Calls-Footnote-1602012
+Node: Functions Summary602140
+Node: Library Functions604842
+Ref: Library Functions-Footnote-1608451
+Ref: Library Functions-Footnote-2608594
+Node: Library Names608765
+Ref: Library Names-Footnote-1612219
+Ref: Library Names-Footnote-2612442
+Node: General Functions612528
+Node: Strtonum Function613631
+Node: Assert Function616653
+Node: Round Function619977
+Node: Cliff Random Function621518
+Node: Ordinal Functions622534
+Ref: Ordinal Functions-Footnote-1625597
+Ref: Ordinal Functions-Footnote-2625849
+Node: Join Function626060
+Ref: Join Function-Footnote-1627829
+Node: Getlocaltime Function628029
+Node: Readfile Function631773
+Node: Shell Quoting633743
+Node: Data File Management635144
+Node: Filetrans Function635776
+Node: Rewind Function639832
+Node: File Checking641219
+Ref: File Checking-Footnote-1642551
+Node: Empty Files642752
+Node: Ignoring Assigns644731
+Node: Getopt Function646282
+Ref: Getopt Function-Footnote-1657744
+Node: Passwd Functions657944
+Ref: Passwd Functions-Footnote-1666781
+Node: Group Functions666869
+Ref: Group Functions-Footnote-1674763
+Node: Walking Arrays674976
+Node: Library Functions Summary676579
+Node: Library Exercises677980
+Node: Sample Programs679260
+Node: Running Examples680030
+Node: Clones680758
+Node: Cut Program681982
+Node: Egrep Program691701
+Ref: Egrep Program-Footnote-1699199
+Node: Id Program699309
+Node: Split Program702954
+Ref: Split Program-Footnote-1706402
+Node: Tee Program706530
+Node: Uniq Program709319
+Node: Wc Program716738
+Ref: Wc Program-Footnote-1720988
+Node: Miscellaneous Programs721082
+Node: Dupword Program722295
+Node: Alarm Program724326
+Node: Translate Program729130
+Ref: Translate Program-Footnote-1733695
+Node: Labels Program733965
+Ref: Labels Program-Footnote-1737316
+Node: Word Sorting737400
+Node: History Sorting741471
+Node: Extract Program743307
+Node: Simple Sed750832
+Node: Igawk Program753900
+Ref: Igawk Program-Footnote-1768224
+Ref: Igawk Program-Footnote-2768425
+Ref: Igawk Program-Footnote-3768547
+Node: Anagram Program768662
+Node: Signature Program771719
+Node: Programs Summary772966
+Node: Programs Exercises774159
+Ref: Programs Exercises-Footnote-1778290
+Node: Advanced Features778381
+Node: Nondecimal Data780329
+Node: Array Sorting781919
+Node: Controlling Array Traversal782616
+Ref: Controlling Array Traversal-Footnote-1790949
+Node: Array Sorting Functions791067
+Ref: Array Sorting Functions-Footnote-1794956
+Node: Two-way I/O795152
+Ref: Two-way I/O-Footnote-1800097
+Ref: Two-way I/O-Footnote-2800283
+Node: TCP/IP Networking800365
+Node: Profiling803238
+Node: Advanced Features Summary811515
+Node: Internationalization813448
+Node: I18N and L10N814928
+Node: Explaining gettext815614
+Ref: Explaining gettext-Footnote-1820639
+Ref: Explaining gettext-Footnote-2820823
+Node: Programmer i18n820988
+Ref: Programmer i18n-Footnote-1825854
+Node: Translator i18n825903
+Node: String Extraction826697
+Ref: String Extraction-Footnote-1827828
+Node: Printf Ordering827914
+Ref: Printf Ordering-Footnote-1830700
+Node: I18N Portability830764
+Ref: I18N Portability-Footnote-1833219
+Node: I18N Example833282
+Ref: I18N Example-Footnote-1836085
+Node: Gawk I18N836157
+Node: I18N Summary836795
+Node: Debugger838134
+Node: Debugging839156
+Node: Debugging Concepts839597
+Node: Debugging Terms841450
+Node: Awk Debugging844022
+Node: Sample Debugging Session844916
+Node: Debugger Invocation845436
+Node: Finding The Bug846820
+Node: List of Debugger Commands853295
+Node: Breakpoint Control854628
+Node: Debugger Execution Control858324
+Node: Viewing And Changing Data861688
+Node: Execution Stack865066
+Node: Debugger Info866703
+Node: Miscellaneous Debugger Commands870720
+Node: Readline Support875749
+Node: Limitations876641
+Node: Debugging Summary878755
+Node: Arbitrary Precision Arithmetic879923
+Node: Computer Arithmetic881339
+Ref: table-numeric-ranges884937
+Ref: Computer Arithmetic-Footnote-1885796
+Node: Math Definitions885853
+Ref: table-ieee-formats889141
+Ref: Math Definitions-Footnote-1889745
+Node: MPFR features889850
+Node: FP Math Caution891521
+Ref: FP Math Caution-Footnote-1892571
+Node: Inexactness of computations892940
+Node: Inexact representation893899
+Node: Comparing FP Values895256
+Node: Errors accumulate896338
+Node: Getting Accuracy897771
+Node: Try To Round900433
+Node: Setting precision901332
+Ref: table-predefined-precision-strings902016
+Node: Setting the rounding mode903805
+Ref: table-gawk-rounding-modes904169
+Ref: Setting the rounding mode-Footnote-1907624
+Node: Arbitrary Precision Integers907803
+Ref: Arbitrary Precision Integers-Footnote-1912703
+Node: POSIX Floating Point Problems912852
+Ref: POSIX Floating Point Problems-Footnote-1916725
+Node: Floating point summary916763
+Node: Dynamic Extensions918957
+Node: Extension Intro920509
+Node: Plugin License921775
+Node: Extension Mechanism Outline922572
+Ref: figure-load-extension923000
+Ref: figure-register-new-function924480
+Ref: figure-call-new-function925484
+Node: Extension API Description927470
+Node: Extension API Functions Introduction929004
+Node: General Data Types933876
+Ref: General Data Types-Footnote-1939615
+Node: Memory Allocation Functions939914
+Ref: Memory Allocation Functions-Footnote-1942753
+Node: Constructor Functions942849
+Node: Registration Functions944583
+Node: Extension Functions945268
+Node: Exit Callback Functions947565
+Node: Extension Version String948813
+Node: Input Parsers949478
+Node: Output Wrappers959357
+Node: Two-way processors963872
+Node: Printing Messages966076
+Ref: Printing Messages-Footnote-1967152
+Node: Updating `ERRNO'967304
+Node: Requesting Values968044
+Ref: table-value-types-returned968772
+Node: Accessing Parameters969729
+Node: Symbol Table Access970960
+Node: Symbol table by name971474
+Node: Symbol table by cookie973455
+Ref: Symbol table by cookie-Footnote-1977599
+Node: Cached values977662
+Ref: Cached values-Footnote-1981161
+Node: Array Manipulation981252
+Ref: Array Manipulation-Footnote-1982342
+Node: Array Data Types982379
+Ref: Array Data Types-Footnote-1985034
+Node: Array Functions985126
+Node: Flattening Arrays988980
+Node: Creating Arrays995872
+Node: Redirection API1000643
+Node: Extension API Variables1003414
+Node: Extension Versioning1004047
+Node: Extension API Informational Variables1005948
+Node: Extension API Boilerplate1007013
+Node: Finding Extensions1010822
+Node: Extension Example1011382
+Node: Internal File Description1012154
+Node: Internal File Ops1016221
+Ref: Internal File Ops-Footnote-11027891
+Node: Using Internal File Ops1028031
+Ref: Using Internal File Ops-Footnote-11030414
+Node: Extension Samples1030687
+Node: Extension Sample File Functions1032213
+Node: Extension Sample Fnmatch1039851
+Node: Extension Sample Fork1041342
+Node: Extension Sample Inplace1042557
+Node: Extension Sample Ord1044232
+Node: Extension Sample Readdir1045068
+Ref: table-readdir-file-types1045944
+Node: Extension Sample Revout1046755
+Node: Extension Sample Rev2way1047345
+Node: Extension Sample Read write array1048085
+Node: Extension Sample Readfile1050025
+Node: Extension Sample Time1051120
+Node: Extension Sample API Tests1052469
+Node: gawkextlib1052960
+Node: Extension summary1055618
+Node: Extension Exercises1059307
+Node: Language History1060029
+Node: V7/SVR3.11061685
+Node: SVR41063866
+Node: POSIX1065311
+Node: BTL1066700
+Node: POSIX/GNU1067434
+Node: Feature History1073058
+Node: Common Extensions1086156
+Node: Ranges and Locales1087480
+Ref: Ranges and Locales-Footnote-11092098
+Ref: Ranges and Locales-Footnote-21092125
+Ref: Ranges and Locales-Footnote-31092359
+Node: Contributors1092580
+Node: History summary1098121
+Node: Installation1099491
+Node: Gawk Distribution1100437
+Node: Getting1100921
+Node: Extracting1101744
+Node: Distribution contents1103379
+Node: Unix Installation1109444
+Node: Quick Installation1110127
+Node: Shell Startup Files1112538
+Node: Additional Configuration Options1113617
+Node: Configuration Philosophy1115356
+Node: Non-Unix Installation1117725
+Node: PC Installation1118183
+Node: PC Binary Installation1119502
+Node: PC Compiling1121350
+Ref: PC Compiling-Footnote-11124371
+Node: PC Testing1124480
+Node: PC Using1125656
+Node: Cygwin1129771
+Node: MSYS1130594
+Node: VMS Installation1131094
+Node: VMS Compilation1131886
+Ref: VMS Compilation-Footnote-11133108
+Node: VMS Dynamic Extensions1133166
+Node: VMS Installation Details1134850
+Node: VMS Running1137102
+Node: VMS GNV1139938
+Node: VMS Old Gawk1140672
+Node: Bugs1141142
+Node: Other Versions1145025
+Node: Installation summary1151449
+Node: Notes1152505
+Node: Compatibility Mode1153370
+Node: Additions1154152
+Node: Accessing The Source1155077
+Node: Adding Code1156512
+Node: New Ports1162669
+Node: Derived Files1167151
+Ref: Derived Files-Footnote-11172626
+Ref: Derived Files-Footnote-21172660
+Ref: Derived Files-Footnote-31173256
+Node: Future Extensions1173370
+Node: Implementation Limitations1173976
+Node: Extension Design1175224
+Node: Old Extension Problems1176378
+Ref: Old Extension Problems-Footnote-11177895
+Node: Extension New Mechanism Goals1177952
+Ref: Extension New Mechanism Goals-Footnote-11181312
+Node: Extension Other Design Decisions1181501
+Node: Extension Future Growth1183609
+Node: Old Extension Mechanism1184445
+Node: Notes summary1186207
+Node: Basic Concepts1187393
+Node: Basic High Level1188074
+Ref: figure-general-flow1188346
+Ref: figure-process-flow1188945
+Ref: Basic High Level-Footnote-11192174
+Node: Basic Data Typing1192359
+Node: Glossary1195687
+Node: Copying1227616
+Node: GNU Free Documentation License1265172
+Node: Index1290308

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 6f5aacea..9ad9e3d4 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -472,7 +472,7 @@ particular records in a file and perform operations upon them.
@command{gawk}.
* Internationalization:: Getting @command{gawk} to speak your
language.
-* Debugger:: The @code{gawk} debugger.
+* Debugger:: The @command{gawk} debugger.
* Arbitrary Precision Arithmetic:: Arbitrary precision arithmetic with
@command{gawk}.
* Dynamic Extensions:: Adding new built-in functions to
@@ -957,7 +957,7 @@ particular records in a file and perform operations upon them.
* Internal File Ops:: The code for internal file operations.
* Using Internal File Ops:: How to use an external extension.
* Extension Samples:: The sample extensions that ship with
- @code{gawk}.
+ @command{gawk}.
* Extension Sample File Functions:: The file functions sample.
* Extension Sample Fnmatch:: An interface to @code{fnmatch()}.
* Extension Sample Fork:: An interface to @code{fork()} and
@@ -2599,9 +2599,7 @@ for programs that are provided on the @command{awk} command line.
(Also, placing the program in a file allows us to use a literal single quote in the program
text, instead of the magic @samp{\47}.)
-@c STARTOFRANGE sq1x
@cindex single quote (@code{'}) in @command{gawk} command lines
-@c STARTOFRANGE qs2x
@cindex @code{'} (single quote) in @command{gawk} command lines
If you want to clearly identify an @command{awk} program file as such,
you can add the extension @file{.awk} to the @value{FN}. This doesn't
@@ -2975,8 +2973,6 @@ $ @kbd{awk "BEGIN @{ print \"Here is a single quote <'>\" @}"}
@end example
@noindent
-@c ENDOFRANGE sq1x
-@c ENDOFRANGE qs2x
This option is also painful, because double quotes, backslashes, and dollar signs
are very common in more advanced @command{awk} programs.
@@ -3312,8 +3308,13 @@ no actions run.
After processing all the rules that match the line (and perhaps there are none),
@command{awk} reads the next line. (However,
-@pxref{Next Statement},
+@DBPXREF{Next Statement}
+@ifdocbook
+and @DBREF{Nextfile Statement}.)
+@end ifdocbook
+@ifnotdocbook
and also @pxref{Nextfile Statement}.)
+@end ifnotdocbook
This continues until the program reaches the end of the file.
For example, the following @command{awk} program contains two rules:
@@ -3578,7 +3579,7 @@ performing bit manipulation, for runtime string translation (internationalizatio
determining the type of a variable,
and array sorting.
-As we develop our presentation of the @command{awk} language, we introduce
+As we develop our presentation of the @command{awk} language, we will introduce
most of the variables and many of the functions. They are described
systematically in @DBREF{Built-in Variables} and in
@ref{Built-in}.
@@ -3632,7 +3633,7 @@ and Perl.}
@c FIXME: Review this chapter for summary of builtin functions called.
@itemize @value{BULLET}
@item
-Programs in @command{awk} consist of @var{pattern}-@var{action} pairs.
+Programs in @command{awk} consist of @var{pattern}--@var{action} pairs.
@item
An @var{action} without a @var{pattern} always runs. The default
@@ -3661,7 +3662,7 @@ part of a larger shell script (or MS-Windows batch file).
You may use backslash continuation to continue a source line.
Lines are automatically continued after
a comma, open brace, question mark, colon,
-@samp{||}, @samp{&&}, @code{do} and @code{else}.
+@samp{||}, @samp{&&}, @code{do}, and @code{else}.
@end itemize
@node Invoking Gawk
@@ -3736,20 +3737,16 @@ warning that the program is empty.
@node Options
@section Command-Line Options
-@c STARTOFRANGE ocl
@cindex options, command-line
-@c STARTOFRANGE clo
@cindex command line, options
-@c STARTOFRANGE gnulo
@cindex GNU long options
-@c STARTOFRANGE longo
@cindex options, long
Options begin with a dash and consist of a single character.
GNU-style long options consist of two dashes and a keyword.
The keyword can be abbreviated, as long as the abbreviation allows the option
-to be uniquely identified. If the option takes an argument, then the
-keyword is either immediately followed by an equals sign (@samp{=}) and the
+to be uniquely identified. If the option takes an argument, either the
+keyword is immediately followed by an equals sign (@samp{=}) and the
argument's value, or the keyword and the argument's value are separated
by whitespace.
If a particular option with a value is given more than once, it is the
@@ -3776,7 +3773,7 @@ Set the @code{FS} variable to @var{fs}
@cindex @option{-f} option
@cindex @option{--file} option
@cindex @command{awk} programs, location of
-Read @command{awk} program source from @var{source-file}
+Read the @command{awk} program source from @var{source-file}
instead of in the first nonoption argument.
This option may be given multiple times; the @command{awk}
program consists of the concatenation of the contents of
@@ -3831,8 +3828,6 @@ by the user that could start with @samp{-}.
It is also useful for passing options on to the @command{awk}
program; see @ref{Getopt Function}.
@end table
-@c ENDOFRANGE gnulo
-@c ENDOFRANGE longo
The following list describes @command{gawk}-specific options:
@@ -3844,14 +3839,14 @@ The following list describes @command{gawk}-specific options:
@cindex @option{--characters-as-bytes} option
Cause @command{gawk} to treat all input data as single-byte characters.
In addition, all output written with @code{print} or @code{printf}
-are treated as single-byte characters.
+is treated as single-byte characters.
Normally, @command{gawk} follows the POSIX standard and attempts to process
its input data according to the current locale (@pxref{Locales}). This can often involve
converting multibyte characters into wide characters (internally), and
can lead to problems or confusion if the input data does not contain valid
-multibyte characters. This option is an easy way to tell @command{gawk}:
-``hands off my data!''.
+multibyte characters. This option is an easy way to tell @command{gawk},
+``Hands off my data!''
@item @option{-c}
@itemx @option{--traditional}
@@ -3908,7 +3903,7 @@ Enable debugging of @command{awk} programs
By default, the debugger reads commands interactively from the keyboard
(standard input).
The optional @var{file} argument allows you to specify a file with a list
-of commands for the debugger to execute non-interactively.
+of commands for the debugger to execute noninteractively.
No space is allowed between the @option{-D} and @var{file}, if
@var{file} is supplied.
@@ -3968,7 +3963,7 @@ with @samp{#!} scripts (@pxref{Executable Scripts}), like so:
@cindex portable object files, generating
@cindex files, portable object, generating
Analyze the source program and
-generate a GNU @command{gettext} Portable Object Template file on standard
+generate a GNU @command{gettext} portable object template file on standard
output for all string constants that have been marked for translation.
@xref{Internationalization},
for information about this option.
@@ -3980,7 +3975,7 @@ for information about this option.
@cindex GNU long options, printing list of
@cindex options, printing list of
@cindex printing, list of options
-Print a ``usage'' message summarizing the short and long style options
+Print a ``usage'' message summarizing the short- and long-style options
that @command{gawk} accepts and then exit.
@item @option{-i} @var{source-file}
@@ -3990,7 +3985,7 @@ that @command{gawk} accepts and then exit.
@cindex @command{awk} programs, location of
Read an @command{awk} source library from @var{source-file}. This option
is completely equivalent to using the @code{@@include} directive inside
-your program. This option is very similar to the @option{-f} option,
+your program. It is very similar to the @option{-f} option,
but there are two important differences. First, when @option{-i} is
used, the program source is not loaded if it has been previously
loaded, whereas with @option{-f}, @command{gawk} always loads the file.
@@ -4075,7 +4070,7 @@ when parsing numeric input data (@pxref{Locales}).
@cindex @option{-o} option
@cindex @option{--pretty-print} option
Enable pretty-printing of @command{awk} programs.
-By default, output program is created in a file named @file{awkprof.out}
+By default, the output program is created in a file named @file{awkprof.out}
(@pxref{Profiling}).
The optional @var{file} argument allows you to specify a different
@value{FN} for the output.
@@ -4119,7 +4114,7 @@ in the left margin, and function call counts for each function.
Operate in strict POSIX mode. This disables all @command{gawk}
extensions (just like @option{--traditional}) and
disables all extensions not allowed by POSIX.
-@xref{Common Extensions}, for a summary of the extensions
+@DBXREF{Common Extensions} for a summary of the extensions
in @command{gawk} that are disabled by this option.
Also,
the following additional
@@ -4240,7 +4235,7 @@ source of data.)
Because it is clumsy using the standard @command{awk} mechanisms to mix
source file and command-line @command{awk} programs, @command{gawk}
provides the @option{-e} option. This does not require you to
-pre-empt the standard input for your source code; it allows you to easily
+preempt the standard input for your source code; it allows you to easily
mix command-line and library source code (@pxref{AWKPATH Variable}).
As with @option{-f}, the @option{-e} and @option{-i}
options may also be used multiple times on the command line.
@@ -4286,8 +4281,6 @@ setenv POSIXLY_CORRECT true
Having @env{POSIXLY_CORRECT} set is not recommended for daily use,
but it is good for testing the portability of your programs to other
environments.
-@c ENDOFRANGE ocl
-@c ENDOFRANGE clo
@node Other Arguments
@section Other Command-Line Arguments
@@ -4430,7 +4423,7 @@ file, unless the file is in the current directory.
But with @command{gawk}, if the @value{FN} supplied to the @option{-f}
or @option{-i} options
does not contain a directory separator @samp{/}, then @command{gawk} searches a list of
-directories (called the @dfn{search path}), one by one, looking for a
+directories (called the @dfn{search path}) one by one, looking for a
file with the specified name.
The search path is a string consisting of directory names
@@ -4471,9 +4464,9 @@ as an entry in the path or write a null entry in the path.
Different past versions of @command{gawk} would also look explicitly in
the current directory, either before or after the path search. As of
-@value{PVERSION} 4.1.2, this no longer happens, and if you wish to look
+@value{PVERSION} 4.1.2, this no longer happens; if you wish to look
in the current directory, you must include @file{.} either as a separate
-entry, or as a null entry in the search path.
+entry or as a null entry in the search path.
@end quotation
The default value for @env{AWKPATH} is
@@ -4589,7 +4582,7 @@ If this variable exists, @command{gawk} includes the @value{FN}
and line number within the @command{gawk} source code
from which warning and/or fatal messages
are generated. Its purpose is to help isolate the source of a
-message, as there are multiple places which produce the
+message, as there are multiple places that produce the
same warning or error message.
@item GAWK_NO_DFA
@@ -4605,16 +4598,16 @@ This specifies the amount by which @command{gawk} should grow its
internal evaluation stack, when needed.
@item INT_CHAIN_MAX
-The intended maximum number of items @command{gawk} will maintain on a
+This specifies intended maximum number of items @command{gawk} will maintain on a
hash chain for managing arrays indexed by integers.
@item STR_CHAIN_MAX
-The intended maximum number of items @command{gawk} will maintain on a
+This specifies intended maximum number of items @command{gawk} will maintain on a
hash chain for managing arrays indexed by strings.
@item TIDYMEM
If this variable exists, @command{gawk} uses the @code{mtrace()} library
-calls from GNU LIBC to help track down possible memory leaks.
+calls from the GNU C library to help track down possible memory leaks.
@end table
@node Exit Status
@@ -4651,7 +4644,7 @@ The @code{@@include} keyword can be used to read external @command{awk} source
files. This gives you the ability to split large @command{awk} source files
into smaller, more manageable pieces, and also lets you reuse common @command{awk}
code from various @command{awk} scripts. In other words, you can group
-together @command{awk} functions, used to carry out specific tasks,
+together @command{awk} functions used to carry out specific tasks
into external files. These files can be used just like function libraries,
using the @code{@@include} keyword in conjunction with the @env{AWKPATH}
environment variable. Note that source files may also be included
@@ -4686,7 +4679,7 @@ $ @kbd{gawk -f test2}
@print{} This is script test2.
@end example
-@code{gawk} runs the @file{test2} script, which includes @file{test1}
+@command{gawk} runs the @file{test2} script, which includes @file{test1}
using the @code{@@include}
keyword. So, to include external @command{awk} source files, you just
use @code{@@include} followed by the name of the file to be included,
@@ -4741,11 +4734,12 @@ of the @env{AWKPATH} variable in command-line file searches
This is very helpful in constructing @command{gawk} function libraries.
If you have a large script with useful, general-purpose @command{awk}
functions, you can break it down into library files and put those files
-in a special directory. You can then include those ``libraries,'' using
-either the full pathnames of the files, or by setting the @env{AWKPATH}
+in a special directory. You can then include those ``libraries,''
+either by using the full pathnames of the files, or by setting the @env{AWKPATH}
environment variable accordingly and then using @code{@@include} with
-just the file part of the full pathname. Of course, you can have more
-than one directory to keep library files; the more complex the working
+just the file part of the full pathname. Of course,
+you can keep library files in more than one directory;
+the more complex the working
environment is, the more directories you may need to organize the files
to be included.
@@ -4758,8 +4752,8 @@ In particular, @code{@@include} is very useful for writing CGI scripts
to be run from web pages.
As mentioned in @ref{AWKPATH Variable}, the current directory is always
-searched first for source files, before searching in @env{AWKPATH},
-and this also applies to files named with @code{@@include}.
+searched first for source files, before searching in @env{AWKPATH};
+this also applies to files named with @code{@@include}.
@node Loading Shared Libraries
@section Loading Dynamic Extensions into Your Program
@@ -4813,8 +4807,8 @@ It also describes the @code{ordchr} extension.
@cindex features, deprecated
@cindex obsolete features
This @value{SECTION} describes features and/or command-line options from
-previous releases of @command{gawk} that are either not available in the
-current version or that are still supported but deprecated (meaning that
+previous releases of @command{gawk} that either are not available in the
+current version or are still supported but deprecated (meaning that
they will @emph{not} be in the next release).
The process-related special files @file{/dev/pid}, @file{/dev/ppid},
@@ -4894,7 +4888,7 @@ This seems to have been a long-undocumented feature in Unix @command{awk}.
Similarly, you may use @code{print} or @code{printf} statements in the
@var{init} and @var{increment} parts of a @code{for} loop. This is another
-long-undocumented ``feature'' of Unix @code{awk}.
+long-undocumented ``feature'' of Unix @command{awk}.
@end ignore
@@ -4911,7 +4905,7 @@ to run @command{awk}.
@item
The three standard options for all versions of @command{awk} are
-@option{-f}, @option{-F} and @option{-v}. @command{gawk} supplies these
+@option{-f}, @option{-F}, and @option{-v}. @command{gawk} supplies these
and many others, as well as corresponding GNU-style long options.
@item
@@ -4948,13 +4942,12 @@ and @option{-f} command-line options.
@item
@command{gawk} allows you to load additional functions written in C
or C++ using the @code{@@load} statement and/or the @option{-l} option.
-(This advanced feature is described later on in @ref{Dynamic Extensions}.)
+(This advanced feature is described later, in @ref{Dynamic Extensions}.)
@end itemize
@node Regexp
@chapter Regular Expressions
@cindex regexp
-@c STARTOFRANGE regexp
@cindex regular expressions
A @dfn{regular expression}, or @dfn{regexp}, is a way of describing a
@@ -5161,7 +5154,7 @@ Horizontal TAB, @kbd{Ctrl-i}, ASCII code 9 (HT).
@cindex @code{\} (backslash), @code{\v} escape sequence
@cindex backslash (@code{\}), @code{\v} escape sequence
@item \v
-Vertical tab, @kbd{Ctrl-k}, ASCII code 11 (VT).
+Vertical TAB, @kbd{Ctrl-k}, ASCII code 11 (VT).
@cindex @code{\} (backslash), @code{\}@var{nnn} escape sequence
@cindex backslash (@code{\}), @code{\}@var{nnn} escape sequence
@@ -5236,7 +5229,7 @@ characters @samp{a+b}.
@cindex @code{\} (backslash), in escape sequences
@cindex portability
For complete portability, do not use a backslash before any character not
-shown in the previous list and that is not an operator.
+shown in the previous list or that is not an operator.
@c 11/2014: Moved so as to not stack sidebars
@cindex sidebar, Backslash Before Regular Characters
@@ -5398,7 +5391,6 @@ escape sequences literally when used in regexp constants. Thus,
@node Regexp Operators
@section Regular Expression Operators
-@c STARTOFRANGE regexpo
@cindex regular expressions, operators
@cindex metacharacters in regular expressions
@@ -5416,7 +5408,7 @@ are recognized and converted into corresponding real characters as
the very first step in processing regexps.
Here is a list of metacharacters. All characters that are not escape
-sequences and that are not listed in the following stand for themselves:
+sequences and that are not listed here stand for themselves:
@c Use @asis so the docbook comes out ok. Sigh.
@table @asis
@@ -5539,7 +5531,7 @@ just @samp{p} if no @samp{h}s are present.
There are two subtle points to understand about how @samp{*} works.
First, the @samp{*} applies only to the single preceding regular expression
component (e.g., in @samp{ph*}, it applies just to the @samp{h}).
-To cause @samp{*} to apply to a larger sub-expression, use parentheses:
+To cause @samp{*} to apply to a larger subexpression, use parentheses:
@samp{(ph)*} matches @samp{ph}, @samp{phph}, @samp{phphph}, and so on.
Second, @samp{*} finds as many repetitions as possible. If the text
@@ -5578,10 +5570,10 @@ is repeated at least @var{n} times:
Matches @samp{whhhy}, but not @samp{why} or @samp{whhhhy}.
@item wh@{3,5@}y
-Matches @samp{whhhy}, @samp{whhhhy}, or @samp{whhhhhy}, only.
+Matches @samp{whhhy}, @samp{whhhhy}, or @samp{whhhhhy} only.
@item wh@{2,@}y
-Matches @samp{whhy} or @samp{whhhy}, and so on.
+Matches @samp{whhy}, @samp{whhhy}, and so on.
@end table
@cindex POSIX @command{awk}, interval expressions in
@@ -5630,11 +5622,9 @@ usage as a syntax error.
If @command{gawk} is in compatibility mode (@pxref{Options}), interval
expressions are not available in regular expressions.
-@c ENDOFRANGE regexpo
@node Bracket Expressions
@section Using Bracket Expressions
-@c STARTOFRANGE charlist
@cindex bracket expressions
@cindex bracket expressions, range expressions
@cindex range expressions (regexps)
@@ -5710,7 +5700,7 @@ POSIX standard.
(a space is printable but not visible, whereas an @samp{a} is both)
@item @code{[:lower:]} @tab Lowercase alphabetic characters
@item @code{[:print:]} @tab Printable characters (characters that are not control characters)
-@item @code{[:punct:]} @tab Punctuation characters (characters that are not letters, digits
+@item @code{[:punct:]} @tab Punctuation characters (characters that are not letters, digits,
control characters, or space characters)
@item @code{[:space:]} @tab Space characters (such as space, TAB, and formfeed, to name a few)
@item @code{[:upper:]} @tab Uppercase alphabetic characters
@@ -5730,11 +5720,11 @@ and numeric characters in your character set.
@c Date: Tue, 01 Jul 2014 07:39:51 +0200
@c From: Hermann Peifer <peifer@gmx.eu>
Some utilities that match regular expressions provide a nonstandard
-@code{[:ascii:]} character class; @command{awk} does not. However, you
-can simulate such a construct using @code{[\x00-\x7F]}. This matches
+@samp{[:ascii:]} character class; @command{awk} does not. However, you
+can simulate such a construct using @samp{[\x00-\x7F]}. This matches
all values numerically between zero and 127, which is the defined
range of the ASCII character set. Use a complemented character list
-(@code{[^\x00-\x7F]}) to match any single-byte characters that are not
+(@samp{[^\x00-\x7F]}) to match any single-byte characters that are not
in the ASCII range.
@cindex bracket expressions, collating elements
@@ -5763,8 +5753,8 @@ Locale-specific names for a list of
characters that are equal. The name is enclosed between
@samp{[=} and @samp{=]}.
For example, the name @samp{e} might be used to represent all of
-``e,'' ``@`e,'' and ``@'e.'' In this case, @samp{[[=e=]]} is a regexp
-that matches any of @samp{e}, @samp{@'e}, or @samp{@`e}.
+``e,'' ``@^e,'' ``@`e,'' and ``@'e.'' In this case, @samp{[[=e=]]} is a regexp
+that matches any of @samp{e}, @samp{@^e}, @samp{@'e}, or @samp{@`e}.
@end table
These features are very valuable in non-English-speaking locales.
@@ -5778,7 +5768,6 @@ expression matching currently recognize only POSIX character classes;
they do not recognize collating symbols or equivalence classes.
@end quotation
@c maybe one day ...
-@c ENDOFRANGE charlist
@node Leftmost Longest
@section How Much Text Matches?
@@ -5794,7 +5783,7 @@ echo aaaabcd | awk '@{ sub(/a+/, "<A>"); print @}'
This example uses the @code{sub()} function to make a change to the input
record. (@code{sub()} replaces the first instance of any text matched
by the first argument with the string provided as the second argument;
-@pxref{String Functions}). Here, the regexp @code{/a+/} indicates ``one
+@pxref{String Functions}.) Here, the regexp @code{/a+/} indicates ``one
or more @samp{a} characters,'' and the replacement text is @samp{<A>}.
The input contains four @samp{a} characters.
@@ -5822,9 +5811,7 @@ and also @pxref{Field Separators}).
@node Computed Regexps
@section Using Dynamic Regexps
-@c STARTOFRANGE dregexp
@cindex regular expressions, computed
-@c STARTOFRANGE regexpd
@cindex regular expressions, dynamic
@cindex @code{~} (tilde), @code{~} operator
@cindex tilde (@code{~}), @code{~} operator
@@ -5850,14 +5837,14 @@ and tests whether the input record matches this regexp.
@quotation NOTE
When using the @samp{~} and @samp{!~}
-operators, there is a difference between a regexp constant
+operators, be aware that there is a difference between a regexp constant
enclosed in slashes and a string constant enclosed in double quotes.
If you are going to use a string constant, you have to understand that
the string is, in essence, scanned @emph{twice}: the first time when
@command{awk} reads your program, and the second time when it goes to
match the string on the lefthand side of the operator with the pattern
on the right. This is true of any string-valued expression (such as
-@code{digits_regexp}, shown previously), not just string constants.
+@code{digits_regexp}, shown in the previous example), not just string constants.
@end quotation
@cindex regexp constants, slashes vs.@: quotes
@@ -5975,17 +5962,13 @@ $ @kbd{awk '$0 ~ /[ \t\n]/'}
occur often in practice, but it's worth noting for future reference.
@end cartouche
@end ifnotdocbook
-@c ENDOFRANGE dregexp
-@c ENDOFRANGE regexpd
@node GNU Regexp Operators
@section @command{gawk}-Specific Regexp Operators
@c This section adapted (long ago) from the regex-0.12 manual
-@c STARTOFRANGE regexpg
@cindex regular expressions, operators, @command{gawk}
-@c STARTOFRANGE gregexp
@cindex @command{gawk}, regular expressions, operators
@cindex operators, GNU-specific
@cindex regular expressions, operators, for words
@@ -6061,7 +6044,7 @@ matches either @samp{ball} or @samp{balls}, as a separate word.
@item \B
Matches the empty string that occurs between two
word-constituent characters. For example,
-@code{/\Brat\B/} matches @samp{crate} but it does not match @samp{dirty rat}.
+@code{/\Brat\B/} matches @samp{crate}, but it does not match @samp{dirty rat}.
@samp{\B} is essentially the opposite of @samp{\y}.
@end table
@@ -6080,14 +6063,14 @@ The operators are:
@cindex backslash (@code{\}), @code{\`} operator (@command{gawk})
@cindex @code{\} (backslash), @code{\`} operator (@command{gawk})
Matches the empty string at the
-beginning of a buffer (string).
+beginning of a buffer (string)
@c @cindex operators, @code{\'} (@command{gawk})
@cindex backslash (@code{\}), @code{\'} operator (@command{gawk})
@cindex @code{\} (backslash), @code{\'} operator (@command{gawk})
@item \'
Matches the empty string at the
-end of a buffer (string).
+end of a buffer (string)
@end table
@cindex @code{^} (caret), regexp operator
@@ -6150,15 +6133,11 @@ Allow interval expressions in regexps, if @option{--traditional}
has been provided.
Otherwise, interval expressions are available by default.
@end table
-@c ENDOFRANGE gregexp
-@c ENDOFRANGE regexpg
@node Case-sensitivity
@section Case Sensitivity in Matching
-@c STARTOFRANGE regexpcs
@cindex regular expressions, case sensitivity
-@c STARTOFRANGE csregexp
@cindex case sensitivity, regexps and
Case is normally significant in regular expressions, both when matching
ordinary characters (i.e., not metacharacters) and inside bracket
@@ -6250,8 +6229,6 @@ the right thing.}
The value of @code{IGNORECASE} has no effect if @command{gawk} is in
compatibility mode (@pxref{Options}).
Case is always significant in compatibility mode.
-@c ENDOFRANGE csregexp
-@c ENDOFRANGE regexpcs
@node Regexp Summary
@section Summary
@@ -6298,12 +6275,10 @@ versions, use @code{tolower()} or @code{toupper()}.
@end itemize
-@c ENDOFRANGE regexp
@node Reading Files
@chapter Reading Input Files
-@c STARTOFRANGE infir
@cindex reading input files
@cindex input files, reading
@cindex input files
@@ -6328,7 +6303,7 @@ This makes it more convenient for programs to work on the parts of a record.
@cindex @code{getline} command
On rare occasions, you may need to use the @code{getline} command.
-The @code{getline} command is valuable, both because it
+The @code{getline} command is valuable both because it
can do explicit input from any number of files, and because the files
used with it do not have to be named on the @command{awk} command line
(@pxref{Getline}).
@@ -6355,9 +6330,7 @@ used with it do not have to be named on the @command{awk} command line
@node Records
@section How Input Is Split into Records
-@c STARTOFRANGE inspl
@cindex input, splitting into records
-@c STARTOFRANGE recspl
@cindex records, splitting input into
@cindex @code{NR} variable
@cindex @code{FNR} variable
@@ -6382,8 +6355,8 @@ never automatically reset to zero.
Records are separated by a character called the @dfn{record separator}.
By default, the record separator is the newline character.
This is why records are, by default, single lines.
-A different character can be used for the record separator by
-assigning the character to the predefined variable @code{RS}.
+To use a different character for the record separator,
+simply assign that character to the predefined variable @code{RS}.
@cindex newlines, as record separators
@cindex @code{RS} variable
@@ -6406,8 +6379,8 @@ awk 'BEGIN @{ RS = "u" @}
@noindent
changes the value of @code{RS} to @samp{u}, before reading any input.
-This is a string whose first character is the letter ``u''; as a result, records
-are separated by the letter ``u.'' Then the input file is read, and the second
+The new value is a string whose first character is the letter ``u''; as a result, records
+are separated by the letter ``u''. Then the input file is read, and the second
rule in the @command{awk} program (the action with no pattern) prints each
record. Because each @code{print} statement adds a newline at the end of
its output, this @command{awk} program copies the input
@@ -6468,8 +6441,8 @@ Bill 555-1675 bill.drowning@@hotmail.com A
@end example
@noindent
-It contains no @samp{u} so there is no reason to split the record,
-unlike the others which have one or more occurrences of the @samp{u}.
+It contains no @samp{u}, so there is no reason to split the record,
+unlike the others, which each have one or more occurrences of the @samp{u}.
In fact, this record is treated as part of the previous record;
the newline separating them in the output
is the original newline in the @value{DF}, not the one added by
@@ -6564,7 +6537,7 @@ contains the same single character. However, when @code{RS} is a
regular expression, @code{RT} contains
the actual input text that matched the regular expression.
-If the input file ended without any text that matches @code{RS},
+If the input file ends without any text matching @code{RS},
@command{gawk} sets @code{RT} to the null string.
The following example illustrates both of these features.
@@ -6714,8 +6687,6 @@ whole files. If you are using @command{gawk}, see @DBREF{Extension Sample
Readfile} for another option.
@end cartouche
@end ifnotdocbook
-@c ENDOFRANGE inspl
-@c ENDOFRANGE recspl
@node Fields
@section Examining Fields
@@ -6723,7 +6694,6 @@ Readfile} for another option.
@cindex examining fields
@cindex fields
@cindex accessing fields
-@c STARTOFRANGE fiex
@cindex fields, examining
@cindex POSIX @command{awk}, field separators and
@cindex field separators, POSIX and
@@ -6748,11 +6718,11 @@ simple @command{awk} programs so powerful.
@cindex @code{$} (dollar sign), @code{$} field operator
@cindex dollar sign (@code{$}), @code{$} field operator
@cindex field operators@comma{} dollar sign as
-You use a dollar-sign (@samp{$})
+You use a dollar sign (@samp{$})
to refer to a field in an @command{awk} program,
followed by the number of the field you want. Thus, @code{$1}
refers to the first field, @code{$2} to the second, and so on.
-(Unlike the Unix shells, the field numbers are not limited to single digits.
+(Unlike in the Unix shells, the field numbers are not limited to single digits.
@code{$127} is the 127th field in the record.)
For example, suppose the following is a line of input:
@@ -6778,7 +6748,7 @@ If you try to reference a field beyond the last
one (such as @code{$8} when the record has only seven fields), you get
the empty string. (If used in a numeric operation, you get zero.)
-The use of @code{$0}, which looks like a reference to the ``zero-th'' field, is
+The use of @code{$0}, which looks like a reference to the ``zeroth'' field, is
a special case: it represents the whole input record. Use it
when you are not interested in specific fields.
Here are some more examples:
@@ -6804,7 +6774,6 @@ $ @kbd{awk '/li/ @{ print $1, $NF @}' mail-list}
@print{} Julie F
@print{} Samuel A
@end example
-@c ENDOFRANGE fiex
@node Nonconstant Fields
@section Nonconstant Field Numbers
@@ -6834,13 +6803,13 @@ awk '@{ print $(2*2) @}' mail-list
@end example
@command{awk} evaluates the expression @samp{(2*2)} and uses
-its value as the number of the field to print. The @samp{*} sign
+its value as the number of the field to print. The @samp{*}
represents multiplication, so the expression @samp{2*2} evaluates to four.
The parentheses are used so that the multiplication is done before the
@samp{$} operation; they are necessary whenever there is a binary
operator@footnote{A @dfn{binary operator}, such as @samp{*} for
multiplication, is one that takes two operands. The distinction
-is required, because @command{awk} also has unary (one-operand)
+is required because @command{awk} also has unary (one-operand)
and ternary (three-operand) operators.}
in the field-number expression. This example, then, prints the
type of relationship (the fourth field) for every line of the file
@@ -6865,7 +6834,6 @@ evaluating @code{NF} and using its value as a field number.
@node Changing Fields
@section Changing the Contents of a Field
-@c STARTOFRANGE ficon
@cindex fields, changing contents of
The contents of a field, as seen by @command{awk}, can be changed within an
@command{awk} program; this changes what @command{awk} perceives as the
@@ -7021,7 +6989,7 @@ rebuild @code{$0} when @code{NF} is decremented.
Finally, there are times when it is convenient to force
@command{awk} to rebuild the entire record, using the current
-value of the fields and @code{OFS}. To do this, use the
+values of the fields and @code{OFS}. To do this, use the
seemingly innocuous assignment:
@example
@@ -7050,7 +7018,7 @@ such as @code{sub()} and @code{gsub()}
It is important to remember that @code{$0} is the @emph{full}
record, exactly as it was read from the input. This includes
any leading or trailing whitespace, and the exact whitespace (or other
-characters) that separate the fields.
+characters) that separates the fields.
It is a common error to try to change the field separators
in a record simply by setting @code{FS} and @code{OFS}, and then
@@ -7075,7 +7043,7 @@ with a statement such as @samp{$1 = $1}, as described earlier.
It is important to remember that @code{$0} is the @emph{full}
record, exactly as it was read from the input. This includes
any leading or trailing whitespace, and the exact whitespace (or other
-characters) that separate the fields.
+characters) that separates the fields.
It is a common error to try to change the field separators
in a record simply by setting @code{FS} and @code{OFS}, and then
@@ -7088,7 +7056,6 @@ with a statement such as @samp{$1 = $1}, as described earlier.
@end cartouche
@end ifnotdocbook
-@c ENDOFRANGE ficon
@node Field Separators
@section Specifying How Fields Are Separated
@@ -7104,9 +7071,7 @@ with a statement such as @samp{$1 = $1}, as described earlier.
@cindex @code{FS} variable
@cindex fields, separating
-@c STARTOFRANGE fisepr
@cindex field separators
-@c STARTOFRANGE fisepg
@cindex fields, separating
The @dfn{field separator}, which is either a single character or a regular
expression, controls the way @command{awk} splits an input record into fields.
@@ -7172,7 +7137,7 @@ John Q. Smith, LXIX, 29 Oak St., Walamazoo, MI 42139
@end example
@noindent
-The same program would extract @samp{@bullet{}LXIX}, instead of
+The same program would extract @samp{@bullet{}LXIX} instead of
@samp{@bullet{}29@bullet{}Oak@bullet{}St.}.
If you were expecting the program to print the
address, you would be surprised. The moral is to choose your data layout and
@@ -7206,9 +7171,7 @@ rules.
@node Regexp Field Splitting
@subsection Using Regular Expressions to Separate Fields
-@c STARTOFRANGE regexpfs
@cindex regular expressions, as field separators
-@c STARTOFRANGE fsregexp
@cindex field separators, regular expressions as
The previous @value{SUBSECTION}
discussed the use of single characters or simple strings as the
@@ -7312,8 +7275,6 @@ $ @kbd{echo 'xxAA xxBxx C' |}
@print{} -->xxBxx<--
@print{} -->C<--
@end example
-@c ENDOFRANGE regexpfs
-@c ENDOFRANGE fsregexp
@node Single Character Fields
@subsection Making Each Character a Separate Field
@@ -7437,7 +7398,7 @@ choosing your field and record separators.
@cindex Unix @command{awk}, password files@comma{} field separators and
Perhaps the most common use of a single character as the field separator
occurs when processing the Unix system password file. On many Unix
-systems, each user has a separate entry in the system password file, one
+systems, each user has a separate entry in the system password file, with one
line per user. The information in these lines is separated by colons.
The first field is the user's login name and the second is the user's
encrypted or shadow password. (A shadow password is indicated by the
@@ -7483,7 +7444,7 @@ When you do this, @code{$1} is the same as @code{$0}.
According to the POSIX standard, @command{awk} is supposed to behave
as if each record is split into fields at the time it is read.
In particular, this means that if you change the value of @code{FS}
-after a record is read, the value of the fields (i.e., how they were split)
+after a record is read, the values of the fields (i.e., how they were split)
should reflect the old value of @code{FS}, not the new one.
@cindex dark corner, field separators
@@ -7496,10 +7457,7 @@ using the @emph{current} value of @code{FS}!
@value{DARKCORNER}
This behavior can be difficult
to diagnose. The following example illustrates the difference
-between the two methods.
-(The @command{sed}@footnote{The @command{sed} utility is a ``stream editor.''
-Its behavior is also defined by the POSIX standard.}
-command prints just the first line of @file{/etc/passwd}.)
+between the two methods:
@example
sed 1q /etc/passwd | awk '@{ FS = ":" ; print $1 @}'
@@ -7520,6 +7478,10 @@ prints the full first line of the file, something like:
root:x:0:0:Root:/:
@end example
+(The @command{sed}@footnote{The @command{sed} utility is a ``stream editor.''
+Its behavior is also defined by the POSIX standard.}
+command prints just the first line of @file{/etc/passwd}.)
+
@docbook
</sidebar>
@end docbook
@@ -7536,7 +7498,7 @@ root:x:0:0:Root:/:
According to the POSIX standard, @command{awk} is supposed to behave
as if each record is split into fields at the time it is read.
In particular, this means that if you change the value of @code{FS}
-after a record is read, the value of the fields (i.e., how they were split)
+after a record is read, the values of the fields (i.e., how they were split)
should reflect the old value of @code{FS}, not the new one.
@cindex dark corner, field separators
@@ -7549,10 +7511,7 @@ using the @emph{current} value of @code{FS}!
@value{DARKCORNER}
This behavior can be difficult
to diagnose. The following example illustrates the difference
-between the two methods.
-(The @command{sed}@footnote{The @command{sed} utility is a ``stream editor.''
-Its behavior is also defined by the POSIX standard.}
-command prints just the first line of @file{/etc/passwd}.)
+between the two methods:
@example
sed 1q /etc/passwd | awk '@{ FS = ":" ; print $1 @}'
@@ -7572,6 +7531,10 @@ prints the full first line of the file, something like:
@example
root:x:0:0:Root:/:
@end example
+
+(The @command{sed}@footnote{The @command{sed} utility is a ``stream editor.''
+Its behavior is also defined by the POSIX standard.}
+command prints just the first line of @file{/etc/passwd}.)
@end cartouche
@end ifnotdocbook
@@ -7669,8 +7632,6 @@ will take effect.
@end cartouche
@end ifnotdocbook
-@c ENDOFRANGE fisepr
-@c ENDOFRANGE fisepg
@node Constant Size
@section Reading Fixed-Width Data
@@ -7785,7 +7746,7 @@ In order to tell which kind of field splitting is in effect,
use @code{PROCINFO["FS"]}
(@pxref{Auto-set}).
The value is @code{"FS"} if regular field splitting is being used,
-or it is @code{"FIELDWIDTHS"} if fixed-width field splitting is being used:
+or @code{"FIELDWIDTHS"} if fixed-width field splitting is being used:
@example
if (PROCINFO["FS"] == "FS")
@@ -7821,14 +7782,14 @@ what they are, and not by what they are not.
The most notorious such case
is so-called @dfn{comma-separated values} (CSV) data. Many spreadsheet programs,
for example, can export their data into text files, where each record is
-terminated with a newline, and fields are separated by commas. If only
-commas separated the data, there wouldn't be an issue. The problem comes when
+terminated with a newline, and fields are separated by commas. If
+commas only separated the data, there wouldn't be an issue. The problem comes when
one of the fields contains an @emph{embedded} comma.
In such cases, most programs embed the field in double quotes.@footnote{The
CSV format lacked a formal standard definition for many years.
@uref{http://www.ietf.org/rfc/rfc4180.txt, RFC 4180}
standardizes the most common practices.}
-So we might have data like this:
+So, we might have data like this:
@example
@c file eg/misc/addresses.csv
@@ -7914,8 +7875,8 @@ of cases, and the @command{gawk} developers are satisfied with that.
@end quotation
As written, the regexp used for @code{FPAT} requires that each field
-have a least one character. A straightforward modification
-(changing changed the first @samp{+} to @samp{*}) allows fields to be empty:
+contain at least one character. A straightforward modification
+(changing the first @samp{+} to @samp{*}) allows fields to be empty:
@example
FPAT = "([^,]*)|(\"[^\"]+\")"
@@ -7925,20 +7886,17 @@ Finally, the @code{patsplit()} function makes the same functionality
available for splitting regular strings (@pxref{String Functions}).
To recap, @command{gawk} provides three independent methods
-to split input records into fields. @command{gawk} uses whichever
-mechanism was last chosen based on which of the three
-variables---@code{FS}, @code{FIELDWIDTHS}, and @code{FPAT}---was
+to split input records into fields.
+The mechanism used is based on which of the three
+variables---@code{FS}, @code{FIELDWIDTHS}, or @code{FPAT}---was
last assigned to.
@node Multiple Line
@section Multiple-Line Records
@cindex multiple-line records
-@c STARTOFRANGE recm
@cindex records, multiline
-@c STARTOFRANGE imr
@cindex input, multiline records
-@c STARTOFRANGE frm
@cindex files, reading, multiline records
@cindex input, files, See input files
In some databases, a single line cannot conveniently hold all the
@@ -7973,7 +7931,7 @@ at the end of the record and one or more blank lines after the record.
In addition, a regular expression always matches the longest possible
sequence when there is a choice
(@pxref{Leftmost Longest}).
-So the next record doesn't start until
+So, the next record doesn't start until
the first nonblank line that follows---no matter how many blank lines
appear in a row, they are considered one record separator.
@@ -7988,10 +7946,10 @@ In the second case, this special processing is not done.
@cindex field separator, in multiline records
@cindex @code{FS}, in multiline records
Now that the input is separated into records, the second step is to
-separate the fields in the record. One way to do this is to divide each
+separate the fields in the records. One way to do this is to divide each
of the lines into fields in the normal manner. This happens by default
as the result of a special feature. When @code{RS} is set to the empty
-string, @emph{and} @code{FS} is set to a single character,
+string @emph{and} @code{FS} is set to a single character,
the newline character @emph{always} acts as a field separator.
This is in addition to whatever field separations result from
@code{FS}.@footnote{When @code{FS} is the null string (@code{""})
@@ -8006,7 +7964,7 @@ want the newline character to separate fields, because there is no way to
prevent it. However, you can work around this by using the @code{split()}
function to break up the record manually
(@pxref{String Functions}).
-If you have a single character field separator, you can work around
+If you have a single-character field separator, you can work around
the special feature in a different way, by making @code{FS} into a
regexp for that single character. For example, if the field
separator is a percent character, instead of
@@ -8014,10 +7972,10 @@ separator is a percent character, instead of
Another way to separate fields is to
put each field on a separate line: to do this, just set the
-variable @code{FS} to the string @code{"\n"}. (This single
-character separator matches a single newline.)
+variable @code{FS} to the string @code{"\n"}.
+(This single-character separator matches a single newline.)
A practical example of a @value{DF} organized this way might be a mailing
-list, where each entry is separated by blank lines. Consider a mailing
+list, where blank lines separate the entries. Consider a mailing
list in a file named @file{addresses}, which looks like this:
@example
@@ -8105,20 +8063,15 @@ If not in compatibility mode (@pxref{Options}), @command{gawk} sets
@code{RT} to the input text that matched the value specified by @code{RS}.
But if the input file ended without any text that matches @code{RS},
then @command{gawk} sets @code{RT} to the null string.
-@c ENDOFRANGE recm
-@c ENDOFRANGE imr
-@c ENDOFRANGE frm
@node Getline
@section Explicit Input with @code{getline}
-@c STARTOFRANGE getl
@cindex @code{getline} command, explicit input with
-@c STARTOFRANGE inex
@cindex input, explicit
So far we have been getting our input data from @command{awk}'s main
input stream---either the standard input (usually your keyboard, sometimes
-the output from another program) or from the
+the output from another program) or the
files specified on the command line. The @command{awk} language has a
special built-in command called @code{getline} that
can be used to read input under your explicit control.
@@ -8307,7 +8260,7 @@ free
@end example
The @code{getline} command used in this way sets only the variables
-@code{NR}, @code{FNR}, and @code{RT} (and of course, @var{var}).
+@code{NR}, @code{FNR}, and @code{RT} (and, of course, @var{var}).
The record is not
split into fields, so the values of the fields (including @code{$0}) and
the value of @code{NF} do not change.
@@ -8322,7 +8275,7 @@ the value of @code{NF} do not change.
@cindex left angle bracket (@code{<}), @code{<} operator (I/O)
@cindex operators, input/output
Use @samp{getline < @var{file}} to read the next record from @var{file}.
-Here @var{file} is a string-valued expression that
+Here, @var{file} is a string-valued expression that
specifies the @value{FN}. @samp{< @var{file}} is called a @dfn{redirection}
because it directs input to come from a different place.
For example, the following
@@ -8500,7 +8453,7 @@ of a construct like @samp{@w{"echo "} "date" | getline}.
Most versions, including the current version, treat it at as
@samp{@w{("echo "} "date") | getline}.
(This is also how BWK @command{awk} behaves.)
-Some versions changed and treated it as
+Some versions instead treat it as
@samp{@w{"echo "} ("date" | getline)}.
(This is how @command{mawk} behaves.)
In short, @emph{always} use explicit parentheses, and then you won't
@@ -8548,7 +8501,7 @@ program to be portable to other @command{awk} implementations.
@cindex operators, input/output
@cindex differences in @command{awk} and @command{gawk}, input/output operators
-Input into @code{getline} from a pipe is a one-way operation.
+Reading input into @code{getline} from a pipe is a one-way operation.
The command that is started with @samp{@var{command} | getline} only
sends data @emph{to} your @command{awk} program.
@@ -8558,7 +8511,7 @@ for processing and then read the results back.
communications are possible. This is done with the @samp{|&}
operator.
Typically, you write data to the coprocess first and then
-read results back, as shown in the following:
+read the results back, as shown in the following:
@example
print "@var{some query}" |& "db_server"
@@ -8641,7 +8594,7 @@ also @pxref{Auto-set}.)
@item
Using @code{FILENAME} with @code{getline}
(@samp{getline < FILENAME})
-is likely to be a source for
+is likely to be a source of
confusion. @command{awk} opens a separate input stream from the
current input file. However, by not using a variable, @code{$0}
and @code{NF} are still updated. If you're doing this, it's
@@ -8649,9 +8602,15 @@ probably by accident, and you should reconsider what it is you're
trying to accomplish.
@item
-@DBREF{Getline Summary} presents a table summarizing the
+@ifdocbook
+The next section
+@end ifdocbook
+@ifnotdocbook
+@ref{Getline Summary},
+@end ifnotdocbook
+presents a table summarizing the
@code{getline} variants and which variables they can affect.
-It is worth noting that those variants which do not use redirection
+It is worth noting that those variants that do not use redirection
can cause @code{FILENAME} to be updated if they cause
@command{awk} to start reading a new input file.
@@ -8660,7 +8619,7 @@ can cause @code{FILENAME} to be updated if they cause
If the variable being assigned is an expression with side effects,
different versions of @command{awk} behave differently upon encountering
end-of-file. Some versions don't evaluate the expression; many versions
-(including @command{gawk}) do. Here is an example, due to Duncan Moore:
+(including @command{gawk}) do. Here is an example, courtesy of Duncan Moore:
@ignore
Date: Sun, 01 Apr 2012 11:49:33 +0100
@@ -8677,7 +8636,7 @@ BEGIN @{
@noindent
Here, the side effect is the @samp{++c}. Is @code{c} incremented if
-end of file is encountered, before the element in @code{a} is assigned?
+end-of-file is encountered before the element in @code{a} is assigned?
@command{gawk} treats @code{getline} like a function call, and evaluates
the expression @samp{a[++c]} before attempting to read from @file{f}.
@@ -8709,9 +8668,6 @@ Note: for each variant, @command{gawk} sets the @code{RT} predefined variable.
@item @var{command} @code{|& getline} @var{var} @tab Sets @var{var} and @code{RT} @tab @command{gawk}
@end multitable
@end float
-@c ENDOFRANGE getl
-@c ENDOFRANGE inex
-@c ENDOFRANGE infir
@node Read Timeout
@section Reading Input with a Timeout
@@ -8722,8 +8678,8 @@ This @value{SECTION} describes a feature that is specific to @command{gawk}.
You may specify a timeout in milliseconds for reading input from the keyboard,
a pipe, or two-way communication, including TCP/IP sockets. This can be done
-on a per input, command, or connection basis, by setting a special element
-in the @code{PROCINFO} array (@pxref{Auto-set}):
+on a per-input, per-command, or per-connection basis, by setting a special
+element in the @code{PROCINFO} array (@pxref{Auto-set}):
@example
PROCINFO["input_name", "READ_TIMEOUT"] = @var{timeout in milliseconds}
@@ -8754,7 +8710,7 @@ while ((getline < "/dev/stdin") > 0)
@end example
@command{gawk} terminates the read operation if input does not
-arrive after waiting for the timeout period, returns failure
+arrive after waiting for the timeout period, returns failure,
and sets @code{ERRNO} to an appropriate string value.
A negative or zero value for the timeout is the same as specifying
no timeout at all.
@@ -8804,7 +8760,7 @@ If the @code{PROCINFO} element is not present and the
@command{gawk} uses its value to initialize the timeout value.
The exclusive use of the environment variable to specify timeout
has the disadvantage of not being able to control it
-on a per command or connection basis.
+on a per-command or per-connection basis.
@command{gawk} considers a timeout event to be an error even though
the attempt to read from the underlying device may
@@ -8900,7 +8856,7 @@ The possibilities are as follows:
@item
After splitting the input into records, @command{awk} further splits
-the record into individual fields, named @code{$1}, @code{$2}, and so
+the records into individual fields, named @code{$1}, @code{$2}, and so
on. @code{$0} is the whole record, and @code{NF} indicates how many
fields there are. The default way to split fields is between whitespace
characters.
@@ -8916,12 +8872,12 @@ thing. Decrementing @code{NF} throws away fields and rebuilds the record.
@item
Field splitting is more complicated than record splitting:
-@multitable @columnfractions .40 .45 .15
+@multitable @columnfractions .40 .40 .20
@headitem Field separator value @tab Fields are split @dots{} @tab @command{awk} / @command{gawk}
@item @code{FS == " "} @tab On runs of whitespace @tab @command{awk}
@item @code{FS == @var{any single character}} @tab On that character @tab @command{awk}
@item @code{FS == @var{regexp}} @tab On text matching the regexp @tab @command{awk}
-@item @code{FS == ""} @tab Each individual character is a separate field @tab @command{gawk}
+@item @code{FS == ""} @tab Such that each individual character is a separate field @tab @command{gawk}
@item @code{FIELDWIDTHS == @var{list of columns}} @tab Based on character position @tab @command{gawk}
@item @code{FPAT == @var{regexp}} @tab On the text surrounding text matching the regexp @tab @command{gawk}
@end multitable
@@ -8938,11 +8894,11 @@ This can also be done using command-line variable assignment.
Use @code{PROCINFO["FS"]} to see how fields are being split.
@item
-Use @code{getline} in its various forms to read additional records,
+Use @code{getline} in its various forms to read additional records
from the default input stream, from a file, or from a pipe or coprocess.
@item
-Use @code{PROCINFO[@var{file}, "READ_TIMEOUT"]} to cause reads to timeout
+Use @code{PROCINFO[@var{file}, "READ_TIMEOUT"]} to cause reads to time out
for @var{file}.
@item
@@ -8976,7 +8932,6 @@ That can be fixed by making one simple change. What is it?
@node Printing
@chapter Printing Output
-@c STARTOFRANGE prnt
@cindex printing
@cindex output, printing, See printing
One of the most common programming actions is to @dfn{print}, or output,
@@ -8992,7 +8947,6 @@ columns, whether to use exponential notation or not, and so on.
For printing with specifications, you need the @code{printf} statement
(@pxref{Printf}).
-@c STARTOFRANGE prnts
@cindex @code{print} statement
@cindex @code{printf} statement
Besides basic and formatted printing, this @value{CHAPTER}
@@ -9053,7 +9007,7 @@ space is printed between any two items.
Note that the @code{print} statement is a statement and not an
expression---you can't use it in the pattern part of a
-@var{pattern}-@var{action} statement, for example.
+pattern--action statement, for example.
@node Print Examples
@section @code{print} Statement Examples
@@ -9172,7 +9126,6 @@ You can continue either a @code{print} or
@code{printf} statement simply by putting a newline after any comma
(@pxref{Statements/Lines}).
@end quotation
-@c ENDOFRANGE prnts
@node Output Separators
@section Output Separators
@@ -9245,7 +9198,7 @@ runs together on a single line.
@cindex numeric, output format
@cindex formats@comma{} numeric output
When printing numeric values with the @code{print} statement,
-@command{awk} internally converts the number to a string of characters
+@command{awk} internally converts each number to a string of characters
and prints that string. @command{awk} uses the @code{sprintf()} function
to do this conversion
(@pxref{String Functions}).
@@ -9285,7 +9238,6 @@ if @code{OFMT} contains anything but a floating-point conversion specification.
@node Printf
@section Using @code{printf} Statements for Fancier Printing
-@c STARTOFRANGE printfs
@cindex @code{printf} statement
@cindex output, formatted
@cindex formatting output
@@ -9317,7 +9269,7 @@ printf @var{format}, @var{item1}, @var{item2}, @dots{}
@noindent
As for @code{print}, the entire list of arguments may optionally be
enclosed in parentheses. Here too, the parentheses are necessary if any
-of the item expressions use the @samp{>} relational operator; otherwise,
+of the item expressions uses the @samp{>} relational operator; otherwise,
it can be confused with an output redirection (@pxref{Redirection}).
@cindex format specifiers
@@ -9348,7 +9300,7 @@ $ @kbd{awk 'BEGIN @{}
@end example
@noindent
-Here, neither the @samp{+} nor the @samp{OUCH!} appear in
+Here, neither the @samp{+} nor the @samp{OUCH!} appears in
the output message.
@node Control Letters
@@ -9395,8 +9347,8 @@ The two control letters are equivalent.
(The @samp{%i} specification is for compatibility with ISO C.)
@item @code{%e}, @code{%E}
-Print a number in scientific (exponential) notation;
-for example:
+Print a number in scientific (exponential) notation.
+For example:
@example
printf "%4.3e\n", 1950
@@ -9433,7 +9385,7 @@ The special ``not a number'' value formats as @samp{-nan} or @samp{nan}
(@pxref{Math Definitions}).
@item @code{%F}
-Like @samp{%f} but the infinity and ``not a number'' values are spelled
+Like @samp{%f}, but the infinity and ``not a number'' values are spelled
using uppercase letters.
The @samp{%F} format is a POSIX extension to ISO C; not all systems
@@ -9483,7 +9435,6 @@ values or do something else entirely.
@node Format Modifiers
@subsection Modifiers for @code{printf} Formats
-@c STARTOFRANGE pfm
@cindex @code{printf} statement, modifiers
@cindex modifiers@comma{} in format specifiers
A format specification can also include @dfn{modifiers} that can control
@@ -9522,7 +9473,7 @@ messages at runtime.
which describes how and why to use positional specifiers.
For now, we ignore them.
-@item - (Minus)
+@item - @r{(Minus)}
The minus sign, used before the width modifier (see later on in
this list),
says to left-justify
@@ -9678,7 +9629,7 @@ printf "%" w "." p "s\n", s
@end example
@noindent
-This is not particularly easy to read but it does work.
+This is not particularly easy to read, but it does work.
@c @cindex lint checks
@cindex troubleshooting, fatal errors, @code{printf} format strings
@@ -9689,7 +9640,6 @@ format strings. These are not valid in @command{awk}. Most @command{awk}
implementations silently ignore them. If @option{--lint} is provided
on the command line (@pxref{Options}), @command{gawk} warns about their
use. If @option{--posix} is supplied, their use is a fatal error.
-@c ENDOFRANGE pfm
@node Printf Examples
@subsection Examples Using @code{printf}
@@ -9725,7 +9675,7 @@ $ @kbd{awk '@{ printf "%-10s %s\n", $1, $2 @}' mail-list}
@end example
In this case, the phone numbers had to be printed as strings because
-the numbers are separated by a dash. Printing the phone numbers as
+the numbers are separated by dashes. Printing the phone numbers as
numbers would have produced just the first three digits: @samp{555}.
This would have been pretty confusing.
@@ -9770,14 +9720,11 @@ awk 'BEGIN @{ format = "%-10s %s\n"
@{ printf format, $1, $2 @}' mail-list
@end example
-@c ENDOFRANGE printfs
@node Redirection
@section Redirecting Output of @code{print} and @code{printf}
-@c STARTOFRANGE outre
@cindex output redirection
-@c STARTOFRANGE reout
@cindex redirection of output
@cindex @option{--sandbox} option, output redirection with @code{print}, @code{printf}
So far, the output from @code{print} and @code{printf} has gone
@@ -9788,7 +9735,7 @@ This is called @dfn{redirection}.
@quotation NOTE
When @option{--sandbox} is specified (@pxref{Options}),
-redirecting output to files, pipes and coprocesses is disabled.
+redirecting output to files, pipes, and coprocesses is disabled.
@end quotation
A redirection appears after the @code{print} or @code{printf} statement.
@@ -9841,7 +9788,7 @@ Each output file contains one name or number per line.
@cindex @code{>} (right angle bracket), @code{>>} operator (I/O)
@cindex right angle bracket (@code{>}), @code{>>} operator (I/O)
@item print @var{items} >> @var{output-file}
-This redirection prints the items into the pre-existing output file
+This redirection prints the items into the preexisting output file
named @var{output-file}. The difference between this and the
single-@samp{>} redirection is that the old contents (if any) of
@var{output-file} are not erased. Instead, the @command{awk} output is
@@ -9880,7 +9827,7 @@ The unsorted list is written with an ordinary redirection, while
the sorted list is written by piping through the @command{sort} utility.
The next example uses redirection to mail a message to the mailing
-list @samp{bug-system}. This might be useful when trouble is encountered
+list @code{bug-system}. This might be useful when trouble is encountered
in an @command{awk} script run periodically for system maintenance:
@example
@@ -9911,15 +9858,23 @@ This redirection prints the items to the input of @var{command}.
The difference between this and the
single-@samp{|} redirection is that the output from @var{command}
can be read with @code{getline}.
-Thus @var{command} is a @dfn{coprocess}, which works together with,
-but subsidiary to, the @command{awk} program.
+Thus, @var{command} is a @dfn{coprocess}, which works together with
+but is subsidiary to the @command{awk} program.
This feature is a @command{gawk} extension, and is not available in
POSIX @command{awk}.
-@DBXREF{Getline/Coprocess}
+@ifnotdocbook
+@xref{Getline/Coprocess},
for a brief discussion.
-@DBXREF{Two-way I/O}
+@xref{Two-way I/O},
for a more complete discussion.
+@end ifnotdocbook
+@ifdocbook
+@DBXREF{Getline/Coprocess}
+for a brief discussion and
+@DBREF{Two-way I/O}
+for a more complete discussion.
+@end ifdocbook
@end table
Redirecting output using @samp{>}, @samp{>>}, @samp{|}, or @samp{|&}
@@ -9944,7 +9899,7 @@ This is indeed how redirections must be used from the shell. But in
@command{awk}, it isn't necessary. In this kind of case, a program should
use @samp{>} for all the @code{print} statements, because the output file
is only opened once. (It happens that if you mix @samp{>} and @samp{>>}
-that output is produced in the expected order. However, mixing the operators
+output is produced in the expected order. However, mixing the operators
for the same file is definitely poor style, and is confusing to readers
of your program.)
@@ -10035,11 +9990,9 @@ It then sends the list to the shell for execution.
command lines to be fed to the shell.
@end cartouche
@end ifnotdocbook
-@c ENDOFRANGE outre
-@c ENDOFRANGE reout
@node Special FD
-@section Special Files for Standard Pre-Opened Data Streams
+@section Special Files for Standard Preopened Data Streams
@cindex standard input
@cindex input, standard
@cindex standard output
@@ -10052,7 +10005,7 @@ command lines to be fed to the shell.
Running programs conventionally have three input and output streams
already available to them for reading and writing. These are known
as the @dfn{standard input}, @dfn{standard output}, and @dfn{standard
-error output}. These open streams (and any other open file or pipe)
+error output}. These open streams (and any other open files or pipes)
are often referred to by the technical term @dfn{file descriptors}.
These streams are, by default, connected to your keyboard and screen, but
@@ -10090,7 +10043,7 @@ that is connected to your keyboard and screen. It represents the
``terminal,''@footnote{The ``tty'' in @file{/dev/tty} stands for
``Teletype,'' a serial terminal.} which on modern systems is a keyboard
and screen, not a serial console.)
-This generally has the same effect but not always: although the
+This generally has the same effect, but not always: although the
standard error stream is usually the screen, it can be redirected; when
that happens, writing to the screen is not correct. In fact, if
@command{awk} is run from a background job, it may not have a
@@ -10135,7 +10088,7 @@ print "Serious error detected!" > "/dev/stderr"
@cindex troubleshooting, quotes with file names
Note the use of quotes around the @value{FN}.
-Like any other redirection, the value must be a string.
+Like with any other redirection, the value must be a string.
It is a common error to omit the quotes, which leads
to confusing results.
@@ -10146,7 +10099,6 @@ invoked with the @option{--traditional} option (@pxref{Options}).
@node Special Files
@section Special @value{FFN}s in @command{gawk}
-@c STARTOFRANGE gfn
@cindex @command{gawk}, file names in
Besides access to standard input, standard output, and standard error,
@@ -10162,7 +10114,7 @@ TCP/IP networking.
@end menu
@node Other Inherited Files
-@subsection Accessing Other Open Files With @command{gawk}
+@subsection Accessing Other Open Files with @command{gawk}
Besides the @code{/dev/stdin}, @code{/dev/stdout}, and @code{/dev/stderr}
special @value{FN}s mentioned earlier, @command{gawk} provides syntax
@@ -10219,7 +10171,7 @@ special @value{FN}s that @command{gawk} provides:
@cindex compatibility mode (@command{gawk}), file names
@cindex file names, in compatibility mode
@item
-Recognition of the @value{FN}s for the three standard pre-opened
+Recognition of the @value{FN}s for the three standard preopened
files is disabled only in POSIX mode.
@item
@@ -10232,23 +10184,18 @@ compatibility mode (either @option{--traditional} or @option{--posix};
interprets these special @value{FN}s.
For example, using @samp{/dev/fd/4}
for output actually writes on file descriptor 4, and not on a new
-file descriptor that is @code{dup()}'ed from file descriptor 4. Most of
+file descriptor that is @code{dup()}ed from file descriptor 4. Most of
the time this does not matter; however, it is important to @emph{not}
close any of the files related to file descriptors 0, 1, and 2.
Doing so results in unpredictable behavior.
@end itemize
-@c ENDOFRANGE gfn
@node Close Files And Pipes
@section Closing Input and Output Redirections
@cindex files, output, See output files
-@c STARTOFRANGE ifc
@cindex input files, closing
-@c STARTOFRANGE ofc
@cindex output, files@comma{} closing
-@c STARTOFRANGE pc
@cindex pipe, closing
-@c STARTOFRANGE cc
@cindex coprocesses, closing
@cindex @code{getline} command, coprocesses@comma{} using from
@@ -10459,9 +10406,9 @@ This value is zero if the close succeeds, or @minus{}1 if
it fails.
The POSIX standard is very vague; it says that @code{close()}
-returns zero on success and nonzero otherwise. In general,
+returns zero on success and a nonzero value otherwise. In general,
different implementations vary in what they report when closing
-pipes; thus the return value cannot be used portably.
+pipes; thus, the return value cannot be used portably.
@value{DARKCORNER}
In POSIX mode (@pxref{Options}), @command{gawk} just returns zero
when closing a pipe.
@@ -10516,19 +10463,15 @@ This value is zero if the close succeeds, or @minus{}1 if
it fails.
The POSIX standard is very vague; it says that @code{close()}
-returns zero on success and nonzero otherwise. In general,
+returns zero on success and a nonzero value otherwise. In general,
different implementations vary in what they report when closing
-pipes; thus the return value cannot be used portably.
+pipes; thus, the return value cannot be used portably.
@value{DARKCORNER}
In POSIX mode (@pxref{Options}), @command{gawk} just returns zero
when closing a pipe.
@end cartouche
@end ifnotdocbook
-@c ENDOFRANGE ifc
-@c ENDOFRANGE ofc
-@c ENDOFRANGE pc
-@c ENDOFRANGE cc
@node Output Summary
@section Summary
@@ -10542,8 +10485,8 @@ for numeric values for the @code{print} statement.
@item
The @code{printf} statement provides finer-grained control over output,
-with format control letters for different data types and various flags
-that modify the behavior of the format control letters.
+with format-control letters for different data types and various flags
+that modify the behavior of the format-control letters.
@item
Output from both @code{print} and @code{printf} may be redirected to
@@ -10592,11 +10535,9 @@ BEGIN @{ print "Serious error detected!" > /dev/stderr @}
@end enumerate
@c EXCLUDE END
-@c ENDOFRANGE prnt
@node Expressions
@chapter Expressions
-@c STARTOFRANGE exps
@cindex expressions
Expressions are the basic building blocks of @command{awk} patterns
@@ -10607,7 +10548,7 @@ can assign a new value to a variable or a field by using an assignment operator.
An expression can serve as a pattern or action statement on its own.
Most other kinds of
statements contain one or more expressions that specify the data on which to
-operate. As in other languages, expressions in @command{awk} include
+operate. As in other languages, expressions in @command{awk} can include
variables, array references, constants, and function calls, as well as
combinations of these with various operators.
@@ -10626,7 +10567,7 @@ combinations of these with various operators.
Expressions are built up from values and the operations performed
upon them. This @value{SECTION} describes the elementary objects
-which provide the values used in expressions.
+that provide the values used in expressions.
@menu
* Constants:: String, numeric and regexp constants.
@@ -10639,7 +10580,6 @@ which provide the values used in expressions.
@node Constants
@subsection Constant Expressions
-@c STARTOFRANGE cnst
@cindex constants, types of
The simplest type of expression is the @dfn{constant}, which always has
@@ -10677,7 +10617,7 @@ have the same value:
@end example
@cindex string constants
-A string constant consists of a sequence of characters enclosed in
+A @dfn{string constant} consists of a sequence of characters enclosed in
double quotation marks. For example:
@example
@@ -10689,7 +10629,7 @@ double quotation marks. For example:
@cindex strings, length limitations
represents the string whose contents are @samp{parrot}. Strings in
@command{gawk} can be of any length, and they can contain any of the possible
-eight-bit ASCII characters including ASCII @sc{nul} (character code zero).
+eight-bit ASCII characters, including ASCII @sc{nul} (character code zero).
Other @command{awk}
implementations may have difficulty with some character codes.
@@ -10704,15 +10644,15 @@ In @command{awk}, all numbers are in decimal (i.e., base 10). Many other
programming languages allow you to specify numbers in other bases, often
octal (base 8) and hexadecimal (base 16).
In octal, the numbers go 0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 12, and so on.
-Just as @samp{11}, in decimal, is 1 times 10 plus 1, so
-@samp{11}, in octal, is 1 times 8, plus 1. This equals 9 in decimal.
+Just as @samp{11} in decimal is 1 times 10 plus 1, so
+@samp{11} in octal is 1 times 8 plus 1. This equals 9 in decimal.
In hexadecimal, there are 16 digits. Because the everyday decimal
number system only has ten digits (@samp{0}--@samp{9}), the letters
@samp{a} through @samp{f} are used to represent the rest.
(Case in the letters is usually irrelevant; hexadecimal @samp{a} and @samp{A}
have the same value.)
-Thus, @samp{11}, in
-hexadecimal, is 1 times 16 plus 1, which equals 17 in decimal.
+Thus, @samp{11} in
+hexadecimal is 1 times 16 plus 1, which equals 17 in decimal.
Just by looking at plain @samp{11}, you can't tell what base it's in.
So, in C, C++, and other languages derived from C,
@@ -10723,13 +10663,13 @@ and hexadecimal numbers start with a leading @samp{0x} or @samp{0X}:
@table @code
@item 11
-Decimal value 11.
+Decimal value 11
@item 011
-Octal 11, decimal value 9.
+Octal 11, decimal value 9
@item 0x11
-Hexadecimal 11, decimal value 17.
+Hexadecimal 11, decimal value 17
@end table
This example shows the difference:
@@ -10757,11 +10697,11 @@ you can use the @code{strtonum()} function
(@pxref{String Functions})
to convert the data into a number.
Most of the time, you will want to use octal or hexadecimal constants
-when working with the built-in bit manipulation functions;
+when working with the built-in bit-manipulation functions;
see @DBREF{Bitwise Functions}
for more information.
-Unlike some early C implementations, @samp{8} and @samp{9} are not
+Unlike in some early C implementations, @samp{8} and @samp{9} are not
valid in octal constants. For example, @command{gawk} treats @samp{018}
as decimal 18:
@@ -10825,19 +10765,17 @@ $ @kbd{gawk 'BEGIN @{ printf "0x11 is <%s>\n", 0x11 @}'}
@node Regexp Constants
@subsubsection Regular Expression Constants
-@c STARTOFRANGE rec
@cindex regexp constants
@cindex @code{~} (tilde), @code{~} operator
@cindex tilde (@code{~}), @code{~} operator
@cindex @code{!} (exclamation point), @code{!~} operator
@cindex exclamation point (@code{!}), @code{!~} operator
-A regexp constant is a regular expression description enclosed in
+A @dfn{regexp constant} is a regular expression description enclosed in
slashes, such as @code{@w{/^beginning and end$/}}. Most regexps used in
@command{awk} programs are constant, but the @samp{~} and @samp{!~}
matching operators can also match computed or dynamic regexps
(which are typically just ordinary strings or variables that contain a regexp,
-but could be a more complex expression).
-@c ENDOFRANGE cnst
+but could be more complex expressions).
@node Using Constant Regexps
@subsection Using Regular Expression Constants
@@ -10917,7 +10855,7 @@ the third argument of @code{split()} to be a regexp constant, but some
older implementations do not.
@value{DARKCORNER}
Because some built-in functions accept regexp constants as arguments,
-it can be confusing when attempting to use regexp constants as arguments
+confusion can arise when attempting to use regexp constants as arguments
to user-defined functions (@pxref{User-defined}). For example:
@example
@@ -10943,19 +10881,18 @@ function mysub(pat, repl, str, global)
In this example, the programmer wants to pass a regexp constant to the
user-defined function @code{mysub()}, which in turn passes it on to
either @code{sub()} or @code{gsub()}. However, what really happens is that
-the @code{pat} parameter is either one or zero, depending upon whether
+the @code{pat} parameter is assigned a value of either one or zero, depending upon whether
or not @code{$0} matches @code{/hi/}.
@command{gawk} issues a warning when it sees a regexp constant used as
a parameter to a user-defined function, because passing a truth value in
this way is probably not what was intended.
-@c ENDOFRANGE rec
@node Variables
@subsection Variables
@cindex variables, user-defined
@cindex user-defined, variables
-Variables are ways of storing values at one point in your program for
+@dfn{Variables} are ways of storing values at one point in your program for
use later in another part of your program. They can be manipulated
entirely within the program text, and they can also be assigned values
on the @command{awk} command line.
@@ -10983,17 +10920,17 @@ are distinct variables.
A variable name is a valid expression by itself; it represents the
variable's current value. Variables are given new values with
@dfn{assignment operators}, @dfn{increment operators}, and
-@dfn{decrement operators}.
-@xref{Assignment Ops}.
+@dfn{decrement operators}
+(@pxref{Assignment Ops}).
In addition, the @code{sub()} and @code{gsub()} functions can
change a variable's value, and the @code{match()}, @code{split()},
and @code{patsplit()} functions can change the contents of their
-array parameters. @xref{String Functions}.
+array parameters (@pxref{String Functions}).
@cindex variables, built-in
@cindex variables, initializing
A few variables have special built-in meanings, such as @code{FS} (the
-field separator), and @code{NF} (the number of fields in the current input
+field separator) and @code{NF} (the number of fields in the current input
record). @DBXREF{Built-in Variables} for a list of the predefined variables.
These predefined variables can be used and assigned just like all other
variables, but their values are also used or changed automatically by
@@ -11250,7 +11187,7 @@ point, so the default behavior was restored to use a period as the
decimal point character. You can use the @option{--use-lc-numeric}
option (@pxref{Options}) to force @command{gawk} to use the locale's
decimal point character. (@command{gawk} also uses the locale's decimal
-point character when in POSIX mode, either via @option{--posix}, or the
+point character when in POSIX mode, either via @option{--posix} or the
@env{POSIXLY_CORRECT} environment variable, as shown previously.)
@ref{table-locale-affects} describes the cases in which the locale's decimal
@@ -11268,7 +11205,7 @@ features have not been described yet.
@end multitable
@end float
-Finally, modern day formal standards and IEEE standard floating-point
+Finally, modern-day formal standards and the IEEE standard floating-point
representation can have an unusual but important effect on the way
@command{gawk} converts some special string values to numbers. The details
are presented in @ref{POSIX Floating Point Problems}.
@@ -11276,7 +11213,7 @@ are presented in @ref{POSIX Floating Point Problems}.
@node All Operators
@section Operators: Doing Something with Values
-This @value{SECTION} introduces the @dfn{operators} which make use
+This @value{SECTION} introduces the @dfn{operators} that make use
of the values provided by constants and variables.
@menu
@@ -11454,7 +11391,7 @@ print "something meaningful" > file name
@noindent
This produces a syntax error with some versions of Unix
@command{awk}.@footnote{It happens that BWK
-@command{awk}, @command{gawk} and @command{mawk} all ``get it right,''
+@command{awk}, @command{gawk}, and @command{mawk} all ``get it right,''
but you should not rely on this.}
It is necessary to use the following:
@@ -11543,11 +11480,8 @@ you're never quite sure what you'll get.
@node Assignment Ops
@subsection Assignment Expressions
-@c STARTOFRANGE asop
@cindex assignment operators
-@c STARTOFRANGE opas
@cindex operators, assignment
-@c STARTOFRANGE exas
@cindex expressions, assignment
@cindex @code{=} (equals sign), @code{=} operator
@cindex equals sign (@code{=}), @code{=} operator
@@ -11707,7 +11641,7 @@ and
@ifdocbook
@DBREF{Numeric Functions}
@end ifdocbook
-for more information).
+for more information.)
This example illustrates an important fact about assignment
operators: the lefthand expression is only evaluated @emph{once}.
@@ -11743,17 +11677,17 @@ to a number.
@caption{Arithmetic assignment operators}
@multitable @columnfractions .30 .70
@headitem Operator @tab Effect
-@item @var{lvalue} @code{+=} @var{increment} @tab Add @var{increment} to the value of @var{lvalue}
-@item @var{lvalue} @code{-=} @var{decrement} @tab Subtract @var{decrement} from the value of @var{lvalue}
-@item @var{lvalue} @code{*=} @var{coefficient} @tab Multiply the value of @var{lvalue} by @var{coefficient}
-@item @var{lvalue} @code{/=} @var{divisor} @tab Divide the value of @var{lvalue} by @var{divisor}
-@item @var{lvalue} @code{%=} @var{modulus} @tab Set @var{lvalue} to its remainder by @var{modulus}
+@item @var{lvalue} @code{+=} @var{increment} @tab Add @var{increment} to the value of @var{lvalue}.
+@item @var{lvalue} @code{-=} @var{decrement} @tab Subtract @var{decrement} from the value of @var{lvalue}.
+@item @var{lvalue} @code{*=} @var{coefficient} @tab Multiply the value of @var{lvalue} by @var{coefficient}.
+@item @var{lvalue} @code{/=} @var{divisor} @tab Divide the value of @var{lvalue} by @var{divisor}.
+@item @var{lvalue} @code{%=} @var{modulus} @tab Set @var{lvalue} to its remainder by @var{modulus}.
@cindex common extensions, @code{**=} operator
@cindex extensions, common@comma{} @code{**=} operator
@cindex @command{awk} language, POSIX version
@cindex POSIX @command{awk}
-@item @var{lvalue} @code{^=} @var{power} @tab
-@item @var{lvalue} @code{**=} @var{power} @tab Raise @var{lvalue} to the power @var{power} @value{COMMONEXT}
+@item @var{lvalue} @code{^=} @var{power} @tab Raise @var{lvalue} to the power @var{power}.
+@item @var{lvalue} @code{**=} @var{power} @tab Raise @var{lvalue} to the power @var{power}. @value{COMMONEXT}
@end multitable
@end float
@@ -11853,16 +11787,11 @@ awk '/[=]=/' /dev/null
and @command{mawk} also do not.
@end cartouche
@end ifnotdocbook
-@c ENDOFRANGE exas
-@c ENDOFRANGE opas
-@c ENDOFRANGE asop
@node Increment Ops
@subsection Increment and Decrement Operators
-@c STARTOFRANGE inop
@cindex increment operators
-@c STARTOFRANGE opde
@cindex operators, decrement/increment
@dfn{Increment} and @dfn{decrement operators} increase or decrease the value of
a variable by one. An assignment operator can do the same thing, so
@@ -11910,7 +11839,6 @@ just like variables. (Use @samp{$(i++)} when you want to do a field reference
and a variable increment at the same time. The parentheses are necessary
because of the precedence of the field reference operator @samp{$}.)
-@c STARTOFRANGE deop
@cindex decrement operators
The decrement operator @samp{--} works just like @samp{++}, except that
it subtracts one instead of adding it. As with @samp{++}, it can be used before
@@ -11955,8 +11883,8 @@ like @samp{@var{lvalue}++}, but instead of adding, it subtracts.)
@cindex evaluation order
@cindex Marx, Groucho
@quotation
-@i{Doctor, doctor! It hurts when I do this!@*
-So don't do that!}
+@i{Doctor, it hurts when I do this!@*
+Then don't do that!}
@author Groucho Marx
@end quotation
@@ -11980,7 +11908,7 @@ print b
@cindex side effects
In other words, when do the various side effects prescribed by the
postfix operators (@samp{b++}) take effect?
-When side effects happen is @dfn{implementation defined}.
+When side effects happen is @dfn{implementation-defined}.
In other words, it is up to the particular version of @command{awk}.
The result for the first example may be 12 or 13, and for the second, it
may be 22 or 23.
@@ -12007,8 +11935,8 @@ You should avoid such things in your own programs.
@cindex evaluation order
@cindex Marx, Groucho
@quotation
-@i{Doctor, doctor! It hurts when I do this!@*
-So don't do that!}
+@i{Doctor, it hurts when I do this!@*
+Then don't do that!}
@author Groucho Marx
@end quotation
@@ -12032,7 +11960,7 @@ print b
@cindex side effects
In other words, when do the various side effects prescribed by the
postfix operators (@samp{b++}) take effect?
-When side effects happen is @dfn{implementation defined}.
+When side effects happen is @dfn{implementation-defined}.
In other words, it is up to the particular version of @command{awk}.
The result for the first example may be 12 or 13, and for the second, it
may be 22 or 23.
@@ -12044,15 +11972,12 @@ You should avoid such things in your own programs.
@c in the mirror in the morning.
@end cartouche
@end ifnotdocbook
-@c ENDOFRANGE inop
-@c ENDOFRANGE opde
-@c ENDOFRANGE deop
@node Truth Values and Conditions
@section Truth Values and Conditions
-In certain contexts, expression values also serve as ``truth values''; (i.e.,
-they determine what should happen next as the program runs). This
+In certain contexts, expression values also serve as ``truth values''; i.e.,
+they determine what should happen next as the program runs. This
@value{SECTION} describes how @command{awk} defines ``true'' and ``false''
and how values are compared.
@@ -12111,19 +12036,15 @@ the string constant @code{"0"} is actually true, because it is non-null.
@author Douglas Adams, @cite{The Hitchhiker's Guide to the Galaxy}
@end quotation
-@c STARTOFRANGE comex
@cindex comparison expressions
-@c STARTOFRANGE excom
@cindex expressions, comparison
@cindex expressions, matching, See comparison expressions
@cindex matching, expressions, See comparison expressions
@cindex relational operators, See comparison operators
@cindex operators, relational, See operators@comma{} comparison
-@c STARTOFRANGE varting
@cindex variable typing
-@c STARTOFRANGE vartypc
@cindex variables, types of, comparison expressions and
-Unlike other programming languages, @command{awk} variables do not have a
+Unlike in other programming languages, in @command{awk} variables do not have a
fixed type. Instead, they can be either a number or a string, depending
upon the value that is assigned to them.
We look now at how variables are typed, and how @command{awk}
@@ -12152,20 +12073,20 @@ Variable typing follows these rules:
@itemize @value{BULLET}
@item
-A numeric constant or the result of a numeric operation has the @var{numeric}
+A numeric constant or the result of a numeric operation has the @dfn{numeric}
attribute.
@item
-A string constant or the result of a string operation has the @var{string}
+A string constant or the result of a string operation has the @dfn{string}
attribute.
@item
Fields, @code{getline} input, @code{FILENAME}, @code{ARGV} elements,
@code{ENVIRON} elements, and the elements of an array created by
@code{match()}, @code{split()}, and @code{patsplit()} that are numeric
-strings have the @var{strnum} attribute. Otherwise, they have
-the @var{string} attribute. Uninitialized variables also have the
-@var{strnum} attribute.
+strings have the @dfn{strnum} attribute. Otherwise, they have
+the @dfn{string} attribute. Uninitialized variables also have the
+@dfn{strnum} attribute.
@item
Attributes propagate across assignments but are not changed by
@@ -12309,13 +12230,13 @@ constant, then a string comparison is performed. Otherwise, a
numeric comparison is performed.
This point bears additional emphasis: All user input is made of characters,
-and so is first and foremost of @var{string} type; input strings
-that look numeric are additionally given the @var{strnum} attribute.
+and so is first and foremost of string type; input strings
+that look numeric are additionally given the strnum attribute.
Thus, the six-character input string @w{@samp{ +3.14}} receives the
-@var{strnum} attribute. In contrast, the eight characters
+strnum attribute. In contrast, the eight characters
@w{@code{" +3.14"}} appearing in program text comprise a string constant.
The following examples print @samp{1} when the comparison between
-the two different constants is true, @samp{0} otherwise:
+the two different constants is true, and @samp{0} otherwise:
@c 22.9.2014: Tested with mawk and BWK awk, got same results.
@example
@@ -12445,7 +12366,7 @@ $ @kbd{echo 1e2 3 | awk '@{ print ($1 < $2) ? "true" : "false" @}'}
@noindent
the result is @samp{false} because both @code{$1} and @code{$2}
are user input. They are numeric strings---therefore both have
-the @var{strnum} attribute, dictating a numeric comparison.
+the strnum attribute, dictating a numeric comparison.
The purpose of the comparison rules and the use of numeric strings is
to attempt to produce the behavior that is ``least surprising,'' while
still ``doing the right thing.''
@@ -12504,7 +12425,7 @@ characters sort, as defined by the locale (for more discussion,
@pxref{Locales}). This order is usually very different
from the results obtained when doing straight character-by-character
comparison.@footnote{Technically, string comparison is supposed
-to behave the same way as if the strings are compared with the C
+to behave the same way as if the strings were compared with the C
@code{strcoll()} function.}
Because this behavior differs considerably from existing practice,
@@ -12521,19 +12442,13 @@ $ @kbd{gawk --posix 'BEGIN @{ printf("ABC < abc = %s\n",}
@print{} ABC < abc = FALSE
@end example
-@c ENDOFRANGE comex
-@c ENDOFRANGE excom
-@c ENDOFRANGE vartypc
-@c ENDOFRANGE varting
@node Boolean Ops
@subsection Boolean Expressions
@cindex and Boolean-logic operator
@cindex or Boolean-logic operator
@cindex not Boolean-logic operator
-@c STARTOFRANGE exbo
@cindex expressions, Boolean
-@c STARTOFRANGE boex
@cindex Boolean expressions
@cindex operators, Boolean, See Boolean expressions
@cindex Boolean operators, See Boolean expressions
@@ -12617,7 +12532,7 @@ BEGIN @{ if (! ("HOME" in ENVIRON))
@cindex vertical bar (@code{|}), @code{||} operator
The @samp{&&} and @samp{||} operators are called @dfn{short-circuit}
operators because of the way they work. Evaluation of the full expression
-is ``short-circuited'' if the result can be determined part way through
+is ``short-circuited'' if the result can be determined partway through
its evaluation.
@cindex line continuations
@@ -12679,8 +12594,6 @@ next record, and start processing the rules over again at the top.
The reason it's there is to avoid printing the bracketing
@samp{START} and @samp{END} lines.
@end quotation
-@c ENDOFRANGE exbo
-@c ENDOFRANGE boex
@node Conditional Exp
@subsection Conditional Expressions
@@ -12691,8 +12604,8 @@ The reason it's there is to avoid printing the bracketing
A @dfn{conditional expression} is a special kind of expression that has
three operands. It allows you to use one expression's value to select
one of two other expressions.
-The conditional expression is the same as in the C language,
-as shown here:
+The conditional expression in @command{awk} is the same as in the C
+language, as shown here:
@example
@var{selector} ? @var{if-true-exp} : @var{if-false-exp}
@@ -12701,8 +12614,8 @@ as shown here:
@noindent
There are three subexpressions. The first, @var{selector}, is always
computed first. If it is ``true'' (not zero or not null), then
-@var{if-true-exp} is computed next and its value becomes the value of
-the whole expression. Otherwise, @var{if-false-exp} is computed next
+@var{if-true-exp} is computed next, and its value becomes the value of
+the whole expression. Otherwise, @var{if-false-exp} is computed next,
and its value becomes the value of the whole expression.
For example, the following expression produces the absolute value of @code{x}:
@@ -12750,7 +12663,7 @@ ask for it by name at any point in the program. For
example, the function @code{sqrt()} computes the square root of a number.
@cindex functions, built-in
-A fixed set of functions are @dfn{built-in}, which means they are
+A fixed set of functions are @dfn{built in}, which means they are
available in every @command{awk} program. The @code{sqrt()} function is one
of these. @DBXREF{Built-in} for a list of built-in
functions and their descriptions. In addition, you can define
@@ -12859,9 +12772,7 @@ $ @kbd{awk -f matchit.awk}
@node Precedence
@section Operator Precedence (How Operators Nest)
-@c STARTOFRANGE prec
@cindex precedence
-@c STARTOFRANGE oppr
@cindex operators, precedence
@dfn{Operator precedence} determines how operators are grouped when
@@ -12926,7 +12837,7 @@ Increment, decrement.
@cindex @code{*} (asterisk), @code{**} operator
@cindex asterisk (@code{*}), @code{**} operator
@item @code{^ **}
-Exponentiation. These operators group right-to-left.
+Exponentiation. These operators group right to left.
@cindex @code{+} (plus sign), @code{+} operator
@cindex plus sign (@code{+}), @code{+} operator
@@ -12992,7 +12903,7 @@ statements belong to the statement level, not to expressions. The
redirection does not produce an expression that could be the operand of
another operator. As a result, it does not make sense to use a
redirection operator near another operator of lower precedence without
-parentheses. Such combinations (e.g., @samp{print foo > a ? b : c}),
+parentheses. Such combinations (e.g., @samp{print foo > a ? b : c})
result in syntax errors.
The correct way to write this statement is @samp{print foo > (a ? b : c)}.
@@ -13010,17 +12921,17 @@ Array membership.
@cindex @code{&} (ampersand), @code{&&} operator
@cindex ampersand (@code{&}), @code{&&} operator
@item @code{&&}
-Logical ``and''.
+Logical ``and.''
@cindex @code{|} (vertical bar), @code{||} operator
@cindex vertical bar (@code{|}), @code{||} operator
@item @code{||}
-Logical ``or''.
+Logical ``or.''
@cindex @code{?} (question mark), @code{?:} operator
@cindex question mark (@code{?}), @code{?:} operator
@item @code{?:}
-Conditional. This operator groups right-to-left.
+Conditional. This operator groups right to left.
@cindex @code{+} (plus sign), @code{+=} operator
@cindex plus sign (@code{+}), @code{+=} operator
@@ -13037,7 +12948,7 @@ Conditional. This operator groups right-to-left.
@cindex @code{^} (caret), @code{^=} operator
@cindex caret (@code{^}), @code{^=} operator
@item @code{= += -= *= /= %= ^= **=}
-Assignment. These operators group right-to-left.
+Assignment. These operators group right to left.
@end table
@cindex POSIX @command{awk}, @code{**} operator and
@@ -13046,8 +12957,6 @@ Assignment. These operators group right-to-left.
The @samp{|&}, @samp{**}, and @samp{**=} operators are not specified by POSIX.
For maximum portability, do not use them.
@end quotation
-@c ENDOFRANGE prec
-@c ENDOFRANGE oppr
@node Locales
@section Where You Are Makes a Difference
@@ -13113,8 +13022,8 @@ Locales can influence the conversions.
@item
@command{awk} provides the usual arithmetic operators (addition,
subtraction, multiplication, division, modulus), and unary plus and minus.
-It also provides comparison operators, boolean operators, array membership
-testing, and regexp
+It also provides comparison operators, Boolean operators, an array membership
+testing operator, and regexp
matching operators. String concatenation is accomplished by placing
two expressions next to each other; there is no explicit operator.
The three-operand @samp{?:} operator provides an ``if-else'' test within
@@ -13125,7 +13034,7 @@ Assignment operators provide convenient shorthands for common arithmetic
operations.
@item
-In @command{awk}, a value is considered to be true if it is non-zero
+In @command{awk}, a value is considered to be true if it is nonzero
@emph{or} non-null. Otherwise, the value is false.
@item
@@ -13134,7 +13043,7 @@ lifetime. The type determines how it behaves in comparisons (string
or numeric).
@item
-Function calls return a value which may be used as part of a larger
+Function calls return a value that may be used as part of a larger
expression. Expressions used to pass parameter values are fully
evaluated before the function is called. @command{awk} provides
built-in and user-defined functions; this is described in
@@ -13151,11 +13060,9 @@ program, and occasionally the format for data read as input.
@end itemize
-@c ENDOFRANGE exps
@node Patterns and Actions
@chapter Patterns, Actions, and Variables
-@c STARTOFRANGE pat
@cindex patterns
As you have already seen, each @command{awk} statement consists of
@@ -13163,7 +13070,7 @@ a pattern with an associated action. This @value{CHAPTER} describes how
you build patterns and actions, what kinds of things you can do within
actions, and @command{awk}'s predefined variables.
-The pattern-action rules and the statements available for use
+The pattern--action rules and the statements available for use
within actions form the core of @command{awk} programming.
In a sense, everything covered
up to here has been the foundation
@@ -13354,7 +13261,7 @@ patterns. Likewise, the special patterns @code{BEGIN}, @code{END},
which never match any input record, are not expressions and cannot
appear inside Boolean patterns.
-The precedence of the different operators which can appear in
+The precedence of the different operators that can appear in
patterns is described in @ref{Precedence}.
@node Ranges
@@ -13380,7 +13287,7 @@ prints every record in @file{myfile} between @samp{on}/@samp{off} pairs, inclusi
A range pattern starts out by matching @var{begpat} against every
input record. When a record matches @var{begpat}, the range pattern is
-@dfn{turned on} and the range pattern matches this record as well. As long as
+@dfn{turned on}, and the range pattern matches this record as well. As long as
the range pattern stays turned on, it automatically matches every input
record read. The range pattern also matches @var{endpat} against every
input record; when this succeeds, the range pattern is @dfn{turned off} again
@@ -13451,9 +13358,7 @@ a range pattern. @value{DARKCORNER}
@node BEGIN/END
@subsection The @code{BEGIN} and @code{END} Special Patterns
-@c STARTOFRANGE beg
@cindex @code{BEGIN} pattern
-@c STARTOFRANGE end
@cindex @code{END} pattern
All the patterns described so far are for matching input records.
The @code{BEGIN} and @code{END} special patterns are different.
@@ -13526,7 +13431,7 @@ using library functions.
for a number of useful library functions.
If an @command{awk} program has only @code{BEGIN} rules and no
-other rules, then the program exits after the @code{BEGIN} rule is
+other rules, then the program exits after the @code{BEGIN} rules are
run.@footnote{The original version of @command{awk} kept
reading and ignoring input until the end of the file was seen.} However, if an
@code{END} rule exists, then the input is read, even if there are
@@ -13554,7 +13459,7 @@ Another way is simply to assign a value to @code{$0}.
@cindex @code{print} statement, @code{BEGIN}/@code{END} patterns and
@cindex @code{BEGIN} pattern, @code{print} statement and
@cindex @code{END} pattern, @code{print} statement and
-The second point is similar to the first but from the other direction.
+The second point is similar to the first, but from the other direction.
Traditionally, due largely to implementation issues, @code{$0} and
@code{NF} were @emph{undefined} inside an @code{END} rule.
The POSIX standard specifies that @code{NF} is available in an @code{END}
@@ -13591,8 +13496,6 @@ are not valid in an @code{END} rule, because all the input has been read.
@ifdocbook
@DBREF{Nextfile Statement}.)
@end ifdocbook
-@c ENDOFRANGE beg
-@c ENDOFRANGE end
@node BEGINFILE/ENDFILE
@subsection The @code{BEGINFILE} and @code{ENDFILE} Special Patterns
@@ -13645,7 +13548,7 @@ fatal error.
@item
If you have written extensions that modify the record handling (by
-inserting an ``input parser,'' @pxref{Input Parsers}), you can invoke
+inserting an ``input parser''; @pxref{Input Parsers}), you can invoke
them at this point, before @command{gawk} has started processing the file.
(This is a @emph{very} advanced feature, currently used only by the
@uref{http://gawkextlib.sourceforge.net, @code{gawkextlib} project}.)
@@ -13656,8 +13559,8 @@ the last record in an input file. For the last input file,
it will be called before any @code{END} rules.
The @code{ENDFILE} rule is executed even for empty input files.
-Normally, when an error occurs when reading input in the normal input
-processing loop, the error is fatal. However, if an @code{ENDFILE}
+Normally, when an error occurs when reading input in the normal
+input-processing loop, the error is fatal. However, if an @code{ENDFILE}
rule is present, the error becomes non-fatal, and instead @code{ERRNO}
is set. This makes it possible to catch and process I/O errors at the
level of the @command{awk} program.
@@ -13666,7 +13569,7 @@ level of the @command{awk} program.
The @code{next} statement (@pxref{Next Statement}) is not allowed inside
either a @code{BEGINFILE} or an @code{ENDFILE} rule. The @code{nextfile}
statement is allowed only inside a
-@code{BEGINFILE} rule, but not inside an @code{ENDFILE} rule.
+@code{BEGINFILE} rule, not inside an @code{ENDFILE} rule.
@cindex @code{getline} statement, @code{BEGINFILE}/@code{ENDFILE} patterns and
The @code{getline} statement (@pxref{Getline}) is restricted inside
@@ -13713,7 +13616,6 @@ awk '@{ print $1 @}' mail-list
@noindent
prints the first field of every record.
-@c ENDOFRANGE pat
@node Using Shell Variables
@section Using Shell Variables in Programs
@@ -13743,11 +13645,11 @@ awk "/$pattern/ "'@{ nmatches++ @}
@noindent
The @command{awk} program consists of two pieces of quoted text
that are concatenated together to form the program.
-The first part is double quoted, which allows substitution of
+The first part is double-quoted, which allows substitution of
the @code{pattern} shell variable inside the quotes.
-The second part is single quoted.
+The second part is single-quoted.
-Variable substitution via quoting works, but can be potentially
+Variable substitution via quoting works, but can potentially be
messy. It requires a good understanding of the shell's quoting rules
(@pxref{Quoting}),
and it's often difficult to correctly
@@ -13862,11 +13764,8 @@ For deleting array elements.
@node Statements
@section Control Statements in Actions
-@c STARTOFRANGE csta
@cindex control statements
-@c STARTOFRANGE acs
@cindex statements, control, in actions
-@c STARTOFRANGE accs
@cindex actions, control statements in
@dfn{Control statements}, such as @code{if}, @code{while}, and so on,
@@ -14009,13 +13908,13 @@ The body of this loop is a compound statement enclosed in braces,
containing two statements.
The loop works in the following manner: first, the value of @code{i} is set to one.
Then, the @code{while} statement tests whether @code{i} is less than or equal to
-three. This is true when @code{i} equals one, so the @code{i}-th
+three. This is true when @code{i} equals one, so the @code{i}th
field is printed. Then the @samp{i++} increments the value of @code{i}
and the loop repeats. The loop terminates when @code{i} reaches four.
A newline is not required between the condition and the
body; however, using one makes the program clearer unless the body is a
-compound statement or else is very simple. The newline after the open-brace
+compound statement or else is very simple. The newline after the open brace
that begins the compound statement is not required either, but the
program is harder to read without it.
@@ -14045,9 +13944,9 @@ while (@var{condition})
@end example
@noindent
-This statement does not execute @var{body} even once if the @var{condition}
-is false to begin with.
-The following is an example of a @code{do} statement:
+This statement does not execute the @var{body} even once if the
+@var{condition} is false to begin with. The following is an example of
+a @code{do} statement:
@example
@{
@@ -14114,7 +14013,7 @@ their assignments as separate statements preceding the @code{for} loop.)
The same is true of the @var{increment} part. Incrementing additional
variables requires separate statements at the end of the loop.
The C compound expression, using C's comma operator, is useful in
-this context but it is not supported in @command{awk}.
+this context, but it is not supported in @command{awk}.
Most often, @var{increment} is an increment expression, as in the previous
example. But this is not required; it can be any expression
@@ -14205,7 +14104,7 @@ default:
Control flow in
the @code{switch} statement works as it does in C. Once a match to a given
case is made, the case statement bodies execute until a @code{break},
-@code{continue}, @code{next}, @code{nextfile} or @code{exit} is encountered,
+@code{continue}, @code{next}, @code{nextfile}, or @code{exit} is encountered,
or the end of the @code{switch} statement itself. For example:
@example
@@ -14379,7 +14278,12 @@ body of a loop. Historical versions of @command{awk} treated a @code{continue}
statement outside a loop the same way they treated a @code{break}
statement outside a loop: as if it were a @code{next}
statement
+@ifset FOR_PRINT
+(discussed in the following section).
+@end ifset
+@ifclear FOR_PRINT
(@pxref{Next Statement}).
+@end ifclear
@value{DARKCORNER}
Recent versions of BWK @command{awk} no longer work this way, nor
does @command{gawk}.
@@ -14507,7 +14411,7 @@ See @uref{http://austingroupbugs.net/view.php?id=607, the Austin Group website}.
@cindex @code{nextfile} statement, user-defined functions and
@cindex Brian Kernighan's @command{awk}
@cindex @command{mawk} utility
-The current version of BWK @command{awk}, and @command{mawk}
+The current version of BWK @command{awk} and @command{mawk}
also support @code{nextfile}. However, they don't allow the
@code{nextfile} statement inside function bodies (@pxref{User-defined}).
@command{gawk} does; a @code{nextfile} inside a function body reads the
@@ -14545,7 +14449,7 @@ any @code{ENDFILE} rules; they do not execute.
In such a case,
if you don't want the @code{END} rule to do its job, set a variable
-to nonzero before the @code{exit} statement and check that variable in
+to a nonzero value before the @code{exit} statement and check that variable in
the @code{END} rule.
@DBXREF{Assert Function}
for an example that does this.
@@ -14584,15 +14488,10 @@ Negative values, and values of 127 or greater, may not produce consistent
results across different operating systems.
@end quotation
-@c ENDOFRANGE csta
-@c ENDOFRANGE acs
-@c ENDOFRANGE accs
@node Built-in Variables
@section Predefined Variables
-@c STARTOFRANGE bvar
@cindex predefined variables
-@c STARTOFRANGE varb
@cindex variables, predefined
Most @command{awk} variables are available to use for your own
@@ -14618,10 +14517,8 @@ their areas of activity.
@end menu
@node User-modified
-@subsection Built-In Variables That Control @command{awk}
-@c STARTOFRANGE bvaru
+@subsection Built-in Variables That Control @command{awk}
@cindex predefined variables, user-modifiable
-@c STARTOFRANGE nmbv
@cindex user-modifiable variables
The following is an alphabetical list of variables that you can change to
@@ -14649,7 +14546,7 @@ respectively, should use binary I/O. A string value of @code{"rw"} or
@code{"wr"} indicates that all files should use binary I/O. Any other
string value is treated the same as @code{"rw"}, but causes @command{gawk}
to generate a warning message. @code{BINMODE} is described in more
-detail in @ref{PC Using}. @command{mawk} (@pxref{Other Versions}),
+detail in @ref{PC Using}. @command{mawk} (@pxref{Other Versions})
also supports this variable, but only using numeric values.
@cindex @code{CONVFMT} variable
@@ -14657,7 +14554,7 @@ also supports this variable, but only using numeric values.
@cindex numbers, converting, to strings
@cindex strings, converting, numbers to
@item @code{CONVFMT}
-This string controls conversion of numbers to
+A string that controls the conversion of numbers to
strings (@pxref{Conversion}).
It works by being passed, in effect, as the first argument to the
@code{sprintf()} function
@@ -14732,7 +14629,7 @@ is to simply say @samp{FS = FS}, perhaps with an explanatory comment.
@cindex regular expressions, case sensitivity
@item IGNORECASE #
If @code{IGNORECASE} is nonzero or non-null, then all string comparisons
-and all regular expression matching are case independent. Thus, regexp
+and all regular expression matching are case-independent. Thus, regexp
matching with @samp{~} and @samp{!~}, as well as the @code{gensub()},
@code{gsub()}, @code{index()}, @code{match()}, @code{patsplit()},
@code{split()}, and @code{sub()}
@@ -14758,7 +14655,7 @@ Any other true value prints nonfatal warnings.
Assigning a false value to @code{LINT} turns off the lint warnings.
This variable is a @command{gawk} extension. It is not special
-in other @command{awk} implementations. Unlike the other special variables,
+in other @command{awk} implementations. Unlike with the other special variables,
changing @code{LINT} does affect the production of lint warnings,
even if @command{gawk} is in compatibility mode. Much as
the @option{--lint} and @option{--traditional} options independently
@@ -14770,7 +14667,7 @@ of @command{awk} being executed.
@cindex numbers, converting, to strings
@cindex strings, converting, numbers to
@item OFMT
-Controls conversion of numbers to
+A string that controls conversion of numbers to
strings (@pxref{Conversion}) for
printing with the @code{print} statement. It works by being passed
as the first argument to the @code{sprintf()} function
@@ -14785,7 +14682,7 @@ strings in general expressions; this is now done by @code{CONVFMT}.
@cindex separators, field
@cindex field separators
@item OFS
-This is the output field separator (@pxref{Output Separators}). It is
+The output field separator (@pxref{Output Separators}). It is
output between the fields printed by a @code{print} statement. Its
default value is @w{@code{" "}}, a string consisting of a single space.
@@ -14803,7 +14700,7 @@ The working precision of arbitrary-precision floating-point numbers,
@cindex @code{ROUNDMODE} variable
@item ROUNDMODE #
The rounding mode to use for arbitrary-precision arithmetic on
-numbers, by default @code{"N"} (@samp{roundTiesToEven} in
+numbers, by default @code{"N"} (@code{roundTiesToEven} in
the IEEE 754 standard; @pxref{Setting the rounding mode}).
@cindex @code{RS} variable
@@ -14832,7 +14729,7 @@ just the first character of @code{RS}'s value is used.
@item @code{SUBSEP}
The subscript separator. It has the default value of
@code{"\034"} and is used to separate the parts of the indices of a
-multidimensional array. Thus, the expression @code{@w{foo["A", "B"]}}
+multidimensional array. Thus, the expression @samp{@w{foo["A", "B"]}}
really accesses @code{foo["A\034B"]}
(@pxref{Multidimensional}).
@@ -14848,17 +14745,11 @@ marked string constants in the source text, as well as for the
(@pxref{Internationalization}).
The default value of @code{TEXTDOMAIN} is @code{"messages"}.
@end table
-@c ENDOFRANGE bvar
-@c ENDOFRANGE varb
-@c ENDOFRANGE bvaru
-@c ENDOFRANGE nmbv
@node Auto-set
-@subsection Built-In Variables That Convey Information
+@subsection Built-in Variables That Convey Information
-@c STARTOFRANGE bvconi
@cindex predefined variables, conveying information
-@c STARTOFRANGE vbconi
@cindex variables, predefined conveying information
The following is an alphabetical list of variables that @command{awk}
sets automatically on certain occasions in order to provide
@@ -15019,12 +14910,12 @@ input file.
@item @code{NF}
The number of fields in the current input record.
@code{NF} is set each time a new record is read, when a new field is
-created or when @code{$0} changes (@pxref{Fields}).
+created, or when @code{$0} changes (@pxref{Fields}).
Unlike most of the variables described in this @value{SUBSECTION},
assigning a value to @code{NF} has the potential to affect
@command{awk}'s internal workings. In particular, assignments
-to @code{NF} can be used to create or remove fields from the
+to @code{NF} can be used to create fields in or remove fields from the
current record. @xref{Changing Fields}.
@cindex @code{FUNCTAB} array
@@ -15078,7 +14969,7 @@ or @code{"FPAT"} if field matching with @code{FPAT} is in effect.
@item PROCINFO["identifiers"]
@cindex program identifiers
A subarray, indexed by the names of all identifiers used in the text of
-the AWK program. An @dfn{identifier} is simply the name of a variable
+the @command{awk} program. An @dfn{identifier} is simply the name of a variable
(be it scalar or array), built-in function, user-defined function, or
extension function. For each identifier, the value of the element is
one of the following:
@@ -15098,7 +14989,7 @@ The identifier is an extension function loaded via
The identifier is a scalar.
@item "untyped"
-The identifier is untyped (could be used as a scalar or array,
+The identifier is untyped (could be used as a scalar or an array;
@command{gawk} doesn't know yet).
@item "user"
@@ -15224,7 +15115,7 @@ is the length of the matched string, or @minus{}1 if no match is found.
@cindex @code{RSTART} variable
@item @code{RSTART}
-The start-index in characters of the substring that is matched by the
+The start index in characters of the substring that is matched by the
@code{match()} function
(@pxref{String Functions}).
@code{RSTART} is set by invoking the @code{match()} function. Its value
@@ -15291,11 +15182,9 @@ function multiply(variable, amount)
@quotation NOTE
In order to avoid severe time-travel paradoxes,@footnote{Not to mention difficult
implementation issues.} neither @code{FUNCTAB} nor @code{SYMTAB}
-are available as elements within the @code{SYMTAB} array.
+is available as an element within the @code{SYMTAB} array.
@end quotation
@end table
-@c ENDOFRANGE bvconi
-@c ENDOFRANGE vbconi
@cindex sidebar, Changing @code{NR} and @code{FNR}
@ifdocbook
@@ -15513,7 +15402,7 @@ When designing your program, you should choose options that don't
conflict with @command{gawk}'s, because it will process any options
that it accepts before passing the rest of the command line on to
your program. Using @samp{#!} with the @option{-E} option may help
-(@DBXREF{Executable Scripts}
+(@DBPXREF{Executable Scripts}
and
@ifnotdocbook
@DBPXREF{Options}).
@@ -15527,15 +15416,15 @@ and
@itemize @value{BULLET}
@item
-Pattern-action pairs make up the basic elements of an @command{awk}
+Pattern--action pairs make up the basic elements of an @command{awk}
program. Patterns are either normal expressions, range expressions,
-regexp constants, one of the special keywords @code{BEGIN}, @code{END},
-@code{BEGINFILE}, @code{ENDFILE}, or empty. The action executes if
+or regexp constants; one of the special keywords @code{BEGIN}, @code{END},
+@code{BEGINFILE}, or @code{ENDFILE}; or empty. The action executes if
the current record matches the pattern. Empty (missing) patterns match
all records.
@item
-I/O from @code{BEGIN} and @code{END} rules have certain constraints.
+I/O from @code{BEGIN} and @code{END} rules has certain constraints.
This is also true, only more so, for @code{BEGINFILE} and @code{ENDFILE}
rules. The latter two give you ``hooks'' into @command{gawk}'s file
processing, allowing you to recover from a file that otherwise would
@@ -15565,12 +15454,12 @@ iteration of a loop (or get out of a @code{switch}).
@item
@code{next} and @code{nextfile} let you read the next record and start
-over at the top of your program, or skip to the next input file and
+over at the top of your program or skip to the next input file and
start over, respectively.
@item
The @code{exit} statement terminates your program. When executed
-from an action (or function body) it transfers control to the
+from an action (or function body), it transfers control to the
@code{END} statements. From an @code{END} statement body, it exits
immediately. You may pass an optional numeric value to be used
as @command{awk}'s exit status.
@@ -15588,7 +15477,6 @@ control how @command{awk} will process the provided @value{DF}s.
@node Arrays
@chapter Arrays in @command{awk}
-@c STARTOFRANGE arrs
@cindex arrays
An @dfn{array} is a table of values called @dfn{elements}. The
@@ -15674,15 +15562,17 @@ the declaration.
indices---e.g., @samp{15 .. 27}---but the size of the array is still fixed when
the array is declared.)
-A contiguous array of four elements might look like the following example,
-conceptually, if the element values are 8, @code{"foo"},
-@code{""}, and 30
+@c 1/2015: Do not put the numeric values into @code. Array element
+@c values are no different than scalar variable values.
+A contiguous array of four elements might look like
@ifnotdocbook
-as shown in @ref{figure-array-elements}:
+@ref{figure-array-elements},
@end ifnotdocbook
@ifdocbook
-as shown in @inlineraw{docbook, <xref linkend="figure-array-elements"/>}:
+@inlineraw{docbook, <xref linkend="figure-array-elements"/>},
@end ifdocbook
+conceptually, if the element values are eight, @code{"foo"},
+@code{""}, and 30.
@ifnotdocbook
@float Figure,figure-array-elements
@@ -15707,12 +15597,10 @@ as shown in @inlineraw{docbook, <xref linkend="figure-array-elements"/>}:
@noindent
Only the values are stored; the indices are implicit from the order of
-the values. Here, 8 is the value at index zero, because 8 appears in the
+the values. Here, eight is the value at index zero, because eight appears in the
position with zero elements before it.
-@c STARTOFRANGE arrin
@cindex arrays, indexing
-@c STARTOFRANGE inarr
@cindex indexing arrays
@cindex associative arrays
@cindex arrays, associative
@@ -15721,19 +15609,21 @@ that each array is a collection of pairs---an index and its corresponding
array element value:
@ifnotdocbook
-@example
-@r{Index} 3 @r{Value} 30
-@r{Index} 1 @r{Value} "foo"
-@r{Index} 0 @r{Value} 8
-@r{Index} 2 @r{Value} ""
-@end example
+@c extra empty column to indent it right
+@multitable @columnfractions .1 .1 .1
+@headitem @tab Index @tab Value
+@item @tab @code{3} @tab @code{30}
+@item @tab @code{1} @tab @code{"foo"}
+@item @tab @code{0} @tab @code{8}
+@item @tab @code{2} @tab @code{""}
+@end multitable
@end ifnotdocbook
@docbook
<informaltable>
<tgroup cols="2">
-<colspec colname="1" align="center"/>
-<colspec colname="2" align="center"/>
+<colspec colname="1" align="left"/>
+<colspec colname="2" align="left"/>
<thead>
<row>
<entry>Index</entry>
@@ -15779,20 +15669,22 @@ at any time. For example, suppose a tenth element is added to the array
whose value is @w{@code{"number ten"}}. The result is:
@ifnotdocbook
-@example
-@r{Index} 10 @r{Value} "number ten"
-@r{Index} 3 @r{Value} 30
-@r{Index} 1 @r{Value} "foo"
-@r{Index} 0 @r{Value} 8
-@r{Index} 2 @r{Value} ""
-@end example
+@c extra empty column to indent it right
+@multitable @columnfractions .1 .1 .2
+@headitem @tab Index @tab Value
+@item @tab @code{10} @tab @code{"number ten"}
+@item @tab @code{3} @tab @code{30}
+@item @tab @code{1} @tab @code{"foo"}
+@item @tab @code{0} @tab @code{8}
+@item @tab @code{2} @tab @code{""}
+@end multitable
@end ifnotdocbook
@docbook
<informaltable>
<tgroup cols="2">
-<colspec colname="1" align="center"/>
-<colspec colname="2" align="center"/>
+<colspec colname="1" align="left"/>
+<colspec colname="2" align="left"/>
<thead>
<row>
<entry>Index</entry>
@@ -15844,19 +15736,20 @@ an index. For example, the following is an array that translates words from
English to French:
@ifnotdocbook
-@example
-@r{Index} "dog" @r{Value} "chien"
-@r{Index} "cat" @r{Value} "chat"
-@r{Index} "one" @r{Value} "un"
-@r{Index} 1 @r{Value} "un"
-@end example
+@multitable @columnfractions .1 .1 .1
+@headitem @tab Index @tab Value
+@item @tab @code{"dog"} @tab @code{"chien"}
+@item @tab @code{"cat"} @tab @code{"chat"}
+@item @tab @code{"one"} @tab @code{"un"}
+@item @tab @code{1} @tab @code{"un"}
+@end multitable
@end ifnotdocbook
@docbook
<informaltable>
<tgroup cols="2">
-<colspec colname="1" align="center"/>
-<colspec colname="2" align="center"/>
+<colspec colname="1" align="left"/>
+<colspec colname="2" align="left"/>
<thead>
<row>
<entry>Index</entry>
@@ -15898,7 +15791,7 @@ numbers and strings as indices.
There are some subtleties to how numbers work when used as
array subscripts; this is discussed in more detail in
@ref{Numeric Array Subscripts}.)
-Here, the number @code{1} isn't double quoted, because @command{awk}
+Here, the number @code{1} isn't double-quoted, because @command{awk}
automatically converts it to a string.
@cindex @command{gawk}, @code{IGNORECASE} variable in
@@ -15915,8 +15808,6 @@ that array's indices are consecutive integers starting at one.
@command{awk}'s arrays are efficient---the time to access an element
is independent of the number of elements in the array.
-@c ENDOFRANGE arrin
-@c ENDOFRANGE inarr
@node Reference to Elements
@subsection Referring to an Array Element
@@ -15925,7 +15816,7 @@ is independent of the number of elements in the array.
@cindex elements of arrays
The principal way to use an array is to refer to one of its elements.
-An array reference is an expression as follows:
+An @dfn{array reference} is an expression as follows:
@example
@var{array}[@var{index-expression}]
@@ -15935,8 +15826,11 @@ An array reference is an expression as follows:
Here, @var{array} is the name of an array. The expression @var{index-expression} is
the index of the desired element of the array.
+@c 1/2015: Having the 4.3 in @samp is a little iffy. It's essentially
+@c an expression though, so leave be. It's to early in the discussion
+@c to mention that it's really a string.
The value of the array reference is the current value of that array
-element. For example, @code{foo[4.3]} is an expression for the element
+element. For example, @code{foo[4.3]} is an expression referencing the element
of array @code{foo} at index @samp{4.3}.
@cindex arrays, unassigned elements
@@ -16028,7 +15922,7 @@ assign to that element of the array.
The following program takes a list of lines, each beginning with a line
number, and prints them out in order of line number. The line numbers
-are not in order when they are first read---instead they
+are not in order when they are first read---instead, they
are scrambled. This program sorts the lines by making an array using
the line numbers as subscripts. The program then prints out the lines
in sorted order of their numbers. It is a very simple program and gets
@@ -16122,7 +16016,7 @@ program has previously used, with the variable @var{var} set to that index.
The following program uses this form of the @code{for} statement. The
first rule scans the input records and notes which words appear (at
least once) in the input, by storing a one into the array @code{used} with
-the word as index. The second rule scans the elements of @code{used} to
+the word as the index. The second rule scans the elements of @code{used} to
find all the distinct words that appear in the input. It prints each
word that is more than 10 characters long and also prints the number of
such words.
@@ -16219,7 +16113,7 @@ and will vary from one version of @command{awk} to the next.
Often, though, you may wish to do something simple, such as
``traverse the array by comparing the indices in ascending order,''
or ``traverse the array by comparing the values in descending order.''
-@command{gawk} provides two mechanisms which give you this control.
+@command{gawk} provides two mechanisms that give you this control:
@itemize @value{BULLET}
@item
@@ -16276,21 +16170,26 @@ across different environments.} which @command{gawk} uses internally
to perform the sorting.
@item "@@ind_str_desc"
-String indices ordered from high to low.
+Like @code{"@@ind_str_asc"}, but the
+string indices are ordered from high to low.
@item "@@ind_num_desc"
-Numeric indices ordered from high to low.
+Like @code{"@@ind_num_asc"}, but the
+numeric indices are ordered from high to low.
@item "@@val_type_desc"
-Element values, based on type, ordered from high to low.
+Like @code{"@@val_type_asc"}, but the
+element values, based on type, are ordered from high to low.
Subarrays, if present, come out first.
@item "@@val_str_desc"
-Element values, treated as strings, ordered from high to low.
+Like @code{"@@val_str_asc"}, but the
+element values, treated as strings, are ordered from high to low.
Subarrays, if present, come out first.
@item "@@val_num_desc"
-Element values, treated as numbers, ordered from high to low.
+Like @code{"@@val_num_asc"}, but the
+element values, treated as numbers, are ordered from high to low.
Subarrays, if present, come out first.
@end table
@@ -16513,7 +16412,7 @@ for (i in frequencies)
@noindent
This example removes all the elements from the array @code{frequencies}.
Once an element is deleted, a subsequent @code{for} statement to scan the array
-does not report that element and the @code{in} operator to check for
+does not report that element and using the @code{in} operator to check for
the presence of that element returns zero (i.e., false):
@example
@@ -16773,7 +16672,7 @@ a[1][2] = 2
This simulates a true two-dimensional array. Each subarray element can
contain another subarray as a value, which in turn can hold other arrays
as well. In this way, you can create arrays of three or more dimensions.
-The indices can be any @command{awk} expression, including scalars
+The indices can be any @command{awk} expressions, including scalars
separated by commas (i.e., a regular @command{awk} simulated
multidimensional subscript). So the following is valid in
@command{gawk}:
@@ -16785,7 +16684,7 @@ a[1][3][1, "name"] = "barney"
Each subarray and the main array can be of different length. In fact, the
elements of an array or its subarray do not all have to have the same
type. This means that the main array and any of its subarrays can be
-non-rectangular, or jagged in structure. You can assign a scalar value to
+nonrectangular, or jagged in structure. You can assign a scalar value to
the index @code{4} of the main array @code{a}, even though @code{a[1]}
is itself an array and not a scalar:
@@ -16809,7 +16708,8 @@ a[4][5][6][7] = "An element in a four-dimensional array"
@noindent
This removes the scalar value from index @code{4} and then inserts a
-subarray of subarray of subarray containing a scalar. You can also
+three-level nested subarray
+containing a scalar. You can also
delete an entire subarray or subarray of subarrays:
@example
@@ -16820,7 +16720,7 @@ a[4][5] = "An element in subarray a[4]"
But recall that you can not delete the main array @code{a} and then use it
as a scalar.
-The built-in functions which take array arguments can also be used
+The built-in functions that take array arguments can also be used
with subarrays. For example, the following code fragment uses @code{length()}
(@pxref{String Functions})
to determine the number of elements in the main array @code{a} and
@@ -16850,7 +16750,7 @@ can be nested to scan all the
elements of an array of arrays if it is rectangular in structure. In order
to print the contents (scalar values) of a two-dimensional array of arrays
(i.e., in which each first-level element is itself an
-array, not necessarily of the same length)
+array, not necessarily of the same length),
you could use the following code:
@example
@@ -16950,9 +16850,9 @@ versions of @command{awk}.
@item
Standard @command{awk} simulates multidimensional arrays by separating
-subscript values with a comma. The values are concatenated into a
+subscript values with commas. The values are concatenated into a
single string, separated by the value of @code{SUBSEP}. The fact
-that such a subscript was created in this way is not retained; thus
+that such a subscript was created in this way is not retained; thus,
changing @code{SUBSEP} may have unexpected consequences. You can use
@samp{(@var{sub1}, @var{sub2}, @dots{}) in @var{array}} to see if such
a multidimensional subscript exists in @var{array}.
@@ -16961,7 +16861,7 @@ a multidimensional subscript exists in @var{array}.
@command{gawk} provides true arrays of arrays. You use a separate
set of square brackets for each dimension in such an array:
@code{data[row][col]}, for example. Array elements may thus be either
-scalar values (number or string) or another array.
+scalar values (number or string) or other arrays.
@item
Use the @code{isarray()} built-in function to determine if an array
@@ -16969,14 +16869,11 @@ element is itself a subarray.
@end itemize
-@c ENDOFRANGE arrs
@node Functions
@chapter Functions
-@c STARTOFRANGE funcbi
@cindex functions, built-in
-@c STARTOFRANGE bifunc
@cindex built-in functions
This @value{CHAPTER} describes @command{awk}'s built-in functions,
which fall into three categories: numeric, string, and I/O.
@@ -16989,6 +16886,9 @@ Besides the built-in functions, @command{awk} has provisions for
writing new functions that the rest of a program can use.
The second half of this @value{CHAPTER} describes these
@dfn{user-defined} functions.
+Finally, we explore indirect function calls, a @command{gawk}-specific
+extension that lets you determine at runtime what function is to
+be called.
@menu
* Built-in:: Summarizes the built-in functions.
@@ -16998,7 +16898,7 @@ The second half of this @value{CHAPTER} describes these
@end menu
@node Built-in
-@section Built-In Functions
+@section Built-in Functions
@dfn{Built-in} functions are always available for
your @command{awk} program to call. This @value{SECTION} defines all
@@ -17021,7 +16921,7 @@ but are summarized here for your convenience.
@end menu
@node Calling Built-in
-@subsection Calling Built-In Functions
+@subsection Calling Built-in Functions
To call one of @command{awk}'s built-in functions, write the name of
the function followed
@@ -17072,7 +16972,7 @@ j = atan2(++i, i *= 2)
@end example
If the order of evaluation is left to right, then @code{i} first becomes
-6, and then 12, and @code{atan2()} is called with the two arguments 6
+six, and then 12, and @code{atan2()} is called with the two arguments six
and 12. But if the order of evaluation is right to left, @code{i}
first becomes 10, then 11, and @code{atan2()} is called with the
two arguments 11 and 10.
@@ -17153,7 +17053,7 @@ In fact, @command{gawk} uses the BSD @code{random()} function, which is
considerably better than @code{rand()}, to produce random numbers.}
Often random integers are needed instead. Following is a user-defined function
-that can be used to obtain a random non-negative integer less than @var{n}:
+that can be used to obtain a random nonnegative integer less than @var{n}:
@example
function randint(n)
@@ -17248,7 +17148,7 @@ implementations.
The functions in this @value{SECTION} look at or change the text of one
or more strings.
-@code{gawk} understands locales (@pxref{Locales}), and does all
+@command{gawk} understands locales (@pxref{Locales}) and does all
string processing in terms of @emph{characters}, not @emph{bytes}.
This distinction is particularly important to understand for locales
where one character may be represented by multiple bytes. Thus, for
@@ -17337,7 +17237,7 @@ a[2] = "de"
a[3] = "sac"
@end example
-The @code{asorti()} function works similarly to @code{asort()}, however,
+The @code{asorti()} function works similarly to @code{asort()}; however,
the @emph{indices} are sorted, instead of the values. Thus, in the
previous example, starting with the same initial set of indices and
values in @code{a}, calling @samp{asorti(a)} would yield:
@@ -17452,7 +17352,7 @@ If @var{find} is not found, @code{index()} returns zero.
With BWK @command{awk} and @command{gawk},
it is a fatal error to use a regexp constant for @var{find}.
Other implementations allow it, simply treating the regexp
-constant as an expression meaning @samp{$0 ~ /regexp/}. @value{DARKCORNER}.
+constant as an expression meaning @samp{$0 ~ /regexp/}. @value{DARKCORNER}
@item @code{length(}[@var{string}]@code{)}
@cindexawkfunc{length}
@@ -17535,7 +17435,7 @@ If @option{--posix} is supplied, using an array argument is a fatal error
@cindex string, regular expression match
@cindex match regexp in string
Search @var{string} for the
-longest, leftmost substring matched by the regular expression,
+longest, leftmost substring matched by the regular expression
@var{regexp} and return the character position (index)
at which that substring begins (one, if it starts at the beginning of
@var{string}). If no match is found, return zero.
@@ -17547,7 +17447,7 @@ In the latter case, the string is treated as a regexp to be matched.
discussion of the difference between the two forms, and the
implications for writing your program correctly.
-The order of the first two arguments is backwards from most other string
+The order of the first two arguments is the opposite of most other string
functions that work with regular expressions, such as
@code{sub()} and @code{gsub()}. It might help to remember that
for @code{match()}, the order is the same as for the @samp{~} operator:
@@ -17636,7 +17536,7 @@ $ @kbd{echo foooobazbarrrrr |}
@end example
There may not be subscripts for the start and index for every parenthesized
-subexpression, because they may not all have matched text; thus they
+subexpression, because they may not all have matched text; thus, they
should be tested for with the @code{in} operator
(@pxref{Reference to Elements}).
@@ -17683,13 +17583,13 @@ a regexp describing where to split @var{string} (much as @code{FS} can
be a regexp describing where to split input records).
If @var{fieldsep} is omitted, the value of @code{FS} is used.
@code{split()} returns the number of elements created.
-@var{seps} is a @command{gawk} extension with @code{@var{seps}[@var{i}]}
+@var{seps} is a @command{gawk} extension, with @code{@var{seps}[@var{i}]}
being the separator string
between @code{@var{array}[@var{i}]} and @code{@var{array}[@var{i}+1]}.
If @var{fieldsep} is a single
-space then any leading whitespace goes into @code{@var{seps}[0]} and
+space, then any leading whitespace goes into @code{@var{seps}[0]} and
any trailing
-whitespace goes into @code{@var{seps}[@var{n}]} where @var{n} is the
+whitespace goes into @code{@var{seps}[@var{n}]}, where @var{n} is the
return value of
@code{split()} (i.e., the number of elements in @var{array}).
@@ -17702,7 +17602,7 @@ split("cul-de-sac", a, "-", seps)
@noindent
@cindex strings splitting, example
-splits the string @samp{cul-de-sac} into three fields using @samp{-} as the
+splits the string @code{"cul-de-sac"} into three fields using @samp{-} as the
separator. It sets the contents of the array @code{a} as follows:
@example
@@ -17727,19 +17627,18 @@ As with input field-splitting, when the value of @var{fieldsep} is
the elements of
@var{array} but not in @var{seps}, and the elements
are separated by runs of whitespace.
-Also, as with input field-splitting, if @var{fieldsep} is the null string, each
+Also, as with input field splitting, if @var{fieldsep} is the null string, each
individual character in the string is split into its own array element.
@value{COMMONEXT}
Note, however, that @code{RS} has no effect on the way @code{split()}
-works. Even though @samp{RS = ""} causes newline to also be an input
+works. Even though @samp{RS = ""} causes the newline character to also be an input
field separator, this does not affect how @code{split()} splits strings.
@cindex dark corner, @code{split()} function
Modern implementations of @command{awk}, including @command{gawk}, allow
-the third argument to be a regexp constant (@code{/abc/}) as well as a
-string.
-@value{DARKCORNER}
+the third argument to be a regexp constant (@w{@code{/}@dots{}@code{/}})
+as well as a string. @value{DARKCORNER}
The POSIX standard allows this as well.
@DBXREF{Computed Regexps} for a
discussion of the difference between using a string constant or a regexp constant,
@@ -17876,7 +17775,7 @@ an @samp{&}:
@cindex @code{sub()} function, arguments of
@cindex @code{gsub()} function, arguments of
As mentioned, the third argument to @code{sub()} must
-be a variable, field or array element.
+be a variable, field, or array element.
Some versions of @command{awk} allow the third argument to
be an expression that is not an lvalue. In such a case, @code{sub()}
still searches for the pattern and returns zero or one, but the result of
@@ -18068,8 +17967,8 @@ example, @code{"a\qb"} is treated as @code{"aqb"}.
At the runtime level, the various functions handle sequences of
@samp{\} and @samp{&} differently. The situation is (sadly) somewhat complex.
-Historically, the @code{sub()} and @code{gsub()} functions treated the two
-character sequence @samp{\&} specially; this sequence was replaced in
+Historically, the @code{sub()} and @code{gsub()} functions treated the
+two-character sequence @samp{\&} specially; this sequence was replaced in
the generated text with a single @samp{&}. Any other @samp{\} within
the @var{replacement} string that did not precede an @samp{&} was passed
through unchanged. This is illustrated in @ref{table-sub-escapes}.
@@ -18127,7 +18026,7 @@ _bigskip}
@end float
@noindent
-This table shows both the lexical-level processing, where
+This table shows the lexical-level processing, where
an odd number of backslashes becomes an even number at the runtime level,
as well as the runtime processing done by @code{sub()}.
(For the sake of simplicity, the rest of the following tables only show the
@@ -18148,7 +18047,7 @@ This is shown in
@ref{table-sub-proposed}.
@float Table,table-sub-proposed
-@caption{GNU @command{awk} rules for @code{sub()} and backslash}
+@caption{@command{gawk} rules for @code{sub()} and backslash}
@tex
\vbox{\bigskip
% We need more characters for escape and tab ...
@@ -18193,7 +18092,7 @@ _bigskip}
@end float
In a nutshell, at the runtime level, there are now three special sequences
-of characters (@samp{\\\&}, @samp{\\&} and @samp{\&}) whereas historically
+of characters (@samp{\\\&}, @samp{\\&}, and @samp{\&}) whereas historically
there was only one. However, as in the historical case, any @samp{\} that
is not part of one of these three sequences is not special and appears
in the output literally.
@@ -18259,7 +18158,7 @@ The only case where the difference is noticeable is the last one: @samp{\\\\}
is seen as @samp{\\} and produces @samp{\} instead of @samp{\\}.
Starting with @value{PVERSION} 3.1.4, @command{gawk} followed the POSIX rules
-when @option{--posix} is specified (@pxref{Options}). Otherwise,
+when @option{--posix} was specified (@pxref{Options}). Otherwise,
it continued to follow the proposed rules, as
that had been its behavior for many years.
@@ -18327,7 +18226,7 @@ _bigskip}
@end ifnottex
@end float
-Because of the complexity of the lexical and runtime level processing
+Because of the complexity of the lexical- and runtime-level processing
and the special cases for @code{sub()} and @code{gsub()},
we recommend the use of @command{gawk} and @code{gensub()} when you have
to do substitutions.
@@ -18353,6 +18252,7 @@ for more information.
When closing a coprocess, it is occasionally useful to first close
one end of the two-way pipe and then to close the other. This is done
by providing a second argument to @code{close()}. This second argument
+(@var{how})
should be one of the two string values @code{"to"} or @code{"from"},
indicating which end of the pipe to close. Case in the string does
not matter.
@@ -18379,7 +18279,7 @@ every little bit of information as soon as it is ready. However, sometimes
it is necessary to force a program to @dfn{flush} its buffers (i.e.,
write the information to its destination, even if a buffer is not full).
This is the purpose of the @code{fflush()} function---@command{gawk} also
-buffers its output and the @code{fflush()} function forces
+buffers its output, and the @code{fflush()} function forces
@command{gawk} to flush its buffers.
@cindex extensions, common@comma{} @code{fflush()} function
@@ -18400,7 +18300,7 @@ would flush only the standard output if there was no argument,
and flush all output files and pipes if the argument was the null
string. This was changed in order to be compatible with Brian
Kernighan's @command{awk}, in the hope that standardizing this
-feature in POSIX would then be easier (which indeed helped).
+feature in POSIX would then be easier (which indeed proved to be the case).
With @command{gawk},
you can use @samp{fflush("/dev/stdout")} if you wish to flush
@@ -18411,7 +18311,7 @@ only the standard output.
@c @cindex warnings, automatic
@cindex troubleshooting, @code{fflush()} function
@code{fflush()} returns zero if the buffer is successfully flushed;
-otherwise, it returns non-zero. (@command{gawk} returns @minus{}1.)
+otherwise, it returns a nonzero value. (@command{gawk} returns @minus{}1.)
In the case where all buffers are flushed, the return value is zero
only if all buffers were flushed successfully. Otherwise, it is
@minus{}1, and @command{gawk} warns about the problem @var{filename}.
@@ -18429,8 +18329,8 @@ In such a case, @code{fflush()} returns @minus{}1, as well.
@cindex buffering, interactive vs.@: noninteractive
-As a side point, buffering issues can be even more confusing, depending
-upon whether your program is @dfn{interactive} (i.e., communicating
+As a side point, buffering issues can be even more confusing if
+your program is @dfn{interactive} (i.e., communicating
with a user sitting at a keyboard).@footnote{A program is interactive
if the standard output is connected to a terminal device. On modern
systems, this means your keyboard and screen.}
@@ -18480,8 +18380,8 @@ it is all buffered and sent down the pipe to @command{cat} in one shot.
@cindex buffering, interactive vs.@: noninteractive
-As a side point, buffering issues can be even more confusing, depending
-upon whether your program is @dfn{interactive} (i.e., communicating
+As a side point, buffering issues can be even more confusing if
+your program is @dfn{interactive} (i.e., communicating
with a user sitting at a keyboard).@footnote{A program is interactive
if the standard output is connected to a terminal device. On modern
systems, this means your keyboard and screen.}
@@ -18525,7 +18425,7 @@ it is all buffered and sent down the pipe to @command{cat} in one shot.
@cindexawkfunc{system}
@cindex invoke shell command
@cindex interacting with other programs
-Execute the operating-system
+Execute the operating system
command @var{command} and then return to the @command{awk} program.
Return @var{command}'s exit status.
@@ -18700,18 +18600,14 @@ you would see the latter (undesirable) output.
@subsection Time Functions
@cindex time functions
-@c STARTOFRANGE tst
@cindex timestamps
-@c STARTOFRANGE logftst
@cindex log files, timestamps in
-@c STARTOFRANGE filogtst
@cindex files, log@comma{} timestamps in
-@c STARTOFRANGE gawtst
@cindex @command{gawk}, timestamps
@cindex POSIX @command{awk}, timestamps and
-@code{awk} programs are commonly used to process log files
+@command{awk} programs are commonly used to process log files
containing timestamp information, indicating when a
-particular log record was written. Many programs log their timestamp
+particular log record was written. Many programs log their timestamps
in the form returned by the @code{time()} system call, which is the
number of seconds since a particular epoch. On POSIX-compliant systems,
it is the number of seconds since
@@ -18772,7 +18668,7 @@ The values of these numbers need not be within the ranges specified;
for example, an hour of @minus{}1 means 1 hour before midnight.
The origin-zero Gregorian calendar is assumed, with year 0 preceding
year 1 and year @minus{}1 preceding year 0.
-The time is assumed to be in the local timezone.
+The time is assumed to be in the local time zone.
If the daylight-savings flag is positive, the time is assumed to be
daylight savings time; if zero, the time is assumed to be standard
time; and if negative (the default), @code{mktime()} attempts to determine
@@ -18784,7 +18680,6 @@ is out of range, @code{mktime()} returns @minus{}1.
@cindex @command{gawk}, @code{PROCINFO} array in
@cindex @code{PROCINFO} array
@item @code{strftime(}[@var{format} [@code{,} @var{timestamp} [@code{,} @var{utc-flag}] ] ]@code{)}
-@c STARTOFRANGE strf
@cindexgawkfunc{strftime}
@cindex format time string
Format the time specified by @var{timestamp}
@@ -18933,12 +18828,12 @@ Equivalent to specifying @samp{%H:%M:%S}.
The weekday as a decimal number (1--7). Monday is day one.
@item %U
-The week number of the year (the first Sunday as the first day of week one)
+The week number of the year (with the first Sunday as the first day of week one)
as a decimal number (00--53).
@c @cindex ISO 8601
@item %V
-The week number of the year (the first Monday as the first
+The week number of the year (with the first Monday as the first
day of week one) as a decimal number (01--53).
The method for determining the week number is as specified by ISO 8601.
(To wit: if the week containing January 1 has four or more days in the
@@ -18949,7 +18844,7 @@ and the next week is week one.)
The weekday as a decimal number (0--6). Sunday is day zero.
@item %W
-The week number of the year (the first Monday as the first day of week one)
+The week number of the year (with the first Monday as the first day of week one)
as a decimal number (00--53).
@item %x
@@ -18969,8 +18864,8 @@ The full year as a decimal number (e.g., 2015).
@c @cindex RFC 822
@c @cindex RFC 1036
@item %z
-The timezone offset in a +HHMM format (e.g., the format necessary to
-produce RFC 822/RFC 1036 date headers).
+The time zone offset in a @samp{+@var{HHMM}} format (e.g., the format
+necessary to produce RFC 822/RFC 1036 date headers).
@item %Z
The time zone name or abbreviation; no characters if
@@ -19033,7 +18928,6 @@ The time as a decimal timestamp in seconds since the epoch.
The date in VMS format (e.g., @samp{20-JUN-1991}).
@end ignore
@end table
-@c ENDOFRANGE strf
Additionally, the alternative representations are recognized but their
normal representations are used.
@@ -19084,23 +18978,14 @@ gawk 'BEGIN @{
exit exitval
@}' "$@@"
@end example
-@c ENDOFRANGE tst
-@c ENDOFRANGE logftst
-@c ENDOFRANGE filogtst
-@c ENDOFRANGE gawtst
@node Bitwise Functions
@subsection Bit-Manipulation Functions
@cindex bit-manipulation functions
-@c STARTOFRANGE bit
@cindex bitwise, operations
-@c STARTOFRANGE and
@cindex AND bitwise operation
-@c STARTOFRANGE oro
@cindex OR bitwise operation
-@c STARTOFRANGE xor
@cindex XOR bitwise operation
-@c STARTOFRANGE opbit
@cindex operations, bitwise
@quotation
@i{I can explain it for you, but I can't understand it for you.}
@@ -19120,7 +19005,7 @@ The operations are described in @ref{table-bitwise-ops}.
@ifnottex
@ifnotdocbook
@display
- Bit Operator
+ Bit operator
| AND | OR | XOR
|---+---+---+---+---+---
Operands | 0 | 1 | 0 | 1 | 0 | 1
@@ -19178,7 +19063,7 @@ Operands | 0 | 1 | 0 | 1 | 0 | 1
<tbody>
<row>
<entry colsep="0"></entry>
-<entry spanname="optitle"><emphasis role="bold">Bit Operator</emphasis></entry>
+<entry spanname="optitle"><emphasis role="bold">Bit operator</emphasis></entry>
</row>
<row rowsep="1">
@@ -19242,10 +19127,9 @@ of a given value.
Finally, two other common operations are to shift the bits left or right.
For example, if you have a bit string @samp{10111001} and you shift it
right by three bits, you end up with @samp{00010111}.@footnote{This example
-shows that 0's come in on the left side. For @command{gawk}, this is
+shows that zeros come in on the left side. For @command{gawk}, this is
always true, but in some languages, it's possible to have the left side
-fill with 1's.}
-@c Purposely decided to use 0's and 1's here. 2/2001.
+fill with ones.}
If you start over again with @samp{10111001} and shift it left by three
bits, you end up with @samp{11001000}. The following list describes
@command{gawk}'s built-in functions that implement the bitwise operations.
@@ -19299,7 +19183,7 @@ that illustrates the use of these functions:
@example
@group
@c file eg/lib/bits2str.awk
-# bits2str --- turn a byte into readable 1's and 0's
+# bits2str --- turn a byte into readable ones and zeros
function bits2str(bits, data, mask)
@{
@@ -19392,11 +19276,6 @@ decimal and octal values for the same numbers
(@pxref{Nondecimal-numbers}),
and then demonstrates the
results of the @code{compl()}, @code{lshift()}, and @code{rshift()} functions.
-@c ENDOFRANGE bit
-@c ENDOFRANGE and
-@c ENDOFRANGE oro
-@c ENDOFRANGE xor
-@c ENDOFRANGE opbit
@node Type Functions
@subsection Getting Type Information
@@ -19476,15 +19355,11 @@ variant of the same message.
The default value for @var{domain} is the current value of @code{TEXTDOMAIN}.
The default value for @var{category} is @code{"LC_MESSAGES"}.
@end table
-@c ENDOFRANGE funcbi
-@c ENDOFRANGE bifunc
@node User-defined
@section User-Defined Functions
-@c STARTOFRANGE udfunc
@cindex user-defined functions
-@c STARTOFRANGE funcud
@cindex functions, user-defined
Complicated @command{awk} programs can often be simplified by defining
your own functions. User-defined functions can be called just like
@@ -19509,7 +19384,6 @@ variable definitions is appallingly awful.}
@author Brian Kernighan
@end quotation
-@c STARTOFRANGE fdef
@cindex functions, defining
Definitions of functions can appear anywhere between the rules of an
@command{awk} program. Thus, the general form of an @command{awk} program is
@@ -19547,10 +19421,15 @@ the call.
A function cannot have two parameters with the same name, nor may it
have a parameter with the same name as the function itself.
-In addition, according to the POSIX standard, function parameters
+
+@quotation CAUTION
+According to the POSIX standard, function parameters
cannot have the same name as one of the special predefined variables
-(@pxref{Built-in Variables}). Not all versions of @command{awk} enforce
-this restriction.
+(@pxref{Built-in Variables}), nor may a function parameter have the
+same name as another function.
+Not all versions of @command{awk} enforce
+these restrictions.
+@end quotation
Local variables act like the empty string if referenced where a string
value is required, and like zero if referenced where a numeric value
@@ -19756,12 +19635,10 @@ You might think that @code{ctime()} could use @code{PROCINFO["strftime"]}
for its format string. That would be a mistake, because @code{ctime()} is
supposed to return the time formatted in a standard fashion, and user-level
code could have changed @code{PROCINFO["strftime"]}.
-@c ENDOFRANGE fdef
@node Function Caveats
@subsection Calling User-Defined Functions
-@c STARTOFRANGE fudc
@cindex functions, user-defined, calling
@dfn{Calling a function} means causing the function to run and do its job.
A function call is an expression and its value is the value returned by
@@ -20053,7 +19930,6 @@ or the @code{nextfile} statement
@end ifnotdocbook
inside a user-defined function.
@command{gawk} does not have this limitation.
-@c ENDOFRANGE fudc
@node Return Statement
@subsection The @code{return} Statement
@@ -20181,7 +20057,6 @@ does report the second error.
Usually, such things aren't a big issue, but it's worth
being aware of them.
-@c ENDOFRANGE udfunc
@node Indirect Calls
@section Indirect Function Calls
@@ -20271,13 +20146,13 @@ using indirect function calls:
@c file eg/prog/indirectcall.awk
# average --- return the average of the values in fields $first - $last
-function average(first, last, sum, i)
+function average(first, last, the_sum, i)
@{
- sum = 0;
+ the_sum = 0;
for (i = first; i <= last; i++)
- sum += $i
+ the_sum += $i
- return sum / (last - first + 1)
+ return the_sum / (last - first + 1)
@}
# sum --- return the sum of the values in fields $first - $last
@@ -20607,7 +20482,7 @@ for (i = 1; i <= n; i++)
@end example
@noindent
-@code{gawk} looks up the actual function to call only once.
+@command{gawk} looks up the actual function to call only once.
@node Functions Summary
@section Summary
@@ -20674,7 +20549,6 @@ program. This is equivalent to function pointers in C and C++.
@end itemize
-@c ENDOFRANGE funcud
@ifnotinfo
@part @value{PART2}Problem Solving with @command{awk}
@@ -20696,11 +20570,8 @@ It contains the following chapters:
@node Library Functions
@chapter A Library of @command{awk} Functions
-@c STARTOFRANGE libf
@cindex libraries of @command{awk} functions
-@c STARTOFRANGE flib
@cindex functions, library
-@c STARTOFRANGE fudlib
@cindex functions, user-defined, library of
@DBREF{User-defined} describes how to write
@@ -21023,13 +20894,9 @@ be tested with @command{gawk} and the results compared to the built-in
@node Assert Function
@subsection Assertions
-@c STARTOFRANGE asse
@cindex assertions
-@c STARTOFRANGE assef
@cindex @code{assert()} function (C library)
-@c STARTOFRANGE libfass
@cindex libraries of @command{awk} functions, assertions
-@c STARTOFRANGE flibass
@cindex functions, library, assertions
@cindex @command{awk} programs, lengthy, assertions
When writing large programs, it is often useful to know
@@ -21145,10 +21012,6 @@ most likely causing the program to hang as it waits for input.
There is a simple workaround to this:
make sure that such a @code{BEGIN} rule always ends
with an @code{exit} statement.
-@c ENDOFRANGE asse
-@c ENDOFRANGE assef
-@c ENDOFRANGE flibass
-@c ENDOFRANGE libfass
@node Round Function
@subsection Rounding Numbers
@@ -21706,11 +21569,8 @@ function shell_quote(s, # parameter
@node Data File Management
@section @value{DDF} Management
-@c STARTOFRANGE dataf
@cindex files, managing
-@c STARTOFRANGE libfdataf
@cindex libraries of @command{awk} functions, managing, data files
-@c STARTOFRANGE flibdataf
@cindex functions, library, managing data files
This @value{SECTION} presents functions that are useful for managing
command-line @value{DF}s.
@@ -22102,22 +21962,14 @@ The use of @code{No_command_assign} allows you to disable command-line
assignments at invocation time, by giving the variable a true value.
When not set, it is initially zero (i.e., false), so the command-line arguments
are left alone.
-@c ENDOFRANGE dataf
-@c ENDOFRANGE flibdataf
-@c ENDOFRANGE libfdataf
@node Getopt Function
@section Processing Command-Line Options
-@c STARTOFRANGE libfclo
@cindex libraries of @command{awk} functions, command-line options
-@c STARTOFRANGE flibclo
@cindex functions, library, command-line options
-@c STARTOFRANGE clop
@cindex command-line options, processing
-@c STARTOFRANGE oclp
@cindex options, command-line, processing
-@c STARTOFRANGE clibf
@cindex functions, library, C library
@cindex arguments, processing
Most utilities on POSIX-compatible systems take options on
@@ -22469,21 +22321,13 @@ further options
Several of the sample programs presented in
@ref{Sample Programs},
use @code{getopt()} to process their arguments.
-@c ENDOFRANGE libfclo
-@c ENDOFRANGE flibclo
-@c ENDOFRANGE clop
-@c ENDOFRANGE oclp
@node Passwd Functions
@section Reading the User Database
-@c STARTOFRANGE libfudata
@cindex libraries of @command{awk} functions, user database, reading
-@c STARTOFRANGE flibudata
@cindex functions, library, user database@comma{} reading
-@c STARTOFRANGE udatar
@cindex user database@comma{} reading
-@c STARTOFRANGE dataur
@cindex database, users@comma{} reading
@cindex @code{PROCINFO} array
The @code{PROCINFO} array
@@ -22830,21 +22674,13 @@ and such a change would clutter up the code.
The @command{id} program in @DBREF{Id Program}
uses these functions.
-@c ENDOFRANGE libfudata
-@c ENDOFRANGE flibudata
-@c ENDOFRANGE udatar
-@c ENDOFRANGE dataur
@node Group Functions
@section Reading the Group Database
-@c STARTOFRANGE libfgdata
@cindex libraries of @command{awk} functions, group database, reading
-@c STARTOFRANGE flibgdata
@cindex functions, library, group database@comma{} reading
-@c STARTOFRANGE gdatar
@cindex group database, reading
-@c STARTOFRANGE datagr
@cindex database, group, reading
@cindex @code{PROCINFO} array, and group membership
@cindex @code{getgrent()} function (C library)
@@ -23167,7 +23003,6 @@ function getgrent()
@}
@c endfile
@end example
-@c ENDOFRANGE clibf
@cindex @code{endgrent()} function (C library)
The @code{endgrent()} function resets @code{_gr_count} to zero so that @code{getgrent()} can
@@ -23256,10 +23091,6 @@ $ @kbd{gawk -f walk_array.awk}
@print{} a[4][2] = 42
@end example
-@c ENDOFRANGE libfgdata
-@c ENDOFRANGE flibgdata
-@c ENDOFRANGE gdatar
-@c ENDOFRANGE libf
@node Library Functions Summary
@section Summary
@@ -23373,13 +23204,9 @@ output identical to that of the original version.
@end enumerate
@c EXCLUDE END
-@c ENDOFRANGE flib
-@c ENDOFRANGE fudlib
-@c ENDOFRANGE datagr
@node Sample Programs
@chapter Practical @command{awk} Programs
-@c STARTOFRANGE awkpex
@cindex @command{awk} programs, examples of
@c FULLXREF ON
@@ -23449,7 +23276,6 @@ cut.awk -- -c1-8 myfiles > results
@node Clones
@section Reinventing Wheels for Fun and Profit
-@c STARTOFRANGE posimawk
@cindex POSIX, programs@comma{} implementing in @command{awk}
This @value{SECTION} presents a number of POSIX utilities implemented in
@@ -23480,11 +23306,8 @@ The programs are presented in alphabetical order.
@subsection Cutting Out Fields and Columns
@cindex @command{cut} utility
-@c STARTOFRANGE cut
@cindex @command{cut} utility
-@c STARTOFRANGE ficut
@cindex fields, cutting
-@c STARTOFRANGE colcut
@cindex columns, cutting
The @command{cut} utility selects, or ``cuts,'' characters or fields
from its standard input and sends them to its standard output.
@@ -23792,21 +23615,14 @@ other @command{awk} implementations to use @code{substr()}
it is also extremely painful.
The @code{FIELDWIDTHS} variable supplies an elegant solution to the problem
of picking the input line apart by characters.
-@c ENDOFRANGE cut
-@c ENDOFRANGE ficut
-@c ENDOFRANGE colcut
@node Egrep Program
@subsection Searching for Regular Expressions in Files
-@c STARTOFRANGE regexps
@cindex regular expressions, searching for
-@c STARTOFRANGE sfregexp
@cindex searching, files for regular expressions
-@c STARTOFRANGE fsregexp
@cindex files, searching for regular expressions
-@c STARTOFRANGE egrep
@cindex @command{egrep} utility
The @command{egrep} utility searches files for patterns. It uses regular
expressions that are almost identical to those available in @command{awk}
@@ -24074,17 +23890,12 @@ function usage()
@c endfile
@end example
-@c ENDOFRANGE regexps
-@c ENDOFRANGE sfregexp
-@c ENDOFRANGE fsregexp
-@c ENDOFRANGE egrep
@node Id Program
@subsection Printing Out User Information
@cindex printing, user information
@cindex users, information about, printing
-@c STARTOFRANGE id
@cindex @command{id} utility
The @command{id} utility lists a user's real and effective user ID numbers,
real and effective group ID numbers, and the user's group set, if any.
@@ -24213,16 +24024,13 @@ code that is used repeatedly, making the whole program
shorter and cleaner. In particular, moving the check for
the empty string into this function saves several lines of code.
-@c ENDOFRANGE id
@node Split Program
@subsection Splitting a Large File into Pieces
@c FIXME: One day, update to current POSIX version of split
-@c STARTOFRANGE filspl
@cindex files, splitting
-@c STARTOFRANGE split
@cindex @code{split} utility
The @command{split} program splits large text files into smaller pieces.
Usage is as follows:@footnote{This is the traditional usage. The
@@ -24357,15 +24165,12 @@ You might want to consider how to eliminate the use of
way as to solve the EBCDIC issue as well.
@end ifset
-@c ENDOFRANGE filspl
-@c ENDOFRANGE split
@node Tee Program
@subsection Duplicating Output into Multiple Files
@cindex files, multiple@comma{} duplicating output into
@cindex output, duplicating into files
-@c STARTOFRANGE tee
@cindex @code{tee} utility
The @code{tee} program is known as a ``pipe fitting.'' @code{tee} copies
its standard input to its standard output and also duplicates it to the
@@ -24478,18 +24283,14 @@ END @{
@}
@c endfile
@end example
-@c ENDOFRANGE tee
@node Uniq Program
@subsection Printing Nonduplicated Lines of Text
@c FIXME: One day, update to current POSIX version of uniq
-@c STARTOFRANGE prunt
@cindex printing, unduplicated lines of text
-@c STARTOFRANGE tpul
@cindex text@comma{} printing, unduplicated lines of
-@c STARTOFRANGE uniq
@cindex @command{uniq} utility
The @command{uniq} utility reads sorted lines of data on its standard
input, and by default removes duplicate lines. In other words, it only
@@ -24758,26 +24559,17 @@ suggestion.
@end ifset
-@c ENDOFRANGE prunt
-@c ENDOFRANGE tpul
-@c ENDOFRANGE uniq
@node Wc Program
@subsection Counting Things
@c FIXME: One day, update to current POSIX version of wc
-@c STARTOFRANGE count
@cindex counting
-@c STARTOFRANGE infco
@cindex input files, counting elements in
-@c STARTOFRANGE woco
@cindex words, counting
-@c STARTOFRANGE chco
@cindex characters, counting
-@c STARTOFRANGE lico
@cindex lines, counting
-@c STARTOFRANGE wc
@cindex @command{wc} utility
The @command{wc} (word count) utility counts lines, words, and characters in
one or more input files. Its usage is as follows:
@@ -24947,13 +24739,6 @@ END @{
@}
@c endfile
@end example
-@c ENDOFRANGE count
-@c ENDOFRANGE infco
-@c ENDOFRANGE lico
-@c ENDOFRANGE woco
-@c ENDOFRANGE chco
-@c ENDOFRANGE wc
-@c ENDOFRANGE posimawk
@node Miscellaneous Programs
@section A Grab Bag of @command{awk} Programs
@@ -25084,9 +24869,7 @@ Aharon Robbins <arnold@skeeve.com> wrote:
@author Erik Quanstrom
@end quotation
-@c STARTOFRANGE tialarm
@cindex time, alarm clock example program
-@c STARTOFRANGE alaex
@cindex alarm clock example program
The following program is a simple ``alarm clock'' program.
You give it a time of day and an optional message. At the specified time,
@@ -25238,15 +25021,11 @@ seconds are necessary:
@}
@c endfile
@end example
-@c ENDOFRANGE tialarm
-@c ENDOFRANGE alaex
@node Translate Program
@subsection Transliterating Characters
-@c STARTOFRANGE chtra
@cindex characters, transliterating
-@c STARTOFRANGE tr
@cindex @command{tr} utility
The system @command{tr} utility transliterates characters. For example, it is
often used to map uppercase letters into lowercase for further processing:
@@ -25394,15 +25173,11 @@ such as @samp{a-z}, as allowed by the @command{tr} utility.
Look at the code for @file{cut.awk} (@pxref{Cut Program})
for inspiration.
-@c ENDOFRANGE chtra
-@c ENDOFRANGE tr
@node Labels Program
@subsection Printing Mailing Labels
-@c STARTOFRANGE prml
@cindex printing, mailing labels
-@c STARTOFRANGE mlprint
@cindex mailing labels@comma{} printing
Here is a ``real world''@footnote{``Real world'' is defined as
``a program actually used to get something done.''}
@@ -25466,7 +25241,6 @@ that there are two blank lines at the top and two blank lines at the bottom.
The @code{END} rule arranges to flush the final page of labels; there may
not have been an even multiple of 20 labels in the data:
-@c STARTOFRANGE labels
@cindex @code{labels.awk} program
@example
@c file eg/prog/labels.awk
@@ -25531,14 +25305,10 @@ END @{
@}
@c endfile
@end example
-@c ENDOFRANGE prml
-@c ENDOFRANGE mlprint
-@c ENDOFRANGE labels
@node Word Sorting
@subsection Generating Word-Usage Counts
-@c STARTOFRANGE worus
@cindex words, usage counts@comma{} generating
When working with large amounts of text, it can be interesting to know
@@ -25600,7 +25370,6 @@ to remove punctuation characters. Finally, we solve the third problem
by using the system @command{sort} utility to process the output of the
@command{awk} script. Here is the new version of the program:
-@c STARTOFRANGE wordfreq
@cindex @code{wordfreq.awk} program
@example
@c file eg/prog/wordfreq.awk
@@ -25665,13 +25434,10 @@ This way of sorting must be used on systems that do not
have true pipes at the command-line (or batch-file) level.
See the general operating system documentation for more information on how
to use the @command{sort} program.
-@c ENDOFRANGE worus
-@c ENDOFRANGE wordfreq
@node History Sorting
@subsection Removing Duplicates from Unsorted Text
-@c STARTOFRANGE lidu
@cindex lines, duplicate@comma{} removing
The @command{uniq} program
(@pxref{Uniq Program}),
@@ -25696,7 +25462,6 @@ Each element of @code{lines} is a unique command, and the indices of
The @code{END} rule simply prints out the lines, in order:
@cindex Rakitzis, Byron
-@c STARTOFRANGE histsort
@cindex @code{histsort.awk} program
@example
@c file eg/prog/histsort.awk
@@ -25739,15 +25504,11 @@ print data[lines[i]], lines[i]
@noindent
This works because @code{data[$0]} is incremented each time a line is
seen.
-@c ENDOFRANGE lidu
-@c ENDOFRANGE histsort
@node Extract Program
@subsection Extracting Programs from Texinfo Source Files
-@c STARTOFRANGE texse
@cindex Texinfo, extracting programs from source files
-@c STARTOFRANGE fitex
@cindex files, Texinfo@comma{} extracting programs from
@ifnotinfo
Both this chapter and the previous chapter
@@ -25851,7 +25612,6 @@ The first rule handles calling @code{system()}, checking that a command is
given (@code{NF} is at least three) and also checking that the command
exits with a zero exit status, signifying OK:
-@c STARTOFRANGE extract
@cindex @code{extract.awk} program
@example
@c file eg/prog/extract.awk
@@ -25997,9 +25757,6 @@ END @{
@}
@c endfile
@end example
-@c ENDOFRANGE texse
-@c ENDOFRANGE fitex
-@c ENDOFRANGE extract
@node Simple Sed
@subsection A Simple Stream Editor
@@ -26029,7 +25786,6 @@ additional arguments are treated as @value{DF} names to process. If none
are provided, the standard input is used:
@cindex Brennan, Michael
-@c STARTOFRANGE awksed
@cindex @command{awksed.awk} program
@c @cindex simple stream editor
@c @cindex stream editor, simple
@@ -26106,14 +25862,11 @@ The @code{usage()} function prints an error message and exits.
Finally, the single rule handles the printing scheme outlined earlier,
using @code{print} or @code{printf} as appropriate, depending upon the
value of @code{RT}.
-@c ENDOFRANGE awksed
@node Igawk Program
@subsection An Easy Way to Use Library Functions
-@c STARTOFRANGE libfex
@cindex libraries of @command{awk} functions, example program for using
-@c STARTOFRANGE flibex
@cindex functions, library, example program for using
In @ref{Include Files}, we saw how @command{gawk} provides a built-in
file-inclusion capability. However, this is a @command{gawk} extension.
@@ -26252,7 +26005,6 @@ program.
The program is as follows:
-@c STARTOFRANGE igawk
@cindex @code{igawk.sh} program
@example
@c file eg/prog/igawk.sh
@@ -26577,10 +26329,6 @@ features to a program; they can often be layered on top.@footnote{@command{gawk}
does @code{@@include} processing itself in order to support the use
of @command{awk} programs as Web CGI scripts.}
-@c ENDOFRANGE libfex
-@c ENDOFRANGE flibex
-@c ENDOFRANGE awkpex
-@c ENDOFRANGE igawk
@node Anagram Program
@subsection Finding Anagrams from a Dictionary
@@ -26604,7 +26352,6 @@ The following program uses arrays of arrays to bring together
words with the same signature and array sorting to print the words
in sorted order:
-@c STARTOFRANGE anagram
@cindex @code{anagram.awk} program
@example
@c file eg/prog/anagram.awk
@@ -26713,7 +26460,6 @@ babery yabber
@dots{}
@end example
-@c ENDOFRANGE anagram
@node Signature Program
@subsection And Now for Something Completely Different
@@ -27033,9 +26779,7 @@ It contains the following chapters:
@node Advanced Features
@chapter Advanced Features of @command{gawk}
-@c STARTOFRANGE gawadv
@cindex @command{gawk}, features, advanced
-@c STARTOFRANGE advgaw
@cindex advanced features, @command{gawk}
@ignore
Contributed by: Peter Langston <pud!psl@bellcore.bellcore.com>
@@ -27745,7 +27489,6 @@ using regular pipes.
@section Using @command{gawk} for Network Programming
@cindex advanced features, network programming
@cindex networks, programming
-@c STARTOFRANGE tcpip
@cindex TCP/IP
@cindex @code{/inet/@dots{}} special files (@command{gawk})
@cindex files, @code{/inet/@dots{}} (@command{gawk})
@@ -27862,13 +27605,10 @@ which comes as part of the @command{gawk} distribution,
for a much more complete introduction and discussion, as well as
extensive examples.
-@c ENDOFRANGE tcpip
@node Profiling
@section Profiling Your @command{awk} Programs
-@c STARTOFRANGE awkp
@cindex @command{awk} programs, profiling
-@c STARTOFRANGE proawk
@cindex profiling @command{awk} programs
@cindex @code{awkprof.out} file
@cindex files, @code{awkprof.out}
@@ -28195,9 +27935,6 @@ that the profiling output does. This makes it easy to pretty-print your
code once development is completed, and then use the result as the final
version of your program.
-@c ENDOFRANGE awkp
-@c ENDOFRANGE proawk
-
@node Advanced Features Summary
@section Summary
@@ -28243,8 +27980,6 @@ the program, but that will change in the next major release.
@end itemize
-@c ENDOFRANGE advgaw
-@c ENDOFRANGE gawadv
@node Internationalization
@chapter Internationalization with @command{gawk}
@@ -28257,7 +27992,6 @@ countries, they were able to sell more systems.
As a result, internationalization and localization
of programs and software systems became a common practice.
-@c STARTOFRANGE inloc
@cindex internationalization, localization
@cindex @command{gawk}, internationalization and, See internationalization
@cindex internationalization, localization, @command{gawk} and
@@ -28302,7 +28036,6 @@ monetary values are printed and read.
@section GNU @command{gettext}
@cindex internationalizing a program
-@c STARTOFRANGE gettex
@cindex @command{gettext} library
@command{gawk} uses GNU @command{gettext} to provide its internationalization
features.
@@ -28354,7 +28087,6 @@ lookup of the translations.
@cindex @code{.po} files
@cindex files, @code{.po}
-@c STARTOFRANGE portobfi
@cindex portable object files
@cindex files, portable object
@item
@@ -28366,7 +28098,6 @@ For example, there might be a @file{fr.po} for a French translation.
@cindex @code{.gmo} files
@cindex files, @code{.gmo}
@cindex message object files
-@c STARTOFRANGE portmsgfi
@cindex files, message object
@item
Each language's @file{.po} file is converted into a binary
@@ -28494,11 +28225,9 @@ before or after the day in a date, local month abbreviations, and so on.
@item LC_ALL
All of the above. (Not too useful in the context of @command{gettext}.)
@end table
-@c ENDOFRANGE gettex
@node Programmer i18n
@section Internationalizing @command{awk} Programs
-@c STARTOFRANGE inap
@cindex @command{awk} programs, internationalizing
@command{gawk} provides the following variables and functions for
@@ -28731,8 +28460,6 @@ to provide you translations that you can also then distribute.
@DBXREF{I18N Example}
for the full list of steps to go through to create and test
translations for @command{guide}.
-@c ENDOFRANGE portobfi
-@c ENDOFRANGE portmsgfi
@node Printf Ordering
@subsection Rearranging @code{printf} Arguments
@@ -28908,7 +28635,6 @@ However, because the positional specifications are primarily for use in
@emph{translated} format strings, and because non-GNU @command{awk}s never
retrieve the translated string, this should not be a problem in practice.
@end itemize
-@c ENDOFRANGE inap
@node I18N Example
@section A Simple Internationalization Example
@@ -29059,8 +28785,8 @@ complete detail in
@cite{GNU gettext tools}}.)
@end ifnotinfo
As of this writing, the latest version of GNU @command{gettext} is
-@uref{ftp://ftp.gnu.org/gnu/gettext/gettext-0.19.3.tar.gz,
-@value{PVERSION} 0.19.3}.
+@uref{ftp://ftp.gnu.org/gnu/gettext/gettext-0.19.4.tar.gz,
+@value{PVERSION} 0.19.4}.
If a translation of @command{gawk}'s messages exists,
then @command{gawk} produces usage messages, warnings,
@@ -29104,7 +28830,6 @@ a number of translations for its messages.
@end itemize
-@c ENDOFRANGE inloc
@node Debugger
@chapter Debugging @command{awk} Programs
@@ -30708,7 +30433,7 @@ is available like so:
@example
$ @kbd{gawk --version}
@print{} GNU Awk 4.1.2, API: 1.1 (GNU MPFR 3.1.0-p3, GNU MP 5.0.2)
-@print{} Copyright (C) 1989, 1991-2014 Free Software Foundation.
+@print{} Copyright (C) 1989, 1991-2015 Free Software Foundation.
@dots{}
@end example
@@ -31362,7 +31087,7 @@ When asked about the algorithm used, Katie replied:
@quotation
It's not that well known but it's not that obscure either.
It's Euler's modification to Newton's method for calculating pi.
-Take a look at lines (23) - (25) here: @uref{http://mathworld.wolfram.com/PiFormulas.htm}.
+Take a look at lines (23) - (25) here: @uref{http://mathworld.wolfram.com/PiFormulas.html}.
The algorithm I wrote simply expands the multiply by 2 and works from
the innermost expression outwards. I used this to program HP calculators
@@ -31412,7 +31137,7 @@ Allowing completely alphabetic strings to have valid numeric
values is also a very severe departure from historical practice.
@end itemize
-The second problem is that the @code{gawk} maintainer feels that this
+The second problem is that the @command{gawk} maintainer feels that this
interpretation of the standard, which requires a certain amount of
``language lawyering'' to arrive at in the first place, was not even
intended by the standard developers. In other words, ``we see how you
@@ -31571,7 +31296,7 @@ When @option{--sandbox} is specified, extensions are disabled
* Finding Extensions:: How @command{gawk} finds compiled extensions.
* Extension Example:: Example C code for an extension.
* Extension Samples:: The sample extensions that ship with
- @code{gawk}.
+ @command{gawk}.
* gawkextlib:: The @code{gawkextlib} project.
* Extension summary:: Extension summary.
* Extension Exercises:: Exercises.
@@ -32540,7 +32265,7 @@ If the concept of a ``record terminator'' makes sense, then
@code{*rt_start} should be set to point to the data to be used for
@code{RT}, and @code{*rt_len} should be set to the length of the
data. Otherwise, @code{*rt_len} should be set to zero.
-@code{gawk} makes its own copy of this data, so the
+@command{gawk} makes its own copy of this data, so the
extension must manage this storage.
@end table
@@ -32586,7 +32311,7 @@ When writing an input parser, you should think about (and document)
how it is expected to interact with @command{awk} code. You may want
it to always be called, and take effect as appropriate (as the
@code{readdir} extension does). Or you may want it to take effect
-based upon the value of an @code{awk} variable, as the XML extension
+based upon the value of an @command{awk} variable, as the XML extension
from the @code{gawkextlib} project does (@pxref{gawkextlib}).
In the latter case, code in a @code{BEGINFILE} section
can look at @code{FILENAME} and @code{ERRNO} to decide whether or
@@ -33369,7 +33094,7 @@ converts it to a string. Using non-integral values is possible, but
requires that you understand how such values are converted to strings
(@pxref{Conversion}); thus using integral values is safest.
-As with @emph{all} strings passed into @code{gawk} from an extension,
+As with @emph{all} strings passed into @command{gawk} from an extension,
the string value of @code{index} must come from @code{gawk_malloc()},
@code{gawk_calloc()} or @code{gawk_realloc()}, and
@command{gawk} releases the storage.
@@ -35711,9 +35436,7 @@ online documentation}.
@node V7/SVR3.1
@appendixsec Major Changes Between V7 and SVR3.1
-@c STARTOFRANGE gawkv
@cindex @command{awk}, versions of
-@c STARTOFRANGE gawkv1
@cindex @command{awk}, versions of, changes between V7 and SVR3.1
The @command{awk} language evolved considerably between the release of
@@ -35800,7 +35523,6 @@ Multiple @code{BEGIN} and @code{END} rules
Multidimensional arrays
(@pxref{Multidimensional}).
@end itemize
-@c ENDOFRANGE gawkv1
@node SVR4
@appendixsec Changes Between SVR3.1 and SVR4
@@ -35915,7 +35637,6 @@ not permitted by the POSIX standard.
The 2008 POSIX standard can be found online at
@url{http://www.opengroup.org/onlinepubs/9699919799/}.
-@c ENDOFRANGE gawkv
@node BTL
@appendixsec Extensions in Brian Kernighan's @command{awk}
@@ -35961,11 +35682,8 @@ available in his @command{awk}.
@node POSIX/GNU
@appendixsec Extensions in @command{gawk} Not in POSIX @command{awk}
-@c STARTOFRANGE fripls
@cindex compatibility mode (@command{gawk}), extensions
-@c STARTOFRANGE exgnot
@cindex extensions, in @command{gawk}, not in POSIX @command{awk}
-@c STARTOFRANGE posnot
@cindex POSIX, @command{gawk} extensions not included in
The GNU implementation, @command{gawk}, adds a large number of features.
They can all be disabled with either the @option{--traditional} or
@@ -36279,9 +35997,6 @@ Support for MirBSD was removed at @command{gawk} @value{PVERSION} 4.2.
@c XXX ADD MORE STUFF HERE
-@c ENDOFRANGE fripls
-@c ENDOFRANGE exgnot
-@c ENDOFRANGE posnot
@c This does not need to be in the formal book.
@ifclear FOR_PRINT
@@ -37330,9 +37045,7 @@ the appropriate credit where credit is due.
@c last two commas are part of see also
@cindex operating systems, See Also GNU/Linux@comma{} PC operating systems@comma{} Unix
-@c STARTOFRANGE gligawk
@cindex @command{gawk}, installing
-@c STARTOFRANGE ingawk
@cindex installing @command{gawk}
This appendix provides instructions for installing @command{gawk} on the
various platforms that are supported by the developers. The primary
@@ -37442,7 +37155,6 @@ a local expert.
@node Distribution contents
@appendixsubsec Contents of the @command{gawk} Distribution
-@c STARTOFRANGE gawdis
@cindex @command{gawk}, distribution
The @command{gawk} distribution has a number of C source files,
@@ -37641,7 +37353,6 @@ directory to run your version of @command{gawk} against the test suite.
If @command{gawk} successfully passes @samp{make check}, then you can
be confident of a successful port.
@end table
-@c ENDOFRANGE gawdis
@node Unix Installation
@appendixsec Compiling and Installing @command{gawk} on Unix-Like Systems
@@ -37792,7 +37503,7 @@ can be configured and compiled.
@cindex @option{--disable-lint} configuration option
@cindex configuration option, @code{--disable-lint}
@item --disable-lint
-Disable all lint checking within @code{gawk}. The
+Disable all lint checking within @command{gawk}. The
@option{--lint} and @option{--lint-old} options
(@pxref{Options})
are accepted, but silently do nothing.
@@ -38106,9 +37817,7 @@ multibyte functionality is not available.
@node PC Using
@appendixsubsubsec Using @command{gawk} on PC Operating Systems
-@c STARTOFRANGE opgawx
@cindex operating systems, PC, @command{gawk} on
-@c STARTOFRANGE pcgawon
@cindex PC operating systems, @command{gawk} on
Under MS-DOS and MS-Windows, the Cygwin and MinGW environments support
@@ -38616,8 +38325,6 @@ $ @kbd{gawk :== $sys$common:[syshlp.examples.tcpip.snmp]gawk.exe}
This is apparently @value{PVERSION} 2.15.6, which is extremely old. We
recommend compiling and using the current version.
-@c ENDOFRANGE opgawx
-@c ENDOFRANGE pcgawon
@node Bugs
@appendixsec Reporting Problems and Bugs
@@ -38628,9 +38335,7 @@ recommend compiling and using the current version.
@end quotation
@c the radio show, not the book. :-)
-@c STARTOFRANGE dbugg
@cindex debugging @command{gawk}, bug reports
-@c STARTOFRANGE tblgawb
@cindex troubleshooting, @command{gawk}, bug reports
If you have problems with @command{gawk} or think that you have found a bug,
report it to the developers; we cannot promise to do anything
@@ -38727,12 +38432,9 @@ The people maintaining the various @command{gawk} ports are:
If your bug is also reproducible under Unix, send a copy of your
report to the @EMAIL{bug-gawk@@gnu.org,bug-gawk at gnu dot org} email list as well.
-@c ENDOFRANGE dbugg
-@c ENDOFRANGE tblgawb
@node Other Versions
@appendixsec Other Freely Available @command{awk} Implementations
-@c STARTOFRANGE awkim
@cindex @command{awk}, implementations
@ignore
From: emory!amc.com!brennan (Michael Brennan)
@@ -38792,7 +38494,7 @@ git clone git://github.com/onetrueawk/awk bwkawk
@end example
@noindent
-This command creates a copy of the @uref{http://www.git-scm.com, Git}
+This command creates a copy of the @uref{http://git-scm.com, Git}
repository in a directory named @file{bwkawk}. If you leave that argument
off the @command{git} command line, the repository copy is created in a
directory named @file{awk}.
@@ -38857,7 +38559,7 @@ To get @command{awka}, go to @url{http://sourceforge.net/projects/awka}.
@c andrewsumner@@yahoo.net
The project seems to be frozen; no new code changes have been made
-since approximately 2003.
+since approximately 2001.
@cindex Beebe, Nelson H.F.@:
@cindex @command{pawk} (profiling version of Brian Kernighan's @command{awk})
@@ -38953,7 +38655,6 @@ See also the ``Versions and implementations'' section of the
Wikipedia article} for information on additional versions.
@end table
-@c ENDOFRANGE awkim
@node Installation summary
@appendixsec Summary
@@ -38991,15 +38692,11 @@ implementations. Many are POSIX compliant; others are less so.
@end itemize
-@c ENDOFRANGE gligawk
-@c ENDOFRANGE ingawk
@ifclear FOR_PRINT
@node Notes
@appendix Implementation Notes
-@c STARTOFRANGE gawii
@cindex @command{gawk}, implementation issues
-@c STARTOFRANGE impis
@cindex implementation issues, @command{gawk}
This appendix contains information mainly of interest to implementers and
@@ -39075,7 +38772,7 @@ However, if you want to modify @command{gawk} and contribute back your
changes, you will probably wish to work with the development version.
To do so, you will need to access the @command{gawk} source code
repository. The code is maintained using the
-@uref{http://git-scm.com/, Git distributed version control system}.
+@uref{http://git-scm.com, Git distributed version control system}.
You will need to install it if your system doesn't have it.
Once you have done so, use the command:
@@ -39104,11 +38801,8 @@ that has a Git plug-in for working with Git repositories.
@node Adding Code
@appendixsubsec Adding New Features
-@c STARTOFRANGE adfgaw
@cindex adding, features to @command{gawk}
-@c STARTOFRANGE fadgaw
@cindex features, adding to @command{gawk}
-@c STARTOFRANGE gawadf
@cindex @command{gawk}, features, adding
You are free to add any new features you like to @command{gawk}.
However, if you want your changes to be incorporated into the @command{gawk}
@@ -39143,7 +38837,7 @@ for information on getting the latest version of @command{gawk}.)
@item
@ifnotinfo
-Follow the @uref{http://www.gnu.org/prep/standards/, @cite{GNU Coding Standards}}.
+Follow the @cite{GNU Coding Standards}.
@end ifnotinfo
@ifinfo
See @inforef{Top, , Version, standards, GNU Coding Standards}.
@@ -39152,7 +38846,7 @@ This document describes how GNU software should be written. If you haven't
read it, please do so, preferably @emph{before} starting to modify @command{gawk}.
(The @cite{GNU Coding Standards} are available from
the GNU Project's
-@uref{http://www.gnu.org/prep/standards_toc.html, website}.
+@uref{http://www.gnu.org/prep/standards/, website}.
Texinfo, Info, and DVI versions are also available.)
@cindex @command{gawk}, coding style in
@@ -39275,9 +38969,6 @@ Although this sounds like a lot of work, please remember that while you
may write the new code, I have to maintain it and support it. If it
isn't possible for me to do that with a minimum of extra work, then I
probably will not.
-@c ENDOFRANGE adfgaw
-@c ENDOFRANGE gawadf
-@c ENDOFRANGE fadgaw
@node New Ports
@appendixsubsec Porting @command{gawk} to a New Operating System
@@ -39411,7 +39102,6 @@ coding style and brace layout that suits your taste.
@node Derived Files
@appendixsubsec Why Generated Files Are Kept In Git
-@c STARTOFRANGE gawkgit
@cindex Git, use of for @command{gawk} source code
@c From emails written March 22, 2012, to the gawk developers list.
@@ -39600,7 +39290,6 @@ wget http://git.savannah.gnu.org/cgit/gawk.git/snapshot/gawk-@var{branchname}.ta
@noindent
to retrieve a snapshot of the given branch.
-@c ENDOFRANGE gawkgit
@node Future Extensions
@appendixsec Probable Future Extensions
@@ -39981,13 +39670,10 @@ of @command{gawk}, but it @emph{will} be removed in the next major release.
@end itemize
-@c ENDOFRANGE impis
-@c ENDOFRANGE gawii
@node Basic Concepts
@appendix Basic Programming Concepts
@cindex programming, concepts
-@c STARTOFRANGE procon
@cindex programming, concepts
This @value{APPENDIX} attempts to define some of the basic concepts
@@ -40225,7 +39911,6 @@ standard for C. This standard became an ISO standard in 1990.
In 1999, a revised ISO C standard was approved and released.
Where it makes sense, POSIX @command{awk} is compatible with 1999 ISO C.
-@c ENDOFRANGE procon
@node Glossary
@unnumbered Glossary
@@ -40276,6 +39961,21 @@ languages.
These standards often become international standards as well. See also
``ISO.''
+@item Argument
+An argument can be two different things. It can be an option or a
+@value{FN} passed to a command while invoking it from the command line, or
+it can be something passed to a @dfn{function} inside a program, e.g.
+inside @command{awk}.
+
+In the latter case, an argument can be passed to a function in two ways.
+Either it is given to the called function by value, i.e., a copy of the
+value of the variable is made available to the called function, but the
+original variable cannot be modified by the function itself; or it is
+given by reference, i.e., a pointer to the interested variable is passed to
+the function, which can then directly modify it. In @command{awk}
+scalars are passed by value, and arrays are passed by reference.
+See ``Pass By Value/Reference.''
+
@item Array
A grouping of multiple values under the same name.
Most languages just provide sequential arrays.
@@ -40317,6 +40017,25 @@ The GNU version of the standard shell
@end ifinfo
See also ``Bourne Shell.''
+@item Binary
+Base-two notation, where the digits are @code{0}--@code{1}. Since
+electronic circuitry works ``naturally'' in base 2 (just think of Off/On),
+everything inside a computer is calculated using base 2. Each digit
+represents the presence (or absence) of a power of 2 and is called a
+@dfn{bit}. So, for example, the base-two number @code{10101} is
+the same as decimal 21, ((1 x 16) + (1 x 4) + (1 x 1)).
+
+Since base-two numbers quickly become
+very long to read and write, they are usually grouped by 3 (i.e., they are
+read as octal numbers), or by 4 (i.e., they are read as hexadecimal
+numbers). There is no direct way to insert base 2 numbers in a C program.
+If need arises, such numbers are usually inserted as octal or hexadecimal
+numbers. The number of base-two digits that fit into registers used for
+representing integer numbers in computers is a rough indication of the
+computing power of the computer itself. Most computers nowadays use 64
+bits for representing integer numbers in their registers, but 32-bit,
+16-bit and 8-bit registers have been widely used in the past.
+@xref{Nondecimal-numbers}.
@item Bit
Short for ``Binary Digit.''
All values in computer memory ultimately reduce to binary digits: values
@@ -40348,6 +40067,19 @@ The characters @samp{@{} and @samp{@}}. Braces are used in
@command{awk} for delimiting actions, compound statements, and function
bodies.
+@item Bracket Expression
+Inside a @dfn{regular expression}, an expression included in square
+brackets, meant to designate a single character as belonging to a
+specified character class. A bracket expression can contain a list of one
+or more characters, like @samp{[abc]}, a range of characters, like
+@samp{[A-Z]}, or a name, delimited by @samp{:}, that designates a known set
+of characters, like @samp{[:digit:]}. The form of bracket expression
+enclosed between @samp{:} is independent of the underlying representation
+of the character themselves, which could utilize the ASCII, ECBDIC, or
+Unicode codesets, depending on the architecture of the computer system, and on
+localization.
+See also ``Regular Expression.''
+
@item Built-in Function
The @command{awk} language provides built-in functions that perform various
numerical, I/O-related, and string computations. Examples are
@@ -40401,9 +40133,25 @@ points out similarities between @command{awk} and C when appropriate.
In general, @command{gawk} attempts to be as similar to the 1990 version
of ISO C as makes sense.
+@item C Shell
+The C Shell (@command{csh} or its improved version, @command{tcsh}) is a Unix shell that was
+created by Bill Joy in the late 1970s. The C shell was differentiated from
+other shells by its interactive features and overall style, which
+looks more like C. The C Shell is not backward compatible with the Bourne
+Shell, so special attention is required when converting scripts
+written for other Unix shells to the C shell, especially with regard to the management of
+shell variables.
+See also ``Bourne Shell.''
+
@item C++
A popular object-oriented programming language derived from C.
+@item Character Class
+See ``Bracket Expression.''
+
+@item Character List
+See ``Bracket Expression.''
+
@cindex ASCII
@cindex ISO 8859-1
@cindex ISO Latin-1
@@ -40427,7 +40175,7 @@ A preprocessor for @command{pic} that reads descriptions of molecules
and produces @command{pic} input for drawing them.
It was written in @command{awk}
by Brian Kernighan and Jon Bentley, and is available from
-@uref{http://netlib.sandia.gov/netlib/typesetting/chem.gz}.
+@uref{http://netlib.org/typesetting/chem}.
@item Comparison Expression
A relation that is either true or false, such as @samp{a < b}.
@@ -40443,11 +40191,23 @@ machine-executable object code. The object code is then executed
directly by the computer.
See also ``Interpreter.''
+@item Complemented Bracket Expression
+The negation of a @dfn{bracket expression}. All that is @emph{not}
+described by a given bracket expression. The symbol @samp{^} precedes
+the negated bracket expression. E.g.: @samp{[[^:digit:]}
+designates whatever character is not a digit. @samp{[^bad]}
+designates whatever character is not one of the letters @samp{b}, @samp{a},
+or @samp{d}.
+See ``Bracket Expression.''
+
@item Compound Statement
A series of @command{awk} statements, enclosed in curly braces. Compound
statements may be nested.
(@xref{Statements}.)
+@item Computed Regexps
+See ``Dynamic Regular Expressions.''
+
@item Concatenation
Concatenating two strings means sticking them together, one after another,
producing a new string. For example, the string @samp{foo} concatenated with
@@ -40462,6 +40222,13 @@ expression is the value of @var{expr2}; otherwise the value is
@var{expr3}. In either case, only one of @var{expr2} and @var{expr3}
is evaluated. (@xref{Conditional Exp}.)
+@item Control Statement
+A control statement is an instruction to perform a given operation or a set
+of operations inside an @command{awk} program, if a given condition is
+true. Control statements are: @code{if}, @code{for}, @code{while}, and
+@code{do}
+(@pxref{Statements}).
+
@cindex McIlroy, Doug
@cindex cookie
@item Cookie
@@ -40616,6 +40383,11 @@ Format strings control the appearance of output in the
are controlled by the format strings contained in the predefined variables
@code{CONVFMT} and @code{OFMT}. (@xref{Control Letters}.)
+@item Fortran
+Shorthand for FORmula TRANslator, one of the first programming languages
+available for scientific calculations. It was created by John Backus,
+and has been available since 1957. It is still in use today.
+
@item Free Documentation License
This document describes the terms under which this @value{DOCUMENT}
is published and may be copied. (@xref{GNU Free Documentation License}.)
@@ -40633,10 +40405,21 @@ Emacs editor. GNU Emacs is the most widely used version of Emacs today.
See ``Free Software Foundation.''
@item Function
-A specialized group of statements used to encapsulate general
-or program-specific tasks. @command{awk} has a number of built-in
-functions, and also allows you to define your own.
-(@xref{Functions}.)
+A part of an @command{awk} program that can be invoked from every point of
+the program, to perform a task. @command{awk} has several built-in
+functions.
+Users can define their own functions in every part of the program.
+Function can be recursive, i.e., they may invoke themselves.
+@xref{Functions}.
+In @command{gawk} it is also possible to have functions shared
+among different programs, and included where required using the
+@code{@@include} directive
+(@pxref{Include Files}).
+In @command{gawk} the name of the function that should be invoked
+can be generated at run time, i.e., dynamically.
+The @command{gawk} extension API provides constructor functions
+(@pxref{Constructor Functions}).
+
@item @command{gawk}
The GNU implementation of @command{awk}.
@@ -40760,6 +40543,12 @@ meaning. Keywords are reserved and may not be used as variable names.
and
@code{while}.
+@item Korn Shell
+The Korn Shell (@command{ksh}) is a Unix shell which was developed by David Korn at Bell
+Laboratories in the early 1980s. The Korn Shell is backward-compatible with the Bourne
+shell and includes many features of the C shell.
+See also ``Bourne Shell.''
+
@cindex LGPL (Lesser General Public License)
@cindex Lesser General Public License (LGPL)
@cindex GNU Lesser General Public License
@@ -40799,6 +40588,14 @@ Characters used within a regexp that do not stand for themselves.
Instead, they denote regular expression operations, such as repetition,
grouping, or alternation.
+@item Nesting
+Nesting is where information is organized in layers, or where objects
+contain other similar objects.
+In @command{gawk} the @code{@@include}
+directive can be nested. The ``natural'' nesting of arithmetic and
+logical operations can be changed using parentheses
+(@pxref{Precedence}).
+
@item No-op
An operation that does nothing.
@@ -40819,6 +40616,11 @@ Octal numbers are written in C using a leading @samp{0},
to indicate their base. Thus, @code{013} is 11 ((1 x 8) + 3).
@xref{Nondecimal-numbers}.
+@item Output Record
+A single chunk of data that is written out by @command{awk}. Usually, an
+@command{awk} output record consists of one or more lines of text.
+@xref{Records}.
+
@item Pattern
Patterns tell @command{awk} which input records are interesting to which
rules.
@@ -40833,6 +40635,9 @@ An acronym describing what is possibly the most frequent
source of computer usage problems. (Problem Exists Between
Keyboard And Chair.)
+@item Plug-in
+See ``Extensions.''
+
@item POSIX
The name for a series of standards
that specify a Portable Operating System interface. The ``IX'' denotes
@@ -40857,6 +40662,9 @@ A sequence of consecutive lines from the input file(s). A pattern
can specify ranges of input lines for @command{awk} to process or it can
specify single lines. (@xref{Pattern Overview}.)
+@item Record
+See ``Input record'' and ``Output record.''
+
@item Recursion
When a function calls itself, either directly or indirectly.
If this is clear, stop, and proceed to the next entry.
@@ -40874,6 +40682,15 @@ operators.
(@xref{Getline},
and @ref{Redirection}.)
+@item Reference Counts
+An internal mechanism in @command{gawk} to minimize the amount of memory
+needed to store the value of string variables. If the value assumed by
+a variable is used in more than one place, only one copy of the value
+itself is kept, and the associated reference count is increased when the
+same value is used by an additional variable, and decresed when the related
+variable is no longer in use. When the reference count goes to zero,
+the memory space used to store the value of the variable is freed.
+
@item Regexp
See ``Regular Expression.''
@@ -40891,6 +40708,15 @@ slashes, such as @code{/foo/}. This regular expression is chosen
when you write the @command{awk} program and cannot be changed during
its execution. (@xref{Regexp Usage}.)
+@item Regular Expression Operators
+See ``Metacharacters.''
+
+@item Rounding
+Rounding the result of an arithmetic operation can be tricky.
+More than one way of rounding exists, and in @command{gawk}
+it is possible to choose which method should be used in a program.
+@xref{Setting the rounding mode}.
+
@item Rule
A segment of an @command{awk} program that specifies how to process single
input records. A rule consists of a @dfn{pattern} and an @dfn{action}.
@@ -40950,6 +40776,12 @@ A @value{FN} interpreted internally by @command{gawk}, instead of being handed
directly to the underlying operating system---for example, @file{/dev/stderr}.
(@xref{Special Files}.)
+@item Statement
+An expression inside an @command{awk} program in the action part
+of a pattern--action rule, or inside an
+@command{awk} function. A statement can be a variable assignment,
+an array operation, a loop, etc.
+
@item Stream Editor
A program that reads records from an input stream and processes them one
or more at a time. This is in contrast with batch programs, which may
@@ -41000,9 +40832,14 @@ This is standard time in Greenwich, England, which is used as a
reference time for day and date calculations.
See also ``Epoch'' and ``GMT.''
+@item Variable
+A name for a value. In @command{awk}, variables may be either scalars
+or arrays.
+
@item Whitespace
A sequence of space, TAB, or newline characters occurring inside an input
record or a string.
+
@end table
@end ifclear
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index daf38adf..e557efae 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -467,7 +467,7 @@ particular records in a file and perform operations upon them.
@command{gawk}.
* Internationalization:: Getting @command{gawk} to speak your
language.
-* Debugger:: The @code{gawk} debugger.
+* Debugger:: The @command{gawk} debugger.
* Arbitrary Precision Arithmetic:: Arbitrary precision arithmetic with
@command{gawk}.
* Dynamic Extensions:: Adding new built-in functions to
@@ -952,7 +952,7 @@ particular records in a file and perform operations upon them.
* Internal File Ops:: The code for internal file operations.
* Using Internal File Ops:: How to use an external extension.
* Extension Samples:: The sample extensions that ship with
- @code{gawk}.
+ @command{gawk}.
* Extension Sample File Functions:: The file functions sample.
* Extension Sample Fnmatch:: An interface to @code{fnmatch()}.
* Extension Sample Fork:: An interface to @code{fork()} and
@@ -2566,9 +2566,7 @@ for programs that are provided on the @command{awk} command line.
(Also, placing the program in a file allows us to use a literal single quote in the program
text, instead of the magic @samp{\47}.)
-@c STARTOFRANGE sq1x
@cindex single quote (@code{'}) in @command{gawk} command lines
-@c STARTOFRANGE qs2x
@cindex @code{'} (single quote) in @command{gawk} command lines
If you want to clearly identify an @command{awk} program file as such,
you can add the extension @file{.awk} to the @value{FN}. This doesn't
@@ -2886,8 +2884,6 @@ $ @kbd{awk "BEGIN @{ print \"Here is a single quote <'>\" @}"}
@end example
@noindent
-@c ENDOFRANGE sq1x
-@c ENDOFRANGE qs2x
This option is also painful, because double quotes, backslashes, and dollar signs
are very common in more advanced @command{awk} programs.
@@ -3223,8 +3219,13 @@ no actions run.
After processing all the rules that match the line (and perhaps there are none),
@command{awk} reads the next line. (However,
-@pxref{Next Statement},
+@DBPXREF{Next Statement}
+@ifdocbook
+and @DBREF{Nextfile Statement}.)
+@end ifdocbook
+@ifnotdocbook
and also @pxref{Nextfile Statement}.)
+@end ifnotdocbook
This continues until the program reaches the end of the file.
For example, the following @command{awk} program contains two rules:
@@ -3489,7 +3490,7 @@ performing bit manipulation, for runtime string translation (internationalizatio
determining the type of a variable,
and array sorting.
-As we develop our presentation of the @command{awk} language, we introduce
+As we develop our presentation of the @command{awk} language, we will introduce
most of the variables and many of the functions. They are described
systematically in @DBREF{Built-in Variables} and in
@ref{Built-in}.
@@ -3543,7 +3544,7 @@ and Perl.}
@c FIXME: Review this chapter for summary of builtin functions called.
@itemize @value{BULLET}
@item
-Programs in @command{awk} consist of @var{pattern}-@var{action} pairs.
+Programs in @command{awk} consist of @var{pattern}--@var{action} pairs.
@item
An @var{action} without a @var{pattern} always runs. The default
@@ -3572,7 +3573,7 @@ part of a larger shell script (or MS-Windows batch file).
You may use backslash continuation to continue a source line.
Lines are automatically continued after
a comma, open brace, question mark, colon,
-@samp{||}, @samp{&&}, @code{do} and @code{else}.
+@samp{||}, @samp{&&}, @code{do}, and @code{else}.
@end itemize
@node Invoking Gawk
@@ -3647,20 +3648,16 @@ warning that the program is empty.
@node Options
@section Command-Line Options
-@c STARTOFRANGE ocl
@cindex options, command-line
-@c STARTOFRANGE clo
@cindex command line, options
-@c STARTOFRANGE gnulo
@cindex GNU long options
-@c STARTOFRANGE longo
@cindex options, long
Options begin with a dash and consist of a single character.
GNU-style long options consist of two dashes and a keyword.
The keyword can be abbreviated, as long as the abbreviation allows the option
-to be uniquely identified. If the option takes an argument, then the
-keyword is either immediately followed by an equals sign (@samp{=}) and the
+to be uniquely identified. If the option takes an argument, either the
+keyword is immediately followed by an equals sign (@samp{=}) and the
argument's value, or the keyword and the argument's value are separated
by whitespace.
If a particular option with a value is given more than once, it is the
@@ -3687,7 +3684,7 @@ Set the @code{FS} variable to @var{fs}
@cindex @option{-f} option
@cindex @option{--file} option
@cindex @command{awk} programs, location of
-Read @command{awk} program source from @var{source-file}
+Read the @command{awk} program source from @var{source-file}
instead of in the first nonoption argument.
This option may be given multiple times; the @command{awk}
program consists of the concatenation of the contents of
@@ -3742,8 +3739,6 @@ by the user that could start with @samp{-}.
It is also useful for passing options on to the @command{awk}
program; see @ref{Getopt Function}.
@end table
-@c ENDOFRANGE gnulo
-@c ENDOFRANGE longo
The following list describes @command{gawk}-specific options:
@@ -3755,14 +3750,14 @@ The following list describes @command{gawk}-specific options:
@cindex @option{--characters-as-bytes} option
Cause @command{gawk} to treat all input data as single-byte characters.
In addition, all output written with @code{print} or @code{printf}
-are treated as single-byte characters.
+is treated as single-byte characters.
Normally, @command{gawk} follows the POSIX standard and attempts to process
its input data according to the current locale (@pxref{Locales}). This can often involve
converting multibyte characters into wide characters (internally), and
can lead to problems or confusion if the input data does not contain valid
-multibyte characters. This option is an easy way to tell @command{gawk}:
-``hands off my data!''.
+multibyte characters. This option is an easy way to tell @command{gawk},
+``Hands off my data!''
@item @option{-c}
@itemx @option{--traditional}
@@ -3819,7 +3814,7 @@ Enable debugging of @command{awk} programs
By default, the debugger reads commands interactively from the keyboard
(standard input).
The optional @var{file} argument allows you to specify a file with a list
-of commands for the debugger to execute non-interactively.
+of commands for the debugger to execute noninteractively.
No space is allowed between the @option{-D} and @var{file}, if
@var{file} is supplied.
@@ -3879,7 +3874,7 @@ with @samp{#!} scripts (@pxref{Executable Scripts}), like so:
@cindex portable object files, generating
@cindex files, portable object, generating
Analyze the source program and
-generate a GNU @command{gettext} Portable Object Template file on standard
+generate a GNU @command{gettext} portable object template file on standard
output for all string constants that have been marked for translation.
@xref{Internationalization},
for information about this option.
@@ -3891,7 +3886,7 @@ for information about this option.
@cindex GNU long options, printing list of
@cindex options, printing list of
@cindex printing, list of options
-Print a ``usage'' message summarizing the short and long style options
+Print a ``usage'' message summarizing the short- and long-style options
that @command{gawk} accepts and then exit.
@item @option{-i} @var{source-file}
@@ -3901,7 +3896,7 @@ that @command{gawk} accepts and then exit.
@cindex @command{awk} programs, location of
Read an @command{awk} source library from @var{source-file}. This option
is completely equivalent to using the @code{@@include} directive inside
-your program. This option is very similar to the @option{-f} option,
+your program. It is very similar to the @option{-f} option,
but there are two important differences. First, when @option{-i} is
used, the program source is not loaded if it has been previously
loaded, whereas with @option{-f}, @command{gawk} always loads the file.
@@ -3986,7 +3981,7 @@ when parsing numeric input data (@pxref{Locales}).
@cindex @option{-o} option
@cindex @option{--pretty-print} option
Enable pretty-printing of @command{awk} programs.
-By default, output program is created in a file named @file{awkprof.out}
+By default, the output program is created in a file named @file{awkprof.out}
(@pxref{Profiling}).
The optional @var{file} argument allows you to specify a different
@value{FN} for the output.
@@ -4030,7 +4025,7 @@ in the left margin, and function call counts for each function.
Operate in strict POSIX mode. This disables all @command{gawk}
extensions (just like @option{--traditional}) and
disables all extensions not allowed by POSIX.
-@xref{Common Extensions}, for a summary of the extensions
+@DBXREF{Common Extensions} for a summary of the extensions
in @command{gawk} that are disabled by this option.
Also,
the following additional
@@ -4151,7 +4146,7 @@ source of data.)
Because it is clumsy using the standard @command{awk} mechanisms to mix
source file and command-line @command{awk} programs, @command{gawk}
provides the @option{-e} option. This does not require you to
-pre-empt the standard input for your source code; it allows you to easily
+preempt the standard input for your source code; it allows you to easily
mix command-line and library source code (@pxref{AWKPATH Variable}).
As with @option{-f}, the @option{-e} and @option{-i}
options may also be used multiple times on the command line.
@@ -4197,8 +4192,6 @@ setenv POSIXLY_CORRECT true
Having @env{POSIXLY_CORRECT} set is not recommended for daily use,
but it is good for testing the portability of your programs to other
environments.
-@c ENDOFRANGE ocl
-@c ENDOFRANGE clo
@node Other Arguments
@section Other Command-Line Arguments
@@ -4341,7 +4334,7 @@ file, unless the file is in the current directory.
But with @command{gawk}, if the @value{FN} supplied to the @option{-f}
or @option{-i} options
does not contain a directory separator @samp{/}, then @command{gawk} searches a list of
-directories (called the @dfn{search path}), one by one, looking for a
+directories (called the @dfn{search path}) one by one, looking for a
file with the specified name.
The search path is a string consisting of directory names
@@ -4382,9 +4375,9 @@ as an entry in the path or write a null entry in the path.
Different past versions of @command{gawk} would also look explicitly in
the current directory, either before or after the path search. As of
-@value{PVERSION} 4.1.2, this no longer happens, and if you wish to look
+@value{PVERSION} 4.1.2, this no longer happens; if you wish to look
in the current directory, you must include @file{.} either as a separate
-entry, or as a null entry in the search path.
+entry or as a null entry in the search path.
@end quotation
The default value for @env{AWKPATH} is
@@ -4500,7 +4493,7 @@ If this variable exists, @command{gawk} includes the @value{FN}
and line number within the @command{gawk} source code
from which warning and/or fatal messages
are generated. Its purpose is to help isolate the source of a
-message, as there are multiple places which produce the
+message, as there are multiple places that produce the
same warning or error message.
@item GAWK_NO_DFA
@@ -4516,16 +4509,16 @@ This specifies the amount by which @command{gawk} should grow its
internal evaluation stack, when needed.
@item INT_CHAIN_MAX
-The intended maximum number of items @command{gawk} will maintain on a
+This specifies intended maximum number of items @command{gawk} will maintain on a
hash chain for managing arrays indexed by integers.
@item STR_CHAIN_MAX
-The intended maximum number of items @command{gawk} will maintain on a
+This specifies intended maximum number of items @command{gawk} will maintain on a
hash chain for managing arrays indexed by strings.
@item TIDYMEM
If this variable exists, @command{gawk} uses the @code{mtrace()} library
-calls from GNU LIBC to help track down possible memory leaks.
+calls from the GNU C library to help track down possible memory leaks.
@end table
@node Exit Status
@@ -4562,7 +4555,7 @@ The @code{@@include} keyword can be used to read external @command{awk} source
files. This gives you the ability to split large @command{awk} source files
into smaller, more manageable pieces, and also lets you reuse common @command{awk}
code from various @command{awk} scripts. In other words, you can group
-together @command{awk} functions, used to carry out specific tasks,
+together @command{awk} functions used to carry out specific tasks
into external files. These files can be used just like function libraries,
using the @code{@@include} keyword in conjunction with the @env{AWKPATH}
environment variable. Note that source files may also be included
@@ -4597,7 +4590,7 @@ $ @kbd{gawk -f test2}
@print{} This is script test2.
@end example
-@code{gawk} runs the @file{test2} script, which includes @file{test1}
+@command{gawk} runs the @file{test2} script, which includes @file{test1}
using the @code{@@include}
keyword. So, to include external @command{awk} source files, you just
use @code{@@include} followed by the name of the file to be included,
@@ -4652,11 +4645,12 @@ of the @env{AWKPATH} variable in command-line file searches
This is very helpful in constructing @command{gawk} function libraries.
If you have a large script with useful, general-purpose @command{awk}
functions, you can break it down into library files and put those files
-in a special directory. You can then include those ``libraries,'' using
-either the full pathnames of the files, or by setting the @env{AWKPATH}
+in a special directory. You can then include those ``libraries,''
+either by using the full pathnames of the files, or by setting the @env{AWKPATH}
environment variable accordingly and then using @code{@@include} with
-just the file part of the full pathname. Of course, you can have more
-than one directory to keep library files; the more complex the working
+just the file part of the full pathname. Of course,
+you can keep library files in more than one directory;
+the more complex the working
environment is, the more directories you may need to organize the files
to be included.
@@ -4669,8 +4663,8 @@ In particular, @code{@@include} is very useful for writing CGI scripts
to be run from web pages.
As mentioned in @ref{AWKPATH Variable}, the current directory is always
-searched first for source files, before searching in @env{AWKPATH},
-and this also applies to files named with @code{@@include}.
+searched first for source files, before searching in @env{AWKPATH};
+this also applies to files named with @code{@@include}.
@node Loading Shared Libraries
@section Loading Dynamic Extensions into Your Program
@@ -4724,8 +4718,8 @@ It also describes the @code{ordchr} extension.
@cindex features, deprecated
@cindex obsolete features
This @value{SECTION} describes features and/or command-line options from
-previous releases of @command{gawk} that are either not available in the
-current version or that are still supported but deprecated (meaning that
+previous releases of @command{gawk} that either are not available in the
+current version or are still supported but deprecated (meaning that
they will @emph{not} be in the next release).
The process-related special files @file{/dev/pid}, @file{/dev/ppid},
@@ -4805,7 +4799,7 @@ This seems to have been a long-undocumented feature in Unix @command{awk}.
Similarly, you may use @code{print} or @code{printf} statements in the
@var{init} and @var{increment} parts of a @code{for} loop. This is another
-long-undocumented ``feature'' of Unix @code{awk}.
+long-undocumented ``feature'' of Unix @command{awk}.
@end ignore
@@ -4822,7 +4816,7 @@ to run @command{awk}.
@item
The three standard options for all versions of @command{awk} are
-@option{-f}, @option{-F} and @option{-v}. @command{gawk} supplies these
+@option{-f}, @option{-F}, and @option{-v}. @command{gawk} supplies these
and many others, as well as corresponding GNU-style long options.
@item
@@ -4859,13 +4853,12 @@ and @option{-f} command-line options.
@item
@command{gawk} allows you to load additional functions written in C
or C++ using the @code{@@load} statement and/or the @option{-l} option.
-(This advanced feature is described later on in @ref{Dynamic Extensions}.)
+(This advanced feature is described later, in @ref{Dynamic Extensions}.)
@end itemize
@node Regexp
@chapter Regular Expressions
@cindex regexp
-@c STARTOFRANGE regexp
@cindex regular expressions
A @dfn{regular expression}, or @dfn{regexp}, is a way of describing a
@@ -5072,7 +5065,7 @@ Horizontal TAB, @kbd{Ctrl-i}, ASCII code 9 (HT).
@cindex @code{\} (backslash), @code{\v} escape sequence
@cindex backslash (@code{\}), @code{\v} escape sequence
@item \v
-Vertical tab, @kbd{Ctrl-k}, ASCII code 11 (VT).
+Vertical TAB, @kbd{Ctrl-k}, ASCII code 11 (VT).
@cindex @code{\} (backslash), @code{\}@var{nnn} escape sequence
@cindex backslash (@code{\}), @code{\}@var{nnn} escape sequence
@@ -5147,7 +5140,7 @@ characters @samp{a+b}.
@cindex @code{\} (backslash), in escape sequences
@cindex portability
For complete portability, do not use a backslash before any character not
-shown in the previous list and that is not an operator.
+shown in the previous list or that is not an operator.
@c 11/2014: Moved so as to not stack sidebars
@sidebar Backslash Before Regular Characters
@@ -5226,7 +5219,6 @@ escape sequences literally when used in regexp constants. Thus,
@node Regexp Operators
@section Regular Expression Operators
-@c STARTOFRANGE regexpo
@cindex regular expressions, operators
@cindex metacharacters in regular expressions
@@ -5244,7 +5236,7 @@ are recognized and converted into corresponding real characters as
the very first step in processing regexps.
Here is a list of metacharacters. All characters that are not escape
-sequences and that are not listed in the following stand for themselves:
+sequences and that are not listed here stand for themselves:
@c Use @asis so the docbook comes out ok. Sigh.
@table @asis
@@ -5367,7 +5359,7 @@ just @samp{p} if no @samp{h}s are present.
There are two subtle points to understand about how @samp{*} works.
First, the @samp{*} applies only to the single preceding regular expression
component (e.g., in @samp{ph*}, it applies just to the @samp{h}).
-To cause @samp{*} to apply to a larger sub-expression, use parentheses:
+To cause @samp{*} to apply to a larger subexpression, use parentheses:
@samp{(ph)*} matches @samp{ph}, @samp{phph}, @samp{phphph}, and so on.
Second, @samp{*} finds as many repetitions as possible. If the text
@@ -5406,10 +5398,10 @@ is repeated at least @var{n} times:
Matches @samp{whhhy}, but not @samp{why} or @samp{whhhhy}.
@item wh@{3,5@}y
-Matches @samp{whhhy}, @samp{whhhhy}, or @samp{whhhhhy}, only.
+Matches @samp{whhhy}, @samp{whhhhy}, or @samp{whhhhhy} only.
@item wh@{2,@}y
-Matches @samp{whhy} or @samp{whhhy}, and so on.
+Matches @samp{whhy}, @samp{whhhy}, and so on.
@end table
@cindex POSIX @command{awk}, interval expressions in
@@ -5458,11 +5450,9 @@ usage as a syntax error.
If @command{gawk} is in compatibility mode (@pxref{Options}), interval
expressions are not available in regular expressions.
-@c ENDOFRANGE regexpo
@node Bracket Expressions
@section Using Bracket Expressions
-@c STARTOFRANGE charlist
@cindex bracket expressions
@cindex bracket expressions, range expressions
@cindex range expressions (regexps)
@@ -5538,7 +5528,7 @@ POSIX standard.
(a space is printable but not visible, whereas an @samp{a} is both)
@item @code{[:lower:]} @tab Lowercase alphabetic characters
@item @code{[:print:]} @tab Printable characters (characters that are not control characters)
-@item @code{[:punct:]} @tab Punctuation characters (characters that are not letters, digits
+@item @code{[:punct:]} @tab Punctuation characters (characters that are not letters, digits,
control characters, or space characters)
@item @code{[:space:]} @tab Space characters (such as space, TAB, and formfeed, to name a few)
@item @code{[:upper:]} @tab Uppercase alphabetic characters
@@ -5558,11 +5548,11 @@ and numeric characters in your character set.
@c Date: Tue, 01 Jul 2014 07:39:51 +0200
@c From: Hermann Peifer <peifer@gmx.eu>
Some utilities that match regular expressions provide a nonstandard
-@code{[:ascii:]} character class; @command{awk} does not. However, you
-can simulate such a construct using @code{[\x00-\x7F]}. This matches
+@samp{[:ascii:]} character class; @command{awk} does not. However, you
+can simulate such a construct using @samp{[\x00-\x7F]}. This matches
all values numerically between zero and 127, which is the defined
range of the ASCII character set. Use a complemented character list
-(@code{[^\x00-\x7F]}) to match any single-byte characters that are not
+(@samp{[^\x00-\x7F]}) to match any single-byte characters that are not
in the ASCII range.
@cindex bracket expressions, collating elements
@@ -5591,8 +5581,8 @@ Locale-specific names for a list of
characters that are equal. The name is enclosed between
@samp{[=} and @samp{=]}.
For example, the name @samp{e} might be used to represent all of
-``e,'' ``@`e,'' and ``@'e.'' In this case, @samp{[[=e=]]} is a regexp
-that matches any of @samp{e}, @samp{@'e}, or @samp{@`e}.
+``e,'' ``@^e,'' ``@`e,'' and ``@'e.'' In this case, @samp{[[=e=]]} is a regexp
+that matches any of @samp{e}, @samp{@^e}, @samp{@'e}, or @samp{@`e}.
@end table
These features are very valuable in non-English-speaking locales.
@@ -5606,7 +5596,6 @@ expression matching currently recognize only POSIX character classes;
they do not recognize collating symbols or equivalence classes.
@end quotation
@c maybe one day ...
-@c ENDOFRANGE charlist
@node Leftmost Longest
@section How Much Text Matches?
@@ -5622,7 +5611,7 @@ echo aaaabcd | awk '@{ sub(/a+/, "<A>"); print @}'
This example uses the @code{sub()} function to make a change to the input
record. (@code{sub()} replaces the first instance of any text matched
by the first argument with the string provided as the second argument;
-@pxref{String Functions}). Here, the regexp @code{/a+/} indicates ``one
+@pxref{String Functions}.) Here, the regexp @code{/a+/} indicates ``one
or more @samp{a} characters,'' and the replacement text is @samp{<A>}.
The input contains four @samp{a} characters.
@@ -5650,9 +5639,7 @@ and also @pxref{Field Separators}).
@node Computed Regexps
@section Using Dynamic Regexps
-@c STARTOFRANGE dregexp
@cindex regular expressions, computed
-@c STARTOFRANGE regexpd
@cindex regular expressions, dynamic
@cindex @code{~} (tilde), @code{~} operator
@cindex tilde (@code{~}), @code{~} operator
@@ -5678,14 +5665,14 @@ and tests whether the input record matches this regexp.
@quotation NOTE
When using the @samp{~} and @samp{!~}
-operators, there is a difference between a regexp constant
+operators, be aware that there is a difference between a regexp constant
enclosed in slashes and a string constant enclosed in double quotes.
If you are going to use a string constant, you have to understand that
the string is, in essence, scanned @emph{twice}: the first time when
@command{awk} reads your program, and the second time when it goes to
match the string on the lefthand side of the operator with the pattern
on the right. This is true of any string-valued expression (such as
-@code{digits_regexp}, shown previously), not just string constants.
+@code{digits_regexp}, shown in the previous example), not just string constants.
@end quotation
@cindex regexp constants, slashes vs.@: quotes
@@ -5759,17 +5746,13 @@ $ @kbd{awk '$0 ~ /[ \t\n]/'}
@command{gawk} does not have this problem, and it isn't likely to
occur often in practice, but it's worth noting for future reference.
@end sidebar
-@c ENDOFRANGE dregexp
-@c ENDOFRANGE regexpd
@node GNU Regexp Operators
@section @command{gawk}-Specific Regexp Operators
@c This section adapted (long ago) from the regex-0.12 manual
-@c STARTOFRANGE regexpg
@cindex regular expressions, operators, @command{gawk}
-@c STARTOFRANGE gregexp
@cindex @command{gawk}, regular expressions, operators
@cindex operators, GNU-specific
@cindex regular expressions, operators, for words
@@ -5845,7 +5828,7 @@ matches either @samp{ball} or @samp{balls}, as a separate word.
@item \B
Matches the empty string that occurs between two
word-constituent characters. For example,
-@code{/\Brat\B/} matches @samp{crate} but it does not match @samp{dirty rat}.
+@code{/\Brat\B/} matches @samp{crate}, but it does not match @samp{dirty rat}.
@samp{\B} is essentially the opposite of @samp{\y}.
@end table
@@ -5864,14 +5847,14 @@ The operators are:
@cindex backslash (@code{\}), @code{\`} operator (@command{gawk})
@cindex @code{\} (backslash), @code{\`} operator (@command{gawk})
Matches the empty string at the
-beginning of a buffer (string).
+beginning of a buffer (string)
@c @cindex operators, @code{\'} (@command{gawk})
@cindex backslash (@code{\}), @code{\'} operator (@command{gawk})
@cindex @code{\} (backslash), @code{\'} operator (@command{gawk})
@item \'
Matches the empty string at the
-end of a buffer (string).
+end of a buffer (string)
@end table
@cindex @code{^} (caret), regexp operator
@@ -5934,15 +5917,11 @@ Allow interval expressions in regexps, if @option{--traditional}
has been provided.
Otherwise, interval expressions are available by default.
@end table
-@c ENDOFRANGE gregexp
-@c ENDOFRANGE regexpg
@node Case-sensitivity
@section Case Sensitivity in Matching
-@c STARTOFRANGE regexpcs
@cindex regular expressions, case sensitivity
-@c STARTOFRANGE csregexp
@cindex case sensitivity, regexps and
Case is normally significant in regular expressions, both when matching
ordinary characters (i.e., not metacharacters) and inside bracket
@@ -6034,8 +6013,6 @@ the right thing.}
The value of @code{IGNORECASE} has no effect if @command{gawk} is in
compatibility mode (@pxref{Options}).
Case is always significant in compatibility mode.
-@c ENDOFRANGE csregexp
-@c ENDOFRANGE regexpcs
@node Regexp Summary
@section Summary
@@ -6082,12 +6059,10 @@ versions, use @code{tolower()} or @code{toupper()}.
@end itemize
-@c ENDOFRANGE regexp
@node Reading Files
@chapter Reading Input Files
-@c STARTOFRANGE infir
@cindex reading input files
@cindex input files, reading
@cindex input files
@@ -6112,7 +6087,7 @@ This makes it more convenient for programs to work on the parts of a record.
@cindex @code{getline} command
On rare occasions, you may need to use the @code{getline} command.
-The @code{getline} command is valuable, both because it
+The @code{getline} command is valuable both because it
can do explicit input from any number of files, and because the files
used with it do not have to be named on the @command{awk} command line
(@pxref{Getline}).
@@ -6139,9 +6114,7 @@ used with it do not have to be named on the @command{awk} command line
@node Records
@section How Input Is Split into Records
-@c STARTOFRANGE inspl
@cindex input, splitting into records
-@c STARTOFRANGE recspl
@cindex records, splitting input into
@cindex @code{NR} variable
@cindex @code{FNR} variable
@@ -6166,8 +6139,8 @@ never automatically reset to zero.
Records are separated by a character called the @dfn{record separator}.
By default, the record separator is the newline character.
This is why records are, by default, single lines.
-A different character can be used for the record separator by
-assigning the character to the predefined variable @code{RS}.
+To use a different character for the record separator,
+simply assign that character to the predefined variable @code{RS}.
@cindex newlines, as record separators
@cindex @code{RS} variable
@@ -6190,8 +6163,8 @@ awk 'BEGIN @{ RS = "u" @}
@noindent
changes the value of @code{RS} to @samp{u}, before reading any input.
-This is a string whose first character is the letter ``u''; as a result, records
-are separated by the letter ``u.'' Then the input file is read, and the second
+The new value is a string whose first character is the letter ``u''; as a result, records
+are separated by the letter ``u''. Then the input file is read, and the second
rule in the @command{awk} program (the action with no pattern) prints each
record. Because each @code{print} statement adds a newline at the end of
its output, this @command{awk} program copies the input
@@ -6252,8 +6225,8 @@ Bill 555-1675 bill.drowning@@hotmail.com A
@end example
@noindent
-It contains no @samp{u} so there is no reason to split the record,
-unlike the others which have one or more occurrences of the @samp{u}.
+It contains no @samp{u}, so there is no reason to split the record,
+unlike the others, which each have one or more occurrences of the @samp{u}.
In fact, this record is treated as part of the previous record;
the newline separating them in the output
is the original newline in the @value{DF}, not the one added by
@@ -6348,7 +6321,7 @@ contains the same single character. However, when @code{RS} is a
regular expression, @code{RT} contains
the actual input text that matched the regular expression.
-If the input file ended without any text that matches @code{RS},
+If the input file ends without any text matching @code{RS},
@command{gawk} sets @code{RT} to the null string.
The following example illustrates both of these features.
@@ -6441,8 +6414,6 @@ character as a record separator. However, this is a special case:
whole files. If you are using @command{gawk}, see @DBREF{Extension Sample
Readfile} for another option.
@end sidebar
-@c ENDOFRANGE inspl
-@c ENDOFRANGE recspl
@node Fields
@section Examining Fields
@@ -6450,7 +6421,6 @@ Readfile} for another option.
@cindex examining fields
@cindex fields
@cindex accessing fields
-@c STARTOFRANGE fiex
@cindex fields, examining
@cindex POSIX @command{awk}, field separators and
@cindex field separators, POSIX and
@@ -6475,11 +6445,11 @@ simple @command{awk} programs so powerful.
@cindex @code{$} (dollar sign), @code{$} field operator
@cindex dollar sign (@code{$}), @code{$} field operator
@cindex field operators@comma{} dollar sign as
-You use a dollar-sign (@samp{$})
+You use a dollar sign (@samp{$})
to refer to a field in an @command{awk} program,
followed by the number of the field you want. Thus, @code{$1}
refers to the first field, @code{$2} to the second, and so on.
-(Unlike the Unix shells, the field numbers are not limited to single digits.
+(Unlike in the Unix shells, the field numbers are not limited to single digits.
@code{$127} is the 127th field in the record.)
For example, suppose the following is a line of input:
@@ -6505,7 +6475,7 @@ If you try to reference a field beyond the last
one (such as @code{$8} when the record has only seven fields), you get
the empty string. (If used in a numeric operation, you get zero.)
-The use of @code{$0}, which looks like a reference to the ``zero-th'' field, is
+The use of @code{$0}, which looks like a reference to the ``zeroth'' field, is
a special case: it represents the whole input record. Use it
when you are not interested in specific fields.
Here are some more examples:
@@ -6531,7 +6501,6 @@ $ @kbd{awk '/li/ @{ print $1, $NF @}' mail-list}
@print{} Julie F
@print{} Samuel A
@end example
-@c ENDOFRANGE fiex
@node Nonconstant Fields
@section Nonconstant Field Numbers
@@ -6561,13 +6530,13 @@ awk '@{ print $(2*2) @}' mail-list
@end example
@command{awk} evaluates the expression @samp{(2*2)} and uses
-its value as the number of the field to print. The @samp{*} sign
+its value as the number of the field to print. The @samp{*}
represents multiplication, so the expression @samp{2*2} evaluates to four.
The parentheses are used so that the multiplication is done before the
@samp{$} operation; they are necessary whenever there is a binary
operator@footnote{A @dfn{binary operator}, such as @samp{*} for
multiplication, is one that takes two operands. The distinction
-is required, because @command{awk} also has unary (one-operand)
+is required because @command{awk} also has unary (one-operand)
and ternary (three-operand) operators.}
in the field-number expression. This example, then, prints the
type of relationship (the fourth field) for every line of the file
@@ -6592,7 +6561,6 @@ evaluating @code{NF} and using its value as a field number.
@node Changing Fields
@section Changing the Contents of a Field
-@c STARTOFRANGE ficon
@cindex fields, changing contents of
The contents of a field, as seen by @command{awk}, can be changed within an
@command{awk} program; this changes what @command{awk} perceives as the
@@ -6748,7 +6716,7 @@ rebuild @code{$0} when @code{NF} is decremented.
Finally, there are times when it is convenient to force
@command{awk} to rebuild the entire record, using the current
-value of the fields and @code{OFS}. To do this, use the
+values of the fields and @code{OFS}. To do this, use the
seemingly innocuous assignment:
@example
@@ -6772,7 +6740,7 @@ such as @code{sub()} and @code{gsub()}
It is important to remember that @code{$0} is the @emph{full}
record, exactly as it was read from the input. This includes
any leading or trailing whitespace, and the exact whitespace (or other
-characters) that separate the fields.
+characters) that separates the fields.
It is a common error to try to change the field separators
in a record simply by setting @code{FS} and @code{OFS}, and then
@@ -6784,7 +6752,6 @@ itself. Instead, you must force the record to be rebuilt, typically
with a statement such as @samp{$1 = $1}, as described earlier.
@end sidebar
-@c ENDOFRANGE ficon
@node Field Separators
@section Specifying How Fields Are Separated
@@ -6800,9 +6767,7 @@ with a statement such as @samp{$1 = $1}, as described earlier.
@cindex @code{FS} variable
@cindex fields, separating
-@c STARTOFRANGE fisepr
@cindex field separators
-@c STARTOFRANGE fisepg
@cindex fields, separating
The @dfn{field separator}, which is either a single character or a regular
expression, controls the way @command{awk} splits an input record into fields.
@@ -6868,7 +6833,7 @@ John Q. Smith, LXIX, 29 Oak St., Walamazoo, MI 42139
@end example
@noindent
-The same program would extract @samp{@bullet{}LXIX}, instead of
+The same program would extract @samp{@bullet{}LXIX} instead of
@samp{@bullet{}29@bullet{}Oak@bullet{}St.}.
If you were expecting the program to print the
address, you would be surprised. The moral is to choose your data layout and
@@ -6902,9 +6867,7 @@ rules.
@node Regexp Field Splitting
@subsection Using Regular Expressions to Separate Fields
-@c STARTOFRANGE regexpfs
@cindex regular expressions, as field separators
-@c STARTOFRANGE fsregexp
@cindex field separators, regular expressions as
The previous @value{SUBSECTION}
discussed the use of single characters or simple strings as the
@@ -7008,8 +6971,6 @@ $ @kbd{echo 'xxAA xxBxx C' |}
@print{} -->xxBxx<--
@print{} -->C<--
@end example
-@c ENDOFRANGE regexpfs
-@c ENDOFRANGE fsregexp
@node Single Character Fields
@subsection Making Each Character a Separate Field
@@ -7133,7 +7094,7 @@ choosing your field and record separators.
@cindex Unix @command{awk}, password files@comma{} field separators and
Perhaps the most common use of a single character as the field separator
occurs when processing the Unix system password file. On many Unix
-systems, each user has a separate entry in the system password file, one
+systems, each user has a separate entry in the system password file, with one
line per user. The information in these lines is separated by colons.
The first field is the user's login name and the second is the user's
encrypted or shadow password. (A shadow password is indicated by the
@@ -7174,7 +7135,7 @@ When you do this, @code{$1} is the same as @code{$0}.
According to the POSIX standard, @command{awk} is supposed to behave
as if each record is split into fields at the time it is read.
In particular, this means that if you change the value of @code{FS}
-after a record is read, the value of the fields (i.e., how they were split)
+after a record is read, the values of the fields (i.e., how they were split)
should reflect the old value of @code{FS}, not the new one.
@cindex dark corner, field separators
@@ -7187,10 +7148,7 @@ using the @emph{current} value of @code{FS}!
@value{DARKCORNER}
This behavior can be difficult
to diagnose. The following example illustrates the difference
-between the two methods.
-(The @command{sed}@footnote{The @command{sed} utility is a ``stream editor.''
-Its behavior is also defined by the POSIX standard.}
-command prints just the first line of @file{/etc/passwd}.)
+between the two methods:
@example
sed 1q /etc/passwd | awk '@{ FS = ":" ; print $1 @}'
@@ -7210,6 +7168,10 @@ prints the full first line of the file, something like:
@example
root:x:0:0:Root:/:
@end example
+
+(The @command{sed}@footnote{The @command{sed} utility is a ``stream editor.''
+Its behavior is also defined by the POSIX standard.}
+command prints just the first line of @file{/etc/passwd}.)
@end sidebar
@node Field Splitting Summary
@@ -7270,8 +7232,6 @@ do it for you (e.g., @samp{FS = "[c]"}). In this case, @code{IGNORECASE}
will take effect.
@end sidebar
-@c ENDOFRANGE fisepr
-@c ENDOFRANGE fisepg
@node Constant Size
@section Reading Fixed-Width Data
@@ -7386,7 +7346,7 @@ In order to tell which kind of field splitting is in effect,
use @code{PROCINFO["FS"]}
(@pxref{Auto-set}).
The value is @code{"FS"} if regular field splitting is being used,
-or it is @code{"FIELDWIDTHS"} if fixed-width field splitting is being used:
+or @code{"FIELDWIDTHS"} if fixed-width field splitting is being used:
@example
if (PROCINFO["FS"] == "FS")
@@ -7422,14 +7382,14 @@ what they are, and not by what they are not.
The most notorious such case
is so-called @dfn{comma-separated values} (CSV) data. Many spreadsheet programs,
for example, can export their data into text files, where each record is
-terminated with a newline, and fields are separated by commas. If only
-commas separated the data, there wouldn't be an issue. The problem comes when
+terminated with a newline, and fields are separated by commas. If
+commas only separated the data, there wouldn't be an issue. The problem comes when
one of the fields contains an @emph{embedded} comma.
In such cases, most programs embed the field in double quotes.@footnote{The
CSV format lacked a formal standard definition for many years.
@uref{http://www.ietf.org/rfc/rfc4180.txt, RFC 4180}
standardizes the most common practices.}
-So we might have data like this:
+So, we might have data like this:
@example
@c file eg/misc/addresses.csv
@@ -7515,8 +7475,8 @@ of cases, and the @command{gawk} developers are satisfied with that.
@end quotation
As written, the regexp used for @code{FPAT} requires that each field
-have a least one character. A straightforward modification
-(changing changed the first @samp{+} to @samp{*}) allows fields to be empty:
+contain at least one character. A straightforward modification
+(changing the first @samp{+} to @samp{*}) allows fields to be empty:
@example
FPAT = "([^,]*)|(\"[^\"]+\")"
@@ -7526,20 +7486,17 @@ Finally, the @code{patsplit()} function makes the same functionality
available for splitting regular strings (@pxref{String Functions}).
To recap, @command{gawk} provides three independent methods
-to split input records into fields. @command{gawk} uses whichever
-mechanism was last chosen based on which of the three
-variables---@code{FS}, @code{FIELDWIDTHS}, and @code{FPAT}---was
+to split input records into fields.
+The mechanism used is based on which of the three
+variables---@code{FS}, @code{FIELDWIDTHS}, or @code{FPAT}---was
last assigned to.
@node Multiple Line
@section Multiple-Line Records
@cindex multiple-line records
-@c STARTOFRANGE recm
@cindex records, multiline
-@c STARTOFRANGE imr
@cindex input, multiline records
-@c STARTOFRANGE frm
@cindex files, reading, multiline records
@cindex input, files, See input files
In some databases, a single line cannot conveniently hold all the
@@ -7574,7 +7531,7 @@ at the end of the record and one or more blank lines after the record.
In addition, a regular expression always matches the longest possible
sequence when there is a choice
(@pxref{Leftmost Longest}).
-So the next record doesn't start until
+So, the next record doesn't start until
the first nonblank line that follows---no matter how many blank lines
appear in a row, they are considered one record separator.
@@ -7589,10 +7546,10 @@ In the second case, this special processing is not done.
@cindex field separator, in multiline records
@cindex @code{FS}, in multiline records
Now that the input is separated into records, the second step is to
-separate the fields in the record. One way to do this is to divide each
+separate the fields in the records. One way to do this is to divide each
of the lines into fields in the normal manner. This happens by default
as the result of a special feature. When @code{RS} is set to the empty
-string, @emph{and} @code{FS} is set to a single character,
+string @emph{and} @code{FS} is set to a single character,
the newline character @emph{always} acts as a field separator.
This is in addition to whatever field separations result from
@code{FS}.@footnote{When @code{FS} is the null string (@code{""})
@@ -7607,7 +7564,7 @@ want the newline character to separate fields, because there is no way to
prevent it. However, you can work around this by using the @code{split()}
function to break up the record manually
(@pxref{String Functions}).
-If you have a single character field separator, you can work around
+If you have a single-character field separator, you can work around
the special feature in a different way, by making @code{FS} into a
regexp for that single character. For example, if the field
separator is a percent character, instead of
@@ -7615,10 +7572,10 @@ separator is a percent character, instead of
Another way to separate fields is to
put each field on a separate line: to do this, just set the
-variable @code{FS} to the string @code{"\n"}. (This single
-character separator matches a single newline.)
+variable @code{FS} to the string @code{"\n"}.
+(This single-character separator matches a single newline.)
A practical example of a @value{DF} organized this way might be a mailing
-list, where each entry is separated by blank lines. Consider a mailing
+list, where blank lines separate the entries. Consider a mailing
list in a file named @file{addresses}, which looks like this:
@example
@@ -7706,20 +7663,15 @@ If not in compatibility mode (@pxref{Options}), @command{gawk} sets
@code{RT} to the input text that matched the value specified by @code{RS}.
But if the input file ended without any text that matches @code{RS},
then @command{gawk} sets @code{RT} to the null string.
-@c ENDOFRANGE recm
-@c ENDOFRANGE imr
-@c ENDOFRANGE frm
@node Getline
@section Explicit Input with @code{getline}
-@c STARTOFRANGE getl
@cindex @code{getline} command, explicit input with
-@c STARTOFRANGE inex
@cindex input, explicit
So far we have been getting our input data from @command{awk}'s main
input stream---either the standard input (usually your keyboard, sometimes
-the output from another program) or from the
+the output from another program) or the
files specified on the command line. The @command{awk} language has a
special built-in command called @code{getline} that
can be used to read input under your explicit control.
@@ -7908,7 +7860,7 @@ free
@end example
The @code{getline} command used in this way sets only the variables
-@code{NR}, @code{FNR}, and @code{RT} (and of course, @var{var}).
+@code{NR}, @code{FNR}, and @code{RT} (and, of course, @var{var}).
The record is not
split into fields, so the values of the fields (including @code{$0}) and
the value of @code{NF} do not change.
@@ -7923,7 +7875,7 @@ the value of @code{NF} do not change.
@cindex left angle bracket (@code{<}), @code{<} operator (I/O)
@cindex operators, input/output
Use @samp{getline < @var{file}} to read the next record from @var{file}.
-Here @var{file} is a string-valued expression that
+Here, @var{file} is a string-valued expression that
specifies the @value{FN}. @samp{< @var{file}} is called a @dfn{redirection}
because it directs input to come from a different place.
For example, the following
@@ -8101,7 +8053,7 @@ of a construct like @samp{@w{"echo "} "date" | getline}.
Most versions, including the current version, treat it at as
@samp{@w{("echo "} "date") | getline}.
(This is also how BWK @command{awk} behaves.)
-Some versions changed and treated it as
+Some versions instead treat it as
@samp{@w{"echo "} ("date" | getline)}.
(This is how @command{mawk} behaves.)
In short, @emph{always} use explicit parentheses, and then you won't
@@ -8149,7 +8101,7 @@ program to be portable to other @command{awk} implementations.
@cindex operators, input/output
@cindex differences in @command{awk} and @command{gawk}, input/output operators
-Input into @code{getline} from a pipe is a one-way operation.
+Reading input into @code{getline} from a pipe is a one-way operation.
The command that is started with @samp{@var{command} | getline} only
sends data @emph{to} your @command{awk} program.
@@ -8159,7 +8111,7 @@ for processing and then read the results back.
communications are possible. This is done with the @samp{|&}
operator.
Typically, you write data to the coprocess first and then
-read results back, as shown in the following:
+read the results back, as shown in the following:
@example
print "@var{some query}" |& "db_server"
@@ -8242,7 +8194,7 @@ also @pxref{Auto-set}.)
@item
Using @code{FILENAME} with @code{getline}
(@samp{getline < FILENAME})
-is likely to be a source for
+is likely to be a source of
confusion. @command{awk} opens a separate input stream from the
current input file. However, by not using a variable, @code{$0}
and @code{NF} are still updated. If you're doing this, it's
@@ -8250,9 +8202,15 @@ probably by accident, and you should reconsider what it is you're
trying to accomplish.
@item
-@DBREF{Getline Summary} presents a table summarizing the
+@ifdocbook
+The next section
+@end ifdocbook
+@ifnotdocbook
+@ref{Getline Summary},
+@end ifnotdocbook
+presents a table summarizing the
@code{getline} variants and which variables they can affect.
-It is worth noting that those variants which do not use redirection
+It is worth noting that those variants that do not use redirection
can cause @code{FILENAME} to be updated if they cause
@command{awk} to start reading a new input file.
@@ -8261,7 +8219,7 @@ can cause @code{FILENAME} to be updated if they cause
If the variable being assigned is an expression with side effects,
different versions of @command{awk} behave differently upon encountering
end-of-file. Some versions don't evaluate the expression; many versions
-(including @command{gawk}) do. Here is an example, due to Duncan Moore:
+(including @command{gawk}) do. Here is an example, courtesy of Duncan Moore:
@ignore
Date: Sun, 01 Apr 2012 11:49:33 +0100
@@ -8278,7 +8236,7 @@ BEGIN @{
@noindent
Here, the side effect is the @samp{++c}. Is @code{c} incremented if
-end of file is encountered, before the element in @code{a} is assigned?
+end-of-file is encountered before the element in @code{a} is assigned?
@command{gawk} treats @code{getline} like a function call, and evaluates
the expression @samp{a[++c]} before attempting to read from @file{f}.
@@ -8310,9 +8268,6 @@ Note: for each variant, @command{gawk} sets the @code{RT} predefined variable.
@item @var{command} @code{|& getline} @var{var} @tab Sets @var{var} and @code{RT} @tab @command{gawk}
@end multitable
@end float
-@c ENDOFRANGE getl
-@c ENDOFRANGE inex
-@c ENDOFRANGE infir
@node Read Timeout
@section Reading Input with a Timeout
@@ -8323,8 +8278,8 @@ This @value{SECTION} describes a feature that is specific to @command{gawk}.
You may specify a timeout in milliseconds for reading input from the keyboard,
a pipe, or two-way communication, including TCP/IP sockets. This can be done
-on a per input, command, or connection basis, by setting a special element
-in the @code{PROCINFO} array (@pxref{Auto-set}):
+on a per-input, per-command, or per-connection basis, by setting a special
+element in the @code{PROCINFO} array (@pxref{Auto-set}):
@example
PROCINFO["input_name", "READ_TIMEOUT"] = @var{timeout in milliseconds}
@@ -8355,7 +8310,7 @@ while ((getline < "/dev/stdin") > 0)
@end example
@command{gawk} terminates the read operation if input does not
-arrive after waiting for the timeout period, returns failure
+arrive after waiting for the timeout period, returns failure,
and sets @code{ERRNO} to an appropriate string value.
A negative or zero value for the timeout is the same as specifying
no timeout at all.
@@ -8405,7 +8360,7 @@ If the @code{PROCINFO} element is not present and the
@command{gawk} uses its value to initialize the timeout value.
The exclusive use of the environment variable to specify timeout
has the disadvantage of not being able to control it
-on a per command or connection basis.
+on a per-command or per-connection basis.
@command{gawk} considers a timeout event to be an error even though
the attempt to read from the underlying device may
@@ -8501,7 +8456,7 @@ The possibilities are as follows:
@item
After splitting the input into records, @command{awk} further splits
-the record into individual fields, named @code{$1}, @code{$2}, and so
+the records into individual fields, named @code{$1}, @code{$2}, and so
on. @code{$0} is the whole record, and @code{NF} indicates how many
fields there are. The default way to split fields is between whitespace
characters.
@@ -8517,12 +8472,12 @@ thing. Decrementing @code{NF} throws away fields and rebuilds the record.
@item
Field splitting is more complicated than record splitting:
-@multitable @columnfractions .40 .45 .15
+@multitable @columnfractions .40 .40 .20
@headitem Field separator value @tab Fields are split @dots{} @tab @command{awk} / @command{gawk}
@item @code{FS == " "} @tab On runs of whitespace @tab @command{awk}
@item @code{FS == @var{any single character}} @tab On that character @tab @command{awk}
@item @code{FS == @var{regexp}} @tab On text matching the regexp @tab @command{awk}
-@item @code{FS == ""} @tab Each individual character is a separate field @tab @command{gawk}
+@item @code{FS == ""} @tab Such that each individual character is a separate field @tab @command{gawk}
@item @code{FIELDWIDTHS == @var{list of columns}} @tab Based on character position @tab @command{gawk}
@item @code{FPAT == @var{regexp}} @tab On the text surrounding text matching the regexp @tab @command{gawk}
@end multitable
@@ -8539,11 +8494,11 @@ This can also be done using command-line variable assignment.
Use @code{PROCINFO["FS"]} to see how fields are being split.
@item
-Use @code{getline} in its various forms to read additional records,
+Use @code{getline} in its various forms to read additional records
from the default input stream, from a file, or from a pipe or coprocess.
@item
-Use @code{PROCINFO[@var{file}, "READ_TIMEOUT"]} to cause reads to timeout
+Use @code{PROCINFO[@var{file}, "READ_TIMEOUT"]} to cause reads to time out
for @var{file}.
@item
@@ -8577,7 +8532,6 @@ That can be fixed by making one simple change. What is it?
@node Printing
@chapter Printing Output
-@c STARTOFRANGE prnt
@cindex printing
@cindex output, printing, See printing
One of the most common programming actions is to @dfn{print}, or output,
@@ -8593,7 +8547,6 @@ columns, whether to use exponential notation or not, and so on.
For printing with specifications, you need the @code{printf} statement
(@pxref{Printf}).
-@c STARTOFRANGE prnts
@cindex @code{print} statement
@cindex @code{printf} statement
Besides basic and formatted printing, this @value{CHAPTER}
@@ -8654,7 +8607,7 @@ space is printed between any two items.
Note that the @code{print} statement is a statement and not an
expression---you can't use it in the pattern part of a
-@var{pattern}-@var{action} statement, for example.
+pattern--action statement, for example.
@node Print Examples
@section @code{print} Statement Examples
@@ -8773,7 +8726,6 @@ You can continue either a @code{print} or
@code{printf} statement simply by putting a newline after any comma
(@pxref{Statements/Lines}).
@end quotation
-@c ENDOFRANGE prnts
@node Output Separators
@section Output Separators
@@ -8846,7 +8798,7 @@ runs together on a single line.
@cindex numeric, output format
@cindex formats@comma{} numeric output
When printing numeric values with the @code{print} statement,
-@command{awk} internally converts the number to a string of characters
+@command{awk} internally converts each number to a string of characters
and prints that string. @command{awk} uses the @code{sprintf()} function
to do this conversion
(@pxref{String Functions}).
@@ -8886,7 +8838,6 @@ if @code{OFMT} contains anything but a floating-point conversion specification.
@node Printf
@section Using @code{printf} Statements for Fancier Printing
-@c STARTOFRANGE printfs
@cindex @code{printf} statement
@cindex output, formatted
@cindex formatting output
@@ -8918,7 +8869,7 @@ printf @var{format}, @var{item1}, @var{item2}, @dots{}
@noindent
As for @code{print}, the entire list of arguments may optionally be
enclosed in parentheses. Here too, the parentheses are necessary if any
-of the item expressions use the @samp{>} relational operator; otherwise,
+of the item expressions uses the @samp{>} relational operator; otherwise,
it can be confused with an output redirection (@pxref{Redirection}).
@cindex format specifiers
@@ -8949,7 +8900,7 @@ $ @kbd{awk 'BEGIN @{}
@end example
@noindent
-Here, neither the @samp{+} nor the @samp{OUCH!} appear in
+Here, neither the @samp{+} nor the @samp{OUCH!} appears in
the output message.
@node Control Letters
@@ -8996,8 +8947,8 @@ The two control letters are equivalent.
(The @samp{%i} specification is for compatibility with ISO C.)
@item @code{%e}, @code{%E}
-Print a number in scientific (exponential) notation;
-for example:
+Print a number in scientific (exponential) notation.
+For example:
@example
printf "%4.3e\n", 1950
@@ -9034,7 +8985,7 @@ The special ``not a number'' value formats as @samp{-nan} or @samp{nan}
(@pxref{Math Definitions}).
@item @code{%F}
-Like @samp{%f} but the infinity and ``not a number'' values are spelled
+Like @samp{%f}, but the infinity and ``not a number'' values are spelled
using uppercase letters.
The @samp{%F} format is a POSIX extension to ISO C; not all systems
@@ -9084,7 +9035,6 @@ values or do something else entirely.
@node Format Modifiers
@subsection Modifiers for @code{printf} Formats
-@c STARTOFRANGE pfm
@cindex @code{printf} statement, modifiers
@cindex modifiers@comma{} in format specifiers
A format specification can also include @dfn{modifiers} that can control
@@ -9123,7 +9073,7 @@ messages at runtime.
which describes how and why to use positional specifiers.
For now, we ignore them.
-@item - (Minus)
+@item - @r{(Minus)}
The minus sign, used before the width modifier (see later on in
this list),
says to left-justify
@@ -9279,7 +9229,7 @@ printf "%" w "." p "s\n", s
@end example
@noindent
-This is not particularly easy to read but it does work.
+This is not particularly easy to read, but it does work.
@c @cindex lint checks
@cindex troubleshooting, fatal errors, @code{printf} format strings
@@ -9290,7 +9240,6 @@ format strings. These are not valid in @command{awk}. Most @command{awk}
implementations silently ignore them. If @option{--lint} is provided
on the command line (@pxref{Options}), @command{gawk} warns about their
use. If @option{--posix} is supplied, their use is a fatal error.
-@c ENDOFRANGE pfm
@node Printf Examples
@subsection Examples Using @code{printf}
@@ -9326,7 +9275,7 @@ $ @kbd{awk '@{ printf "%-10s %s\n", $1, $2 @}' mail-list}
@end example
In this case, the phone numbers had to be printed as strings because
-the numbers are separated by a dash. Printing the phone numbers as
+the numbers are separated by dashes. Printing the phone numbers as
numbers would have produced just the first three digits: @samp{555}.
This would have been pretty confusing.
@@ -9371,14 +9320,11 @@ awk 'BEGIN @{ format = "%-10s %s\n"
@{ printf format, $1, $2 @}' mail-list
@end example
-@c ENDOFRANGE printfs
@node Redirection
@section Redirecting Output of @code{print} and @code{printf}
-@c STARTOFRANGE outre
@cindex output redirection
-@c STARTOFRANGE reout
@cindex redirection of output
@cindex @option{--sandbox} option, output redirection with @code{print}, @code{printf}
So far, the output from @code{print} and @code{printf} has gone
@@ -9389,7 +9335,7 @@ This is called @dfn{redirection}.
@quotation NOTE
When @option{--sandbox} is specified (@pxref{Options}),
-redirecting output to files, pipes and coprocesses is disabled.
+redirecting output to files, pipes, and coprocesses is disabled.
@end quotation
A redirection appears after the @code{print} or @code{printf} statement.
@@ -9442,7 +9388,7 @@ Each output file contains one name or number per line.
@cindex @code{>} (right angle bracket), @code{>>} operator (I/O)
@cindex right angle bracket (@code{>}), @code{>>} operator (I/O)
@item print @var{items} >> @var{output-file}
-This redirection prints the items into the pre-existing output file
+This redirection prints the items into the preexisting output file
named @var{output-file}. The difference between this and the
single-@samp{>} redirection is that the old contents (if any) of
@var{output-file} are not erased. Instead, the @command{awk} output is
@@ -9481,7 +9427,7 @@ The unsorted list is written with an ordinary redirection, while
the sorted list is written by piping through the @command{sort} utility.
The next example uses redirection to mail a message to the mailing
-list @samp{bug-system}. This might be useful when trouble is encountered
+list @code{bug-system}. This might be useful when trouble is encountered
in an @command{awk} script run periodically for system maintenance:
@example
@@ -9512,15 +9458,23 @@ This redirection prints the items to the input of @var{command}.
The difference between this and the
single-@samp{|} redirection is that the output from @var{command}
can be read with @code{getline}.
-Thus @var{command} is a @dfn{coprocess}, which works together with,
-but subsidiary to, the @command{awk} program.
+Thus, @var{command} is a @dfn{coprocess}, which works together with
+but is subsidiary to the @command{awk} program.
This feature is a @command{gawk} extension, and is not available in
POSIX @command{awk}.
-@DBXREF{Getline/Coprocess}
+@ifnotdocbook
+@xref{Getline/Coprocess},
for a brief discussion.
-@DBXREF{Two-way I/O}
+@xref{Two-way I/O},
for a more complete discussion.
+@end ifnotdocbook
+@ifdocbook
+@DBXREF{Getline/Coprocess}
+for a brief discussion and
+@DBREF{Two-way I/O}
+for a more complete discussion.
+@end ifdocbook
@end table
Redirecting output using @samp{>}, @samp{>>}, @samp{|}, or @samp{|&}
@@ -9545,7 +9499,7 @@ This is indeed how redirections must be used from the shell. But in
@command{awk}, it isn't necessary. In this kind of case, a program should
use @samp{>} for all the @code{print} statements, because the output file
is only opened once. (It happens that if you mix @samp{>} and @samp{>>}
-that output is produced in the expected order. However, mixing the operators
+output is produced in the expected order. However, mixing the operators
for the same file is definitely poor style, and is confusing to readers
of your program.)
@@ -9595,11 +9549,9 @@ It then sends the list to the shell for execution.
@DBXREF{Shell Quoting} for a function that can help in generating
command lines to be fed to the shell.
@end sidebar
-@c ENDOFRANGE outre
-@c ENDOFRANGE reout
@node Special FD
-@section Special Files for Standard Pre-Opened Data Streams
+@section Special Files for Standard Preopened Data Streams
@cindex standard input
@cindex input, standard
@cindex standard output
@@ -9612,7 +9564,7 @@ command lines to be fed to the shell.
Running programs conventionally have three input and output streams
already available to them for reading and writing. These are known
as the @dfn{standard input}, @dfn{standard output}, and @dfn{standard
-error output}. These open streams (and any other open file or pipe)
+error output}. These open streams (and any other open files or pipes)
are often referred to by the technical term @dfn{file descriptors}.
These streams are, by default, connected to your keyboard and screen, but
@@ -9650,7 +9602,7 @@ that is connected to your keyboard and screen. It represents the
``terminal,''@footnote{The ``tty'' in @file{/dev/tty} stands for
``Teletype,'' a serial terminal.} which on modern systems is a keyboard
and screen, not a serial console.)
-This generally has the same effect but not always: although the
+This generally has the same effect, but not always: although the
standard error stream is usually the screen, it can be redirected; when
that happens, writing to the screen is not correct. In fact, if
@command{awk} is run from a background job, it may not have a
@@ -9695,7 +9647,7 @@ print "Serious error detected!" > "/dev/stderr"
@cindex troubleshooting, quotes with file names
Note the use of quotes around the @value{FN}.
-Like any other redirection, the value must be a string.
+Like with any other redirection, the value must be a string.
It is a common error to omit the quotes, which leads
to confusing results.
@@ -9706,7 +9658,6 @@ invoked with the @option{--traditional} option (@pxref{Options}).
@node Special Files
@section Special @value{FFN}s in @command{gawk}
-@c STARTOFRANGE gfn
@cindex @command{gawk}, file names in
Besides access to standard input, standard output, and standard error,
@@ -9722,7 +9673,7 @@ TCP/IP networking.
@end menu
@node Other Inherited Files
-@subsection Accessing Other Open Files With @command{gawk}
+@subsection Accessing Other Open Files with @command{gawk}
Besides the @code{/dev/stdin}, @code{/dev/stdout}, and @code{/dev/stderr}
special @value{FN}s mentioned earlier, @command{gawk} provides syntax
@@ -9779,7 +9730,7 @@ special @value{FN}s that @command{gawk} provides:
@cindex compatibility mode (@command{gawk}), file names
@cindex file names, in compatibility mode
@item
-Recognition of the @value{FN}s for the three standard pre-opened
+Recognition of the @value{FN}s for the three standard preopened
files is disabled only in POSIX mode.
@item
@@ -9792,23 +9743,18 @@ compatibility mode (either @option{--traditional} or @option{--posix};
interprets these special @value{FN}s.
For example, using @samp{/dev/fd/4}
for output actually writes on file descriptor 4, and not on a new
-file descriptor that is @code{dup()}'ed from file descriptor 4. Most of
+file descriptor that is @code{dup()}ed from file descriptor 4. Most of
the time this does not matter; however, it is important to @emph{not}
close any of the files related to file descriptors 0, 1, and 2.
Doing so results in unpredictable behavior.
@end itemize
-@c ENDOFRANGE gfn
@node Close Files And Pipes
@section Closing Input and Output Redirections
@cindex files, output, See output files
-@c STARTOFRANGE ifc
@cindex input files, closing
-@c STARTOFRANGE ofc
@cindex output, files@comma{} closing
-@c STARTOFRANGE pc
@cindex pipe, closing
-@c STARTOFRANGE cc
@cindex coprocesses, closing
@cindex @code{getline} command, coprocesses@comma{} using from
@@ -10014,18 +9960,14 @@ This value is zero if the close succeeds, or @minus{}1 if
it fails.
The POSIX standard is very vague; it says that @code{close()}
-returns zero on success and nonzero otherwise. In general,
+returns zero on success and a nonzero value otherwise. In general,
different implementations vary in what they report when closing
-pipes; thus the return value cannot be used portably.
+pipes; thus, the return value cannot be used portably.
@value{DARKCORNER}
In POSIX mode (@pxref{Options}), @command{gawk} just returns zero
when closing a pipe.
@end sidebar
-@c ENDOFRANGE ifc
-@c ENDOFRANGE ofc
-@c ENDOFRANGE pc
-@c ENDOFRANGE cc
@node Output Summary
@section Summary
@@ -10039,8 +9981,8 @@ for numeric values for the @code{print} statement.
@item
The @code{printf} statement provides finer-grained control over output,
-with format control letters for different data types and various flags
-that modify the behavior of the format control letters.
+with format-control letters for different data types and various flags
+that modify the behavior of the format-control letters.
@item
Output from both @code{print} and @code{printf} may be redirected to
@@ -10089,11 +10031,9 @@ BEGIN @{ print "Serious error detected!" > /dev/stderr @}
@end enumerate
@c EXCLUDE END
-@c ENDOFRANGE prnt
@node Expressions
@chapter Expressions
-@c STARTOFRANGE exps
@cindex expressions
Expressions are the basic building blocks of @command{awk} patterns
@@ -10104,7 +10044,7 @@ can assign a new value to a variable or a field by using an assignment operator.
An expression can serve as a pattern or action statement on its own.
Most other kinds of
statements contain one or more expressions that specify the data on which to
-operate. As in other languages, expressions in @command{awk} include
+operate. As in other languages, expressions in @command{awk} can include
variables, array references, constants, and function calls, as well as
combinations of these with various operators.
@@ -10123,7 +10063,7 @@ combinations of these with various operators.
Expressions are built up from values and the operations performed
upon them. This @value{SECTION} describes the elementary objects
-which provide the values used in expressions.
+that provide the values used in expressions.
@menu
* Constants:: String, numeric and regexp constants.
@@ -10136,7 +10076,6 @@ which provide the values used in expressions.
@node Constants
@subsection Constant Expressions
-@c STARTOFRANGE cnst
@cindex constants, types of
The simplest type of expression is the @dfn{constant}, which always has
@@ -10174,7 +10113,7 @@ have the same value:
@end example
@cindex string constants
-A string constant consists of a sequence of characters enclosed in
+A @dfn{string constant} consists of a sequence of characters enclosed in
double quotation marks. For example:
@example
@@ -10186,7 +10125,7 @@ double quotation marks. For example:
@cindex strings, length limitations
represents the string whose contents are @samp{parrot}. Strings in
@command{gawk} can be of any length, and they can contain any of the possible
-eight-bit ASCII characters including ASCII @sc{nul} (character code zero).
+eight-bit ASCII characters, including ASCII @sc{nul} (character code zero).
Other @command{awk}
implementations may have difficulty with some character codes.
@@ -10201,15 +10140,15 @@ In @command{awk}, all numbers are in decimal (i.e., base 10). Many other
programming languages allow you to specify numbers in other bases, often
octal (base 8) and hexadecimal (base 16).
In octal, the numbers go 0, 1, 2, 3, 4, 5, 6, 7, 10, 11, 12, and so on.
-Just as @samp{11}, in decimal, is 1 times 10 plus 1, so
-@samp{11}, in octal, is 1 times 8, plus 1. This equals 9 in decimal.
+Just as @samp{11} in decimal is 1 times 10 plus 1, so
+@samp{11} in octal is 1 times 8 plus 1. This equals 9 in decimal.
In hexadecimal, there are 16 digits. Because the everyday decimal
number system only has ten digits (@samp{0}--@samp{9}), the letters
@samp{a} through @samp{f} are used to represent the rest.
(Case in the letters is usually irrelevant; hexadecimal @samp{a} and @samp{A}
have the same value.)
-Thus, @samp{11}, in
-hexadecimal, is 1 times 16 plus 1, which equals 17 in decimal.
+Thus, @samp{11} in
+hexadecimal is 1 times 16 plus 1, which equals 17 in decimal.
Just by looking at plain @samp{11}, you can't tell what base it's in.
So, in C, C++, and other languages derived from C,
@@ -10220,13 +10159,13 @@ and hexadecimal numbers start with a leading @samp{0x} or @samp{0X}:
@table @code
@item 11
-Decimal value 11.
+Decimal value 11
@item 011
-Octal 11, decimal value 9.
+Octal 11, decimal value 9
@item 0x11
-Hexadecimal 11, decimal value 17.
+Hexadecimal 11, decimal value 17
@end table
This example shows the difference:
@@ -10254,11 +10193,11 @@ you can use the @code{strtonum()} function
(@pxref{String Functions})
to convert the data into a number.
Most of the time, you will want to use octal or hexadecimal constants
-when working with the built-in bit manipulation functions;
+when working with the built-in bit-manipulation functions;
see @DBREF{Bitwise Functions}
for more information.
-Unlike some early C implementations, @samp{8} and @samp{9} are not
+Unlike in some early C implementations, @samp{8} and @samp{9} are not
valid in octal constants. For example, @command{gawk} treats @samp{018}
as decimal 18:
@@ -10293,19 +10232,17 @@ $ @kbd{gawk 'BEGIN @{ printf "0x11 is <%s>\n", 0x11 @}'}
@node Regexp Constants
@subsubsection Regular Expression Constants
-@c STARTOFRANGE rec
@cindex regexp constants
@cindex @code{~} (tilde), @code{~} operator
@cindex tilde (@code{~}), @code{~} operator
@cindex @code{!} (exclamation point), @code{!~} operator
@cindex exclamation point (@code{!}), @code{!~} operator
-A regexp constant is a regular expression description enclosed in
+A @dfn{regexp constant} is a regular expression description enclosed in
slashes, such as @code{@w{/^beginning and end$/}}. Most regexps used in
@command{awk} programs are constant, but the @samp{~} and @samp{!~}
matching operators can also match computed or dynamic regexps
(which are typically just ordinary strings or variables that contain a regexp,
-but could be a more complex expression).
-@c ENDOFRANGE cnst
+but could be more complex expressions).
@node Using Constant Regexps
@subsection Using Regular Expression Constants
@@ -10385,7 +10322,7 @@ the third argument of @code{split()} to be a regexp constant, but some
older implementations do not.
@value{DARKCORNER}
Because some built-in functions accept regexp constants as arguments,
-it can be confusing when attempting to use regexp constants as arguments
+confusion can arise when attempting to use regexp constants as arguments
to user-defined functions (@pxref{User-defined}). For example:
@example
@@ -10411,19 +10348,18 @@ function mysub(pat, repl, str, global)
In this example, the programmer wants to pass a regexp constant to the
user-defined function @code{mysub()}, which in turn passes it on to
either @code{sub()} or @code{gsub()}. However, what really happens is that
-the @code{pat} parameter is either one or zero, depending upon whether
+the @code{pat} parameter is assigned a value of either one or zero, depending upon whether
or not @code{$0} matches @code{/hi/}.
@command{gawk} issues a warning when it sees a regexp constant used as
a parameter to a user-defined function, because passing a truth value in
this way is probably not what was intended.
-@c ENDOFRANGE rec
@node Variables
@subsection Variables
@cindex variables, user-defined
@cindex user-defined, variables
-Variables are ways of storing values at one point in your program for
+@dfn{Variables} are ways of storing values at one point in your program for
use later in another part of your program. They can be manipulated
entirely within the program text, and they can also be assigned values
on the @command{awk} command line.
@@ -10451,17 +10387,17 @@ are distinct variables.
A variable name is a valid expression by itself; it represents the
variable's current value. Variables are given new values with
@dfn{assignment operators}, @dfn{increment operators}, and
-@dfn{decrement operators}.
-@xref{Assignment Ops}.
+@dfn{decrement operators}
+(@pxref{Assignment Ops}).
In addition, the @code{sub()} and @code{gsub()} functions can
change a variable's value, and the @code{match()}, @code{split()},
and @code{patsplit()} functions can change the contents of their
-array parameters. @xref{String Functions}.
+array parameters (@pxref{String Functions}).
@cindex variables, built-in
@cindex variables, initializing
A few variables have special built-in meanings, such as @code{FS} (the
-field separator), and @code{NF} (the number of fields in the current input
+field separator) and @code{NF} (the number of fields in the current input
record). @DBXREF{Built-in Variables} for a list of the predefined variables.
These predefined variables can be used and assigned just like all other
variables, but their values are also used or changed automatically by
@@ -10689,7 +10625,7 @@ point, so the default behavior was restored to use a period as the
decimal point character. You can use the @option{--use-lc-numeric}
option (@pxref{Options}) to force @command{gawk} to use the locale's
decimal point character. (@command{gawk} also uses the locale's decimal
-point character when in POSIX mode, either via @option{--posix}, or the
+point character when in POSIX mode, either via @option{--posix} or the
@env{POSIXLY_CORRECT} environment variable, as shown previously.)
@ref{table-locale-affects} describes the cases in which the locale's decimal
@@ -10707,7 +10643,7 @@ features have not been described yet.
@end multitable
@end float
-Finally, modern day formal standards and IEEE standard floating-point
+Finally, modern-day formal standards and the IEEE standard floating-point
representation can have an unusual but important effect on the way
@command{gawk} converts some special string values to numbers. The details
are presented in @ref{POSIX Floating Point Problems}.
@@ -10715,7 +10651,7 @@ are presented in @ref{POSIX Floating Point Problems}.
@node All Operators
@section Operators: Doing Something with Values
-This @value{SECTION} introduces the @dfn{operators} which make use
+This @value{SECTION} introduces the @dfn{operators} that make use
of the values provided by constants and variables.
@menu
@@ -10893,7 +10829,7 @@ print "something meaningful" > file name
@noindent
This produces a syntax error with some versions of Unix
@command{awk}.@footnote{It happens that BWK
-@command{awk}, @command{gawk} and @command{mawk} all ``get it right,''
+@command{awk}, @command{gawk}, and @command{mawk} all ``get it right,''
but you should not rely on this.}
It is necessary to use the following:
@@ -10982,11 +10918,8 @@ you're never quite sure what you'll get.
@node Assignment Ops
@subsection Assignment Expressions
-@c STARTOFRANGE asop
@cindex assignment operators
-@c STARTOFRANGE opas
@cindex operators, assignment
-@c STARTOFRANGE exas
@cindex expressions, assignment
@cindex @code{=} (equals sign), @code{=} operator
@cindex equals sign (@code{=}), @code{=} operator
@@ -11146,7 +11079,7 @@ and
@ifdocbook
@DBREF{Numeric Functions}
@end ifdocbook
-for more information).
+for more information.)
This example illustrates an important fact about assignment
operators: the lefthand expression is only evaluated @emph{once}.
@@ -11182,17 +11115,17 @@ to a number.
@caption{Arithmetic assignment operators}
@multitable @columnfractions .30 .70
@headitem Operator @tab Effect
-@item @var{lvalue} @code{+=} @var{increment} @tab Add @var{increment} to the value of @var{lvalue}
-@item @var{lvalue} @code{-=} @var{decrement} @tab Subtract @var{decrement} from the value of @var{lvalue}
-@item @var{lvalue} @code{*=} @var{coefficient} @tab Multiply the value of @var{lvalue} by @var{coefficient}
-@item @var{lvalue} @code{/=} @var{divisor} @tab Divide the value of @var{lvalue} by @var{divisor}
-@item @var{lvalue} @code{%=} @var{modulus} @tab Set @var{lvalue} to its remainder by @var{modulus}
+@item @var{lvalue} @code{+=} @var{increment} @tab Add @var{increment} to the value of @var{lvalue}.
+@item @var{lvalue} @code{-=} @var{decrement} @tab Subtract @var{decrement} from the value of @var{lvalue}.
+@item @var{lvalue} @code{*=} @var{coefficient} @tab Multiply the value of @var{lvalue} by @var{coefficient}.
+@item @var{lvalue} @code{/=} @var{divisor} @tab Divide the value of @var{lvalue} by @var{divisor}.
+@item @var{lvalue} @code{%=} @var{modulus} @tab Set @var{lvalue} to its remainder by @var{modulus}.
@cindex common extensions, @code{**=} operator
@cindex extensions, common@comma{} @code{**=} operator
@cindex @command{awk} language, POSIX version
@cindex POSIX @command{awk}
-@item @var{lvalue} @code{^=} @var{power} @tab
-@item @var{lvalue} @code{**=} @var{power} @tab Raise @var{lvalue} to the power @var{power} @value{COMMONEXT}
+@item @var{lvalue} @code{^=} @var{power} @tab Raise @var{lvalue} to the power @var{power}.
+@item @var{lvalue} @code{**=} @var{power} @tab Raise @var{lvalue} to the power @var{power}. @value{COMMONEXT}
@end multitable
@end float
@@ -11240,16 +11173,11 @@ awk '/[=]=/' /dev/null
@command{gawk} does not have this problem; BWK @command{awk}
and @command{mawk} also do not.
@end sidebar
-@c ENDOFRANGE exas
-@c ENDOFRANGE opas
-@c ENDOFRANGE asop
@node Increment Ops
@subsection Increment and Decrement Operators
-@c STARTOFRANGE inop
@cindex increment operators
-@c STARTOFRANGE opde
@cindex operators, decrement/increment
@dfn{Increment} and @dfn{decrement operators} increase or decrease the value of
a variable by one. An assignment operator can do the same thing, so
@@ -11297,7 +11225,6 @@ just like variables. (Use @samp{$(i++)} when you want to do a field reference
and a variable increment at the same time. The parentheses are necessary
because of the precedence of the field reference operator @samp{$}.)
-@c STARTOFRANGE deop
@cindex decrement operators
The decrement operator @samp{--} works just like @samp{++}, except that
it subtracts one instead of adding it. As with @samp{++}, it can be used before
@@ -11337,8 +11264,8 @@ like @samp{@var{lvalue}++}, but instead of adding, it subtracts.)
@cindex evaluation order
@cindex Marx, Groucho
@quotation
-@i{Doctor, doctor! It hurts when I do this!@*
-So don't do that!}
+@i{Doctor, it hurts when I do this!@*
+Then don't do that!}
@author Groucho Marx
@end quotation
@@ -11362,7 +11289,7 @@ print b
@cindex side effects
In other words, when do the various side effects prescribed by the
postfix operators (@samp{b++}) take effect?
-When side effects happen is @dfn{implementation defined}.
+When side effects happen is @dfn{implementation-defined}.
In other words, it is up to the particular version of @command{awk}.
The result for the first example may be 12 or 13, and for the second, it
may be 22 or 23.
@@ -11373,15 +11300,12 @@ You should avoid such things in your own programs.
@c You'll sleep better at night and be able to look at yourself
@c in the mirror in the morning.
@end sidebar
-@c ENDOFRANGE inop
-@c ENDOFRANGE opde
-@c ENDOFRANGE deop
@node Truth Values and Conditions
@section Truth Values and Conditions
-In certain contexts, expression values also serve as ``truth values''; (i.e.,
-they determine what should happen next as the program runs). This
+In certain contexts, expression values also serve as ``truth values''; i.e.,
+they determine what should happen next as the program runs. This
@value{SECTION} describes how @command{awk} defines ``true'' and ``false''
and how values are compared.
@@ -11440,19 +11364,15 @@ the string constant @code{"0"} is actually true, because it is non-null.
@author Douglas Adams, @cite{The Hitchhiker's Guide to the Galaxy}
@end quotation
-@c STARTOFRANGE comex
@cindex comparison expressions
-@c STARTOFRANGE excom
@cindex expressions, comparison
@cindex expressions, matching, See comparison expressions
@cindex matching, expressions, See comparison expressions
@cindex relational operators, See comparison operators
@cindex operators, relational, See operators@comma{} comparison
-@c STARTOFRANGE varting
@cindex variable typing
-@c STARTOFRANGE vartypc
@cindex variables, types of, comparison expressions and
-Unlike other programming languages, @command{awk} variables do not have a
+Unlike in other programming languages, in @command{awk} variables do not have a
fixed type. Instead, they can be either a number or a string, depending
upon the value that is assigned to them.
We look now at how variables are typed, and how @command{awk}
@@ -11481,20 +11401,20 @@ Variable typing follows these rules:
@itemize @value{BULLET}
@item
-A numeric constant or the result of a numeric operation has the @var{numeric}
+A numeric constant or the result of a numeric operation has the @dfn{numeric}
attribute.
@item
-A string constant or the result of a string operation has the @var{string}
+A string constant or the result of a string operation has the @dfn{string}
attribute.
@item
Fields, @code{getline} input, @code{FILENAME}, @code{ARGV} elements,
@code{ENVIRON} elements, and the elements of an array created by
@code{match()}, @code{split()}, and @code{patsplit()} that are numeric
-strings have the @var{strnum} attribute. Otherwise, they have
-the @var{string} attribute. Uninitialized variables also have the
-@var{strnum} attribute.
+strings have the @dfn{strnum} attribute. Otherwise, they have
+the @dfn{string} attribute. Uninitialized variables also have the
+@dfn{strnum} attribute.
@item
Attributes propagate across assignments but are not changed by
@@ -11638,13 +11558,13 @@ constant, then a string comparison is performed. Otherwise, a
numeric comparison is performed.
This point bears additional emphasis: All user input is made of characters,
-and so is first and foremost of @var{string} type; input strings
-that look numeric are additionally given the @var{strnum} attribute.
+and so is first and foremost of string type; input strings
+that look numeric are additionally given the strnum attribute.
Thus, the six-character input string @w{@samp{ +3.14}} receives the
-@var{strnum} attribute. In contrast, the eight characters
+strnum attribute. In contrast, the eight characters
@w{@code{" +3.14"}} appearing in program text comprise a string constant.
The following examples print @samp{1} when the comparison between
-the two different constants is true, @samp{0} otherwise:
+the two different constants is true, and @samp{0} otherwise:
@c 22.9.2014: Tested with mawk and BWK awk, got same results.
@example
@@ -11774,7 +11694,7 @@ $ @kbd{echo 1e2 3 | awk '@{ print ($1 < $2) ? "true" : "false" @}'}
@noindent
the result is @samp{false} because both @code{$1} and @code{$2}
are user input. They are numeric strings---therefore both have
-the @var{strnum} attribute, dictating a numeric comparison.
+the strnum attribute, dictating a numeric comparison.
The purpose of the comparison rules and the use of numeric strings is
to attempt to produce the behavior that is ``least surprising,'' while
still ``doing the right thing.''
@@ -11833,7 +11753,7 @@ characters sort, as defined by the locale (for more discussion,
@pxref{Locales}). This order is usually very different
from the results obtained when doing straight character-by-character
comparison.@footnote{Technically, string comparison is supposed
-to behave the same way as if the strings are compared with the C
+to behave the same way as if the strings were compared with the C
@code{strcoll()} function.}
Because this behavior differs considerably from existing practice,
@@ -11850,19 +11770,13 @@ $ @kbd{gawk --posix 'BEGIN @{ printf("ABC < abc = %s\n",}
@print{} ABC < abc = FALSE
@end example
-@c ENDOFRANGE comex
-@c ENDOFRANGE excom
-@c ENDOFRANGE vartypc
-@c ENDOFRANGE varting
@node Boolean Ops
@subsection Boolean Expressions
@cindex and Boolean-logic operator
@cindex or Boolean-logic operator
@cindex not Boolean-logic operator
-@c STARTOFRANGE exbo
@cindex expressions, Boolean
-@c STARTOFRANGE boex
@cindex Boolean expressions
@cindex operators, Boolean, See Boolean expressions
@cindex Boolean operators, See Boolean expressions
@@ -11946,7 +11860,7 @@ BEGIN @{ if (! ("HOME" in ENVIRON))
@cindex vertical bar (@code{|}), @code{||} operator
The @samp{&&} and @samp{||} operators are called @dfn{short-circuit}
operators because of the way they work. Evaluation of the full expression
-is ``short-circuited'' if the result can be determined part way through
+is ``short-circuited'' if the result can be determined partway through
its evaluation.
@cindex line continuations
@@ -12008,8 +11922,6 @@ next record, and start processing the rules over again at the top.
The reason it's there is to avoid printing the bracketing
@samp{START} and @samp{END} lines.
@end quotation
-@c ENDOFRANGE exbo
-@c ENDOFRANGE boex
@node Conditional Exp
@subsection Conditional Expressions
@@ -12020,8 +11932,8 @@ The reason it's there is to avoid printing the bracketing
A @dfn{conditional expression} is a special kind of expression that has
three operands. It allows you to use one expression's value to select
one of two other expressions.
-The conditional expression is the same as in the C language,
-as shown here:
+The conditional expression in @command{awk} is the same as in the C
+language, as shown here:
@example
@var{selector} ? @var{if-true-exp} : @var{if-false-exp}
@@ -12030,8 +11942,8 @@ as shown here:
@noindent
There are three subexpressions. The first, @var{selector}, is always
computed first. If it is ``true'' (not zero or not null), then
-@var{if-true-exp} is computed next and its value becomes the value of
-the whole expression. Otherwise, @var{if-false-exp} is computed next
+@var{if-true-exp} is computed next, and its value becomes the value of
+the whole expression. Otherwise, @var{if-false-exp} is computed next,
and its value becomes the value of the whole expression.
For example, the following expression produces the absolute value of @code{x}:
@@ -12079,7 +11991,7 @@ ask for it by name at any point in the program. For
example, the function @code{sqrt()} computes the square root of a number.
@cindex functions, built-in
-A fixed set of functions are @dfn{built-in}, which means they are
+A fixed set of functions are @dfn{built in}, which means they are
available in every @command{awk} program. The @code{sqrt()} function is one
of these. @DBXREF{Built-in} for a list of built-in
functions and their descriptions. In addition, you can define
@@ -12188,9 +12100,7 @@ $ @kbd{awk -f matchit.awk}
@node Precedence
@section Operator Precedence (How Operators Nest)
-@c STARTOFRANGE prec
@cindex precedence
-@c STARTOFRANGE oppr
@cindex operators, precedence
@dfn{Operator precedence} determines how operators are grouped when
@@ -12255,7 +12165,7 @@ Increment, decrement.
@cindex @code{*} (asterisk), @code{**} operator
@cindex asterisk (@code{*}), @code{**} operator
@item @code{^ **}
-Exponentiation. These operators group right-to-left.
+Exponentiation. These operators group right to left.
@cindex @code{+} (plus sign), @code{+} operator
@cindex plus sign (@code{+}), @code{+} operator
@@ -12321,7 +12231,7 @@ statements belong to the statement level, not to expressions. The
redirection does not produce an expression that could be the operand of
another operator. As a result, it does not make sense to use a
redirection operator near another operator of lower precedence without
-parentheses. Such combinations (e.g., @samp{print foo > a ? b : c}),
+parentheses. Such combinations (e.g., @samp{print foo > a ? b : c})
result in syntax errors.
The correct way to write this statement is @samp{print foo > (a ? b : c)}.
@@ -12339,17 +12249,17 @@ Array membership.
@cindex @code{&} (ampersand), @code{&&} operator
@cindex ampersand (@code{&}), @code{&&} operator
@item @code{&&}
-Logical ``and''.
+Logical ``and.''
@cindex @code{|} (vertical bar), @code{||} operator
@cindex vertical bar (@code{|}), @code{||} operator
@item @code{||}
-Logical ``or''.
+Logical ``or.''
@cindex @code{?} (question mark), @code{?:} operator
@cindex question mark (@code{?}), @code{?:} operator
@item @code{?:}
-Conditional. This operator groups right-to-left.
+Conditional. This operator groups right to left.
@cindex @code{+} (plus sign), @code{+=} operator
@cindex plus sign (@code{+}), @code{+=} operator
@@ -12366,7 +12276,7 @@ Conditional. This operator groups right-to-left.
@cindex @code{^} (caret), @code{^=} operator
@cindex caret (@code{^}), @code{^=} operator
@item @code{= += -= *= /= %= ^= **=}
-Assignment. These operators group right-to-left.
+Assignment. These operators group right to left.
@end table
@cindex POSIX @command{awk}, @code{**} operator and
@@ -12375,8 +12285,6 @@ Assignment. These operators group right-to-left.
The @samp{|&}, @samp{**}, and @samp{**=} operators are not specified by POSIX.
For maximum portability, do not use them.
@end quotation
-@c ENDOFRANGE prec
-@c ENDOFRANGE oppr
@node Locales
@section Where You Are Makes a Difference
@@ -12442,8 +12350,8 @@ Locales can influence the conversions.
@item
@command{awk} provides the usual arithmetic operators (addition,
subtraction, multiplication, division, modulus), and unary plus and minus.
-It also provides comparison operators, boolean operators, array membership
-testing, and regexp
+It also provides comparison operators, Boolean operators, an array membership
+testing operator, and regexp
matching operators. String concatenation is accomplished by placing
two expressions next to each other; there is no explicit operator.
The three-operand @samp{?:} operator provides an ``if-else'' test within
@@ -12454,7 +12362,7 @@ Assignment operators provide convenient shorthands for common arithmetic
operations.
@item
-In @command{awk}, a value is considered to be true if it is non-zero
+In @command{awk}, a value is considered to be true if it is nonzero
@emph{or} non-null. Otherwise, the value is false.
@item
@@ -12463,7 +12371,7 @@ lifetime. The type determines how it behaves in comparisons (string
or numeric).
@item
-Function calls return a value which may be used as part of a larger
+Function calls return a value that may be used as part of a larger
expression. Expressions used to pass parameter values are fully
evaluated before the function is called. @command{awk} provides
built-in and user-defined functions; this is described in
@@ -12480,11 +12388,9 @@ program, and occasionally the format for data read as input.
@end itemize
-@c ENDOFRANGE exps
@node Patterns and Actions
@chapter Patterns, Actions, and Variables
-@c STARTOFRANGE pat
@cindex patterns
As you have already seen, each @command{awk} statement consists of
@@ -12492,7 +12398,7 @@ a pattern with an associated action. This @value{CHAPTER} describes how
you build patterns and actions, what kinds of things you can do within
actions, and @command{awk}'s predefined variables.
-The pattern-action rules and the statements available for use
+The pattern--action rules and the statements available for use
within actions form the core of @command{awk} programming.
In a sense, everything covered
up to here has been the foundation
@@ -12683,7 +12589,7 @@ patterns. Likewise, the special patterns @code{BEGIN}, @code{END},
which never match any input record, are not expressions and cannot
appear inside Boolean patterns.
-The precedence of the different operators which can appear in
+The precedence of the different operators that can appear in
patterns is described in @ref{Precedence}.
@node Ranges
@@ -12709,7 +12615,7 @@ prints every record in @file{myfile} between @samp{on}/@samp{off} pairs, inclusi
A range pattern starts out by matching @var{begpat} against every
input record. When a record matches @var{begpat}, the range pattern is
-@dfn{turned on} and the range pattern matches this record as well. As long as
+@dfn{turned on}, and the range pattern matches this record as well. As long as
the range pattern stays turned on, it automatically matches every input
record read. The range pattern also matches @var{endpat} against every
input record; when this succeeds, the range pattern is @dfn{turned off} again
@@ -12780,9 +12686,7 @@ a range pattern. @value{DARKCORNER}
@node BEGIN/END
@subsection The @code{BEGIN} and @code{END} Special Patterns
-@c STARTOFRANGE beg
@cindex @code{BEGIN} pattern
-@c STARTOFRANGE end
@cindex @code{END} pattern
All the patterns described so far are for matching input records.
The @code{BEGIN} and @code{END} special patterns are different.
@@ -12855,7 +12759,7 @@ using library functions.
for a number of useful library functions.
If an @command{awk} program has only @code{BEGIN} rules and no
-other rules, then the program exits after the @code{BEGIN} rule is
+other rules, then the program exits after the @code{BEGIN} rules are
run.@footnote{The original version of @command{awk} kept
reading and ignoring input until the end of the file was seen.} However, if an
@code{END} rule exists, then the input is read, even if there are
@@ -12883,7 +12787,7 @@ Another way is simply to assign a value to @code{$0}.
@cindex @code{print} statement, @code{BEGIN}/@code{END} patterns and
@cindex @code{BEGIN} pattern, @code{print} statement and
@cindex @code{END} pattern, @code{print} statement and
-The second point is similar to the first but from the other direction.
+The second point is similar to the first, but from the other direction.
Traditionally, due largely to implementation issues, @code{$0} and
@code{NF} were @emph{undefined} inside an @code{END} rule.
The POSIX standard specifies that @code{NF} is available in an @code{END}
@@ -12920,8 +12824,6 @@ are not valid in an @code{END} rule, because all the input has been read.
@ifdocbook
@DBREF{Nextfile Statement}.)
@end ifdocbook
-@c ENDOFRANGE beg
-@c ENDOFRANGE end
@node BEGINFILE/ENDFILE
@subsection The @code{BEGINFILE} and @code{ENDFILE} Special Patterns
@@ -12974,7 +12876,7 @@ fatal error.
@item
If you have written extensions that modify the record handling (by
-inserting an ``input parser,'' @pxref{Input Parsers}), you can invoke
+inserting an ``input parser''; @pxref{Input Parsers}), you can invoke
them at this point, before @command{gawk} has started processing the file.
(This is a @emph{very} advanced feature, currently used only by the
@uref{http://gawkextlib.sourceforge.net, @code{gawkextlib} project}.)
@@ -12985,8 +12887,8 @@ the last record in an input file. For the last input file,
it will be called before any @code{END} rules.
The @code{ENDFILE} rule is executed even for empty input files.
-Normally, when an error occurs when reading input in the normal input
-processing loop, the error is fatal. However, if an @code{ENDFILE}
+Normally, when an error occurs when reading input in the normal
+input-processing loop, the error is fatal. However, if an @code{ENDFILE}
rule is present, the error becomes non-fatal, and instead @code{ERRNO}
is set. This makes it possible to catch and process I/O errors at the
level of the @command{awk} program.
@@ -12995,7 +12897,7 @@ level of the @command{awk} program.
The @code{next} statement (@pxref{Next Statement}) is not allowed inside
either a @code{BEGINFILE} or an @code{ENDFILE} rule. The @code{nextfile}
statement is allowed only inside a
-@code{BEGINFILE} rule, but not inside an @code{ENDFILE} rule.
+@code{BEGINFILE} rule, not inside an @code{ENDFILE} rule.
@cindex @code{getline} statement, @code{BEGINFILE}/@code{ENDFILE} patterns and
The @code{getline} statement (@pxref{Getline}) is restricted inside
@@ -13042,7 +12944,6 @@ awk '@{ print $1 @}' mail-list
@noindent
prints the first field of every record.
-@c ENDOFRANGE pat
@node Using Shell Variables
@section Using Shell Variables in Programs
@@ -13072,11 +12973,11 @@ awk "/$pattern/ "'@{ nmatches++ @}
@noindent
The @command{awk} program consists of two pieces of quoted text
that are concatenated together to form the program.
-The first part is double quoted, which allows substitution of
+The first part is double-quoted, which allows substitution of
the @code{pattern} shell variable inside the quotes.
-The second part is single quoted.
+The second part is single-quoted.
-Variable substitution via quoting works, but can be potentially
+Variable substitution via quoting works, but can potentially be
messy. It requires a good understanding of the shell's quoting rules
(@pxref{Quoting}),
and it's often difficult to correctly
@@ -13191,11 +13092,8 @@ For deleting array elements.
@node Statements
@section Control Statements in Actions
-@c STARTOFRANGE csta
@cindex control statements
-@c STARTOFRANGE acs
@cindex statements, control, in actions
-@c STARTOFRANGE accs
@cindex actions, control statements in
@dfn{Control statements}, such as @code{if}, @code{while}, and so on,
@@ -13338,13 +13236,13 @@ The body of this loop is a compound statement enclosed in braces,
containing two statements.
The loop works in the following manner: first, the value of @code{i} is set to one.
Then, the @code{while} statement tests whether @code{i} is less than or equal to
-three. This is true when @code{i} equals one, so the @code{i}-th
+three. This is true when @code{i} equals one, so the @code{i}th
field is printed. Then the @samp{i++} increments the value of @code{i}
and the loop repeats. The loop terminates when @code{i} reaches four.
A newline is not required between the condition and the
body; however, using one makes the program clearer unless the body is a
-compound statement or else is very simple. The newline after the open-brace
+compound statement or else is very simple. The newline after the open brace
that begins the compound statement is not required either, but the
program is harder to read without it.
@@ -13374,9 +13272,9 @@ while (@var{condition})
@end example
@noindent
-This statement does not execute @var{body} even once if the @var{condition}
-is false to begin with.
-The following is an example of a @code{do} statement:
+This statement does not execute the @var{body} even once if the
+@var{condition} is false to begin with. The following is an example of
+a @code{do} statement:
@example
@{
@@ -13443,7 +13341,7 @@ their assignments as separate statements preceding the @code{for} loop.)
The same is true of the @var{increment} part. Incrementing additional
variables requires separate statements at the end of the loop.
The C compound expression, using C's comma operator, is useful in
-this context but it is not supported in @command{awk}.
+this context, but it is not supported in @command{awk}.
Most often, @var{increment} is an increment expression, as in the previous
example. But this is not required; it can be any expression
@@ -13534,7 +13432,7 @@ default:
Control flow in
the @code{switch} statement works as it does in C. Once a match to a given
case is made, the case statement bodies execute until a @code{break},
-@code{continue}, @code{next}, @code{nextfile} or @code{exit} is encountered,
+@code{continue}, @code{next}, @code{nextfile}, or @code{exit} is encountered,
or the end of the @code{switch} statement itself. For example:
@example
@@ -13708,7 +13606,12 @@ body of a loop. Historical versions of @command{awk} treated a @code{continue}
statement outside a loop the same way they treated a @code{break}
statement outside a loop: as if it were a @code{next}
statement
+@ifset FOR_PRINT
+(discussed in the following section).
+@end ifset
+@ifclear FOR_PRINT
(@pxref{Next Statement}).
+@end ifclear
@value{DARKCORNER}
Recent versions of BWK @command{awk} no longer work this way, nor
does @command{gawk}.
@@ -13836,7 +13739,7 @@ See @uref{http://austingroupbugs.net/view.php?id=607, the Austin Group website}.
@cindex @code{nextfile} statement, user-defined functions and
@cindex Brian Kernighan's @command{awk}
@cindex @command{mawk} utility
-The current version of BWK @command{awk}, and @command{mawk}
+The current version of BWK @command{awk} and @command{mawk}
also support @code{nextfile}. However, they don't allow the
@code{nextfile} statement inside function bodies (@pxref{User-defined}).
@command{gawk} does; a @code{nextfile} inside a function body reads the
@@ -13874,7 +13777,7 @@ any @code{ENDFILE} rules; they do not execute.
In such a case,
if you don't want the @code{END} rule to do its job, set a variable
-to nonzero before the @code{exit} statement and check that variable in
+to a nonzero value before the @code{exit} statement and check that variable in
the @code{END} rule.
@DBXREF{Assert Function}
for an example that does this.
@@ -13913,15 +13816,10 @@ Negative values, and values of 127 or greater, may not produce consistent
results across different operating systems.
@end quotation
-@c ENDOFRANGE csta
-@c ENDOFRANGE acs
-@c ENDOFRANGE accs
@node Built-in Variables
@section Predefined Variables
-@c STARTOFRANGE bvar
@cindex predefined variables
-@c STARTOFRANGE varb
@cindex variables, predefined
Most @command{awk} variables are available to use for your own
@@ -13947,10 +13845,8 @@ their areas of activity.
@end menu
@node User-modified
-@subsection Built-In Variables That Control @command{awk}
-@c STARTOFRANGE bvaru
+@subsection Built-in Variables That Control @command{awk}
@cindex predefined variables, user-modifiable
-@c STARTOFRANGE nmbv
@cindex user-modifiable variables
The following is an alphabetical list of variables that you can change to
@@ -13978,7 +13874,7 @@ respectively, should use binary I/O. A string value of @code{"rw"} or
@code{"wr"} indicates that all files should use binary I/O. Any other
string value is treated the same as @code{"rw"}, but causes @command{gawk}
to generate a warning message. @code{BINMODE} is described in more
-detail in @ref{PC Using}. @command{mawk} (@pxref{Other Versions}),
+detail in @ref{PC Using}. @command{mawk} (@pxref{Other Versions})
also supports this variable, but only using numeric values.
@cindex @code{CONVFMT} variable
@@ -13986,7 +13882,7 @@ also supports this variable, but only using numeric values.
@cindex numbers, converting, to strings
@cindex strings, converting, numbers to
@item @code{CONVFMT}
-This string controls conversion of numbers to
+A string that controls the conversion of numbers to
strings (@pxref{Conversion}).
It works by being passed, in effect, as the first argument to the
@code{sprintf()} function
@@ -14061,7 +13957,7 @@ is to simply say @samp{FS = FS}, perhaps with an explanatory comment.
@cindex regular expressions, case sensitivity
@item IGNORECASE #
If @code{IGNORECASE} is nonzero or non-null, then all string comparisons
-and all regular expression matching are case independent. Thus, regexp
+and all regular expression matching are case-independent. Thus, regexp
matching with @samp{~} and @samp{!~}, as well as the @code{gensub()},
@code{gsub()}, @code{index()}, @code{match()}, @code{patsplit()},
@code{split()}, and @code{sub()}
@@ -14087,7 +13983,7 @@ Any other true value prints nonfatal warnings.
Assigning a false value to @code{LINT} turns off the lint warnings.
This variable is a @command{gawk} extension. It is not special
-in other @command{awk} implementations. Unlike the other special variables,
+in other @command{awk} implementations. Unlike with the other special variables,
changing @code{LINT} does affect the production of lint warnings,
even if @command{gawk} is in compatibility mode. Much as
the @option{--lint} and @option{--traditional} options independently
@@ -14099,7 +13995,7 @@ of @command{awk} being executed.
@cindex numbers, converting, to strings
@cindex strings, converting, numbers to
@item OFMT
-Controls conversion of numbers to
+A string that controls conversion of numbers to
strings (@pxref{Conversion}) for
printing with the @code{print} statement. It works by being passed
as the first argument to the @code{sprintf()} function
@@ -14114,7 +14010,7 @@ strings in general expressions; this is now done by @code{CONVFMT}.
@cindex separators, field
@cindex field separators
@item OFS
-This is the output field separator (@pxref{Output Separators}). It is
+The output field separator (@pxref{Output Separators}). It is
output between the fields printed by a @code{print} statement. Its
default value is @w{@code{" "}}, a string consisting of a single space.
@@ -14132,7 +14028,7 @@ The working precision of arbitrary-precision floating-point numbers,
@cindex @code{ROUNDMODE} variable
@item ROUNDMODE #
The rounding mode to use for arbitrary-precision arithmetic on
-numbers, by default @code{"N"} (@samp{roundTiesToEven} in
+numbers, by default @code{"N"} (@code{roundTiesToEven} in
the IEEE 754 standard; @pxref{Setting the rounding mode}).
@cindex @code{RS} variable
@@ -14161,7 +14057,7 @@ just the first character of @code{RS}'s value is used.
@item @code{SUBSEP}
The subscript separator. It has the default value of
@code{"\034"} and is used to separate the parts of the indices of a
-multidimensional array. Thus, the expression @code{@w{foo["A", "B"]}}
+multidimensional array. Thus, the expression @samp{@w{foo["A", "B"]}}
really accesses @code{foo["A\034B"]}
(@pxref{Multidimensional}).
@@ -14177,17 +14073,11 @@ marked string constants in the source text, as well as for the
(@pxref{Internationalization}).
The default value of @code{TEXTDOMAIN} is @code{"messages"}.
@end table
-@c ENDOFRANGE bvar
-@c ENDOFRANGE varb
-@c ENDOFRANGE bvaru
-@c ENDOFRANGE nmbv
@node Auto-set
-@subsection Built-In Variables That Convey Information
+@subsection Built-in Variables That Convey Information
-@c STARTOFRANGE bvconi
@cindex predefined variables, conveying information
-@c STARTOFRANGE vbconi
@cindex variables, predefined conveying information
The following is an alphabetical list of variables that @command{awk}
sets automatically on certain occasions in order to provide
@@ -14348,12 +14238,12 @@ input file.
@item @code{NF}
The number of fields in the current input record.
@code{NF} is set each time a new record is read, when a new field is
-created or when @code{$0} changes (@pxref{Fields}).
+created, or when @code{$0} changes (@pxref{Fields}).
Unlike most of the variables described in this @value{SUBSECTION},
assigning a value to @code{NF} has the potential to affect
@command{awk}'s internal workings. In particular, assignments
-to @code{NF} can be used to create or remove fields from the
+to @code{NF} can be used to create fields in or remove fields from the
current record. @xref{Changing Fields}.
@cindex @code{FUNCTAB} array
@@ -14407,7 +14297,7 @@ or @code{"FPAT"} if field matching with @code{FPAT} is in effect.
@item PROCINFO["identifiers"]
@cindex program identifiers
A subarray, indexed by the names of all identifiers used in the text of
-the AWK program. An @dfn{identifier} is simply the name of a variable
+the @command{awk} program. An @dfn{identifier} is simply the name of a variable
(be it scalar or array), built-in function, user-defined function, or
extension function. For each identifier, the value of the element is
one of the following:
@@ -14427,7 +14317,7 @@ The identifier is an extension function loaded via
The identifier is a scalar.
@item "untyped"
-The identifier is untyped (could be used as a scalar or array,
+The identifier is untyped (could be used as a scalar or an array;
@command{gawk} doesn't know yet).
@item "user"
@@ -14553,7 +14443,7 @@ is the length of the matched string, or @minus{}1 if no match is found.
@cindex @code{RSTART} variable
@item @code{RSTART}
-The start-index in characters of the substring that is matched by the
+The start index in characters of the substring that is matched by the
@code{match()} function
(@pxref{String Functions}).
@code{RSTART} is set by invoking the @code{match()} function. Its value
@@ -14620,11 +14510,9 @@ function multiply(variable, amount)
@quotation NOTE
In order to avoid severe time-travel paradoxes,@footnote{Not to mention difficult
implementation issues.} neither @code{FUNCTAB} nor @code{SYMTAB}
-are available as elements within the @code{SYMTAB} array.
+is available as an element within the @code{SYMTAB} array.
@end quotation
@end table
-@c ENDOFRANGE bvconi
-@c ENDOFRANGE vbconi
@sidebar Changing @code{NR} and @code{FNR}
@cindex @code{NR} variable, changing
@@ -14796,7 +14684,7 @@ When designing your program, you should choose options that don't
conflict with @command{gawk}'s, because it will process any options
that it accepts before passing the rest of the command line on to
your program. Using @samp{#!} with the @option{-E} option may help
-(@DBXREF{Executable Scripts}
+(@DBPXREF{Executable Scripts}
and
@ifnotdocbook
@DBPXREF{Options}).
@@ -14810,15 +14698,15 @@ and
@itemize @value{BULLET}
@item
-Pattern-action pairs make up the basic elements of an @command{awk}
+Pattern--action pairs make up the basic elements of an @command{awk}
program. Patterns are either normal expressions, range expressions,
-regexp constants, one of the special keywords @code{BEGIN}, @code{END},
-@code{BEGINFILE}, @code{ENDFILE}, or empty. The action executes if
+or regexp constants; one of the special keywords @code{BEGIN}, @code{END},
+@code{BEGINFILE}, or @code{ENDFILE}; or empty. The action executes if
the current record matches the pattern. Empty (missing) patterns match
all records.
@item
-I/O from @code{BEGIN} and @code{END} rules have certain constraints.
+I/O from @code{BEGIN} and @code{END} rules has certain constraints.
This is also true, only more so, for @code{BEGINFILE} and @code{ENDFILE}
rules. The latter two give you ``hooks'' into @command{gawk}'s file
processing, allowing you to recover from a file that otherwise would
@@ -14848,12 +14736,12 @@ iteration of a loop (or get out of a @code{switch}).
@item
@code{next} and @code{nextfile} let you read the next record and start
-over at the top of your program, or skip to the next input file and
+over at the top of your program or skip to the next input file and
start over, respectively.
@item
The @code{exit} statement terminates your program. When executed
-from an action (or function body) it transfers control to the
+from an action (or function body), it transfers control to the
@code{END} statements. From an @code{END} statement body, it exits
immediately. You may pass an optional numeric value to be used
as @command{awk}'s exit status.
@@ -14871,7 +14759,6 @@ control how @command{awk} will process the provided @value{DF}s.
@node Arrays
@chapter Arrays in @command{awk}
-@c STARTOFRANGE arrs
@cindex arrays
An @dfn{array} is a table of values called @dfn{elements}. The
@@ -14957,15 +14844,17 @@ the declaration.
indices---e.g., @samp{15 .. 27}---but the size of the array is still fixed when
the array is declared.)
-A contiguous array of four elements might look like the following example,
-conceptually, if the element values are 8, @code{"foo"},
-@code{""}, and 30
+@c 1/2015: Do not put the numeric values into @code. Array element
+@c values are no different than scalar variable values.
+A contiguous array of four elements might look like
@ifnotdocbook
-as shown in @ref{figure-array-elements}:
+@ref{figure-array-elements},
@end ifnotdocbook
@ifdocbook
-as shown in @inlineraw{docbook, <xref linkend="figure-array-elements"/>}:
+@inlineraw{docbook, <xref linkend="figure-array-elements"/>},
@end ifdocbook
+conceptually, if the element values are eight, @code{"foo"},
+@code{""}, and 30.
@ifnotdocbook
@float Figure,figure-array-elements
@@ -14990,12 +14879,10 @@ as shown in @inlineraw{docbook, <xref linkend="figure-array-elements"/>}:
@noindent
Only the values are stored; the indices are implicit from the order of
-the values. Here, 8 is the value at index zero, because 8 appears in the
+the values. Here, eight is the value at index zero, because eight appears in the
position with zero elements before it.
-@c STARTOFRANGE arrin
@cindex arrays, indexing
-@c STARTOFRANGE inarr
@cindex indexing arrays
@cindex associative arrays
@cindex arrays, associative
@@ -15004,19 +14891,21 @@ that each array is a collection of pairs---an index and its corresponding
array element value:
@ifnotdocbook
-@example
-@r{Index} 3 @r{Value} 30
-@r{Index} 1 @r{Value} "foo"
-@r{Index} 0 @r{Value} 8
-@r{Index} 2 @r{Value} ""
-@end example
+@c extra empty column to indent it right
+@multitable @columnfractions .1 .1 .1
+@headitem @tab Index @tab Value
+@item @tab @code{3} @tab @code{30}
+@item @tab @code{1} @tab @code{"foo"}
+@item @tab @code{0} @tab @code{8}
+@item @tab @code{2} @tab @code{""}
+@end multitable
@end ifnotdocbook
@docbook
<informaltable>
<tgroup cols="2">
-<colspec colname="1" align="center"/>
-<colspec colname="2" align="center"/>
+<colspec colname="1" align="left"/>
+<colspec colname="2" align="left"/>
<thead>
<row>
<entry>Index</entry>
@@ -15062,20 +14951,22 @@ at any time. For example, suppose a tenth element is added to the array
whose value is @w{@code{"number ten"}}. The result is:
@ifnotdocbook
-@example
-@r{Index} 10 @r{Value} "number ten"
-@r{Index} 3 @r{Value} 30
-@r{Index} 1 @r{Value} "foo"
-@r{Index} 0 @r{Value} 8
-@r{Index} 2 @r{Value} ""
-@end example
+@c extra empty column to indent it right
+@multitable @columnfractions .1 .1 .2
+@headitem @tab Index @tab Value
+@item @tab @code{10} @tab @code{"number ten"}
+@item @tab @code{3} @tab @code{30}
+@item @tab @code{1} @tab @code{"foo"}
+@item @tab @code{0} @tab @code{8}
+@item @tab @code{2} @tab @code{""}
+@end multitable
@end ifnotdocbook
@docbook
<informaltable>
<tgroup cols="2">
-<colspec colname="1" align="center"/>
-<colspec colname="2" align="center"/>
+<colspec colname="1" align="left"/>
+<colspec colname="2" align="left"/>
<thead>
<row>
<entry>Index</entry>
@@ -15127,19 +15018,20 @@ an index. For example, the following is an array that translates words from
English to French:
@ifnotdocbook
-@example
-@r{Index} "dog" @r{Value} "chien"
-@r{Index} "cat" @r{Value} "chat"
-@r{Index} "one" @r{Value} "un"
-@r{Index} 1 @r{Value} "un"
-@end example
+@multitable @columnfractions .1 .1 .1
+@headitem @tab Index @tab Value
+@item @tab @code{"dog"} @tab @code{"chien"}
+@item @tab @code{"cat"} @tab @code{"chat"}
+@item @tab @code{"one"} @tab @code{"un"}
+@item @tab @code{1} @tab @code{"un"}
+@end multitable
@end ifnotdocbook
@docbook
<informaltable>
<tgroup cols="2">
-<colspec colname="1" align="center"/>
-<colspec colname="2" align="center"/>
+<colspec colname="1" align="left"/>
+<colspec colname="2" align="left"/>
<thead>
<row>
<entry>Index</entry>
@@ -15181,7 +15073,7 @@ numbers and strings as indices.
There are some subtleties to how numbers work when used as
array subscripts; this is discussed in more detail in
@ref{Numeric Array Subscripts}.)
-Here, the number @code{1} isn't double quoted, because @command{awk}
+Here, the number @code{1} isn't double-quoted, because @command{awk}
automatically converts it to a string.
@cindex @command{gawk}, @code{IGNORECASE} variable in
@@ -15198,8 +15090,6 @@ that array's indices are consecutive integers starting at one.
@command{awk}'s arrays are efficient---the time to access an element
is independent of the number of elements in the array.
-@c ENDOFRANGE arrin
-@c ENDOFRANGE inarr
@node Reference to Elements
@subsection Referring to an Array Element
@@ -15208,7 +15098,7 @@ is independent of the number of elements in the array.
@cindex elements of arrays
The principal way to use an array is to refer to one of its elements.
-An array reference is an expression as follows:
+An @dfn{array reference} is an expression as follows:
@example
@var{array}[@var{index-expression}]
@@ -15218,8 +15108,11 @@ An array reference is an expression as follows:
Here, @var{array} is the name of an array. The expression @var{index-expression} is
the index of the desired element of the array.
+@c 1/2015: Having the 4.3 in @samp is a little iffy. It's essentially
+@c an expression though, so leave be. It's to early in the discussion
+@c to mention that it's really a string.
The value of the array reference is the current value of that array
-element. For example, @code{foo[4.3]} is an expression for the element
+element. For example, @code{foo[4.3]} is an expression referencing the element
of array @code{foo} at index @samp{4.3}.
@cindex arrays, unassigned elements
@@ -15311,7 +15204,7 @@ assign to that element of the array.
The following program takes a list of lines, each beginning with a line
number, and prints them out in order of line number. The line numbers
-are not in order when they are first read---instead they
+are not in order when they are first read---instead, they
are scrambled. This program sorts the lines by making an array using
the line numbers as subscripts. The program then prints out the lines
in sorted order of their numbers. It is a very simple program and gets
@@ -15405,7 +15298,7 @@ program has previously used, with the variable @var{var} set to that index.
The following program uses this form of the @code{for} statement. The
first rule scans the input records and notes which words appear (at
least once) in the input, by storing a one into the array @code{used} with
-the word as index. The second rule scans the elements of @code{used} to
+the word as the index. The second rule scans the elements of @code{used} to
find all the distinct words that appear in the input. It prints each
word that is more than 10 characters long and also prints the number of
such words.
@@ -15502,7 +15395,7 @@ and will vary from one version of @command{awk} to the next.
Often, though, you may wish to do something simple, such as
``traverse the array by comparing the indices in ascending order,''
or ``traverse the array by comparing the values in descending order.''
-@command{gawk} provides two mechanisms which give you this control.
+@command{gawk} provides two mechanisms that give you this control:
@itemize @value{BULLET}
@item
@@ -15559,21 +15452,26 @@ across different environments.} which @command{gawk} uses internally
to perform the sorting.
@item "@@ind_str_desc"
-String indices ordered from high to low.
+Like @code{"@@ind_str_asc"}, but the
+string indices are ordered from high to low.
@item "@@ind_num_desc"
-Numeric indices ordered from high to low.
+Like @code{"@@ind_num_asc"}, but the
+numeric indices are ordered from high to low.
@item "@@val_type_desc"
-Element values, based on type, ordered from high to low.
+Like @code{"@@val_type_asc"}, but the
+element values, based on type, are ordered from high to low.
Subarrays, if present, come out first.
@item "@@val_str_desc"
-Element values, treated as strings, ordered from high to low.
+Like @code{"@@val_str_asc"}, but the
+element values, treated as strings, are ordered from high to low.
Subarrays, if present, come out first.
@item "@@val_num_desc"
-Element values, treated as numbers, ordered from high to low.
+Like @code{"@@val_num_asc"}, but the
+element values, treated as numbers, are ordered from high to low.
Subarrays, if present, come out first.
@end table
@@ -15796,7 +15694,7 @@ for (i in frequencies)
@noindent
This example removes all the elements from the array @code{frequencies}.
Once an element is deleted, a subsequent @code{for} statement to scan the array
-does not report that element and the @code{in} operator to check for
+does not report that element and using the @code{in} operator to check for
the presence of that element returns zero (i.e., false):
@example
@@ -16056,7 +15954,7 @@ a[1][2] = 2
This simulates a true two-dimensional array. Each subarray element can
contain another subarray as a value, which in turn can hold other arrays
as well. In this way, you can create arrays of three or more dimensions.
-The indices can be any @command{awk} expression, including scalars
+The indices can be any @command{awk} expressions, including scalars
separated by commas (i.e., a regular @command{awk} simulated
multidimensional subscript). So the following is valid in
@command{gawk}:
@@ -16068,7 +15966,7 @@ a[1][3][1, "name"] = "barney"
Each subarray and the main array can be of different length. In fact, the
elements of an array or its subarray do not all have to have the same
type. This means that the main array and any of its subarrays can be
-non-rectangular, or jagged in structure. You can assign a scalar value to
+nonrectangular, or jagged in structure. You can assign a scalar value to
the index @code{4} of the main array @code{a}, even though @code{a[1]}
is itself an array and not a scalar:
@@ -16092,7 +15990,8 @@ a[4][5][6][7] = "An element in a four-dimensional array"
@noindent
This removes the scalar value from index @code{4} and then inserts a
-subarray of subarray of subarray containing a scalar. You can also
+three-level nested subarray
+containing a scalar. You can also
delete an entire subarray or subarray of subarrays:
@example
@@ -16103,7 +16002,7 @@ a[4][5] = "An element in subarray a[4]"
But recall that you can not delete the main array @code{a} and then use it
as a scalar.
-The built-in functions which take array arguments can also be used
+The built-in functions that take array arguments can also be used
with subarrays. For example, the following code fragment uses @code{length()}
(@pxref{String Functions})
to determine the number of elements in the main array @code{a} and
@@ -16133,7 +16032,7 @@ can be nested to scan all the
elements of an array of arrays if it is rectangular in structure. In order
to print the contents (scalar values) of a two-dimensional array of arrays
(i.e., in which each first-level element is itself an
-array, not necessarily of the same length)
+array, not necessarily of the same length),
you could use the following code:
@example
@@ -16233,9 +16132,9 @@ versions of @command{awk}.
@item
Standard @command{awk} simulates multidimensional arrays by separating
-subscript values with a comma. The values are concatenated into a
+subscript values with commas. The values are concatenated into a
single string, separated by the value of @code{SUBSEP}. The fact
-that such a subscript was created in this way is not retained; thus
+that such a subscript was created in this way is not retained; thus,
changing @code{SUBSEP} may have unexpected consequences. You can use
@samp{(@var{sub1}, @var{sub2}, @dots{}) in @var{array}} to see if such
a multidimensional subscript exists in @var{array}.
@@ -16244,7 +16143,7 @@ a multidimensional subscript exists in @var{array}.
@command{gawk} provides true arrays of arrays. You use a separate
set of square brackets for each dimension in such an array:
@code{data[row][col]}, for example. Array elements may thus be either
-scalar values (number or string) or another array.
+scalar values (number or string) or other arrays.
@item
Use the @code{isarray()} built-in function to determine if an array
@@ -16252,14 +16151,11 @@ element is itself a subarray.
@end itemize
-@c ENDOFRANGE arrs
@node Functions
@chapter Functions
-@c STARTOFRANGE funcbi
@cindex functions, built-in
-@c STARTOFRANGE bifunc
@cindex built-in functions
This @value{CHAPTER} describes @command{awk}'s built-in functions,
which fall into three categories: numeric, string, and I/O.
@@ -16272,6 +16168,9 @@ Besides the built-in functions, @command{awk} has provisions for
writing new functions that the rest of a program can use.
The second half of this @value{CHAPTER} describes these
@dfn{user-defined} functions.
+Finally, we explore indirect function calls, a @command{gawk}-specific
+extension that lets you determine at runtime what function is to
+be called.
@menu
* Built-in:: Summarizes the built-in functions.
@@ -16281,7 +16180,7 @@ The second half of this @value{CHAPTER} describes these
@end menu
@node Built-in
-@section Built-In Functions
+@section Built-in Functions
@dfn{Built-in} functions are always available for
your @command{awk} program to call. This @value{SECTION} defines all
@@ -16304,7 +16203,7 @@ but are summarized here for your convenience.
@end menu
@node Calling Built-in
-@subsection Calling Built-In Functions
+@subsection Calling Built-in Functions
To call one of @command{awk}'s built-in functions, write the name of
the function followed
@@ -16355,7 +16254,7 @@ j = atan2(++i, i *= 2)
@end example
If the order of evaluation is left to right, then @code{i} first becomes
-6, and then 12, and @code{atan2()} is called with the two arguments 6
+six, and then 12, and @code{atan2()} is called with the two arguments six
and 12. But if the order of evaluation is right to left, @code{i}
first becomes 10, then 11, and @code{atan2()} is called with the
two arguments 11 and 10.
@@ -16436,7 +16335,7 @@ In fact, @command{gawk} uses the BSD @code{random()} function, which is
considerably better than @code{rand()}, to produce random numbers.}
Often random integers are needed instead. Following is a user-defined function
-that can be used to obtain a random non-negative integer less than @var{n}:
+that can be used to obtain a random nonnegative integer less than @var{n}:
@example
function randint(n)
@@ -16531,7 +16430,7 @@ implementations.
The functions in this @value{SECTION} look at or change the text of one
or more strings.
-@code{gawk} understands locales (@pxref{Locales}), and does all
+@command{gawk} understands locales (@pxref{Locales}) and does all
string processing in terms of @emph{characters}, not @emph{bytes}.
This distinction is particularly important to understand for locales
where one character may be represented by multiple bytes. Thus, for
@@ -16620,7 +16519,7 @@ a[2] = "de"
a[3] = "sac"
@end example
-The @code{asorti()} function works similarly to @code{asort()}, however,
+The @code{asorti()} function works similarly to @code{asort()}; however,
the @emph{indices} are sorted, instead of the values. Thus, in the
previous example, starting with the same initial set of indices and
values in @code{a}, calling @samp{asorti(a)} would yield:
@@ -16735,7 +16634,7 @@ If @var{find} is not found, @code{index()} returns zero.
With BWK @command{awk} and @command{gawk},
it is a fatal error to use a regexp constant for @var{find}.
Other implementations allow it, simply treating the regexp
-constant as an expression meaning @samp{$0 ~ /regexp/}. @value{DARKCORNER}.
+constant as an expression meaning @samp{$0 ~ /regexp/}. @value{DARKCORNER}
@item @code{length(}[@var{string}]@code{)}
@cindexawkfunc{length}
@@ -16818,7 +16717,7 @@ If @option{--posix} is supplied, using an array argument is a fatal error
@cindex string, regular expression match
@cindex match regexp in string
Search @var{string} for the
-longest, leftmost substring matched by the regular expression,
+longest, leftmost substring matched by the regular expression
@var{regexp} and return the character position (index)
at which that substring begins (one, if it starts at the beginning of
@var{string}). If no match is found, return zero.
@@ -16830,7 +16729,7 @@ In the latter case, the string is treated as a regexp to be matched.
discussion of the difference between the two forms, and the
implications for writing your program correctly.
-The order of the first two arguments is backwards from most other string
+The order of the first two arguments is the opposite of most other string
functions that work with regular expressions, such as
@code{sub()} and @code{gsub()}. It might help to remember that
for @code{match()}, the order is the same as for the @samp{~} operator:
@@ -16919,7 +16818,7 @@ $ @kbd{echo foooobazbarrrrr |}
@end example
There may not be subscripts for the start and index for every parenthesized
-subexpression, because they may not all have matched text; thus they
+subexpression, because they may not all have matched text; thus, they
should be tested for with the @code{in} operator
(@pxref{Reference to Elements}).
@@ -16966,13 +16865,13 @@ a regexp describing where to split @var{string} (much as @code{FS} can
be a regexp describing where to split input records).
If @var{fieldsep} is omitted, the value of @code{FS} is used.
@code{split()} returns the number of elements created.
-@var{seps} is a @command{gawk} extension with @code{@var{seps}[@var{i}]}
+@var{seps} is a @command{gawk} extension, with @code{@var{seps}[@var{i}]}
being the separator string
between @code{@var{array}[@var{i}]} and @code{@var{array}[@var{i}+1]}.
If @var{fieldsep} is a single
-space then any leading whitespace goes into @code{@var{seps}[0]} and
+space, then any leading whitespace goes into @code{@var{seps}[0]} and
any trailing
-whitespace goes into @code{@var{seps}[@var{n}]} where @var{n} is the
+whitespace goes into @code{@var{seps}[@var{n}]}, where @var{n} is the
return value of
@code{split()} (i.e., the number of elements in @var{array}).
@@ -16985,7 +16884,7 @@ split("cul-de-sac", a, "-", seps)
@noindent
@cindex strings splitting, example
-splits the string @samp{cul-de-sac} into three fields using @samp{-} as the
+splits the string @code{"cul-de-sac"} into three fields using @samp{-} as the
separator. It sets the contents of the array @code{a} as follows:
@example
@@ -17010,19 +16909,18 @@ As with input field-splitting, when the value of @var{fieldsep} is
the elements of
@var{array} but not in @var{seps}, and the elements
are separated by runs of whitespace.
-Also, as with input field-splitting, if @var{fieldsep} is the null string, each
+Also, as with input field splitting, if @var{fieldsep} is the null string, each
individual character in the string is split into its own array element.
@value{COMMONEXT}
Note, however, that @code{RS} has no effect on the way @code{split()}
-works. Even though @samp{RS = ""} causes newline to also be an input
+works. Even though @samp{RS = ""} causes the newline character to also be an input
field separator, this does not affect how @code{split()} splits strings.
@cindex dark corner, @code{split()} function
Modern implementations of @command{awk}, including @command{gawk}, allow
-the third argument to be a regexp constant (@code{/abc/}) as well as a
-string.
-@value{DARKCORNER}
+the third argument to be a regexp constant (@w{@code{/}@dots{}@code{/}})
+as well as a string. @value{DARKCORNER}
The POSIX standard allows this as well.
@DBXREF{Computed Regexps} for a
discussion of the difference between using a string constant or a regexp constant,
@@ -17159,7 +17057,7 @@ an @samp{&}:
@cindex @code{sub()} function, arguments of
@cindex @code{gsub()} function, arguments of
As mentioned, the third argument to @code{sub()} must
-be a variable, field or array element.
+be a variable, field, or array element.
Some versions of @command{awk} allow the third argument to
be an expression that is not an lvalue. In such a case, @code{sub()}
still searches for the pattern and returns zero or one, but the result of
@@ -17318,8 +17216,8 @@ example, @code{"a\qb"} is treated as @code{"aqb"}.
At the runtime level, the various functions handle sequences of
@samp{\} and @samp{&} differently. The situation is (sadly) somewhat complex.
-Historically, the @code{sub()} and @code{gsub()} functions treated the two
-character sequence @samp{\&} specially; this sequence was replaced in
+Historically, the @code{sub()} and @code{gsub()} functions treated the
+two-character sequence @samp{\&} specially; this sequence was replaced in
the generated text with a single @samp{&}. Any other @samp{\} within
the @var{replacement} string that did not precede an @samp{&} was passed
through unchanged. This is illustrated in @ref{table-sub-escapes}.
@@ -17377,7 +17275,7 @@ _bigskip}
@end float
@noindent
-This table shows both the lexical-level processing, where
+This table shows the lexical-level processing, where
an odd number of backslashes becomes an even number at the runtime level,
as well as the runtime processing done by @code{sub()}.
(For the sake of simplicity, the rest of the following tables only show the
@@ -17398,7 +17296,7 @@ This is shown in
@ref{table-sub-proposed}.
@float Table,table-sub-proposed
-@caption{GNU @command{awk} rules for @code{sub()} and backslash}
+@caption{@command{gawk} rules for @code{sub()} and backslash}
@tex
\vbox{\bigskip
% We need more characters for escape and tab ...
@@ -17443,7 +17341,7 @@ _bigskip}
@end float
In a nutshell, at the runtime level, there are now three special sequences
-of characters (@samp{\\\&}, @samp{\\&} and @samp{\&}) whereas historically
+of characters (@samp{\\\&}, @samp{\\&}, and @samp{\&}) whereas historically
there was only one. However, as in the historical case, any @samp{\} that
is not part of one of these three sequences is not special and appears
in the output literally.
@@ -17509,7 +17407,7 @@ The only case where the difference is noticeable is the last one: @samp{\\\\}
is seen as @samp{\\} and produces @samp{\} instead of @samp{\\}.
Starting with @value{PVERSION} 3.1.4, @command{gawk} followed the POSIX rules
-when @option{--posix} is specified (@pxref{Options}). Otherwise,
+when @option{--posix} was specified (@pxref{Options}). Otherwise,
it continued to follow the proposed rules, as
that had been its behavior for many years.
@@ -17577,7 +17475,7 @@ _bigskip}
@end ifnottex
@end float
-Because of the complexity of the lexical and runtime level processing
+Because of the complexity of the lexical- and runtime-level processing
and the special cases for @code{sub()} and @code{gsub()},
we recommend the use of @command{gawk} and @code{gensub()} when you have
to do substitutions.
@@ -17603,6 +17501,7 @@ for more information.
When closing a coprocess, it is occasionally useful to first close
one end of the two-way pipe and then to close the other. This is done
by providing a second argument to @code{close()}. This second argument
+(@var{how})
should be one of the two string values @code{"to"} or @code{"from"},
indicating which end of the pipe to close. Case in the string does
not matter.
@@ -17629,7 +17528,7 @@ every little bit of information as soon as it is ready. However, sometimes
it is necessary to force a program to @dfn{flush} its buffers (i.e.,
write the information to its destination, even if a buffer is not full).
This is the purpose of the @code{fflush()} function---@command{gawk} also
-buffers its output and the @code{fflush()} function forces
+buffers its output, and the @code{fflush()} function forces
@command{gawk} to flush its buffers.
@cindex extensions, common@comma{} @code{fflush()} function
@@ -17650,7 +17549,7 @@ would flush only the standard output if there was no argument,
and flush all output files and pipes if the argument was the null
string. This was changed in order to be compatible with Brian
Kernighan's @command{awk}, in the hope that standardizing this
-feature in POSIX would then be easier (which indeed helped).
+feature in POSIX would then be easier (which indeed proved to be the case).
With @command{gawk},
you can use @samp{fflush("/dev/stdout")} if you wish to flush
@@ -17661,7 +17560,7 @@ only the standard output.
@c @cindex warnings, automatic
@cindex troubleshooting, @code{fflush()} function
@code{fflush()} returns zero if the buffer is successfully flushed;
-otherwise, it returns non-zero. (@command{gawk} returns @minus{}1.)
+otherwise, it returns a nonzero value. (@command{gawk} returns @minus{}1.)
In the case where all buffers are flushed, the return value is zero
only if all buffers were flushed successfully. Otherwise, it is
@minus{}1, and @command{gawk} warns about the problem @var{filename}.
@@ -17674,8 +17573,8 @@ In such a case, @code{fflush()} returns @minus{}1, as well.
@sidebar Interactive Versus Noninteractive Buffering
@cindex buffering, interactive vs.@: noninteractive
-As a side point, buffering issues can be even more confusing, depending
-upon whether your program is @dfn{interactive} (i.e., communicating
+As a side point, buffering issues can be even more confusing if
+your program is @dfn{interactive} (i.e., communicating
with a user sitting at a keyboard).@footnote{A program is interactive
if the standard output is connected to a terminal device. On modern
systems, this means your keyboard and screen.}
@@ -17718,7 +17617,7 @@ it is all buffered and sent down the pipe to @command{cat} in one shot.
@cindexawkfunc{system}
@cindex invoke shell command
@cindex interacting with other programs
-Execute the operating-system
+Execute the operating system
command @var{command} and then return to the @command{awk} program.
Return @var{command}'s exit status.
@@ -17822,18 +17721,14 @@ you would see the latter (undesirable) output.
@subsection Time Functions
@cindex time functions
-@c STARTOFRANGE tst
@cindex timestamps
-@c STARTOFRANGE logftst
@cindex log files, timestamps in
-@c STARTOFRANGE filogtst
@cindex files, log@comma{} timestamps in
-@c STARTOFRANGE gawtst
@cindex @command{gawk}, timestamps
@cindex POSIX @command{awk}, timestamps and
-@code{awk} programs are commonly used to process log files
+@command{awk} programs are commonly used to process log files
containing timestamp information, indicating when a
-particular log record was written. Many programs log their timestamp
+particular log record was written. Many programs log their timestamps
in the form returned by the @code{time()} system call, which is the
number of seconds since a particular epoch. On POSIX-compliant systems,
it is the number of seconds since
@@ -17894,7 +17789,7 @@ The values of these numbers need not be within the ranges specified;
for example, an hour of @minus{}1 means 1 hour before midnight.
The origin-zero Gregorian calendar is assumed, with year 0 preceding
year 1 and year @minus{}1 preceding year 0.
-The time is assumed to be in the local timezone.
+The time is assumed to be in the local time zone.
If the daylight-savings flag is positive, the time is assumed to be
daylight savings time; if zero, the time is assumed to be standard
time; and if negative (the default), @code{mktime()} attempts to determine
@@ -17906,7 +17801,6 @@ is out of range, @code{mktime()} returns @minus{}1.
@cindex @command{gawk}, @code{PROCINFO} array in
@cindex @code{PROCINFO} array
@item @code{strftime(}[@var{format} [@code{,} @var{timestamp} [@code{,} @var{utc-flag}] ] ]@code{)}
-@c STARTOFRANGE strf
@cindexgawkfunc{strftime}
@cindex format time string
Format the time specified by @var{timestamp}
@@ -18055,12 +17949,12 @@ Equivalent to specifying @samp{%H:%M:%S}.
The weekday as a decimal number (1--7). Monday is day one.
@item %U
-The week number of the year (the first Sunday as the first day of week one)
+The week number of the year (with the first Sunday as the first day of week one)
as a decimal number (00--53).
@c @cindex ISO 8601
@item %V
-The week number of the year (the first Monday as the first
+The week number of the year (with the first Monday as the first
day of week one) as a decimal number (01--53).
The method for determining the week number is as specified by ISO 8601.
(To wit: if the week containing January 1 has four or more days in the
@@ -18071,7 +17965,7 @@ and the next week is week one.)
The weekday as a decimal number (0--6). Sunday is day zero.
@item %W
-The week number of the year (the first Monday as the first day of week one)
+The week number of the year (with the first Monday as the first day of week one)
as a decimal number (00--53).
@item %x
@@ -18091,8 +17985,8 @@ The full year as a decimal number (e.g., 2015).
@c @cindex RFC 822
@c @cindex RFC 1036
@item %z
-The timezone offset in a +HHMM format (e.g., the format necessary to
-produce RFC 822/RFC 1036 date headers).
+The time zone offset in a @samp{+@var{HHMM}} format (e.g., the format
+necessary to produce RFC 822/RFC 1036 date headers).
@item %Z
The time zone name or abbreviation; no characters if
@@ -18155,7 +18049,6 @@ The time as a decimal timestamp in seconds since the epoch.
The date in VMS format (e.g., @samp{20-JUN-1991}).
@end ignore
@end table
-@c ENDOFRANGE strf
Additionally, the alternative representations are recognized but their
normal representations are used.
@@ -18206,23 +18099,14 @@ gawk 'BEGIN @{
exit exitval
@}' "$@@"
@end example
-@c ENDOFRANGE tst
-@c ENDOFRANGE logftst
-@c ENDOFRANGE filogtst
-@c ENDOFRANGE gawtst
@node Bitwise Functions
@subsection Bit-Manipulation Functions
@cindex bit-manipulation functions
-@c STARTOFRANGE bit
@cindex bitwise, operations
-@c STARTOFRANGE and
@cindex AND bitwise operation
-@c STARTOFRANGE oro
@cindex OR bitwise operation
-@c STARTOFRANGE xor
@cindex XOR bitwise operation
-@c STARTOFRANGE opbit
@cindex operations, bitwise
@quotation
@i{I can explain it for you, but I can't understand it for you.}
@@ -18242,7 +18126,7 @@ The operations are described in @ref{table-bitwise-ops}.
@ifnottex
@ifnotdocbook
@display
- Bit Operator
+ Bit operator
| AND | OR | XOR
|---+---+---+---+---+---
Operands | 0 | 1 | 0 | 1 | 0 | 1
@@ -18300,7 +18184,7 @@ Operands | 0 | 1 | 0 | 1 | 0 | 1
<tbody>
<row>
<entry colsep="0"></entry>
-<entry spanname="optitle"><emphasis role="bold">Bit Operator</emphasis></entry>
+<entry spanname="optitle"><emphasis role="bold">Bit operator</emphasis></entry>
</row>
<row rowsep="1">
@@ -18364,10 +18248,9 @@ of a given value.
Finally, two other common operations are to shift the bits left or right.
For example, if you have a bit string @samp{10111001} and you shift it
right by three bits, you end up with @samp{00010111}.@footnote{This example
-shows that 0's come in on the left side. For @command{gawk}, this is
+shows that zeros come in on the left side. For @command{gawk}, this is
always true, but in some languages, it's possible to have the left side
-fill with 1's.}
-@c Purposely decided to use 0's and 1's here. 2/2001.
+fill with ones.}
If you start over again with @samp{10111001} and shift it left by three
bits, you end up with @samp{11001000}. The following list describes
@command{gawk}'s built-in functions that implement the bitwise operations.
@@ -18421,7 +18304,7 @@ that illustrates the use of these functions:
@example
@group
@c file eg/lib/bits2str.awk
-# bits2str --- turn a byte into readable 1's and 0's
+# bits2str --- turn a byte into readable ones and zeros
function bits2str(bits, data, mask)
@{
@@ -18514,11 +18397,6 @@ decimal and octal values for the same numbers
(@pxref{Nondecimal-numbers}),
and then demonstrates the
results of the @code{compl()}, @code{lshift()}, and @code{rshift()} functions.
-@c ENDOFRANGE bit
-@c ENDOFRANGE and
-@c ENDOFRANGE oro
-@c ENDOFRANGE xor
-@c ENDOFRANGE opbit
@node Type Functions
@subsection Getting Type Information
@@ -18598,15 +18476,11 @@ variant of the same message.
The default value for @var{domain} is the current value of @code{TEXTDOMAIN}.
The default value for @var{category} is @code{"LC_MESSAGES"}.
@end table
-@c ENDOFRANGE funcbi
-@c ENDOFRANGE bifunc
@node User-defined
@section User-Defined Functions
-@c STARTOFRANGE udfunc
@cindex user-defined functions
-@c STARTOFRANGE funcud
@cindex functions, user-defined
Complicated @command{awk} programs can often be simplified by defining
your own functions. User-defined functions can be called just like
@@ -18631,7 +18505,6 @@ variable definitions is appallingly awful.}
@author Brian Kernighan
@end quotation
-@c STARTOFRANGE fdef
@cindex functions, defining
Definitions of functions can appear anywhere between the rules of an
@command{awk} program. Thus, the general form of an @command{awk} program is
@@ -18669,10 +18542,15 @@ the call.
A function cannot have two parameters with the same name, nor may it
have a parameter with the same name as the function itself.
-In addition, according to the POSIX standard, function parameters
+
+@quotation CAUTION
+According to the POSIX standard, function parameters
cannot have the same name as one of the special predefined variables
-(@pxref{Built-in Variables}). Not all versions of @command{awk} enforce
-this restriction.
+(@pxref{Built-in Variables}), nor may a function parameter have the
+same name as another function.
+Not all versions of @command{awk} enforce
+these restrictions.
+@end quotation
Local variables act like the empty string if referenced where a string
value is required, and like zero if referenced where a numeric value
@@ -18878,12 +18756,10 @@ You might think that @code{ctime()} could use @code{PROCINFO["strftime"]}
for its format string. That would be a mistake, because @code{ctime()} is
supposed to return the time formatted in a standard fashion, and user-level
code could have changed @code{PROCINFO["strftime"]}.
-@c ENDOFRANGE fdef
@node Function Caveats
@subsection Calling User-Defined Functions
-@c STARTOFRANGE fudc
@cindex functions, user-defined, calling
@dfn{Calling a function} means causing the function to run and do its job.
A function call is an expression and its value is the value returned by
@@ -19175,7 +19051,6 @@ or the @code{nextfile} statement
@end ifnotdocbook
inside a user-defined function.
@command{gawk} does not have this limitation.
-@c ENDOFRANGE fudc
@node Return Statement
@subsection The @code{return} Statement
@@ -19303,7 +19178,6 @@ does report the second error.
Usually, such things aren't a big issue, but it's worth
being aware of them.
-@c ENDOFRANGE udfunc
@node Indirect Calls
@section Indirect Function Calls
@@ -19393,13 +19267,13 @@ using indirect function calls:
@c file eg/prog/indirectcall.awk
# average --- return the average of the values in fields $first - $last
-function average(first, last, sum, i)
+function average(first, last, the_sum, i)
@{
- sum = 0;
+ the_sum = 0;
for (i = first; i <= last; i++)
- sum += $i
+ the_sum += $i
- return sum / (last - first + 1)
+ return the_sum / (last - first + 1)
@}
# sum --- return the sum of the values in fields $first - $last
@@ -19729,7 +19603,7 @@ for (i = 1; i <= n; i++)
@end example
@noindent
-@code{gawk} looks up the actual function to call only once.
+@command{gawk} looks up the actual function to call only once.
@node Functions Summary
@section Summary
@@ -19796,7 +19670,6 @@ program. This is equivalent to function pointers in C and C++.
@end itemize
-@c ENDOFRANGE funcud
@ifnotinfo
@part @value{PART2}Problem Solving with @command{awk}
@@ -19818,11 +19691,8 @@ It contains the following chapters:
@node Library Functions
@chapter A Library of @command{awk} Functions
-@c STARTOFRANGE libf
@cindex libraries of @command{awk} functions
-@c STARTOFRANGE flib
@cindex functions, library
-@c STARTOFRANGE fudlib
@cindex functions, user-defined, library of
@DBREF{User-defined} describes how to write
@@ -20145,13 +20015,9 @@ be tested with @command{gawk} and the results compared to the built-in
@node Assert Function
@subsection Assertions
-@c STARTOFRANGE asse
@cindex assertions
-@c STARTOFRANGE assef
@cindex @code{assert()} function (C library)
-@c STARTOFRANGE libfass
@cindex libraries of @command{awk} functions, assertions
-@c STARTOFRANGE flibass
@cindex functions, library, assertions
@cindex @command{awk} programs, lengthy, assertions
When writing large programs, it is often useful to know
@@ -20267,10 +20133,6 @@ most likely causing the program to hang as it waits for input.
There is a simple workaround to this:
make sure that such a @code{BEGIN} rule always ends
with an @code{exit} statement.
-@c ENDOFRANGE asse
-@c ENDOFRANGE assef
-@c ENDOFRANGE flibass
-@c ENDOFRANGE libfass
@node Round Function
@subsection Rounding Numbers
@@ -20828,11 +20690,8 @@ function shell_quote(s, # parameter
@node Data File Management
@section @value{DDF} Management
-@c STARTOFRANGE dataf
@cindex files, managing
-@c STARTOFRANGE libfdataf
@cindex libraries of @command{awk} functions, managing, data files
-@c STARTOFRANGE flibdataf
@cindex functions, library, managing data files
This @value{SECTION} presents functions that are useful for managing
command-line @value{DF}s.
@@ -21195,22 +21054,14 @@ The use of @code{No_command_assign} allows you to disable command-line
assignments at invocation time, by giving the variable a true value.
When not set, it is initially zero (i.e., false), so the command-line arguments
are left alone.
-@c ENDOFRANGE dataf
-@c ENDOFRANGE flibdataf
-@c ENDOFRANGE libfdataf
@node Getopt Function
@section Processing Command-Line Options
-@c STARTOFRANGE libfclo
@cindex libraries of @command{awk} functions, command-line options
-@c STARTOFRANGE flibclo
@cindex functions, library, command-line options
-@c STARTOFRANGE clop
@cindex command-line options, processing
-@c STARTOFRANGE oclp
@cindex options, command-line, processing
-@c STARTOFRANGE clibf
@cindex functions, library, C library
@cindex arguments, processing
Most utilities on POSIX-compatible systems take options on
@@ -21562,21 +21413,13 @@ further options
Several of the sample programs presented in
@ref{Sample Programs},
use @code{getopt()} to process their arguments.
-@c ENDOFRANGE libfclo
-@c ENDOFRANGE flibclo
-@c ENDOFRANGE clop
-@c ENDOFRANGE oclp
@node Passwd Functions
@section Reading the User Database
-@c STARTOFRANGE libfudata
@cindex libraries of @command{awk} functions, user database, reading
-@c STARTOFRANGE flibudata
@cindex functions, library, user database@comma{} reading
-@c STARTOFRANGE udatar
@cindex user database@comma{} reading
-@c STARTOFRANGE dataur
@cindex database, users@comma{} reading
@cindex @code{PROCINFO} array
The @code{PROCINFO} array
@@ -21923,21 +21766,13 @@ and such a change would clutter up the code.
The @command{id} program in @DBREF{Id Program}
uses these functions.
-@c ENDOFRANGE libfudata
-@c ENDOFRANGE flibudata
-@c ENDOFRANGE udatar
-@c ENDOFRANGE dataur
@node Group Functions
@section Reading the Group Database
-@c STARTOFRANGE libfgdata
@cindex libraries of @command{awk} functions, group database, reading
-@c STARTOFRANGE flibgdata
@cindex functions, library, group database@comma{} reading
-@c STARTOFRANGE gdatar
@cindex group database, reading
-@c STARTOFRANGE datagr
@cindex database, group, reading
@cindex @code{PROCINFO} array, and group membership
@cindex @code{getgrent()} function (C library)
@@ -22260,7 +22095,6 @@ function getgrent()
@}
@c endfile
@end example
-@c ENDOFRANGE clibf
@cindex @code{endgrent()} function (C library)
The @code{endgrent()} function resets @code{_gr_count} to zero so that @code{getgrent()} can
@@ -22349,10 +22183,6 @@ $ @kbd{gawk -f walk_array.awk}
@print{} a[4][2] = 42
@end example
-@c ENDOFRANGE libfgdata
-@c ENDOFRANGE flibgdata
-@c ENDOFRANGE gdatar
-@c ENDOFRANGE libf
@node Library Functions Summary
@section Summary
@@ -22466,13 +22296,9 @@ output identical to that of the original version.
@end enumerate
@c EXCLUDE END
-@c ENDOFRANGE flib
-@c ENDOFRANGE fudlib
-@c ENDOFRANGE datagr
@node Sample Programs
@chapter Practical @command{awk} Programs
-@c STARTOFRANGE awkpex
@cindex @command{awk} programs, examples of
@c FULLXREF ON
@@ -22542,7 +22368,6 @@ cut.awk -- -c1-8 myfiles > results
@node Clones
@section Reinventing Wheels for Fun and Profit
-@c STARTOFRANGE posimawk
@cindex POSIX, programs@comma{} implementing in @command{awk}
This @value{SECTION} presents a number of POSIX utilities implemented in
@@ -22573,11 +22398,8 @@ The programs are presented in alphabetical order.
@subsection Cutting Out Fields and Columns
@cindex @command{cut} utility
-@c STARTOFRANGE cut
@cindex @command{cut} utility
-@c STARTOFRANGE ficut
@cindex fields, cutting
-@c STARTOFRANGE colcut
@cindex columns, cutting
The @command{cut} utility selects, or ``cuts,'' characters or fields
from its standard input and sends them to its standard output.
@@ -22885,21 +22707,14 @@ other @command{awk} implementations to use @code{substr()}
it is also extremely painful.
The @code{FIELDWIDTHS} variable supplies an elegant solution to the problem
of picking the input line apart by characters.
-@c ENDOFRANGE cut
-@c ENDOFRANGE ficut
-@c ENDOFRANGE colcut
@node Egrep Program
@subsection Searching for Regular Expressions in Files
-@c STARTOFRANGE regexps
@cindex regular expressions, searching for
-@c STARTOFRANGE sfregexp
@cindex searching, files for regular expressions
-@c STARTOFRANGE fsregexp
@cindex files, searching for regular expressions
-@c STARTOFRANGE egrep
@cindex @command{egrep} utility
The @command{egrep} utility searches files for patterns. It uses regular
expressions that are almost identical to those available in @command{awk}
@@ -23167,17 +22982,12 @@ function usage()
@c endfile
@end example
-@c ENDOFRANGE regexps
-@c ENDOFRANGE sfregexp
-@c ENDOFRANGE fsregexp
-@c ENDOFRANGE egrep
@node Id Program
@subsection Printing Out User Information
@cindex printing, user information
@cindex users, information about, printing
-@c STARTOFRANGE id
@cindex @command{id} utility
The @command{id} utility lists a user's real and effective user ID numbers,
real and effective group ID numbers, and the user's group set, if any.
@@ -23306,16 +23116,13 @@ code that is used repeatedly, making the whole program
shorter and cleaner. In particular, moving the check for
the empty string into this function saves several lines of code.
-@c ENDOFRANGE id
@node Split Program
@subsection Splitting a Large File into Pieces
@c FIXME: One day, update to current POSIX version of split
-@c STARTOFRANGE filspl
@cindex files, splitting
-@c STARTOFRANGE split
@cindex @code{split} utility
The @command{split} program splits large text files into smaller pieces.
Usage is as follows:@footnote{This is the traditional usage. The
@@ -23450,15 +23257,12 @@ You might want to consider how to eliminate the use of
way as to solve the EBCDIC issue as well.
@end ifset
-@c ENDOFRANGE filspl
-@c ENDOFRANGE split
@node Tee Program
@subsection Duplicating Output into Multiple Files
@cindex files, multiple@comma{} duplicating output into
@cindex output, duplicating into files
-@c STARTOFRANGE tee
@cindex @code{tee} utility
The @code{tee} program is known as a ``pipe fitting.'' @code{tee} copies
its standard input to its standard output and also duplicates it to the
@@ -23571,18 +23375,14 @@ END @{
@}
@c endfile
@end example
-@c ENDOFRANGE tee
@node Uniq Program
@subsection Printing Nonduplicated Lines of Text
@c FIXME: One day, update to current POSIX version of uniq
-@c STARTOFRANGE prunt
@cindex printing, unduplicated lines of text
-@c STARTOFRANGE tpul
@cindex text@comma{} printing, unduplicated lines of
-@c STARTOFRANGE uniq
@cindex @command{uniq} utility
The @command{uniq} utility reads sorted lines of data on its standard
input, and by default removes duplicate lines. In other words, it only
@@ -23851,26 +23651,17 @@ suggestion.
@end ifset
-@c ENDOFRANGE prunt
-@c ENDOFRANGE tpul
-@c ENDOFRANGE uniq
@node Wc Program
@subsection Counting Things
@c FIXME: One day, update to current POSIX version of wc
-@c STARTOFRANGE count
@cindex counting
-@c STARTOFRANGE infco
@cindex input files, counting elements in
-@c STARTOFRANGE woco
@cindex words, counting
-@c STARTOFRANGE chco
@cindex characters, counting
-@c STARTOFRANGE lico
@cindex lines, counting
-@c STARTOFRANGE wc
@cindex @command{wc} utility
The @command{wc} (word count) utility counts lines, words, and characters in
one or more input files. Its usage is as follows:
@@ -24040,13 +23831,6 @@ END @{
@}
@c endfile
@end example
-@c ENDOFRANGE count
-@c ENDOFRANGE infco
-@c ENDOFRANGE lico
-@c ENDOFRANGE woco
-@c ENDOFRANGE chco
-@c ENDOFRANGE wc
-@c ENDOFRANGE posimawk
@node Miscellaneous Programs
@section A Grab Bag of @command{awk} Programs
@@ -24177,9 +23961,7 @@ Aharon Robbins <arnold@skeeve.com> wrote:
@author Erik Quanstrom
@end quotation
-@c STARTOFRANGE tialarm
@cindex time, alarm clock example program
-@c STARTOFRANGE alaex
@cindex alarm clock example program
The following program is a simple ``alarm clock'' program.
You give it a time of day and an optional message. At the specified time,
@@ -24331,15 +24113,11 @@ seconds are necessary:
@}
@c endfile
@end example
-@c ENDOFRANGE tialarm
-@c ENDOFRANGE alaex
@node Translate Program
@subsection Transliterating Characters
-@c STARTOFRANGE chtra
@cindex characters, transliterating
-@c STARTOFRANGE tr
@cindex @command{tr} utility
The system @command{tr} utility transliterates characters. For example, it is
often used to map uppercase letters into lowercase for further processing:
@@ -24487,15 +24265,11 @@ such as @samp{a-z}, as allowed by the @command{tr} utility.
Look at the code for @file{cut.awk} (@pxref{Cut Program})
for inspiration.
-@c ENDOFRANGE chtra
-@c ENDOFRANGE tr
@node Labels Program
@subsection Printing Mailing Labels
-@c STARTOFRANGE prml
@cindex printing, mailing labels
-@c STARTOFRANGE mlprint
@cindex mailing labels@comma{} printing
Here is a ``real world''@footnote{``Real world'' is defined as
``a program actually used to get something done.''}
@@ -24559,7 +24333,6 @@ that there are two blank lines at the top and two blank lines at the bottom.
The @code{END} rule arranges to flush the final page of labels; there may
not have been an even multiple of 20 labels in the data:
-@c STARTOFRANGE labels
@cindex @code{labels.awk} program
@example
@c file eg/prog/labels.awk
@@ -24624,14 +24397,10 @@ END @{
@}
@c endfile
@end example
-@c ENDOFRANGE prml
-@c ENDOFRANGE mlprint
-@c ENDOFRANGE labels
@node Word Sorting
@subsection Generating Word-Usage Counts
-@c STARTOFRANGE worus
@cindex words, usage counts@comma{} generating
When working with large amounts of text, it can be interesting to know
@@ -24693,7 +24462,6 @@ to remove punctuation characters. Finally, we solve the third problem
by using the system @command{sort} utility to process the output of the
@command{awk} script. Here is the new version of the program:
-@c STARTOFRANGE wordfreq
@cindex @code{wordfreq.awk} program
@example
@c file eg/prog/wordfreq.awk
@@ -24758,13 +24526,10 @@ This way of sorting must be used on systems that do not
have true pipes at the command-line (or batch-file) level.
See the general operating system documentation for more information on how
to use the @command{sort} program.
-@c ENDOFRANGE worus
-@c ENDOFRANGE wordfreq
@node History Sorting
@subsection Removing Duplicates from Unsorted Text
-@c STARTOFRANGE lidu
@cindex lines, duplicate@comma{} removing
The @command{uniq} program
(@pxref{Uniq Program}),
@@ -24789,7 +24554,6 @@ Each element of @code{lines} is a unique command, and the indices of
The @code{END} rule simply prints out the lines, in order:
@cindex Rakitzis, Byron
-@c STARTOFRANGE histsort
@cindex @code{histsort.awk} program
@example
@c file eg/prog/histsort.awk
@@ -24832,15 +24596,11 @@ print data[lines[i]], lines[i]
@noindent
This works because @code{data[$0]} is incremented each time a line is
seen.
-@c ENDOFRANGE lidu
-@c ENDOFRANGE histsort
@node Extract Program
@subsection Extracting Programs from Texinfo Source Files
-@c STARTOFRANGE texse
@cindex Texinfo, extracting programs from source files
-@c STARTOFRANGE fitex
@cindex files, Texinfo@comma{} extracting programs from
@ifnotinfo
Both this chapter and the previous chapter
@@ -24944,7 +24704,6 @@ The first rule handles calling @code{system()}, checking that a command is
given (@code{NF} is at least three) and also checking that the command
exits with a zero exit status, signifying OK:
-@c STARTOFRANGE extract
@cindex @code{extract.awk} program
@example
@c file eg/prog/extract.awk
@@ -25090,9 +24849,6 @@ END @{
@}
@c endfile
@end example
-@c ENDOFRANGE texse
-@c ENDOFRANGE fitex
-@c ENDOFRANGE extract
@node Simple Sed
@subsection A Simple Stream Editor
@@ -25122,7 +24878,6 @@ additional arguments are treated as @value{DF} names to process. If none
are provided, the standard input is used:
@cindex Brennan, Michael
-@c STARTOFRANGE awksed
@cindex @command{awksed.awk} program
@c @cindex simple stream editor
@c @cindex stream editor, simple
@@ -25199,14 +24954,11 @@ The @code{usage()} function prints an error message and exits.
Finally, the single rule handles the printing scheme outlined earlier,
using @code{print} or @code{printf} as appropriate, depending upon the
value of @code{RT}.
-@c ENDOFRANGE awksed
@node Igawk Program
@subsection An Easy Way to Use Library Functions
-@c STARTOFRANGE libfex
@cindex libraries of @command{awk} functions, example program for using
-@c STARTOFRANGE flibex
@cindex functions, library, example program for using
In @ref{Include Files}, we saw how @command{gawk} provides a built-in
file-inclusion capability. However, this is a @command{gawk} extension.
@@ -25345,7 +25097,6 @@ program.
The program is as follows:
-@c STARTOFRANGE igawk
@cindex @code{igawk.sh} program
@example
@c file eg/prog/igawk.sh
@@ -25670,10 +25421,6 @@ features to a program; they can often be layered on top.@footnote{@command{gawk}
does @code{@@include} processing itself in order to support the use
of @command{awk} programs as Web CGI scripts.}
-@c ENDOFRANGE libfex
-@c ENDOFRANGE flibex
-@c ENDOFRANGE awkpex
-@c ENDOFRANGE igawk
@node Anagram Program
@subsection Finding Anagrams from a Dictionary
@@ -25697,7 +25444,6 @@ The following program uses arrays of arrays to bring together
words with the same signature and array sorting to print the words
in sorted order:
-@c STARTOFRANGE anagram
@cindex @code{anagram.awk} program
@example
@c file eg/prog/anagram.awk
@@ -25806,7 +25552,6 @@ babery yabber
@dots{}
@end example
-@c ENDOFRANGE anagram
@node Signature Program
@subsection And Now for Something Completely Different
@@ -26126,9 +25871,7 @@ It contains the following chapters:
@node Advanced Features
@chapter Advanced Features of @command{gawk}
-@c STARTOFRANGE gawadv
@cindex @command{gawk}, features, advanced
-@c STARTOFRANGE advgaw
@cindex advanced features, @command{gawk}
@ignore
Contributed by: Peter Langston <pud!psl@bellcore.bellcore.com>
@@ -26838,7 +26581,6 @@ using regular pipes.
@section Using @command{gawk} for Network Programming
@cindex advanced features, network programming
@cindex networks, programming
-@c STARTOFRANGE tcpip
@cindex TCP/IP
@cindex @code{/inet/@dots{}} special files (@command{gawk})
@cindex files, @code{/inet/@dots{}} (@command{gawk})
@@ -26955,13 +26697,10 @@ which comes as part of the @command{gawk} distribution,
for a much more complete introduction and discussion, as well as
extensive examples.
-@c ENDOFRANGE tcpip
@node Profiling
@section Profiling Your @command{awk} Programs
-@c STARTOFRANGE awkp
@cindex @command{awk} programs, profiling
-@c STARTOFRANGE proawk
@cindex profiling @command{awk} programs
@cindex @code{awkprof.out} file
@cindex files, @code{awkprof.out}
@@ -27288,9 +27027,6 @@ that the profiling output does. This makes it easy to pretty-print your
code once development is completed, and then use the result as the final
version of your program.
-@c ENDOFRANGE awkp
-@c ENDOFRANGE proawk
-
@node Advanced Features Summary
@section Summary
@@ -27336,8 +27072,6 @@ the program, but that will change in the next major release.
@end itemize
-@c ENDOFRANGE advgaw
-@c ENDOFRANGE gawadv
@node Internationalization
@chapter Internationalization with @command{gawk}
@@ -27350,7 +27084,6 @@ countries, they were able to sell more systems.
As a result, internationalization and localization
of programs and software systems became a common practice.
-@c STARTOFRANGE inloc
@cindex internationalization, localization
@cindex @command{gawk}, internationalization and, See internationalization
@cindex internationalization, localization, @command{gawk} and
@@ -27395,7 +27128,6 @@ monetary values are printed and read.
@section GNU @command{gettext}
@cindex internationalizing a program
-@c STARTOFRANGE gettex
@cindex @command{gettext} library
@command{gawk} uses GNU @command{gettext} to provide its internationalization
features.
@@ -27447,7 +27179,6 @@ lookup of the translations.
@cindex @code{.po} files
@cindex files, @code{.po}
-@c STARTOFRANGE portobfi
@cindex portable object files
@cindex files, portable object
@item
@@ -27459,7 +27190,6 @@ For example, there might be a @file{fr.po} for a French translation.
@cindex @code{.gmo} files
@cindex files, @code{.gmo}
@cindex message object files
-@c STARTOFRANGE portmsgfi
@cindex files, message object
@item
Each language's @file{.po} file is converted into a binary
@@ -27587,11 +27317,9 @@ before or after the day in a date, local month abbreviations, and so on.
@item LC_ALL
All of the above. (Not too useful in the context of @command{gettext}.)
@end table
-@c ENDOFRANGE gettex
@node Programmer i18n
@section Internationalizing @command{awk} Programs
-@c STARTOFRANGE inap
@cindex @command{awk} programs, internationalizing
@command{gawk} provides the following variables and functions for
@@ -27824,8 +27552,6 @@ to provide you translations that you can also then distribute.
@DBXREF{I18N Example}
for the full list of steps to go through to create and test
translations for @command{guide}.
-@c ENDOFRANGE portobfi
-@c ENDOFRANGE portmsgfi
@node Printf Ordering
@subsection Rearranging @code{printf} Arguments
@@ -28001,7 +27727,6 @@ However, because the positional specifications are primarily for use in
@emph{translated} format strings, and because non-GNU @command{awk}s never
retrieve the translated string, this should not be a problem in practice.
@end itemize
-@c ENDOFRANGE inap
@node I18N Example
@section A Simple Internationalization Example
@@ -28152,8 +27877,8 @@ complete detail in
@cite{GNU gettext tools}}.)
@end ifnotinfo
As of this writing, the latest version of GNU @command{gettext} is
-@uref{ftp://ftp.gnu.org/gnu/gettext/gettext-0.19.3.tar.gz,
-@value{PVERSION} 0.19.3}.
+@uref{ftp://ftp.gnu.org/gnu/gettext/gettext-0.19.4.tar.gz,
+@value{PVERSION} 0.19.4}.
If a translation of @command{gawk}'s messages exists,
then @command{gawk} produces usage messages, warnings,
@@ -28197,7 +27922,6 @@ a number of translations for its messages.
@end itemize
-@c ENDOFRANGE inloc
@node Debugger
@chapter Debugging @command{awk} Programs
@@ -29801,7 +29525,7 @@ is available like so:
@example
$ @kbd{gawk --version}
@print{} GNU Awk 4.1.2, API: 1.1 (GNU MPFR 3.1.0-p3, GNU MP 5.0.2)
-@print{} Copyright (C) 1989, 1991-2014 Free Software Foundation.
+@print{} Copyright (C) 1989, 1991-2015 Free Software Foundation.
@dots{}
@end example
@@ -30455,7 +30179,7 @@ When asked about the algorithm used, Katie replied:
@quotation
It's not that well known but it's not that obscure either.
It's Euler's modification to Newton's method for calculating pi.
-Take a look at lines (23) - (25) here: @uref{http://mathworld.wolfram.com/PiFormulas.htm}.
+Take a look at lines (23) - (25) here: @uref{http://mathworld.wolfram.com/PiFormulas.html}.
The algorithm I wrote simply expands the multiply by 2 and works from
the innermost expression outwards. I used this to program HP calculators
@@ -30505,7 +30229,7 @@ Allowing completely alphabetic strings to have valid numeric
values is also a very severe departure from historical practice.
@end itemize
-The second problem is that the @code{gawk} maintainer feels that this
+The second problem is that the @command{gawk} maintainer feels that this
interpretation of the standard, which requires a certain amount of
``language lawyering'' to arrive at in the first place, was not even
intended by the standard developers. In other words, ``we see how you
@@ -30664,7 +30388,7 @@ When @option{--sandbox} is specified, extensions are disabled
* Finding Extensions:: How @command{gawk} finds compiled extensions.
* Extension Example:: Example C code for an extension.
* Extension Samples:: The sample extensions that ship with
- @code{gawk}.
+ @command{gawk}.
* gawkextlib:: The @code{gawkextlib} project.
* Extension summary:: Extension summary.
* Extension Exercises:: Exercises.
@@ -31633,7 +31357,7 @@ If the concept of a ``record terminator'' makes sense, then
@code{*rt_start} should be set to point to the data to be used for
@code{RT}, and @code{*rt_len} should be set to the length of the
data. Otherwise, @code{*rt_len} should be set to zero.
-@code{gawk} makes its own copy of this data, so the
+@command{gawk} makes its own copy of this data, so the
extension must manage this storage.
@end table
@@ -31679,7 +31403,7 @@ When writing an input parser, you should think about (and document)
how it is expected to interact with @command{awk} code. You may want
it to always be called, and take effect as appropriate (as the
@code{readdir} extension does). Or you may want it to take effect
-based upon the value of an @code{awk} variable, as the XML extension
+based upon the value of an @command{awk} variable, as the XML extension
from the @code{gawkextlib} project does (@pxref{gawkextlib}).
In the latter case, code in a @code{BEGINFILE} section
can look at @code{FILENAME} and @code{ERRNO} to decide whether or
@@ -32462,7 +32186,7 @@ converts it to a string. Using non-integral values is possible, but
requires that you understand how such values are converted to strings
(@pxref{Conversion}); thus using integral values is safest.
-As with @emph{all} strings passed into @code{gawk} from an extension,
+As with @emph{all} strings passed into @command{gawk} from an extension,
the string value of @code{index} must come from @code{gawk_malloc()},
@code{gawk_calloc()} or @code{gawk_realloc()}, and
@command{gawk} releases the storage.
@@ -34804,9 +34528,7 @@ online documentation}.
@node V7/SVR3.1
@appendixsec Major Changes Between V7 and SVR3.1
-@c STARTOFRANGE gawkv
@cindex @command{awk}, versions of
-@c STARTOFRANGE gawkv1
@cindex @command{awk}, versions of, changes between V7 and SVR3.1
The @command{awk} language evolved considerably between the release of
@@ -34893,7 +34615,6 @@ Multiple @code{BEGIN} and @code{END} rules
Multidimensional arrays
(@pxref{Multidimensional}).
@end itemize
-@c ENDOFRANGE gawkv1
@node SVR4
@appendixsec Changes Between SVR3.1 and SVR4
@@ -35008,7 +34729,6 @@ not permitted by the POSIX standard.
The 2008 POSIX standard can be found online at
@url{http://www.opengroup.org/onlinepubs/9699919799/}.
-@c ENDOFRANGE gawkv
@node BTL
@appendixsec Extensions in Brian Kernighan's @command{awk}
@@ -35054,11 +34774,8 @@ available in his @command{awk}.
@node POSIX/GNU
@appendixsec Extensions in @command{gawk} Not in POSIX @command{awk}
-@c STARTOFRANGE fripls
@cindex compatibility mode (@command{gawk}), extensions
-@c STARTOFRANGE exgnot
@cindex extensions, in @command{gawk}, not in POSIX @command{awk}
-@c STARTOFRANGE posnot
@cindex POSIX, @command{gawk} extensions not included in
The GNU implementation, @command{gawk}, adds a large number of features.
They can all be disabled with either the @option{--traditional} or
@@ -35372,9 +35089,6 @@ Support for MirBSD was removed at @command{gawk} @value{PVERSION} 4.2.
@c XXX ADD MORE STUFF HERE
-@c ENDOFRANGE fripls
-@c ENDOFRANGE exgnot
-@c ENDOFRANGE posnot
@c This does not need to be in the formal book.
@ifclear FOR_PRINT
@@ -36423,9 +36137,7 @@ the appropriate credit where credit is due.
@c last two commas are part of see also
@cindex operating systems, See Also GNU/Linux@comma{} PC operating systems@comma{} Unix
-@c STARTOFRANGE gligawk
@cindex @command{gawk}, installing
-@c STARTOFRANGE ingawk
@cindex installing @command{gawk}
This appendix provides instructions for installing @command{gawk} on the
various platforms that are supported by the developers. The primary
@@ -36535,7 +36247,6 @@ a local expert.
@node Distribution contents
@appendixsubsec Contents of the @command{gawk} Distribution
-@c STARTOFRANGE gawdis
@cindex @command{gawk}, distribution
The @command{gawk} distribution has a number of C source files,
@@ -36734,7 +36445,6 @@ directory to run your version of @command{gawk} against the test suite.
If @command{gawk} successfully passes @samp{make check}, then you can
be confident of a successful port.
@end table
-@c ENDOFRANGE gawdis
@node Unix Installation
@appendixsec Compiling and Installing @command{gawk} on Unix-Like Systems
@@ -36885,7 +36595,7 @@ can be configured and compiled.
@cindex @option{--disable-lint} configuration option
@cindex configuration option, @code{--disable-lint}
@item --disable-lint
-Disable all lint checking within @code{gawk}. The
+Disable all lint checking within @command{gawk}. The
@option{--lint} and @option{--lint-old} options
(@pxref{Options})
are accepted, but silently do nothing.
@@ -37199,9 +36909,7 @@ multibyte functionality is not available.
@node PC Using
@appendixsubsubsec Using @command{gawk} on PC Operating Systems
-@c STARTOFRANGE opgawx
@cindex operating systems, PC, @command{gawk} on
-@c STARTOFRANGE pcgawon
@cindex PC operating systems, @command{gawk} on
Under MS-DOS and MS-Windows, the Cygwin and MinGW environments support
@@ -37709,8 +37417,6 @@ $ @kbd{gawk :== $sys$common:[syshlp.examples.tcpip.snmp]gawk.exe}
This is apparently @value{PVERSION} 2.15.6, which is extremely old. We
recommend compiling and using the current version.
-@c ENDOFRANGE opgawx
-@c ENDOFRANGE pcgawon
@node Bugs
@appendixsec Reporting Problems and Bugs
@@ -37721,9 +37427,7 @@ recommend compiling and using the current version.
@end quotation
@c the radio show, not the book. :-)
-@c STARTOFRANGE dbugg
@cindex debugging @command{gawk}, bug reports
-@c STARTOFRANGE tblgawb
@cindex troubleshooting, @command{gawk}, bug reports
If you have problems with @command{gawk} or think that you have found a bug,
report it to the developers; we cannot promise to do anything
@@ -37820,12 +37524,9 @@ The people maintaining the various @command{gawk} ports are:
If your bug is also reproducible under Unix, send a copy of your
report to the @EMAIL{bug-gawk@@gnu.org,bug-gawk at gnu dot org} email list as well.
-@c ENDOFRANGE dbugg
-@c ENDOFRANGE tblgawb
@node Other Versions
@appendixsec Other Freely Available @command{awk} Implementations
-@c STARTOFRANGE awkim
@cindex @command{awk}, implementations
@ignore
From: emory!amc.com!brennan (Michael Brennan)
@@ -37885,7 +37586,7 @@ git clone git://github.com/onetrueawk/awk bwkawk
@end example
@noindent
-This command creates a copy of the @uref{http://www.git-scm.com, Git}
+This command creates a copy of the @uref{http://git-scm.com, Git}
repository in a directory named @file{bwkawk}. If you leave that argument
off the @command{git} command line, the repository copy is created in a
directory named @file{awk}.
@@ -37950,7 +37651,7 @@ To get @command{awka}, go to @url{http://sourceforge.net/projects/awka}.
@c andrewsumner@@yahoo.net
The project seems to be frozen; no new code changes have been made
-since approximately 2003.
+since approximately 2001.
@cindex Beebe, Nelson H.F.@:
@cindex @command{pawk} (profiling version of Brian Kernighan's @command{awk})
@@ -38046,7 +37747,6 @@ See also the ``Versions and implementations'' section of the
Wikipedia article} for information on additional versions.
@end table
-@c ENDOFRANGE awkim
@node Installation summary
@appendixsec Summary
@@ -38084,15 +37784,11 @@ implementations. Many are POSIX compliant; others are less so.
@end itemize
-@c ENDOFRANGE gligawk
-@c ENDOFRANGE ingawk
@ifclear FOR_PRINT
@node Notes
@appendix Implementation Notes
-@c STARTOFRANGE gawii
@cindex @command{gawk}, implementation issues
-@c STARTOFRANGE impis
@cindex implementation issues, @command{gawk}
This appendix contains information mainly of interest to implementers and
@@ -38168,7 +37864,7 @@ However, if you want to modify @command{gawk} and contribute back your
changes, you will probably wish to work with the development version.
To do so, you will need to access the @command{gawk} source code
repository. The code is maintained using the
-@uref{http://git-scm.com/, Git distributed version control system}.
+@uref{http://git-scm.com, Git distributed version control system}.
You will need to install it if your system doesn't have it.
Once you have done so, use the command:
@@ -38197,11 +37893,8 @@ that has a Git plug-in for working with Git repositories.
@node Adding Code
@appendixsubsec Adding New Features
-@c STARTOFRANGE adfgaw
@cindex adding, features to @command{gawk}
-@c STARTOFRANGE fadgaw
@cindex features, adding to @command{gawk}
-@c STARTOFRANGE gawadf
@cindex @command{gawk}, features, adding
You are free to add any new features you like to @command{gawk}.
However, if you want your changes to be incorporated into the @command{gawk}
@@ -38236,7 +37929,7 @@ for information on getting the latest version of @command{gawk}.)
@item
@ifnotinfo
-Follow the @uref{http://www.gnu.org/prep/standards/, @cite{GNU Coding Standards}}.
+Follow the @cite{GNU Coding Standards}.
@end ifnotinfo
@ifinfo
See @inforef{Top, , Version, standards, GNU Coding Standards}.
@@ -38245,7 +37938,7 @@ This document describes how GNU software should be written. If you haven't
read it, please do so, preferably @emph{before} starting to modify @command{gawk}.
(The @cite{GNU Coding Standards} are available from
the GNU Project's
-@uref{http://www.gnu.org/prep/standards_toc.html, website}.
+@uref{http://www.gnu.org/prep/standards/, website}.
Texinfo, Info, and DVI versions are also available.)
@cindex @command{gawk}, coding style in
@@ -38368,9 +38061,6 @@ Although this sounds like a lot of work, please remember that while you
may write the new code, I have to maintain it and support it. If it
isn't possible for me to do that with a minimum of extra work, then I
probably will not.
-@c ENDOFRANGE adfgaw
-@c ENDOFRANGE gawadf
-@c ENDOFRANGE fadgaw
@node New Ports
@appendixsubsec Porting @command{gawk} to a New Operating System
@@ -38504,7 +38194,6 @@ coding style and brace layout that suits your taste.
@node Derived Files
@appendixsubsec Why Generated Files Are Kept In Git
-@c STARTOFRANGE gawkgit
@cindex Git, use of for @command{gawk} source code
@c From emails written March 22, 2012, to the gawk developers list.
@@ -38693,7 +38382,6 @@ wget http://git.savannah.gnu.org/cgit/gawk.git/snapshot/gawk-@var{branchname}.ta
@noindent
to retrieve a snapshot of the given branch.
-@c ENDOFRANGE gawkgit
@node Future Extensions
@appendixsec Probable Future Extensions
@@ -39074,13 +38762,10 @@ of @command{gawk}, but it @emph{will} be removed in the next major release.
@end itemize
-@c ENDOFRANGE impis
-@c ENDOFRANGE gawii
@node Basic Concepts
@appendix Basic Programming Concepts
@cindex programming, concepts
-@c STARTOFRANGE procon
@cindex programming, concepts
This @value{APPENDIX} attempts to define some of the basic concepts
@@ -39318,7 +39003,6 @@ standard for C. This standard became an ISO standard in 1990.
In 1999, a revised ISO C standard was approved and released.
Where it makes sense, POSIX @command{awk} is compatible with 1999 ISO C.
-@c ENDOFRANGE procon
@node Glossary
@unnumbered Glossary
@@ -39369,6 +39053,21 @@ languages.
These standards often become international standards as well. See also
``ISO.''
+@item Argument
+An argument can be two different things. It can be an option or a
+@value{FN} passed to a command while invoking it from the command line, or
+it can be something passed to a @dfn{function} inside a program, e.g.
+inside @command{awk}.
+
+In the latter case, an argument can be passed to a function in two ways.
+Either it is given to the called function by value, i.e., a copy of the
+value of the variable is made available to the called function, but the
+original variable cannot be modified by the function itself; or it is
+given by reference, i.e., a pointer to the interested variable is passed to
+the function, which can then directly modify it. In @command{awk}
+scalars are passed by value, and arrays are passed by reference.
+See ``Pass By Value/Reference.''
+
@item Array
A grouping of multiple values under the same name.
Most languages just provide sequential arrays.
@@ -39410,6 +39109,25 @@ The GNU version of the standard shell
@end ifinfo
See also ``Bourne Shell.''
+@item Binary
+Base-two notation, where the digits are @code{0}--@code{1}. Since
+electronic circuitry works ``naturally'' in base 2 (just think of Off/On),
+everything inside a computer is calculated using base 2. Each digit
+represents the presence (or absence) of a power of 2 and is called a
+@dfn{bit}. So, for example, the base-two number @code{10101} is
+the same as decimal 21, ((1 x 16) + (1 x 4) + (1 x 1)).
+
+Since base-two numbers quickly become
+very long to read and write, they are usually grouped by 3 (i.e., they are
+read as octal numbers), or by 4 (i.e., they are read as hexadecimal
+numbers). There is no direct way to insert base 2 numbers in a C program.
+If need arises, such numbers are usually inserted as octal or hexadecimal
+numbers. The number of base-two digits that fit into registers used for
+representing integer numbers in computers is a rough indication of the
+computing power of the computer itself. Most computers nowadays use 64
+bits for representing integer numbers in their registers, but 32-bit,
+16-bit and 8-bit registers have been widely used in the past.
+@xref{Nondecimal-numbers}.
@item Bit
Short for ``Binary Digit.''
All values in computer memory ultimately reduce to binary digits: values
@@ -39441,6 +39159,19 @@ The characters @samp{@{} and @samp{@}}. Braces are used in
@command{awk} for delimiting actions, compound statements, and function
bodies.
+@item Bracket Expression
+Inside a @dfn{regular expression}, an expression included in square
+brackets, meant to designate a single character as belonging to a
+specified character class. A bracket expression can contain a list of one
+or more characters, like @samp{[abc]}, a range of characters, like
+@samp{[A-Z]}, or a name, delimited by @samp{:}, that designates a known set
+of characters, like @samp{[:digit:]}. The form of bracket expression
+enclosed between @samp{:} is independent of the underlying representation
+of the character themselves, which could utilize the ASCII, ECBDIC, or
+Unicode codesets, depending on the architecture of the computer system, and on
+localization.
+See also ``Regular Expression.''
+
@item Built-in Function
The @command{awk} language provides built-in functions that perform various
numerical, I/O-related, and string computations. Examples are
@@ -39494,9 +39225,25 @@ points out similarities between @command{awk} and C when appropriate.
In general, @command{gawk} attempts to be as similar to the 1990 version
of ISO C as makes sense.
+@item C Shell
+The C Shell (@command{csh} or its improved version, @command{tcsh}) is a Unix shell that was
+created by Bill Joy in the late 1970s. The C shell was differentiated from
+other shells by its interactive features and overall style, which
+looks more like C. The C Shell is not backward compatible with the Bourne
+Shell, so special attention is required when converting scripts
+written for other Unix shells to the C shell, especially with regard to the management of
+shell variables.
+See also ``Bourne Shell.''
+
@item C++
A popular object-oriented programming language derived from C.
+@item Character Class
+See ``Bracket Expression.''
+
+@item Character List
+See ``Bracket Expression.''
+
@cindex ASCII
@cindex ISO 8859-1
@cindex ISO Latin-1
@@ -39520,7 +39267,7 @@ A preprocessor for @command{pic} that reads descriptions of molecules
and produces @command{pic} input for drawing them.
It was written in @command{awk}
by Brian Kernighan and Jon Bentley, and is available from
-@uref{http://netlib.sandia.gov/netlib/typesetting/chem.gz}.
+@uref{http://netlib.org/typesetting/chem}.
@item Comparison Expression
A relation that is either true or false, such as @samp{a < b}.
@@ -39536,11 +39283,23 @@ machine-executable object code. The object code is then executed
directly by the computer.
See also ``Interpreter.''
+@item Complemented Bracket Expression
+The negation of a @dfn{bracket expression}. All that is @emph{not}
+described by a given bracket expression. The symbol @samp{^} precedes
+the negated bracket expression. E.g.: @samp{[[^:digit:]}
+designates whatever character is not a digit. @samp{[^bad]}
+designates whatever character is not one of the letters @samp{b}, @samp{a},
+or @samp{d}.
+See ``Bracket Expression.''
+
@item Compound Statement
A series of @command{awk} statements, enclosed in curly braces. Compound
statements may be nested.
(@xref{Statements}.)
+@item Computed Regexps
+See ``Dynamic Regular Expressions.''
+
@item Concatenation
Concatenating two strings means sticking them together, one after another,
producing a new string. For example, the string @samp{foo} concatenated with
@@ -39555,6 +39314,13 @@ expression is the value of @var{expr2}; otherwise the value is
@var{expr3}. In either case, only one of @var{expr2} and @var{expr3}
is evaluated. (@xref{Conditional Exp}.)
+@item Control Statement
+A control statement is an instruction to perform a given operation or a set
+of operations inside an @command{awk} program, if a given condition is
+true. Control statements are: @code{if}, @code{for}, @code{while}, and
+@code{do}
+(@pxref{Statements}).
+
@cindex McIlroy, Doug
@cindex cookie
@item Cookie
@@ -39709,6 +39475,11 @@ Format strings control the appearance of output in the
are controlled by the format strings contained in the predefined variables
@code{CONVFMT} and @code{OFMT}. (@xref{Control Letters}.)
+@item Fortran
+Shorthand for FORmula TRANslator, one of the first programming languages
+available for scientific calculations. It was created by John Backus,
+and has been available since 1957. It is still in use today.
+
@item Free Documentation License
This document describes the terms under which this @value{DOCUMENT}
is published and may be copied. (@xref{GNU Free Documentation License}.)
@@ -39726,10 +39497,21 @@ Emacs editor. GNU Emacs is the most widely used version of Emacs today.
See ``Free Software Foundation.''
@item Function
-A specialized group of statements used to encapsulate general
-or program-specific tasks. @command{awk} has a number of built-in
-functions, and also allows you to define your own.
-(@xref{Functions}.)
+A part of an @command{awk} program that can be invoked from every point of
+the program, to perform a task. @command{awk} has several built-in
+functions.
+Users can define their own functions in every part of the program.
+Function can be recursive, i.e., they may invoke themselves.
+@xref{Functions}.
+In @command{gawk} it is also possible to have functions shared
+among different programs, and included where required using the
+@code{@@include} directive
+(@pxref{Include Files}).
+In @command{gawk} the name of the function that should be invoked
+can be generated at run time, i.e., dynamically.
+The @command{gawk} extension API provides constructor functions
+(@pxref{Constructor Functions}).
+
@item @command{gawk}
The GNU implementation of @command{awk}.
@@ -39853,6 +39635,12 @@ meaning. Keywords are reserved and may not be used as variable names.
and
@code{while}.
+@item Korn Shell
+The Korn Shell (@command{ksh}) is a Unix shell which was developed by David Korn at Bell
+Laboratories in the early 1980s. The Korn Shell is backward-compatible with the Bourne
+shell and includes many features of the C shell.
+See also ``Bourne Shell.''
+
@cindex LGPL (Lesser General Public License)
@cindex Lesser General Public License (LGPL)
@cindex GNU Lesser General Public License
@@ -39892,6 +39680,14 @@ Characters used within a regexp that do not stand for themselves.
Instead, they denote regular expression operations, such as repetition,
grouping, or alternation.
+@item Nesting
+Nesting is where information is organized in layers, or where objects
+contain other similar objects.
+In @command{gawk} the @code{@@include}
+directive can be nested. The ``natural'' nesting of arithmetic and
+logical operations can be changed using parentheses
+(@pxref{Precedence}).
+
@item No-op
An operation that does nothing.
@@ -39912,6 +39708,11 @@ Octal numbers are written in C using a leading @samp{0},
to indicate their base. Thus, @code{013} is 11 ((1 x 8) + 3).
@xref{Nondecimal-numbers}.
+@item Output Record
+A single chunk of data that is written out by @command{awk}. Usually, an
+@command{awk} output record consists of one or more lines of text.
+@xref{Records}.
+
@item Pattern
Patterns tell @command{awk} which input records are interesting to which
rules.
@@ -39926,6 +39727,9 @@ An acronym describing what is possibly the most frequent
source of computer usage problems. (Problem Exists Between
Keyboard And Chair.)
+@item Plug-in
+See ``Extensions.''
+
@item POSIX
The name for a series of standards
that specify a Portable Operating System interface. The ``IX'' denotes
@@ -39950,6 +39754,9 @@ A sequence of consecutive lines from the input file(s). A pattern
can specify ranges of input lines for @command{awk} to process or it can
specify single lines. (@xref{Pattern Overview}.)
+@item Record
+See ``Input record'' and ``Output record.''
+
@item Recursion
When a function calls itself, either directly or indirectly.
If this is clear, stop, and proceed to the next entry.
@@ -39967,6 +39774,15 @@ operators.
(@xref{Getline},
and @ref{Redirection}.)
+@item Reference Counts
+An internal mechanism in @command{gawk} to minimize the amount of memory
+needed to store the value of string variables. If the value assumed by
+a variable is used in more than one place, only one copy of the value
+itself is kept, and the associated reference count is increased when the
+same value is used by an additional variable, and decresed when the related
+variable is no longer in use. When the reference count goes to zero,
+the memory space used to store the value of the variable is freed.
+
@item Regexp
See ``Regular Expression.''
@@ -39984,6 +39800,15 @@ slashes, such as @code{/foo/}. This regular expression is chosen
when you write the @command{awk} program and cannot be changed during
its execution. (@xref{Regexp Usage}.)
+@item Regular Expression Operators
+See ``Metacharacters.''
+
+@item Rounding
+Rounding the result of an arithmetic operation can be tricky.
+More than one way of rounding exists, and in @command{gawk}
+it is possible to choose which method should be used in a program.
+@xref{Setting the rounding mode}.
+
@item Rule
A segment of an @command{awk} program that specifies how to process single
input records. A rule consists of a @dfn{pattern} and an @dfn{action}.
@@ -40043,6 +39868,12 @@ A @value{FN} interpreted internally by @command{gawk}, instead of being handed
directly to the underlying operating system---for example, @file{/dev/stderr}.
(@xref{Special Files}.)
+@item Statement
+An expression inside an @command{awk} program in the action part
+of a pattern--action rule, or inside an
+@command{awk} function. A statement can be a variable assignment,
+an array operation, a loop, etc.
+
@item Stream Editor
A program that reads records from an input stream and processes them one
or more at a time. This is in contrast with batch programs, which may
@@ -40093,9 +39924,14 @@ This is standard time in Greenwich, England, which is used as a
reference time for day and date calculations.
See also ``Epoch'' and ``GMT.''
+@item Variable
+A name for a value. In @command{awk}, variables may be either scalars
+or arrays.
+
@item Whitespace
A sequence of space, TAB, or newline characters occurring inside an input
record or a string.
+
@end table
@end ifclear
diff --git a/extension/ChangeLog b/extension/ChangeLog
index 8a6dfd93..9ecd2697 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,3 +1,11 @@
+2015-01-24 Arnold D. Robbins <arnold@skeeve.com>
+
+ Infrastructure updates.
+
+ Automake 1.15. Libtool 2.4.5.
+
+ * configure.ac: Remove gettext macros.
+
2015-01-07 Arnold D. Robbins <arnold@skeeve.com>
* testext.c (var_test): Adjust for PROCINFO now being there.
diff --git a/extension/INSTALL b/extension/INSTALL
index 6e90e07d..20998407 100644
--- a/extension/INSTALL
+++ b/extension/INSTALL
@@ -1,7 +1,7 @@
Installation Instructions
*************************
-Copyright (C) 1994-1996, 1999-2002, 2004-2012 Free Software Foundation,
+Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation,
Inc.
Copying and distribution of this file, with or without modification,
@@ -12,8 +12,8 @@ without warranty of any kind.
Basic Installation
==================
- Briefly, the shell commands `./configure; make; make install' should
-configure, build, and install this package. The following
+ Briefly, the shell command `./configure && make && make install'
+should configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for
instructions specific to this package. Some packages provide this
`INSTALL' file but do not implement all of the features documented
diff --git a/extension/Makefile.in b/extension/Makefile.in
index 2596d282..2a6ef5e0 100644
--- a/extension/Makefile.in
+++ b/extension/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -38,7 +38,17 @@
#
VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -102,33 +112,15 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = .
-DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
- $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/configure $(am__configure_deps) \
- $(srcdir)/configh.in ABOUT-NLS $(top_srcdir)/build-aux/depcomp \
- $(dist_man_MANS) COPYING build-aux/ChangeLog build-aux/ar-lib \
- build-aux/compile build-aux/config.guess \
- build-aux/config.rpath build-aux/config.sub build-aux/depcomp \
- build-aux/install-sh build-aux/missing build-aux/ltmain.sh \
- $(top_srcdir)/build-aux/ar-lib $(top_srcdir)/build-aux/compile \
- $(top_srcdir)/build-aux/config.guess \
- $(top_srcdir)/build-aux/config.rpath \
- $(top_srcdir)/build-aux/config.sub \
- $(top_srcdir)/build-aux/install-sh \
- $(top_srcdir)/build-aux/ltmain.sh \
- $(top_srcdir)/build-aux/missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/dirfd.m4 \
- $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/iconv.m4 \
- $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
- $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
- $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \
- $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \
- $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
+ $(am__configure_deps) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
@@ -166,8 +158,7 @@ am__installdirs = "$(DESTDIR)$(pkgextensiondir)" \
"$(DESTDIR)$(man3dir)"
LTLIBRARIES = $(pkgextension_LTLIBRARIES)
am__DEPENDENCIES_1 =
-am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1)
-filefuncs_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
+filefuncs_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
am_filefuncs_la_OBJECTS = filefuncs.lo stack.lo gawkfts.lo
filefuncs_la_OBJECTS = $(am_filefuncs_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
@@ -177,67 +168,67 @@ am__v_lt_1 =
filefuncs_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(filefuncs_la_LDFLAGS) $(LDFLAGS) -o $@
-fnmatch_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
+fnmatch_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
am_fnmatch_la_OBJECTS = fnmatch.lo
fnmatch_la_OBJECTS = $(am_fnmatch_la_OBJECTS)
fnmatch_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(fnmatch_la_LDFLAGS) $(LDFLAGS) -o $@
-fork_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
+fork_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
am_fork_la_OBJECTS = fork.lo
fork_la_OBJECTS = $(am_fork_la_OBJECTS)
fork_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(fork_la_LDFLAGS) $(LDFLAGS) -o $@
-inplace_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
+inplace_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
am_inplace_la_OBJECTS = inplace.lo
inplace_la_OBJECTS = $(am_inplace_la_OBJECTS)
inplace_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(inplace_la_LDFLAGS) $(LDFLAGS) -o $@
-ordchr_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
+ordchr_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
am_ordchr_la_OBJECTS = ordchr.lo
ordchr_la_OBJECTS = $(am_ordchr_la_OBJECTS)
ordchr_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(ordchr_la_LDFLAGS) $(LDFLAGS) -o $@
-readdir_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
+readdir_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
am_readdir_la_OBJECTS = readdir.lo
readdir_la_OBJECTS = $(am_readdir_la_OBJECTS)
readdir_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(readdir_la_LDFLAGS) $(LDFLAGS) -o $@
-readfile_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
+readfile_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
am_readfile_la_OBJECTS = readfile.lo
readfile_la_OBJECTS = $(am_readfile_la_OBJECTS)
readfile_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(readfile_la_LDFLAGS) $(LDFLAGS) -o $@
-revoutput_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
+revoutput_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
am_revoutput_la_OBJECTS = revoutput.lo
revoutput_la_OBJECTS = $(am_revoutput_la_OBJECTS)
revoutput_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(revoutput_la_LDFLAGS) $(LDFLAGS) -o $@
-revtwoway_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
+revtwoway_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
am_revtwoway_la_OBJECTS = revtwoway.lo
revtwoway_la_OBJECTS = $(am_revtwoway_la_OBJECTS)
revtwoway_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(revtwoway_la_LDFLAGS) $(LDFLAGS) -o $@
-rwarray_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
+rwarray_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
am_rwarray_la_OBJECTS = rwarray.lo
rwarray_la_OBJECTS = $(am_rwarray_la_OBJECTS)
rwarray_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(rwarray_la_LDFLAGS) $(LDFLAGS) -o $@
-testext_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
+testext_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
am_testext_la_OBJECTS = testext.lo
testext_la_OBJECTS = $(am_testext_la_OBJECTS)
testext_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(testext_la_LDFLAGS) $(LDFLAGS) -o $@
-time_la_DEPENDENCIES = $(am__DEPENDENCIES_2)
+time_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
am_time_la_OBJECTS = time.lo
time_la_OBJECTS = $(am_time_la_OBJECTS)
time_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
@@ -333,6 +324,19 @@ ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in \
+ $(srcdir)/configh.in $(top_srcdir)/build-aux/ar-lib \
+ $(top_srcdir)/build-aux/compile \
+ $(top_srcdir)/build-aux/config.guess \
+ $(top_srcdir)/build-aux/config.sub \
+ $(top_srcdir)/build-aux/depcomp \
+ $(top_srcdir)/build-aux/install-sh \
+ $(top_srcdir)/build-aux/ltmain.sh \
+ $(top_srcdir)/build-aux/missing ABOUT-NLS AUTHORS COPYING \
+ ChangeLog INSTALL NEWS README build-aux/ChangeLog \
+ build-aux/ar-lib build-aux/compile build-aux/config.guess \
+ build-aux/config.rpath build-aux/config.sub build-aux/depcomp \
+ build-aux/install-sh build-aux/ltmain.sh build-aux/missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
@@ -400,35 +404,24 @@ ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
-GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
-GMSGFMT = @GMSGFMT@
-GMSGFMT_015 = @GMSGFMT_015@
GREP = @GREP@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-INTLLIBS = @INTLLIBS@
-INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LD = @LD@
LDFLAGS = @LDFLAGS@
-LIBICONV = @LIBICONV@
-LIBINTL = @LIBINTL@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
-LTLIBICONV = @LTLIBICONV@
-LTLIBINTL = @LTLIBINTL@
LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
-MSGFMT = @MSGFMT@
-MSGFMT_015 = @MSGFMT_015@
-MSGMERGE = @MSGMERGE@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
@@ -443,17 +436,12 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
-POSUB = @POSUB@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
-USE_NLS = @USE_NLS@
VERSION = @VERSION@
-XGETTEXT = @XGETTEXT@
-XGETTEXT_015 = @XGETTEXT_015@
-XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
@@ -606,7 +594,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu Makefile
-.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@@ -993,15 +980,15 @@ dist-xz: distdir
$(am__post_remove_distdir)
dist-tarZ: distdir
- @echo WARNING: "Support for shar distribution archives is" \
- "deprecated." >&2
+ @echo WARNING: "Support for distribution archives compressed with" \
+ "legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
- @echo WARNING: "Support for distribution archives compressed with" \
- "legacy program 'compress' is deprecated." >&2
+ @echo WARNING: "Support for shar distribution archives is" \
+ "deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir)
@@ -1037,17 +1024,17 @@ distcheck: dist
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
- mkdir $(distdir)/_build $(distdir)/_inst
+ mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
- && $(am__cd) $(distdir)/_build \
- && ../configure \
+ && $(am__cd) $(distdir)/_build/sub \
+ && ../../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
- --srcdir=.. --prefix="$$dc_install_base" \
+ --srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
@@ -1238,6 +1225,8 @@ uninstall-man: uninstall-man3
tags tags-am uninstall uninstall-am uninstall-man \
uninstall-man3 uninstall-pkgextensionLTLIBRARIES
+.PRECIOUS: Makefile
+
install-data-hook:
for i in $(pkgextension_LTLIBRARIES) ; do \
diff --git a/extension/aclocal.m4 b/extension/aclocal.m4
index cd7f9c16..d2e755e4 100644
--- a/extension/aclocal.m4
+++ b/extension/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.15 -*- Autoconf -*-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to.
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'.])])
-# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+# Copyright (C) 2002-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.14'
+[am__api_version='1.15'
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.14.1], [],
+m4_if([$1], [1.15], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -51,12 +51,12 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# 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.14.1])dnl
+[AM_AUTOMAKE_VERSION([1.15])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
-# Copyright (C) 2011-2013 Free Software Foundation, Inc.
+# Copyright (C) 2011-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -118,7 +118,7 @@ AC_SUBST([AR])dnl
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -163,15 +163,14 @@ AC_SUBST([AR])dnl
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
])
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -202,7 +201,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -393,7 +392,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -469,7 +468,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -559,8 +558,8 @@ AC_REQUIRE([AC_PROG_MKDIR_P])dnl
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
+# We need awk for the "check" target (and possibly the TAP driver). The
+# system "awk" is bad on some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
@@ -633,7 +632,11 @@ to "yes", and re-run configure.
END
AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
fi
-fi])
+fi
+dnl The trailing newline in this macro's definition is deliberate, for
+dnl backward compatibility and to allow trailing 'dnl'-style comments
+dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
+])
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
@@ -662,7 +665,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -673,7 +676,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-if test x"${install_sh}" != xset; then
+if test x"${install_sh+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -683,7 +686,7 @@ if test x"${install_sh}" != xset; then
fi
AC_SUBST([install_sh])])
-# Copyright (C) 2003-2013 Free Software Foundation, Inc.
+# Copyright (C) 2003-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -704,7 +707,7 @@ AC_SUBST([am__leading_dot])])
# Check to see how 'make' treats includes. -*- Autoconf -*-
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -754,7 +757,7 @@ rm -f confinc confmf
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -793,7 +796,7 @@ fi
# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -822,7 +825,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -869,7 +872,7 @@ AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -888,7 +891,7 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -969,7 +972,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
-# Copyright (C) 2009-2013 Free Software Foundation, Inc.
+# Copyright (C) 2009-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1029,7 +1032,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1057,7 +1060,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006-2013 Free Software Foundation, Inc.
+# Copyright (C) 2006-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1076,7 +1079,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
-# Copyright (C) 2004-2013 Free Software Foundation, Inc.
+# Copyright (C) 2004-2014 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1208,17 +1211,8 @@ AC_SUBST([am__untar])
]) # _AM_PROG_TAR
m4_include([m4/dirfd.m4])
-m4_include([m4/gettext.m4])
-m4_include([m4/iconv.m4])
-m4_include([m4/intlmacosx.m4])
-m4_include([m4/lib-ld.m4])
-m4_include([m4/lib-link.m4])
-m4_include([m4/lib-prefix.m4])
m4_include([m4/libtool.m4])
m4_include([m4/ltoptions.m4])
m4_include([m4/ltsugar.m4])
m4_include([m4/ltversion.m4])
m4_include([m4/lt~obsolete.m4])
-m4_include([m4/nls.m4])
-m4_include([m4/po.m4])
-m4_include([m4/progtest.m4])
diff --git a/extension/build-aux/ar-lib b/extension/build-aux/ar-lib
index 67f5f36f..463b9ec0 100755
--- a/extension/build-aux/ar-lib
+++ b/extension/build-aux/ar-lib
@@ -4,7 +4,7 @@
me=ar-lib
scriptversion=2012-03-01.08; # UTC
-# Copyright (C) 2010-2012 Free Software Foundation, Inc.
+# Copyright (C) 2010-2014 Free Software Foundation, Inc.
# Written by Peter Rosin <peda@lysator.liu.se>.
#
# This program is free software; you can redistribute it and/or modify
diff --git a/extension/build-aux/compile b/extension/build-aux/compile
index 531136b0..a85b723c 100755
--- a/extension/build-aux/compile
+++ b/extension/build-aux/compile
@@ -3,7 +3,7 @@
scriptversion=2012-10-14.11; # UTC
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
diff --git a/extension/build-aux/config.guess b/extension/build-aux/config.guess
index 4438cd70..6c32c864 100755
--- a/extension/build-aux/config.guess
+++ b/extension/build-aux/config.guess
@@ -2,7 +2,7 @@
# Attempt to guess a canonical system name.
# Copyright 1992-2014 Free Software Foundation, Inc.
-timestamp='2014-01-01'
+timestamp='2014-11-04'
# 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
@@ -24,12 +24,12 @@ timestamp='2014-01-01'
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
#
-# Originally written by Per Bothner.
+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
#
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
#
-# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+# Please send patches to <config-patches@gnu.org>.
me=`echo "$0" | sed -e 's,.*/,,'`
@@ -149,7 +149,7 @@ Linux|GNU|GNU/*)
LIBC=gnu
#endif
EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
;;
esac
@@ -579,8 +579,9 @@ EOF
else
IBM_ARCH=powerpc
fi
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
+ if [ -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
@@ -826,7 +827,7 @@ EOF
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
- i*:MSYS*:*)
+ *:MSYS*:*)
echo ${UNAME_MACHINE}-pc-msys
exit ;;
i*:windows32*:*)
@@ -969,10 +970,10 @@ EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
;;
- or1k:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ openrisc*:Linux:*:*)
+ echo or1k-unknown-linux-${LIBC}
exit ;;
- or32:Linux:*:*)
+ or32:Linux:*:* | or1k*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
padre:Linux:*:*)
@@ -1371,154 +1372,6 @@ EOF
exit ;;
esac
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
- /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
- I don't know.... */
- printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
- printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
- "4"
-#else
- ""
-#endif
- ); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
- int version;
- 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
- printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
- exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
- printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
- printf ("ns32k-encore-mach\n"); exit (0);
-#else
- printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
- printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
- printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
- printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
- struct utsname un;
-
- uname(&un);
-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
- printf ("i386-sequent-ptx1\n"); exit (0);
- }
- printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-# include <sys/param.h>
-# if defined (BSD)
-# if BSD == 43
- printf ("vax-dec-bsd4.3\n"); exit (0);
-# else
-# if BSD == 199006
- printf ("vax-dec-bsd4.3reno\n"); exit (0);
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# endif
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# else
- printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
- printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
- exit (1);
-}
-EOF
-
-$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.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
- case `getsysinfo -f cpu_type` in
- c1*)
- echo c1-convex-bsd
- exit ;;
- c2*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- c34*)
- echo c34-convex-bsd
- exit ;;
- c38*)
- echo c38-convex-bsd
- exit ;;
- c4*)
- echo c4-convex-bsd
- exit ;;
- esac
-fi
-
cat >&2 <<EOF
$0: unable to guess system type
diff --git a/extension/build-aux/config.sub b/extension/build-aux/config.sub
index 092cff00..7ffe3737 100755
--- a/extension/build-aux/config.sub
+++ b/extension/build-aux/config.sub
@@ -2,7 +2,7 @@
# Configuration validation subroutine script.
# Copyright 1992-2014 Free Software Foundation, Inc.
-timestamp='2014-01-01'
+timestamp='2014-12-03'
# 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
@@ -25,7 +25,7 @@ timestamp='2014-01-01'
# of the GNU General Public License, version 3 ("GPLv3").
-# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+# Please send patches to <config-patches@gnu.org>.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
@@ -283,8 +283,10 @@ case $basic_machine in
| mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
+ | mipsisa32r6 | mipsisa32r6el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64r6 | mipsisa64r6el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipsr5900 | mipsr5900el \
@@ -296,11 +298,11 @@ case $basic_machine in
| nds32 | nds32le | nds32be \
| nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \
- | open8 \
- | or1k | or32 \
+ | open8 | or1k | or1knd | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
+ | riscv32 | riscv64 \
| rl78 | rx \
| score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
@@ -311,6 +313,7 @@ case $basic_machine in
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
| ubicom32 \
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+ | visium \
| we32k \
| x86 | xc16x | xstormy16 | xtensa \
| z8k | z80)
@@ -325,6 +328,9 @@ case $basic_machine in
c6x)
basic_machine=tic6x-unknown
;;
+ leon|leon[3-9])
+ basic_machine=sparc-$basic_machine
+ ;;
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
basic_machine=$basic_machine-unknown
os=-none
@@ -402,8 +408,10 @@ case $basic_machine in
| mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa32r6-* | mipsisa32r6el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64r6-* | mipsisa64r6el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipsr5900-* | mipsr5900el-* \
@@ -415,6 +423,7 @@ case $basic_machine in
| nios-* | nios2-* | nios2eb-* | nios2el-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \
+ | or1k*-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
@@ -432,6 +441,7 @@ case $basic_machine in
| ubicom32-* \
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
| vax-* \
+ | visium-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \
@@ -769,6 +779,9 @@ case $basic_machine in
basic_machine=m68k-isi
os=-sysv
;;
+ leon-*|leon[3-9]-*)
+ basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
+ ;;
m68knommu)
basic_machine=m68k-unknown
os=-linux
@@ -824,6 +837,10 @@ case $basic_machine in
basic_machine=powerpc-unknown
os=-morphos
;;
+ moxiebox)
+ basic_machine=moxie-unknown
+ os=-moxiebox
+ ;;
msdos)
basic_machine=i386-pc
os=-msdos
@@ -1369,14 +1386,14 @@ case $os in
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
- | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1594,9 +1611,6 @@ case $basic_machine in
mips*-*)
os=-elf
;;
- or1k-*)
- os=-elf
- ;;
or32-*)
os=-coff
;;
diff --git a/extension/build-aux/depcomp b/extension/build-aux/depcomp
index 31788017..fc98710e 100755
--- a/extension/build-aux/depcomp
+++ b/extension/build-aux/depcomp
@@ -3,7 +3,7 @@
scriptversion=2013-05-30.07; # UTC
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -251,6 +251,41 @@ hp)
exit 1
;;
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
+ echo "$object : \\" > "$depfile"
+ # Clip off the initial element (the dependent). Don't try to be
+ # clever and replace this with sed code, as IRIX sed won't handle
+ # lines with more than a fixed number of characters (4096 in
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
+ # the IRIX cc adds comments like '#:fec' to the end of the
+ # dependency line.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
+ | tr "$nl" ' ' >> "$depfile"
+ echo >> "$depfile"
+ # The second pass generates a dummy entry for each header file.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> "$depfile"
+ else
+ make_dummy_depfile
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
xlc)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
diff --git a/extension/build-aux/install-sh b/extension/build-aux/install-sh
index 04367377..0b0fdcbb 100755
--- a/extension/build-aux/install-sh
+++ b/extension/build-aux/install-sh
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2013-10-30.23; # UTC
+scriptversion=2013-12-25.23; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -82,7 +82,7 @@ dir_arg=
dst_arg=
copy_on_change=false
-no_target_directory=
+is_target_a_directory=possibly
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
@@ -139,14 +139,16 @@ while test $# -ne 0; do
-s) stripcmd=$stripprog;;
- -t) dst_arg=$2
+ -t)
+ is_target_a_directory=always
+ dst_arg=$2
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
- -T) no_target_directory=true;;
+ -T) is_target_a_directory=never;;
--version) echo "$0 $scriptversion"; exit $?;;
@@ -161,6 +163,16 @@ while test $# -ne 0; do
shift
done
+# We allow the use of options -d and -T together, by making -d
+# take the precedence; this is for compatibility with GNU install.
+
+if test -n "$dir_arg"; then
+ if test -n "$dst_arg"; then
+ echo "$0: target directory not allowed when installing a directory." >&2
+ exit 1
+ fi
+fi
+
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
@@ -192,6 +204,15 @@ if test $# -eq 0; then
fi
if test -z "$dir_arg"; then
+ if test $# -gt 1 || test "$is_target_a_directory" = always; then
+ if test ! -d "$dst_arg"; then
+ echo "$0: $dst_arg: Is not a directory." >&2
+ exit 1
+ fi
+ fi
+fi
+
+if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
@@ -253,7 +274,7 @@ do
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
- if test -n "$no_target_directory"; then
+ if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
diff --git a/extension/build-aux/ltmain.sh b/extension/build-aux/ltmain.sh
index 555b7637..b8915268 100644
--- a/extension/build-aux/ltmain.sh
+++ b/extension/build-aux/ltmain.sh
@@ -2,11 +2,11 @@
## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
## by inline-source v2014-01-03.01
-# libtool (GNU libtool) 2.4.3
+# libtool (GNU libtool) 2.4.5
# Provide generalized library-building support services.
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2015 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.
@@ -31,8 +31,8 @@
PROGRAM=libtool
PACKAGE=libtool
-VERSION=2.4.3
-package_revision=2.4.3
+VERSION=2.4.5
+package_revision=2.4.5
## ------ ##
@@ -69,7 +69,7 @@ scriptversion=2014-01-03.01; # UTC
# General shell script boiler plate, and helper functions.
# Written by Gary V. Vaughan, 2004
-# Copyright (C) 2004-2014 Free Software Foundation, Inc.
+# Copyright (C) 2004-2015 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.
@@ -1375,7 +1375,7 @@ scriptversion=2014-01-07.03; # UTC
# A portable, pluggable option parser for Bourne shell.
# Written by Gary V. Vaughan, 2010
-# Copyright (C) 2010-2014 Free Software Foundation, Inc.
+# Copyright (C) 2010-2015 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.
@@ -1977,7 +1977,7 @@ func_version ()
# End:
# Set a version string.
-scriptversion='(GNU libtool) 2.4.3'
+scriptversion='(GNU libtool) 2.4.5'
# func_echo ARG...
@@ -2063,7 +2063,7 @@ include the following information:
compiler: $LTCC
compiler flags: $LTCFLAGS
linker: $LD (gnu? $with_gnu_ld)
- version: $progname (GNU libtool) 2.4.3
+ version: $progname (GNU libtool) 2.4.5
automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
@@ -2411,7 +2411,7 @@ libtool_validate_options ()
case $host in
# Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
# see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
- *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2*)
+ *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
# don't eliminate duplications in $postdeps and $predeps
opt_duplicate_compiler_generated_deps=:
;;
@@ -3730,7 +3730,8 @@ The following components of LINK-COMMAND are treated specially:
-no-install link a not-installable executable
-no-undefined declare that a library does not refer to external symbols
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects
- -objectlist FILE Use a list of object files found in FILE to specify objects
+ -objectlist FILE use a list of object files found in FILE to specify objects
+ -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes)
-precious-files-regex REGEX
don't remove output files matching REGEX
-release RELEASE specify package release information
@@ -4312,6 +4313,13 @@ func_mode_install ()
;;
esac
;;
+ os2*)
+ case $realname in
+ *_dll.a)
+ tstripme=
+ ;;
+ esac
+ ;;
esac
if test -n "$tstripme" && test -n "$striplib"; then
func_show_eval "$striplib $destdir/$realname" 'exit $?'
@@ -5153,7 +5161,7 @@ func_extract_archives ()
$RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
done # $darwin_arches
## Okay now we've a bunch of thin objects, gotta fatten them up :)
- darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+ darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
darwin_file=
darwin_files=
for darwin_file in $darwin_filelist; do
@@ -6453,6 +6461,24 @@ func_win32_import_lib_p ()
esac
}
+# func_suncc_cstd_abi
+# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
+# Several compiler flags select an ABI that is incompatible with the
+# Cstd library. Avoid specifying it if any are in CXXFLAGS.
+func_suncc_cstd_abi ()
+{
+ $debug_cmd
+
+ case " $compile_command " in
+ *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
+ suncc_use_cstd_abi=no
+ ;;
+ *)
+ suncc_use_cstd_abi=yes
+ ;;
+ esac
+}
+
# func_mode_link arg...
func_mode_link ()
{
@@ -6511,6 +6537,7 @@ func_mode_link ()
module=no
no_install=no
objs=
+ os2dllname=
non_pic_objects=
precious_files_regex=
prefer_static_libs=no
@@ -6768,6 +6795,11 @@ func_mode_link ()
prev=
continue
;;
+ os2dllname)
+ os2dllname=$arg
+ prev=
+ continue
+ ;;
precious_regex)
precious_files_regex=$arg
prev=
@@ -7077,6 +7109,11 @@ func_mode_link ()
continue
;;
+ -os2dllname)
+ prev=os2dllname
+ continue
+ ;;
+
-o) prev=output ;;
-precious-files-regex)
@@ -7240,6 +7277,25 @@ func_mode_link ()
continue
;;
+ -Z*)
+ if test os2 = "`expr $host : '.*\(os2\)'`"; then
+ # OS/2 uses -Zxxx to specify OS/2-specific options
+ compiler_flags="$compiler_flags $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ case $arg in
+ -Zlinker | -Zstack)
+ prev=xcompiler
+ ;;
+ esac
+ continue
+ else
+ # Otherwise treat like 'Some other compiler flag' below
+ func_quote_for_eval "$arg"
+ arg=$func_quote_for_eval_result
+ fi
+ ;;
+
# Some other compiler flag.
-* | +*)
func_quote_for_eval "$arg"
@@ -7399,6 +7455,9 @@ func_mode_link ()
eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+ # Definition is injected by LT_CONFIG during libtool generation.
+ func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
+
func_dirname "$output" "/" ""
output_objdir=$func_dirname_result$objdir
func_to_tool_file "$output_objdir/"
@@ -8066,7 +8125,7 @@ func_mode_link ()
if test -n "$library_names" &&
{ test no = "$use_static_libs" || test -z "$old_library"; }; then
case $host in
- *cygwin* | *mingw* | *cegcc*)
+ *cygwin* | *mingw* | *cegcc* | *os2*)
# No point in relinking DLLs because paths are not encoded
func_append notinst_deplibs " $lib"
need_relink=no
@@ -8136,7 +8195,7 @@ func_mode_link ()
elif test -n "$soname_spec"; then
# bleh windows
case $host in
- *cygwin* | mingw* | *cegcc*)
+ *cygwin* | mingw* | *cegcc* | *os2*)
func_arith $current - $age
major=$func_arith_result
versuffix=-$major
@@ -8561,6 +8620,37 @@ func_mode_link ()
eval $var=\"$tmp_libs\"
done # for var
fi
+
+ # Add Sun CC postdeps if required:
+ test CXX = "$tagname" && {
+ case $host_os in
+ linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C++ 5.9
+ func_suncc_cstd_abi
+
+ if test no != "$suncc_use_cstd_abi"; then
+ func_append postdeps ' -library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
+ solaris*)
+ func_cc_basename "$CC"
+ case $func_cc_basename_result in
+ CC* | sunCC*)
+ func_suncc_cstd_abi
+
+ if test no != "$suncc_use_cstd_abi"; then
+ func_append postdeps ' -library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ }
+
# Last step: remove runtime libs from dependency_libs
# (they stay in deplibs)
tmp_libs=
@@ -8708,13 +8798,13 @@ func_mode_link ()
#
case $version_type in
# correct linux to gnu/linux during the next big refactor
- darwin|linux|osf|windows|none)
+ darwin|freebsd-elf|linux|osf|windows|none)
func_arith $number_major + $number_minor
current=$func_arith_result
age=$number_minor
revision=$number_revision
;;
- freebsd-aout|freebsd-elf|qnx|sunos)
+ freebsd-aout|qnx|sunos)
current=$number_major
revision=$number_minor
age=0
@@ -8800,8 +8890,9 @@ func_mode_link ()
;;
freebsd-elf)
- major=.$current
- versuffix=.$current
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix=$major.$age.$revision
;;
irix | nonstopux)
@@ -8864,6 +8955,11 @@ func_mode_link ()
versuffix=.$current
;;
+ sco)
+ major=.$current
+ versuffix=.$current
+ ;;
+
sunos)
major=.$current
versuffix=.$current.$revision
diff --git a/extension/build-aux/missing b/extension/build-aux/missing
index cdea5149..f62bbae3 100755
--- a/extension/build-aux/missing
+++ b/extension/build-aux/missing
@@ -1,9 +1,9 @@
#! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
-scriptversion=2012-06-26.16; # UTC
+scriptversion=2013-10-28.13; # UTC
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
@@ -160,7 +160,7 @@ give_advice ()
;;
autom4te*)
echo "You might have modified some maintainer files that require"
- echo "the 'automa4te' program to be rebuilt."
+ echo "the 'autom4te' program to be rebuilt."
program_details 'autom4te'
;;
bison*|yacc*)
diff --git a/extension/configh.in b/extension/configh.in
index 5842f2f4..d3f7361e 100644
--- a/extension/configh.in
+++ b/extension/configh.in
@@ -10,22 +10,6 @@
#endif
-/* Define to 1 if translation of program messages to the user's native
- language is requested. */
-#undef ENABLE_NLS
-
-/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
- CoreFoundation framework. */
-#undef HAVE_CFLOCALECOPYCURRENT
-
-/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in
- the CoreFoundation framework. */
-#undef HAVE_CFPREFERENCESCOPYAPPVALUE
-
-/* Define if the GNU dcgettext() function is already present or preinstalled.
- */
-#undef HAVE_DCGETTEXT
-
/* Define to 1 if you have the declaration of `dirfd', and to 0 if you don't.
*/
#undef HAVE_DECL_DIRFD
@@ -55,15 +39,9 @@
/* Define to 1 if you have the `GetSystemTimeAsFileTime' function. */
#undef HAVE_GETSYSTEMTIMEASFILETIME
-/* Define if the GNU gettext() function is already present or preinstalled. */
-#undef HAVE_GETTEXT
-
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
-/* Define if you have the iconv() function and it works. */
-#undef HAVE_ICONV
-
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
diff --git a/extension/configure b/extension/configure
index 7ee9c0df..6818958b 100755
--- a/extension/configure
+++ b/extension/configure
@@ -631,12 +631,12 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-gt_needs=
ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
LIBOBJS
pkgextensiondir
+LT_SYS_LIBRARY_PATH
OTOOL64
OTOOL
LIPO
@@ -653,16 +653,6 @@ DUMPBIN
LD
FGREP
SED
-LIBTOOL
-ac_ct_AR
-AR
-POSUB
-LTLIBINTL
-LIBINTL
-INTLLIBS
-LTLIBICONV
-LIBICONV
-INTL_MACOSX_LIBS
host_os
host_vendor
host_cpu
@@ -671,16 +661,9 @@ build_os
build_vendor
build_cpu
build
-XGETTEXT_EXTRA_OPTIONS
-MSGMERGE
-XGETTEXT_015
-XGETTEXT
-GMSGFMT_015
-MSGFMT_015
-GMSGFMT
-MSGFMT
-GETTEXT_MACRO_VERSION
-USE_NLS
+LIBTOOL
+ac_ct_AR
+AR
AM_BACKSLASH
AM_DEFAULT_VERBOSITY
AM_DEFAULT_V
@@ -771,16 +754,13 @@ ac_user_opts='
enable_option_checking
enable_dependency_tracking
enable_silent_rules
-enable_nls
-with_gnu_ld
-enable_rpath
-with_libiconv_prefix
-with_libintl_prefix
enable_largefile
enable_static
enable_shared
with_pic
enable_fast_install
+with_aix_soname
+with_gnu_ld
with_sysroot
enable_libtool_lock
'
@@ -792,7 +772,8 @@ CFLAGS
LDFLAGS
LIBS
CPPFLAGS
-CPP'
+CPP
+LT_SYS_LIBRARY_PATH'
# Initialize some variables set by options.
@@ -1417,8 +1398,6 @@ Optional Features:
speeds up one-time build
--enable-silent-rules less verbose build output (undo: "make V=1")
--disable-silent-rules verbose build output (undo: "make V=0")
- --disable-nls do not use Native Language Support
- --disable-rpath do not hardcode runtime library paths
--disable-largefile omit support for large files
--enable-static[=PKGS] build static libraries [default=no]
--enable-shared[=PKGS] build shared libraries [default=yes]
@@ -1429,13 +1408,11 @@ Optional Features:
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-gnu-ld assume the C compiler uses GNU ld default=no
- --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib
- --without-libiconv-prefix don't search for libiconv in includedir and libdir
- --with-libintl-prefix[=DIR] search for libintl in DIR/include and DIR/lib
- --without-libintl-prefix don't search for libintl in includedir and libdir
--with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
both]
+ --with-aix-soname=aix|svr4|both
+ shared library versioning (aka "SONAME") variant to
+ provide on AIX, [default=aix].
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
--with-sysroot[=DIR] Search for dependent libraries within DIR (or the
compiler's sysroot if not specified).
@@ -1449,6 +1426,8 @@ Some influential environment variables:
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
CPP C preprocessor
+ LT_SYS_LIBRARY_PATH
+ User-defined run-time library search path.
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
@@ -1771,52 +1750,6 @@ $as_echo "$ac_res" >&6; }
} # ac_fn_c_check_header_compile
-# ac_fn_c_try_link LINENO
-# -----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_link ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext && {
- test "$cross_compiling" = yes ||
- test -x conftest$ac_exeext
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
- # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
- # interfere with the next link command; also delete a directory that is
- # left behind by Apple's compiler. We do this before executing the actions.
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_link
-
# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
# ----------------------------------------------------
# Tries to find if the field MEMBER exists in type AGGR, after including
@@ -1874,6 +1807,52 @@ $as_echo "$ac_res" >&6; }
} # ac_fn_c_check_member
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ test -x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
# ac_fn_c_check_func LINENO FUNC VAR
# ----------------------------------
# Tests whether FUNC exists, setting the cache variable VAR accordingly
@@ -2270,7 +2249,6 @@ $as_echo "$as_me: creating cache $cache_file" >&6;}
>$cache_file
fi
-gt_needs="$gt_needs "
# Check that the precious variables saved in the cache have kept the same
# value.
ac_cache_corrupted=false
@@ -2371,8 +2349,8 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -3685,7 +3663,7 @@ $as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
INSTALL="$ac_aux_dir/install-sh -c"
export INSTALL
-am__api_version='1.14'
+am__api_version='1.15'
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
@@ -3874,7 +3852,7 @@ else
$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
fi
-if test x"${install_sh}" != xset; then
+if test x"${install_sh+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -4265,8 +4243,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
mkdir_p='$(MKDIR_P)'
-# We need awk for the "check" target. The system "awk" is bad on
-# some platforms.
+# We need awk for the "check" target (and possibly the TAP driver). The
+# system "awk" is bad on some platforms.
# Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ...
AMTAR='$${TAR-tar}'
@@ -4453,2097 +4431,6 @@ END
fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5
-$as_echo_n "checking whether NLS is requested... " >&6; }
- # Check whether --enable-nls was given.
-if test "${enable_nls+set}" = set; then :
- enableval=$enable_nls; USE_NLS=$enableval
-else
- USE_NLS=yes
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5
-$as_echo "$USE_NLS" >&6; }
-
-
-
-
- GETTEXT_MACRO_VERSION=0.18
-
-
-
-
-# Prepare PATH_SEPARATOR.
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-# Find out how to test for executable files. Don't use a zero-byte file,
-# as systems may use methods other than mode bits to determine executability.
-cat >conf$$.file <<_ASEOF
-#! /bin/sh
-exit 0
-_ASEOF
-chmod +x conf$$.file
-if test -x conf$$.file >/dev/null 2>&1; then
- ac_executable_p="test -x"
-else
- ac_executable_p="test -f"
-fi
-rm -f conf$$.file
-
-# Extract the first word of "msgfmt", so it can be a program name with args.
-set dummy msgfmt; 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_MSGFMT+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case "$MSGFMT" in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
- ;;
- *)
- ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$ac_save_IFS"
- test -z "$ac_dir" && ac_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
- echo "$as_me: trying $ac_dir/$ac_word..." >&5
- if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 &&
- (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
- ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext"
- break 2
- fi
- fi
- done
- done
- IFS="$ac_save_IFS"
- test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":"
- ;;
-esac
-fi
-MSGFMT="$ac_cv_path_MSGFMT"
-if test "$MSGFMT" != ":"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5
-$as_echo "$MSGFMT" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- # Extract the first word of "gmsgfmt", so it can be a program name with args.
-set dummy gmsgfmt; 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_GMSGFMT+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $GMSGFMT in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_GMSGFMT="$GMSGFMT" # 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_GMSGFMT="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
- ;;
-esac
-fi
-GMSGFMT=$ac_cv_path_GMSGFMT
-if test -n "$GMSGFMT"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5
-$as_echo "$GMSGFMT" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
- 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
-
-
-
-# Prepare PATH_SEPARATOR.
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-# Find out how to test for executable files. Don't use a zero-byte file,
-# as systems may use methods other than mode bits to determine executability.
-cat >conf$$.file <<_ASEOF
-#! /bin/sh
-exit 0
-_ASEOF
-chmod +x conf$$.file
-if test -x conf$$.file >/dev/null 2>&1; then
- ac_executable_p="test -x"
-else
- ac_executable_p="test -f"
-fi
-rm -f conf$$.file
-
-# Extract the first word of "xgettext", so it can be a program name with args.
-set dummy xgettext; 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_XGETTEXT+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case "$XGETTEXT" in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
- ;;
- *)
- ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$ac_save_IFS"
- test -z "$ac_dir" && ac_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
- echo "$as_me: trying $ac_dir/$ac_word..." >&5
- if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 &&
- (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
- ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext"
- break 2
- fi
- fi
- done
- done
- IFS="$ac_save_IFS"
- test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
- ;;
-esac
-fi
-XGETTEXT="$ac_cv_path_XGETTEXT"
-if test "$XGETTEXT" != ":"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5
-$as_echo "$XGETTEXT" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- rm -f messages.po
-
- case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
- '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
- *) XGETTEXT_015=$XGETTEXT ;;
- esac
-
-
-
-# Prepare PATH_SEPARATOR.
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-# Find out how to test for executable files. Don't use a zero-byte file,
-# as systems may use methods other than mode bits to determine executability.
-cat >conf$$.file <<_ASEOF
-#! /bin/sh
-exit 0
-_ASEOF
-chmod +x conf$$.file
-if test -x conf$$.file >/dev/null 2>&1; then
- ac_executable_p="test -x"
-else
- ac_executable_p="test -f"
-fi
-rm -f conf$$.file
-
-# Extract the first word of "msgmerge", so it can be a program name with args.
-set dummy msgmerge; 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_MSGMERGE+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case "$MSGMERGE" in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path.
- ;;
- *)
- ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$ac_save_IFS"
- test -z "$ac_dir" && ac_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
- echo "$as_me: trying $ac_dir/$ac_word..." >&5
- if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then
- ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext"
- break 2
- fi
- fi
- done
- done
- IFS="$ac_save_IFS"
- test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":"
- ;;
-esac
-fi
-MSGMERGE="$ac_cv_path_MSGMERGE"
-if test "$MSGMERGE" != ":"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5
-$as_echo "$MSGMERGE" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$localedir" || localedir='${datadir}/locale'
-
-
- test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
-
-
- ac_config_commands="$ac_config_commands po-directories"
-
-
-
- if test "X$prefix" = "XNONE"; then
- acl_final_prefix="$ac_default_prefix"
- else
- acl_final_prefix="$prefix"
- fi
- if test "X$exec_prefix" = "XNONE"; then
- acl_final_exec_prefix='${prefix}'
- else
- acl_final_exec_prefix="$exec_prefix"
- fi
- acl_save_prefix="$prefix"
- prefix="$acl_final_prefix"
- eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
- prefix="$acl_save_prefix"
-
-# 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
-
-
-
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then :
- withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
-else
- with_gnu_ld=no
-fi
-
-# Prepare PATH_SEPARATOR.
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by GCC" >&5
-$as_echo_n "checking for ld used by GCC... " >&6; }
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [\\/]* | [A-Za-z]:[\\/]*)
- re_direlt='/[^/][^/]*/\.\./'
- # Canonicalize the path of ld
- ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
-$as_echo_n "checking for GNU ld... " >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
-$as_echo_n "checking for non-GNU ld... " >&6; }
-fi
-if ${acl_cv_path_LD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$LD"; then
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- acl_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some GNU ld's only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break ;;
- *)
- test "$with_gnu_ld" != yes && break ;;
- esac
- fi
- done
- IFS="$ac_save_ifs"
-else
- acl_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
-
-LD="$acl_cv_path_LD"
-if test -n "$LD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
-$as_echo "$LD" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
-$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if ${acl_cv_prog_gnu_ld+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # I'd rather use --version here, but apparently some GNU ld's only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- acl_cv_prog_gnu_ld=yes ;;
-*)
- acl_cv_prog_gnu_ld=no ;;
-esac
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_prog_gnu_ld" >&5
-$as_echo "$acl_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$acl_cv_prog_gnu_ld
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5
-$as_echo_n "checking for shared library run path origin... " >&6; }
-if ${acl_cv_rpath+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
- ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
- . ./conftest.sh
- rm -f ./conftest.sh
- acl_cv_rpath=done
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5
-$as_echo "$acl_cv_rpath" >&6; }
- wl="$acl_cv_wl"
- acl_libext="$acl_cv_libext"
- acl_shlibext="$acl_cv_shlibext"
- acl_libname_spec="$acl_cv_libname_spec"
- acl_library_names_spec="$acl_cv_library_names_spec"
- acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
- acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
- acl_hardcode_direct="$acl_cv_hardcode_direct"
- acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
- # Check whether --enable-rpath was given.
-if test "${enable_rpath+set}" = set; then :
- enableval=$enable_rpath; :
-else
- enable_rpath=yes
-fi
-
-
-
-
- acl_libdirstem=lib
- acl_libdirstem2=
- case "$host_os" in
- solaris*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5
-$as_echo_n "checking for 64-bit host... " >&6; }
-if ${gl_cv_solaris_64bit+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#ifdef _LP64
-sixtyfour bits
-#endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "sixtyfour bits" >/dev/null 2>&1; then :
- gl_cv_solaris_64bit=yes
-else
- gl_cv_solaris_64bit=no
-fi
-rm -f conftest*
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5
-$as_echo "$gl_cv_solaris_64bit" >&6; }
- if test $gl_cv_solaris_64bit = yes; then
- acl_libdirstem=lib/64
- case "$host_cpu" in
- sparc*) acl_libdirstem2=lib/sparcv9 ;;
- i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
- esac
- fi
- ;;
- *)
- searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
- if test -n "$searchpath"; then
- acl_save_IFS="${IFS= }"; IFS=":"
- for searchdir in $searchpath; do
- if test -d "$searchdir"; then
- case "$searchdir" in
- */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
- */../ | */.. )
- # Better ignore directories of this form. They are misleading.
- ;;
- *) searchdir=`cd "$searchdir" && pwd`
- case "$searchdir" in
- */lib64 ) acl_libdirstem=lib64 ;;
- esac ;;
- esac
- fi
- done
- IFS="$acl_save_IFS"
- fi
- ;;
- esac
- test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
-
-
-
-
-
-
-
-
-
-
-
-
- use_additional=yes
-
- acl_save_prefix="$prefix"
- prefix="$acl_final_prefix"
- acl_save_exec_prefix="$exec_prefix"
- exec_prefix="$acl_final_exec_prefix"
-
- eval additional_includedir=\"$includedir\"
- eval additional_libdir=\"$libdir\"
-
- exec_prefix="$acl_save_exec_prefix"
- prefix="$acl_save_prefix"
-
-
-# Check whether --with-libiconv-prefix was given.
-if test "${with_libiconv_prefix+set}" = set; then :
- withval=$with_libiconv_prefix;
- if test "X$withval" = "Xno"; then
- use_additional=no
- else
- if test "X$withval" = "X"; then
-
- acl_save_prefix="$prefix"
- prefix="$acl_final_prefix"
- acl_save_exec_prefix="$exec_prefix"
- exec_prefix="$acl_final_exec_prefix"
-
- eval additional_includedir=\"$includedir\"
- eval additional_libdir=\"$libdir\"
-
- exec_prefix="$acl_save_exec_prefix"
- prefix="$acl_save_prefix"
-
- else
- additional_includedir="$withval/include"
- additional_libdir="$withval/$acl_libdirstem"
- if test "$acl_libdirstem2" != "$acl_libdirstem" \
- && ! test -d "$withval/$acl_libdirstem"; then
- additional_libdir="$withval/$acl_libdirstem2"
- fi
- fi
- fi
-
-fi
-
- LIBICONV=
- LTLIBICONV=
- INCICONV=
- LIBICONV_PREFIX=
- HAVE_LIBICONV=
- rpathdirs=
- ltrpathdirs=
- names_already_handled=
- names_next_round='iconv '
- while test -n "$names_next_round"; do
- names_this_round="$names_next_round"
- names_next_round=
- for name in $names_this_round; do
- already_handled=
- for n in $names_already_handled; do
- if test "$n" = "$name"; then
- already_handled=yes
- break
- fi
- done
- if test -z "$already_handled"; then
- names_already_handled="$names_already_handled $name"
- uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
- eval value=\"\$HAVE_LIB$uppername\"
- if test -n "$value"; then
- if test "$value" = yes; then
- eval value=\"\$LIB$uppername\"
- test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value"
- eval value=\"\$LTLIB$uppername\"
- test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value"
- else
- :
- fi
- else
- found_dir=
- found_la=
- found_so=
- found_a=
- eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
- if test -n "$acl_shlibext"; then
- shrext=".$acl_shlibext" # typically: shrext=.so
- else
- shrext=
- fi
- if test $use_additional = yes; then
- dir="$additional_libdir"
- if test -n "$acl_shlibext"; then
- if test -f "$dir/$libname$shrext"; then
- found_dir="$dir"
- found_so="$dir/$libname$shrext"
- else
- if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
- ver=`(cd "$dir" && \
- for f in "$libname$shrext".*; do echo "$f"; done \
- | sed -e "s,^$libname$shrext\\\\.,," \
- | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
- | sed 1q ) 2>/dev/null`
- if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
- found_dir="$dir"
- found_so="$dir/$libname$shrext.$ver"
- fi
- else
- eval library_names=\"$acl_library_names_spec\"
- for f in $library_names; do
- if test -f "$dir/$f"; then
- found_dir="$dir"
- found_so="$dir/$f"
- break
- fi
- done
- fi
- fi
- fi
- if test "X$found_dir" = "X"; then
- if test -f "$dir/$libname.$acl_libext"; then
- found_dir="$dir"
- found_a="$dir/$libname.$acl_libext"
- fi
- fi
- if test "X$found_dir" != "X"; then
- if test -f "$dir/$libname.la"; then
- found_la="$dir/$libname.la"
- fi
- fi
- fi
- if test "X$found_dir" = "X"; then
- for x in $LDFLAGS $LTLIBICONV; do
-
- acl_save_prefix="$prefix"
- prefix="$acl_final_prefix"
- acl_save_exec_prefix="$exec_prefix"
- exec_prefix="$acl_final_exec_prefix"
- eval x=\"$x\"
- exec_prefix="$acl_save_exec_prefix"
- prefix="$acl_save_prefix"
-
- case "$x" in
- -L*)
- dir=`echo "X$x" | sed -e 's/^X-L//'`
- if test -n "$acl_shlibext"; then
- if test -f "$dir/$libname$shrext"; then
- found_dir="$dir"
- found_so="$dir/$libname$shrext"
- else
- if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
- ver=`(cd "$dir" && \
- for f in "$libname$shrext".*; do echo "$f"; done \
- | sed -e "s,^$libname$shrext\\\\.,," \
- | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
- | sed 1q ) 2>/dev/null`
- if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
- found_dir="$dir"
- found_so="$dir/$libname$shrext.$ver"
- fi
- else
- eval library_names=\"$acl_library_names_spec\"
- for f in $library_names; do
- if test -f "$dir/$f"; then
- found_dir="$dir"
- found_so="$dir/$f"
- break
- fi
- done
- fi
- fi
- fi
- if test "X$found_dir" = "X"; then
- if test -f "$dir/$libname.$acl_libext"; then
- found_dir="$dir"
- found_a="$dir/$libname.$acl_libext"
- fi
- fi
- if test "X$found_dir" != "X"; then
- if test -f "$dir/$libname.la"; then
- found_la="$dir/$libname.la"
- fi
- fi
- ;;
- esac
- if test "X$found_dir" != "X"; then
- break
- fi
- done
- fi
- if test "X$found_dir" != "X"; then
- LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name"
- if test "X$found_so" != "X"; then
- if test "$enable_rpath" = no \
- || test "X$found_dir" = "X/usr/$acl_libdirstem" \
- || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
- LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
- else
- haveit=
- for x in $ltrpathdirs; do
- if test "X$x" = "X$found_dir"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- ltrpathdirs="$ltrpathdirs $found_dir"
- fi
- if test "$acl_hardcode_direct" = yes; then
- LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
- else
- if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
- LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
- haveit=
- for x in $rpathdirs; do
- if test "X$x" = "X$found_dir"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- rpathdirs="$rpathdirs $found_dir"
- fi
- else
- haveit=
- for x in $LDFLAGS $LIBICONV; do
-
- acl_save_prefix="$prefix"
- prefix="$acl_final_prefix"
- acl_save_exec_prefix="$exec_prefix"
- exec_prefix="$acl_final_exec_prefix"
- eval x=\"$x\"
- exec_prefix="$acl_save_exec_prefix"
- prefix="$acl_save_prefix"
-
- if test "X$x" = "X-L$found_dir"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir"
- fi
- if test "$acl_hardcode_minus_L" != no; then
- LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
- else
- LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name"
- fi
- fi
- fi
- fi
- else
- if test "X$found_a" != "X"; then
- LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a"
- else
- LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name"
- fi
- fi
- additional_includedir=
- case "$found_dir" in
- */$acl_libdirstem | */$acl_libdirstem/)
- basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
- if test "$name" = 'iconv'; then
- LIBICONV_PREFIX="$basedir"
- fi
- additional_includedir="$basedir/include"
- ;;
- */$acl_libdirstem2 | */$acl_libdirstem2/)
- basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
- if test "$name" = 'iconv'; then
- LIBICONV_PREFIX="$basedir"
- fi
- additional_includedir="$basedir/include"
- ;;
- esac
- if test "X$additional_includedir" != "X"; then
- if test "X$additional_includedir" != "X/usr/include"; then
- haveit=
- if test "X$additional_includedir" = "X/usr/local/include"; then
- if test -n "$GCC"; then
- case $host_os in
- linux* | gnu* | k*bsd*-gnu) haveit=yes;;
- esac
- fi
- fi
- if test -z "$haveit"; then
- for x in $CPPFLAGS $INCICONV; do
-
- acl_save_prefix="$prefix"
- prefix="$acl_final_prefix"
- acl_save_exec_prefix="$exec_prefix"
- exec_prefix="$acl_final_exec_prefix"
- eval x=\"$x\"
- exec_prefix="$acl_save_exec_prefix"
- prefix="$acl_save_prefix"
-
- if test "X$x" = "X-I$additional_includedir"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- if test -d "$additional_includedir"; then
- INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir"
- fi
- fi
- fi
- fi
- fi
- if test -n "$found_la"; then
- save_libdir="$libdir"
- case "$found_la" in
- */* | *\\*) . "$found_la" ;;
- *) . "./$found_la" ;;
- esac
- libdir="$save_libdir"
- for dep in $dependency_libs; do
- case "$dep" in
- -L*)
- additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
- if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
- && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
- haveit=
- if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
- || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
- if test -n "$GCC"; then
- case $host_os in
- linux* | gnu* | k*bsd*-gnu) haveit=yes;;
- esac
- fi
- fi
- if test -z "$haveit"; then
- haveit=
- for x in $LDFLAGS $LIBICONV; do
-
- acl_save_prefix="$prefix"
- prefix="$acl_final_prefix"
- acl_save_exec_prefix="$exec_prefix"
- exec_prefix="$acl_final_exec_prefix"
- eval x=\"$x\"
- exec_prefix="$acl_save_exec_prefix"
- prefix="$acl_save_prefix"
-
- if test "X$x" = "X-L$additional_libdir"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- if test -d "$additional_libdir"; then
- LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir"
- fi
- fi
- haveit=
- for x in $LDFLAGS $LTLIBICONV; do
-
- acl_save_prefix="$prefix"
- prefix="$acl_final_prefix"
- acl_save_exec_prefix="$exec_prefix"
- exec_prefix="$acl_final_exec_prefix"
- eval x=\"$x\"
- exec_prefix="$acl_save_exec_prefix"
- prefix="$acl_save_prefix"
-
- if test "X$x" = "X-L$additional_libdir"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- if test -d "$additional_libdir"; then
- LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir"
- fi
- fi
- fi
- fi
- ;;
- -R*)
- dir=`echo "X$dep" | sed -e 's/^X-R//'`
- if test "$enable_rpath" != no; then
- haveit=
- for x in $rpathdirs; do
- if test "X$x" = "X$dir"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- rpathdirs="$rpathdirs $dir"
- fi
- haveit=
- for x in $ltrpathdirs; do
- if test "X$x" = "X$dir"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- ltrpathdirs="$ltrpathdirs $dir"
- fi
- fi
- ;;
- -l*)
- names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
- ;;
- *.la)
- names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
- ;;
- *)
- LIBICONV="${LIBICONV}${LIBICONV:+ }$dep"
- LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep"
- ;;
- esac
- done
- fi
- else
- LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name"
- LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name"
- fi
- fi
- fi
- done
- done
- if test "X$rpathdirs" != "X"; then
- if test -n "$acl_hardcode_libdir_separator"; then
- alldirs=
- for found_dir in $rpathdirs; do
- alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
- done
- acl_save_libdir="$libdir"
- libdir="$alldirs"
- eval flag=\"$acl_hardcode_libdir_flag_spec\"
- libdir="$acl_save_libdir"
- LIBICONV="${LIBICONV}${LIBICONV:+ }$flag"
- else
- for found_dir in $rpathdirs; do
- acl_save_libdir="$libdir"
- libdir="$found_dir"
- eval flag=\"$acl_hardcode_libdir_flag_spec\"
- libdir="$acl_save_libdir"
- LIBICONV="${LIBICONV}${LIBICONV:+ }$flag"
- done
- fi
- fi
- if test "X$ltrpathdirs" != "X"; then
- for found_dir in $ltrpathdirs; do
- LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir"
- done
- fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- { $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
- gt_save_LIBS="$LIBS"
- LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <CoreFoundation/CFPreferences.h>
-int
-main ()
-{
-CFPreferencesCopyAppValue(NULL, NULL)
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- gt_cv_func_CFPreferencesCopyAppValue=yes
-else
- gt_cv_func_CFPreferencesCopyAppValue=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_CFPreferencesCopyAppValue" >&5
-$as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; }
- if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
-
-$as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h
-
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5
-$as_echo_n "checking for CFLocaleCopyCurrent... " >&6; }
-if ${gt_cv_func_CFLocaleCopyCurrent+:} 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 <CoreFoundation/CFLocale.h>
-int
-main ()
-{
-CFLocaleCopyCurrent();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- gt_cv_func_CFLocaleCopyCurrent=yes
-else
- gt_cv_func_CFLocaleCopyCurrent=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_CFLocaleCopyCurrent" >&5
-$as_echo "$gt_cv_func_CFLocaleCopyCurrent" >&6; }
- if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
-
-$as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h
-
- fi
- INTL_MACOSX_LIBS=
- if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
- INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
- fi
-
-
-
-
-
-
- LIBINTL=
- LTLIBINTL=
- POSUB=
-
- case " $gt_needs " in
- *" need-formatstring-macros "*) gt_api_version=3 ;;
- *" need-ngettext "*) gt_api_version=2 ;;
- *) gt_api_version=1 ;;
- esac
- gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
- gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
-
- if test "$USE_NLS" = "yes"; then
- gt_use_preinstalled_gnugettext=no
-
-
- if test $gt_api_version -ge 3; then
- gt_revision_test_code='
-#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
-#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
-#endif
-typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
-'
- else
- gt_revision_test_code=
- fi
- if test $gt_api_version -ge 2; then
- gt_expression_test_code=' + * ngettext ("", "", 0)'
- else
- gt_expression_test_code=
- fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5
-$as_echo_n "checking for GNU gettext in libc... " >&6; }
-if eval \${$gt_func_gnugettext_libc+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <libintl.h>
-$gt_revision_test_code
-extern int _nl_msg_cat_cntr;
-extern int *_nl_domain_bindings;
-int
-main ()
-{
-bindtextdomain ("", "");
-return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- eval "$gt_func_gnugettext_libc=yes"
-else
- eval "$gt_func_gnugettext_libc=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-eval ac_res=\$$gt_func_gnugettext_libc
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
- if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
-
-
-
-
-
- am_save_CPPFLAGS="$CPPFLAGS"
-
- for element in $INCICONV; do
- haveit=
- for x in $CPPFLAGS; do
-
- acl_save_prefix="$prefix"
- prefix="$acl_final_prefix"
- acl_save_exec_prefix="$exec_prefix"
- exec_prefix="$acl_final_exec_prefix"
- eval x=\"$x\"
- exec_prefix="$acl_save_exec_prefix"
- prefix="$acl_save_prefix"
-
- if test "X$x" = "X$element"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
- fi
- done
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5
-$as_echo_n "checking for iconv... " >&6; }
-if ${am_cv_func_iconv+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- am_cv_func_iconv="no, consider installing GNU libiconv"
- am_cv_lib_iconv=no
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <iconv.h>
-int
-main ()
-{
-iconv_t cd = iconv_open("","");
- iconv(cd,NULL,NULL,NULL,NULL);
- iconv_close(cd);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- am_cv_func_iconv=yes
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- if test "$am_cv_func_iconv" != yes; then
- am_save_LIBS="$LIBS"
- LIBS="$LIBS $LIBICONV"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <iconv.h>
-int
-main ()
-{
-iconv_t cd = iconv_open("","");
- iconv(cd,NULL,NULL,NULL,NULL);
- iconv_close(cd);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- am_cv_lib_iconv=yes
- am_cv_func_iconv=yes
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LIBS="$am_save_LIBS"
- fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5
-$as_echo "$am_cv_func_iconv" >&6; }
- if test "$am_cv_func_iconv" = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5
-$as_echo_n "checking for working iconv... " >&6; }
-if ${am_cv_func_iconv_works+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- am_save_LIBS="$LIBS"
- if test $am_cv_lib_iconv = yes; then
- LIBS="$LIBS $LIBICONV"
- fi
- if test "$cross_compiling" = yes; then :
- case "$host_os" in
- aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
- *) am_cv_func_iconv_works="guessing yes" ;;
- esac
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#include <iconv.h>
-#include <string.h>
-int main ()
-{
- /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
- returns. */
- {
- iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
- if (cd_utf8_to_88591 != (iconv_t)(-1))
- {
- static const char input[] = "\342\202\254"; /* EURO SIGN */
- char buf[10];
- const char *inptr = input;
- size_t inbytesleft = strlen (input);
- char *outptr = buf;
- size_t outbytesleft = sizeof (buf);
- size_t res = iconv (cd_utf8_to_88591,
- (char **) &inptr, &inbytesleft,
- &outptr, &outbytesleft);
- if (res == 0)
- return 1;
- }
- }
- /* Test against Solaris 10 bug: Failures are not distinguishable from
- successful returns. */
- {
- iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
- if (cd_ascii_to_88591 != (iconv_t)(-1))
- {
- static const char input[] = "\263";
- char buf[10];
- const char *inptr = input;
- size_t inbytesleft = strlen (input);
- char *outptr = buf;
- size_t outbytesleft = sizeof (buf);
- size_t res = iconv (cd_ascii_to_88591,
- (char **) &inptr, &inbytesleft,
- &outptr, &outbytesleft);
- if (res == 0)
- return 1;
- }
- }
-#if 0 /* This bug could be worked around by the caller. */
- /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
- {
- iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
- if (cd_88591_to_utf8 != (iconv_t)(-1))
- {
- static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
- char buf[50];
- const char *inptr = input;
- size_t inbytesleft = strlen (input);
- char *outptr = buf;
- size_t outbytesleft = sizeof (buf);
- size_t res = iconv (cd_88591_to_utf8,
- (char **) &inptr, &inbytesleft,
- &outptr, &outbytesleft);
- if ((int)res > 0)
- return 1;
- }
- }
-#endif
- /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
- provided. */
- if (/* Try standardized names. */
- iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
- /* Try IRIX, OSF/1 names. */
- && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
- /* Try AIX names. */
- && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
- /* Try HP-UX names. */
- && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
- return 1;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- am_cv_func_iconv_works=yes
-else
- am_cv_func_iconv_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="$am_save_LIBS"
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5
-$as_echo "$am_cv_func_iconv_works" >&6; }
- case "$am_cv_func_iconv_works" in
- *no) am_func_iconv=no am_cv_lib_iconv=no ;;
- *) am_func_iconv=yes ;;
- esac
- else
- am_func_iconv=no am_cv_lib_iconv=no
- fi
- if test "$am_func_iconv" = yes; then
-
-$as_echo "#define HAVE_ICONV 1" >>confdefs.h
-
- fi
- if test "$am_cv_lib_iconv" = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5
-$as_echo_n "checking how to link with libiconv... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5
-$as_echo "$LIBICONV" >&6; }
- else
- CPPFLAGS="$am_save_CPPFLAGS"
- LIBICONV=
- LTLIBICONV=
- fi
-
-
-
-
-
-
-
-
-
-
-
- use_additional=yes
-
- acl_save_prefix="$prefix"
- prefix="$acl_final_prefix"
- acl_save_exec_prefix="$exec_prefix"
- exec_prefix="$acl_final_exec_prefix"
-
- eval additional_includedir=\"$includedir\"
- eval additional_libdir=\"$libdir\"
-
- exec_prefix="$acl_save_exec_prefix"
- prefix="$acl_save_prefix"
-
-
-# Check whether --with-libintl-prefix was given.
-if test "${with_libintl_prefix+set}" = set; then :
- withval=$with_libintl_prefix;
- if test "X$withval" = "Xno"; then
- use_additional=no
- else
- if test "X$withval" = "X"; then
-
- acl_save_prefix="$prefix"
- prefix="$acl_final_prefix"
- acl_save_exec_prefix="$exec_prefix"
- exec_prefix="$acl_final_exec_prefix"
-
- eval additional_includedir=\"$includedir\"
- eval additional_libdir=\"$libdir\"
-
- exec_prefix="$acl_save_exec_prefix"
- prefix="$acl_save_prefix"
-
- else
- additional_includedir="$withval/include"
- additional_libdir="$withval/$acl_libdirstem"
- if test "$acl_libdirstem2" != "$acl_libdirstem" \
- && ! test -d "$withval/$acl_libdirstem"; then
- additional_libdir="$withval/$acl_libdirstem2"
- fi
- fi
- fi
-
-fi
-
- LIBINTL=
- LTLIBINTL=
- INCINTL=
- LIBINTL_PREFIX=
- HAVE_LIBINTL=
- rpathdirs=
- ltrpathdirs=
- names_already_handled=
- names_next_round='intl '
- while test -n "$names_next_round"; do
- names_this_round="$names_next_round"
- names_next_round=
- for name in $names_this_round; do
- already_handled=
- for n in $names_already_handled; do
- if test "$n" = "$name"; then
- already_handled=yes
- break
- fi
- done
- if test -z "$already_handled"; then
- names_already_handled="$names_already_handled $name"
- uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
- eval value=\"\$HAVE_LIB$uppername\"
- if test -n "$value"; then
- if test "$value" = yes; then
- eval value=\"\$LIB$uppername\"
- test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value"
- eval value=\"\$LTLIB$uppername\"
- test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value"
- else
- :
- fi
- else
- found_dir=
- found_la=
- found_so=
- found_a=
- eval libname=\"$acl_libname_spec\" # typically: libname=lib$name
- if test -n "$acl_shlibext"; then
- shrext=".$acl_shlibext" # typically: shrext=.so
- else
- shrext=
- fi
- if test $use_additional = yes; then
- dir="$additional_libdir"
- if test -n "$acl_shlibext"; then
- if test -f "$dir/$libname$shrext"; then
- found_dir="$dir"
- found_so="$dir/$libname$shrext"
- else
- if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
- ver=`(cd "$dir" && \
- for f in "$libname$shrext".*; do echo "$f"; done \
- | sed -e "s,^$libname$shrext\\\\.,," \
- | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
- | sed 1q ) 2>/dev/null`
- if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
- found_dir="$dir"
- found_so="$dir/$libname$shrext.$ver"
- fi
- else
- eval library_names=\"$acl_library_names_spec\"
- for f in $library_names; do
- if test -f "$dir/$f"; then
- found_dir="$dir"
- found_so="$dir/$f"
- break
- fi
- done
- fi
- fi
- fi
- if test "X$found_dir" = "X"; then
- if test -f "$dir/$libname.$acl_libext"; then
- found_dir="$dir"
- found_a="$dir/$libname.$acl_libext"
- fi
- fi
- if test "X$found_dir" != "X"; then
- if test -f "$dir/$libname.la"; then
- found_la="$dir/$libname.la"
- fi
- fi
- fi
- if test "X$found_dir" = "X"; then
- for x in $LDFLAGS $LTLIBINTL; do
-
- acl_save_prefix="$prefix"
- prefix="$acl_final_prefix"
- acl_save_exec_prefix="$exec_prefix"
- exec_prefix="$acl_final_exec_prefix"
- eval x=\"$x\"
- exec_prefix="$acl_save_exec_prefix"
- prefix="$acl_save_prefix"
-
- case "$x" in
- -L*)
- dir=`echo "X$x" | sed -e 's/^X-L//'`
- if test -n "$acl_shlibext"; then
- if test -f "$dir/$libname$shrext"; then
- found_dir="$dir"
- found_so="$dir/$libname$shrext"
- else
- if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
- ver=`(cd "$dir" && \
- for f in "$libname$shrext".*; do echo "$f"; done \
- | sed -e "s,^$libname$shrext\\\\.,," \
- | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
- | sed 1q ) 2>/dev/null`
- if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
- found_dir="$dir"
- found_so="$dir/$libname$shrext.$ver"
- fi
- else
- eval library_names=\"$acl_library_names_spec\"
- for f in $library_names; do
- if test -f "$dir/$f"; then
- found_dir="$dir"
- found_so="$dir/$f"
- break
- fi
- done
- fi
- fi
- fi
- if test "X$found_dir" = "X"; then
- if test -f "$dir/$libname.$acl_libext"; then
- found_dir="$dir"
- found_a="$dir/$libname.$acl_libext"
- fi
- fi
- if test "X$found_dir" != "X"; then
- if test -f "$dir/$libname.la"; then
- found_la="$dir/$libname.la"
- fi
- fi
- ;;
- esac
- if test "X$found_dir" != "X"; then
- break
- fi
- done
- fi
- if test "X$found_dir" != "X"; then
- LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name"
- if test "X$found_so" != "X"; then
- if test "$enable_rpath" = no \
- || test "X$found_dir" = "X/usr/$acl_libdirstem" \
- || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
- LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
- else
- haveit=
- for x in $ltrpathdirs; do
- if test "X$x" = "X$found_dir"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- ltrpathdirs="$ltrpathdirs $found_dir"
- fi
- if test "$acl_hardcode_direct" = yes; then
- LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
- else
- if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
- LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
- haveit=
- for x in $rpathdirs; do
- if test "X$x" = "X$found_dir"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- rpathdirs="$rpathdirs $found_dir"
- fi
- else
- haveit=
- for x in $LDFLAGS $LIBINTL; do
-
- acl_save_prefix="$prefix"
- prefix="$acl_final_prefix"
- acl_save_exec_prefix="$exec_prefix"
- exec_prefix="$acl_final_exec_prefix"
- eval x=\"$x\"
- exec_prefix="$acl_save_exec_prefix"
- prefix="$acl_save_prefix"
-
- if test "X$x" = "X-L$found_dir"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir"
- fi
- if test "$acl_hardcode_minus_L" != no; then
- LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
- else
- LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name"
- fi
- fi
- fi
- fi
- else
- if test "X$found_a" != "X"; then
- LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a"
- else
- LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name"
- fi
- fi
- additional_includedir=
- case "$found_dir" in
- */$acl_libdirstem | */$acl_libdirstem/)
- basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
- if test "$name" = 'intl'; then
- LIBINTL_PREFIX="$basedir"
- fi
- additional_includedir="$basedir/include"
- ;;
- */$acl_libdirstem2 | */$acl_libdirstem2/)
- basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
- if test "$name" = 'intl'; then
- LIBINTL_PREFIX="$basedir"
- fi
- additional_includedir="$basedir/include"
- ;;
- esac
- if test "X$additional_includedir" != "X"; then
- if test "X$additional_includedir" != "X/usr/include"; then
- haveit=
- if test "X$additional_includedir" = "X/usr/local/include"; then
- if test -n "$GCC"; then
- case $host_os in
- linux* | gnu* | k*bsd*-gnu) haveit=yes;;
- esac
- fi
- fi
- if test -z "$haveit"; then
- for x in $CPPFLAGS $INCINTL; do
-
- acl_save_prefix="$prefix"
- prefix="$acl_final_prefix"
- acl_save_exec_prefix="$exec_prefix"
- exec_prefix="$acl_final_exec_prefix"
- eval x=\"$x\"
- exec_prefix="$acl_save_exec_prefix"
- prefix="$acl_save_prefix"
-
- if test "X$x" = "X-I$additional_includedir"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- if test -d "$additional_includedir"; then
- INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir"
- fi
- fi
- fi
- fi
- fi
- if test -n "$found_la"; then
- save_libdir="$libdir"
- case "$found_la" in
- */* | *\\*) . "$found_la" ;;
- *) . "./$found_la" ;;
- esac
- libdir="$save_libdir"
- for dep in $dependency_libs; do
- case "$dep" in
- -L*)
- additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
- if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
- && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
- haveit=
- if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
- || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
- if test -n "$GCC"; then
- case $host_os in
- linux* | gnu* | k*bsd*-gnu) haveit=yes;;
- esac
- fi
- fi
- if test -z "$haveit"; then
- haveit=
- for x in $LDFLAGS $LIBINTL; do
-
- acl_save_prefix="$prefix"
- prefix="$acl_final_prefix"
- acl_save_exec_prefix="$exec_prefix"
- exec_prefix="$acl_final_exec_prefix"
- eval x=\"$x\"
- exec_prefix="$acl_save_exec_prefix"
- prefix="$acl_save_prefix"
-
- if test "X$x" = "X-L$additional_libdir"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- if test -d "$additional_libdir"; then
- LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir"
- fi
- fi
- haveit=
- for x in $LDFLAGS $LTLIBINTL; do
-
- acl_save_prefix="$prefix"
- prefix="$acl_final_prefix"
- acl_save_exec_prefix="$exec_prefix"
- exec_prefix="$acl_final_exec_prefix"
- eval x=\"$x\"
- exec_prefix="$acl_save_exec_prefix"
- prefix="$acl_save_prefix"
-
- if test "X$x" = "X-L$additional_libdir"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- if test -d "$additional_libdir"; then
- LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir"
- fi
- fi
- fi
- fi
- ;;
- -R*)
- dir=`echo "X$dep" | sed -e 's/^X-R//'`
- if test "$enable_rpath" != no; then
- haveit=
- for x in $rpathdirs; do
- if test "X$x" = "X$dir"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- rpathdirs="$rpathdirs $dir"
- fi
- haveit=
- for x in $ltrpathdirs; do
- if test "X$x" = "X$dir"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- ltrpathdirs="$ltrpathdirs $dir"
- fi
- fi
- ;;
- -l*)
- names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
- ;;
- *.la)
- names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
- ;;
- *)
- LIBINTL="${LIBINTL}${LIBINTL:+ }$dep"
- LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep"
- ;;
- esac
- done
- fi
- else
- LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name"
- LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name"
- fi
- fi
- fi
- done
- done
- if test "X$rpathdirs" != "X"; then
- if test -n "$acl_hardcode_libdir_separator"; then
- alldirs=
- for found_dir in $rpathdirs; do
- alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
- done
- acl_save_libdir="$libdir"
- libdir="$alldirs"
- eval flag=\"$acl_hardcode_libdir_flag_spec\"
- libdir="$acl_save_libdir"
- LIBINTL="${LIBINTL}${LIBINTL:+ }$flag"
- else
- for found_dir in $rpathdirs; do
- acl_save_libdir="$libdir"
- libdir="$found_dir"
- eval flag=\"$acl_hardcode_libdir_flag_spec\"
- libdir="$acl_save_libdir"
- LIBINTL="${LIBINTL}${LIBINTL:+ }$flag"
- done
- fi
- fi
- if test "X$ltrpathdirs" != "X"; then
- for found_dir in $ltrpathdirs; do
- LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir"
- done
- fi
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5
-$as_echo_n "checking for GNU gettext in libintl... " >&6; }
-if eval \${$gt_func_gnugettext_libintl+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- gt_save_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $INCINTL"
- gt_save_LIBS="$LIBS"
- LIBS="$LIBS $LIBINTL"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <libintl.h>
-$gt_revision_test_code
-extern int _nl_msg_cat_cntr;
-extern
-#ifdef __cplusplus
-"C"
-#endif
-const char *_nl_expand_alias (const char *);
-int
-main ()
-{
-bindtextdomain ("", "");
-return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- eval "$gt_func_gnugettext_libintl=yes"
-else
- eval "$gt_func_gnugettext_libintl=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
- LIBS="$LIBS $LIBICONV"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <libintl.h>
-$gt_revision_test_code
-extern int _nl_msg_cat_cntr;
-extern
-#ifdef __cplusplus
-"C"
-#endif
-const char *_nl_expand_alias (const char *);
-int
-main ()
-{
-bindtextdomain ("", "");
-return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- LIBINTL="$LIBINTL $LIBICONV"
- LTLIBINTL="$LTLIBINTL $LTLIBICONV"
- eval "$gt_func_gnugettext_libintl=yes"
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- fi
- CPPFLAGS="$gt_save_CPPFLAGS"
- LIBS="$gt_save_LIBS"
-fi
-eval ac_res=\$$gt_func_gnugettext_libintl
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- fi
-
- if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
- || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
- && test "$PACKAGE" != gettext-runtime \
- && test "$PACKAGE" != gettext-tools; }; then
- gt_use_preinstalled_gnugettext=yes
- else
- LIBINTL=
- LTLIBINTL=
- INCINTL=
- fi
-
-
-
- if test -n "$INTL_MACOSX_LIBS"; then
- if test "$gt_use_preinstalled_gnugettext" = "yes" \
- || test "$nls_cv_use_gnu_gettext" = "yes"; then
- LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
- LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
- fi
- fi
-
- if test "$gt_use_preinstalled_gnugettext" = "yes" \
- || test "$nls_cv_use_gnu_gettext" = "yes"; then
-
-$as_echo "#define ENABLE_NLS 1" >>confdefs.h
-
- else
- USE_NLS=no
- fi
- fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5
-$as_echo_n "checking whether to use NLS... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5
-$as_echo "$USE_NLS" >&6; }
- if test "$USE_NLS" = "yes"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5
-$as_echo_n "checking where the gettext function comes from... " >&6; }
- if test "$gt_use_preinstalled_gnugettext" = "yes"; then
- if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
- gt_source="external libintl"
- else
- gt_source="libc"
- fi
- else
- gt_source="included intl directory"
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5
-$as_echo "$gt_source" >&6; }
- fi
-
- if test "$USE_NLS" = "yes"; then
-
- if test "$gt_use_preinstalled_gnugettext" = "yes"; then
- if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5
-$as_echo_n "checking how to link with libintl... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5
-$as_echo "$LIBINTL" >&6; }
-
- for element in $INCINTL; do
- haveit=
- for x in $CPPFLAGS; do
-
- acl_save_prefix="$prefix"
- prefix="$acl_final_prefix"
- acl_save_exec_prefix="$exec_prefix"
- exec_prefix="$acl_final_exec_prefix"
- eval x=\"$x\"
- exec_prefix="$acl_save_exec_prefix"
- prefix="$acl_save_prefix"
-
- if test "X$x" = "X$element"; then
- haveit=yes
- break
- fi
- done
- if test -z "$haveit"; then
- CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
- fi
- done
-
- fi
-
-
-$as_echo "#define HAVE_GETTEXT 1" >>confdefs.h
-
-
-$as_echo "#define HAVE_DCGETTEXT 1" >>confdefs.h
-
- fi
-
- POSUB=po
- fi
-
-
-
- INTLLIBS="$LIBINTL"
-
-
-
-
-
-
-
-
ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default"
if test "x$ac_cv_member_struct_stat_st_blksize" = xyes; then :
@@ -6965,8 +4852,8 @@ esac
-macro_version='2.4.2.458.26-92994'
-macro_revision='2.4.3'
+macro_version='2.4.5'
+macro_revision='2.4.5'
@@ -6982,6 +4869,77 @@ macro_revision='2.4.3'
ltmain=$ac_aux_dir/ltmain.sh
+# 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
+
+
# Backslashify metacharacters that are still active within
# double-quoted strings.
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
@@ -8137,6 +6095,9 @@ sysv4 | sysv4.3*)
tpf*)
lt_cv_deplibs_check_method=pass_all
;;
+os2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
esac
fi
@@ -9184,6 +7145,21 @@ $as_echo "$lt_cv_truncate_bin" >&6; }
+
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+ for cc_temp in $*""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+ done
+ func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+
# Check whether --enable-libtool-lock was given.
if test "${enable_libtool_lock+set}" = set; then :
enableval=$enable_libtool_lock;
@@ -10191,6 +8167,41 @@ $as_echo "$lt_cv_ld_force_load" >&6; }
;;
esac
+# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+# string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+# string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+# string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+# "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+# VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+ case x$2 in
+ x)
+ ;;
+ *:)
+ eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \S|@1\"
+ ;;
+ x:*)
+ eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
+ ;;
+ *::*)
+ eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+ eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
+ ;;
+ *)
+ eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
+ ;;
+ esac
+}
+
for ac_header in dlfcn.h
do :
ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
@@ -10310,6 +8321,58 @@ fi
+ shared_archive_member_spec=
+case $host,$enable_shared in
+power*-*-aix[5-9]*,yes)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5
+$as_echo_n "checking which variant of shared library versioning to provide... " >&6; }
+
+# Check whether --with-aix-soname was given.
+if test "${with_aix_soname+set}" = set; then :
+ withval=$with_aix_soname; case $withval in
+ aix|svr4|both)
+ ;;
+ *)
+ as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5
+ ;;
+ esac
+ lt_cv_with_aix_soname=$with_aix_soname
+else
+ if ${lt_cv_with_aix_soname+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_with_aix_soname=aix
+fi
+
+ with_aix_soname=$lt_cv_with_aix_soname
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5
+$as_echo "$with_aix_soname" >&6; }
+ if test aix != "$with_aix_soname"; then
+ # For the AIX way of multilib, we name the shared archive member
+ # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
+ # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
+ # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
+ # the AIX toolchain works better with OBJECT_MODE set (default 32).
+ if test 64 = "${OBJECT_MODE-32}"; then
+ shared_archive_member_spec=shr_64
+ else
+ shared_archive_member_spec=shr
+ fi
+ fi
+ ;;
+*)
+ with_aix_soname=aix
+ ;;
+esac
+
+
+
+
+
+
+
@@ -10429,15 +8492,8 @@ test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
test -z "$LD" && LD=ld
test -z "$ac_objext" && ac_objext=o
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+func_cc_basename $compiler
+cc_basename=$func_cc_basename_result
# Only perform the check for file, if the check method requires it
@@ -10748,6 +8804,11 @@ lt_prog_compiler_static=
# Although the cygwin gcc ignores -fPIC, still need this for old-style
# (--disable-auto-import) libraries
lt_prog_compiler_pic='-DDLL_EXPORT'
+ case $host_os in
+ os2*)
+ lt_prog_compiler_static='$wl-static'
+ ;;
+ esac
;;
darwin* | rhapsody*)
@@ -10844,6 +8905,11 @@ lt_prog_compiler_static=
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
lt_prog_compiler_pic='-DDLL_EXPORT'
+ case $host_os in
+ os2*)
+ lt_prog_compiler_static='$wl-static'
+ ;;
+ esac
;;
hpux9* | hpux10* | hpux11*)
@@ -11484,6 +9550,34 @@ _LT_EOF
link_all_deplibs=yes
;;
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ allow_undefined_flag=unsupported
+ shrext_cmds=.dll
+ archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ prefix_cmds="$SED"~
+ if test EXPORTS = "`$SED 1q $export_symbols`"; then
+ prefix_cmds="$prefix_cmds -e 1d";
+ fi~
+ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ enable_shared_with_static_runtimes=yes
+ ;;
+
interix[3-9]*)
hardcode_direct=no
hardcode_shlibpath_var=no
@@ -11557,6 +9651,9 @@ _LT_EOF
fi
case $cc_basename in
+ tcc*)
+ export_dynamic_flag_spec='-rdynamic'
+ ;;
xlf* | bgf* | bgxlf* | mpixlf*)
# IBM XL Fortran 10.1 on PPC cannot create shared libs itself
whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
@@ -11686,19 +9783,35 @@ _LT_EOF
no_entry_flag=
else
# If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- # Also, AIX nm treats weak defined symbols like other global
- # defined symbols, whereas GNU nm marks them as "W".
+ # -C means demangle to GNU nm, but means don't demangle to AIX nm.
+ # Without the "-l" option, or with the "-B" option, AIX nm treats
+ # weak defined symbols like other global defined symbols, whereas
+ # GNU nm marks them as "W".
+ # While the 'weak' keyword is ignored in the Export File, we need
+ # it in the Import File for the 'aix-soname' feature, so we have
+ # to replace the "-B" option with "-P" for AIX nm.
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
- export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else
- export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
fi
aix_use_runtimelinking=no
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
+ # have runtime linking enabled, and use it for executables.
+ # For shared libraries, we enable/disable runtime linking
+ # depending on the kind of the shared library created -
+ # when "with_aix_soname,aix_use_runtimelinking" is:
+ # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
+ # "aix,yes" lib.so shared, rtl:yes, for executables
+ # lib.a static archive
+ # "both,no" lib.so.V(shr.o) shared, rtl:yes
+ # lib.a(lib.so.V) shared, rtl:no, for executables
+ # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+ # lib.a(lib.so.V) shared, rtl:no
+ # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
+ # lib.a static archive
case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
for ld_flag in $LDFLAGS; do
if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
@@ -11706,6 +9819,13 @@ _LT_EOF
break
fi
done
+ if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+ # With aix-soname=svr4, we create the lib.so.V shared archives only,
+ # so we don't have lib.a shared libs to link our executables.
+ # We have to force runtime linking in this case.
+ aix_use_runtimelinking=yes
+ LDFLAGS="$LDFLAGS -Wl,-brtl"
+ fi
;;
esac
@@ -11725,6 +9845,14 @@ _LT_EOF
hardcode_libdir_separator=':'
link_all_deplibs=yes
file_list_spec='$wl-f,'
+ case $with_aix_soname,$aix_use_runtimelinking in
+ aix,*) ;; # traditional, no import file
+ svr4,* | *,yes) # use import file
+ # The Import File defines what to hardcode.
+ hardcode_direct=no
+ hardcode_direct_absolute=no
+ ;;
+ esac
if test yes = "$GCC"; then
case $host_os in aix4.[012]|aix4.[012].*)
@@ -11752,6 +9880,11 @@ _LT_EOF
if test yes = "$aix_use_runtimelinking"; then
shared_flag="$shared_flag "'$wl-G'
fi
+ # Need to ensure runtime linking is disabled for the traditional
+ # shared library, or the linker may eventually find shared libraries
+ # /with/ Import File - we do not want to mix them.
+ shared_flag_aix='-shared'
+ shared_flag_svr4='-shared $wl-G'
else
# not using gcc
if test ia64 = "$host_cpu"; then
@@ -11764,6 +9897,8 @@ _LT_EOF
else
shared_flag='$wl-bM:SRE'
fi
+ shared_flag_aix='$wl-bM:SRE'
+ shared_flag_svr4='$wl-G'
fi
fi
@@ -11771,7 +9906,7 @@ _LT_EOF
# It seems that -bexpall does not export symbols beginning with
# underscore (_), so it is better to generate a list of symbols to export.
always_export_symbols=yes
- if test yes = "$aix_use_runtimelinking"; then
+ if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
# Warning - without using the other runtime loading flags (-brtl),
# -berok will link without error, but may produce a broken library.
allow_undefined_flag='-berok'
@@ -11886,8 +10021,20 @@ fi
whole_archive_flag_spec='$convenience'
fi
archive_cmds_need_lc=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $wl-bnoentry $compiler_flags $wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+ # -brtl affects multiple linker settings, -berok does not and is overridden later
+ compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`'
+ if test svr4 != "$with_aix_soname"; then
+ # This is similar to how AIX traditionally builds its shared libraries.
+ archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+ fi
+ if test aix != "$with_aix_soname"; then
+ archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
+ else
+ # used by -dlpreopen to get the symbols
+ archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
+ fi
+ archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d'
fi
fi
;;
@@ -12206,6 +10353,16 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
link_all_deplibs=yes
;;
+ linux*)
+ case $cc_basename in
+ tcc*)
+ # Fabrice Bellard et al's Tiny C Compiler
+ ld_shlibs=yes
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
@@ -12251,8 +10408,28 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
allow_undefined_flag=unsupported
- archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ shrext_cmds=.dll
+ archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ prefix_cmds="$SED"~
+ if test EXPORTS = "`$SED 1q $export_symbols`"; then
+ prefix_cmds="$prefix_cmds -e 1d";
+ fi~
+ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ enable_shared_with_static_runtimes=yes
;;
osf3*)
@@ -12775,6 +10952,8 @@ hardcode_into_libs=no
# flags to be left without arguments
need_version=unknown
+
+
case $host_os in
aix3*)
version_type=linux # correct to gnu/linux during the next big refactor
@@ -12811,20 +10990,70 @@ aix[4-9]*)
fi
;;
esac
+ # Using Import Files as archive members, it is possible to support
+ # filename-based versioning of shared library archives on AIX. While
+ # this would work for both with and without runtime linking, it will
+ # prevent static linking of such archives. So we do filename-based
+ # shared library versioning with .so extension only, which is used
+ # when both runtime linking and shared linking is enabled.
+ # Unfortunately, runtime linking may impact performance, so we do
+ # not want this to be the default eventually. Also, we use the
+ # versioned .so libs for executables only if there is the -brtl
+ # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+ # To allow for filename-based versioning support, we need to create
+ # libNAME.so.V as an archive file, containing:
+ # *) an Import File, referring to the versioned filename of the
+ # archive as well as the shared archive member, telling the
+ # bitwidth (32 or 64) of that shared object, and providing the
+ # list of exported symbols of that shared object, eventually
+ # decorated with the 'weak' keyword
+ # *) the shared object with the F_LOADONLY flag set, to really avoid
+ # it being seen by the linker.
+ # At run time we better use the real file rather than another symlink,
+ # but for link time we create the symlink libNAME.so -> libNAME.so.V
+
+ case $with_aix_soname,$aix_use_runtimelinking in
# AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
# soname into executable. Probably we can add versioning support to
# collect2, so additional links can be useful in future.
- if test yes = "$aix_use_runtimelinking"; then
+ aix,yes) # traditional libtool
+ dynamic_linker='AIX unversionable lib.so'
# If using run time linking (on AIX 4.2 or later) use lib<name>.so
# instead of lib<name>.a to let people know that these are not
# typical AIX shared libraries.
library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- else
+ ;;
+ aix,no) # traditional AIX only
+ dynamic_linker='AIX lib.a(lib.so.V)'
# We preserve .a as extension for shared libraries through AIX4.2
# and later when we are not doing run time linking.
library_names_spec='$libname$release.a $libname.a'
soname_spec='$libname$release$shared_ext$major'
- fi
+ ;;
+ svr4,*) # full svr4 only
+ dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)"
+ library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+ # We do not specify a path in Import Files, so LIBPATH fires.
+ shlibpath_overrides_runpath=yes
+ ;;
+ *,yes) # both, prefer svr4
+ dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)"
+ library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+ # unpreferred sharedlib libNAME.a needs extra handling
+ postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
+ postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
+ # We do not specify a path in Import Files, so LIBPATH fires.
+ shlibpath_overrides_runpath=yes
+ ;;
+ *,no) # both, prefer aix
+ dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)"
+ library_names_spec='$libname$release.a $libname.a'
+ soname_spec='$libname$release$shared_ext$major'
+ # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
+ postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
+ postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
+ ;;
+ esac
shlibpath_var=LIBPATH
fi
;;
@@ -13012,7 +11241,8 @@ freebsd* | dragonfly*)
version_type=freebsd-$objformat
case $version_type in
freebsd-elf*)
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
need_version=no
need_lib_prefix=no
;;
@@ -13072,10 +11302,11 @@ hpux9* | hpux10* | hpux11*)
soname_spec='$libname$release$shared_ext$major'
if test 32 = "$HPUX_IA64_MODE"; then
sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ sys_lib_dlsearch_path_spec=/usr/lib/hpux32
else
sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ sys_lib_dlsearch_path_spec=/usr/lib/hpux64
fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
;;
hppa*64*)
shrext_cmds='.sl'
@@ -13227,7 +11458,12 @@ fi
# before this can be enabled.
hardcode_into_libs=yes
- # Append ld.so.conf contents to the search path
+ # Ideally, we could use ldconfig to report *all* directores which are
+ # searched for libraries, however this is still not possible. Aside from not
+ # being certain /sbin/ldconfig is available, command
+ # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
+ # even though it is searched at run-time. Try to do the best guess by
+ # appending ld.so.conf contents (and includes) to the search path.
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
@@ -13296,11 +11532,32 @@ openbsd* | bitrig*)
os2*)
libname_spec='$name'
+ version_type=windows
shrext_cmds=.dll
+ need_version=no
need_lib_prefix=no
- library_names_spec='$libname$shared_ext $libname.a'
+ # OS/2 can only load a DLL with a base name of 8 characters or less.
+ soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
+ v=$($ECHO $release$versuffix | tr -d .-);
+ n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
+ $ECHO $n$v`$shared_ext'
+ library_names_spec='${libname}_dll.$libext'
dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
+ shlibpath_var=BEGINLIBPATH
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
;;
osf3* | osf4* | osf5*)
@@ -13376,7 +11633,7 @@ sysv4*MP*)
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
+ version_type=sco
need_lib_prefix=no
need_version=no
library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
@@ -13431,10 +11688,18 @@ fi
if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
fi
+
if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
fi
+# lt_cv_sys_lib... is unaugmented for libtool script decls...
+lt_cv_sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec
+
+# ..but sys_lib_... needs LT_SYS_LIBRARY_PATH munging for
+# LT_SYS_DLSEARCH_PATH macro in ltdl.m4 to work with the correct paths:
+func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
+
@@ -13905,7 +12170,7 @@ else
# endif
#endif
-/* When -fvisbility=hidden is used, assume the code has been annotated
+/* When -fvisibility=hidden is used, assume the code has been annotated
correspondingly for the symbols needed. */
#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
int fnord () __attribute__((visibility("default")));
@@ -14011,7 +12276,7 @@ else
# endif
#endif
-/* When -fvisbility=hidden is used, assume the code has been annotated
+/* When -fvisibility=hidden is used, assume the code has been annotated
correspondingly for the symbols needed. */
#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
int fnord () __attribute__((visibility("default")));
@@ -14160,8 +12425,12 @@ $as_echo_n "checking whether to build shared libraries... " >&6; }
;;
aix[4-9]*)
- if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then
- test yes = "$enable_shared" && enable_static=no
+ if test ia64 != "$host_cpu"; then
+ case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+ yes,aix,yes) ;; # shared object as lib.so file only
+ yes,svr4,*) ;; # shared object as lib.so archive member only
+ yes,*) enable_static=no ;; # shared object in lib.a archive as well
+ esac
fi
;;
esac
@@ -15386,13 +13655,6 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
# INIT-COMMANDS
#
AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
-# Capture the value of obsolete ALL_LINGUAS because we need it to compute
- # 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%}"
-
# The HP-UX ksh and POSIX shell print the target directory to stdout
@@ -15408,6 +13670,7 @@ macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`'
SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
@@ -15528,7 +13791,7 @@ finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
-sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_lib_dlsearch_path_spec='`$ECHO "$lt_cv_sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
@@ -15646,7 +13909,7 @@ postinstall_cmds \
postuninstall_cmds \
finish_cmds \
sys_lib_search_path_spec \
-sys_lib_dlsearch_path_spec; do
+lt_cv_sys_lib_dlsearch_path_spec; do
case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
*[\\\\\\\`\\"\\\$]*)
eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
@@ -15683,7 +13946,6 @@ for ac_config_target in $ac_config_targets
do
case $ac_config_target in
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
- "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;;
"libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h:configh.in" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
@@ -16375,119 +14637,6 @@ $as_echo X"$file" |
done
}
;;
- "po-directories":C)
- for ac_file in $CONFIG_FILES; do
- # Support "outfile[:infile[:infile...]]"
- case "$ac_file" in
- *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- esac
- # PO directories have a Makefile.in generated from Makefile.in.in.
- case "$ac_file" in */Makefile.in)
- # Adjust a relative srcdir.
- ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
- ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
- ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
- # In autoconf-2.13 it is called $ac_given_srcdir.
- # In autoconf-2.50 it is called $srcdir.
- test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
- case "$ac_given_srcdir" in
- .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
- /*) top_srcdir="$ac_given_srcdir" ;;
- *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
- esac
- # Treat a directory as a PO directory if and only if it has a
- # POTFILES.in file. This allows packages to have multiple PO
- # directories under different names or in different locations.
- if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
- rm -f "$ac_dir/POTFILES"
- test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
- cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
- POMAKEFILEDEPS="POTFILES.in"
- # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
- # on $ac_dir but don't depend on user-specified configuration
- # parameters.
- if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
- # The LINGUAS file contains the set of available languages.
- 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"`
- # Hide the ALL_LINGUAS assigment from automake < 1.5.
- eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
- POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
- else
- # The set of available languages was given in configure.in.
- # Hide the ALL_LINGUAS assigment from automake < 1.5.
- eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
- fi
- # Compute POFILES
- # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
- # Compute UPDATEPOFILES
- # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
- # Compute DUMMYPOFILES
- # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
- # Compute GMOFILES
- # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
- case "$ac_given_srcdir" in
- .) srcdirpre= ;;
- *) srcdirpre='$(srcdir)/' ;;
- esac
- POFILES=
- UPDATEPOFILES=
- DUMMYPOFILES=
- GMOFILES=
- for lang in $ALL_LINGUAS; do
- POFILES="$POFILES $srcdirpre$lang.po"
- UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
- DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
- GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
- done
- # CATALOGS depends on both $ac_dir and the user's LINGUAS
- # environment variable.
- INST_LINGUAS=
- if test -n "$ALL_LINGUAS"; then
- for presentlang in $ALL_LINGUAS; do
- useit=no
- if test "%UNSET%" != "$LINGUAS"; then
- desiredlanguages="$LINGUAS"
- else
- desiredlanguages="$ALL_LINGUAS"
- fi
- for desiredlang in $desiredlanguages; do
- # Use the presentlang catalog if desiredlang is
- # a. equal to presentlang, or
- # b. a variant of presentlang (because in this case,
- # presentlang can be used as a fallback for messages
- # which are not translated in the desiredlang catalog).
- case "$desiredlang" in
- "$presentlang"*) useit=yes;;
- esac
- done
- if test $useit = yes; then
- INST_LINGUAS="$INST_LINGUAS $presentlang"
- fi
- done
- fi
- CATALOGS=
- if test -n "$INST_LINGUAS"; then
- for lang in $INST_LINGUAS; do
- CATALOGS="$CATALOGS $lang.gmo"
- done
- fi
- test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
- sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
- for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
- if test -f "$f"; then
- case "$f" in
- *.orig | *.bak | *~) ;;
- *) cat "$f" >> "$ac_dir/Makefile" ;;
- esac
- fi
- done
- fi
- ;;
- esac
- done ;;
"libtool":C)
# See if we are running on zsh, and set the options that allow our
@@ -16535,6 +14684,9 @@ $as_echo X"$file" |
# The names of the tagged configurations supported by this script.
available_tags=''
+# Configured defaults for sys_lib_dlsearch_path munging.
+: \${LT_SYS_LIBRARY_PATH="$LT_SYS_LIBRARY_PATH"}
+
# ### BEGIN LIBTOOL CONFIG
# Whether or not to build static libraries.
@@ -16553,6 +14705,9 @@ pic_mode=$pic_mode
# Whether or not to optimize for fast installation.
fast_install=$enable_fast_install
+# Shared archive member basename,for filename based shared library versioning on AIX.
+shared_archive_member_spec=$shared_archive_member_spec
+
# Shell to use when invoking shell scripts.
SHELL=$lt_SHELL
@@ -16782,7 +14937,7 @@ hardcode_into_libs=$hardcode_into_libs
sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
# Run-time system search path for libraries.
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+sys_lib_dlsearch_path_spec=$lt_lt_cv_sys_lib_dlsearch_path_spec
# Whether dlopen is supported.
dlopen_support=$enable_dlopen
@@ -16933,6 +15088,64 @@ hardcode_action=$hardcode_action
_LT_EOF
+ cat <<'_LT_EOF' >> "$cfgfile"
+## -------------------------------------- ##
+## Shell functions shared with configure. ##
+## -------------------------------------- ##
+
+# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+# string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+# string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+# string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+# "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+# VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+ case x$2 in
+ x)
+ ;;
+ *:)
+ eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \S|@1\"
+ ;;
+ x:*)
+ eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
+ ;;
+ *::*)
+ eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+ eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
+ ;;
+ *)
+ eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
+ ;;
+ esac
+}
+
+
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+ for cc_temp in $*""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+ done
+ func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+
+
+_LT_EOF
+
case $host_os in
aix3*)
cat <<\_LT_EOF >> "$cfgfile"
diff --git a/extension/configure.ac b/extension/configure.ac
index 1f876a0e..6a516cbc 100644
--- a/extension/configure.ac
+++ b/extension/configure.ac
@@ -33,10 +33,7 @@ AC_USE_SYSTEM_EXTENSIONS
INSTALL="$ac_aux_dir/install-sh -c"
export INSTALL
-AM_INIT_AUTOMAKE([-Wall -Werror])
-
-AM_GNU_GETTEXT([external])
-AM_GNU_GETTEXT_VERSION([0.18.1])
+AM_INIT_AUTOMAKE([1.15 -Wall -Werror])
dnl checks for structure members
AC_CHECK_MEMBERS([struct stat.st_blksize])
diff --git a/extension/m4/ChangeLog b/extension/m4/ChangeLog
index 349bbcc8..f991eac3 100644
--- a/extension/m4/ChangeLog
+++ b/extension/m4/ChangeLog
@@ -1,3 +1,7 @@
+2015-01-24 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gettext.m4, iconv.m4, intlmacosx.m4, po.m4: Removed.
+
2014-04-08 Arnold D. Robbins <arnold@skeeve.com>
* 4.1.1: Release tar ball made.
diff --git a/extension/m4/gettext.m4 b/extension/m4/gettext.m4
deleted file mode 100644
index f84e6a5d..00000000
--- a/extension/m4/gettext.m4
+++ /dev/null
@@ -1,383 +0,0 @@
-# gettext.m4 serial 63 (gettext-0.18)
-dnl Copyright (C) 1995-2010 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-dnl
-dnl This file can can be used in projects which are not available under
-dnl the GNU General Public License or the GNU Library General Public
-dnl License but which still want to provide support for the GNU gettext
-dnl functionality.
-dnl Please note that the actual code of the GNU gettext library is covered
-dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package package is covered by the GNU General Public License.
-dnl They are *not* in the public domain.
-
-dnl Authors:
-dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
-dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010.
-
-dnl Macro to add for using GNU gettext.
-
-dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
-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). 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
-dnl 'need-formatstring-macros', then GNU gettext implementations that don't
-dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
-dnl INTLDIR is used to find the intl libraries. If empty,
-dnl the value `$(top_builddir)/intl/' is used.
-dnl
-dnl The result of the configuration is one of three cases:
-dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
-dnl and used.
-dnl Catalog format: GNU --> install in $(datadir)
-dnl Catalog extension: .mo after installation, .gmo in source tree
-dnl 2) GNU gettext has been found in the system's C library.
-dnl Catalog format: GNU --> install in $(datadir)
-dnl Catalog extension: .mo after installation, .gmo in source tree
-dnl 3) No internationalization, always use English msgid.
-dnl Catalog format: none
-dnl Catalog extension: none
-dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
-dnl The use of .gmo is historical (it was needed to avoid overwriting the
-dnl GNU format catalogs when building on a platform with an X/Open gettext),
-dnl but we keep it in order not to force irrelevant filename changes on the
-dnl maintainers.
-dnl
-AC_DEFUN([AM_GNU_GETTEXT],
-[
- dnl Argument checking.
- 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],
- [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],
- 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])
-
- AC_REQUIRE([AM_PO_SUBDIRS])dnl
- ifelse(gt_included_intl, yes, [
- AC_REQUIRE([AM_INTL_SUBDIR])dnl
- ])
-
- dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
- AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
- AC_REQUIRE([AC_LIB_RPATH])
-
- dnl Sometimes libintl requires libiconv, so first search for libiconv.
- dnl Ideally we would do this search only after the
- dnl if test "$USE_NLS" = "yes"; then
- dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
- dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
- dnl the configure script would need to contain the same shell code
- 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 only in autoconf >= 2.52 and not
- dnl documented, we avoid it.
- ifelse(gt_included_intl, yes, , [
- AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
- ])
-
- dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation.
- gt_INTL_MACOSX
-
- dnl Set USE_NLS.
- AC_REQUIRE([AM_NLS])
-
- ifelse(gt_included_intl, yes, [
- BUILD_INCLUDED_LIBINTL=no
- USE_INCLUDED_LIBINTL=no
- ])
- LIBINTL=
- LTLIBINTL=
- POSUB=
-
- dnl Add a version number to the cache macros.
- case " $gt_needs " in
- *" need-formatstring-macros "*) gt_api_version=3 ;;
- *" need-ngettext "*) gt_api_version=2 ;;
- *) gt_api_version=1 ;;
- esac
- gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
- gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
-
- dnl If we use NLS figure out what method
- if test "$USE_NLS" = "yes"; then
- gt_use_preinstalled_gnugettext=no
- ifelse(gt_included_intl, yes, [
- AC_MSG_CHECKING([whether included gettext is requested])
- AC_ARG_WITH([included-gettext],
- [ --with-included-gettext use the GNU gettext library included here],
- nls_cv_force_use_gnu_gettext=$withval,
- nls_cv_force_use_gnu_gettext=no)
- AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext])
-
- nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
- if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
- ])
- dnl User does not insist on using GNU NLS library. Figure out what
- dnl to use. If GNU gettext is available we use this. Else we have
- dnl to fall back to GNU NLS library.
-
- if test $gt_api_version -ge 3; then
- gt_revision_test_code='
-#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
-#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
-#endif
-changequote(,)dnl
-typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
-changequote([,])dnl
-'
- else
- gt_revision_test_code=
- fi
- if test $gt_api_version -ge 2; then
- gt_expression_test_code=' + * ngettext ("", "", 0)'
- else
- gt_expression_test_code=
- fi
-
- AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
- [AC_TRY_LINK([#include <libintl.h>
-$gt_revision_test_code
-extern int _nl_msg_cat_cntr;
-extern int *_nl_domain_bindings;],
- [bindtextdomain ("", "");
-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"])])
-
- if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
- dnl Sometimes libintl requires libiconv, so first search for libiconv.
- ifelse(gt_included_intl, yes, , [
- AM_ICONV_LINK
- ])
- dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
- dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
- dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
- dnl even if libiconv doesn't exist.
- AC_LIB_LINKFLAGS_BODY([intl])
- AC_CACHE_CHECK([for GNU gettext in libintl],
- [$gt_func_gnugettext_libintl],
- [gt_save_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $INCINTL"
- gt_save_LIBS="$LIBS"
- LIBS="$LIBS $LIBINTL"
- dnl Now see whether libintl exists and does not depend on libiconv.
- AC_TRY_LINK([#include <libintl.h>
-$gt_revision_test_code
-extern int _nl_msg_cat_cntr;
-extern
-#ifdef __cplusplus
-"C"
-#endif
-const char *_nl_expand_alias (const char *);],
- [bindtextdomain ("", "");
-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"])
- dnl Now see whether libintl exists and depends on libiconv.
- if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
- LIBS="$LIBS $LIBICONV"
- AC_TRY_LINK([#include <libintl.h>
-$gt_revision_test_code
-extern int _nl_msg_cat_cntr;
-extern
-#ifdef __cplusplus
-"C"
-#endif
-const char *_nl_expand_alias (const char *);],
- [bindtextdomain ("", "");
-return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")],
- [LIBINTL="$LIBINTL $LIBICONV"
- LTLIBINTL="$LTLIBINTL $LTLIBICONV"
- eval "$gt_func_gnugettext_libintl=yes"
- ])
- fi
- CPPFLAGS="$gt_save_CPPFLAGS"
- LIBS="$gt_save_LIBS"])
- fi
-
- dnl If an already present or preinstalled GNU gettext() is found,
- dnl use it. But if this macro is used in GNU gettext, and GNU
- dnl gettext is already preinstalled in libintl, we update this
- dnl libintl. (Cf. the install rule in intl/Makefile.in.)
- if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
- || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
- && test "$PACKAGE" != gettext-runtime \
- && test "$PACKAGE" != gettext-tools; }; then
- gt_use_preinstalled_gnugettext=yes
- else
- dnl Reset the values set by searching for libintl.
- LIBINTL=
- LTLIBINTL=
- INCINTL=
- fi
-
- ifelse(gt_included_intl, yes, [
- if test "$gt_use_preinstalled_gnugettext" != "yes"; then
- dnl GNU gettext is not found in the C library.
- dnl Fall back on included GNU gettext library.
- nls_cv_use_gnu_gettext=yes
- fi
- fi
-
- if test "$nls_cv_use_gnu_gettext" = "yes"; then
- 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.[]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
-
- CATOBJEXT=
- if test "$gt_use_preinstalled_gnugettext" = "yes" \
- || test "$nls_cv_use_gnu_gettext" = "yes"; then
- dnl Mark actions to use GNU gettext tools.
- CATOBJEXT=.gmo
- fi
- ])
-
- if test -n "$INTL_MACOSX_LIBS"; then
- if test "$gt_use_preinstalled_gnugettext" = "yes" \
- || test "$nls_cv_use_gnu_gettext" = "yes"; then
- dnl Some extra flags are needed during linking.
- LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
- LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
- fi
- fi
-
- if test "$gt_use_preinstalled_gnugettext" = "yes" \
- || test "$nls_cv_use_gnu_gettext" = "yes"; then
- AC_DEFINE([ENABLE_NLS], [1],
- [Define to 1 if translation of program messages to the user's native language
- is requested.])
- else
- USE_NLS=no
- fi
- fi
-
- AC_MSG_CHECKING([whether to use NLS])
- AC_MSG_RESULT([$USE_NLS])
- if test "$USE_NLS" = "yes"; then
- AC_MSG_CHECKING([where the gettext function comes from])
- if test "$gt_use_preinstalled_gnugettext" = "yes"; then
- if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
- gt_source="external libintl"
- else
- gt_source="libc"
- fi
- else
- gt_source="included intl directory"
- fi
- AC_MSG_RESULT([$gt_source])
- fi
-
- if test "$USE_NLS" = "yes"; then
-
- if test "$gt_use_preinstalled_gnugettext" = "yes"; then
- if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
- AC_MSG_CHECKING([how to link with libintl])
- AC_MSG_RESULT([$LIBINTL])
- AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
- fi
-
- dnl For backward compatibility. Some packages may be using this.
- AC_DEFINE([HAVE_GETTEXT], [1],
- [Define if the GNU gettext() function is already present or preinstalled.])
- AC_DEFINE([HAVE_DCGETTEXT], [1],
- [Define if the GNU dcgettext() function is already present or preinstalled.])
- fi
-
- dnl We need to process the po/ directory.
- POSUB=po
- fi
-
- ifelse(gt_included_intl, 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.
- INTLLIBS="$LIBINTL"
- AC_SUBST([INTLLIBS])
-
- dnl Make all documented variables known to autoconf.
- AC_SUBST([LIBINTL])
- AC_SUBST([LTLIBINTL])
- AC_SUBST([POSUB])
-])
-
-
-dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
-m4_define([gt_NEEDS_INIT],
-[
- m4_divert_text([DEFAULTS], [gt_needs=])
- m4_define([gt_NEEDS_INIT], [])
-])
-
-
-dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
-AC_DEFUN([AM_GNU_GETTEXT_NEED],
-[
- m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
-])
-
-
-dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
-AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
diff --git a/extension/m4/iconv.m4 b/extension/m4/iconv.m4
deleted file mode 100644
index e2041b9b..00000000
--- a/extension/m4/iconv.m4
+++ /dev/null
@@ -1,214 +0,0 @@
-# iconv.m4 serial 11 (gettext-0.18.1)
-dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc.
-dnl This file is free software; the Free 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([AM_ICONV_LINKFLAGS_BODY],
-[
- dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
- AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
- AC_REQUIRE([AC_LIB_RPATH])
-
- dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
- dnl accordingly.
- AC_LIB_LINKFLAGS_BODY([iconv])
-])
-
-AC_DEFUN([AM_ICONV_LINK],
-[
- dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
- dnl those with the standalone portable GNU libiconv installed).
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
-
- dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
- dnl accordingly.
- AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
-
- dnl Add $INCICONV to CPPFLAGS before performing the following checks,
- dnl because if the user has installed libiconv and not disabled its use
- dnl via --without-libiconv-prefix, he wants to use it. The first
- dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
- am_save_CPPFLAGS="$CPPFLAGS"
- AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
-
- AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
- am_cv_func_iconv="no, consider installing GNU libiconv"
- am_cv_lib_iconv=no
- AC_TRY_LINK([#include <stdlib.h>
-#include <iconv.h>],
- [iconv_t cd = iconv_open("","");
- iconv(cd,NULL,NULL,NULL,NULL);
- iconv_close(cd);],
- [am_cv_func_iconv=yes])
- if test "$am_cv_func_iconv" != yes; then
- am_save_LIBS="$LIBS"
- LIBS="$LIBS $LIBICONV"
- AC_TRY_LINK([#include <stdlib.h>
-#include <iconv.h>],
- [iconv_t cd = iconv_open("","");
- iconv(cd,NULL,NULL,NULL,NULL);
- iconv_close(cd);],
- [am_cv_lib_iconv=yes]
- [am_cv_func_iconv=yes])
- LIBS="$am_save_LIBS"
- fi
- ])
- if test "$am_cv_func_iconv" = yes; then
- AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
- dnl This tests against bugs in AIX 5.1, HP-UX 11.11, Solaris 10.
- am_save_LIBS="$LIBS"
- if test $am_cv_lib_iconv = yes; then
- LIBS="$LIBS $LIBICONV"
- fi
- AC_TRY_RUN([
-#include <iconv.h>
-#include <string.h>
-int main ()
-{
- /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
- returns. */
- {
- iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
- if (cd_utf8_to_88591 != (iconv_t)(-1))
- {
- static const char input[] = "\342\202\254"; /* EURO SIGN */
- char buf[10];
- const char *inptr = input;
- size_t inbytesleft = strlen (input);
- char *outptr = buf;
- size_t outbytesleft = sizeof (buf);
- size_t res = iconv (cd_utf8_to_88591,
- (char **) &inptr, &inbytesleft,
- &outptr, &outbytesleft);
- if (res == 0)
- return 1;
- }
- }
- /* Test against Solaris 10 bug: Failures are not distinguishable from
- successful returns. */
- {
- iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
- if (cd_ascii_to_88591 != (iconv_t)(-1))
- {
- static const char input[] = "\263";
- char buf[10];
- const char *inptr = input;
- size_t inbytesleft = strlen (input);
- char *outptr = buf;
- size_t outbytesleft = sizeof (buf);
- size_t res = iconv (cd_ascii_to_88591,
- (char **) &inptr, &inbytesleft,
- &outptr, &outbytesleft);
- if (res == 0)
- return 1;
- }
- }
-#if 0 /* This bug could be worked around by the caller. */
- /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */
- {
- iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
- if (cd_88591_to_utf8 != (iconv_t)(-1))
- {
- static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
- char buf[50];
- const char *inptr = input;
- size_t inbytesleft = strlen (input);
- char *outptr = buf;
- size_t outbytesleft = sizeof (buf);
- size_t res = iconv (cd_88591_to_utf8,
- (char **) &inptr, &inbytesleft,
- &outptr, &outbytesleft);
- if ((int)res > 0)
- return 1;
- }
- }
-#endif
- /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
- provided. */
- if (/* Try standardized names. */
- iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
- /* Try IRIX, OSF/1 names. */
- && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
- /* Try AIX names. */
- && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
- /* Try HP-UX names. */
- && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
- return 1;
- return 0;
-}], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no],
- [case "$host_os" in
- aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
- *) am_cv_func_iconv_works="guessing yes" ;;
- esac])
- LIBS="$am_save_LIBS"
- ])
- case "$am_cv_func_iconv_works" in
- *no) am_func_iconv=no am_cv_lib_iconv=no ;;
- *) am_func_iconv=yes ;;
- esac
- else
- am_func_iconv=no am_cv_lib_iconv=no
- fi
- if test "$am_func_iconv" = yes; then
- AC_DEFINE([HAVE_ICONV], [1],
- [Define if you have the iconv() function and it works.])
- fi
- if test "$am_cv_lib_iconv" = yes; then
- AC_MSG_CHECKING([how to link with libiconv])
- AC_MSG_RESULT([$LIBICONV])
- else
- dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
- dnl either.
- CPPFLAGS="$am_save_CPPFLAGS"
- LIBICONV=
- LTLIBICONV=
- fi
- AC_SUBST([LIBICONV])
- AC_SUBST([LTLIBICONV])
-])
-
-dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
-dnl 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.
-dnl Otherwise aclocal's initial scan pass would miss the macro definition.
-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])]],
- [[AC_DEFUN(
- [$1], [$2])]]))
-gl_iconv_AC_DEFUN([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_TRY_COMPILE([
-#include <stdlib.h>
-#include <iconv.h>
-extern
-#ifdef __cplusplus
-"C"
-#endif
-#if defined(__STDC__) || 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])
- AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
- [Define as const if the declaration of iconv() needs const.])
- fi
-])
diff --git a/extension/m4/intlmacosx.m4 b/extension/m4/intlmacosx.m4
deleted file mode 100644
index dd910259..00000000
--- a/extension/m4/intlmacosx.m4
+++ /dev/null
@@ -1,51 +0,0 @@
-# intlmacosx.m4 serial 3 (gettext-0.18)
-dnl Copyright (C) 2004-2010 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-dnl
-dnl This file can can be used in projects which are not available under
-dnl the GNU General Public License or the GNU Library General Public
-dnl License but which still want to provide support for the GNU gettext
-dnl functionality.
-dnl Please note that the actual code of the GNU gettext library is covered
-dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package package is covered by the GNU General Public License.
-dnl They are *not* in the public domain.
-
-dnl Checks for special options needed on MacOS X.
-dnl Defines INTL_MACOSX_LIBS.
-AC_DEFUN([gt_INTL_MACOSX],
-[
- dnl Check for API introduced in MacOS X 10.2.
- AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
- [gt_cv_func_CFPreferencesCopyAppValue],
- [gt_save_LIBS="$LIBS"
- LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
- AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
- [CFPreferencesCopyAppValue(NULL, NULL)],
- [gt_cv_func_CFPreferencesCopyAppValue=yes],
- [gt_cv_func_CFPreferencesCopyAppValue=no])
- LIBS="$gt_save_LIBS"])
- if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
- AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
- [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
- fi
- dnl Check for API introduced in MacOS X 10.3.
- AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
- [gt_save_LIBS="$LIBS"
- LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
- AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
- [gt_cv_func_CFLocaleCopyCurrent=yes],
- [gt_cv_func_CFLocaleCopyCurrent=no])
- LIBS="$gt_save_LIBS"])
- if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
- AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
- [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
- fi
- INTL_MACOSX_LIBS=
- if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
- INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
- fi
- AC_SUBST([INTL_MACOSX_LIBS])
-])
diff --git a/extension/m4/libtool.m4 b/extension/m4/libtool.m4
index 068f0d8b..f796d7bc 100644
--- a/extension/m4/libtool.m4
+++ b/extension/m4/libtool.m4
@@ -1,6 +1,6 @@
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
#
-# Copyright (C) 1996-2001, 2003-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
# Written by Gordon Matzigkeit, 1996
#
# This file is free software; the Free Software Foundation gives
@@ -103,19 +103,36 @@ dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+# _LT_PREPARE_CC_BASENAME
+# -----------------------
+m4_defun([_LT_PREPARE_CC_BASENAME], [
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+ for cc_temp in @S|@*""; do
+ case $cc_temp in
+ compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+ distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+ done
+ func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+])# _LT_PREPARE_CC_BASENAME
+
+
# _LT_CC_BASENAME(CC)
# -------------------
-# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
+# but that macro is also expanded into generated libtool script, which
+# arranges for $SED and $ECHO to be set by different means.
m4_defun([_LT_CC_BASENAME],
-[for cc_temp in $1""; do
- case $cc_temp in
- compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
- distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+[m4_require([_LT_PREPARE_CC_BASENAME])dnl
+AC_REQUIRE([_LT_DECL_SED])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+func_cc_basename $1
+cc_basename=$func_cc_basename_result
])
@@ -720,6 +737,9 @@ _LT_CONFIG_SAVE_COMMANDS([
_LT_COPYING
_LT_LIBTOOL_TAGS
+# Configured defaults for sys_lib_dlsearch_path munging.
+: \${LT_SYS_LIBRARY_PATH="$LT_SYS_LIBRARY_PATH"}
+
# ### BEGIN LIBTOOL CONFIG
_LT_LIBTOOL_CONFIG_VARS
_LT_LIBTOOL_TAG_VARS
@@ -727,6 +747,16 @@ _LT_LIBTOOL_TAG_VARS
_LT_EOF
+ cat <<'_LT_EOF' >> "$cfgfile"
+## -------------------------------------- ##
+## Shell functions shared with configure. ##
+## -------------------------------------- ##
+
+_LT_PREPARE_MUNGE_PATH_LIST
+_LT_PREPARE_CC_BASENAME
+
+_LT_EOF
+
case $host_os in
aix3*)
cat <<\_LT_EOF >> "$cfgfile"
@@ -1840,7 +1870,7 @@ else
# endif
#endif
-/* When -fvisbility=hidden is used, assume the code has been annotated
+/* When -fvisibility=hidden is used, assume the code has been annotated
correspondingly for the symbols needed. */
#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
int fnord () __attribute__((visibility("default")));
@@ -2202,6 +2232,47 @@ _LT_DECL([], [striplib], [1])
])# _LT_CMD_STRIPLIB
+# _LT_PREPARE_MUNGE_PATH_LIST
+# ---------------------------
+# Make sure func_munge_path_list() is defined correctly.
+m4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
+[[# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+# string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+# string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+# string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+# "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+# VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+ case x@S|@2 in
+ x)
+ ;;
+ *:)
+ eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \$@S|@1\"
+ ;;
+ x:*)
+ eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
+ ;;
+ *::*)
+ eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+ eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
+ ;;
+ *)
+ eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
+ ;;
+ esac
+}
+]])# _LT_PREPARE_PATH_LIST
+
+
# _LT_SYS_DYNAMIC_LINKER([TAG])
# -----------------------------
# PORTME Fill in your ld.so characteristics
@@ -2212,6 +2283,7 @@ m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_DECL_OBJDUMP])dnl
m4_require([_LT_DECL_SED])dnl
m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
AC_MSG_CHECKING([dynamic linker characteristics])
m4_if([$1],
[], [
@@ -2306,6 +2378,9 @@ hardcode_into_libs=no
# flags to be left without arguments
need_version=unknown
+AC_ARG_VAR([LT_SYS_LIBRARY_PATH],
+[User-defined run-time library search path.])
+
case $host_os in
aix3*)
version_type=linux # correct to gnu/linux during the next big refactor
@@ -2342,20 +2417,70 @@ aix[[4-9]]*)
fi
;;
esac
+ # Using Import Files as archive members, it is possible to support
+ # filename-based versioning of shared library archives on AIX. While
+ # this would work for both with and without runtime linking, it will
+ # prevent static linking of such archives. So we do filename-based
+ # shared library versioning with .so extension only, which is used
+ # when both runtime linking and shared linking is enabled.
+ # Unfortunately, runtime linking may impact performance, so we do
+ # not want this to be the default eventually. Also, we use the
+ # versioned .so libs for executables only if there is the -brtl
+ # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+ # To allow for filename-based versioning support, we need to create
+ # libNAME.so.V as an archive file, containing:
+ # *) an Import File, referring to the versioned filename of the
+ # archive as well as the shared archive member, telling the
+ # bitwidth (32 or 64) of that shared object, and providing the
+ # list of exported symbols of that shared object, eventually
+ # decorated with the 'weak' keyword
+ # *) the shared object with the F_LOADONLY flag set, to really avoid
+ # it being seen by the linker.
+ # At run time we better use the real file rather than another symlink,
+ # but for link time we create the symlink libNAME.so -> libNAME.so.V
+
+ case $with_aix_soname,$aix_use_runtimelinking in
# AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
# soname into executable. Probably we can add versioning support to
# collect2, so additional links can be useful in future.
- if test yes = "$aix_use_runtimelinking"; then
+ aix,yes) # traditional libtool
+ dynamic_linker='AIX unversionable lib.so'
# If using run time linking (on AIX 4.2 or later) use lib<name>.so
# instead of lib<name>.a to let people know that these are not
# typical AIX shared libraries.
library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- else
+ ;;
+ aix,no) # traditional AIX only
+ dynamic_linker='AIX lib.a[(]lib.so.V[)]'
# We preserve .a as extension for shared libraries through AIX4.2
# and later when we are not doing run time linking.
library_names_spec='$libname$release.a $libname.a'
soname_spec='$libname$release$shared_ext$major'
- fi
+ ;;
+ svr4,*) # full svr4 only
+ dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
+ library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+ # We do not specify a path in Import Files, so LIBPATH fires.
+ shlibpath_overrides_runpath=yes
+ ;;
+ *,yes) # both, prefer svr4
+ dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
+ library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+ # unpreferred sharedlib libNAME.a needs extra handling
+ postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
+ postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
+ # We do not specify a path in Import Files, so LIBPATH fires.
+ shlibpath_overrides_runpath=yes
+ ;;
+ *,no) # both, prefer aix
+ dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
+ library_names_spec='$libname$release.a $libname.a'
+ soname_spec='$libname$release$shared_ext$major'
+ # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
+ postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
+ postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
+ ;;
+ esac
shlibpath_var=LIBPATH
fi
;;
@@ -2543,7 +2668,8 @@ freebsd* | dragonfly*)
version_type=freebsd-$objformat
case $version_type in
freebsd-elf*)
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
need_version=no
need_lib_prefix=no
;;
@@ -2603,10 +2729,11 @@ hpux9* | hpux10* | hpux11*)
soname_spec='$libname$release$shared_ext$major'
if test 32 = "$HPUX_IA64_MODE"; then
sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ sys_lib_dlsearch_path_spec=/usr/lib/hpux32
else
sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ sys_lib_dlsearch_path_spec=/usr/lib/hpux64
fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
;;
hppa*64*)
shrext_cmds='.sl'
@@ -2739,7 +2866,12 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
# before this can be enabled.
hardcode_into_libs=yes
- # Append ld.so.conf contents to the search path
+ # Ideally, we could use ldconfig to report *all* directores which are
+ # searched for libraries, however this is still not possible. Aside from not
+ # being certain /sbin/ldconfig is available, command
+ # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
+ # even though it is searched at run-time. Try to do the best guess by
+ # appending ld.so.conf contents (and includes) to the search path.
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
@@ -2808,11 +2940,32 @@ openbsd* | bitrig*)
os2*)
libname_spec='$name'
+ version_type=windows
shrext_cmds=.dll
+ need_version=no
need_lib_prefix=no
- library_names_spec='$libname$shared_ext $libname.a'
+ # OS/2 can only load a DLL with a base name of 8 characters or less.
+ soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
+ v=$($ECHO $release$versuffix | tr -d .-);
+ n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
+ $ECHO $n$v`$shared_ext'
+ library_names_spec='${libname}_dll.$libext'
dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
+ shlibpath_var=BEGINLIBPATH
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
;;
osf3* | osf4* | osf5*)
@@ -2888,7 +3041,7 @@ sysv4*MP*)
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
+ version_type=sco
need_lib_prefix=no
need_version=no
library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
@@ -2942,10 +3095,18 @@ fi
if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
fi
+
if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
fi
+# lt_cv_sys_lib... is unaugmented for libtool script decls...
+lt_cv_sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec
+
+# ..but sys_lib_... needs LT_SYS_LIBRARY_PATH munging for
+# LT_SYS_DLSEARCH_PATH macro in ltdl.m4 to work with the correct paths:
+func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
+
_LT_DECL([], [variables_saved_for_relink], [1],
[Variables whose values should be saved in libtool wrapper scripts and
restored at link time])
@@ -2978,7 +3139,7 @@ _LT_DECL([], [hardcode_into_libs], [0],
[Whether we should hardcode library paths into libraries])
_LT_DECL([], [sys_lib_search_path_spec], [2],
[Compile-time system search path for libraries])
-_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+_LT_DECL([sys_lib_dlsearch_path_spec], [lt_cv_sys_lib_dlsearch_path_spec], [2],
[Run-time system search path for libraries])
])# _LT_SYS_DYNAMIC_LINKER
@@ -3452,6 +3613,9 @@ sysv4 | sysv4.3*)
tpf*)
lt_cv_deplibs_check_method=pass_all
;;
+os2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
esac
])
@@ -4060,6 +4224,11 @@ m4_if([$1], [CXX], [
# (--disable-auto-import) libraries
m4_if([$1], [GCJ], [],
[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ case $host_os in
+ os2*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
+ ;;
+ esac
;;
darwin* | rhapsody*)
# PIC is the default on this platform
@@ -4379,6 +4548,11 @@ m4_if([$1], [CXX], [
# (--disable-auto-import) libraries
m4_if([$1], [GCJ], [],
[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ case $host_os in
+ os2*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
+ ;;
+ esac
;;
darwin* | rhapsody*)
@@ -4476,6 +4650,11 @@ m4_if([$1], [CXX], [
# built for inclusion in a dll (and should export symbols for example).
m4_if([$1], [GCJ], [],
[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ case $host_os in
+ os2*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
+ ;;
+ esac
;;
hpux9* | hpux10* | hpux11*)
@@ -4725,13 +4904,17 @@ m4_if([$1], [CXX], [
case $host_os in
aix[[4-9]]*)
# If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- # Also, AIX nm treats weak defined symbols like other global defined
- # symbols, whereas GNU nm marks them as "W".
+ # -C means demangle to GNU nm, but means don't demangle to AIX nm.
+ # Without the "-l" option, or with the "-B" option, AIX nm treats
+ # weak defined symbols like other global defined symbols, whereas
+ # GNU nm marks them as "W".
+ # While the 'weak' keyword is ignored in the Export File, we need
+ # it in the Import File for the 'aix-soname' feature, so we have
+ # to replace the "-B" option with "-P" for AIX nm.
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
fi
;;
pw32*)
@@ -4942,6 +5125,34 @@ _LT_EOF
_LT_TAGVAR(link_all_deplibs, $1)=yes
;;
+ os2*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ shrext_cmds=.dll
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ prefix_cmds="$SED"~
+ if test EXPORTS = "`$SED 1q $export_symbols`"; then
+ prefix_cmds="$prefix_cmds -e 1d";
+ fi~
+ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+
interix[[3-9]]*)
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
@@ -5015,6 +5226,9 @@ _LT_EOF
fi
case $cc_basename in
+ tcc*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
+ ;;
xlf* | bgf* | bgxlf* | mpixlf*)
# IBM XL Fortran 10.1 on PPC cannot create shared libs itself
_LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
@@ -5144,19 +5358,35 @@ _LT_EOF
no_entry_flag=
else
# If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- # Also, AIX nm treats weak defined symbols like other global
- # defined symbols, whereas GNU nm marks them as "W".
+ # -C means demangle to GNU nm, but means don't demangle to AIX nm.
+ # Without the "-l" option, or with the "-B" option, AIX nm treats
+ # weak defined symbols like other global defined symbols, whereas
+ # GNU nm marks them as "W".
+ # While the 'weak' keyword is ignored in the Export File, we need
+ # it in the Import File for the 'aix-soname' feature, so we have
+ # to replace the "-B" option with "-P" for AIX nm.
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
fi
aix_use_runtimelinking=no
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
+ # have runtime linking enabled, and use it for executables.
+ # For shared libraries, we enable/disable runtime linking
+ # depending on the kind of the shared library created -
+ # when "with_aix_soname,aix_use_runtimelinking" is:
+ # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
+ # "aix,yes" lib.so shared, rtl:yes, for executables
+ # lib.a static archive
+ # "both,no" lib.so.V(shr.o) shared, rtl:yes
+ # lib.a(lib.so.V) shared, rtl:no, for executables
+ # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+ # lib.a(lib.so.V) shared, rtl:no
+ # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
+ # lib.a static archive
case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
for ld_flag in $LDFLAGS; do
if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
@@ -5164,6 +5394,13 @@ _LT_EOF
break
fi
done
+ if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+ # With aix-soname=svr4, we create the lib.so.V shared archives only,
+ # so we don't have lib.a shared libs to link our executables.
+ # We have to force runtime linking in this case.
+ aix_use_runtimelinking=yes
+ LDFLAGS="$LDFLAGS -Wl,-brtl"
+ fi
;;
esac
@@ -5183,6 +5420,14 @@ _LT_EOF
_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
_LT_TAGVAR(link_all_deplibs, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='$wl-f,'
+ case $with_aix_soname,$aix_use_runtimelinking in
+ aix,*) ;; # traditional, no import file
+ svr4,* | *,yes) # use import file
+ # The Import File defines what to hardcode.
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+ ;;
+ esac
if test yes = "$GCC"; then
case $host_os in aix4.[[012]]|aix4.[[012]].*)
@@ -5210,6 +5455,11 @@ _LT_EOF
if test yes = "$aix_use_runtimelinking"; then
shared_flag="$shared_flag "'$wl-G'
fi
+ # Need to ensure runtime linking is disabled for the traditional
+ # shared library, or the linker may eventually find shared libraries
+ # /with/ Import File - we do not want to mix them.
+ shared_flag_aix='-shared'
+ shared_flag_svr4='-shared $wl-G'
else
# not using gcc
if test ia64 = "$host_cpu"; then
@@ -5222,6 +5472,8 @@ _LT_EOF
else
shared_flag='$wl-bM:SRE'
fi
+ shared_flag_aix='$wl-bM:SRE'
+ shared_flag_svr4='$wl-G'
fi
fi
@@ -5229,7 +5481,7 @@ _LT_EOF
# It seems that -bexpall does not export symbols beginning with
# underscore (_), so it is better to generate a list of symbols to export.
_LT_TAGVAR(always_export_symbols, $1)=yes
- if test yes = "$aix_use_runtimelinking"; then
+ if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
# Warning - without using the other runtime loading flags (-brtl),
# -berok will link without error, but may produce a broken library.
_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
@@ -5260,8 +5512,20 @@ _LT_EOF
_LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
fi
_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $wl-bnoentry $compiler_flags $wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+ # -brtl affects multiple linker settings, -berok does not and is overridden later
+ compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
+ if test svr4 != "$with_aix_soname"; then
+ # This is similar to how AIX traditionally builds its shared libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+ fi
+ if test aix != "$with_aix_soname"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
+ else
+ # used by -dlpreopen to get the symbols
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
+ fi
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
fi
fi
;;
@@ -5515,6 +5779,16 @@ _LT_EOF
_LT_TAGVAR(link_all_deplibs, $1)=yes
;;
+ linux*)
+ case $cc_basename in
+ tcc*)
+ # Fabrice Bellard et al's Tiny C Compiler
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
netbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
@@ -5560,8 +5834,28 @@ _LT_EOF
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
_LT_TAGVAR(hardcode_minus_L, $1)=yes
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ shrext_cmds=.dll
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ prefix_cmds="$SED"~
+ if test EXPORTS = "`$SED 1q $export_symbols`"; then
+ prefix_cmds="$prefix_cmds -e 1d";
+ fi~
+ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
;;
osf3*)
@@ -5956,8 +6250,12 @@ if test -n "$compiler"; then
;;
aix[[4-9]]*)
- if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then
- test yes = "$enable_shared" && enable_static=no
+ if test ia64 != "$host_cpu"; then
+ case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+ yes,aix,yes) ;; # shared object as lib.so file only
+ yes,svr4,*) ;; # shared object as lib.so archive member only
+ yes,*) enable_static=no ;; # shared object in lib.a archive as well
+ esac
fi
;;
esac
@@ -6145,7 +6443,19 @@ if test yes != "$_lt_caught_CXX_error"; then
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
+ # have runtime linking enabled, and use it for executables.
+ # For shared libraries, we enable/disable runtime linking
+ # depending on the kind of the shared library created -
+ # when "with_aix_soname,aix_use_runtimelinking" is:
+ # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
+ # "aix,yes" lib.so shared, rtl:yes, for executables
+ # lib.a static archive
+ # "both,no" lib.so.V(shr.o) shared, rtl:yes
+ # lib.a(lib.so.V) shared, rtl:no, for executables
+ # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+ # lib.a(lib.so.V) shared, rtl:no
+ # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
+ # lib.a static archive
case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
for ld_flag in $LDFLAGS; do
case $ld_flag in
@@ -6155,6 +6465,13 @@ if test yes != "$_lt_caught_CXX_error"; then
;;
esac
done
+ if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+ # With aix-soname=svr4, we create the lib.so.V shared archives only,
+ # so we don't have lib.a shared libs to link our executables.
+ # We have to force runtime linking in this case.
+ aix_use_runtimelinking=yes
+ LDFLAGS="$LDFLAGS -Wl,-brtl"
+ fi
;;
esac
@@ -6174,6 +6491,14 @@ if test yes != "$_lt_caught_CXX_error"; then
_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
_LT_TAGVAR(link_all_deplibs, $1)=yes
_LT_TAGVAR(file_list_spec, $1)='$wl-f,'
+ case $with_aix_soname,$aix_use_runtimelinking in
+ aix,*) ;; # no import file
+ svr4,* | *,yes) # use import file
+ # The Import File defines what to hardcode.
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+ ;;
+ esac
if test yes = "$GXX"; then
case $host_os in aix4.[[012]]|aix4.[[012]].*)
@@ -6200,6 +6525,11 @@ if test yes != "$_lt_caught_CXX_error"; then
if test yes = "$aix_use_runtimelinking"; then
shared_flag=$shared_flag' $wl-G'
fi
+ # Need to ensure runtime linking is disabled for the traditional
+ # shared library, or the linker may eventually find shared libraries
+ # /with/ Import File - we do not want to mix them.
+ shared_flag_aix='-shared'
+ shared_flag_svr4='-shared $wl-G'
else
# not using gcc
if test ia64 = "$host_cpu"; then
@@ -6212,6 +6542,8 @@ if test yes != "$_lt_caught_CXX_error"; then
else
shared_flag='$wl-bM:SRE'
fi
+ shared_flag_aix='$wl-bM:SRE'
+ shared_flag_svr4='$wl-G'
fi
fi
@@ -6220,10 +6552,11 @@ if test yes != "$_lt_caught_CXX_error"; then
# underscore (_), so it is better to generate a list of symbols to
# export.
_LT_TAGVAR(always_export_symbols, $1)=yes
- if test yes = "$aix_use_runtimelinking"; then
+ if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
# Warning - without using the other runtime loading flags (-brtl),
# -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # The "-G" linker flag allows undefined symbols.
+ _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
# Determine the default libpath from the value encoded in an empty
# executable.
_LT_SYS_MODULE_PATH_AIX([$1])
@@ -6252,9 +6585,21 @@ if test yes != "$_lt_caught_CXX_error"; then
_LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
fi
_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
- # This is similar to how AIX traditionally builds its shared
- # libraries.
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $wl-bnoentry $compiler_flags $wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+ # -brtl affects multiple linker settings, -berok does not and is overridden later
+ compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
+ if test svr4 != "$with_aix_soname"; then
+ # This is similar to how AIX traditionally builds its shared
+ # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+ fi
+ if test aix != "$with_aix_soname"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
+ else
+ # used by -dlpreopen to get the symbols
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
+ fi
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
fi
fi
;;
@@ -6354,6 +6699,34 @@ if test yes != "$_lt_caught_CXX_error"; then
_LT_DARWIN_LINKER_FEATURES($1)
;;
+ os2*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ shrext_cmds=.dll
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ prefix_cmds="$SED"~
+ if test EXPORTS = "`$SED 1q $export_symbols`"; then
+ prefix_cmds="$prefix_cmds -e 1d";
+ fi~
+ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+
dgux*)
case $cc_basename in
ec++*)
@@ -7067,6 +7440,7 @@ func_stripname_cnf ()
} # func_stripname_cnf
])# _LT_FUNC_STRIPNAME_CNF
+
# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
# ---------------------------------
# Figure out "hidden" library dependencies from verbose
@@ -7245,51 +7619,6 @@ interix[[3-9]]*)
_LT_TAGVAR(postdep_objects,$1)=
_LT_TAGVAR(postdeps,$1)=
;;
-
-linux*)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
-
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
-
- if test yes != "$solaris_use_stlport4"; then
- _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-
-solaris*)
- case $cc_basename in
- CC* | sunCC*)
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
-
- # Adding this requires a known-good setup of shared libraries for
- # Sun compiler versions before 5.6, else PIC objects from an old
- # archive will be linked into the output, leading to subtle bugs.
- if test yes != "$solaris_use_stlport4"; then
- _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
esac
])
@@ -7407,8 +7736,12 @@ if test yes != "$_lt_disable_F77"; then
fi
;;
aix[[4-9]]*)
- if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then
- test yes = "$enable_shared" && enable_static=no
+ if test ia64 != "$host_cpu"; then
+ case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+ yes,aix,yes) ;; # shared object as lib.so file only
+ yes,svr4,*) ;; # shared object as lib.so archive member only
+ yes,*) enable_static=no ;; # shared object in lib.a archive as well
+ esac
fi
;;
esac
@@ -7541,8 +7874,12 @@ if test yes != "$_lt_disable_FC"; then
fi
;;
aix[[4-9]]*)
- if test ia64 != "$host_cpu" && test no = "$aix_use_runtimelinking"; then
- test yes = "$enable_shared" && enable_static=no
+ if test ia64 != "$host_cpu"; then
+ case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+ yes,aix,yes) ;; # shared object as lib.so file only
+ yes,svr4,*) ;; # shared object as lib.so archive member only
+ yes,*) enable_static=no ;; # shared object in lib.a archive as well
+ esac
fi
;;
esac
diff --git a/extension/m4/ltoptions.m4 b/extension/m4/ltoptions.m4
index de6520ed..94b08297 100644
--- a/extension/m4/ltoptions.m4
+++ b/extension/m4/ltoptions.m4
@@ -1,6 +1,6 @@
# Helper functions for option handling. -*- Autoconf -*-
#
-# Copyright (C) 2004-2005, 2007-2009, 2011-2014 Free Software
+# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
# Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
@@ -82,6 +82,8 @@ m4_if([$1],[LT_INIT],[
_LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
_LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
[_LT_ENABLE_FAST_INSTALL])
+ _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
+ [_LT_WITH_AIX_SONAME([aix])])
])
])# _LT_SET_OPTIONS
@@ -319,6 +321,59 @@ dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+# _LT_WITH_AIX_SONAME([DEFAULT])
+# ----------------------------------
+# implement the --with-aix-soname flag, and support the `aix-soname=aix'
+# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
+# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'.
+m4_define([_LT_WITH_AIX_SONAME],
+[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
+shared_archive_member_spec=
+case $host,$enable_shared in
+power*-*-aix[[5-9]]*,yes)
+ AC_MSG_CHECKING([which variant of shared library versioning to provide])
+ AC_ARG_WITH([aix-soname],
+ [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
+ [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
+ [case $withval in
+ aix|svr4|both)
+ ;;
+ *)
+ AC_MSG_ERROR([Unknown argument to --with-aix-soname])
+ ;;
+ esac
+ lt_cv_with_aix_soname=$with_aix_soname],
+ [AC_CACHE_VAL([lt_cv_with_aix_soname],
+ [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
+ with_aix_soname=$lt_cv_with_aix_soname])
+ AC_MSG_RESULT([$with_aix_soname])
+ if test aix != "$with_aix_soname"; then
+ # For the AIX way of multilib, we name the shared archive member
+ # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
+ # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
+ # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
+ # the AIX toolchain works better with OBJECT_MODE set (default 32).
+ if test 64 = "${OBJECT_MODE-32}"; then
+ shared_archive_member_spec=shr_64
+ else
+ shared_archive_member_spec=shr
+ fi
+ fi
+ ;;
+*)
+ with_aix_soname=aix
+ ;;
+esac
+
+_LT_DECL([], [shared_archive_member_spec], [0],
+ [Shared archive member basename, for filename based shared library versioning on AIX])dnl
+])# _LT_WITH_AIX_SONAME
+
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
+
+
# _LT_WITH_PIC([MODE])
# --------------------
# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
diff --git a/extension/m4/ltsugar.m4 b/extension/m4/ltsugar.m4
index da4ac6b3..48bc9344 100644
--- a/extension/m4/ltsugar.m4
+++ b/extension/m4/ltsugar.m4
@@ -1,6 +1,6 @@
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
-# Copyright (C) 2004-2005, 2007-2008, 2011-2014 Free Software
+# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
# Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
diff --git a/extension/m4/ltversion.m4 b/extension/m4/ltversion.m4
index 3535ff40..a4c5ed43 100644
--- a/extension/m4/ltversion.m4
+++ b/extension/m4/ltversion.m4
@@ -1,6 +1,6 @@
# ltversion.m4 -- version numbers -*- Autoconf -*-
#
-# Copyright (C) 2004, 2011-2014 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004
#
# This file is free software; the Free Software Foundation gives
@@ -9,15 +9,15 @@
# @configure_input@
-# serial 4105 ltversion.m4
+# serial 4171 ltversion.m4
# This file is part of GNU Libtool
-m4_define([LT_PACKAGE_VERSION], [2.4.2.458.26-92994])
-m4_define([LT_PACKAGE_REVISION], [2.4.3])
+m4_define([LT_PACKAGE_VERSION], [2.4.5])
+m4_define([LT_PACKAGE_REVISION], [2.4.5])
AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4.2.458.26-92994'
-macro_revision='2.4.3'
+[macro_version='2.4.5'
+macro_revision='2.4.5'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])
diff --git a/extension/m4/lt~obsolete.m4 b/extension/m4/lt~obsolete.m4
index 6975098b..c6b26f88 100644
--- a/extension/m4/lt~obsolete.m4
+++ b/extension/m4/lt~obsolete.m4
@@ -1,6 +1,6 @@
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
-# Copyright (C) 2004-2005, 2007, 2009, 2011-2014 Free Software
+# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
# Foundation, Inc.
# Written by Scott James Remnant, 2004.
#
diff --git a/extension/m4/po.m4 b/extension/m4/po.m4
deleted file mode 100644
index 3c9884ba..00000000
--- a/extension/m4/po.m4
+++ /dev/null
@@ -1,449 +0,0 @@
-# po.m4 serial 17 (gettext-0.18)
-dnl Copyright (C) 1995-2010 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-dnl
-dnl This file can can be used in projects which are not available under
-dnl the GNU General Public License or the GNU Library General Public
-dnl License but which still want to provide support for the GNU gettext
-dnl functionality.
-dnl Please note that the actual code of the GNU gettext library is covered
-dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package package is covered by the GNU General Public License.
-dnl They are *not* in the public domain.
-
-dnl Authors:
-dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
-dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
-
-AC_PREREQ([2.50])
-
-dnl Checks for all prerequisites of the po subdirectory.
-AC_DEFUN([AM_PO_SUBDIRS],
-[
- AC_REQUIRE([AC_PROG_MAKE_SET])dnl
- AC_REQUIRE([AC_PROG_INSTALL])dnl
- AC_REQUIRE([AC_PROG_MKDIR_P])dnl defined by automake
- AC_REQUIRE([AM_NLS])dnl
-
- 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.18])
-
- dnl Perform the following tests also if --disable-nls has been given,
- dnl because they are needed for "make dist" to work.
-
- dnl Search for GNU msgfmt in the PATH.
- dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
- dnl The second test excludes FreeBSD msgfmt.
- AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
- [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
- (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
- :)
- AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT])
-
- 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 ;;
- esac
-changequote([,])dnl
- AC_SUBST([GMSGFMT_015])
-
- dnl Search for GNU xgettext 0.12 or newer in the PATH.
- dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
- dnl The second test excludes FreeBSD xgettext.
- AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
- [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
- (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
- :)
- dnl Remove leftover from FreeBSD xgettext call.
- rm -f messages.po
-
- dnl Test whether it is GNU xgettext >= 0.15.
-changequote(,)dnl
- case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
- '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
- *) XGETTEXT_015=$XGETTEXT ;;
- esac
-changequote([,])dnl
- AC_SUBST([XGETTEXT_015])
-
- dnl Search for GNU msgmerge 0.11 or newer in the PATH.
- AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
- [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
-
- 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=
- AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
-
- AC_CONFIG_COMMANDS([po-directories], [[
- for ac_file in $CONFIG_FILES; do
- # Support "outfile[:infile[:infile...]]"
- case "$ac_file" in
- *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- esac
- # PO directories have a Makefile.in generated from Makefile.in.in.
- case "$ac_file" in */Makefile.in)
- # Adjust a relative srcdir.
- ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
- ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
- ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
- # In autoconf-2.13 it is called $ac_given_srcdir.
- # In autoconf-2.50 it is called $srcdir.
- test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
- case "$ac_given_srcdir" in
- .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
- /*) top_srcdir="$ac_given_srcdir" ;;
- *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
- esac
- # Treat a directory as a PO directory if and only if it has a
- # POTFILES.in file. This allows packages to have multiple PO
- # directories under different names or in different locations.
- if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
- rm -f "$ac_dir/POTFILES"
- test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
- cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
- POMAKEFILEDEPS="POTFILES.in"
- # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
- # on $ac_dir but don't depend on user-specified configuration
- # parameters.
- if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
- # The LINGUAS file contains the set of available languages.
- 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"`
- # Hide the ALL_LINGUAS assigment from automake < 1.5.
- eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
- POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
- else
- # The set of available languages was given in configure.in.
- # Hide the ALL_LINGUAS assigment from automake < 1.5.
- eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
- fi
- # Compute POFILES
- # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
- # Compute UPDATEPOFILES
- # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
- # Compute DUMMYPOFILES
- # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
- # Compute GMOFILES
- # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
- case "$ac_given_srcdir" in
- .) srcdirpre= ;;
- *) srcdirpre='$(srcdir)/' ;;
- esac
- POFILES=
- UPDATEPOFILES=
- DUMMYPOFILES=
- GMOFILES=
- for lang in $ALL_LINGUAS; do
- POFILES="$POFILES $srcdirpre$lang.po"
- UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
- DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
- GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
- done
- # CATALOGS depends on both $ac_dir and the user's LINGUAS
- # environment variable.
- INST_LINGUAS=
- if test -n "$ALL_LINGUAS"; then
- for presentlang in $ALL_LINGUAS; do
- useit=no
- if test "%UNSET%" != "$LINGUAS"; then
- desiredlanguages="$LINGUAS"
- else
- desiredlanguages="$ALL_LINGUAS"
- fi
- for desiredlang in $desiredlanguages; do
- # Use the presentlang catalog if desiredlang is
- # a. equal to presentlang, or
- # b. a variant of presentlang (because in this case,
- # presentlang can be used as a fallback for messages
- # which are not translated in the desiredlang catalog).
- case "$desiredlang" in
- "$presentlang"*) useit=yes;;
- esac
- done
- if test $useit = yes; then
- INST_LINGUAS="$INST_LINGUAS $presentlang"
- fi
- done
- fi
- CATALOGS=
- if test -n "$INST_LINGUAS"; then
- for lang in $INST_LINGUAS; do
- CATALOGS="$CATALOGS $lang.gmo"
- done
- fi
- test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
- sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
- for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
- if test -f "$f"; then
- case "$f" in
- *.orig | *.bak | *~) ;;
- *) cat "$f" >> "$ac_dir/Makefile" ;;
- esac
- fi
- done
- fi
- ;;
- esac
- done]],
- [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
- # 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%}"
- ])
-])
-
-dnl Postprocesses a Makefile in a directory containing PO files.
-AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
-[
- # When this code is run, in config.status, two variables have already been
- # set:
- # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
- # - LINGUAS is the value of the environment variable LINGUAS at configure
- # time.
-
-changequote(,)dnl
- # Adjust a relative srcdir.
- ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
- ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
- ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
- # In autoconf-2.13 it is called $ac_given_srcdir.
- # In autoconf-2.50 it is called $srcdir.
- test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
- case "$ac_given_srcdir" in
- .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
- /*) top_srcdir="$ac_given_srcdir" ;;
- *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
- esac
-
- # Find a way to echo strings without interpreting backslash.
- if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
- gt_echo='echo'
- else
- if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
- gt_echo='printf %s\n'
- else
- echo_func () {
- cat <<EOT
-$*
-EOT
- }
- gt_echo='echo_func'
- fi
- fi
-
- # A sed script that extracts the value of VARIABLE from a Makefile.
- sed_x_variable='
-# Test if the hold space is empty.
-x
-s/P/P/
-x
-ta
-# Yes it was empty. Look if we have the expected variable definition.
-/^[ ]*VARIABLE[ ]*=/{
- # Seen the first line of the variable definition.
- s/^[ ]*VARIABLE[ ]*=//
- ba
-}
-bd
-:a
-# Here we are processing a line from the variable definition.
-# Remove comment, more precisely replace it with a space.
-s/#.*$/ /
-# See if the line ends in a backslash.
-tb
-:b
-s/\\$//
-# Print the line, without the trailing backslash.
-p
-tc
-# There was no trailing backslash. The end of the variable definition is
-# reached. Clear the hold space.
-s/^.*$//
-x
-bd
-:c
-# A trailing backslash means that the variable definition continues in the
-# next line. Put a nonempty string into the hold space to indicate this.
-s/^.*$/P/
-x
-:d
-'
-changequote([,])dnl
-
- # Set POTFILES to the value of the Makefile variable POTFILES.
- sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
- POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
- # Compute POTFILES_DEPS as
- # $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
- POTFILES_DEPS=
- for file in $POTFILES; do
- POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
- done
- POMAKEFILEDEPS=""
-
- 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
- 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"`
- 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"`
- fi
- # Hide the ALL_LINGUAS assigment from automake < 1.5.
- eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
- # Compute POFILES
- # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
- # Compute UPDATEPOFILES
- # as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
- # Compute DUMMYPOFILES
- # as $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
- # Compute GMOFILES
- # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
- # Compute PROPERTIESFILES
- # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
- # Compute CLASSFILES
- # as $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
- # Compute QMFILES
- # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
- # Compute MSGFILES
- # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
- # Compute RESOURCESDLLFILES
- # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
- case "$ac_given_srcdir" in
- .) srcdirpre= ;;
- *) srcdirpre='$(srcdir)/' ;;
- esac
- POFILES=
- UPDATEPOFILES=
- DUMMYPOFILES=
- GMOFILES=
- PROPERTIESFILES=
- CLASSFILES=
- QMFILES=
- MSGFILES=
- RESOURCESDLLFILES=
- for lang in $ALL_LINGUAS; do
- POFILES="$POFILES $srcdirpre$lang.po"
- UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
- DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
- GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
- 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"
- frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
- RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
- done
- # CATALOGS depends on both $ac_dir and the user's LINGUAS
- # environment variable.
- INST_LINGUAS=
- if test -n "$ALL_LINGUAS"; then
- for presentlang in $ALL_LINGUAS; do
- useit=no
- if test "%UNSET%" != "$LINGUAS"; then
- desiredlanguages="$LINGUAS"
- else
- desiredlanguages="$ALL_LINGUAS"
- fi
- for desiredlang in $desiredlanguages; do
- # Use the presentlang catalog if desiredlang is
- # a. equal to presentlang, or
- # b. a variant of presentlang (because in this case,
- # presentlang can be used as a fallback for messages
- # which are not translated in the desiredlang catalog).
- case "$desiredlang" in
- "$presentlang"*) useit=yes;;
- esac
- done
- if test $useit = yes; then
- INST_LINGUAS="$INST_LINGUAS $presentlang"
- fi
- done
- fi
- CATALOGS=
- JAVACATALOGS=
- QTCATALOGS=
- TCLCATALOGS=
- CSHARPCATALOGS=
- if test -n "$INST_LINGUAS"; then
- for lang in $INST_LINGUAS; do
- CATALOGS="$CATALOGS $lang.gmo"
- JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
- QTCATALOGS="$QTCATALOGS $lang.qm"
- frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
- TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
- frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
- CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
- done
- fi
-
- sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
- if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
- # Add dependencies that cannot be formulated as a simple suffix rule.
- for lang in $ALL_LINGUAS; do
- frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
- cat >> "$ac_file.tmp" <<EOF
-$frobbedlang.msg: $lang.po
- @echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
- \$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
-EOF
- done
- fi
- if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
- # Add dependencies that cannot be formulated as a simple suffix rule.
- for lang in $ALL_LINGUAS; do
- frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
- cat >> "$ac_file.tmp" <<EOF
-$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
- @echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
- \$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
-EOF
- done
- fi
- if test -n "$POMAKEFILEDEPS"; then
- cat >> "$ac_file.tmp" <<EOF
-Makefile: $POMAKEFILEDEPS
-EOF
- fi
- mv "$ac_file.tmp" "$ac_file"
-])
-
-dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
-AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
-[
- XGETTEXT_EXTRA_OPTIONS=
-])
-
-dnl Registers an option to be passed to xgettext in the po subdirectory.
-AC_DEFUN([AM_XGETTEXT_OPTION],
-[
- AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
- XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
-])
diff --git a/extras/Makefile.in b/extras/Makefile.in
index f6416f56..f6741221 100644
--- a/extras/Makefile.in
+++ b/extras/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -38,7 +38,17 @@
#
VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -102,8 +112,6 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = extras
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/mkinstalldirs ChangeLog
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
$(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/gettext.m4 \
@@ -118,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
$(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@@ -171,6 +180,8 @@ am__uninstall_files_from_dir = { \
am__installdirs = "$(DESTDIR)$(profiledir)"
DATA = $(profile_DATA)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs \
+ ChangeLog
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@@ -317,7 +328,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu extras/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu extras/Makefile
-.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@@ -510,6 +520,8 @@ uninstall-am: uninstall-profileDATA
pdf-am ps ps-am tags-am uninstall uninstall-am \
uninstall-profileDATA
+.PRECIOUS: Makefile
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/install-sh b/install-sh
index 04367377..0b0fdcbb 100755
--- a/install-sh
+++ b/install-sh
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2013-10-30.23; # UTC
+scriptversion=2013-12-25.23; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -82,7 +82,7 @@ dir_arg=
dst_arg=
copy_on_change=false
-no_target_directory=
+is_target_a_directory=possibly
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
@@ -139,14 +139,16 @@ while test $# -ne 0; do
-s) stripcmd=$stripprog;;
- -t) dst_arg=$2
+ -t)
+ is_target_a_directory=always
+ dst_arg=$2
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
- -T) no_target_directory=true;;
+ -T) is_target_a_directory=never;;
--version) echo "$0 $scriptversion"; exit $?;;
@@ -161,6 +163,16 @@ while test $# -ne 0; do
shift
done
+# We allow the use of options -d and -T together, by making -d
+# take the precedence; this is for compatibility with GNU install.
+
+if test -n "$dir_arg"; then
+ if test -n "$dst_arg"; then
+ echo "$0: target directory not allowed when installing a directory." >&2
+ exit 1
+ fi
+fi
+
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
@@ -192,6 +204,15 @@ if test $# -eq 0; then
fi
if test -z "$dir_arg"; then
+ if test $# -gt 1 || test "$is_target_a_directory" = always; then
+ if test ! -d "$dst_arg"; then
+ echo "$0: $dst_arg: Is not a directory." >&2
+ exit 1
+ fi
+ fi
+fi
+
+if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
@@ -253,7 +274,7 @@ do
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
- if test -n "$no_target_directory"; then
+ if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
diff --git a/m4/ChangeLog b/m4/ChangeLog
index 9ef76c4f..41febbdd 100644
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,3 +1,8 @@
+2015-01-24 gettextize <bug-gnu-gettext@gnu.org>
+
+ * iconv.m4: Upgrade to gettext-0.19.4.
+ * po.m4: Upgrade to gettext-0.19.4.
+
2014-11-19 gettextize <bug-gnu-gettext@gnu.org>
* gettext.m4: Upgrade to gettext-0.19.3.
diff --git a/m4/iconv.m4 b/m4/iconv.m4
index 4b29c5f2..4e373631 100644
--- a/m4/iconv.m4
+++ b/m4/iconv.m4
@@ -1,4 +1,4 @@
-# iconv.m4 serial 18 (gettext-0.18.2)
+# iconv.m4 serial 19 (gettext-0.18.2)
dnl Copyright (C) 2000-2002, 2007-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,
@@ -72,27 +72,33 @@ AC_DEFUN([AM_ICONV_LINK],
if test $am_cv_lib_iconv = yes; then
LIBS="$LIBS $LIBICONV"
fi
- AC_RUN_IFELSE(
- [AC_LANG_SOURCE([[
+ am_cv_func_iconv_works=no
+ for ac_iconv_const in '' 'const'; do
+ AC_RUN_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
#include <iconv.h>
#include <string.h>
-int main ()
-{
- int result = 0;
+
+#ifndef ICONV_CONST
+# define ICONV_CONST $ac_iconv_const
+#endif
+ ]],
+ [[int result = 0;
/* Test against AIX 5.1 bug: Failures are not distinguishable from successful
returns. */
{
iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
if (cd_utf8_to_88591 != (iconv_t)(-1))
{
- static const char input[] = "\342\202\254"; /* EURO SIGN */
+ static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
char buf[10];
- const char *inptr = input;
+ ICONV_CONST char *inptr = input;
size_t inbytesleft = strlen (input);
char *outptr = buf;
size_t outbytesleft = sizeof (buf);
size_t res = iconv (cd_utf8_to_88591,
- (char **) &inptr, &inbytesleft,
+ &inptr, &inbytesleft,
&outptr, &outbytesleft);
if (res == 0)
result |= 1;
@@ -105,14 +111,14 @@ int main ()
iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
if (cd_ascii_to_88591 != (iconv_t)(-1))
{
- static const char input[] = "\263";
+ static ICONV_CONST char input[] = "\263";
char buf[10];
- const char *inptr = input;
+ ICONV_CONST char *inptr = input;
size_t inbytesleft = strlen (input);
char *outptr = buf;
size_t outbytesleft = sizeof (buf);
size_t res = iconv (cd_ascii_to_88591,
- (char **) &inptr, &inbytesleft,
+ &inptr, &inbytesleft,
&outptr, &outbytesleft);
if (res == 0)
result |= 2;
@@ -124,14 +130,14 @@ int main ()
iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
if (cd_88591_to_utf8 != (iconv_t)(-1))
{
- static const char input[] = "\304";
+ static ICONV_CONST char input[] = "\304";
static char buf[2] = { (char)0xDE, (char)0xAD };
- const char *inptr = input;
+ ICONV_CONST char *inptr = input;
size_t inbytesleft = 1;
char *outptr = buf;
size_t outbytesleft = 1;
size_t res = iconv (cd_88591_to_utf8,
- (char **) &inptr, &inbytesleft,
+ &inptr, &inbytesleft,
&outptr, &outbytesleft);
if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
result |= 4;
@@ -144,14 +150,14 @@ int main ()
iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
if (cd_88591_to_utf8 != (iconv_t)(-1))
{
- static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+ static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
char buf[50];
- const char *inptr = input;
+ ICONV_CONST char *inptr = input;
size_t inbytesleft = strlen (input);
char *outptr = buf;
size_t outbytesleft = sizeof (buf);
size_t res = iconv (cd_88591_to_utf8,
- (char **) &inptr, &inbytesleft,
+ &inptr, &inbytesleft,
&outptr, &outbytesleft);
if ((int)res > 0)
result |= 8;
@@ -171,17 +177,14 @@ int main ()
&& iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
result |= 16;
return result;
-}]])],
- [am_cv_func_iconv_works=yes],
- [am_cv_func_iconv_works=no],
- [
-changequote(,)dnl
- case "$host_os" in
- aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
- *) am_cv_func_iconv_works="guessing yes" ;;
- esac
-changequote([,])dnl
- ])
+]])],
+ [am_cv_func_iconv_works=yes], ,
+ [case "$host_os" in
+ aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
+ *) am_cv_func_iconv_works="guessing yes" ;;
+ esac])
+ test "$am_cv_func_iconv_works" = no || break
+ done
LIBS="$am_save_LIBS"
])
case "$am_cv_func_iconv_works" in
diff --git a/m4/po.m4 b/m4/po.m4
index 84659ea5..43012dca 100644
--- a/m4/po.m4
+++ b/m4/po.m4
@@ -1,4 +1,4 @@
-# po.m4 serial 22 (gettext-0.19)
+# 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,
diff --git a/missing b/missing
index cdea5149..f62bbae3 100755
--- a/missing
+++ b/missing
@@ -1,9 +1,9 @@
#! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
-scriptversion=2012-06-26.16; # UTC
+scriptversion=2013-10-28.13; # UTC
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
@@ -160,7 +160,7 @@ give_advice ()
;;
autom4te*)
echo "You might have modified some maintainer files that require"
- echo "the 'automa4te' program to be rebuilt."
+ echo "the 'autom4te' program to be rebuilt."
program_details 'autom4te'
;;
bison*|yacc*)
diff --git a/po/ChangeLog b/po/ChangeLog
index 022e5326..3ef4175b 100644
--- a/po/ChangeLog
+++ b/po/ChangeLog
@@ -1,3 +1,7 @@
+2015-01-24 Arnold D. Robbins <arnold@skeeve.com>
+
+ * POTFILES.in: Brought up to date.
+
2014-11-19 gettextize <bug-gnu-gettext@gnu.org>
* Makefile.in.in: Upgrade to gettext-0.19.3.
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 63461e76..0781efc1 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -13,11 +13,17 @@ ext.c
extension/filefuncs.c
extension/fnmatch.c
extension/fork.c
+extension/gawkfts.c
extension/inplace.c
extension/ordchr.c
extension/readdir.c
extension/readfile.c
+extension/revoutput.c
+extension/revtwoway.c
extension/rwarray.c
+extension/rwarray0.c
+extension/stack.c
+extension/testext.c
extension/time.c
field.c
floatcomp.c
diff --git a/symbol.c b/symbol.c
index 23e04c03..552c111e 100644
--- a/symbol.c
+++ b/symbol.c
@@ -625,6 +625,61 @@ load_symbols()
unref(array);
}
+/* check_param_names --- make sure no parameter is the name of a function */
+
+bool
+check_param_names(void)
+{
+ int i, j, k;
+ NODE **list;
+ NODE *f;
+ long max;
+ bool result = true;
+
+ max = func_table->table_size * 2;
+
+ /*
+ * assoc_list() returns an array with two elements per awk array
+ * element. Elements i and i+1 in the C array represent the key
+ * and value of element j in the awk array. Thus the loops use += 2
+ * to go through the awk array.
+ *
+ * In this case, the name is in list[i], and the function is
+ * in list[i+1]. Just what we need.
+ */
+
+ list = assoc_list(func_table, "@unsorted", ASORTI);
+
+ /*
+ * You want linear searches?
+ * Have we got linear searches!
+ */
+ for (i = 0; i < max; i += 2) {
+ f = list[i+1];
+ if (f->type == Node_builtin_func || f->param_cnt == 0)
+ continue;
+
+ /* loop over each param in function i */
+ for (j = 0; j < f->param_cnt; j++) {
+ /* compare to function names */
+ for (k = 0; k < max; k += 2) {
+ if (k == i)
+ continue;
+ if (strcmp(f->fparms[j].param, list[k]->stptr) == 0) {
+ error(
+ _("function `%s': can't use function `%s' as a parameter name"),
+ list[i]->stptr,
+ list[k]->stptr);
+ result = false;
+ }
+ }
+ }
+ }
+
+ efree(list);
+ return result;
+}
+
#define pool_size d.dl
#define freei x.xi
static INSTRUCTION *pool_list;
diff --git a/test/ChangeLog b/test/ChangeLog
index c859a7bb..2bcbc6ea 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,11 @@
+2015-01-30 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.in (callparam, paramasfunc1, paramasfunc2): New tests.
+ * callparam.awk, callparam.ok: New files.
+ * paramasfunc1.awk, paramasfunc1.ok: New files.
+ * paramasfunc2.awk, paramasfunc2.ok: New files.
+ * exit.sh, indirectcall.awk: Update after code change.
+
2015-01-19 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (profile8): Actually add the test and the files.
diff --git a/test/Makefile.am b/test/Makefile.am
index 438efd93..d5f9b002 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -132,6 +132,8 @@ EXTRA_DIST = \
beginfile2.ok \
beginfile2.sh \
binmode1.ok \
+ callparam.awk \
+ callparam.ok \
charasbytes.awk \
charasbytes.in \
charasbytes.ok \
@@ -649,6 +651,10 @@ EXTRA_DIST = \
out1.ok \
out2.ok \
out3.ok \
+ paramasfunc1.awk \
+ paramasfunc1.ok \
+ paramasfunc2.awk \
+ paramasfunc2.ok \
paramdup.awk \
paramdup.ok \
paramres.awk \
@@ -996,7 +1002,7 @@ BASIC_TESTS = \
arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \
aryprm8 arysubnm asgext awkpath \
back89 backgsub badassign1 badbuild \
- childin clobber closebad clsflnam compare compare2 concat1 concat2 \
+ callparam childin clobber closebad clsflnam compare compare2 concat1 concat2 \
concat3 concat4 convfmt \
datanonl defref delargv delarpm2 delarprm delfunc dfamb1 dfastress dynlj \
eofsplit exit2 exitval1 exitval2 \
@@ -1014,6 +1020,7 @@ BASIC_TESTS = \
nlinstr nlstrina noeffect nofile nofmtch noloop1 noloop2 nonl \
noparms nors nulrsend numindex numsubstr \
octsub ofmt ofmta ofmtbig ofmtfidl ofmts ofs1 onlynl opasnidx opasnslf \
+ paramasfunc1 paramasfunc2 \
paramdup paramres paramtyp paramuninitglobal parse1 parsefld parseme \
pcntplus posix2008sub prdupval prec printf0 printf1 prmarscl prmreuse \
prt1eval prtoeval \
diff --git a/test/Makefile.in b/test/Makefile.in
index e6abf971..b90c3e73 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -37,7 +37,17 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -100,9 +110,6 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-DIST_COMMON = $(srcdir)/Maketests $(srcdir)/Makefile.in \
- $(srcdir)/Makefile.am $(top_srcdir)/mkinstalldirs ChangeLog \
- README
subdir = test
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
@@ -118,6 +125,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/arch.m4 \
$(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@@ -142,6 +150,8 @@ am__can_run_installinfo = \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Maketests \
+ $(top_srcdir)/mkinstalldirs ChangeLog README
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@@ -379,6 +389,8 @@ EXTRA_DIST = \
beginfile2.ok \
beginfile2.sh \
binmode1.ok \
+ callparam.awk \
+ callparam.ok \
charasbytes.awk \
charasbytes.in \
charasbytes.ok \
@@ -896,6 +908,10 @@ EXTRA_DIST = \
out1.ok \
out2.ok \
out3.ok \
+ paramasfunc1.awk \
+ paramasfunc1.ok \
+ paramasfunc2.awk \
+ paramasfunc2.ok \
paramdup.awk \
paramdup.ok \
paramres.awk \
@@ -1242,7 +1258,7 @@ BASIC_TESTS = \
arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \
aryprm8 arysubnm asgext awkpath \
back89 backgsub badassign1 badbuild \
- childin clobber closebad clsflnam compare compare2 concat1 concat2 \
+ callparam childin clobber closebad clsflnam compare compare2 concat1 concat2 \
concat3 concat4 convfmt \
datanonl defref delargv delarpm2 delarprm delfunc dfamb1 dfastress dynlj \
eofsplit exit2 exitval1 exitval2 \
@@ -1260,6 +1276,7 @@ BASIC_TESTS = \
nlinstr nlstrina noeffect nofile nofmtch noloop1 noloop2 nonl \
noparms nors nulrsend numindex numsubstr \
octsub ofmt ofmta ofmtbig ofmtfidl ofmts ofs1 onlynl opasnidx opasnslf \
+ paramasfunc1 paramasfunc2 \
paramdup paramres paramtyp paramuninitglobal parse1 parsefld parseme \
pcntplus posix2008sub prdupval prec printf0 printf1 prmarscl prmreuse \
prt1eval prtoeval \
@@ -1371,7 +1388,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/Maketests $(am__configur
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu test/Makefile
-.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@@ -1380,6 +1396,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
+$(srcdir)/Maketests $(am__empty):
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
@@ -1538,6 +1555,8 @@ uninstall-am:
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
pdf-am ps ps-am tags-am uninstall uninstall-am
+.PRECIOUS: Makefile
+
# Message stuff is to make it a little easier to follow.
# Make the pass-fail last and dependent on others to avoid
@@ -2599,6 +2618,11 @@ badbuild:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+callparam:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
childin:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@@ -3069,6 +3093,16 @@ opasnslf:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+paramasfunc1:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+paramasfunc2:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
paramdup:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index be10addd..5368195b 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -130,6 +130,11 @@ badbuild:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+callparam:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
childin:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@@ -600,6 +605,16 @@ opasnslf:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+paramasfunc1:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+paramasfunc2:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
paramdup:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/callparam.awk b/test/callparam.awk
new file mode 100644
index 00000000..b925db01
--- /dev/null
+++ b/test/callparam.awk
@@ -0,0 +1,6 @@
+BEGIN { f() }
+
+function f( a, b)
+{
+ a = b()
+}
diff --git a/test/callparam.ok b/test/callparam.ok
new file mode 100644
index 00000000..00a027e8
--- /dev/null
+++ b/test/callparam.ok
@@ -0,0 +1,2 @@
+gawk: callparam.awk:5: error: attempt to use non-function `b' in function call
+EXIT CODE: 1
diff --git a/test/exit.sh b/test/exit.sh
index 9510dcdc..3922f83c 100755
--- a/test/exit.sh
+++ b/test/exit.sh
@@ -30,7 +30,7 @@ x='function f(){ exit}; BEGINFILE {f()}; NR>1{ f()}; END{print NR}'
$AWK 'BEGIN { print "a\nb" }' | $AWK "$x"
echo "-- 5"
-y='function strip(f) { sub(/.*\//, "", f); return f };'
+y='function strip(val) { sub(/.*\//, "", val); return val };'
x='BEGINFILE{if(++i==1) exit;}; END{print i, strip(FILENAME)}'
$AWK "$y$x" /dev/null $0
diff --git a/test/indirectcall.awk b/test/indirectcall.awk
index 5cfdd235..74290973 100644
--- a/test/indirectcall.awk
+++ b/test/indirectcall.awk
@@ -5,13 +5,13 @@
# average --- return the average of the values in fields $first - $last
-function average(first, last, sum, i)
+function average(first, last, the_sum, i)
{
- sum = 0;
+ the_sum = 0;
for (i = first; i <= last; i++)
- sum += $i
+ the_sum += $i
- return sum / (last - first + 1)
+ return the_sum / (last - first + 1)
}
# sum --- return the average of the values in fields $first - $last
diff --git a/test/paramasfunc1.awk b/test/paramasfunc1.awk
new file mode 100644
index 00000000..b0d06849
--- /dev/null
+++ b/test/paramasfunc1.awk
@@ -0,0 +1,9 @@
+BEGIN{ X() }
+
+function X( abc)
+{
+ abc = "stamp out "
+ print abc abc()
+}
+
+function abc() { return "dark corners" }
diff --git a/test/paramasfunc1.ok b/test/paramasfunc1.ok
new file mode 100644
index 00000000..9ee95116
--- /dev/null
+++ b/test/paramasfunc1.ok
@@ -0,0 +1,3 @@
+gawk: paramasfunc1.awk:6: error: attempt to use non-function `abc' in function call
+gawk: error: function `X': can't use function `abc' as a parameter name
+EXIT CODE: 1
diff --git a/test/paramasfunc2.awk b/test/paramasfunc2.awk
new file mode 100644
index 00000000..849b3d1b
--- /dev/null
+++ b/test/paramasfunc2.awk
@@ -0,0 +1,10 @@
+BEGIN{ X() }
+
+function abc() { return "dark corners" }
+
+function X( abc)
+{
+ abc = "stamp out "
+ print abc abc()
+}
+
diff --git a/test/paramasfunc2.ok b/test/paramasfunc2.ok
new file mode 100644
index 00000000..2cdf4f66
--- /dev/null
+++ b/test/paramasfunc2.ok
@@ -0,0 +1,3 @@
+gawk: paramasfunc2.awk:8: error: attempt to use non-function `abc' in function call
+gawk: error: function `X': can't use function `abc' as a parameter name
+EXIT CODE: 1
diff --git a/ylwrap b/ylwrap
index 7befa46d..7c2d927f 100755
--- a/ylwrap
+++ b/ylwrap
@@ -1,9 +1,9 @@
#! /bin/sh
# ylwrap - wrapper for lex/yacc invocations.
-scriptversion=2012-07-14.08; # UTC
+scriptversion=2013-01-12.17; # UTC
-# Copyright (C) 1996-2012 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
#
# Written by Tom Tromey <tromey@cygnus.com>.
#
@@ -40,12 +40,13 @@ get_dirname ()
# guard FILE
# ----------
# The CPP macro used to guard inclusion of FILE.
-guard()
+guard ()
{
- printf '%s\n' "$from" \
- | sed \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
- -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'
+ printf '%s\n' "$1" \
+ | sed \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
+ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g' \
+ -e 's/__*/_/g'
}
# quote_for_sed [STRING]
@@ -95,17 +96,17 @@ esac
# The input.
-input="$1"
+input=$1
shift
# We'll later need for a correct munging of "#line" directives.
input_sub_rx=`get_dirname "$input" | quote_for_sed`
-case "$input" in
+case $input in
[\\/]* | ?:[\\/]*)
# Absolute path; do nothing.
;;
*)
# Relative path. Make it absolute.
- input="`pwd`/$input"
+ input=`pwd`/$input
;;
esac
input_rx=`get_dirname "$input" | quote_for_sed`
@@ -121,12 +122,18 @@ fi
# The parser itself, the first file, is the destination of the .y.c
# rule in the Makefile.
parser=$1
+
# A sed program to s/FROM/TO/g for all the FROM/TO so that, for
# instance, we rename #include "y.tab.h" into #include "parse.h"
# during the conversion from y.tab.c to parse.c.
-rename_sed=
-while test "$#" -ne 0; do
- if test "$1" = "--"; then
+sed_fix_filenames=
+
+# Also rename header guards, as Bison 2.7 for instance uses its header
+# guard in its implementation file.
+sed_fix_header_guards=
+
+while test $# -ne 0; do
+ if test x"$1" = x"--"; then
shift
break
fi
@@ -141,20 +148,19 @@ while test "$#" -ne 0; do
shift
to=$1
shift
- rename_sed="${rename_sed}s|"`quote_for_sed "$from"`"|$to|g;"
+ sed_fix_filenames="${sed_fix_filenames}s|"`quote_for_sed "$from"`"|$to|g;"
+ sed_fix_header_guards="${sed_fix_header_guards}s|"`guard "$from"`"|"`guard "$to"`"|g;"
done
# The program to run.
-prog="$1"
+prog=$1
shift
# Make any relative path in $prog absolute.
-case "$prog" in
+case $prog in
[\\/]* | ?:[\\/]*) ;;
- *[\\/]*) prog="`pwd`/$prog" ;;
+ *[\\/]*) prog=`pwd`/$prog ;;
esac
-# FIXME: add hostname here for parallel makes that run commands on
-# other machines. But that might take us over the 14-char limit.
dirname=ylwrap$$
do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
@@ -174,13 +180,13 @@ ret=$?
if test $ret -eq 0; then
for from in *
do
- to=`printf '%s\n' "$from" | sed "$rename_sed"`
+ to=`printf '%s\n' "$from" | sed "$sed_fix_filenames"`
if test -f "$from"; then
# If $2 is an absolute path name, then just use that,
# otherwise prepend '../'.
case $to in
[\\/]* | ?:[\\/]*) target=$to;;
- *) target="../$to";;
+ *) target=../$to;;
esac
# Do not overwrite unchanged header files to avoid useless
@@ -189,7 +195,7 @@ if test $ret -eq 0; then
# output of all other files to a temporary file so we can
# compare them to existing versions.
if test $from != $parser; then
- realtarget="$target"
+ realtarget=$target
target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'`
fi
@@ -197,10 +203,11 @@ if test $ret -eq 0; then
# debug information point at an absolute srcdir. Use the real
# output file name, not yy.lex.c for instance. Adjust the
# include guards too.
- FROM=`guard "$from"`
- TARGET=`guard "$to"`
- sed -e "/^#/!b" -e "s|$input_rx|$input_sub_rx|" -e "$rename_sed" \
- -e "s|$FROM|$TARGET|" "$from" >"$target" || ret=$?
+ sed -e "/^#/!b" \
+ -e "s|$input_rx|$input_sub_rx|" \
+ -e "$sed_fix_filenames" \
+ -e "$sed_fix_header_guards" \
+ "$from" >"$target" || ret=$?
# Check whether files must be updated.
if test "$from" != "$parser"; then